decocms 4.538.0 → 4.538.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-BAkVUwUO.js → ActiveShapeUtils-CFnSXQrP.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-GiWY14UJ.js → AlertCircle-Ds_2WhXL.js} +1 -1
  3. package/dist/client/assets/{AreaChart-Dci3EK3c.js → AreaChart-nWCoaPwi.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-Dm1DOIO_.js → ArrowLeft-GaJGcGPr.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DmZqFHxG.js → ArrowUp-Ve1cK4qn.js} +1 -1
  6. package/dist/client/assets/{BarChart-BjaeNt4p.js → BarChart-Dcp2-buy.js} +1 -1
  7. package/dist/client/assets/{Building02-BIDOqlzR.js → Building02-Cf4X-d51.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-CB8wC0a9.js → CartesianChart-DBuztnGc.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-BA1mz10K.js → CategoricalChart-BmgZ7uPj.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-XFmpER2C.js → CheckCircle-D7olxQBc.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BB7VHQ8R.js → ChevronSelectorVertical-ByzlNFqX.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-BOBhKnkD.js → ChevronUp-zgLSJo7N.js} +1 -1
  13. package/dist/client/assets/{Copy01-CNd4Y0N1.js → Copy01-BzoMFIdk.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-12Md4Si9.js → CreditCard01-DqirQppZ.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-PMMJbcO3.js → DotsVertical-DkVpKTIv.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-B2VOr3wa.js → ErrorBarContext-vyTaVMu4.js} +1 -1
  17. package/dist/client/assets/{Globe04-CGU-JbvL.js → Globe04-CkFRv0Y2.js} +1 -1
  18. package/dist/client/assets/{Image01-W4iMjF9I.js → Image01-DqO4SvqB.js} +1 -1
  19. package/dist/client/assets/{Key01-BYK94S-D.js → Key01-DWe6k94t.js} +1 -1
  20. package/dist/client/assets/{Link01-B2ZgpsAH.js → Link01-3o9Elk03.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-BIEHba-f.js → LinkBroken01-DRUa5XT1.js} +1 -1
  22. package/dist/client/assets/{Minus-7M5sAhSA.js → Minus-kzkj_29B.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Dbk8mjTp.js → Monitor01-is8ZyUQC.js} +1 -1
  24. package/dist/client/assets/{Play-BbRDkLyq.js → Play-CjXmtBKS.js} +1 -1
  25. package/dist/client/assets/{Plus-DdEst5EN.js → Plus-DCMQMI-9.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-BsJ5BUHq.js → ReferenceLine-BJ-vDTSh.js} +1 -1
  27. package/dist/client/assets/{SearchMd-tzLrT0kr.js → SearchMd-BPcibh2b.js} +1 -1
  28. package/dist/client/assets/{Sector--uekcoiH.js → Sector-BBrsL2eG.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-qJGLHlTH.js → ShoppingBag01-Bqi9yZ2c.js} +1 -1
  30. package/dist/client/assets/{Sun-D-KTUfZy.js → Sun-ChTfaRFO.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01--A00BMas.js → SwitchHorizontal01-vlFzntYK.js} +1 -1
  32. package/dist/client/assets/{Tool01-CkZ1DNSP.js → Tool01-D_DzUkH6.js} +1 -1
  33. package/dist/client/assets/{Trash01-CbJGwAlq.js → Trash01-D5WxxfhG.js} +1 -1
  34. package/dist/client/assets/{Upload01-DjD3JGRn.js → Upload01-CCpxUc0U.js} +1 -1
  35. package/dist/client/assets/{UserSquare-ynyjvlRU.js → UserSquare-BpdCC6Kq.js} +1 -1
  36. package/dist/client/assets/{Users01-DdZpwbA5.js → Users01-BewLilnR.js} +1 -1
  37. package/dist/client/assets/{XClose-DceAPqwG.js → XClose-CBoBcHI9.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-CdHfy3Ql.js → ZoomOut-UKDGw6yq.js} +1 -1
  39. package/dist/client/assets/{access-gate-DJuyzn-i.js → access-gate-B5lnrNp3.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-C1MwBP_r.js → add-connection-dialog-C5Y_DQIe.js} +1 -1
  41. package/dist/client/assets/{agent-analytics-dfXX1cU0.js → agent-analytics-CrWuxji2.js} +1 -1
  42. package/dist/client/assets/agent-app-B8g7HXCG.js +1 -0
  43. package/dist/client/assets/{agent-assets-CyRSmalt.js → agent-assets-CjCohDd1.js} +1 -1
  44. package/dist/client/assets/{agent-automation-CJd8wY6G.js → agent-automation-Cw1vupSq.js} +1 -1
  45. package/dist/client/assets/{agent-automations-D6Adafc6.js → agent-automations-DADyH9LU.js} +1 -1
  46. package/dist/client/assets/{agent-calendar-Cv3ib5K3.js → agent-calendar-BpnS1B-Q.js} +1 -1
  47. package/dist/client/assets/{agent-connect-sources-DHBUa3O2.js → agent-connect-sources-BUtEOOEi.js} +1 -1
  48. package/dist/client/assets/agent-deck-BjW3Z3s-.js +1 -0
  49. package/dist/client/assets/{agent-e2e-VKi-AtE0.js → agent-e2e-BhriQdAN.js} +1 -1
  50. package/dist/client/assets/agent-experiments-Dr_m9GDA.js +1 -0
  51. package/dist/client/assets/{agent-file-DZcooBP1.js → agent-file-GsiMJmdT.js} +1 -1
  52. package/dist/client/assets/{agent-hosting-B7r4qgUV.js → agent-hosting-3IKxPqmX.js} +1 -1
  53. package/dist/client/assets/{agent-icon-gy5gO-IG.js → agent-icon-CXyyqpMa.js} +1 -1
  54. package/dist/client/assets/agent-library-4NnJCrl7.js +1 -0
  55. package/dist/client/assets/agent-library-file-wOie6wjv.js +1 -0
  56. package/dist/client/assets/agent-monitor-D93cGiV4.js +1 -0
  57. package/dist/client/assets/{agent-overview-d81QkJ3q.js → agent-overview-B5PvLXFR.js} +1 -1
  58. package/dist/client/assets/{agent-releases-BZ3IyOFH.js → agent-releases-bMsZ5yQZ.js} +1 -1
  59. package/dist/client/assets/agent-settings-0mcQwgqo.js +1 -0
  60. package/dist/client/assets/{agent-site-editor-CCwQiTOn.js → agent-site-editor-DN3KRvIk.js} +1 -1
  61. package/dist/client/assets/agent-site-editor-code-BQblA5PP.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-CzD7r_8-.js +1 -0
  63. package/dist/client/assets/agent-site-editor-preview-C0fyF2la.js +1 -0
  64. package/dist/client/assets/agent-view-BqQguXfW.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-DZoYULDN.js → agent-view-guard-z90QrYwh.js} +1 -1
  66. package/dist/client/assets/{agents-list-DbBurDms.js → agents-list-DSXkyPRk.js} +1 -1
  67. package/dist/client/assets/{ai-providers-_rRUHcQ7.js → ai-providers-BbOFlSCp.js} +1 -1
  68. package/dist/client/assets/{alert-DvVSGyF3.js → alert-DtgstSU8.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-NE_bzeJg.js → analytics-sections-u74BlDgr.js} +1 -1
  70. package/dist/client/assets/api-keys-C3Yfrg07.js +1 -0
  71. package/dist/client/assets/{api-keys-ahow6ILL.js → api-keys-CH40x9b5.js} +1 -1
  72. package/dist/client/assets/{app-editor-B3KQDcRV.js → app-editor-lpYZsEpK.js} +1 -1
  73. package/dist/client/assets/{asset-utils-DHO8iK1b.js → asset-utils-D4yG02dq.js} +1 -1
  74. package/dist/client/assets/{auth-BaDT9x77.js → auth-BdHhBAFh.js} +1 -1
  75. package/dist/client/assets/{auth-catchall-DjY3AfiL.js → auth-catchall-GYBtR3ic.js} +1 -1
  76. package/dist/client/assets/{auth-entry-CdkNSgrh.js → auth-entry-CfOxikcY.js} +1 -1
  77. package/dist/client/assets/{auth-split-layout-j0u9Y9VH.js → auth-split-layout-D4alojNr.js} +1 -1
  78. package/dist/client/assets/{authenticate-and-persist-oauth-Ck_jXxSo.js → authenticate-and-persist-oauth-C5KpSVFq.js} +1 -1
  79. package/dist/client/assets/{automation-list-row-CXx6fw_j.js → automation-list-row-CFMhUt1F.js} +1 -1
  80. package/dist/client/assets/{automation-runs-cOtzrPMg.js → automation-runs-r4ByP7K9.js} +1 -1
  81. package/dist/client/assets/{automations-BpilPhr-.js → automations-CJg1PL_7.js} +1 -1
  82. package/dist/client/assets/{autosend-BH28Njc8.js → autosend-BgdlbO_i.js} +1 -1
  83. package/dist/client/assets/{badge-Bwux_Jdb.js → badge-CCN5Ad5E.js} +1 -1
  84. package/dist/client/assets/{block-document-DukFXvb9.js → block-document-BQbDLhhm.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-DK3CHyzo.js → blocks-preview-workspace-context-BoGPIYEL.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-BHECZHqH.js → blocks-tab-states-XuAlkDNG.js} +1 -1
  87. package/dist/client/assets/{blog-schema-BbmcwIps.js → blog-schema-BHUk1mcN.js} +1 -1
  88. package/dist/client/assets/{buckets-Dqk3SwDj.js → buckets-B4G1WogN.js} +1 -1
  89. package/dist/client/assets/{build-improve-prompt-doc-ChB-j5_L.js → build-improve-prompt-doc-BSYSdSKQ.js} +1 -1
  90. package/dist/client/assets/{calendar-BSsKj4_c.js → calendar-DFYFqMKq.js} +1 -1
  91. package/dist/client/assets/{capability-load-error-DUUGeyFg.js → capability-load-error-WlqEME5j.js} +1 -1
  92. package/dist/client/assets/{category-editor-CWstRZQV.js → category-editor-DH1seDHj.js} +1 -1
  93. package/dist/client/assets/{cdn-tab-BTtRBzdr.js → cdn-tab-DtA8sFST.js} +1 -1
  94. package/dist/client/assets/{chart-wRtBwGr8.js → chart-DBJ0nBTj.js} +1 -1
  95. package/dist/client/assets/{chat-context-CMHTyqVA.js → chat-context-B0QfMtK7.js} +1 -1
  96. package/dist/client/assets/{chat-draft-CircrMX4.js → chat-draft-C2BZw8j7.js} +1 -1
  97. package/dist/client/assets/{checkbox-B6Jej9eU.js → checkbox-CzFYIYeS.js} +1 -1
  98. package/dist/client/assets/{choose-editor-CWRKxtO4.js → choose-editor-DJ0ZEPVl.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-DsdcdvJc.js → cli-auth-success-BXfPKx1V.js} +1 -1
  100. package/dist/client/assets/{client-icons-y1Q10YFN.js → client-icons-azojl93a.js} +1 -1
  101. package/dist/client/assets/{cms-settings-editor-Rl7CYt-n.js → cms-settings-editor-CVlNsR9g.js} +1 -1
  102. package/dist/client/assets/{collapsible-BX4HWcSo.js → collapsible-D7SyoWI6.js} +1 -1
  103. package/dist/client/assets/{collection-detail-CIMh3Jei.js → collection-detail-2IiivUXw.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-B6dcxjrb.js → collection-display-button-BdfHxfK8.js} +1 -1
  105. package/dist/client/assets/{collection-search-DF_k1vPg.js → collection-search-ZYYfADQw.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-DY_FxG6c.js → collection-table-wrapper-nUoCOMI0.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-CY_ndJsm.js → collection-tabs-DUT-_32y.js} +1 -1
  108. package/dist/client/assets/{column-rules-AJ36A-hh.js → column-rules-zsCVfrEU.js} +1 -1
  109. package/dist/client/assets/{combobox-BtOTHSYG.js → combobox-BcG9kY9H.js} +1 -1
  110. package/dist/client/assets/{command-CJ4gxSMG.js → command-DMjv9UCp.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-C2KCTUUR.js → companion-mcps-section-BbQDgg34.js} +1 -1
  112. package/dist/client/assets/{config-CPsLBULE.js → config-BRQKyTF3.js} +1 -1
  113. package/dist/client/assets/{connect-kUNXUGjC.js → connect-PJXKtBkj.js} +1 -1
  114. package/dist/client/assets/{connect-layout-VH1UNOcl.js → connect-layout-CdIOrnnB.js} +1 -1
  115. package/dist/client/assets/{connect-source-dialog-Ctou8yGb.js → connect-source-dialog-wB_CpMH5.js} +1 -1
  116. package/dist/client/assets/{connection-DK177lmE.js → connection-Co5j8iMf.js} +1 -1
  117. package/dist/client/assets/{connection-card-B-1tJM8j.js → connection-card-C0W4Y5E8.js} +1 -1
  118. package/dist/client/assets/{connection-detail--WCzBAT2.js → connection-detail-CndRUN2P.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-1yiAHH1P.js → connection-form-helpers-Dz9M5mpv.js} +1 -1
  120. package/dist/client/assets/{connections-Caq3gWB-.js → connections-CyFz6dcc.js} +1 -1
  121. package/dist/client/assets/{content-tab-Cc0Q2ULJ.js → content-tab-YfBULH2U.js} +3 -3
  122. package/dist/client/assets/{context-B-ngValp.js → context-CyZYwDX8.js} +1 -1
  123. package/dist/client/assets/{context-menu-BU8ZaQuM.js → context-menu-BR-HLcTM.js} +1 -1
  124. package/dist/client/assets/{context-shell-DWKwHJHJ.js → context-shell-v5YxJs4X.js} +3 -3
  125. package/dist/client/assets/{core.esm-DGTo4W3O.js → core.esm-CJau0VZ_.js} +1 -1
  126. package/dist/client/assets/{create-organization-dialog-xggmlIiR.js → create-organization-dialog-D3uDt-mS.js} +1 -1
  127. package/dist/client/assets/{daily-pulse-qg2c97vc.js → daily-pulse-CEYtilUl.js} +1 -1
  128. package/dist/client/assets/{discover-UBQau0mq.js → discover-Dt5UzKit.js} +1 -1
  129. package/dist/client/assets/{domain-settings-DOo9wUGy.js → domain-settings-Vd91cRuZ.js} +1 -1
  130. package/dist/client/assets/{drawer-cCeHz-L_.js → drawer-DVDEynMl.js} +1 -1
  131. package/dist/client/assets/{editor-CJ3BTpUv.js → editor-BPHWgsFO.js} +1 -1
  132. package/dist/client/assets/{editor-classes-BWss0ahE.js → editor-classes-DO0eVExg.js} +1 -1
  133. package/dist/client/assets/{empty-state-C1tanHed.js → empty-state-6fA1LS5m.js} +1 -1
  134. package/dist/client/assets/{empty-state-KX515AmC.js → empty-state-C98_cQun.js} +1 -1
  135. package/dist/client/assets/{experiments-tab-ChFL1Dxn.js → experiments-tab-CVhWHQz6.js} +1 -1
  136. package/dist/client/assets/{experiments-tab-choice-Cmll9XRX.js → experiments-tab-choice-9WDva_co.js} +1 -1
  137. package/dist/client/assets/{extract-connection-data-B4eV0UAf.js → extract-connection-data-CQ-9c4M4.js} +1 -1
  138. package/dist/client/assets/{feature-gate-KjTs7hEa.js → feature-gate-BM2nPq_K.js} +1 -1
  139. package/dist/client/assets/{feature-paywall-CDnBgqeG.js → feature-paywall-BkRDvqlZ.js} +1 -1
  140. package/dist/client/assets/{file-explorer-vsnyJPrF.js → file-explorer-CGmxhajs.js} +1 -1
  141. package/dist/client/assets/{file-preview-CSlYixvL.js → file-preview-CW106Au3.js} +1 -1
  142. package/dist/client/assets/{file-share-button-DcdF8SPH.js → file-share-button-B6mdTr9l.js} +1 -1
  143. package/dist/client/assets/{file-type-icon-CGcvQl1w.js → file-type-icon-BQOlt6bc.js} +1 -1
  144. package/dist/client/assets/{folder-icon-DMKaQAkS.js → folder-icon-CEeLVxaA.js} +1 -1
  145. package/dist/client/assets/{form-D3QMRyGF.js → form-D31DoepE.js} +1 -1
  146. package/dist/client/assets/{general-CeodHkRL.js → general-CJiud_H3.js} +1 -1
  147. package/dist/client/assets/{held-block-view-B7Cg1lHe.js → held-block-view-CB3xOhYs.js} +3 -3
  148. package/dist/client/assets/{home-B2OMFpn1.js → home-CNcl_kvy.js} +1 -1
  149. package/dist/client/assets/{hosted-publish-feedback-BHrbF1cA.js → hosted-publish-feedback-BSdcqLMQ.js} +1 -1
  150. package/dist/client/assets/{icon-button-QBx8ZygL.js → icon-button-CbqEy6tn.js} +1 -1
  151. package/dist/client/assets/{index-D0C3Q4Qh.js → index-7IShUKYk.js} +1 -1
  152. package/dist/client/assets/{index-D5DdhWpU.js → index-BU5FmmeM.js} +1 -1
  153. package/dist/client/assets/{index-JgxModG_.js → index-BdgyAwPA.js} +1 -1
  154. package/dist/client/assets/{index-D_g5fbwO.js → index-CD3fj83c.js} +3 -3
  155. package/dist/client/assets/{index-CxwJoIfH.js → index-CQr86l05.js} +1 -1
  156. package/dist/client/assets/{index-w4PzPo3L.js → index-CeKKvvrE.js} +1 -1
  157. package/dist/client/assets/{index-CCCFXbTH.js → index-Cm3twnkq.js} +1 -1
  158. package/dist/client/assets/{index-BFCPigEv.js → index-Cnj5xCCg.js} +1 -1
  159. package/dist/client/assets/{index-DU9qEpSd.js → index-D4YmJ5bn.js} +1 -1
  160. package/dist/client/assets/{index-DXUKwqTT.js → index-DGMpoxyU.js} +1 -1
  161. package/dist/client/assets/{index-DzZQyUBS.js → index-DZBneeX2.js} +1 -1
  162. package/dist/client/assets/{index-CK3OHota.js → index-D_3ll4pl.js} +1 -1
  163. package/dist/client/assets/{index-BKdv8yOo.js → index-GuHT1Dqd.js} +1 -1
  164. package/dist/client/assets/{index-f6pvFBro.js → index-XNAHJkYn.js} +1 -1
  165. package/dist/client/assets/{index-redirect-DR3kwfY_.js → index-redirect-D2Jxd7RA.js} +1 -1
  166. package/dist/client/assets/{index-nla-PJCP.js → index-zj4emT8y.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-OmdTxLUx.js → infiniteQueryObserver-DIZnkeqn.js} +1 -1
  168. package/dist/client/assets/{infra-billing-CnuDBKgM.js → infra-billing-CHM9W63C.js} +1 -1
  169. package/dist/client/assets/{input-Bn4dO9O5.js → input-B5oK-tm6.js} +1 -1
  170. package/dist/client/assets/{input-BM_N6Y5w.js → input-C8LAqcW8.js} +3 -3
  171. package/dist/client/assets/{integration-icon-CjeKpmHY.js → integration-icon-DrUX7MlE.js} +1 -1
  172. package/dist/client/assets/{jira-icon-tR4A-oH7.js → jira-icon-BZpTWRDk.js} +1 -1
  173. package/dist/client/assets/{label-OhIpdV40.js → label-BjHcnejP.js} +1 -1
  174. package/dist/client/assets/{layout-DanHGYTn.js → layout-D-7ngqTv.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-CJWuMxLh.js → legacy-agents-deep-DlwSBmEx.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-LHCezREc.js → legacy-main-redirect-CjBqfgkP.js} +1 -1
  177. package/dist/client/assets/library-DGmRBsYh.js +1 -0
  178. package/dist/client/assets/{login-CGX_-9NW.js → login-DoscEwvo.js} +1 -1
  179. package/dist/client/assets/{markdown-Ccl-upwY.js → markdown-DCOlrq5H.js} +1 -1
  180. package/dist/client/assets/{mcp-app-renderer-Bd1deLT9.js → mcp-app-renderer-CpTKqKhy.js} +1 -1
  181. package/dist/client/assets/{mcp-oauth-TQiYMgbF.js → mcp-oauth-CFWliElr.js} +1 -1
  182. package/dist/client/assets/{mcp-oauth-V5LqpjQv.js → mcp-oauth-rYjfwNTN.js} +1 -1
  183. package/dist/client/assets/{members-D-q5n-4d.js → members-CtNRNIZz.js} +1 -1
  184. package/dist/client/assets/{memory-fmVzKsZd.js → memory-BzISrBF9.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-C-2Xi8qg.js → mini-report-page-COcteM5H.js} +1 -1
  186. package/dist/client/assets/{mock-board-BZHCoT8_.js → mock-board-C1z7Js6O.js} +3 -3
  187. package/dist/client/assets/{monaco-editor-DXrAgHWf.js → monaco-editor-8NbaeYxI.js} +1 -1
  188. package/dist/client/assets/{monitoring-D9N3dAzZ.js → monitoring-CP2OHem9.js} +1 -1
  189. package/dist/client/assets/{monitoring-stats-row-CGUI7QEq.js → monitoring-stats-row-DJwGXbaX.js} +1 -1
  190. package/dist/client/assets/{multi-select-74_OAX-H.js → multi-select-MrdYsdQJ.js} +1 -1
  191. package/dist/client/assets/{mustache-CbGdlb3Z.js → mustache-Cse4SZP_.js} +1 -1
  192. package/dist/client/assets/{named-rule-uses-CjwCvwXA.js → named-rule-uses-DbKcBg9W.js} +1 -1
  193. package/dist/client/assets/{new-project-dialog-WrDYKTwo.js → new-project-dialog-t1kb5xiA.js} +1 -1
  194. package/dist/client/assets/{oauth-callback-ai-provider-WCBjh_Q4.js → oauth-callback-ai-provider-DsuZukYv.js} +1 -1
  195. package/dist/client/assets/{oauth-callback-2GTQxAE4.js → oauth-callback-bSFZUAjG.js} +1 -1
  196. package/dist/client/assets/{onboarding-Vxd9x2Lr.js → onboarding-8qc2gNkO.js} +1 -1
  197. package/dist/client/assets/{openai-conversation-BmXZjGte.js → openai-conversation-CaEjm2EP.js} +1 -1
  198. package/dist/client/assets/{optimistic-project-sidebar-views-Blt0TNGA.js → optimistic-project-sidebar-views-B6Zgt9ra.js} +1 -1
  199. package/dist/client/assets/{order-monitor-day-RXwFA0HX.js → order-monitor-day-kqoS-Y_Q.js} +1 -1
  200. package/dist/client/assets/{organization-choice-Bh1vqoey.js → organization-choice-DZZeL1XT.js} +1 -1
  201. package/dist/client/assets/{orgs-D8Cd4o2t.js → orgs-kt9vh-dy.js} +1 -1
  202. package/dist/client/assets/{page-seo-form-PkkDJzzh.js → page-seo-form-Dp0KuKjw.js} +1 -1
  203. package/dist/client/assets/{pair-CUzOr8bI.js → pair-o3WkMbxi.js} +1 -1
  204. package/dist/client/assets/{parse-sections-CoU5h-pA.js → parse-sections-B9Tf8cb0.js} +1 -1
  205. package/dist/client/assets/{plan-BFEo7Gl8.js → plan-9q_Cw6ji.js} +1 -1
  206. package/dist/client/assets/{plan-ladder-BD0dFgi7.js → plan-ladder-6A8SWD1S.js} +1 -1
  207. package/dist/client/assets/{popover-C_zTb0re.js → popover-DNa0geGd.js} +1 -1
  208. package/dist/client/assets/{post-calendar-DFQsiTn7.js → post-calendar-N4MlB9EJ.js} +1 -1
  209. package/dist/client/assets/{post-editor-DE0wNTFZ.js → post-editor-BPhcrZnu.js} +1 -1
  210. package/dist/client/assets/{preview-content-C-qeGfnu.js → preview-content-BGa1aq6N.js} +1 -1
  211. package/dist/client/assets/{preview-dialog-DQK5-M23.js → preview-dialog-BcLlrF7L.js} +1 -1
  212. package/dist/client/assets/{preview-panel-D-QfoUDv.js → preview-panel-BipRwFTG.js} +1 -1
  213. package/dist/client/assets/{preview-tab-C3PhJlLe.js → preview-tab-D_XmjQ94.js} +3 -3
  214. package/dist/client/assets/{product-picker-dialog-pe0_j8eG.js → product-picker-dialog-CuQoqK9j.js} +1 -1
  215. package/dist/client/assets/{profile-DAfBQItX.js → profile-FuN22bNA.js} +1 -1
  216. package/dist/client/assets/{project-app-view-B6LGlz1-.js → project-app-view-MMtV5o0V.js} +1 -1
  217. package/dist/client/assets/{project-apps-CPupwOqV.js → project-apps-GTR8G8Ys.js} +1 -1
  218. package/dist/client/assets/{project-feed-vxPoCD9l.js → project-feed-CkPrHQsk.js} +1 -1
  219. package/dist/client/assets/{project-icon-Cr845_CG.js → project-icon-fmbPzLuQ.js} +1 -1
  220. package/dist/client/assets/project-reports-Dg-vdrJe.js +1 -0
  221. package/dist/client/assets/project-tasks-C1Fo6Q_q.js +1 -0
  222. package/dist/client/assets/{projects-BjWFpkwY.js → projects-Do4dpHSf.js} +1 -1
  223. package/dist/client/assets/{projects-empty-state-BYlm9UUi.js → projects-empty-state-DOLbuC5C.js} +1 -1
  224. package/dist/client/assets/{prompts-Cssd3XKK.js → prompts-Cbd5IniR.js} +1 -1
  225. package/dist/client/assets/record-editor-CzhxcAkT.js +1 -0
  226. package/dist/client/assets/{redirect-editor-DMEEDgtP.js → redirect-editor-Be9-Qvv_.js} +1 -1
  227. package/dist/client/assets/{releases-api-Bk5t0ert.js → releases-api-CJKOs4iF.js} +1 -1
  228. package/dist/client/assets/reports-BC3mXfe2.js +1 -0
  229. package/dist/client/assets/{reports-Dgbcbhtv.js → reports-Cwi7mYJf.js} +1 -1
  230. package/dist/client/assets/{reports-onboarding-DqBX9ov6.js → reports-onboarding-DBwy9sOO.js} +1 -1
  231. package/dist/client/assets/{reports-tab-CacnVvHJ.js → reports-tab-C6GCZ_1e.js} +2 -2
  232. package/dist/client/assets/repositories-C-vvRVWc.js +1 -0
  233. package/dist/client/assets/{repositories-ByXlUnyd.js → repositories-CLK21UHp.js} +1 -1
  234. package/dist/client/assets/{repository-binding-By57Fxxd.js → repository-binding-BpxbVNK2.js} +1 -1
  235. package/dist/client/assets/{repository-import-picker-CEj8FSjR.js → repository-import-picker-BIa2KeQJ.js} +1 -1
  236. package/dist/client/assets/{repository-picker-CYEr0G_x.js → repository-picker-D1FdmUjm.js} +1 -1
  237. package/dist/client/assets/{require-capability-DEL3Av3U.js → require-capability-DiaarhnE.js} +1 -1
  238. package/dist/client/assets/{required-auth-layout-CjuTV0NI.js → required-auth-layout-CLzneFN8.js} +1 -1
  239. package/dist/client/assets/{reset-password-UdQOTW8F.js → reset-password-CFxj9jWH.js} +1 -1
  240. package/dist/client/assets/{resizable-Dm7Ppqsk.js → resizable-BRQDRNKu.js} +1 -1
  241. package/dist/client/assets/{resolve-tab-icon-RIV-aaN8.js → resolve-tab-icon-bhxvukg7.js} +1 -1
  242. package/dist/client/assets/{review-settings-BTvN1SXb.js → review-settings-BY-BbFx8.js} +1 -1
  243. package/dist/client/assets/{roles-BIW20J-X.js → roles-8aR2wtse.js} +1 -1
  244. package/dist/client/assets/{route-ZLMvRGu5.js → route-BKABB7N0.js} +1 -1
  245. package/dist/client/assets/route-CBcyPgFB.js +1 -0
  246. package/dist/client/assets/{route-CXQCqWNG.js → route-D0phypJY.js} +1 -1
  247. package/dist/client/assets/{sandbox-lifecycle-context-Dgq0M2ct.js → sandbox-lifecycle-context-CP46WhuD.js} +1 -1
  248. package/dist/client/assets/{schema-Bo1PMfNO.js → schema-CZyOweh2.js} +1 -1
  249. package/dist/client/assets/{schema-BCNeMwy9.js → schema-DlfScG-X.js} +1 -1
  250. package/dist/client/assets/{scroll-area-B5DHgOgq.js → scroll-area-DfDFaLoK.js} +1 -1
  251. package/dist/client/assets/{search-input-DUnxVDPX.js → search-input-Ce0LKLJH.js} +1 -1
  252. package/dist/client/assets/{search-toggle-BNKJfOTM.js → search-toggle-mwrYnTpd.js} +1 -1
  253. package/dist/client/assets/{secret-picker-_MclVjTA.js → secret-picker-0ebHTmVr.js} +1 -1
  254. package/dist/client/assets/{secrets-BefWQ0Kr.js → secrets-i5YFgzbS.js} +1 -1
  255. package/dist/client/assets/{section-array-field-CkpcagA9.js → section-array-field-oWK_IMJM.js} +1 -1
  256. package/dist/client/assets/{sections-BnnbYMn9.js → sections-BhWKKbK8.js} +1 -1
  257. package/dist/client/assets/{sections-editor-cmh9dcT6.js → sections-editor-B6j8jHtF.js} +1 -1
  258. package/dist/client/assets/{select-BjHL6qhR.js → select-CEUzoC6o.js} +1 -1
  259. package/dist/client/assets/{select-model-VvtmJMg1.js → select-model-rItZIAGH.js} +1 -1
  260. package/dist/client/assets/{seo-editor-CvmOkvM2.js → seo-editor-BNYNobIZ.js} +1 -1
  261. package/dist/client/assets/{separator-DNlHxi9i.js → separator-DnXEcPkq.js} +1 -1
  262. package/dist/client/assets/settings-tab-4qrzXqQr.js +1 -0
  263. package/dist/client/assets/{sheet-BDXuMmna.js → sheet-BdF546xt.js} +1 -1
  264. package/dist/client/assets/{shell-layout-CjolmPkc.js → shell-layout-BHS6wDGg.js} +1 -1
  265. package/dist/client/assets/{site-draft-actions-BHDZ9fow.js → site-draft-actions-D9KLDMNb.js} +1 -1
  266. package/dist/client/assets/{site-draft-view-DS-zp5U3.js → site-draft-view-Dwp6ox-i.js} +2 -2
  267. package/dist/client/assets/site-editor-C_RF5xzW.js +1 -0
  268. package/dist/client/assets/{site-editor-toast-l1dhSHCt.js → site-editor-toast-qpDJ9c8x.js} +1 -1
  269. package/dist/client/assets/{skills-G8RLqpdy.js → skills-DkTHa0rC.js} +1 -1
  270. package/dist/client/assets/{slider-CMbVyVJQ.js → slider-C2GpxduI.js} +1 -1
  271. package/dist/client/assets/{sortable.esm-ZyT2TvZV.js → sortable.esm-DSLK_VXl.js} +1 -1
  272. package/dist/client/assets/{sso-dK3w8qI7.js → sso-9_HDrEa6.js} +1 -1
  273. package/dist/client/assets/{suggestion-DXuFICZE.js → suggestion-DWnq0fLw.js} +1 -1
  274. package/dist/client/assets/{switch-CZBObdNg.js → switch-JNrraILQ.js} +1 -1
  275. package/dist/client/assets/{symbol-PHC61XFI.js → symbol-DN0zRhCk.js} +1 -1
  276. package/dist/client/assets/{synced-repos-Bz2NDPvW.js → synced-repos-BqaODaqZ.js} +1 -1
  277. package/dist/client/assets/{tab-icon-glyph-Dasyata1.js → tab-icon-glyph-CAGljGST.js} +1 -1
  278. package/dist/client/assets/{table-DCMR2n9h.js → table-CQyj6E6L.js} +1 -1
  279. package/dist/client/assets/{tabs-C-9VaJhf.js → tabs-Dsn3YxbL.js} +1 -1
  280. package/dist/client/assets/{task-assignee-avatar-CIYygg8_.js → task-assignee-avatar-_ItHEfyB.js} +1 -1
  281. package/dist/client/assets/{task-board-CbT-KEYT.js → task-board-Bl8e1XTd.js} +1 -1
  282. package/dist/client/assets/{task-route-BvmEqfe-.js → task-route-TqMS3_Xw.js} +1 -1
  283. package/dist/client/assets/{task-status-DBdRSG-l.js → task-status-RY841uT0.js} +1 -1
  284. package/dist/client/assets/{taskboard-analytics-D-HgYUFe.js → taskboard-analytics-CVrP0ozY.js} +1 -1
  285. package/dist/client/assets/tasks-BQyDO5YT.js +1 -0
  286. package/dist/client/assets/{tasks-TnH1j2VG.js → tasks-DKrnOMsF.js} +1 -1
  287. package/dist/client/assets/{textarea-CM43JFTD.js → textarea-DHsxWS9H.js} +1 -1
  288. package/dist/client/assets/{thread-analytics-0CnU2XFc.js → thread-analytics-BlBn_Ue7.js} +1 -1
  289. package/dist/client/assets/{thread-intent-Cqs1opf_.js → thread-intent-CIa2mqqt.js} +1 -1
  290. package/dist/client/assets/{thread-route-B5ut0NU_.js → thread-route-CUBgdoZ0.js} +1 -1
  291. package/dist/client/assets/{thread-route-LGDwdWed.js → thread-route-OlD3VCew.js} +1 -1
  292. package/dist/client/assets/{thread-sheet-body-O5yfLvQS.js → thread-sheet-body-DcCGHErs.js} +1 -1
  293. package/dist/client/assets/{time-range-picker-CZQbuwqz.js → time-range-picker-DG1uQaMF.js} +1 -1
  294. package/dist/client/assets/{toggle-group-D2zNn425.js → toggle-group-BFn7oikO.js} +1 -1
  295. package/dist/client/assets/{tool-namespace-DTR_kwTg.js → tool-namespace-DtJ2HF8a.js} +1 -1
  296. package/dist/client/assets/{toolbar-icon-button-BHKfNIjM.js → toolbar-icon-button-DZ8JPQ_p.js} +1 -1
  297. package/dist/client/assets/{tooltip-C9Lea48a.js → tooltip-BFOA909d.js} +1 -1
  298. package/dist/client/assets/{tooltipContext-DOujR0BI.js → tooltipContext-2V1j45YY.js} +1 -1
  299. package/dist/client/assets/{track-7vwNFuqv.js → track-XCtPNBYr.js} +1 -1
  300. package/dist/client/assets/{types-CcFIA35S.js → types-BxxJTVxe.js} +1 -1
  301. package/dist/client/assets/{url-slug-BwNJtYgj.js → url-slug-nNAf_zW7.js} +1 -1
  302. package/dist/client/assets/{usage-stats-B1BWkK1R.js → usage-stats-bTZK9s6S.js} +1 -1
  303. package/dist/client/assets/{use-ai-providers-CGxV6Ump.js → use-ai-providers-CehDWGIM.js} +1 -1
  304. package/dist/client/assets/{use-apply-named-rule-CZu73ste.js → use-apply-named-rule-DlF_o_O9.js} +1 -1
  305. package/dist/client/assets/{use-automations-CnW9gLcq.js → use-automations-CcifryrO.js} +1 -1
  306. package/dist/client/assets/{use-autosave-DXgCcKSg.js → use-autosave-Brq7MoHE.js} +1 -1
  307. package/dist/client/assets/{use-chat-layout-state-Df9sHeOa.js → use-chat-layout-state-DX2dVnP3.js} +1 -1
  308. package/dist/client/assets/{use-clock-tick-CIwUUqD7.js → use-clock-tick-9j5u-Rtx.js} +1 -1
  309. package/dist/client/assets/{use-cms-publish-actions-uyU5PTIQ.js → use-cms-publish-actions-CpgSJalU.js} +1 -1
  310. package/dist/client/assets/{use-connect-companion-GZcPBM3Q.js → use-connect-companion-DZRxznzL.js} +1 -1
  311. package/dist/client/assets/{use-connection-Bl0Snogb.js → use-connection-BUd2E1e4.js} +1 -1
  312. package/dist/client/assets/{use-copy-BymKXx9E.js → use-copy-AGiqroYo.js} +1 -1
  313. package/dist/client/assets/{use-create-virtual-mcp-3B7eJ8ln.js → use-create-virtual-mcp-DUfDYvY_.js} +1 -1
  314. package/dist/client/assets/{use-date-fns-locale-C9WVsNHe.js → use-date-fns-locale-t1pyfasq.js} +1 -1
  315. package/dist/client/assets/{use-debounced-autosave-CM2eDIid.js → use-debounced-autosave-uS4v6WVr.js} +1 -1
  316. package/dist/client/assets/{use-debounced-value-DD-Uo8LF.js → use-debounced-value-Bvr3c0Bg.js} +1 -1
  317. package/dist/client/assets/{use-deco-credits-DI-Ge8Zp.js → use-deco-credits-D3Ul2AHT.js} +1 -1
  318. package/dist/client/assets/{use-decopilot-events-C_or96Qd.js → use-decopilot-events-CQwRTT8g.js} +1 -1
  319. package/dist/client/assets/{use-delete-connection-DPdqR9cX.js → use-delete-connection-MUWA0C1G.js} +1 -1
  320. package/dist/client/assets/{use-deployment-admin-B4OyNHUs.js → use-deployment-admin-DtrC7GR5.js} +1 -1
  321. package/dist/client/assets/{use-fast-preview-draft-url-DTWM-ut4.js → use-fast-preview-draft-url-B40YryGZ.js} +1 -1
  322. package/dist/client/assets/{use-file-configs-CuUOK6xS.js → use-file-configs-C87nAUnF.js} +1 -1
  323. package/dist/client/assets/{use-inbox-feed-BXBI7C7m.js → use-inbox-feed-BrxFGNGq.js} +1 -1
  324. package/dist/client/assets/{use-infinite-scroll-DtUCDqWy.js → use-infinite-scroll-BBt1tR4g.js} +1 -1
  325. package/dist/client/assets/{use-join-requests-Cif12_Yd.js → use-join-requests-KZQ6WXPe.js} +1 -1
  326. package/dist/client/assets/{use-main-panel-tabs-DwRWmy8l.js → use-main-panel-tabs-DFZxwocn.js} +1 -1
  327. package/dist/client/assets/{use-mcp-auth-status-CUefMSEY.js → use-mcp-auth-status-fGawges9.js} +1 -1
  328. package/dist/client/assets/{use-mcp-client-B7ar03Mf.js → use-mcp-client-BHU-qsif.js} +1 -1
  329. package/dist/client/assets/{use-mcp-prompts-CSHnamAQ.js → use-mcp-prompts-DVKPAtxK.js} +1 -1
  330. package/dist/client/assets/{use-mcp-tools-C3K1Ek3G.js → use-mcp-tools-DTZgJEdW.js} +1 -1
  331. package/dist/client/assets/{use-mobile-DkF4ktIE.js → use-mobile-C7tjJGs8.js} +1 -1
  332. package/dist/client/assets/{use-move-blocks-D7FqLWkn.js → use-move-blocks-Co0993wA.js} +1 -1
  333. package/dist/client/assets/{use-navigate-to-agent-BMet2fBs.js → use-navigate-to-agent-BZyzGjVW.js} +1 -1
  334. package/dist/client/assets/{use-org-fs-CpvRxmtT.js → use-org-fs-DiFStjLf.js} +1 -1
  335. package/dist/client/assets/{use-org-repo-syncs-DiMRemww.js → use-org-repo-syncs-D8YSA9t2.js} +1 -1
  336. package/dist/client/assets/{use-org-sso-BvIeHiW0.js → use-org-sso-C9Iucy6w.js} +1 -1
  337. package/dist/client/assets/{use-organization-roles-DVxxo3pr.js → use-organization-roles-Dz-b1a1s.js} +1 -1
  338. package/dist/client/assets/{use-organization-settings-BDkE8atK.js → use-organization-settings-CHidLnF6.js} +1 -1
  339. package/dist/client/assets/{use-panel-navigate-CQ5-5m15.js → use-panel-navigate-CrCScmoE.js} +1 -1
  340. package/dist/client/assets/{use-project-native-view-presence-DYYkvSz7.js → use-project-native-view-presence-DSs2LzKr.js} +1 -1
  341. package/dist/client/assets/{use-project-scope-C58lw4kY.js → use-project-scope-ejA4MhTG.js} +1 -1
  342. package/dist/client/assets/{use-recent-apps-CKV2JUjj.js → use-recent-apps-BQamzqjd.js} +1 -1
  343. package/dist/client/assets/{use-releases-BuVS0Zpo.js → use-releases-BgQagTY2.js} +1 -1
  344. package/dist/client/assets/{use-reports-diagnostic-Cw-6s-9X.js → use-reports-diagnostic-DiC-K8YA.js} +1 -1
  345. package/dist/client/assets/{use-sandbox-events-DpAa77RX.js → use-sandbox-events-BbmfXv6n.js} +1 -1
  346. package/dist/client/assets/{use-secrets-BiIt-MIc.js → use-secrets-0iGSdnGP.js} +1 -1
  347. package/dist/client/assets/{use-section-preview-base-Ua-YFPnC.js → use-section-preview-base-QNrdx3XX.js} +1 -1
  348. package/dist/client/assets/{use-session-runtime-D0DDxEjh.js → use-session-runtime-DYJ3pOXd.js} +1 -1
  349. package/dist/client/assets/{use-sidebar-collapsed-a4idgJIz.js → use-sidebar-collapsed-DBJ9kFpJ.js} +1 -1
  350. package/dist/client/assets/{use-tags-BDB4AWNG.js → use-tags-XdRP6hv7.js} +1 -1
  351. package/dist/client/assets/{use-task-board-analytics-DRaiYNSr.js → use-task-board-analytics-C8Y_Nmnp.js} +1 -1
  352. package/dist/client/assets/{use-task-board-events-C59TKc8i.js → use-task-board-events-C3c7HDax.js} +1 -1
  353. package/dist/client/assets/{use-task-board-item-prs-B-u60KUK.js → use-task-board-item-prs-DlYgoZJv.js} +1 -1
  354. package/dist/client/assets/{use-task-metadata-DRhZU82v.js → use-task-metadata-PWx0qQrW.js} +1 -1
  355. package/dist/client/assets/{use-thread-analytics-Czfic6gr.js → use-thread-analytics-DfrxxjCR.js} +1 -1
  356. package/dist/client/assets/{use-thread-outputs-DGui0G3n.js → use-thread-outputs-CAL5fh-E.js} +1 -1
  357. package/dist/client/assets/useInfiniteQuery-BPkTbU3d.js +1 -0
  358. package/dist/client/assets/{useQueries-DBXn9O72.js → useQueries-D1NR6XSj.js} +1 -1
  359. package/dist/client/assets/useSuspenseInfiniteQuery-BpGKYE1U.js +1 -0
  360. package/dist/client/assets/{users-CU_fKKjr.js → users-CHbLiMHe.js} +1 -1
  361. package/dist/client/assets/{utils-BaNJYkyI.js → utils-BzZnpE20.js} +1 -1
  362. package/dist/client/assets/{variant-calendar-Bjoa2Jrm.js → variant-calendar-nksjvE17.js} +1 -1
  363. package/dist/client/assets/{variant-matcher-override-CJIqSDDL.js → variant-matcher-override-CIWGPj0Z.js} +1 -1
  364. package/dist/client/assets/{view-header-CWrj1Fiv.js → view-header-D6fHMTsm.js} +1 -1
  365. package/dist/client/assets/{virtual-mcp-TF_kASgw.js → virtual-mcp-AzZIPPoU.js} +1 -1
  366. package/dist/client/assets/{watch-sse-pool-C69EsECV.js → watch-sse-pool-CF4IoX_h.js} +1 -1
  367. package/dist/client/index.html +1 -1
  368. package/dist/server/server.js +459 -459
  369. package/package.json +1 -1
  370. package/dist/client/assets/agent-app-Lnk024cG.js +0 -1
  371. package/dist/client/assets/agent-deck-cPCyRJh0.js +0 -1
  372. package/dist/client/assets/agent-experiments-DCNDtGmX.js +0 -1
  373. package/dist/client/assets/agent-library-file-BqdlZ9Na.js +0 -1
  374. package/dist/client/assets/agent-library-gWUsTUyf.js +0 -1
  375. package/dist/client/assets/agent-monitor-BwzA3a4j.js +0 -1
  376. package/dist/client/assets/agent-settings-BhGh94On.js +0 -1
  377. package/dist/client/assets/agent-site-editor-code-XUcD4VpI.js +0 -2
  378. package/dist/client/assets/agent-site-editor-content-BJrBGR9_.js +0 -1
  379. package/dist/client/assets/agent-site-editor-preview-Dpc2igwh.js +0 -1
  380. package/dist/client/assets/agent-view-DxoZ1pTh.js +0 -1
  381. package/dist/client/assets/api-keys-CvP8E9BO.js +0 -1
  382. package/dist/client/assets/library-Drr0VtsN.js +0 -1
  383. package/dist/client/assets/project-reports-BFmjNCSO.js +0 -1
  384. package/dist/client/assets/project-tasks-LmEIVMLo.js +0 -1
  385. package/dist/client/assets/record-editor-BOadhn6H.js +0 -1
  386. package/dist/client/assets/reports-vuOwE56c.js +0 -1
  387. package/dist/client/assets/repositories-CNfg6b14.js +0 -1
  388. package/dist/client/assets/route-CUPxBHEr.js +0 -1
  389. package/dist/client/assets/settings-tab-BVbLfmf7.js +0 -1
  390. package/dist/client/assets/site-editor-CL-_ktpm.js +0 -1
  391. package/dist/client/assets/tasks-Bcry5trB.js +0 -1
  392. package/dist/client/assets/useInfiniteQuery-CVBb5I8q.js +0 -1
  393. package/dist/client/assets/useSuspenseInfiniteQuery-DN4Vh5CF.js +0 -1
@@ -1,3 +1,3 @@
1
- import{c as B,b as ye,r as V,j as r,B as ve,l as X,K as zt,as as br,b4 as gr,ay as Jn,aD as xr,X as Wt,t as $t,aM as zs,aN as Hs,aO as qs,aP as Ks,bm as Vs,aQ as Gs,aR as Ws,aS as Qs,V as vs,Y as ys,Z as js,a as Ps,a4 as ws,cs as vr,h as Qt,f7 as Yn,f8 as Js,bJ as yr,bd as jr,bj as wn,f9 as Pr,c0 as wr,at as Sr,I as kr,a7 as Nr,fa as Cr,U as Xn,m as Rt,eQ as Ys,q as Zn,H as ea,D as ta,x as sa,v as na,Q as aa,M as ra,fb as Ar,bn as la,a5 as ia,b8 as Xs,e as Sn,C as Rr,R as Tr}from"./index-D_g5fbwO.js";import{S as Br}from"./separator-DNlHxi9i.js";import{f as Ir,u as Zt,r as oa,l as ca,c as da,b as Dr}from"./chat-context-CMHTyqVA.js";import{u as Ht,ab as Fr,c as ua,b as ha,ac as $r,ad as Lr,ae as Mr,_ as _r,af as Or,D as Zs,B as fa,ag as Er,L as ma,z as Ur,w as pa}from"./site-editor-toast-l1dhSHCt.js";import{L as zr,a as Hr}from"./shell-layout-CjolmPkc.js";import{I as ba}from"./toolbar-icon-button-BHKfNIjM.js";import{P as qr,a as Kr,b as Vr}from"./popover-C_zTb0re.js";import{c as St,T as kt,a as Nt,b as Ss}from"./tooltip-C9Lea48a.js";import{d as Gr,e as Wr,c as Qr,C as kn,a as Nn,b as Cn}from"./command-CJ4gxSMG.js";import{T as Et,a as ga,c as xa}from"./tabs-C-9VaJhf.js";import{t as va}from"./ChevronUp-BOBhKnkD.js";import{aF as ks,H as Jr,a as ya,aG as Yr,b as ja,aH as Pa,O as Xr}from"./agent-icon-gy5gO-IG.js";import{i as wa}from"./DotsVertical-PMMJbcO3.js";import{b as Sa}from"./Tool01-CkZ1DNSP.js";import{s as ka}from"./Plus-DdEst5EN.js";import{s as Ns}from"./Trash01-CbJGwAlq.js";import{u as en,r as Bs,a as An,n as Is,g as tn,b as sn}from"./use-releases-BuVS0Zpo.js";import{k as Zr,d as el,j as Rn}from"./thread-intent-Cqs1opf_.js";import{h as Na,r as Ca,g as tl,f as et,a as nn,j as Aa}from"./repository-binding-By57Fxxd.js";import{u as sl}from"./use-debounced-value-DD-Uo8LF.js";import{u as nl}from"./use-clock-tick-CIwUUqD7.js";import{u as al}from"./useInfiniteQuery-CVBb5I8q.js";import{e as rl,c as ll,p as il,g as Ra,h as Ta,i as Ba}from"./use-navigate-to-agent-BMet2fBs.js";import{a as Tn}from"./virtual-mcp-TF_kASgw.js";import{u as Ia,c as ol,e as cl}from"./experiments-tab-choice-Cmll9XRX.js";import{G as Da}from"./repository-picker-CYEr0G_x.js";import{u as an}from"./use-session-runtime-D0DDxEjh.js";import{u as dl,c as ul,d as hl,e as fl}from"./use-fast-preview-draft-url-DTWM-ut4.js";import{ab as Vt,ac as Fa,w as bs,l as rn,ad as $a,ae as ml,af as pl,x as bl,ag as gl,j as xl,u as Lt,f as ln,ah as vl}from"./parse-sections-CoU5h-pA.js";import"./index-CxwJoIfH.js";import{T as yl}from"./textarea-CM43JFTD.js";import{i as on}from"./CheckCircle-XFmpER2C.js";import{s as gs}from"./Image01-W4iMjF9I.js";import{r as jl}from"./hosted-publish-feedback-BHrbF1cA.js";import{n as Pl,s as wl,C as Sl,a as kl,b as Nl,M as Cl,c as Al,d as Rl,m as Tl,u as Bl}from"./use-cms-publish-actions-uyU5PTIQ.js";import{a as Il,g as Dl}from"./UserSquare-ynyjvlRU.js";import{n as Fl,b as $l,m as Ll}from"./named-rule-uses-CjwCvwXA.js";import{i as cn,b as La,m as Ml,h as _l,c as Ma,f as _a,d as Ol,r as dn,e as El,n as Ul,g as zl,j as Hl,k as ql,l as un,o as Kl,p as Oa,q as Vl,s as Ea,t as Ds}from"./sandbox-git-api-DcqI6XE4.js";import{b as Gl,g as Wl}from"./utils-BaNJYkyI.js";import{i as Ql}from"./Monitor01-Dbk8mjTp.js";import{w as hn,g as Jl,D as Yl}from"./section-preview-url-7zfngvgW.js";import{w as fn}from"./device-hint-SeLRi17j.js";import{w as Bn}from"./editor-CJ3BTpUv.js";import{d as Xl,a as Zl,R as Ua}from"./section-array-field-CkpcagA9.js";import{s as za}from"./save-changes-debug-nBi-n9eV.js";import{u as ei}from"./releases-api-Bk5t0ert.js";import{u as ti}from"./use-mcp-client-B7ar03Mf.js";import{u as si}from"./use-sandbox-events-DpAa77RX.js";import{b as ni,a as ai}from"./sandbox-lifecycle-context-Dgq0M2ct.js";import{b as ri}from"./thread-route-LGDwdWed.js";function li(t){const{value:e,baseBranch:s,releases:a,baseIsDraft:n=!1}=t,o=!n&&!!e&&e===s,d=a.find(i=>i.branch===e);return{isBase:o,current:d,unlisted:!o&&!d&&!!e}}const ii={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},In=1114111;function Dn(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const a=Number.parseInt(s.slice(2),16);return!Number.isFinite(a)||a>In?e:String.fromCodePoint(a)}if(s.startsWith("#")){const a=Number.parseInt(s.slice(1),10);return!Number.isFinite(a)||a>In?e:String.fromCodePoint(a)}return ii[s]??e}):""}function oi(t){const e=B.c(39),{url:s,onSave:a}=t,n=ye(),[o,d]=V.useState(s??"");let l;e[0]!==o?(l=o.trim(),e[0]=o,e[1]=l):l=e[1];const i=l;let u;e[2]!==a||e[3]!==i?(u=()=>a(i?Zr(i):null),e[2]=a,e[3]=i,e[4]=u):u=e[4];const c=u;let h;e[5]!==n?(h=n("thread.branchPicker.localHint"),e[5]=n,e[6]=h):h=e[6];let f;e[7]!==h?(f=r.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=f):f=e[8];let p;e[9]!==n?(p=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=p):p=e[10];let g;e[11]!==n?(g=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=g):g=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=C=>d(C.target.value),e[13]=m):m=e[13];let b;e[14]!==c||e[15]!==i?(b=C=>{C.key==="Enter"&&i&&c()},e[14]=c,e[15]=i,e[16]=b):b=e[16];let x;e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==o?(x=r.jsx("input",{type:"url",inputMode:"url","aria-label":p,placeholder:g,value:o,onChange:m,onKeyDown:b,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=p,e[18]=g,e[19]=b,e[20]=o,e[21]=x):x=e[21];let P;e[22]!==a||e[23]!==n||e[24]!==s?(P=s?r.jsx(ve,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>a(null),children:n("thread.branchPicker.localTurnOff")}):r.jsx("span",{}),e[22]=a,e[23]=n,e[24]=s,e[25]=P):P=e[25];const y=!i;let v;e[26]!==n?(v=n("thread.branchPicker.save"),e[26]=n,e[27]=v):v=e[27];let w;e[28]!==c||e[29]!==y||e[30]!==v?(w=r.jsx(ve,{size:"sm",disabled:y,onClick:c,children:v}),e[28]=c,e[29]=y,e[30]=v,e[31]=w):w=e[31];let j;e[32]!==P||e[33]!==w?(j=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,w]}),e[32]=P,e[33]=w,e[34]=j):j=e[34];let N;return e[35]!==j||e[36]!==f||e[37]!==x?(N=r.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[f,x,j]}),e[35]=j,e[36]=f,e[37]=x,e[38]=N):N=e[38],N}function ci(t){const e=B.c(8),{virtualMcpId:s,branch:a,serve:n,rowRef:o,onPicked:d}=t,l=Ht(s,a),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>di(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let h;return e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==c?(h=r.jsx(ui,{rowRef:o,selected:i,connected:u,onSelect:c}),e[3]=o,e[4]=i,e[5]=u,e[6]=c,e[7]=h):h=e[7],h}function di(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??Fr})}function ui(t){const e=B.c(19),{rowRef:s,selected:a,connected:n,onSelect:o}=t,d=ye(),l=a?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=X("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=u):u=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==c?(h=r.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let f;e[7]!==n||e[8]!==d?(f=n&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d("thread.branchPicker.localhost.connected")}),e[7]=n,e[8]=d,e[9]=f):f=e[9];let p;e[10]!==o||e[11]!==a||e[12]!==h||e[13]!==f?(p=r.jsxs("button",{type:"button","aria-pressed":a,onClick:o,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,f]}),e[10]=o,e[11]=a,e[12]=h,e[13]=f,e[14]=p):p=e[14];let g;return e[15]!==s||e[16]!==i||e[17]!==p?(g=r.jsx("div",{ref:s,className:i,children:p}),e[15]=s,e[16]=i,e[17]=p,e[18]=g):g=e[18],g}const hi=10080*60*1e3;function fi({sandboxMap:t,userId:e,rawBranches:s,now:a}){const n=new Map;for(const[h,f]of Object.entries(t??{}))for(const[p,g]of Object.entries(f??{})){let m=n.get(p);m||(m={userIds:new Set,lastActiveAt:0},n.set(p,m)),m.userIds.add(h);for(const b of Object.values(g??{})){const x=b?.createdAt??0;x>m.lastActiveAt&&(m.lastActiveAt=x)}}const o=a-hi,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,f)=>f[1].lastActiveAt-h[1].lastActiveAt).map(([h,f])=>({name:h,source:"recent",contributors:[...f.userIds],lastActiveAt:f.lastActiveAt})),l=new Set(d.map(h=>h.name)),i=new Set(Object.keys(t?.[e]??{})),u=[...i].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),c=s.filter(h=>!i.has(h.name)&&!l.has(h.name)).map(h=>({name:h.name,source:"other",author:h.author??null}));return{recent:d,yours:u,others:c}}const mi=100,pi=50,bi=300;function Ms(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function gi(t){const e=B.c(39),{orgId:s,orgSlug:a,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:u,enabled:c}=t,h=u===void 0?"":u,f=c===void 0?!0:c;let p;e[0]!==h?(p=h.trim(),e[0]=h,e[1]=p):p=e[1];const g=p,m=sl(g,bi);let b;e[2]!==o?(b=Na(o),e[2]=o,e[3]=b):b=e[3];const x=b,P=g.length>0;let y;e[4]!==m||e[5]!==s||e[6]!==a||e[7]!==l||e[8]!==i||e[9]!==o?(y=zt.githubBranchSearch(s,a,Ca(o),l,i,m),e[4]=m,e[5]=s,e[6]=a,e[7]=l,e[8]=i,e[9]=o,e[10]=y):y=e[10];const v=f&&x;let w;e[11]!==m||e[12]!==a||e[13]!==o?(w=Y=>{const{pageParam:ne}=Y;return br(a,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?pi:mi,cursor:ne})},e[11]=m,e[12]=a,e[13]=o,e[14]=w):w=e[14];let j;e[15]!==m?(j=Y=>m?void 0:Y.nextCursor??void 0,e[15]=m,e[16]=j):j=e[16];let N;e[17]!==y||e[18]!==v||e[19]!==w||e[20]!==j?(N={queryKey:y,enabled:v,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:w,getNextPageParam:j},e[17]=y,e[18]=v,e[19]=w,e[20]=j,e[21]=N):N=e[21];const{data:C,isLoading:R,isError:k,isFetching:A,hasNextPage:S,isFetchingNextPage:$,fetchNextPage:F}=al(N),T=P&&(m!==g||A),M=(C?.pages??[]).flatMap(xi),O=nl(6e4),ee=fi({sandboxMap:d,userId:n,rawBranches:M,now:O});let re;e[22]!==g?(re=Y=>Ms(Y.name,g),e[22]=g,e[23]=re):re=e[23];const H=ee.recent.filter(re);let L;e[24]!==g?(L=Y=>Ms(Y.name,g),e[24]=g,e[25]=L):L=e[25];const z=ee.yours.filter(L),te=ee.others,W=C?.pages[0],I=P&&W&&!T?Math.max(0,W.totalCount-W.branches.length):0,J=!P&&S;let U;e[26]!==F?(U=()=>{F()},e[26]=F,e[27]=U):U=e[27];let oe;return e[28]!==I||e[29]!==k||e[30]!==$||e[31]!==R||e[32]!==T||e[33]!==te||e[34]!==H||e[35]!==J||e[36]!==U||e[37]!==z?(oe={recent:H,yours:z,others:te,isLoading:R,isError:k,isSearching:T,hiddenMatchCount:I,hasMore:J,isFetchingMore:$,fetchMore:U},e[28]=I,e[29]=k,e[30]=$,e[31]=R,e[32]=T,e[33]=te,e[34]=H,e[35]=J,e[36]=U,e[37]=z,e[38]=oe):oe=e[38],oe}function xi(t){return t.branches}function vi(t){const e=B.c(239),{virtualMcpId:s,isV8:a,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:u,userId:c,target:h,owner:f,repo:p,sandboxMap:g,onChange:m,onCreateBranch:b,onAdoptBranch:x,disabled:P,spawnsNewChat:y,placement:v}=t,w=a===void 0?!1:a,j=l===void 0?!1:l,N=P===void 0?!1:P,C=y===void 0?!1:y,R=v===void 0?"chat":v,k=ye(),A=R==="header",[S,$]=V.useState(!1),[F,T]=V.useState(!1),[M,O]=V.useState("branches"),[ee,re]=V.useState(null),[H,L]=V.useState(""),[z,te]=V.useState(null),W=V.useRef(null),{releases:I,createRelease:J,renameRelease:U,deleteRelease:oe}=en(s),{url:Y,setUrl:ne,clear:D}=ua(s),se=ha(s),le=w&&!!se.connection,he=w?se.connection?.endpoint??null:Y,G=!!he;let pe;e[0]!==D||e[1]!==w||e[2]!==se?(pe=()=>{D(),w&&se.clear()},e[0]=D,e[1]=w,e[2]=se,e[3]=pe):pe=e[3];const Z=pe;let E;e[4]!==S?(E={enabled:S},e[4]=S,e[5]=E):E=e[5];const{data:q}=gr(E);let ce;e[6]!==q?.data?.members?(ce=ue=>ue?q?.data?.members?.find(dt=>dt.userId===ue)?.user?.name??void 0:void 0,e[6]=q?.data?.members,e[7]=ce):ce=e[7];const we=ce,fe=I.length>=Tn;let Me;e[8]!==k?(Me=k("thread.branchPicker.capReached",{max:Tn}),e[8]=k,e[9]=Me):Me=e[9];const _=Me;let ae,Oe,_e,Ee,ft,tt,je,Ie,$e,De,Pe,Fe,Se,Le,st,mt,Re,de,K,xe,ke,Ne,Ce,Ue,nt,pt,bt,We,Qe;if(e[10]!==fe||e[11]!==d||e[12]!==j||e[13]!==_||e[14]!==Z||e[15]!==J||e[16]!==oe||e[17]!==N||e[18]!==H||e[19]!==A||e[20]!==G||e[21]!==le||e[22]!==x||e[23]!==m||e[24]!==b||e[25]!==S||e[26]!==z||e[27]!==I||e[28]!==U||e[29]!==ne||e[30]!==k||e[31]!==c||e[32]!==n||e[33]!==o){const{isBase:ue,current:dt,unlisted:Kt}=li({value:o,baseBranch:d,releases:I,baseIsDraft:j});Qe=Kt;const Q=ue?k("thread.branchPicker.live"):dt?.name??k("thread.branchPicker.defaultVersionName");Pe=le?k("thread.branchPicker.localhost.label"):G?k("thread.branchPicker.localLabel"):o?Q:k("thread.branchPicker.selectVersion");const be=le?"bg-foreground":G?"bg-special":ue?"bg-success":Bs(dt?.color??"orange");let me;e[63]!==Z||e[64]!==m?(me=ie=>{Z(),m(ie),$(!1)},e[63]=Z,e[64]=m,e[65]=me):me=e[65],Se=me;let Te;e[66]!==k?(Te=ie=>{$t.error(k("thread.branchPicker.saveError"),{description:$r(k,Lr(ie))})},e[66]=k,e[67]=Te):Te=e[67];const ge=Te;let Ct;e[68]!==ne?(Ct=ie=>{ne(ie),T(!1),$(!1)},e[68]=ne,e[69]=Ct):Ct=e[69],tt=Ct;let ts;e[70]!==fe||e[71]!==_||e[72]!==Z||e[73]!==J||e[74]!==x||e[75]!==m||e[76]!==I||e[77]!==ge||e[78]!==c?(ts=(ie,Ot)=>{if(Z(),x){x(ie),T(!1),$(!1);return}if(!I.some(Ts=>Ts.branch===ie)){if(fe){$t.error(_);return}J({branch:ie,name:Ot.trim()||ie,color:Is(I.length),createdBy:c,createdAt:new Date().toISOString()}).catch(ge)}m(ie),T(!1),$(!1)},e[70]=fe,e[71]=_,e[72]=Z,e[73]=J,e[74]=x,e[75]=m,e[76]=I,e[77]=ge,e[78]=c,e[79]=ts):ts=e[79],je=ts;let ss;e[80]!==fe||e[81]!==_||e[82]!==Z||e[83]!==J||e[84]!==m||e[85]!==b||e[86]!==I||e[87]!==ge||e[88]!==k||e[89]!==c||e[90]!==n?(ss=()=>{if(fe){$t.error(_);return}Z();const ie=tn(n);J({branch:ie,name:An(I,k("thread.branchPicker.defaultVersionName")),color:Is(I.length),createdBy:c,createdAt:new Date().toISOString()}).catch(ge),(b??m)(ie),$(!1)},e[80]=fe,e[81]=_,e[82]=Z,e[83]=J,e[84]=m,e[85]=b,e[86]=I,e[87]=ge,e[88]=k,e[89]=c,e[90]=n,e[91]=ss):ss=e[91],De=ss;let ns;e[92]===Symbol.for("react.memo_cache_sentinel")?(ns=()=>{re(null),L(""),T(!1),O("branches")},e[92]=ns):ns=e[92];const pr=ns;let as;e[93]===Symbol.for("react.memo_cache_sentinel")?(as=ie=>{O(ie),T(!0)},e[93]=as):as=e[93],Fe=as;let rs;e[94]===Symbol.for("react.memo_cache_sentinel")?(rs=ie=>{re(ie.branch),L(ie.name)},e[94]=rs):rs=e[94],mt=rs;let ls;e[95]!==H||e[96]!==U||e[97]!==ge?(ls=ie=>{const Ot=H.trim();Ot&&U(ie,Ot).catch(ge),re(null),L("")},e[95]=H,e[96]=U,e[97]=ge,e[98]=ls):ls=e[98],Le=ls;let is;e[99]!==fe||e[100]!==_||e[101]!==J||e[102]!==H||e[103]!==I.length||e[104]!==ge||e[105]!==c||e[106]!==o?(is=()=>{const ie=H.trim();if(ie&&o){if(fe){$t.error(_),re(null),L("");return}J({branch:o,name:ie,color:Is(I.length),createdBy:c,createdAt:new Date().toISOString()}).catch(ge)}re(null),L("")},e[99]=fe,e[100]=_,e[101]=J,e[102]=H,e[103]=I.length,e[104]=ge,e[105]=c,e[106]=o,e[107]=is):is=e[107],st=is;let os;e[108]===Symbol.for("react.memo_cache_sentinel")?(os=()=>{re(null),L("")},e[108]=os):os=e[108],Ie=os;let cs;e[109]!==d||e[110]!==oe||e[111]!==z||e[112]!==Se||e[113]!==I||e[114]!==ge||e[115]!==o?(cs=()=>{const ie=z;if(te(null),!!ie){if(ie.branch===o){const Ot=I.find(Ts=>Ts.branch!==ie.branch);Ot?Se(Ot.branch):d?Se(d):$(!1)}else $(!1);oe(ie.branch).catch(ge)}},e[109]=d,e[110]=oe,e[111]=z,e[112]=Se,e[113]=I,e[114]=ge,e[115]=o,e[116]=cs):cs=e[116],$e=cs,ft=qr,bt=S,e[117]!==N?(We=N?void 0:ie=>{ie||pr(),$(ie)},e[117]=N,e[118]=We):We=e[118],Ee=St,_e=kt,pt=!0,nt="inline-flex min-w-0 shrink",Oe=Kr,Ue=!0,ae=ve,de=zr.branchPicker,K=A?"outline":"ghost",xe=A?"sm":"default",ke=Pe,Ne=N;const Rs=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";e[119]!==Rs?(Ce=X("shrink min-w-0 max-w-[220px] gap-2",Rs,ba),e[119]=Rs,e[120]=Ce):Ce=e[120],Re=X("h-2 w-2 shrink-0 rounded-full",o||G?be:"bg-muted-foreground"),e[10]=fe,e[11]=d,e[12]=j,e[13]=_,e[14]=Z,e[15]=J,e[16]=oe,e[17]=N,e[18]=H,e[19]=A,e[20]=G,e[21]=le,e[22]=x,e[23]=m,e[24]=b,e[25]=S,e[26]=z,e[27]=I,e[28]=U,e[29]=ne,e[30]=k,e[31]=c,e[32]=n,e[33]=o,e[34]=ae,e[35]=Oe,e[36]=_e,e[37]=Ee,e[38]=ft,e[39]=tt,e[40]=je,e[41]=Ie,e[42]=$e,e[43]=De,e[44]=Pe,e[45]=Fe,e[46]=Se,e[47]=Le,e[48]=st,e[49]=mt,e[50]=Re,e[51]=de,e[52]=K,e[53]=xe,e[54]=ke,e[55]=Ne,e[56]=Ce,e[57]=Ue,e[58]=nt,e[59]=pt,e[60]=bt,e[61]=We,e[62]=Qe}else ae=e[34],Oe=e[35],_e=e[36],Ee=e[37],ft=e[38],tt=e[39],je=e[40],Ie=e[41],$e=e[42],De=e[43],Pe=e[44],Fe=e[45],Se=e[46],Le=e[47],st=e[48],mt=e[49],Re=e[50],de=e[51],K=e[52],xe=e[53],ke=e[54],Ne=e[55],Ce=e[56],Ue=e[57],nt=e[58],pt=e[59],bt=e[60],We=e[61],Qe=e[62];let Ae;e[121]!==Re?(Ae=r.jsx("span",{className:Re}),e[121]=Re,e[122]=Ae):Ae=e[122];let at;e[123]!==Pe?(at=r.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:Pe}),e[123]=Pe,e[124]=at):at=e[124];let rt;e[125]!==N?(rt=!N&&r.jsx(va,{size:12,className:"opacity-60 shrink-0"}),e[125]=N,e[126]=rt):rt=e[126];let gt;e[127]!==ae||e[128]!==de||e[129]!==K||e[130]!==xe||e[131]!==ke||e[132]!==Ne||e[133]!==Ce||e[134]!==Ae||e[135]!==at||e[136]!==rt?(gt=r.jsxs(ae,{"data-tour":de,variant:K,size:xe,"aria-label":ke,disabled:Ne,className:Ce,children:[Ae,at,rt]}),e[127]=ae,e[128]=de,e[129]=K,e[130]=xe,e[131]=ke,e[132]=Ne,e[133]=Ce,e[134]=Ae,e[135]=at,e[136]=rt,e[137]=gt):gt=e[137];let Tt;e[138]!==Oe||e[139]!==Ue||e[140]!==gt?(Tt=r.jsx(Oe,{asChild:Ue,children:gt}),e[138]=Oe,e[139]=Ue,e[140]=gt,e[141]=Tt):Tt=e[141];let xt;e[142]!==nt||e[143]!==Tt?(xt=r.jsx("span",{className:nt,children:Tt}),e[142]=nt,e[143]=Tt,e[144]=xt):xt=e[144];let Je;e[145]!==_e||e[146]!==pt||e[147]!==xt?(Je=r.jsx(_e,{asChild:pt,children:xt}),e[145]=_e,e[146]=pt,e[147]=xt,e[148]=Je):Je=e[148];let Ye;e[149]!==Pe?(Ye=r.jsx(Nt,{children:Pe}),e[149]=Pe,e[150]=Ye):Ye=e[150];let Xe;e[151]!==Ee||e[152]!==Je||e[153]!==Ye?(Xe=r.jsxs(Ee,{children:[Je,Ye]}),e[151]=Ee,e[152]=Je,e[153]=Ye,e[154]=Xe):Xe=e[154];let Bt;e[155]===Symbol.for("react.memo_cache_sentinel")?(Bt=ue=>{ue.preventDefault(),W.current?.scrollIntoView({block:"nearest"})},e[155]=Bt):Bt=e[155];let lt;e[156]!==C||e[157]!==k?(lt=C&&r.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:k("thread.branchPicker.newChatHint")}),e[156]=C,e[157]=k,e[158]=lt):lt=e[158];let vt;e[159]!==tt||e[160]!==je||e[161]!==F||e[162]!==M||e[163]!==fe||e[164]!==Ie||e[165]!==_||e[166]!==Z||e[167]!==De||e[168]!==we||e[169]!==H||e[170]!==ee||e[171]!==w||e[172]!==G||e[173]!==he||e[174]!==le||e[175]!==S||e[176]!==Fe||e[177]!==i||e[178]!==u||e[179]!==f||e[180]!==Se||e[181]!==I||e[182]!==p||e[183]!==g||e[184]!==Le||e[185]!==st||e[186]!==se||e[187]!==mt||e[188]!==k||e[189]!==h||e[190]!==Y||e[191]!==Qe||e[192]!==c||e[193]!==o||e[194]!==s?(vt=F?r.jsx(ji,{orgId:i,orgSlug:u,userId:c,target:h,owner:f,repo:p,sandboxMap:g,enabled:S,tab:M,onTabChange:O,isV8:w,localUrl:Y,onSaveLocal:tt,onBack:()=>T(!1),onAdopt:je}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:X("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",w&&"gap-1"),children:[!w&&G&&he&&r.jsx(yi,{rowRef:W,url:he,onSelect:()=>Fe("local"),onEdit:()=>Fe("local"),onTurnOff:()=>Z()}),Qe&&o&&(ee===o?r.jsx(Fn,{value:H,onChange:L,onSave:st,onCancel:Ie}):r.jsx($n,{rowRef:G?void 0:W,dot:Bs("orange"),label:k("thread.branchPicker.defaultVersionName"),branch:o,selected:!G,onSelect:()=>Se(o),onRename:()=>{re(o),L(An(I,k("thread.branchPicker.defaultVersionName")))}})),I.map(ue=>ee===ue.branch?r.jsx(Fn,{value:H,onChange:L,onSave:()=>Le(ue.branch),onCancel:Ie},ue.branch):r.jsx($n,{rowRef:!G&&ue.branch===o?W:void 0,dot:Bs(ue.color),label:ue.name,creator:we(ue.createdBy),branch:ue.branch,selected:!G&&ue.branch===o,onSelect:()=>Se(ue.branch),onRename:()=>mt(ue),onDelete:()=>te(ue)},ue.branch)),w&&r.jsx(ci,{virtualMcpId:s,branch:o,serve:se,rowRef:le?W:void 0,onPicked:()=>$(!1)})]}),(Qe||I.length>0||w)&&r.jsx("div",{className:"my-1 border-t"}),r.jsxs("button",{type:"button",onClick:()=>{De()},disabled:fe,className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",children:[r.jsx(ka,{className:"h-4 w-4 shrink-0"}),k("thread.branchPicker.newVersion")]}),fe&&r.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:_}),r.jsxs("button",{type:"button",onClick:()=>Fe("branches"),className:X("flex w-full items-center justify-between gap-2 rounded-lg px-2 py-2 text-left text-xs text-muted-foreground hover:bg-accent hover:text-foreground",w&&"mt-1"),children:[k("thread.branchPicker.advanced"),r.jsx(Jn,{className:"h-4 w-4 shrink-0"})]})]}),e[159]=tt,e[160]=je,e[161]=F,e[162]=M,e[163]=fe,e[164]=Ie,e[165]=_,e[166]=Z,e[167]=De,e[168]=we,e[169]=H,e[170]=ee,e[171]=w,e[172]=G,e[173]=he,e[174]=le,e[175]=S,e[176]=Fe,e[177]=i,e[178]=u,e[179]=f,e[180]=Se,e[181]=I,e[182]=p,e[183]=g,e[184]=Le,e[185]=st,e[186]=se,e[187]=mt,e[188]=k,e[189]=h,e[190]=Y,e[191]=Qe,e[192]=c,e[193]=o,e[194]=s,e[195]=vt):vt=e[195];let it;e[196]!==lt||e[197]!==vt?(it=r.jsxs(Vr,{className:"w-[min(300px,calc(100vw-2rem))] p-1.5",align:"start",onOpenAutoFocus:Bt,children:[lt,vt]}),e[196]=lt,e[197]=vt,e[198]=it):it=e[198];let It;e[199]!==ft||e[200]!==bt||e[201]!==We||e[202]!==Xe||e[203]!==it?(It=r.jsxs(ft,{open:bt,onOpenChange:We,children:[Xe,it]}),e[199]=ft,e[200]=bt,e[201]=We,e[202]=Xe,e[203]=it,e[204]=It):It=e[204];const Dt=It,_t=z!==null;let Ft;e[205]===Symbol.for("react.memo_cache_sentinel")?(Ft=ue=>{ue||te(null)},e[205]=Ft):Ft=e[205];let Ze;e[206]!==k?(Ze=k("thread.branchPicker.deleteTitle"),e[206]=k,e[207]=Ze):Ze=e[207];let yt;e[208]!==Ze?(yt=r.jsx(zs,{children:Ze}),e[208]=Ze,e[209]=yt):yt=e[209];let ot;e[210]!==z||e[211]!==k?(ot=z&&k("thread.branchPicker.deleteConfirm",{name:z.name}),e[210]=z,e[211]=k,e[212]=ot):ot=e[212];let jt;e[213]!==ot?(jt=r.jsx(Hs,{children:ot}),e[213]=ot,e[214]=jt):jt=e[214];let Pt;e[215]!==yt||e[216]!==jt?(Pt=r.jsxs(qs,{children:[yt,jt]}),e[215]=yt,e[216]=jt,e[217]=Pt):Pt=e[217];let wt;e[218]!==k?(wt=k("thread.branchPicker.cancel"),e[218]=k,e[219]=wt):wt=e[219];let ze;e[220]!==wt?(ze=r.jsx(Ks,{children:wt}),e[220]=wt,e[221]=ze):ze=e[221];let He;e[222]!==k?(He=k("thread.branchPicker.delete"),e[222]=k,e[223]=He):He=e[223];let qe;e[224]!==$e||e[225]!==He?(qe=r.jsx(Vs,{onClick:$e,variant:"destructive",children:He}),e[224]=$e,e[225]=He,e[226]=qe):qe=e[226];let Ke;e[227]!==ze||e[228]!==qe?(Ke=r.jsxs(Gs,{children:[ze,qe]}),e[227]=ze,e[228]=qe,e[229]=Ke):Ke=e[229];let Ve;e[230]!==Pt||e[231]!==Ke?(Ve=r.jsxs(Ws,{children:[Pt,Ke]}),e[230]=Pt,e[231]=Ke,e[232]=Ve):Ve=e[232];let Ge;e[233]!==_t||e[234]!==Ve?(Ge=r.jsx(Qs,{open:_t,onOpenChange:Ft,children:Ve}),e[233]=_t,e[234]=Ve,e[235]=Ge):Ge=e[235];let ct;return e[236]!==Dt||e[237]!==Ge?(ct=r.jsxs(r.Fragment,{children:[Dt,Ge]}),e[236]=Dt,e[237]=Ge,e[238]=ct):ct=e[238],ct}function Fn(t){const e=B.c(20),{value:s,onChange:a,onSave:n,onCancel:o}=t,d=ye();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==a?(i=g=>a(g.target.value),e[2]=a,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=g=>{g.key==="Enter"&&n(),g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==i||e[9]!==u||e[10]!==s?(c=r.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,e[9]=u,e[10]=s,e[11]=c):c=e[11];let h;e[12]!==d?(h=d("thread.branchPicker.save"),e[12]=d,e[13]=h):h=e[13];let f;e[14]!==n||e[15]!==h?(f=r.jsx(ve,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=f):f=e[16];let p;return e[17]!==c||e[18]!==f?(p=r.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[c,f]}),e[17]=c,e[18]=f,e[19]=p):p=e[19],p}function $n(t){const e=B.c(49),{rowRef:s,dot:a,label:n,creator:o,branch:d,selected:l,onSelect:i,onRename:u,onDelete:c}=t,h=ye(),f=l?"bg-accent":"hover:bg-accent";let p;e[0]!==f?(p=X("group flex items-center rounded-lg",f),e[0]=f,e[1]=p):p=e[1];let g;e[2]!==a?(g=X("h-2 w-2 shrink-0 rounded-full",a),e[2]=a,e[3]=g):g=e[3];let m;e[4]!==g?(m=r.jsx("span",{className:g}),e[4]=g,e[5]=m):m=e[5];let b;e[6]!==o?(b=o&&r.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:o}),e[6]=o,e[7]=b):b=e[7];let x;e[8]!==n||e[9]!==b?(x=r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[n,b]}),e[8]=n,e[9]=b,e[10]=x):x=e[10];let P;e[11]!==i||e[12]!==l||e[13]!==m||e[14]!==x?(P=r.jsx(kt,{asChild:!0,children:r.jsxs("button",{type:"button","aria-pressed":l,onClick:i,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[m,x]})}),e[11]=i,e[12]=l,e[13]=m,e[14]=x,e[15]=P):P=e[15];let y;e[16]!==d||e[17]!==h?(y=h("thread.branchPicker.branchTooltip",{branch:d}),e[16]=d,e[17]=h,e[18]=y):y=e[18];let v;e[19]!==y?(v=r.jsx(Nt,{side:"bottom",className:"font-mono text-xs",children:y}),e[19]=y,e[20]=v):v=e[20];let w;e[21]!==P||e[22]!==v?(w=r.jsxs(St,{children:[P,v]}),e[21]=P,e[22]=v,e[23]=w):w=e[23];let j;e[24]!==h?(j=h("thread.branchPicker.moreActions"),e[24]=h,e[25]=j):j=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=r.jsx(wa,{className:"h-4 w-4"}),e[26]=N):N=e[26];let C;e[27]!==j?(C=r.jsx(vs,{asChild:!0,children:r.jsx(ve,{variant:"ghost",size:"icon","aria-label":j,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:N})}),e[27]=j,e[28]=C):C=e[28];let R;e[29]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(Sa,{className:"h-4 w-4"}),e[29]=R):R=e[29];let k;e[30]!==h?(k=h("thread.branchPicker.rename"),e[30]=h,e[31]=k):k=e[31];let A;e[32]!==u||e[33]!==k?(A=r.jsxs(Wt,{onSelect:u,children:[R,k]}),e[32]=u,e[33]=k,e[34]=A):A=e[34];let S;e[35]!==c||e[36]!==h?(S=c&&r.jsxs(Wt,{onSelect:c,className:"text-destructive focus:text-destructive",children:[r.jsx(Ns,{className:"h-4 w-4"}),h("thread.branchPicker.delete")]}),e[35]=c,e[36]=h,e[37]=S):S=e[37];let $;e[38]!==A||e[39]!==S?($=r.jsxs(ys,{align:"end",children:[A,S]}),e[38]=A,e[39]=S,e[40]=$):$=e[40];let F;e[41]!==C||e[42]!==$?(F=r.jsxs(js,{children:[C,$]}),e[41]=C,e[42]=$,e[43]=F):F=e[43];let T;return e[44]!==s||e[45]!==w||e[46]!==F||e[47]!==p?(T=r.jsxs("div",{ref:s,className:p,children:[w,F]}),e[44]=s,e[45]=w,e[46]=F,e[47]=p,e[48]=T):T=e[48],T}function yi(t){const e=B.c(40),{rowRef:s,url:a,onSelect:n,onEdit:o,onTurnOff:d}=t,l=ye();let i;try{let A;e[0]!==a?(A=new URL(a),e[0]=a,e[1]=A):A=e[1],i=A.host}catch{i=a}const u=i;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-special"}),e[2]=c):c=e[2];let h;e[3]!==l?(h=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=h):h=e[4];let f;e[5]!==u?(f=r.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=f):f=e[6];let p;e[7]!==h||e[8]!==f?(p=r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,f]}),e[7]=h,e[8]=f,e[9]=p):p=e[9];let g;e[10]!==n||e[11]!==p?(g=r.jsxs("button",{type:"button","aria-pressed":!0,onClick:n,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[c,p]}),e[10]=n,e[11]=p,e[12]=g):g=e[12];let m;e[13]!==l?(m=l("thread.branchPicker.moreActions"),e[13]=l,e[14]=m):m=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(wa,{className:"h-4 w-4"}),e[15]=b):b=e[15];let x;e[16]!==m?(x=r.jsx(vs,{asChild:!0,children:r.jsx(ve,{variant:"ghost",size:"icon","aria-label":m,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:b})}),e[16]=m,e[17]=x):x=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Sa,{className:"h-4 w-4"}),e[18]=P):P=e[18];let y;e[19]!==l?(y=l("thread.branchPicker.rename"),e[19]=l,e[20]=y):y=e[20];let v;e[21]!==o||e[22]!==y?(v=r.jsxs(Wt,{onSelect:o,children:[P,y]}),e[21]=o,e[22]=y,e[23]=v):v=e[23];let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsx(Ns,{className:"h-4 w-4"}),e[24]=w):w=e[24];let j;e[25]!==l?(j=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=j):j=e[26];let N;e[27]!==d||e[28]!==j?(N=r.jsxs(Wt,{onSelect:d,className:"text-destructive focus:text-destructive",children:[w,j]}),e[27]=d,e[28]=j,e[29]=N):N=e[29];let C;e[30]!==v||e[31]!==N?(C=r.jsxs(ys,{align:"end",children:[v,N]}),e[30]=v,e[31]=N,e[32]=C):C=e[32];let R;e[33]!==C||e[34]!==x?(R=r.jsxs(js,{children:[x,C]}),e[33]=C,e[34]=x,e[35]=R):R=e[35];let k;return e[36]!==s||e[37]!==R||e[38]!==g?(k=r.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[g,R]}),e[36]=s,e[37]=R,e[38]=g,e[39]=k):k=e[39],k}function ji(t){const e=B.c(73),{orgId:s,orgSlug:a,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:u,tab:c,onTabChange:h,isV8:f,localUrl:p,onSaveLocal:g,onBack:m,onAdopt:b}=t,x=ye(),[P,y]=V.useState(""),v=c==="branches"?P:"",w=u&&c==="branches";let j;e[0]!==s||e[1]!==a||e[2]!==d||e[3]!==l||e[4]!==i||e[5]!==v||e[6]!==w||e[7]!==o||e[8]!==n?(j={orgId:s,orgSlug:a,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:v,enabled:w},e[0]=s,e[1]=a,e[2]=d,e[3]=l,e[4]=i,e[5]=v,e[6]=w,e[7]=o,e[8]=n,e[9]=j):j=e[9];const{recent:N,yours:C,others:R,isLoading:k,hasMore:A,isFetchingMore:S,fetchMore:$}=gi(j),F=u&&c==="prs";let T;e[10]!==s||e[11]!==a||e[12]!==d||e[13]!==l||e[14]!==F||e[15]!==o?(T={orgId:s,orgSlug:a,target:o,owner:d,repo:l,enabled:F},e[10]=s,e[11]=a,e[12]=d,e[13]=l,e[14]=F,e[15]=o,e[16]=T):T=e[16];const{data:M,isLoading:O}=rl(T);let ee;if(e[17]!==$||e[18]!==A||e[19]!==S||e[20]!==k||e[21]!==f||e[22]!==p||e[23]!==b||e[24]!==m||e[25]!==g||e[26]!==h||e[27]!==R||e[28]!==d||e[29]!==O||e[30]!==N||e[31]!==l||e[32]!==P||e[33]!==x||e[34]!==M||e[35]!==c||e[36]!==C){const re=M===void 0?[]:M,H=`${d}/${l}`;let L;e[38]!==H?(L=H.toLowerCase(),e[38]=H,e[39]=L):L=e[39];const z=L;let te;e[40]!==z?(te=E=>E.headRepoFullName?.toLowerCase()===z,e[40]=z,e[41]=te):te=e[41];const W=re.filter(te);let I;if(e[42]!==R||e[43]!==N||e[44]!==C){const E=new Set;I=[...N,...C,...R].filter(q=>E.has(q.name)?!1:(E.add(q.name),!0)),e[42]=R,e[43]=N,e[44]=C,e[45]=I}else I=e[45];const J=I;let U;e[46]===Symbol.for("react.memo_cache_sentinel")?(U=r.jsx(Jr,{className:"h-4 w-4 shrink-0"}),e[46]=U):U=e[46];let oe;e[47]!==x?(oe=x("thread.branchPicker.advancedBack"),e[47]=x,e[48]=oe):oe=e[48];let Y;e[49]!==m||e[50]!==oe?(Y=r.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground",children:[U,oe]}),e[49]=m,e[50]=oe,e[51]=Y):Y=e[51];let ne;e[52]!==h?(ne=E=>{h(E),y("")},e[52]=h,e[53]=ne):ne=e[53];let D;e[54]!==x?(D=x("thread.branchPicker.branchesTab"),e[54]=x,e[55]=D):D=e[55];let se;e[56]!==D?(se=r.jsx(Et,{value:"branches",className:"h-6 px-2.5 text-xs",children:D}),e[56]=D,e[57]=se):se=e[57];let le;e[58]!==x?(le=x("thread.branchPicker.prsTab"),e[58]=x,e[59]=le):le=e[59];let he;e[60]!==le?(he=r.jsx(Et,{value:"prs",className:"h-6 px-2.5 text-xs",children:le}),e[60]=le,e[61]=he):he=e[61];let G;e[62]!==f||e[63]!==x?(G=!f&&r.jsx(Et,{value:"local",className:"h-6 px-2.5 text-xs",children:x("thread.branchPicker.localTab")}),e[62]=f,e[63]=x,e[64]=G):G=e[64];let pe;e[65]!==se||e[66]!==he||e[67]!==G?(pe=r.jsxs(ga,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[se,he,G]}),e[65]=se,e[66]=he,e[67]=G,e[68]=pe):pe=e[68];let Z;e[69]!==ne||e[70]!==pe||e[71]!==c?(Z=r.jsx(xa,{className:"px-2 pt-2 pb-1",value:c,onValueChange:ne,children:pe}),e[69]=ne,e[70]=pe,e[71]=c,e[72]=Z):Z=e[72],ee=r.jsxs("div",{className:"flex flex-col",children:[Y,Z,c==="local"&&!f?r.jsx(oi,{url:p,onSave:g}):r.jsxs(Gr,{filter:c==="branches"?Pi:void 0,children:[r.jsx(Wr,{placeholder:x(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:P,onValueChange:y}),r.jsx(Qr,{onScroll:E=>{const q=E.currentTarget;c==="branches"&&q.scrollHeight-q.scrollTop-q.clientHeight<48&&$()},children:c==="branches"?r.jsxs(r.Fragment,{children:[k&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingMore")}),!k&&J.length===0&&r.jsx(kn,{children:x("thread.branchPicker.noBranchesFound")}),J.length>0&&r.jsx(Nn,{children:J.map(E=>r.jsxs(Cn,{value:E.name,className:"cursor-pointer",onSelect:()=>b(E.name,E.name),children:[r.jsx(xr,{className:"mr-2 h-4 w-4 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:E.name})]},E.name))}),A&&r.jsx("div",{className:"p-2",children:r.jsx(ve,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:S,onClick:$,children:x(S?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):r.jsxs(r.Fragment,{children:[O&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingPullRequests")}),!O&&W.length===0&&r.jsx(kn,{children:x("thread.branchPicker.noOpenPullRequests")}),W.length>0&&r.jsx(Nn,{children:W.map(E=>r.jsxs(Cn,{value:`#${E.number} ${E.title} ${E.head}`,className:"cursor-pointer",onSelect:()=>b(E.head,Dn(E.title)),children:[r.jsx(ks,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsx("span",{className:"truncate",children:Dn(E.title)}),r.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",E.number," · ",E.head]})]})]},E.number))})]})})]})]}),e[17]=$,e[18]=A,e[19]=S,e[20]=k,e[21]=f,e[22]=p,e[23]=b,e[24]=m,e[25]=g,e[26]=h,e[27]=R,e[28]=d,e[29]=O,e[30]=N,e[31]=l,e[32]=P,e[33]=x,e[34]=M,e[35]=c,e[36]=C,e[37]=ee}else ee=e[37];return ee}function Pi(t,e){return Ms(t,e)?1:0}function wi(t){const e=B.c(19),{locked:s,placement:a,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:f,orgId:p,orgSlug:g,userId:m,target:b,owner:x,repo:P,sandboxMap:y}=t;let v;return e[0]!==i||e[1]!==u||e[2]!==d||e[3]!==s||e[4]!==f||e[5]!==c||e[6]!==h||e[7]!==p||e[8]!==g||e[9]!==x||e[10]!==a||e[11]!==P||e[12]!==y||e[13]!==b||e[14]!==m||e[15]!==l||e[16]!==n||e[17]!==o?(v=r.jsx(vi,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:p,orgSlug:g,userId:m,target:b,owner:x,repo:P,sandboxMap:y,onChange:c,onCreateBranch:h,onAdoptBranch:f,spawnsNewChat:s,placement:a}),e[0]=i,e[1]=u,e[2]=d,e[3]=s,e[4]=f,e[5]=c,e[6]=h,e[7]=p,e[8]=g,e[9]=x,e[10]=a,e[11]=P,e[12]=y,e[13]=b,e[14]=m,e[15]=l,e[16]=n,e[17]=o,e[18]=v):v=e[18],v}function Si(t){const e=B.c(2),{branchPill:s}=t;if(!s)return null;let a;return e[0]!==s?(a=r.jsx(r.Fragment,{children:s}),e[0]=s,e[1]=a):a=e[1],a}function ki(t){const e=B.c(25),{virtualMcp:s,currentBranch:a}=t,n=Ir(),o=Zt();let d;e[0]!==n?.messages||e[1]!==o?.isThreadLocked?(d=(n?.messages??[]).length>0||(o?.isThreadLocked??!1),e[0]=n?.messages,e[1]=o?.isThreadLocked,e[2]=d):d=e[2];const l=d,i=o?.setCurrentTaskBranch,u=o?.createTask;let c;e[3]!==o?.activeTask?.metadata||e[4]!==s?.metadata?(c=el(s?.metadata)==="cms"&&Rn(o?.activeTask?.metadata,s?.metadata)==="sandbox",e[3]=o?.activeTask?.metadata,e[4]=s?.metadata,e[5]=c):c=e[5];const h=c,f=tl(s),p=et(f),{data:g}=Ps.useSession(),m=g?.user;let b;e[6]!==m?(b=sn(m),e[6]=m,e[7]=b):b=e[7];const x=b,P=g?.user?.id??"",{org:y}=ws(),v=ll(s,a),w=Ia(s?.id);let j;e[8]!==w||e[9]!==o?.activeTask?.metadata||e[10]!==s?.metadata?(j=w==="v8"&&Rn(o?.activeTask?.metadata,s?.metadata)==="cms",e[8]=w,e[9]=o?.activeTask?.metadata,e[10]=s?.metadata,e[11]=j):j=e[11];const N=j;let C;e[12]!==u||e[13]!==l||e[14]!==i?(C=M=>{l&&u?u({branch:M}):i&&i(M)},e[12]=u,e[13]=l,e[14]=i,e[15]=C):C=e[15];const R=C;let k;e[16]!==h||e[17]!==u||e[18]!==l||e[19]!==i?(k=M=>{(l||h)&&u?u({branch:M}):i&&i(M)},e[16]=h,e[17]=u,e[18]=l,e[19]=i,e[20]=k):k=e[20];const A=k;let S;e[21]!==u?(S=u?M=>u({runtime:"sandbox",branch:M}):void 0,e[21]=u,e[22]=S):S=e[22];const $=S,F=f&&Na(p)?r.jsx(wi,{userLabel:x,virtualMcpId:s?.id??"",isV8:w==="v8",value:a,baseBranch:v,baseIsDraft:N,orgId:y.id,orgSlug:y.slug,userId:P,target:p,owner:f.owner,repo:f.name,sandboxMap:s?.metadata?.sandboxMap,onChange:R,onCreateBranch:A,onAdoptBranch:$,locked:l,placement:"chat"},`${Ca(p)}:${f.owner}/${f.name}`):null;let T;return e[23]!==F?(T=r.jsx(Si,{branchPill:F}),e[23]=F,e[24]=T):T=e[24],T}const Ni=vr("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function Ci(t){const e=B.c(11);let s,a,n;e[0]!==t?({className:s,orientation:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==s||e[5]!==a?(o=X(Ni({orientation:a}),s),e[4]=s,e[5]=a,e[6]=o):o=e[6];let d;return e[7]!==a||e[8]!==n||e[9]!==o?(d=r.jsx("div",{role:"group","data-slot":"button-group","data-orientation":a,className:o,...n}),e[7]=a,e[8]=n,e[9]=o,e[10]=d):d=e[10],d}function Ai(t){const e=B.c(14),{item:s}=t;let a;e[0]!==s?(a=()=>{s.onSelect()},e[0]=s,e[1]=a):a=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==a?(n=r.jsxs(Wt,{disabled:s.disabled,onSelect:a,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=a,e[6]=n):n=e[6];const o=n;if(!s.tooltip)return o;let d;e[7]!==o?(d=r.jsx(kt,{asChild:!0,children:o}),e[7]=o,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=r.jsx(Nt,{side:"right",children:s.tooltip}),e[9]=s.tooltip,e[10]=l):l=e[10];let i;return e[11]!==d||e[12]!==l?(i=r.jsxs(St,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=i):i=e[13],i}function Ha(t){const e=B.c(20),{label:s,onClick:a,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:u,icon:c,items:h,menuAriaLabel:f,className:p}=t,g=n===void 0?"default":n,m=o===void 0?"default":o,b=d===void 0?!1:d,x=l===void 0?!1:l,P=i===void 0?!1:i,y=(h?.length??0)>0;let v;if(e[0]!==p||e[1]!==b||e[2]!==y||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==x||e[7]!==f||e[8]!==a||e[9]!==P||e[10]!==m||e[11]!==u||e[12]!==g){const w=X(ba,g==="default"&&"focus-visible:inset-ring-current");let j;e[14]!==c||e[15]!==x?(j=x?r.jsx(Qt,{size:"xs"}):c,e[14]=c,e[15]=x,e[16]=j):j=e[16];const N=r.jsxs(ve,{type:"button",variant:g,size:m,disabled:b,"aria-busy":x||void 0,onClick:x?void 0:a,className:X(w,y&&"rounded-r-none border-r border-current/20"),children:[j,s]}),C=P&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let R;e[17]!==p||e[18]!==C?(R=X(C,p),e[17]=p,e[18]=C,e[19]=R):R=e[19],v=r.jsxs(Ci,{className:R,children:[u?r.jsxs(St,{children:[r.jsx(kt,{asChild:!0,children:r.jsx("span",{className:X("inline-flex rounded-lg outline-none",w,b&&"cursor-not-allowed"),tabIndex:b?0:void 0,role:b?"button":void 0,"aria-disabled":b||void 0,children:N})}),r.jsx(Nt,{children:u})]}):N,y?r.jsxs(js,{children:[r.jsx(vs,{asChild:!0,children:r.jsx(ve,{type:"button",variant:g,size:m,"aria-label":f,className:X("has-[>svg]:px-2",w),children:r.jsx(va,{className:"size-3.5"})})}),r.jsx(ys,{align:"end",children:h?.map(Ri)})]}):null]}),e[0]=p,e[1]=b,e[2]=y,e[3]=c,e[4]=h,e[5]=s,e[6]=x,e[7]=f,e[8]=a,e[9]=P,e[10]=m,e[11]=u,e[12]=g,e[13]=v}else v=e[13];return v}function Ri(t){return r.jsx(Ai,{item:t},t.key)}async function Ti(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function Bi(t,e,{hosted:s}){return s&&t!==null?t:e}function Ii(t,e){const s=B.c(11),[a,n]=V.useState(null);let o;s[0]!==a||s[1]!==t||s[2]!==e?(o=Bi(a,t,e),s[0]=a,s[1]=t,s[2]=e,s[3]=o):o=s[3];let d;s[4]!==t||s[5]!==e?(d=()=>n(e.hosted?t:null),s[4]=t,s[5]=e,s[6]=d):d=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n(null),s[7]=l):l=s[7];let i;return s[8]!==o||s[9]!==d?(i={shown:o,hold:d,release:l},s[8]=o,s[9]=d,s[10]=i):i=s[10],i}function Di({open:t,hosted:e}){return t||e}function qa(t){return Pl({userName:t?.name,userEmail:t?.email})??void 0}function Cs(t){const e=B.c(18),{state:s,header:a,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let u;e[0]!==a?(u=r.jsx("div",{className:"space-y-0.5 px-4 py-3",children:a}),e[0]=a,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==o?(h=o?r.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=h):h=e[4];let f;e[5]!==n||e[6]!==h?(f=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"border-t"}),e[8]=p):p=e[8];let g;e[9]!==l?(g=r.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=g):g=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==i||e[14]!==u||e[15]!==f||e[16]!==g?(m=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,c,f,d,p,g]}),e[11]=d,e[12]=s,e[13]=i,e[14]=u,e[15]=f,e[16]=g,e[17]=m):m=e[17],m}function Xt(t){const e=B.c(2),{children:s}=t;let a;return e[0]!==s?(a=r.jsx("div",{className:"scroll-fade min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain px-4 pt-3 pb-2 [scrollbar-width:thin]",children:s}),e[0]=s,e[1]=a):a=e[1],a}function Ka(t){const e=B.c(10);let s,a,n;e[0]!==t?({className:a,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==a?(o=X("rounded-lg border bg-card px-3 py-2.5",a),e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==o?(d=r.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function ht(t){const e=B.c(4),{className:s}=t;let a;e[0]!==s?(a=X("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=a):a=e[1];let n;return e[2]!==a?(n=r.jsx("div",{className:a}),e[2]=a,e[3]=n):n=e[3],n}function Ut(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(Ka,{children:r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(ht,{className:"size-4 rounded-md"}),r.jsx(ht,{className:"h-3 w-24"}),r.jsx(ht,{className:"h-2.5 w-16"}),r.jsx(ht,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const Fi="secret";function Va(t){return t.kind!=="block"?null:t.namedRule??null}function $i(t,e){const s=e.find(a=>a&&typeof a=="object");return s?bl(s.__resolveType):$a(t)}const Li=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function mn(t){const e=Li.exec(t)?.[1];return e?Gl(e):null}function xs(t){if(!t)return null;try{const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return null}function Mi(t,e){return t===null?"new":e===null?"removed":"edited"}function Ga(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim();return e?(e.charAt(0).toUpperCase()+e.slice(1)).replace(/\s+[A-Z](?=[a-z])/g,s=>s.toLowerCase()):t}function Gt(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const a=t.__resolveType;if(typeof a=="string"&&a.trim()){if(s)return yr(a);const o=(a.split("/").pop()??a).replace(/\.[jt]sx?$/,"");return Ga(o)||o}}return`Section ${e+1}`}function pn(t){if(Yn(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&jr(e)?t.section??null:null}const Wa=6;function ms(t,e=0){if(e>Wa||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>ms(n,e+1));const s=t;if(Js(s.__resolveType))return _s(s).flatMap(n=>ms(n?.value,e+1));const a=pn(s);return a!==null?ms(a,e+1):[s]}function _s(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Ln(t){let e=t;for(let s=0;s<Wa;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const a=e;if(Js(a.__resolveType))return a;const n=pn(a);if(n===null)return null;e=n}return null}function _i(t,e,s){const a=_s(Ln(t)),n=e?_s(Ln(e)):[],o=e?Array.from({length:Math.max(a.length,n.length)},(i,u)=>u).filter(i=>!As(a[i],n[i])):[],l=[...o.map(i=>a[i]??n[i]),...a.filter((i,u)=>!o.includes(u))].flatMap(i=>ms(i?.value)).map(i=>Gt(i,s,!0));return[...new Set(l)]}function Fs(t,e,s,a,n){let o=t,d=!1;for(let i=0;i<4;i++){if(!o||typeof o!="object"||Array.isArray(o)){d=!0;break}const u=o;if(Js(u.__resolveType)){d=!0;break}const c=pn(u);if(c===null)break;o=c}const l=d?_i(t,n,e):[];return{name:Gt(d?t:o,e,!0),kind:"section",status:s,fields:a,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function Os(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((a,n)=>a&&typeof a=="object"&&!Array.isArray(a)?[{section:a,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const a=s.variants;if(Array.isArray(a))return a.flatMap((n,o)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&Yn(d),i=l?d.value:d;if(!Array.isArray(i))return[];const u=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((c,h)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...u,h]}]:[])})}return[]}function Mn(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const a=s;return Object.keys(a).sort().reduce((n,o)=>(n[o]=a[o],n),{})}return s})}function As(t,e){return t===void 0&&e===void 0?!0:Mn(t)===Mn(e)}function Mt(t,e,s,a=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const d of n){if(d.startsWith("__")||a.has(d))continue;const l=t?t[d]:void 0,i=e?e[d]:void 0;As(l,i)||o.push({label:Ga(d),path:[...s,d],from:l,to:i})}return o}function Oi(t,e){const s=e.find(a=>a&&typeof a=="object");return s?s.__resolveType===Sl:t===kl}function Ei(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),a=[];for(const n of Mt(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?a.push(...Mt(n.from??{},n.to??{},[o])):a.push(n)}return a}const Ui=new Set(["sections"]);function bn(t,e,s=!1){const a=t?Os(t,s):[],n=e?Os(e,s):[],o=[],d=Math.max(a.length,n.length);for(let i=0;i<d;i++){const u=a[i],c=n[i];if(!s){const h=zi(u,c,i);h&&o.push(h);continue}if(u&&c){if(As(u.section,c.section))continue;o.push(Fs(c.section,i,"edited",Mt(u.section,c.section,c.basePath),u.section))}else c?o.push(Fs(c.section,i,"new",[])):u&&o.push(Fs(u.section,i,"removed",[]))}const l=Mt(t,e,[],Ui);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function zi(t,e,s){return t&&e?As(t.section,e.section)?null:{name:Gt(e.section,s),kind:"section",status:"edited",fields:Mt(t.section,e.section,e.basePath)}:e?{name:Gt(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:Gt(t.section,s),kind:"section",status:"removed",fields:[]}:null}function Es(t,e){return{kind:"other",blockKey:null,name:t.split("/").pop()??t,pagePath:null,isSiteApp:!1,status:e,filepaths:[t],sections:[],fromJson:null,toJson:null}}function Hi(t){const e=[],s=[],a=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(cn(o)){n.push(o);continue}const l=Mi(d.from,d.to),i=mn(o);if(!i){a.push(Es(o,l));continue}const u=xs(d.from),c=xs(d.to),h=c??u;if(!h){a.push(Es(o,l));continue}const f=Vt(i,h);if(f){e.push({kind:"page",blockKey:i,name:f.name,pagePath:f.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?bn(u,c):[],fromJson:u,toJson:c});continue}const p=rn(i,h);s.push({kind:"block",blockKey:i,name:bs(i,h),pagePath:null,isSiteApp:p,status:l,filepaths:[o],sections:l==="edited"?[{name:bs(i,h),kind:"section",status:"edited",fields:Mt(u,c,[])}].filter(g=>g.fields.length>0):[],fromJson:u,toJson:c})}return Qa({pages:e,blocks:s,other:a,generated:n})}function $s(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function Qa(t){const{pages:e,blocks:s,other:a,generated:n}=t;return e.sort($s),s.sort($s),a.sort($s),{pages:e,blocks:s,other:a,generated:n,count:e.length+s.length+a.length}}function qi(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function Ja(t){return t.startsWith("pages-")}function Ya(t){const{files:e,lookup:s,diff:a}=t,n=[],o=[],d=[],l=[];for(const i of e){const u=i.path;if(cn(u)){l.push(u);continue}const c=qi(i.status),h=mn(u);if(!h){d.push(Es(u,c));continue}const f=a?.diffs[u],p=xs(f?.from??null),g=xs(f?.to??null),m=Xa(s,h),b=m??g??p;if((m?Vt(h,m):null)??(!m&&Ja(h))){const y=b?Vt(h,b):null;n.push({kind:"page",blockKey:h,name:y?.name??Fa(h),pagePath:y?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?bn(p,g):[],fromJson:p,toJson:g??(c==="new"?m:null)});continue}const P=bs(h,b??{});o.push({kind:"block",blockKey:h,name:P,pagePath:null,isSiteApp:rn(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:P,kind:"section",status:"edited",fields:Mt(p,g,[])}].filter(y=>y.fields.length>0):[],fromJson:p,toJson:g})}return Qa({pages:n,blocks:o,other:d,generated:l})}function Xa(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Ki(t,e){return t??e}function Za(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const Ls=3;function ds(t){if(t.length<=Ls)return Za(t);const e=t.length-Ls;return`${t.slice(0,Ls).join(", ")} and ${e} more`}function Vi(t,e){if(!e){const a=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return a.length>0?`${t.name} (${a.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(a=>a.kind==="section").flatMap(a=>a.wrapper?a.held??[]:[a.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function Gi(t){const e=Va(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function Wi(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),a=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${ds(s.map(l=>Vi(l,!!t.v8)))}`),a.length>0){const l=a.length===1?"page":"pages";e.push(`added the ${ds(a.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${ds(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(Gi);if(o.length>0&&e.push(`changed ${ds(o)}`),t.other.length>0){const l=t.other.length===1?"file":"files";e.push(`changed ${t.other.length} ${l}`)}if(e.length===0)return"";const d=Za(e);return wl(d.charAt(0).toUpperCase()+d.slice(1))}function Qi(t,e){return t?Os(t,e).length:0}function Ji(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?Qi(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const a of t.sections){if(a.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=a.fields.length}return s}const _n="••••••";function Jt(t){if(Array.isArray(t))return t.map(Jt);if(!t||typeof t!="object")return t;const e=t,s={};for(const[a,n]of Object.entries(e))s[a]=Jt(n);return e.__resolveType===Fi&&"ciphertext"in e&&(s.ciphertext=_n),wr(e)&&"encrypted"in e&&(s.encrypted=_n),s}function On(t){return t.map(e=>({...e,from:Jt(e.from),to:Jt(e.to)}))}function Yi(t){const{changes:e,sides:s,lookup:a,meta:n,missingRules:o,missingRuleUses:d,hosted:l}=t,i=[],u=[],c=f=>[...new Set((s?.diagnostics??[]).filter(p=>wn(Pr(p.file))===wn(f)).map(p=>p.side))],h=Object.keys(e).sort((f,p)=>f<p?-1:f>p?1:0);for(const f of h){const p=e[f],g=p.kind==="delete"?"removed":p.baseVersion===null?"new":"edited",m=s?.entries[f],b=m?.before??null,x=m?.after??null,P=Xa(a,f),y=P??x??b,v=c(f),w=o?.get(f),j=$a(f),N=j?d?.get(j):void 0,C={blockKey:f,status:g,filepaths:[],entry:{name:f,version:p.version},...v.length>0?{unreadable:v}:{},...w&&w.length>0?{missingRules:w}:{},...j&&N&&N.pages+N.sections>0?{missingRuleUses:{kind:j,...N}}:{},fromJson:Jt(b),toJson:Jt(x??(g==="new"?P:null))},R=P?Vt(f,P,n):null,k=!P&&y?Vt(f,y,n):null;if(R??k??(!y&&Ja(f))){const T=y?Vt(f,y,n):null;i.push({...C,kind:"page",name:T?.name??Fa(f),pagePath:T?.path??null,isSiteApp:!1,sections:g==="edited"?bn(b,x,!0).map(M=>({...M,fields:On(M.fields)})):[]});continue}const A=l?ml(f,y,P,x,b):null,S=A?pl(A,[y,P,x,b]):bs(f,y??{}),$=$i(f,[P,x,b]),F=Oi(f,[P,x,b]);u.push({...C,kind:"block",name:F?"Settings":S,...F?{cmsSettings:!0}:{},...A?{blogKind:A}:{},...$?{namedRule:$}:{},pagePath:null,isSiteApp:rn(f,P??y??{}),sections:g==="edited"?[{name:F?"Settings":S,kind:"section",status:"edited",fields:On(F?Ei(b,x):Mt(b,x,[]))}].filter(T=>T.fields.length>0):[]})}return{pages:i,blocks:u,other:[],generated:[],count:i.length+u.length,v8:!0}}function Be(t){return t.filepaths[0]??t.blockKey??t.name}function Xi(t){const e=t.pages+t.sections===1,s=t.names===1;return t.kind==="experiments"?s?e?"thread.publishPopover.missingTestUsesOne":"thread.publishPopover.missingTestUses":e?"thread.publishPopover.missingTestsUsesOne":"thread.publishPopover.missingTestsUses":s?e?"thread.publishPopover.missingCampaignUsesOne":"thread.publishPopover.missingCampaignUses":e?"thread.publishPopover.missingCampaignsUsesOne":"thread.publishPopover.missingCampaignsUses"}function Zi(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function eo(t,e){const s=t.kind==="block"?Il:ya;return r.jsx("span",{title:Zi(t.status,e),className:"flex shrink-0",children:r.jsx(s,{className:X("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function to(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return gl(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=Va(t);return s==="experiments"?e("thread.publishPopover.abTests"):s==="campaigns"?e("thread.publishPopover.campaignDates"):t.isSiteApp?e("thread.publishPopover.siteConfiguration"):e("thread.publishPopover.globalSection")}function so(t,e,s){const a=Ji(t,s);if(a.newPageSections!==null)return[a.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:a.newPageSections})];const n=[];return a.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):a.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:a.sections})),a.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):a.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:a.fields})),a.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function er(t){const e=B.c(72),{change:s,bodyPending:a,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:c,v8:h,alsoChangedOnMain:f}=t,p=a===void 0?!1:a,g=h===void 0?!1:h,m=f===void 0?!1:f,b=ye();let x;e[0]!==s||e[1]!==b?(x=to(s,b),e[0]=s,e[1]=b,e[2]=x):x=e[2];const P=x;let y,v,w,j,N,C,R,k;if(e[3]!==p||e[4]!==s||e[5]!==d||e[6]!==P||e[7]!==c||e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==b||e[14]!==g){const $=so(s,b,g);let F;e[23]!==s.missingRules?(F=s.missingRules??[],e[23]=s.missingRules,e[24]=F):F=e[24];const T=F,M=s.missingRuleUses,O=M?Fl(b,M):null,ee=p&&$.length===0&&s.status==="edited";y=Ka;const re=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";e[25]!==re?(j=X("cursor-pointer transition-colors hover:bg-accent",re),e[25]=re,e[26]=j):j=e[26],e[27]!==s?(N=Be(s),e[27]=s,e[28]=N):N=e[28],C=o;let H;e[29]!==s||e[30]!==b?(H=eo(s,b),e[29]=s,e[30]=b,e[31]=H):H=e[31];let L;e[32]!==s.cmsSettings||e[33]!==s.name||e[34]!==b?(L=s.cmsSettings?b("thread.publishPopover.settings"):s.name,e[32]=s.cmsSettings,e[33]=s.name,e[34]=b,e[35]=L):L=e[35];let z;e[36]!==L?(z=r.jsx("span",{className:"truncate text-sm font-medium",children:L}),e[36]=L,e[37]=z):z=e[37];let te;e[38]!==P?(te=P?r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:P}):null,e[38]=P,e[39]=te):te=e[39];let W;e[40]!==n||e[41]!==z||e[42]!==te?(W=r.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[z,te]}),e[40]=n,e[41]=z,e[42]=te,e[43]=W):W=e[43];let I;e[44]!==d||e[45]!==c||e[46]!==u||e[47]!==l||e[48]!==i||e[49]!==b?(I=d?r.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[r.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:J=>{J.stopPropagation(),l(!1)},children:b("thread.publishDialog.cancel")}),r.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:J=>{J.stopPropagation(),l(!1),i?.()},disabled:c,children:b("thread.publishPopover.discard")})]}):i?r.jsx(Ss,{children:r.jsxs(St,{children:[r.jsx(kt,{asChild:!0,children:r.jsx(ve,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":b("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:J=>{J.stopPropagation(),l(!0)},disabled:u||c,children:r.jsx(Ns,{className:"size-3.5"})})}),r.jsx(Nt,{children:b("thread.publishPopover.discard")})]})}):null,e[44]=d,e[45]=c,e[46]=u,e[47]=l,e[48]=i,e[49]=b,e[50]=I):I=e[50],e[51]!==H||e[52]!==W||e[53]!==I?(R=r.jsxs("div",{className:"flex items-center gap-2.5",children:[H,W,I]}),e[51]=H,e[52]=W,e[53]=I,e[54]=R):R=e[54],k=$.length>0?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:$.map(no)}):ee?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:r.jsx(ht,{className:"h-4 w-2/3"})}):null,e[55]!==T||e[56]!==b?(v=T.length>0?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-foreground","data-testid":"publish-change-missing-rule",children:T.map(J=>r.jsx("div",{className:"truncate",children:b(J==="experiments"?"thread.publishPopover.missingTest":"thread.publishPopover.missingCampaign")},J))}):null,e[55]=T,e[56]=b,e[57]=v):v=e[57],w=M&&O?r.jsx("div",{className:"mt-1 truncate pl-[26px] text-xs text-foreground","data-testid":"publish-change-missing-rule-uses",children:b(Xi(M),{places:O.places})}):null,e[3]=p,e[4]=s,e[5]=d,e[6]=P,e[7]=c,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=b,e[14]=g,e[15]=y,e[16]=v,e[17]=w,e[18]=j,e[19]=N,e[20]=C,e[21]=R,e[22]=k}else y=e[15],v=e[16],w=e[17],j=e[18],N=e[19],C=e[20],R=e[21],k=e[22];let A;e[58]!==m||e[59]!==s.name||e[60]!==b?(A=m?r.jsx("div",{className:"mt-1 pl-[26px] text-xs text-muted-foreground","data-testid":"publish-change-also-changed",children:b("thread.publishPopover.alsoChangedOnMain",{name:s.name})}):null,e[58]=m,e[59]=s.name,e[60]=b,e[61]=A):A=e[61];let S;return e[62]!==y||e[63]!==v||e[64]!==w||e[65]!==A||e[66]!==j||e[67]!==N||e[68]!==C||e[69]!==R||e[70]!==k?(S=r.jsxs(y,{className:j,"data-change-id":N,onClick:C,children:[R,k,v,w,A]}),e[62]=y,e[63]=v,e[64]=w,e[65]=A,e[66]=j,e[67]=N,e[68]=C,e[69]=R,e[70]=k,e[71]=S):S=e[71],S}function no(t,e){return r.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function tr(){const t=B.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:-1,height:-1},t[0]=e):e=t[0];const[s,a]=V.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>a(c=>c.width===l.clientWidth&&c.height===l.clientHeight?c:{width:l.clientWidth,height:l.clientHeight});i();const u=new ResizeObserver(i);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const o=n;let d;return t[2]!==s?(d=[s,o],t[2]=s,t[3]=d):d=t[3],d}function ao(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const ro=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function En(t){const e=B.c(10),{height:s}=t,a=ye();let n;e[0]!==s?(n={height:s},e[0]=s,e[1]=n):n=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=ro.map(lo),e[2]=o):o=e[2];let d;e[3]!==a?(d=a("thread.publishDialog.openingComparison"),e[3]=a,e[4]=d):d=e[4];let l;e[5]!==d?(l=r.jsx("div",{className:"flex items-center justify-center pt-1 text-2xs text-muted-foreground",children:d}),e[5]=d,e[6]=l):l=e[6];let i;return e[7]!==n||e[8]!==l?(i=r.jsxs("div",{style:n,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[o,l]}),e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function lo(t,e){return r.jsxs("div",{className:X("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[r.jsx("div",{className:X("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),r.jsx("div",{className:X("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const sr={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},io={...sr,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function oo(t){const e=B.c(11),{diff:s,emptyMessage:a,rowClassName:n,onDiscardFile:o,hideFileRows:d,editorHeight:l}=t,i=a===void 0?"No file changes in the working tree":a,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=l===void 0?"380px":l,[f,p]=V.useState(null),[g,m]=V.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=ao(),e[0]=b):b=e[0];const x=b;if(!s||Object.keys(s.diffs).length===0){let y;return e[1]!==i?(y=r.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=y):y=e[2],y}let P;return e[3]!==s.diffs||e[4]!==g||e[5]!==h||e[6]!==f||e[7]!==c||e[8]!==o||e[9]!==u?(P=r.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(y=>{const[v,w]=y,{from:j,to:N}=w,C=f===v,R=j===null,k=N===null,A=v.startsWith("/")?v.slice(1):v,S=A.lastIndexOf("/"),$=S>=0?A.slice(S+1):A,F=S>=0?A.slice(0,S):null,T=Wl(v),M=R?"bg-success":k?"bg-destructive":"bg-warning";return c?r.jsx("div",{children:r.jsx(Bn,{original:j??"",modified:N??"",language:T,theme:x,height:h,loading:r.jsx(En,{height:h}),options:io})},v):r.jsxs("div",{children:[r.jsxs("div",{className:X("flex items-center gap-3 py-3 hover:bg-accent",u),children:[r.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>p(C?null:v),children:r.jsx(Jn,{className:X("h-3.5 w-3.5 transition-transform",C&&"rotate-90")})}),r.jsx("div",{className:X("h-2.5 w-2.5 shrink-0 rounded-full",M)}),r.jsx(ya,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:$}),F&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F}),o?r.jsxs(js,{children:[r.jsx(vs,{asChild:!0,children:r.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:r.jsx(Sr,{className:"h-3.5 w-3.5"})})}),r.jsx(ys,{align:"end",children:r.jsx(Wt,{className:"text-destructive focus:text-destructive",onSelect:()=>m(v),children:"Discard changes"})})]}):null]}),g===v&&o?r.jsxs("div",{className:X("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[r.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",r.jsx("span",{className:"font-medium",children:$}),"? This cannot be undone."]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),r.jsx(ve,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(v)},children:"Discard"})]})]}):null,C&&r.jsx("div",{className:"border-t",children:r.jsx(Bn,{original:j??"",modified:N??"",language:T,theme:x,height:h,loading:r.jsx(En,{height:h}),options:sr})})]},v)})}),e[3]=s.diffs,e[4]=g,e[5]=h,e[6]=f,e[7]=c,e[8]=o,e[9]=u,e[10]=P):P=e[10],P}function co(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&Xl(e)?t.blockKey:null}function uo(t){return t.kind!=="page"?!0:!t.pagePath||Lt(t.pagePath).length>0}function ho(t,e){try{return Jl(t,vl,e)}catch{return null}}function fo(t,e,s){if(!e)return;const a=xl(e,t);if(!a)return null;if(Lt(a.path).length===0||s?.path!==a.path)return a.path;const n=ln(a.path,s.params);return Lt(n).length===0?n:a.path}function mo(t){return t.sectionKey&&!t.v8?ho(t.previewServerUrl,t.sectionKey):bo(t.previewServerUrl,t.path)}function po(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Lt(s).length===0)return s;if(e?.path!==s)return"";const a=ln(s,e.params);return Lt(a).length===0?a:""}function bo(t,e){const s=e.trim();if(!s||Lt(s).length>0)return null;try{const a=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,a);return n.origin===a.origin?n:null}catch{return null}}function go(t,e){return e?.kind==="pointer"&&e.link?hn(t.toString(),e.link):nr(t,e)}function nr(t,e){if(!e)return null;if(e.kind==="pointer")return hn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function xo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function vo(t,e){const s=e?t.kind==="page":t.kind!=="other";return{before:s&&t.status==="new"?"new":null,after:s&&t.status==="removed"?"removed":null}}const ar=V.createContext(!0),yo=["split","before","after","code"];function jo(t){return yo.includes(t)}const rr={desktop:1280,mobile:412};function Po(t,e){const s=(o,d)=>t.unreadable?.includes(d)?e:o?`${JSON.stringify(o,null,2)}
1
+ import{c as B,b as ye,r as V,j as r,B as ve,l as X,K as zt,as as br,b4 as gr,ay as Jn,aD as xr,X as Wt,t as $t,aM as zs,aN as Hs,aO as qs,aP as Ks,bm as Vs,aQ as Gs,aR as Ws,aS as Qs,V as vs,Y as ys,Z as js,a as Ps,a4 as ws,cs as vr,h as Qt,f7 as Yn,f8 as Js,bJ as yr,bd as jr,bj as wn,f9 as Pr,c0 as wr,at as Sr,I as kr,a7 as Nr,fa as Cr,U as Xn,m as Rt,eQ as Ys,q as Zn,H as ea,D as ta,x as sa,v as na,Q as aa,M as ra,fb as Ar,bn as la,a5 as ia,b8 as Xs,e as Sn,C as Rr,R as Tr}from"./index-CD3fj83c.js";import{S as Br}from"./separator-DnXEcPkq.js";import{f as Ir,u as Zt,r as oa,l as ca,c as da,b as Dr}from"./chat-context-B0QfMtK7.js";import{u as Ht,ab as Fr,c as ua,b as ha,ac as $r,ad as Lr,ae as Mr,_ as _r,af as Or,D as Zs,B as fa,ag as Er,L as ma,z as Ur,w as pa}from"./site-editor-toast-qpDJ9c8x.js";import{L as zr,a as Hr}from"./shell-layout-BHS6wDGg.js";import{I as ba}from"./toolbar-icon-button-DZ8JPQ_p.js";import{P as qr,a as Kr,b as Vr}from"./popover-DNa0geGd.js";import{c as St,T as kt,a as Nt,b as Ss}from"./tooltip-BFOA909d.js";import{d as Gr,e as Wr,c as Qr,C as kn,a as Nn,b as Cn}from"./command-DMjv9UCp.js";import{T as Et,a as ga,c as xa}from"./tabs-Dsn3YxbL.js";import{t as va}from"./ChevronUp-zgLSJo7N.js";import{aF as ks,H as Jr,a as ya,aG as Yr,b as ja,aH as Pa,O as Xr}from"./agent-icon-CXyyqpMa.js";import{i as wa}from"./DotsVertical-DkVpKTIv.js";import{b as Sa}from"./Tool01-D_DzUkH6.js";import{s as ka}from"./Plus-DCMQMI-9.js";import{s as Ns}from"./Trash01-D5WxxfhG.js";import{u as en,r as Bs,a as An,n as Is,g as tn,b as sn}from"./use-releases-BgQagTY2.js";import{k as Zr,d as el,j as Rn}from"./thread-intent-CIa2mqqt.js";import{h as Na,r as Ca,g as tl,f as et,a as nn,j as Aa}from"./repository-binding-BpxbVNK2.js";import{u as sl}from"./use-debounced-value-Bvr3c0Bg.js";import{u as nl}from"./use-clock-tick-9j5u-Rtx.js";import{u as al}from"./useInfiniteQuery-BPkTbU3d.js";import{e as rl,c as ll,p as il,g as Ra,h as Ta,i as Ba}from"./use-navigate-to-agent-BZyzGjVW.js";import{a as Tn}from"./virtual-mcp-AzZIPPoU.js";import{u as Ia,c as ol,e as cl}from"./experiments-tab-choice-9WDva_co.js";import{G as Da}from"./repository-picker-D1FdmUjm.js";import{u as an}from"./use-session-runtime-DYJ3pOXd.js";import{u as dl,c as ul,d as hl,e as fl}from"./use-fast-preview-draft-url-B40YryGZ.js";import{ab as Vt,ac as Fa,w as bs,l as rn,ad as $a,ae as ml,af as pl,x as bl,ag as gl,j as xl,u as Lt,f as ln,ah as vl}from"./parse-sections-B9Tf8cb0.js";import"./index-CQr86l05.js";import{T as yl}from"./textarea-DHsxWS9H.js";import{i as on}from"./CheckCircle-D7olxQBc.js";import{s as gs}from"./Image01-DqO4SvqB.js";import{r as jl}from"./hosted-publish-feedback-BSdcqLMQ.js";import{n as Pl,s as wl,C as Sl,a as kl,b as Nl,M as Cl,c as Al,d as Rl,m as Tl,u as Bl}from"./use-cms-publish-actions-CpgSJalU.js";import{a as Il,g as Dl}from"./UserSquare-BpdCC6Kq.js";import{n as Fl,b as $l,m as Ll}from"./named-rule-uses-DbKcBg9W.js";import{i as cn,b as La,m as Ml,h as _l,c as Ma,f as _a,d as Ol,r as dn,e as El,n as Ul,g as zl,j as Hl,k as ql,l as un,o as Kl,p as Oa,q as Vl,s as Ea,t as Ds}from"./sandbox-git-api-DcqI6XE4.js";import{b as Gl,g as Wl}from"./utils-BzZnpE20.js";import{i as Ql}from"./Monitor01-is8ZyUQC.js";import{w as hn,g as Jl,D as Yl}from"./section-preview-url-7zfngvgW.js";import{w as fn}from"./device-hint-SeLRi17j.js";import{w as Bn}from"./editor-BPHWgsFO.js";import{d as Xl,a as Zl,R as Ua}from"./section-array-field-oWK_IMJM.js";import{s as za}from"./save-changes-debug-nBi-n9eV.js";import{u as ei}from"./releases-api-CJKOs4iF.js";import{u as ti}from"./use-mcp-client-BHU-qsif.js";import{u as si}from"./use-sandbox-events-BbmfXv6n.js";import{b as ni,a as ai}from"./sandbox-lifecycle-context-CP46WhuD.js";import{b as ri}from"./thread-route-OlD3VCew.js";function li(t){const{value:e,baseBranch:s,releases:a,baseIsDraft:n=!1}=t,o=!n&&!!e&&e===s,d=a.find(i=>i.branch===e);return{isBase:o,current:d,unlisted:!o&&!d&&!!e}}const ii={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},In=1114111;function Dn(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const a=Number.parseInt(s.slice(2),16);return!Number.isFinite(a)||a>In?e:String.fromCodePoint(a)}if(s.startsWith("#")){const a=Number.parseInt(s.slice(1),10);return!Number.isFinite(a)||a>In?e:String.fromCodePoint(a)}return ii[s]??e}):""}function oi(t){const e=B.c(39),{url:s,onSave:a}=t,n=ye(),[o,d]=V.useState(s??"");let l;e[0]!==o?(l=o.trim(),e[0]=o,e[1]=l):l=e[1];const i=l;let u;e[2]!==a||e[3]!==i?(u=()=>a(i?Zr(i):null),e[2]=a,e[3]=i,e[4]=u):u=e[4];const c=u;let h;e[5]!==n?(h=n("thread.branchPicker.localHint"),e[5]=n,e[6]=h):h=e[6];let f;e[7]!==h?(f=r.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=f):f=e[8];let p;e[9]!==n?(p=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=p):p=e[10];let g;e[11]!==n?(g=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=g):g=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=C=>d(C.target.value),e[13]=m):m=e[13];let b;e[14]!==c||e[15]!==i?(b=C=>{C.key==="Enter"&&i&&c()},e[14]=c,e[15]=i,e[16]=b):b=e[16];let x;e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==o?(x=r.jsx("input",{type:"url",inputMode:"url","aria-label":p,placeholder:g,value:o,onChange:m,onKeyDown:b,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=p,e[18]=g,e[19]=b,e[20]=o,e[21]=x):x=e[21];let P;e[22]!==a||e[23]!==n||e[24]!==s?(P=s?r.jsx(ve,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>a(null),children:n("thread.branchPicker.localTurnOff")}):r.jsx("span",{}),e[22]=a,e[23]=n,e[24]=s,e[25]=P):P=e[25];const y=!i;let v;e[26]!==n?(v=n("thread.branchPicker.save"),e[26]=n,e[27]=v):v=e[27];let w;e[28]!==c||e[29]!==y||e[30]!==v?(w=r.jsx(ve,{size:"sm",disabled:y,onClick:c,children:v}),e[28]=c,e[29]=y,e[30]=v,e[31]=w):w=e[31];let j;e[32]!==P||e[33]!==w?(j=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,w]}),e[32]=P,e[33]=w,e[34]=j):j=e[34];let N;return e[35]!==j||e[36]!==f||e[37]!==x?(N=r.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[f,x,j]}),e[35]=j,e[36]=f,e[37]=x,e[38]=N):N=e[38],N}function ci(t){const e=B.c(8),{virtualMcpId:s,branch:a,serve:n,rowRef:o,onPicked:d}=t,l=Ht(s,a),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>di(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let h;return e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==c?(h=r.jsx(ui,{rowRef:o,selected:i,connected:u,onSelect:c}),e[3]=o,e[4]=i,e[5]=u,e[6]=c,e[7]=h):h=e[7],h}function di(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??Fr})}function ui(t){const e=B.c(19),{rowRef:s,selected:a,connected:n,onSelect:o}=t,d=ye(),l=a?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=X("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=u):u=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==c?(h=r.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let f;e[7]!==n||e[8]!==d?(f=n&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d("thread.branchPicker.localhost.connected")}),e[7]=n,e[8]=d,e[9]=f):f=e[9];let p;e[10]!==o||e[11]!==a||e[12]!==h||e[13]!==f?(p=r.jsxs("button",{type:"button","aria-pressed":a,onClick:o,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,f]}),e[10]=o,e[11]=a,e[12]=h,e[13]=f,e[14]=p):p=e[14];let g;return e[15]!==s||e[16]!==i||e[17]!==p?(g=r.jsx("div",{ref:s,className:i,children:p}),e[15]=s,e[16]=i,e[17]=p,e[18]=g):g=e[18],g}const hi=10080*60*1e3;function fi({sandboxMap:t,userId:e,rawBranches:s,now:a}){const n=new Map;for(const[h,f]of Object.entries(t??{}))for(const[p,g]of Object.entries(f??{})){let m=n.get(p);m||(m={userIds:new Set,lastActiveAt:0},n.set(p,m)),m.userIds.add(h);for(const b of Object.values(g??{})){const x=b?.createdAt??0;x>m.lastActiveAt&&(m.lastActiveAt=x)}}const o=a-hi,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,f)=>f[1].lastActiveAt-h[1].lastActiveAt).map(([h,f])=>({name:h,source:"recent",contributors:[...f.userIds],lastActiveAt:f.lastActiveAt})),l=new Set(d.map(h=>h.name)),i=new Set(Object.keys(t?.[e]??{})),u=[...i].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),c=s.filter(h=>!i.has(h.name)&&!l.has(h.name)).map(h=>({name:h.name,source:"other",author:h.author??null}));return{recent:d,yours:u,others:c}}const mi=100,pi=50,bi=300;function Ms(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function gi(t){const e=B.c(39),{orgId:s,orgSlug:a,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:u,enabled:c}=t,h=u===void 0?"":u,f=c===void 0?!0:c;let p;e[0]!==h?(p=h.trim(),e[0]=h,e[1]=p):p=e[1];const g=p,m=sl(g,bi);let b;e[2]!==o?(b=Na(o),e[2]=o,e[3]=b):b=e[3];const x=b,P=g.length>0;let y;e[4]!==m||e[5]!==s||e[6]!==a||e[7]!==l||e[8]!==i||e[9]!==o?(y=zt.githubBranchSearch(s,a,Ca(o),l,i,m),e[4]=m,e[5]=s,e[6]=a,e[7]=l,e[8]=i,e[9]=o,e[10]=y):y=e[10];const v=f&&x;let w;e[11]!==m||e[12]!==a||e[13]!==o?(w=Y=>{const{pageParam:ne}=Y;return br(a,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?pi:mi,cursor:ne})},e[11]=m,e[12]=a,e[13]=o,e[14]=w):w=e[14];let j;e[15]!==m?(j=Y=>m?void 0:Y.nextCursor??void 0,e[15]=m,e[16]=j):j=e[16];let N;e[17]!==y||e[18]!==v||e[19]!==w||e[20]!==j?(N={queryKey:y,enabled:v,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:w,getNextPageParam:j},e[17]=y,e[18]=v,e[19]=w,e[20]=j,e[21]=N):N=e[21];const{data:C,isLoading:R,isError:k,isFetching:A,hasNextPage:S,isFetchingNextPage:$,fetchNextPage:F}=al(N),T=P&&(m!==g||A),M=(C?.pages??[]).flatMap(xi),O=nl(6e4),ee=fi({sandboxMap:d,userId:n,rawBranches:M,now:O});let re;e[22]!==g?(re=Y=>Ms(Y.name,g),e[22]=g,e[23]=re):re=e[23];const H=ee.recent.filter(re);let L;e[24]!==g?(L=Y=>Ms(Y.name,g),e[24]=g,e[25]=L):L=e[25];const z=ee.yours.filter(L),te=ee.others,W=C?.pages[0],I=P&&W&&!T?Math.max(0,W.totalCount-W.branches.length):0,J=!P&&S;let U;e[26]!==F?(U=()=>{F()},e[26]=F,e[27]=U):U=e[27];let oe;return e[28]!==I||e[29]!==k||e[30]!==$||e[31]!==R||e[32]!==T||e[33]!==te||e[34]!==H||e[35]!==J||e[36]!==U||e[37]!==z?(oe={recent:H,yours:z,others:te,isLoading:R,isError:k,isSearching:T,hiddenMatchCount:I,hasMore:J,isFetchingMore:$,fetchMore:U},e[28]=I,e[29]=k,e[30]=$,e[31]=R,e[32]=T,e[33]=te,e[34]=H,e[35]=J,e[36]=U,e[37]=z,e[38]=oe):oe=e[38],oe}function xi(t){return t.branches}function vi(t){const e=B.c(239),{virtualMcpId:s,isV8:a,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:u,userId:c,target:h,owner:f,repo:p,sandboxMap:g,onChange:m,onCreateBranch:b,onAdoptBranch:x,disabled:P,spawnsNewChat:y,placement:v}=t,w=a===void 0?!1:a,j=l===void 0?!1:l,N=P===void 0?!1:P,C=y===void 0?!1:y,R=v===void 0?"chat":v,k=ye(),A=R==="header",[S,$]=V.useState(!1),[F,T]=V.useState(!1),[M,O]=V.useState("branches"),[ee,re]=V.useState(null),[H,L]=V.useState(""),[z,te]=V.useState(null),W=V.useRef(null),{releases:I,createRelease:J,renameRelease:U,deleteRelease:oe}=en(s),{url:Y,setUrl:ne,clear:D}=ua(s),se=ha(s),le=w&&!!se.connection,he=w?se.connection?.endpoint??null:Y,G=!!he;let pe;e[0]!==D||e[1]!==w||e[2]!==se?(pe=()=>{D(),w&&se.clear()},e[0]=D,e[1]=w,e[2]=se,e[3]=pe):pe=e[3];const Z=pe;let E;e[4]!==S?(E={enabled:S},e[4]=S,e[5]=E):E=e[5];const{data:q}=gr(E);let ce;e[6]!==q?.data?.members?(ce=ue=>ue?q?.data?.members?.find(dt=>dt.userId===ue)?.user?.name??void 0:void 0,e[6]=q?.data?.members,e[7]=ce):ce=e[7];const we=ce,fe=I.length>=Tn;let Me;e[8]!==k?(Me=k("thread.branchPicker.capReached",{max:Tn}),e[8]=k,e[9]=Me):Me=e[9];const _=Me;let ae,Oe,_e,Ee,ft,tt,je,Ie,$e,De,Pe,Fe,Se,Le,st,mt,Re,de,K,xe,ke,Ne,Ce,Ue,nt,pt,bt,We,Qe;if(e[10]!==fe||e[11]!==d||e[12]!==j||e[13]!==_||e[14]!==Z||e[15]!==J||e[16]!==oe||e[17]!==N||e[18]!==H||e[19]!==A||e[20]!==G||e[21]!==le||e[22]!==x||e[23]!==m||e[24]!==b||e[25]!==S||e[26]!==z||e[27]!==I||e[28]!==U||e[29]!==ne||e[30]!==k||e[31]!==c||e[32]!==n||e[33]!==o){const{isBase:ue,current:dt,unlisted:Kt}=li({value:o,baseBranch:d,releases:I,baseIsDraft:j});Qe=Kt;const Q=ue?k("thread.branchPicker.live"):dt?.name??k("thread.branchPicker.defaultVersionName");Pe=le?k("thread.branchPicker.localhost.label"):G?k("thread.branchPicker.localLabel"):o?Q:k("thread.branchPicker.selectVersion");const be=le?"bg-foreground":G?"bg-special":ue?"bg-success":Bs(dt?.color??"orange");let me;e[63]!==Z||e[64]!==m?(me=ie=>{Z(),m(ie),$(!1)},e[63]=Z,e[64]=m,e[65]=me):me=e[65],Se=me;let Te;e[66]!==k?(Te=ie=>{$t.error(k("thread.branchPicker.saveError"),{description:$r(k,Lr(ie))})},e[66]=k,e[67]=Te):Te=e[67];const ge=Te;let Ct;e[68]!==ne?(Ct=ie=>{ne(ie),T(!1),$(!1)},e[68]=ne,e[69]=Ct):Ct=e[69],tt=Ct;let ts;e[70]!==fe||e[71]!==_||e[72]!==Z||e[73]!==J||e[74]!==x||e[75]!==m||e[76]!==I||e[77]!==ge||e[78]!==c?(ts=(ie,Ot)=>{if(Z(),x){x(ie),T(!1),$(!1);return}if(!I.some(Ts=>Ts.branch===ie)){if(fe){$t.error(_);return}J({branch:ie,name:Ot.trim()||ie,color:Is(I.length),createdBy:c,createdAt:new Date().toISOString()}).catch(ge)}m(ie),T(!1),$(!1)},e[70]=fe,e[71]=_,e[72]=Z,e[73]=J,e[74]=x,e[75]=m,e[76]=I,e[77]=ge,e[78]=c,e[79]=ts):ts=e[79],je=ts;let ss;e[80]!==fe||e[81]!==_||e[82]!==Z||e[83]!==J||e[84]!==m||e[85]!==b||e[86]!==I||e[87]!==ge||e[88]!==k||e[89]!==c||e[90]!==n?(ss=()=>{if(fe){$t.error(_);return}Z();const ie=tn(n);J({branch:ie,name:An(I,k("thread.branchPicker.defaultVersionName")),color:Is(I.length),createdBy:c,createdAt:new Date().toISOString()}).catch(ge),(b??m)(ie),$(!1)},e[80]=fe,e[81]=_,e[82]=Z,e[83]=J,e[84]=m,e[85]=b,e[86]=I,e[87]=ge,e[88]=k,e[89]=c,e[90]=n,e[91]=ss):ss=e[91],De=ss;let ns;e[92]===Symbol.for("react.memo_cache_sentinel")?(ns=()=>{re(null),L(""),T(!1),O("branches")},e[92]=ns):ns=e[92];const pr=ns;let as;e[93]===Symbol.for("react.memo_cache_sentinel")?(as=ie=>{O(ie),T(!0)},e[93]=as):as=e[93],Fe=as;let rs;e[94]===Symbol.for("react.memo_cache_sentinel")?(rs=ie=>{re(ie.branch),L(ie.name)},e[94]=rs):rs=e[94],mt=rs;let ls;e[95]!==H||e[96]!==U||e[97]!==ge?(ls=ie=>{const Ot=H.trim();Ot&&U(ie,Ot).catch(ge),re(null),L("")},e[95]=H,e[96]=U,e[97]=ge,e[98]=ls):ls=e[98],Le=ls;let is;e[99]!==fe||e[100]!==_||e[101]!==J||e[102]!==H||e[103]!==I.length||e[104]!==ge||e[105]!==c||e[106]!==o?(is=()=>{const ie=H.trim();if(ie&&o){if(fe){$t.error(_),re(null),L("");return}J({branch:o,name:ie,color:Is(I.length),createdBy:c,createdAt:new Date().toISOString()}).catch(ge)}re(null),L("")},e[99]=fe,e[100]=_,e[101]=J,e[102]=H,e[103]=I.length,e[104]=ge,e[105]=c,e[106]=o,e[107]=is):is=e[107],st=is;let os;e[108]===Symbol.for("react.memo_cache_sentinel")?(os=()=>{re(null),L("")},e[108]=os):os=e[108],Ie=os;let cs;e[109]!==d||e[110]!==oe||e[111]!==z||e[112]!==Se||e[113]!==I||e[114]!==ge||e[115]!==o?(cs=()=>{const ie=z;if(te(null),!!ie){if(ie.branch===o){const Ot=I.find(Ts=>Ts.branch!==ie.branch);Ot?Se(Ot.branch):d?Se(d):$(!1)}else $(!1);oe(ie.branch).catch(ge)}},e[109]=d,e[110]=oe,e[111]=z,e[112]=Se,e[113]=I,e[114]=ge,e[115]=o,e[116]=cs):cs=e[116],$e=cs,ft=qr,bt=S,e[117]!==N?(We=N?void 0:ie=>{ie||pr(),$(ie)},e[117]=N,e[118]=We):We=e[118],Ee=St,_e=kt,pt=!0,nt="inline-flex min-w-0 shrink",Oe=Kr,Ue=!0,ae=ve,de=zr.branchPicker,K=A?"outline":"ghost",xe=A?"sm":"default",ke=Pe,Ne=N;const Rs=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";e[119]!==Rs?(Ce=X("shrink min-w-0 max-w-[220px] gap-2",Rs,ba),e[119]=Rs,e[120]=Ce):Ce=e[120],Re=X("h-2 w-2 shrink-0 rounded-full",o||G?be:"bg-muted-foreground"),e[10]=fe,e[11]=d,e[12]=j,e[13]=_,e[14]=Z,e[15]=J,e[16]=oe,e[17]=N,e[18]=H,e[19]=A,e[20]=G,e[21]=le,e[22]=x,e[23]=m,e[24]=b,e[25]=S,e[26]=z,e[27]=I,e[28]=U,e[29]=ne,e[30]=k,e[31]=c,e[32]=n,e[33]=o,e[34]=ae,e[35]=Oe,e[36]=_e,e[37]=Ee,e[38]=ft,e[39]=tt,e[40]=je,e[41]=Ie,e[42]=$e,e[43]=De,e[44]=Pe,e[45]=Fe,e[46]=Se,e[47]=Le,e[48]=st,e[49]=mt,e[50]=Re,e[51]=de,e[52]=K,e[53]=xe,e[54]=ke,e[55]=Ne,e[56]=Ce,e[57]=Ue,e[58]=nt,e[59]=pt,e[60]=bt,e[61]=We,e[62]=Qe}else ae=e[34],Oe=e[35],_e=e[36],Ee=e[37],ft=e[38],tt=e[39],je=e[40],Ie=e[41],$e=e[42],De=e[43],Pe=e[44],Fe=e[45],Se=e[46],Le=e[47],st=e[48],mt=e[49],Re=e[50],de=e[51],K=e[52],xe=e[53],ke=e[54],Ne=e[55],Ce=e[56],Ue=e[57],nt=e[58],pt=e[59],bt=e[60],We=e[61],Qe=e[62];let Ae;e[121]!==Re?(Ae=r.jsx("span",{className:Re}),e[121]=Re,e[122]=Ae):Ae=e[122];let at;e[123]!==Pe?(at=r.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:Pe}),e[123]=Pe,e[124]=at):at=e[124];let rt;e[125]!==N?(rt=!N&&r.jsx(va,{size:12,className:"opacity-60 shrink-0"}),e[125]=N,e[126]=rt):rt=e[126];let gt;e[127]!==ae||e[128]!==de||e[129]!==K||e[130]!==xe||e[131]!==ke||e[132]!==Ne||e[133]!==Ce||e[134]!==Ae||e[135]!==at||e[136]!==rt?(gt=r.jsxs(ae,{"data-tour":de,variant:K,size:xe,"aria-label":ke,disabled:Ne,className:Ce,children:[Ae,at,rt]}),e[127]=ae,e[128]=de,e[129]=K,e[130]=xe,e[131]=ke,e[132]=Ne,e[133]=Ce,e[134]=Ae,e[135]=at,e[136]=rt,e[137]=gt):gt=e[137];let Tt;e[138]!==Oe||e[139]!==Ue||e[140]!==gt?(Tt=r.jsx(Oe,{asChild:Ue,children:gt}),e[138]=Oe,e[139]=Ue,e[140]=gt,e[141]=Tt):Tt=e[141];let xt;e[142]!==nt||e[143]!==Tt?(xt=r.jsx("span",{className:nt,children:Tt}),e[142]=nt,e[143]=Tt,e[144]=xt):xt=e[144];let Je;e[145]!==_e||e[146]!==pt||e[147]!==xt?(Je=r.jsx(_e,{asChild:pt,children:xt}),e[145]=_e,e[146]=pt,e[147]=xt,e[148]=Je):Je=e[148];let Ye;e[149]!==Pe?(Ye=r.jsx(Nt,{children:Pe}),e[149]=Pe,e[150]=Ye):Ye=e[150];let Xe;e[151]!==Ee||e[152]!==Je||e[153]!==Ye?(Xe=r.jsxs(Ee,{children:[Je,Ye]}),e[151]=Ee,e[152]=Je,e[153]=Ye,e[154]=Xe):Xe=e[154];let Bt;e[155]===Symbol.for("react.memo_cache_sentinel")?(Bt=ue=>{ue.preventDefault(),W.current?.scrollIntoView({block:"nearest"})},e[155]=Bt):Bt=e[155];let lt;e[156]!==C||e[157]!==k?(lt=C&&r.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:k("thread.branchPicker.newChatHint")}),e[156]=C,e[157]=k,e[158]=lt):lt=e[158];let vt;e[159]!==tt||e[160]!==je||e[161]!==F||e[162]!==M||e[163]!==fe||e[164]!==Ie||e[165]!==_||e[166]!==Z||e[167]!==De||e[168]!==we||e[169]!==H||e[170]!==ee||e[171]!==w||e[172]!==G||e[173]!==he||e[174]!==le||e[175]!==S||e[176]!==Fe||e[177]!==i||e[178]!==u||e[179]!==f||e[180]!==Se||e[181]!==I||e[182]!==p||e[183]!==g||e[184]!==Le||e[185]!==st||e[186]!==se||e[187]!==mt||e[188]!==k||e[189]!==h||e[190]!==Y||e[191]!==Qe||e[192]!==c||e[193]!==o||e[194]!==s?(vt=F?r.jsx(ji,{orgId:i,orgSlug:u,userId:c,target:h,owner:f,repo:p,sandboxMap:g,enabled:S,tab:M,onTabChange:O,isV8:w,localUrl:Y,onSaveLocal:tt,onBack:()=>T(!1),onAdopt:je}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:X("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",w&&"gap-1"),children:[!w&&G&&he&&r.jsx(yi,{rowRef:W,url:he,onSelect:()=>Fe("local"),onEdit:()=>Fe("local"),onTurnOff:()=>Z()}),Qe&&o&&(ee===o?r.jsx(Fn,{value:H,onChange:L,onSave:st,onCancel:Ie}):r.jsx($n,{rowRef:G?void 0:W,dot:Bs("orange"),label:k("thread.branchPicker.defaultVersionName"),branch:o,selected:!G,onSelect:()=>Se(o),onRename:()=>{re(o),L(An(I,k("thread.branchPicker.defaultVersionName")))}})),I.map(ue=>ee===ue.branch?r.jsx(Fn,{value:H,onChange:L,onSave:()=>Le(ue.branch),onCancel:Ie},ue.branch):r.jsx($n,{rowRef:!G&&ue.branch===o?W:void 0,dot:Bs(ue.color),label:ue.name,creator:we(ue.createdBy),branch:ue.branch,selected:!G&&ue.branch===o,onSelect:()=>Se(ue.branch),onRename:()=>mt(ue),onDelete:()=>te(ue)},ue.branch)),w&&r.jsx(ci,{virtualMcpId:s,branch:o,serve:se,rowRef:le?W:void 0,onPicked:()=>$(!1)})]}),(Qe||I.length>0||w)&&r.jsx("div",{className:"my-1 border-t"}),r.jsxs("button",{type:"button",onClick:()=>{De()},disabled:fe,className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",children:[r.jsx(ka,{className:"h-4 w-4 shrink-0"}),k("thread.branchPicker.newVersion")]}),fe&&r.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:_}),r.jsxs("button",{type:"button",onClick:()=>Fe("branches"),className:X("flex w-full items-center justify-between gap-2 rounded-lg px-2 py-2 text-left text-xs text-muted-foreground hover:bg-accent hover:text-foreground",w&&"mt-1"),children:[k("thread.branchPicker.advanced"),r.jsx(Jn,{className:"h-4 w-4 shrink-0"})]})]}),e[159]=tt,e[160]=je,e[161]=F,e[162]=M,e[163]=fe,e[164]=Ie,e[165]=_,e[166]=Z,e[167]=De,e[168]=we,e[169]=H,e[170]=ee,e[171]=w,e[172]=G,e[173]=he,e[174]=le,e[175]=S,e[176]=Fe,e[177]=i,e[178]=u,e[179]=f,e[180]=Se,e[181]=I,e[182]=p,e[183]=g,e[184]=Le,e[185]=st,e[186]=se,e[187]=mt,e[188]=k,e[189]=h,e[190]=Y,e[191]=Qe,e[192]=c,e[193]=o,e[194]=s,e[195]=vt):vt=e[195];let it;e[196]!==lt||e[197]!==vt?(it=r.jsxs(Vr,{className:"w-[min(300px,calc(100vw-2rem))] p-1.5",align:"start",onOpenAutoFocus:Bt,children:[lt,vt]}),e[196]=lt,e[197]=vt,e[198]=it):it=e[198];let It;e[199]!==ft||e[200]!==bt||e[201]!==We||e[202]!==Xe||e[203]!==it?(It=r.jsxs(ft,{open:bt,onOpenChange:We,children:[Xe,it]}),e[199]=ft,e[200]=bt,e[201]=We,e[202]=Xe,e[203]=it,e[204]=It):It=e[204];const Dt=It,_t=z!==null;let Ft;e[205]===Symbol.for("react.memo_cache_sentinel")?(Ft=ue=>{ue||te(null)},e[205]=Ft):Ft=e[205];let Ze;e[206]!==k?(Ze=k("thread.branchPicker.deleteTitle"),e[206]=k,e[207]=Ze):Ze=e[207];let yt;e[208]!==Ze?(yt=r.jsx(zs,{children:Ze}),e[208]=Ze,e[209]=yt):yt=e[209];let ot;e[210]!==z||e[211]!==k?(ot=z&&k("thread.branchPicker.deleteConfirm",{name:z.name}),e[210]=z,e[211]=k,e[212]=ot):ot=e[212];let jt;e[213]!==ot?(jt=r.jsx(Hs,{children:ot}),e[213]=ot,e[214]=jt):jt=e[214];let Pt;e[215]!==yt||e[216]!==jt?(Pt=r.jsxs(qs,{children:[yt,jt]}),e[215]=yt,e[216]=jt,e[217]=Pt):Pt=e[217];let wt;e[218]!==k?(wt=k("thread.branchPicker.cancel"),e[218]=k,e[219]=wt):wt=e[219];let ze;e[220]!==wt?(ze=r.jsx(Ks,{children:wt}),e[220]=wt,e[221]=ze):ze=e[221];let He;e[222]!==k?(He=k("thread.branchPicker.delete"),e[222]=k,e[223]=He):He=e[223];let qe;e[224]!==$e||e[225]!==He?(qe=r.jsx(Vs,{onClick:$e,variant:"destructive",children:He}),e[224]=$e,e[225]=He,e[226]=qe):qe=e[226];let Ke;e[227]!==ze||e[228]!==qe?(Ke=r.jsxs(Gs,{children:[ze,qe]}),e[227]=ze,e[228]=qe,e[229]=Ke):Ke=e[229];let Ve;e[230]!==Pt||e[231]!==Ke?(Ve=r.jsxs(Ws,{children:[Pt,Ke]}),e[230]=Pt,e[231]=Ke,e[232]=Ve):Ve=e[232];let Ge;e[233]!==_t||e[234]!==Ve?(Ge=r.jsx(Qs,{open:_t,onOpenChange:Ft,children:Ve}),e[233]=_t,e[234]=Ve,e[235]=Ge):Ge=e[235];let ct;return e[236]!==Dt||e[237]!==Ge?(ct=r.jsxs(r.Fragment,{children:[Dt,Ge]}),e[236]=Dt,e[237]=Ge,e[238]=ct):ct=e[238],ct}function Fn(t){const e=B.c(20),{value:s,onChange:a,onSave:n,onCancel:o}=t,d=ye();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==a?(i=g=>a(g.target.value),e[2]=a,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=g=>{g.key==="Enter"&&n(),g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==i||e[9]!==u||e[10]!==s?(c=r.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,e[9]=u,e[10]=s,e[11]=c):c=e[11];let h;e[12]!==d?(h=d("thread.branchPicker.save"),e[12]=d,e[13]=h):h=e[13];let f;e[14]!==n||e[15]!==h?(f=r.jsx(ve,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=f):f=e[16];let p;return e[17]!==c||e[18]!==f?(p=r.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[c,f]}),e[17]=c,e[18]=f,e[19]=p):p=e[19],p}function $n(t){const e=B.c(49),{rowRef:s,dot:a,label:n,creator:o,branch:d,selected:l,onSelect:i,onRename:u,onDelete:c}=t,h=ye(),f=l?"bg-accent":"hover:bg-accent";let p;e[0]!==f?(p=X("group flex items-center rounded-lg",f),e[0]=f,e[1]=p):p=e[1];let g;e[2]!==a?(g=X("h-2 w-2 shrink-0 rounded-full",a),e[2]=a,e[3]=g):g=e[3];let m;e[4]!==g?(m=r.jsx("span",{className:g}),e[4]=g,e[5]=m):m=e[5];let b;e[6]!==o?(b=o&&r.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:o}),e[6]=o,e[7]=b):b=e[7];let x;e[8]!==n||e[9]!==b?(x=r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[n,b]}),e[8]=n,e[9]=b,e[10]=x):x=e[10];let P;e[11]!==i||e[12]!==l||e[13]!==m||e[14]!==x?(P=r.jsx(kt,{asChild:!0,children:r.jsxs("button",{type:"button","aria-pressed":l,onClick:i,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[m,x]})}),e[11]=i,e[12]=l,e[13]=m,e[14]=x,e[15]=P):P=e[15];let y;e[16]!==d||e[17]!==h?(y=h("thread.branchPicker.branchTooltip",{branch:d}),e[16]=d,e[17]=h,e[18]=y):y=e[18];let v;e[19]!==y?(v=r.jsx(Nt,{side:"bottom",className:"font-mono text-xs",children:y}),e[19]=y,e[20]=v):v=e[20];let w;e[21]!==P||e[22]!==v?(w=r.jsxs(St,{children:[P,v]}),e[21]=P,e[22]=v,e[23]=w):w=e[23];let j;e[24]!==h?(j=h("thread.branchPicker.moreActions"),e[24]=h,e[25]=j):j=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=r.jsx(wa,{className:"h-4 w-4"}),e[26]=N):N=e[26];let C;e[27]!==j?(C=r.jsx(vs,{asChild:!0,children:r.jsx(ve,{variant:"ghost",size:"icon","aria-label":j,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:N})}),e[27]=j,e[28]=C):C=e[28];let R;e[29]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(Sa,{className:"h-4 w-4"}),e[29]=R):R=e[29];let k;e[30]!==h?(k=h("thread.branchPicker.rename"),e[30]=h,e[31]=k):k=e[31];let A;e[32]!==u||e[33]!==k?(A=r.jsxs(Wt,{onSelect:u,children:[R,k]}),e[32]=u,e[33]=k,e[34]=A):A=e[34];let S;e[35]!==c||e[36]!==h?(S=c&&r.jsxs(Wt,{onSelect:c,className:"text-destructive focus:text-destructive",children:[r.jsx(Ns,{className:"h-4 w-4"}),h("thread.branchPicker.delete")]}),e[35]=c,e[36]=h,e[37]=S):S=e[37];let $;e[38]!==A||e[39]!==S?($=r.jsxs(ys,{align:"end",children:[A,S]}),e[38]=A,e[39]=S,e[40]=$):$=e[40];let F;e[41]!==C||e[42]!==$?(F=r.jsxs(js,{children:[C,$]}),e[41]=C,e[42]=$,e[43]=F):F=e[43];let T;return e[44]!==s||e[45]!==w||e[46]!==F||e[47]!==p?(T=r.jsxs("div",{ref:s,className:p,children:[w,F]}),e[44]=s,e[45]=w,e[46]=F,e[47]=p,e[48]=T):T=e[48],T}function yi(t){const e=B.c(40),{rowRef:s,url:a,onSelect:n,onEdit:o,onTurnOff:d}=t,l=ye();let i;try{let A;e[0]!==a?(A=new URL(a),e[0]=a,e[1]=A):A=e[1],i=A.host}catch{i=a}const u=i;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-special"}),e[2]=c):c=e[2];let h;e[3]!==l?(h=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=h):h=e[4];let f;e[5]!==u?(f=r.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=f):f=e[6];let p;e[7]!==h||e[8]!==f?(p=r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,f]}),e[7]=h,e[8]=f,e[9]=p):p=e[9];let g;e[10]!==n||e[11]!==p?(g=r.jsxs("button",{type:"button","aria-pressed":!0,onClick:n,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[c,p]}),e[10]=n,e[11]=p,e[12]=g):g=e[12];let m;e[13]!==l?(m=l("thread.branchPicker.moreActions"),e[13]=l,e[14]=m):m=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(wa,{className:"h-4 w-4"}),e[15]=b):b=e[15];let x;e[16]!==m?(x=r.jsx(vs,{asChild:!0,children:r.jsx(ve,{variant:"ghost",size:"icon","aria-label":m,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:b})}),e[16]=m,e[17]=x):x=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Sa,{className:"h-4 w-4"}),e[18]=P):P=e[18];let y;e[19]!==l?(y=l("thread.branchPicker.rename"),e[19]=l,e[20]=y):y=e[20];let v;e[21]!==o||e[22]!==y?(v=r.jsxs(Wt,{onSelect:o,children:[P,y]}),e[21]=o,e[22]=y,e[23]=v):v=e[23];let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsx(Ns,{className:"h-4 w-4"}),e[24]=w):w=e[24];let j;e[25]!==l?(j=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=j):j=e[26];let N;e[27]!==d||e[28]!==j?(N=r.jsxs(Wt,{onSelect:d,className:"text-destructive focus:text-destructive",children:[w,j]}),e[27]=d,e[28]=j,e[29]=N):N=e[29];let C;e[30]!==v||e[31]!==N?(C=r.jsxs(ys,{align:"end",children:[v,N]}),e[30]=v,e[31]=N,e[32]=C):C=e[32];let R;e[33]!==C||e[34]!==x?(R=r.jsxs(js,{children:[x,C]}),e[33]=C,e[34]=x,e[35]=R):R=e[35];let k;return e[36]!==s||e[37]!==R||e[38]!==g?(k=r.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[g,R]}),e[36]=s,e[37]=R,e[38]=g,e[39]=k):k=e[39],k}function ji(t){const e=B.c(73),{orgId:s,orgSlug:a,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:u,tab:c,onTabChange:h,isV8:f,localUrl:p,onSaveLocal:g,onBack:m,onAdopt:b}=t,x=ye(),[P,y]=V.useState(""),v=c==="branches"?P:"",w=u&&c==="branches";let j;e[0]!==s||e[1]!==a||e[2]!==d||e[3]!==l||e[4]!==i||e[5]!==v||e[6]!==w||e[7]!==o||e[8]!==n?(j={orgId:s,orgSlug:a,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:v,enabled:w},e[0]=s,e[1]=a,e[2]=d,e[3]=l,e[4]=i,e[5]=v,e[6]=w,e[7]=o,e[8]=n,e[9]=j):j=e[9];const{recent:N,yours:C,others:R,isLoading:k,hasMore:A,isFetchingMore:S,fetchMore:$}=gi(j),F=u&&c==="prs";let T;e[10]!==s||e[11]!==a||e[12]!==d||e[13]!==l||e[14]!==F||e[15]!==o?(T={orgId:s,orgSlug:a,target:o,owner:d,repo:l,enabled:F},e[10]=s,e[11]=a,e[12]=d,e[13]=l,e[14]=F,e[15]=o,e[16]=T):T=e[16];const{data:M,isLoading:O}=rl(T);let ee;if(e[17]!==$||e[18]!==A||e[19]!==S||e[20]!==k||e[21]!==f||e[22]!==p||e[23]!==b||e[24]!==m||e[25]!==g||e[26]!==h||e[27]!==R||e[28]!==d||e[29]!==O||e[30]!==N||e[31]!==l||e[32]!==P||e[33]!==x||e[34]!==M||e[35]!==c||e[36]!==C){const re=M===void 0?[]:M,H=`${d}/${l}`;let L;e[38]!==H?(L=H.toLowerCase(),e[38]=H,e[39]=L):L=e[39];const z=L;let te;e[40]!==z?(te=E=>E.headRepoFullName?.toLowerCase()===z,e[40]=z,e[41]=te):te=e[41];const W=re.filter(te);let I;if(e[42]!==R||e[43]!==N||e[44]!==C){const E=new Set;I=[...N,...C,...R].filter(q=>E.has(q.name)?!1:(E.add(q.name),!0)),e[42]=R,e[43]=N,e[44]=C,e[45]=I}else I=e[45];const J=I;let U;e[46]===Symbol.for("react.memo_cache_sentinel")?(U=r.jsx(Jr,{className:"h-4 w-4 shrink-0"}),e[46]=U):U=e[46];let oe;e[47]!==x?(oe=x("thread.branchPicker.advancedBack"),e[47]=x,e[48]=oe):oe=e[48];let Y;e[49]!==m||e[50]!==oe?(Y=r.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground",children:[U,oe]}),e[49]=m,e[50]=oe,e[51]=Y):Y=e[51];let ne;e[52]!==h?(ne=E=>{h(E),y("")},e[52]=h,e[53]=ne):ne=e[53];let D;e[54]!==x?(D=x("thread.branchPicker.branchesTab"),e[54]=x,e[55]=D):D=e[55];let se;e[56]!==D?(se=r.jsx(Et,{value:"branches",className:"h-6 px-2.5 text-xs",children:D}),e[56]=D,e[57]=se):se=e[57];let le;e[58]!==x?(le=x("thread.branchPicker.prsTab"),e[58]=x,e[59]=le):le=e[59];let he;e[60]!==le?(he=r.jsx(Et,{value:"prs",className:"h-6 px-2.5 text-xs",children:le}),e[60]=le,e[61]=he):he=e[61];let G;e[62]!==f||e[63]!==x?(G=!f&&r.jsx(Et,{value:"local",className:"h-6 px-2.5 text-xs",children:x("thread.branchPicker.localTab")}),e[62]=f,e[63]=x,e[64]=G):G=e[64];let pe;e[65]!==se||e[66]!==he||e[67]!==G?(pe=r.jsxs(ga,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[se,he,G]}),e[65]=se,e[66]=he,e[67]=G,e[68]=pe):pe=e[68];let Z;e[69]!==ne||e[70]!==pe||e[71]!==c?(Z=r.jsx(xa,{className:"px-2 pt-2 pb-1",value:c,onValueChange:ne,children:pe}),e[69]=ne,e[70]=pe,e[71]=c,e[72]=Z):Z=e[72],ee=r.jsxs("div",{className:"flex flex-col",children:[Y,Z,c==="local"&&!f?r.jsx(oi,{url:p,onSave:g}):r.jsxs(Gr,{filter:c==="branches"?Pi:void 0,children:[r.jsx(Wr,{placeholder:x(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:P,onValueChange:y}),r.jsx(Qr,{onScroll:E=>{const q=E.currentTarget;c==="branches"&&q.scrollHeight-q.scrollTop-q.clientHeight<48&&$()},children:c==="branches"?r.jsxs(r.Fragment,{children:[k&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingMore")}),!k&&J.length===0&&r.jsx(kn,{children:x("thread.branchPicker.noBranchesFound")}),J.length>0&&r.jsx(Nn,{children:J.map(E=>r.jsxs(Cn,{value:E.name,className:"cursor-pointer",onSelect:()=>b(E.name,E.name),children:[r.jsx(xr,{className:"mr-2 h-4 w-4 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:E.name})]},E.name))}),A&&r.jsx("div",{className:"p-2",children:r.jsx(ve,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:S,onClick:$,children:x(S?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):r.jsxs(r.Fragment,{children:[O&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingPullRequests")}),!O&&W.length===0&&r.jsx(kn,{children:x("thread.branchPicker.noOpenPullRequests")}),W.length>0&&r.jsx(Nn,{children:W.map(E=>r.jsxs(Cn,{value:`#${E.number} ${E.title} ${E.head}`,className:"cursor-pointer",onSelect:()=>b(E.head,Dn(E.title)),children:[r.jsx(ks,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsx("span",{className:"truncate",children:Dn(E.title)}),r.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",E.number," · ",E.head]})]})]},E.number))})]})})]})]}),e[17]=$,e[18]=A,e[19]=S,e[20]=k,e[21]=f,e[22]=p,e[23]=b,e[24]=m,e[25]=g,e[26]=h,e[27]=R,e[28]=d,e[29]=O,e[30]=N,e[31]=l,e[32]=P,e[33]=x,e[34]=M,e[35]=c,e[36]=C,e[37]=ee}else ee=e[37];return ee}function Pi(t,e){return Ms(t,e)?1:0}function wi(t){const e=B.c(19),{locked:s,placement:a,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:f,orgId:p,orgSlug:g,userId:m,target:b,owner:x,repo:P,sandboxMap:y}=t;let v;return e[0]!==i||e[1]!==u||e[2]!==d||e[3]!==s||e[4]!==f||e[5]!==c||e[6]!==h||e[7]!==p||e[8]!==g||e[9]!==x||e[10]!==a||e[11]!==P||e[12]!==y||e[13]!==b||e[14]!==m||e[15]!==l||e[16]!==n||e[17]!==o?(v=r.jsx(vi,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:p,orgSlug:g,userId:m,target:b,owner:x,repo:P,sandboxMap:y,onChange:c,onCreateBranch:h,onAdoptBranch:f,spawnsNewChat:s,placement:a}),e[0]=i,e[1]=u,e[2]=d,e[3]=s,e[4]=f,e[5]=c,e[6]=h,e[7]=p,e[8]=g,e[9]=x,e[10]=a,e[11]=P,e[12]=y,e[13]=b,e[14]=m,e[15]=l,e[16]=n,e[17]=o,e[18]=v):v=e[18],v}function Si(t){const e=B.c(2),{branchPill:s}=t;if(!s)return null;let a;return e[0]!==s?(a=r.jsx(r.Fragment,{children:s}),e[0]=s,e[1]=a):a=e[1],a}function ki(t){const e=B.c(25),{virtualMcp:s,currentBranch:a}=t,n=Ir(),o=Zt();let d;e[0]!==n?.messages||e[1]!==o?.isThreadLocked?(d=(n?.messages??[]).length>0||(o?.isThreadLocked??!1),e[0]=n?.messages,e[1]=o?.isThreadLocked,e[2]=d):d=e[2];const l=d,i=o?.setCurrentTaskBranch,u=o?.createTask;let c;e[3]!==o?.activeTask?.metadata||e[4]!==s?.metadata?(c=el(s?.metadata)==="cms"&&Rn(o?.activeTask?.metadata,s?.metadata)==="sandbox",e[3]=o?.activeTask?.metadata,e[4]=s?.metadata,e[5]=c):c=e[5];const h=c,f=tl(s),p=et(f),{data:g}=Ps.useSession(),m=g?.user;let b;e[6]!==m?(b=sn(m),e[6]=m,e[7]=b):b=e[7];const x=b,P=g?.user?.id??"",{org:y}=ws(),v=ll(s,a),w=Ia(s?.id);let j;e[8]!==w||e[9]!==o?.activeTask?.metadata||e[10]!==s?.metadata?(j=w==="v8"&&Rn(o?.activeTask?.metadata,s?.metadata)==="cms",e[8]=w,e[9]=o?.activeTask?.metadata,e[10]=s?.metadata,e[11]=j):j=e[11];const N=j;let C;e[12]!==u||e[13]!==l||e[14]!==i?(C=M=>{l&&u?u({branch:M}):i&&i(M)},e[12]=u,e[13]=l,e[14]=i,e[15]=C):C=e[15];const R=C;let k;e[16]!==h||e[17]!==u||e[18]!==l||e[19]!==i?(k=M=>{(l||h)&&u?u({branch:M}):i&&i(M)},e[16]=h,e[17]=u,e[18]=l,e[19]=i,e[20]=k):k=e[20];const A=k;let S;e[21]!==u?(S=u?M=>u({runtime:"sandbox",branch:M}):void 0,e[21]=u,e[22]=S):S=e[22];const $=S,F=f&&Na(p)?r.jsx(wi,{userLabel:x,virtualMcpId:s?.id??"",isV8:w==="v8",value:a,baseBranch:v,baseIsDraft:N,orgId:y.id,orgSlug:y.slug,userId:P,target:p,owner:f.owner,repo:f.name,sandboxMap:s?.metadata?.sandboxMap,onChange:R,onCreateBranch:A,onAdoptBranch:$,locked:l,placement:"chat"},`${Ca(p)}:${f.owner}/${f.name}`):null;let T;return e[23]!==F?(T=r.jsx(Si,{branchPill:F}),e[23]=F,e[24]=T):T=e[24],T}const Ni=vr("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function Ci(t){const e=B.c(11);let s,a,n;e[0]!==t?({className:s,orientation:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==s||e[5]!==a?(o=X(Ni({orientation:a}),s),e[4]=s,e[5]=a,e[6]=o):o=e[6];let d;return e[7]!==a||e[8]!==n||e[9]!==o?(d=r.jsx("div",{role:"group","data-slot":"button-group","data-orientation":a,className:o,...n}),e[7]=a,e[8]=n,e[9]=o,e[10]=d):d=e[10],d}function Ai(t){const e=B.c(14),{item:s}=t;let a;e[0]!==s?(a=()=>{s.onSelect()},e[0]=s,e[1]=a):a=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==a?(n=r.jsxs(Wt,{disabled:s.disabled,onSelect:a,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=a,e[6]=n):n=e[6];const o=n;if(!s.tooltip)return o;let d;e[7]!==o?(d=r.jsx(kt,{asChild:!0,children:o}),e[7]=o,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=r.jsx(Nt,{side:"right",children:s.tooltip}),e[9]=s.tooltip,e[10]=l):l=e[10];let i;return e[11]!==d||e[12]!==l?(i=r.jsxs(St,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=i):i=e[13],i}function Ha(t){const e=B.c(20),{label:s,onClick:a,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:u,icon:c,items:h,menuAriaLabel:f,className:p}=t,g=n===void 0?"default":n,m=o===void 0?"default":o,b=d===void 0?!1:d,x=l===void 0?!1:l,P=i===void 0?!1:i,y=(h?.length??0)>0;let v;if(e[0]!==p||e[1]!==b||e[2]!==y||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==x||e[7]!==f||e[8]!==a||e[9]!==P||e[10]!==m||e[11]!==u||e[12]!==g){const w=X(ba,g==="default"&&"focus-visible:inset-ring-current");let j;e[14]!==c||e[15]!==x?(j=x?r.jsx(Qt,{size:"xs"}):c,e[14]=c,e[15]=x,e[16]=j):j=e[16];const N=r.jsxs(ve,{type:"button",variant:g,size:m,disabled:b,"aria-busy":x||void 0,onClick:x?void 0:a,className:X(w,y&&"rounded-r-none border-r border-current/20"),children:[j,s]}),C=P&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let R;e[17]!==p||e[18]!==C?(R=X(C,p),e[17]=p,e[18]=C,e[19]=R):R=e[19],v=r.jsxs(Ci,{className:R,children:[u?r.jsxs(St,{children:[r.jsx(kt,{asChild:!0,children:r.jsx("span",{className:X("inline-flex rounded-lg outline-none",w,b&&"cursor-not-allowed"),tabIndex:b?0:void 0,role:b?"button":void 0,"aria-disabled":b||void 0,children:N})}),r.jsx(Nt,{children:u})]}):N,y?r.jsxs(js,{children:[r.jsx(vs,{asChild:!0,children:r.jsx(ve,{type:"button",variant:g,size:m,"aria-label":f,className:X("has-[>svg]:px-2",w),children:r.jsx(va,{className:"size-3.5"})})}),r.jsx(ys,{align:"end",children:h?.map(Ri)})]}):null]}),e[0]=p,e[1]=b,e[2]=y,e[3]=c,e[4]=h,e[5]=s,e[6]=x,e[7]=f,e[8]=a,e[9]=P,e[10]=m,e[11]=u,e[12]=g,e[13]=v}else v=e[13];return v}function Ri(t){return r.jsx(Ai,{item:t},t.key)}async function Ti(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function Bi(t,e,{hosted:s}){return s&&t!==null?t:e}function Ii(t,e){const s=B.c(11),[a,n]=V.useState(null);let o;s[0]!==a||s[1]!==t||s[2]!==e?(o=Bi(a,t,e),s[0]=a,s[1]=t,s[2]=e,s[3]=o):o=s[3];let d;s[4]!==t||s[5]!==e?(d=()=>n(e.hosted?t:null),s[4]=t,s[5]=e,s[6]=d):d=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n(null),s[7]=l):l=s[7];let i;return s[8]!==o||s[9]!==d?(i={shown:o,hold:d,release:l},s[8]=o,s[9]=d,s[10]=i):i=s[10],i}function Di({open:t,hosted:e}){return t||e}function qa(t){return Pl({userName:t?.name,userEmail:t?.email})??void 0}function Cs(t){const e=B.c(18),{state:s,header:a,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let u;e[0]!==a?(u=r.jsx("div",{className:"space-y-0.5 px-4 py-3",children:a}),e[0]=a,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==o?(h=o?r.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=h):h=e[4];let f;e[5]!==n||e[6]!==h?(f=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"border-t"}),e[8]=p):p=e[8];let g;e[9]!==l?(g=r.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=g):g=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==i||e[14]!==u||e[15]!==f||e[16]!==g?(m=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,c,f,d,p,g]}),e[11]=d,e[12]=s,e[13]=i,e[14]=u,e[15]=f,e[16]=g,e[17]=m):m=e[17],m}function Xt(t){const e=B.c(2),{children:s}=t;let a;return e[0]!==s?(a=r.jsx("div",{className:"scroll-fade min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain px-4 pt-3 pb-2 [scrollbar-width:thin]",children:s}),e[0]=s,e[1]=a):a=e[1],a}function Ka(t){const e=B.c(10);let s,a,n;e[0]!==t?({className:a,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==a?(o=X("rounded-lg border bg-card px-3 py-2.5",a),e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==o?(d=r.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function ht(t){const e=B.c(4),{className:s}=t;let a;e[0]!==s?(a=X("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=a):a=e[1];let n;return e[2]!==a?(n=r.jsx("div",{className:a}),e[2]=a,e[3]=n):n=e[3],n}function Ut(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(Ka,{children:r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(ht,{className:"size-4 rounded-md"}),r.jsx(ht,{className:"h-3 w-24"}),r.jsx(ht,{className:"h-2.5 w-16"}),r.jsx(ht,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const Fi="secret";function Va(t){return t.kind!=="block"?null:t.namedRule??null}function $i(t,e){const s=e.find(a=>a&&typeof a=="object");return s?bl(s.__resolveType):$a(t)}const Li=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function mn(t){const e=Li.exec(t)?.[1];return e?Gl(e):null}function xs(t){if(!t)return null;try{const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return null}function Mi(t,e){return t===null?"new":e===null?"removed":"edited"}function Ga(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim();return e?(e.charAt(0).toUpperCase()+e.slice(1)).replace(/\s+[A-Z](?=[a-z])/g,s=>s.toLowerCase()):t}function Gt(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const a=t.__resolveType;if(typeof a=="string"&&a.trim()){if(s)return yr(a);const o=(a.split("/").pop()??a).replace(/\.[jt]sx?$/,"");return Ga(o)||o}}return`Section ${e+1}`}function pn(t){if(Yn(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&jr(e)?t.section??null:null}const Wa=6;function ms(t,e=0){if(e>Wa||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>ms(n,e+1));const s=t;if(Js(s.__resolveType))return _s(s).flatMap(n=>ms(n?.value,e+1));const a=pn(s);return a!==null?ms(a,e+1):[s]}function _s(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Ln(t){let e=t;for(let s=0;s<Wa;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const a=e;if(Js(a.__resolveType))return a;const n=pn(a);if(n===null)return null;e=n}return null}function _i(t,e,s){const a=_s(Ln(t)),n=e?_s(Ln(e)):[],o=e?Array.from({length:Math.max(a.length,n.length)},(i,u)=>u).filter(i=>!As(a[i],n[i])):[],l=[...o.map(i=>a[i]??n[i]),...a.filter((i,u)=>!o.includes(u))].flatMap(i=>ms(i?.value)).map(i=>Gt(i,s,!0));return[...new Set(l)]}function Fs(t,e,s,a,n){let o=t,d=!1;for(let i=0;i<4;i++){if(!o||typeof o!="object"||Array.isArray(o)){d=!0;break}const u=o;if(Js(u.__resolveType)){d=!0;break}const c=pn(u);if(c===null)break;o=c}const l=d?_i(t,n,e):[];return{name:Gt(d?t:o,e,!0),kind:"section",status:s,fields:a,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function Os(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((a,n)=>a&&typeof a=="object"&&!Array.isArray(a)?[{section:a,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const a=s.variants;if(Array.isArray(a))return a.flatMap((n,o)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&Yn(d),i=l?d.value:d;if(!Array.isArray(i))return[];const u=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((c,h)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...u,h]}]:[])})}return[]}function Mn(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const a=s;return Object.keys(a).sort().reduce((n,o)=>(n[o]=a[o],n),{})}return s})}function As(t,e){return t===void 0&&e===void 0?!0:Mn(t)===Mn(e)}function Mt(t,e,s,a=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const d of n){if(d.startsWith("__")||a.has(d))continue;const l=t?t[d]:void 0,i=e?e[d]:void 0;As(l,i)||o.push({label:Ga(d),path:[...s,d],from:l,to:i})}return o}function Oi(t,e){const s=e.find(a=>a&&typeof a=="object");return s?s.__resolveType===Sl:t===kl}function Ei(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),a=[];for(const n of Mt(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?a.push(...Mt(n.from??{},n.to??{},[o])):a.push(n)}return a}const Ui=new Set(["sections"]);function bn(t,e,s=!1){const a=t?Os(t,s):[],n=e?Os(e,s):[],o=[],d=Math.max(a.length,n.length);for(let i=0;i<d;i++){const u=a[i],c=n[i];if(!s){const h=zi(u,c,i);h&&o.push(h);continue}if(u&&c){if(As(u.section,c.section))continue;o.push(Fs(c.section,i,"edited",Mt(u.section,c.section,c.basePath),u.section))}else c?o.push(Fs(c.section,i,"new",[])):u&&o.push(Fs(u.section,i,"removed",[]))}const l=Mt(t,e,[],Ui);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function zi(t,e,s){return t&&e?As(t.section,e.section)?null:{name:Gt(e.section,s),kind:"section",status:"edited",fields:Mt(t.section,e.section,e.basePath)}:e?{name:Gt(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:Gt(t.section,s),kind:"section",status:"removed",fields:[]}:null}function Es(t,e){return{kind:"other",blockKey:null,name:t.split("/").pop()??t,pagePath:null,isSiteApp:!1,status:e,filepaths:[t],sections:[],fromJson:null,toJson:null}}function Hi(t){const e=[],s=[],a=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(cn(o)){n.push(o);continue}const l=Mi(d.from,d.to),i=mn(o);if(!i){a.push(Es(o,l));continue}const u=xs(d.from),c=xs(d.to),h=c??u;if(!h){a.push(Es(o,l));continue}const f=Vt(i,h);if(f){e.push({kind:"page",blockKey:i,name:f.name,pagePath:f.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?bn(u,c):[],fromJson:u,toJson:c});continue}const p=rn(i,h);s.push({kind:"block",blockKey:i,name:bs(i,h),pagePath:null,isSiteApp:p,status:l,filepaths:[o],sections:l==="edited"?[{name:bs(i,h),kind:"section",status:"edited",fields:Mt(u,c,[])}].filter(g=>g.fields.length>0):[],fromJson:u,toJson:c})}return Qa({pages:e,blocks:s,other:a,generated:n})}function $s(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function Qa(t){const{pages:e,blocks:s,other:a,generated:n}=t;return e.sort($s),s.sort($s),a.sort($s),{pages:e,blocks:s,other:a,generated:n,count:e.length+s.length+a.length}}function qi(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function Ja(t){return t.startsWith("pages-")}function Ya(t){const{files:e,lookup:s,diff:a}=t,n=[],o=[],d=[],l=[];for(const i of e){const u=i.path;if(cn(u)){l.push(u);continue}const c=qi(i.status),h=mn(u);if(!h){d.push(Es(u,c));continue}const f=a?.diffs[u],p=xs(f?.from??null),g=xs(f?.to??null),m=Xa(s,h),b=m??g??p;if((m?Vt(h,m):null)??(!m&&Ja(h))){const y=b?Vt(h,b):null;n.push({kind:"page",blockKey:h,name:y?.name??Fa(h),pagePath:y?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?bn(p,g):[],fromJson:p,toJson:g??(c==="new"?m:null)});continue}const P=bs(h,b??{});o.push({kind:"block",blockKey:h,name:P,pagePath:null,isSiteApp:rn(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:P,kind:"section",status:"edited",fields:Mt(p,g,[])}].filter(y=>y.fields.length>0):[],fromJson:p,toJson:g})}return Qa({pages:n,blocks:o,other:d,generated:l})}function Xa(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Ki(t,e){return t??e}function Za(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const Ls=3;function ds(t){if(t.length<=Ls)return Za(t);const e=t.length-Ls;return`${t.slice(0,Ls).join(", ")} and ${e} more`}function Vi(t,e){if(!e){const a=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return a.length>0?`${t.name} (${a.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(a=>a.kind==="section").flatMap(a=>a.wrapper?a.held??[]:[a.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function Gi(t){const e=Va(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function Wi(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),a=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${ds(s.map(l=>Vi(l,!!t.v8)))}`),a.length>0){const l=a.length===1?"page":"pages";e.push(`added the ${ds(a.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${ds(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(Gi);if(o.length>0&&e.push(`changed ${ds(o)}`),t.other.length>0){const l=t.other.length===1?"file":"files";e.push(`changed ${t.other.length} ${l}`)}if(e.length===0)return"";const d=Za(e);return wl(d.charAt(0).toUpperCase()+d.slice(1))}function Qi(t,e){return t?Os(t,e).length:0}function Ji(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?Qi(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const a of t.sections){if(a.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=a.fields.length}return s}const _n="••••••";function Jt(t){if(Array.isArray(t))return t.map(Jt);if(!t||typeof t!="object")return t;const e=t,s={};for(const[a,n]of Object.entries(e))s[a]=Jt(n);return e.__resolveType===Fi&&"ciphertext"in e&&(s.ciphertext=_n),wr(e)&&"encrypted"in e&&(s.encrypted=_n),s}function On(t){return t.map(e=>({...e,from:Jt(e.from),to:Jt(e.to)}))}function Yi(t){const{changes:e,sides:s,lookup:a,meta:n,missingRules:o,missingRuleUses:d,hosted:l}=t,i=[],u=[],c=f=>[...new Set((s?.diagnostics??[]).filter(p=>wn(Pr(p.file))===wn(f)).map(p=>p.side))],h=Object.keys(e).sort((f,p)=>f<p?-1:f>p?1:0);for(const f of h){const p=e[f],g=p.kind==="delete"?"removed":p.baseVersion===null?"new":"edited",m=s?.entries[f],b=m?.before??null,x=m?.after??null,P=Xa(a,f),y=P??x??b,v=c(f),w=o?.get(f),j=$a(f),N=j?d?.get(j):void 0,C={blockKey:f,status:g,filepaths:[],entry:{name:f,version:p.version},...v.length>0?{unreadable:v}:{},...w&&w.length>0?{missingRules:w}:{},...j&&N&&N.pages+N.sections>0?{missingRuleUses:{kind:j,...N}}:{},fromJson:Jt(b),toJson:Jt(x??(g==="new"?P:null))},R=P?Vt(f,P,n):null,k=!P&&y?Vt(f,y,n):null;if(R??k??(!y&&Ja(f))){const T=y?Vt(f,y,n):null;i.push({...C,kind:"page",name:T?.name??Fa(f),pagePath:T?.path??null,isSiteApp:!1,sections:g==="edited"?bn(b,x,!0).map(M=>({...M,fields:On(M.fields)})):[]});continue}const A=l?ml(f,y,P,x,b):null,S=A?pl(A,[y,P,x,b]):bs(f,y??{}),$=$i(f,[P,x,b]),F=Oi(f,[P,x,b]);u.push({...C,kind:"block",name:F?"Settings":S,...F?{cmsSettings:!0}:{},...A?{blogKind:A}:{},...$?{namedRule:$}:{},pagePath:null,isSiteApp:rn(f,P??y??{}),sections:g==="edited"?[{name:F?"Settings":S,kind:"section",status:"edited",fields:On(F?Ei(b,x):Mt(b,x,[]))}].filter(T=>T.fields.length>0):[]})}return{pages:i,blocks:u,other:[],generated:[],count:i.length+u.length,v8:!0}}function Be(t){return t.filepaths[0]??t.blockKey??t.name}function Xi(t){const e=t.pages+t.sections===1,s=t.names===1;return t.kind==="experiments"?s?e?"thread.publishPopover.missingTestUsesOne":"thread.publishPopover.missingTestUses":e?"thread.publishPopover.missingTestsUsesOne":"thread.publishPopover.missingTestsUses":s?e?"thread.publishPopover.missingCampaignUsesOne":"thread.publishPopover.missingCampaignUses":e?"thread.publishPopover.missingCampaignsUsesOne":"thread.publishPopover.missingCampaignsUses"}function Zi(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function eo(t,e){const s=t.kind==="block"?Il:ya;return r.jsx("span",{title:Zi(t.status,e),className:"flex shrink-0",children:r.jsx(s,{className:X("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function to(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return gl(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=Va(t);return s==="experiments"?e("thread.publishPopover.abTests"):s==="campaigns"?e("thread.publishPopover.campaignDates"):t.isSiteApp?e("thread.publishPopover.siteConfiguration"):e("thread.publishPopover.globalSection")}function so(t,e,s){const a=Ji(t,s);if(a.newPageSections!==null)return[a.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:a.newPageSections})];const n=[];return a.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):a.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:a.sections})),a.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):a.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:a.fields})),a.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function er(t){const e=B.c(72),{change:s,bodyPending:a,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:c,v8:h,alsoChangedOnMain:f}=t,p=a===void 0?!1:a,g=h===void 0?!1:h,m=f===void 0?!1:f,b=ye();let x;e[0]!==s||e[1]!==b?(x=to(s,b),e[0]=s,e[1]=b,e[2]=x):x=e[2];const P=x;let y,v,w,j,N,C,R,k;if(e[3]!==p||e[4]!==s||e[5]!==d||e[6]!==P||e[7]!==c||e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==b||e[14]!==g){const $=so(s,b,g);let F;e[23]!==s.missingRules?(F=s.missingRules??[],e[23]=s.missingRules,e[24]=F):F=e[24];const T=F,M=s.missingRuleUses,O=M?Fl(b,M):null,ee=p&&$.length===0&&s.status==="edited";y=Ka;const re=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";e[25]!==re?(j=X("cursor-pointer transition-colors hover:bg-accent",re),e[25]=re,e[26]=j):j=e[26],e[27]!==s?(N=Be(s),e[27]=s,e[28]=N):N=e[28],C=o;let H;e[29]!==s||e[30]!==b?(H=eo(s,b),e[29]=s,e[30]=b,e[31]=H):H=e[31];let L;e[32]!==s.cmsSettings||e[33]!==s.name||e[34]!==b?(L=s.cmsSettings?b("thread.publishPopover.settings"):s.name,e[32]=s.cmsSettings,e[33]=s.name,e[34]=b,e[35]=L):L=e[35];let z;e[36]!==L?(z=r.jsx("span",{className:"truncate text-sm font-medium",children:L}),e[36]=L,e[37]=z):z=e[37];let te;e[38]!==P?(te=P?r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:P}):null,e[38]=P,e[39]=te):te=e[39];let W;e[40]!==n||e[41]!==z||e[42]!==te?(W=r.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[z,te]}),e[40]=n,e[41]=z,e[42]=te,e[43]=W):W=e[43];let I;e[44]!==d||e[45]!==c||e[46]!==u||e[47]!==l||e[48]!==i||e[49]!==b?(I=d?r.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[r.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:J=>{J.stopPropagation(),l(!1)},children:b("thread.publishDialog.cancel")}),r.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:J=>{J.stopPropagation(),l(!1),i?.()},disabled:c,children:b("thread.publishPopover.discard")})]}):i?r.jsx(Ss,{children:r.jsxs(St,{children:[r.jsx(kt,{asChild:!0,children:r.jsx(ve,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":b("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:J=>{J.stopPropagation(),l(!0)},disabled:u||c,children:r.jsx(Ns,{className:"size-3.5"})})}),r.jsx(Nt,{children:b("thread.publishPopover.discard")})]})}):null,e[44]=d,e[45]=c,e[46]=u,e[47]=l,e[48]=i,e[49]=b,e[50]=I):I=e[50],e[51]!==H||e[52]!==W||e[53]!==I?(R=r.jsxs("div",{className:"flex items-center gap-2.5",children:[H,W,I]}),e[51]=H,e[52]=W,e[53]=I,e[54]=R):R=e[54],k=$.length>0?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:$.map(no)}):ee?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:r.jsx(ht,{className:"h-4 w-2/3"})}):null,e[55]!==T||e[56]!==b?(v=T.length>0?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-foreground","data-testid":"publish-change-missing-rule",children:T.map(J=>r.jsx("div",{className:"truncate",children:b(J==="experiments"?"thread.publishPopover.missingTest":"thread.publishPopover.missingCampaign")},J))}):null,e[55]=T,e[56]=b,e[57]=v):v=e[57],w=M&&O?r.jsx("div",{className:"mt-1 truncate pl-[26px] text-xs text-foreground","data-testid":"publish-change-missing-rule-uses",children:b(Xi(M),{places:O.places})}):null,e[3]=p,e[4]=s,e[5]=d,e[6]=P,e[7]=c,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=b,e[14]=g,e[15]=y,e[16]=v,e[17]=w,e[18]=j,e[19]=N,e[20]=C,e[21]=R,e[22]=k}else y=e[15],v=e[16],w=e[17],j=e[18],N=e[19],C=e[20],R=e[21],k=e[22];let A;e[58]!==m||e[59]!==s.name||e[60]!==b?(A=m?r.jsx("div",{className:"mt-1 pl-[26px] text-xs text-muted-foreground","data-testid":"publish-change-also-changed",children:b("thread.publishPopover.alsoChangedOnMain",{name:s.name})}):null,e[58]=m,e[59]=s.name,e[60]=b,e[61]=A):A=e[61];let S;return e[62]!==y||e[63]!==v||e[64]!==w||e[65]!==A||e[66]!==j||e[67]!==N||e[68]!==C||e[69]!==R||e[70]!==k?(S=r.jsxs(y,{className:j,"data-change-id":N,onClick:C,children:[R,k,v,w,A]}),e[62]=y,e[63]=v,e[64]=w,e[65]=A,e[66]=j,e[67]=N,e[68]=C,e[69]=R,e[70]=k,e[71]=S):S=e[71],S}function no(t,e){return r.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function tr(){const t=B.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:-1,height:-1},t[0]=e):e=t[0];const[s,a]=V.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>a(c=>c.width===l.clientWidth&&c.height===l.clientHeight?c:{width:l.clientWidth,height:l.clientHeight});i();const u=new ResizeObserver(i);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const o=n;let d;return t[2]!==s?(d=[s,o],t[2]=s,t[3]=d):d=t[3],d}function ao(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const ro=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function En(t){const e=B.c(10),{height:s}=t,a=ye();let n;e[0]!==s?(n={height:s},e[0]=s,e[1]=n):n=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=ro.map(lo),e[2]=o):o=e[2];let d;e[3]!==a?(d=a("thread.publishDialog.openingComparison"),e[3]=a,e[4]=d):d=e[4];let l;e[5]!==d?(l=r.jsx("div",{className:"flex items-center justify-center pt-1 text-2xs text-muted-foreground",children:d}),e[5]=d,e[6]=l):l=e[6];let i;return e[7]!==n||e[8]!==l?(i=r.jsxs("div",{style:n,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[o,l]}),e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function lo(t,e){return r.jsxs("div",{className:X("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[r.jsx("div",{className:X("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),r.jsx("div",{className:X("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const sr={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},io={...sr,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function oo(t){const e=B.c(11),{diff:s,emptyMessage:a,rowClassName:n,onDiscardFile:o,hideFileRows:d,editorHeight:l}=t,i=a===void 0?"No file changes in the working tree":a,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=l===void 0?"380px":l,[f,p]=V.useState(null),[g,m]=V.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=ao(),e[0]=b):b=e[0];const x=b;if(!s||Object.keys(s.diffs).length===0){let y;return e[1]!==i?(y=r.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=y):y=e[2],y}let P;return e[3]!==s.diffs||e[4]!==g||e[5]!==h||e[6]!==f||e[7]!==c||e[8]!==o||e[9]!==u?(P=r.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(y=>{const[v,w]=y,{from:j,to:N}=w,C=f===v,R=j===null,k=N===null,A=v.startsWith("/")?v.slice(1):v,S=A.lastIndexOf("/"),$=S>=0?A.slice(S+1):A,F=S>=0?A.slice(0,S):null,T=Wl(v),M=R?"bg-success":k?"bg-destructive":"bg-warning";return c?r.jsx("div",{children:r.jsx(Bn,{original:j??"",modified:N??"",language:T,theme:x,height:h,loading:r.jsx(En,{height:h}),options:io})},v):r.jsxs("div",{children:[r.jsxs("div",{className:X("flex items-center gap-3 py-3 hover:bg-accent",u),children:[r.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>p(C?null:v),children:r.jsx(Jn,{className:X("h-3.5 w-3.5 transition-transform",C&&"rotate-90")})}),r.jsx("div",{className:X("h-2.5 w-2.5 shrink-0 rounded-full",M)}),r.jsx(ya,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:$}),F&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F}),o?r.jsxs(js,{children:[r.jsx(vs,{asChild:!0,children:r.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:r.jsx(Sr,{className:"h-3.5 w-3.5"})})}),r.jsx(ys,{align:"end",children:r.jsx(Wt,{className:"text-destructive focus:text-destructive",onSelect:()=>m(v),children:"Discard changes"})})]}):null]}),g===v&&o?r.jsxs("div",{className:X("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[r.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",r.jsx("span",{className:"font-medium",children:$}),"? This cannot be undone."]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),r.jsx(ve,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(v)},children:"Discard"})]})]}):null,C&&r.jsx("div",{className:"border-t",children:r.jsx(Bn,{original:j??"",modified:N??"",language:T,theme:x,height:h,loading:r.jsx(En,{height:h}),options:sr})})]},v)})}),e[3]=s.diffs,e[4]=g,e[5]=h,e[6]=f,e[7]=c,e[8]=o,e[9]=u,e[10]=P):P=e[10],P}function co(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&Xl(e)?t.blockKey:null}function uo(t){return t.kind!=="page"?!0:!t.pagePath||Lt(t.pagePath).length>0}function ho(t,e){try{return Jl(t,vl,e)}catch{return null}}function fo(t,e,s){if(!e)return;const a=xl(e,t);if(!a)return null;if(Lt(a.path).length===0||s?.path!==a.path)return a.path;const n=ln(a.path,s.params);return Lt(n).length===0?n:a.path}function mo(t){return t.sectionKey&&!t.v8?ho(t.previewServerUrl,t.sectionKey):bo(t.previewServerUrl,t.path)}function po(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Lt(s).length===0)return s;if(e?.path!==s)return"";const a=ln(s,e.params);return Lt(a).length===0?a:""}function bo(t,e){const s=e.trim();if(!s||Lt(s).length>0)return null;try{const a=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,a);return n.origin===a.origin?n:null}catch{return null}}function go(t,e){return e?.kind==="pointer"&&e.link?hn(t.toString(),e.link):nr(t,e)}function nr(t,e){if(!e)return null;if(e.kind==="pointer")return hn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function xo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function vo(t,e){const s=e?t.kind==="page":t.kind!=="other";return{before:s&&t.status==="new"?"new":null,after:s&&t.status==="removed"?"removed":null}}const ar=V.createContext(!0),yo=["split","before","after","code"];function jo(t){return yo.includes(t)}const rr={desktop:1280,mobile:412};function Po(t,e){const s=(o,d)=>t.unreadable?.includes(d)?e:o?`${JSON.stringify(o,null,2)}
2
2
  `:null,a=t.status==="new"?null:s(t.fromJson,"before"),n=t.status==="removed"?null:s(t.toJson,"after");return a===null&&n===null?{diffs:{}}:t.status==="edited"&&(a===null||n===null)?{diffs:{}}:{diffs:{[Cr(t.entry.name)]:{from:a,to:n}}}}function lr(t){const e=B.c(76),{change:s,diff:a,bodyPending:n,previewServerUrl:o,draft:d,lastPage:l,v8:i,onReady:u}=t,c=ye(),h=V.use(ar),f=co(s),p=i?null:f,g=i?f:null,m=g?fo(g,i?.blocks,l):void 0,b=g!==null&&m===null,x=xo(s.kind,o,d)&&(g===null||typeof m=="string"),[P,y]=V.useState(null),v=x?P??"split":"code",[w,j]=V.useState("desktop"),[N,C]=V.useState(null),R=N??(g?m??"":po(s,l));let k;e[0]!==s?(k=uo(s),e[0]=s,e[1]=k):k=e[1];const A=k,S=o?mo({previewServerUrl:o,sectionKey:f,path:R,v8:!!i}):null,$=S?hn(S.toString(),Yl):null,F=S?nr(S,d):null,T=S?go(S,d):null;let M;e[2]!==s||e[3]!==a?.diffs||e[4]!==c?(M=s.entry?Po(s,c("thread.publishCompare.sideUnreadable")):{diffs:Object.fromEntries(s.filepaths.flatMap(_=>{const ae=a?.diffs[_];return ae?[[_,ae]]:[]}))},e[2]=s,e[3]=a?.diffs,e[4]=c,e[5]=M):M=e[5];const O=M;let ee;e[6]!==O.diffs?(ee=Object.keys(O.diffs),e[6]=O.diffs,e[7]=ee):ee=e[7];const re=ee.length>0;let H;e:{if(p!==null){H=null;break e}if(g!==null){const ae=R.trim();if(!ae){H=null;break e}H=Lt(ae).length>0?c("thread.publishCompare.dynamicHint",{template:ae}):c("thread.publishCompare.blockHint",{path:ae});break e}if(s.kind!=="page"){let ae;e[8]!==c?(ae=c("thread.publishCompare.globalHint"),e[8]=c,e[9]=ae):ae=e[9],H=ae;break e}let _;e[10]!==s.pagePath||e[11]!==c?(_=s.pagePath&&Lt(s.pagePath).length>0?c("thread.publishCompare.dynamicHint",{template:s.pagePath}):null,e[10]=s.pagePath,e[11]=c,e[12]=_):_=e[12],H=_}const L=H,z=vo(s,!!i),[te,W]=V.useState(wo);let I;e[13]===Symbol.for("react.memo_cache_sentinel")?(I=_=>W(ae=>ae.has(_)?ae:new Set(ae).add(_)),e[13]=I):I=e[13];const J=I;let U;e[14]!==i?(U=_=>i?r.jsx(No,{..._,onLoaded:J}):r.jsx(ko,{..._}),e[14]=i,e[15]=U):U=e[15];const oe=U,ne=(x?[z.before==="new"?null:$,z.after==="removed"?null:F].flatMap(_=>_?[fn(_,w)]:[]):[]).every(_=>te.has(_));let D;e[16]!==u||e[17]!==ne?(D=ne&&u?_=>{_&&u()}:void 0,e[16]=u,e[17]=ne,e[18]=D):D=e[18];const se=D,le=z.before==="new"?r.jsx(us,{icon:r.jsx(ka,{className:"size-5 text-brand"}),title:c("thread.publishCompare.newTitle"),description:c("thread.publishCompare.newDescription")}):oe({url:$,device:w,title:c("thread.publishCompare.before"),missing:c("thread.publishCompare.enterPath")}),he=z.after==="removed"?r.jsx(us,{icon:r.jsx(Ns,{className:"size-5 text-destructive"}),title:c("thread.publishCompare.removedTitle"),description:c("thread.publishCompare.removedDescription")}):oe({url:F,device:w,title:c("thread.publishCompare.after"),missing:c(S?"thread.publishCompare.draftUnavailable":"thread.publishCompare.enterPath")});let G;e[19]!==x||e[20]!==y||e[21]!==h||e[22]!==c||e[23]!==v?(G=x||h?r.jsx(xa,{value:v,onValueChange:_=>{jo(_)&&y(_)},children:r.jsxs(ga,{className:"h-8 w-auto",variant:"pill",children:[x?r.jsxs(r.Fragment,{children:[r.jsx(Et,{value:"split",className:"px-3 text-xs",children:c("thread.publishCompare.sideBySide")}),r.jsx(Et,{value:"before",className:"px-3 text-xs",children:c("thread.publishCompare.before")}),r.jsx(Et,{value:"after",className:"px-3 text-xs",children:c("thread.publishCompare.after")})]}):null,h?r.jsx(Et,{value:"code",className:"px-3 text-xs",children:c("thread.publishCompare.code")}):null]})}):null,e[19]=x,e[20]=y,e[21]=h,e[22]=c,e[23]=v,e[24]=G):G=e[24];let pe;e[25]!==T||e[26]!==x||e[27]!==s.pagePath||e[28]!==w||e[29]!==R||e[30]!==A||e[31]!==p||e[32]!==j||e[33]!==C||e[34]!==c||e[35]!==v?(pe=x&&v!=="code"?r.jsxs(r.Fragment,{children:[p?null:A?r.jsx(kr,{value:R,onChange:_=>C(_.target.value),placeholder:s.pagePath??"/","aria-label":c("thread.publishCompare.pathLabel"),className:"h-8 w-56 font-mono text-xs"}):r.jsx("span",{className:"max-w-56 truncate px-1 font-mono text-xs text-muted-foreground",children:R}),r.jsxs("div",{className:"flex items-center rounded-lg border p-0.5",children:[r.jsx(Un,{active:w==="desktop",label:c("thread.publishCompare.desktop"),onClick:()=>j("desktop"),children:r.jsx(Ql,{className:"size-3.5"})}),r.jsx(Un,{active:w==="mobile",label:c("thread.publishCompare.mobile"),onClick:()=>j("mobile"),children:r.jsx(Yr,{className:"size-3.5"})})]}),T?r.jsxs("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[r.jsx(Nr,{className:"size-3.5"}),c("thread.publishCompare.openDraft")]}):null]}):null,e[25]=T,e[26]=x,e[27]=s.pagePath,e[28]=w,e[29]=R,e[30]=A,e[31]=p,e[32]=j,e[33]=C,e[34]=c,e[35]=v,e[36]=pe):pe=e[36];let Z;e[37]!==G||e[38]!==pe?(Z=r.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b bg-background px-4 py-2.5 max-md:pr-12",children:[G,pe]}),e[37]=G,e[38]=pe,e[39]=Z):Z=e[39];let E;e[40]!==x||e[41]!==L||e[42]!==v?(E=L&&x&&v!=="code"?r.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:L}):null,e[40]=x,e[41]=L,e[42]=v,e[43]=E):E=e[43];let q;e[44]!==b||e[45]!==h||e[46]!==c?(q=b&&h?r.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:c("thread.publishCompare.notOnAnyPage")}):null,e[44]=b,e[45]=h,e[46]=c,e[47]=q):q=e[47];let ce;e[48]!==o||e[49]!==h||e[50]!==c||e[51]!==g||e[52]!==m||e[53]!==v?(ce=v==="code"&&!h?g!==null&&m===void 0?r.jsx(ht,{className:"m-4 h-64 rounded"}):o===null?r.jsx(us,{icon:r.jsx(gs,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.previewNotReadyTitle"),description:c("thread.publishCompare.draftUnavailable")}):r.jsx(us,{icon:r.jsx(gs,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.noPreviewTitle"),description:c("thread.publishCompare.noPreviewDescription")}):null,e[48]=o,e[49]=h,e[50]=c,e[51]=g,e[52]=m,e[53]=v,e[54]=ce):ce=e[54];let we;e[55]!==n||e[56]!==re||e[57]!==O||e[58]!==h||e[59]!==c||e[60]!==v?(we=v==="code"&&h?r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-width:thin]",children:re?r.jsx(oo,{diff:O,hideFileRows:!0,editorHeight:"70vh"}):n?r.jsx(ht,{className:"m-4 h-64 rounded"}):r.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:c("thread.publishPopover.detailsUnavailable")})}):null,e[55]=n,e[56]=re,e[57]=O,e[58]=h,e[59]=c,e[60]=v,e[61]=we):we=e[61];let fe;e[62]!==he||e[63]!==le||e[64]!==x||e[65]!==c||e[66]!==v?(fe=x?r.jsxs("div",{className:X("flex min-h-0 flex-1 gap-3 p-3",v==="code"&&"hidden"),children:[r.jsx(zn,{label:c("thread.publishCompare.before"),hidden:v==="after",children:le}),r.jsx(zn,{label:c("thread.publishCompare.after"),highlight:!0,hidden:v==="before",children:he})]}):null,e[62]=he,e[63]=le,e[64]=x,e[65]=c,e[66]=v,e[67]=fe):fe=e[67];let Me;return e[68]!==se||e[69]!==Z||e[70]!==E||e[71]!==q||e[72]!==ce||e[73]!==we||e[74]!==fe?(Me=r.jsxs("div",{ref:se,className:"flex min-h-0 min-w-0 flex-1 flex-col bg-muted/40",children:[Z,E,q,ce,we,fe]}),e[68]=se,e[69]=Z,e[70]=E,e[71]=q,e[72]=ce,e[73]=we,e[74]=fe,e[75]=Me):Me=e[75],Me}function wo(){return new Set}function Un(t){const e=B.c(8),{active:s,label:a,onClick:n,children:o}=t,d=s&&"bg-accent text-foreground";let l;e[0]!==d?(l=X("flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground",d),e[0]=d,e[1]=l):l=e[1];let i;return e[2]!==s||e[3]!==o||e[4]!==a||e[5]!==n||e[6]!==l?(i=r.jsx("button",{type:"button","aria-label":a,"aria-pressed":s,title:a,onClick:n,className:l,children:o}),e[2]=s,e[3]=o,e[4]=a,e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function zn(t){const e=B.c(18),{label:s,highlight:a,hidden:n,children:o}=t,d=a===void 0?!1:a,i=(n===void 0?!1:n)&&"hidden";let u;e[0]!==i?(u=X("flex min-h-0 min-w-0 flex-1 flex-col gap-1.5",i),e[0]=i,e[1]=u):u=e[1];const c=d&&"bg-brand";let h;e[2]!==c?(h=X("size-1.5 rounded-full bg-muted-foreground/50",c),e[2]=c,e[3]=h):h=e[3];let f;e[4]!==h?(f=r.jsx("span",{className:h}),e[4]=h,e[5]=f):f=e[5];let p;e[6]!==s||e[7]!==f?(p=r.jsxs("div",{className:"flex items-center gap-1.5 px-0.5 text-2xs font-medium text-muted-foreground",children:[f,s]}),e[6]=s,e[7]=f,e[8]=p):p=e[8];const g=d&&"border-brand/60";let m;e[9]!==g?(m=X("relative min-h-0 flex-1 overflow-hidden rounded-lg border bg-background",g),e[9]=g,e[10]=m):m=e[10];let b;e[11]!==o||e[12]!==m?(b=r.jsx("div",{className:m,children:o}),e[11]=o,e[12]=m,e[13]=b):b=e[13];let x;return e[14]!==b||e[15]!==u||e[16]!==p?(x=r.jsxs("div",{className:u,children:[p,b]}),e[14]=b,e[15]=u,e[16]=p,e[17]=x):x=e[17],x}function us(t){const e=B.c(10),{icon:s,title:a,description:n}=t;let o;e[0]!==s?(o=r.jsx("div",{className:"mb-1",children:s}),e[0]=s,e[1]=o):o=e[1];let d;e[2]!==a?(d=r.jsx("p",{className:"text-sm font-medium",children:a}),e[2]=a,e[3]=d):d=e[3];let l;e[4]!==n?(l=r.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[4]=n,e[5]=l):l=e[5];let i;return e[6]!==o||e[7]!==d||e[8]!==l?(i=r.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-1 px-6 text-center",children:[o,d,l]}),e[6]=o,e[7]=d,e[8]=l,e[9]=i):i=e[9],i}function So(t,e){if(!t)return{visibility:"hidden",width:e};const s=Math.min(t.width/e,1);return{left:Math.max((t.width-e*s)/2,0),width:e,height:t.height/s,transform:`scale(${s})`,transformOrigin:"top left"}}function ko(t){const e=B.c(24),{url:s,device:a,title:n,missing:o}=t,[d,l]=tr(),[i,u]=V.useState(null);if(!s){let j;return e[0]!==o?(j=r.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=j):j=e[1],j}let c;e[2]!==a||e[3]!==s?(c=fn(s,a),e[2]=a,e[3]=s,e[4]=c):c=e[4];const h=c,f=rr[a],p=d.width>0?Math.min(d.width/f,1):1,g=d.width>0?Math.max((d.width-f*p)/2,0):0;let m;e[5]!==h?(m=()=>u(h),e[5]=h,e[6]=m):m=e[6];const b=d.height>0?d.height/p:"100%",x=`scale(${p})`;let P;e[7]!==f||e[8]!==g||e[9]!==b||e[10]!==x?(P={left:g,width:f,height:b,transform:x,transformOrigin:"top left"},e[7]=f,e[8]=g,e[9]=b,e[10]=x,e[11]=P):P=e[11];let y;e[12]!==h||e[13]!==m||e[14]!==P||e[15]!==n?(y=r.jsx("iframe",{src:h,title:n,sandbox:"allow-scripts allow-same-origin",onLoad:m,className:"absolute top-0 border-0 bg-white",style:P},h),e[12]=h,e[13]=m,e[14]=P,e[15]=n,e[16]=y):y=e[16];let v;e[17]!==i||e[18]!==h?(v=i!==h?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:r.jsx(Qt,{className:"size-5 motion-reduce:animate-none"})}):null,e[17]=i,e[18]=h,e[19]=v):v=e[19];let w;return e[20]!==l||e[21]!==y||e[22]!==v?(w=r.jsxs("div",{ref:l,className:"absolute inset-0",children:[y,v]}),e[20]=l,e[21]=y,e[22]=v,e[23]=w):w=e[23],w}function No(t){const e=B.c(21),{url:s,device:a,title:n,missing:o,onLoaded:d}=t,[l,i]=tr(),[u,c]=V.useState(null),[h,f]=V.useState(null),p=l.width>0&&l.height>0;p&&(u?.width!==l.width||u?.height!==l.height)&&c(l);const g=p?l:u;if(!s){let w;return e[0]!==o?(w=r.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=w):w=e[1],w}let m,b,x,P;if(e[2]!==g||e[3]!==a||e[4]!==d||e[5]!==i||e[6]!==h||e[7]!==n||e[8]!==s){const w=fn(s,a),j=rr[a];m=h?.src!==w;const N=[...h&&m?[h]:[],{src:w,logicalWidth:j}];b=i,x="absolute inset-0",P=N.map(C=>{const R=C.src===w&&m;return r.jsx("iframe",{src:C.src,title:n,"aria-hidden":R&&h?!0:void 0,sandbox:"allow-scripts allow-same-origin",onLoad:()=>{C.src===w&&(f(C),d?.(C.src))},className:X("absolute top-0 border-0 bg-white",R&&"pointer-events-none opacity-0"),style:So(g,C.logicalWidth)},C.src)}),e[2]=g,e[3]=a,e[4]=d,e[5]=i,e[6]=h,e[7]=n,e[8]=s,e[9]=m,e[10]=b,e[11]=x,e[12]=P}else m=e[9],b=e[10],x=e[11],P=e[12];let y;e[13]!==m||e[14]!==h?(y=m?h?r.jsx(Qt,{className:"absolute right-2 top-2 size-4 text-muted-foreground motion-reduce:animate-none"}):r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:r.jsx(Qt,{className:"size-5 motion-reduce:animate-none"})}):null,e[13]=m,e[14]=h,e[15]=y):y=e[15];let v;return e[16]!==b||e[17]!==x||e[18]!==P||e[19]!==y?(v=r.jsxs("div",{ref:b,className:x,children:[P,y]}),e[16]=b,e[17]=x,e[18]=P,e[19]=y,e[20]=v):v=e[20],v}const Co=/^Co-authored-by:\s*([^<\r\n]+?)(?:\s*<[^>\r\n]*>)?\s*$/im;function Ao(t){if(!t)return null;const e=Co.exec(t)?.[1]?.trim();return e||null}function Ro(t){return/\[bot\]$/i.test(t)||/-bot$/i.test(t)}function To(t){const e=Ao(t.body);if(e)return e;const s=t.author.trim();return!s||Ro(s)?null:s}function Bo(t,e,s,a,n,o){return["cms-publish-bodies",t,e,s,a,n,o]}const Io=6e4;function Do(t,e){return e?null:t.files.map(s=>`${s.index}${s.working_dir} ${s.path}`).sort().join(`
3
3
  `)}function Fo(t,e,s){const a=B.c(6);let n;a[0]!==s||a[1]!==t||a[2]!==e?(n=zt.decofile(`${t}/${e}/${s}`),a[0]=s,a[1]=t,a[2]=e,a[3]=n):n=a[3];let o;a[4]!==n?(o={queryKey:n,queryFn:Ys},a[4]=n,a[5]=o):o=a[5];const{data:d}=Rt(o);return d}function ir(t){const{orgSlug:e,virtualMcpId:s,branch:a,threadId:n,baseBranch:o,fastPreview:d,recoverSandbox:l}=t,i={orgSlug:e,virtualMcpId:s,branch:a,threadId:n},u=d?{fastPreview:!0}:void 0,c=V.useRef(null),h=async w=>{try{return await w()}catch(j){if(!l||!Ma(j))throw j;return c.current??=l(),await c.current,w()}},f=Xn({...La(i),queryFn:()=>h(()=>_a(i))}),p=f.data,g=p.changedFiles??null,m=p.headSha??null,b=g?g.length>0:Ml(p)||_l(p),x=Rt({queryKey:Bo(e,s,a,o,m,Do(p,d)),queryFn:()=>h(()=>Ol(i,p,o,u)),enabled:b,staleTime:d?Io:0,gcTime:d?void 0:0,throwOnError:(w,j)=>!g&&j.state.data===void 0}),P=Fo(e,s,a),y=x.data??null,v=g?Ya({files:g,lookup:P,diff:y}):Hi(y);return{status:p,summary:v,allPaths:g?g.map(w=>w.path):Object.keys(y?.diffs??{}),discardablePaths:d?null:new Set(p.files.map(w=>w.path)),changedFilesTotal:p.changedFilesTotal??v.count,changedFilesTruncated:p.changedFilesTruncated??!1,headSha:m,diff:y,bodiesPending:b&&x.isPending,bodiesFailed:x.isError,cardsPending:!g&&b&&x.isPending,refresh:()=>Promise.all([f.refetch(),d?null:x.refetch()])}}function $o(t){const e=B.c(4);let s;e[0]!==t?(s=zt.decofile(t),e[0]=t,e[1]=s):s=e[1];let a;e[2]!==s?(a={queryKey:s,queryFn:Ys},e[2]=s,e[3]=a):a=e[3];const{data:n}=Rt(a);return n}function Lo(t,e){const s=B.c(5);let a;s[0]!==t||s[1]!==e?(a=e?_r(e,t):zt.liveMeta("","no-scope"),s[0]=t,s[1]=e,s[2]=a):a=s[2];let n;s[3]!==a?(n={queryKey:a,queryFn:Ys},s[3]=a,s[4]=n):n=s[4];const{data:o}=Rt(n);return o}function gn(t){const e=B.c(27),{backend:s,cacheKey:a,scope:n}=t,o=Zn();let d;e[0]!==a?(d=zt.contentChanges(a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s.client||e[3]!==a||e[4]!==o?(l=()=>Or(o,s.client,a),e[2]=s.client,e[3]=a,e[4]=o,e[5]=l):l=e[5];let i;e[6]!==d||e[7]!==l?(i={queryKey:d,queryFn:l,staleTime:0},e[6]=d,e[7]=l,e[8]=i):i=e[8];const u=Xn(i),c=u.data,h=Mr(s,a,c),f=$o(a),p=Lo(s,n);let g;if(e[9]!==s.source||e[10]!==c.changes||e[11]!==f||e[12]!==p||e[13]!==h.data){const w=f&&p?$l(f,p):null,j=f&&p?Ll(f,p):null;g=Yi({changes:c.changes,sides:h.data??null,lookup:f,meta:p,hosted:s.source==="github",...w?{missingRules:w}:{},...j?{missingRuleUses:j}:{}}),e[9]=s.source,e[10]=c.changes,e[11]=f,e[12]=p,e[13]=h.data,e[14]=g}else g=e[14];const m=g;let b;e[15]!==c.changes?(b=Object.entries(c.changes).map(Mo),e[15]=c.changes,e[16]=b):b=e[16];const x=m.count>0&&h.isPending,P=f??null;let y;e[17]!==u?(y=()=>u.refetch(),e[17]=u,e[18]=y):y=e[18];let v;return e[19]!==c||e[20]!==h.isError||e[21]!==m||e[22]!==b||e[23]!==x||e[24]!==P||e[25]!==y?(v={changes:c,summary:m,entries:b,sidesPending:x,sidesFailed:h.isError,blocks:P,refresh:y},e[19]=c,e[20]=h.isError,e[21]=m,e[22]=b,e[23]=x,e[24]=P,e[25]=y,e[26]=v):v=e[26],v}function Mo(t){const[e,s]=t;return{name:e,version:s.version}}function _o(t){return["smart-review-verdict",t.orgSlug,t.virtualMcpId,t.branch,t.threadId,t.fastPreview?"fast-preview-upstream":"sandbox",t.signature,t.language]}function Oo(t){const e=B.c(27),{orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:u}=t,[c]=ea(),{language:h}=c;let f,p,g;if(e[0]!==n||e[1]!==i||e[2]!==u||e[3]!==d||e[4]!==h||e[5]!==s||e[6]!==l||e[7]!==o||e[8]!==a){const w=i?dn(i):"";f=u&&!!n&&!!l&&!!i&&w!=="",g=Rt,p=_o({orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:d,signature:w,language:h}),e[0]=n,e[1]=i,e[2]=u,e[3]=d,e[4]=h,e[5]=s,e[6]=l,e[7]=o,e[8]=a,e[9]=f,e[10]=p,e[11]=g}else f=e[9],p=e[10],g=e[11];let m;e[12]!==n||e[13]!==i||e[14]!==h||e[15]!==s||e[16]!==l||e[17]!==o||e[18]!==a?(m=()=>El({orgSlug:s,virtualMcpId:a,branch:n,threadId:o},{status:l,diff:i,language:h}),e[12]=n,e[13]=i,e[14]=h,e[15]=s,e[16]=l,e[17]=o,e[18]=a,e[19]=m):m=e[19];let b;e[20]!==f||e[21]!==p||e[22]!==m?(b={queryKey:p,queryFn:m,enabled:f,staleTime:1/0,gcTime:6e5,retry:Eo},e[20]=f,e[21]=p,e[22]=m,e[23]=b):b=e[23];const x=g(b),P=x.data??null,y=f&&x.isFetching&&!x.data;let v;return e[24]!==P||e[25]!==y?(v={verdict:P,loading:y},e[24]=P,e[25]=y,e[26]=v):v=e[26],v}function Eo(t,e){return!Ma(e)&&t<1}function or(t){const e=B.c(30),{orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:d,status:l,diff:i,policy:u,judgeEnabled:c,paths:h}=t,f=c===void 0?!0:c,p=h===void 0?null:h;let g;e[0]!==i||e[1]!==f||e[2]!==u?(g=f&&Ul(i,u),e[0]=i,e[1]=f,e[2]=u,e[3]=g):g=e[3];const m=g;let b;e[4]!==n||e[5]!==i||e[6]!==d||e[7]!==m||e[8]!==s||e[9]!==l||e[10]!==o||e[11]!==a?(b={orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:m},e[4]=n,e[5]=i,e[6]=d,e[7]=m,e[8]=s,e[9]=l,e[10]=o,e[11]=a,e[12]=b):b=e[12];const{verdict:x,loading:P}=Oo(b);if(!i&&p){let j;e[13]!==p||e[14]!==u?(j=zl(p,u),e[13]=p,e[14]=u,e[15]=j):j=e[15];let N;return e[16]!==j?(N={gate:j,ready:!1},e[16]=j,e[17]=N):N=e[17],N}if(!i){let j;return e[18]===Symbol.for("react.memo_cache_sentinel")?(j={gate:{allowed:!0,reason:null},ready:!1},e[18]=j):j=e[18],j}if(!m){let j;e[19]!==i||e[20]!==u?(j=Hl(i,u),e[19]=i,e[20]=u,e[21]=j):j=e[21];let N;return e[22]!==j?(N={gate:j,ready:!0},e[22]=j,e[23]=N):N=e[23],N}let y;e[24]!==P||e[25]!==x?(y=ql(x,P),e[24]=P,e[25]=x,e[26]=y):y=e[26];const v=!P;let w;return e[27]!==y||e[28]!==v?(w={gate:y,ready:v},e[27]=y,e[28]=v,e[29]=w):w=e[29],w}function Uo(t){return["main","master"].includes(t.trim().toLowerCase())}function zo(t,e,s,a){return t===0?a("thread.publishPopover.publish"):s||!Uo(e)?t===1?a("thread.publishPopover.publishOne"):a("thread.publishPopover.publishCount",{count:t}):t===1?a("thread.publishPopover.publishOneInProduction"):a("thread.publishPopover.publishCountInProduction",{count:t})}const Ho=2500;function qo(t){const{selectedId:e,readyIds:s,lastShownId:a,liveIds:n}=t;return e===null||s.has(e)?e:a!==null&&a!==e&&n.includes(a)?a:e}function cr(t){const e=B.c(16),s=V.useRef(!1),a=ye();let n;e[0]!==t?(n=h=>{!h&&s.current||t.onOpenChange(h)},e[0]=t,e[1]=n):n=e[1];const o=n;let d;e[2]!==t.mode||e[3]!==a?(d=t.mode==="review"?a("thread.publishPopover.submitForReview"):a("thread.publishPopover.publish"),e[2]=t.mode,e[3]=a,e[4]=d):d=e[4];let l;e[5]!==d?(l=r.jsx(sa,{className:"sr-only",children:d}),e[5]=d,e[6]=l):l=e[6];let i;e[7]!==t?(i=r.jsx(Ko,{...t,publishLockRef:s}),e[7]=t,e[8]=i):i=e[8];let u;e[9]!==l||e[10]!==i?(u=r.jsxs(na,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[l,i]}),e[9]=l,e[10]=i,e[11]=u):u=e[11];let c;return e[12]!==o||e[13]!==t.open||e[14]!==u?(c=r.jsx(ta,{open:t.open,onOpenChange:o,children:u}),e[12]=o,e[13]=t.open,e[14]=u,e[15]=c):c=e[15],c}function Ko(t){const e=B.c(3),s=Ht(t.virtualMcpId,t.branch),a=s.kind==="protocol"&&s.source==="github";let n;return e[0]!==a||e[1]!==t?(n=Di({open:t.open,hosted:a})?r.jsx(Wo,{...t}):null,e[0]=a,e[1]=t,e[2]=n):n=e[2],n}const Vo=4,Yt="flex h-[45%] min-h-0 min-w-0 shrink-0 md:h-auto md:flex-1";function es(t){const e=B.c(5),{list:s,pane:a}=t;let n;e[0]!==s?(n=r.jsx("div",{className:"flex min-h-0 w-full flex-1 flex-col max-md:border-t md:w-[380px] md:flex-none md:shrink-0 md:border-l md:[&>[data-publish-state]>:first-child]:pr-12",children:s}),e[0]=s,e[1]=n):n=e[1];let o;return e[2]!==a||e[3]!==n?(o=r.jsxs(r.Fragment,{children:[a,n]}),e[2]=a,e[3]=n,e[4]=o):o=e[4],o}function xn(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:X(Yt,"bg-muted/40 p-3"),children:r.jsx(ht,{className:"h-full w-full rounded-lg"})}),t[0]=e):e=t[0],e}function vn(t){const e=B.c(11),{mode:s,title:a,subLine:n,trailing:o}=t,d=s==="review"?ks:ja;let l;e[0]!==d?(l=r.jsx(d,{className:"size-4 shrink-0 text-muted-foreground"}),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==l||e[3]!==a||e[4]!==o?(i=r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l,a,o]}),e[2]=l,e[3]=a,e[4]=o,e[5]=i):i=e[5];let u;e[6]!==n?(u=n?r.jsx("div",{className:"pl-6 text-xs text-muted-foreground",children:n}):null,e[6]=n,e[7]=u):u=e[7];let c;return e[8]!==i||e[9]!==u?(c=r.jsxs(r.Fragment,{children:[i,u]}),e[8]=i,e[9]=u,e[10]=c):c=e[10],c}function yn(t){const e=B.c(9),{draftPreviewUrl:s,t:a}=t;let n;e[0]!==s?(n=()=>{s&&window.open(s,"_blank","noopener,noreferrer")},e[0]=s,e[1]=n):n=e[1];const o=!s;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(gs,{className:"size-4"}),e[2]=d):d=e[2];let l;e[3]!==a?(l=a("thread.publishPopover.preview"),e[3]=a,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==o||e[7]!==l?(i=r.jsxs(ve,{type:"button",variant:"outline",onClick:n,disabled:o,children:[d,l]}),e[5]=n,e[6]=o,e[7]=l,e[8]=i):i=e[8],i}function dr(t){const e=B.c(21),{mode:s,draftPreviewUrl:a}=t,n=ye();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(xn,{}),e[0]=o):o=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(ht,{className:"h-3.5 w-48"}),e[1]=d):d=e[1];let l;e[2]!==s?(l=r.jsx(vn,{mode:s,title:d}),e[2]=s,e[3]=l):l=e[3];let i,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Xt,{children:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Ut,{}),r.jsx(Ut,{}),r.jsx(Ut,{})]})}),u=r.jsxs(r.Fragment,{children:[r.jsx(ht,{className:"h-3 w-20"}),r.jsx(ht,{className:"h-14 w-full rounded-lg"})]}),e[4]=i,e[5]=u):(i=e[4],u=e[5]);let c;e[6]!==a||e[7]!==n?(c=r.jsx(yn,{draftPreviewUrl:a,t:n}),e[6]=a,e[7]=n,e[8]=c):c=e[8];const h=s==="review"?"default":"brand";let f;e[9]!==s||e[10]!==n?(f=n(s==="review"?"thread.publishPopover.submitForReview":"thread.publishPopover.publish"),e[9]=s,e[10]=n,e[11]=f):f=e[11];let p;e[12]!==h||e[13]!==f?(p=r.jsx(ve,{type:"button",variant:h,className:"flex-1",disabled:!0,children:f}),e[12]=h,e[13]=f,e[14]=p):p=e[14];let g;e[15]!==c||e[16]!==p?(g=r.jsxs("div",{className:"flex gap-2",children:[c,p]}),e[15]=c,e[16]=p,e[17]=g):g=e[17];let m;return e[18]!==g||e[19]!==l?(m=r.jsx(es,{pane:o,list:r.jsx(Cs,{state:"loading",header:l,body:i,note:u,footer:g})}),e[18]=g,e[19]=l,e[20]=m):m=e[20],m}function Go(t){const e=B.c(26),{mode:s,draftPreviewUrl:a,message:n,onRetry:o}=t,d=ye();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("div",{className:X(Yt,"bg-muted/40")}),e[0]=l):l=e[0];let i;e[1]!==d?(i=d("thread.publishPopover.loadFailed"),e[1]=d,e[2]=i):i=e[2];let u;e[3]!==i?(u=r.jsx("span",{className:"truncate",children:i}),e[3]=i,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==u?(c=r.jsx(vn,{mode:s,title:u}),e[5]=s,e[6]=u,e[7]=c):c=e[7];let h;e[8]!==n?(h=r.jsx("p",{className:"px-4 py-6 text-xs text-destructive",children:n}),e[8]=n,e[9]=h):h=e[9];let f;e[10]!==a||e[11]!==d?(f=r.jsx(yn,{draftPreviewUrl:a,t:d}),e[10]=a,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx(Xs,{className:"size-4"}),e[13]=p):p=e[13];let g;e[14]!==d?(g=d("thread.publishPopover.retry"),e[14]=d,e[15]=g):g=e[15];let m;e[16]!==o||e[17]!==g?(m=r.jsxs(ve,{type:"button",variant:"outline",className:"flex-1",onClick:o,children:[p,g]}),e[16]=o,e[17]=g,e[18]=m):m=e[18];let b;e[19]!==f||e[20]!==m?(b=r.jsxs("div",{className:"flex gap-2",children:[f,m]}),e[19]=f,e[20]=m,e[21]=b):b=e[21];let x;return e[22]!==b||e[23]!==c||e[24]!==h?(x=r.jsx(es,{pane:l,list:r.jsx(Cs,{state:"ready",header:c,body:h,footer:b})}),e[22]=b,e[23]=c,e[24]=h,e[25]=x):x=e[25],x}function Wo(t){const e=B.c(3),s=t.mode??"publish";let a;return e[0]!==s||e[1]!==t?(a=r.jsx(aa,{children:n=>{const{reset:o}=n;return r.jsx(ra,{fallback:d=>{const{error:l,resetError:i}=d;return r.jsx(Go,{mode:s,draftPreviewUrl:t.draftPreviewUrl,message:l?.message??"",onRetry:()=>{o(),i()}})},children:r.jsx(V.Suspense,{fallback:r.jsx(dr,{mode:s,draftPreviewUrl:t.draftPreviewUrl}),children:r.jsx(Qo,{...t})})})}}),e[0]=s,e[1]=t,e[2]=a):a=e[2],a}function Qo(t){const e=B.c(13),s=Ht(t.virtualMcpId,t.branch);let a;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(a={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch},e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=a):a=e[3];const n=Zs(a);if(s.kind==="protocol"&&n){let d;return e[4]!==s||e[5]!==n||e[6]!==t?(d=s.source==="sandbox"?r.jsx(Xo,{...t,backend:s,cacheKey:n}):r.jsx(Yo,{...t,backend:s,cacheKey:n}),e[4]=s,e[5]=n,e[6]=t,e[7]=d):d=e[7],d}if(s.kind!=="legacy"){const d=t.mode??"publish";let l;return e[8]!==t.draftPreviewUrl||e[9]!==d?(l=r.jsx(dr,{mode:d,draftPreviewUrl:t.draftPreviewUrl}),e[8]=t.draftPreviewUrl,e[9]=d,e[10]=l):l=e[10],l}let o;return e[11]!==t?(o=r.jsx(Jo,{...t}),e[11]=t,e[12]=o):o=e[12],o}function Jo(t){const e=B.c(52),s=Zt()?.taskId??null;let a;e[0]!==t.baseBranch||e[1]!==t.branch||e[2]!==t.fastPreview||e[3]!==t.orgSlug||e[4]!==t.recoverSandbox||e[5]!==t.virtualMcpId||e[6]!==s?(a={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:s,baseBranch:t.baseBranch,fastPreview:t.fastPreview,recoverSandbox:t.recoverSandbox},e[0]=t.baseBranch,e[1]=t.branch,e[2]=t.fastPreview,e[3]=t.orgSlug,e[4]=t.recoverSandbox,e[5]=t.virtualMcpId,e[6]=s,e[7]=a):a=e[7];const n=ir(a),o=t.mode!=="review";let d;e[8]!==t.branch||e[9]!==t.fastPreview||e[10]!==t.orgSlug||e[11]!==t.publishPolicy||e[12]!==t.virtualMcpId||e[13]!==n.allPaths||e[14]!==n.diff||e[15]!==n.status||e[16]!==o||e[17]!==s?(d={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:s,fastPreview:t.fastPreview,status:n.status,diff:n.diff,paths:n.allPaths,policy:t.publishPolicy,judgeEnabled:o},e[8]=t.branch,e[9]=t.fastPreview,e[10]=t.orgSlug,e[11]=t.publishPolicy,e[12]=t.virtualMcpId,e[13]=n.allPaths,e[14]=n.diff,e[15]=n.status,e[16]=o,e[17]=s,e[18]=d):d=e[18];const{gate:l}=or(d),i=n.discardablePaths;let u;e[19]!==i?(u=P=>i===null||P.every(y=>i.has(y)),e[19]=i,e[20]=u):u=e[20];const c=u;let h;e[21]!==c?(h=P=>c(P.filepaths),e[21]=c,e[22]=h):h=e[22];let f;e[23]!==c||e[24]!==n.allPaths||e[25]!==n.changedFilesTruncated?(f=!n.changedFilesTruncated&&c(n.allPaths),e[23]=c,e[24]=n.allPaths,e[25]=n.changedFilesTruncated,e[26]=f):f=e[26];let p;e[27]!==t.branch||e[28]!==n.status?(p=un(n.status)??t.branch,e[27]=t.branch,e[28]=n.status,e[29]=p):p=e[29];const g=n.headSha??void 0;let m;e[30]!==t.fastPreview||e[31]!==n.diff?(m=!t.fastPreview&&n.diff?{expectedDiffSignature:dn(n.diff)}:{},e[30]=t.fastPreview,e[31]=n.diff,e[32]=m):m=e[32];let b;e[33]!==l||e[34]!==n.allPaths||e[35]!==n.bodiesFailed||e[36]!==n.bodiesPending||e[37]!==n.cardsPending||e[38]!==n.changedFilesTotal||e[39]!==n.changedFilesTruncated||e[40]!==n.diff||e[41]!==n.refresh||e[42]!==n.summary||e[43]!==h||e[44]!==f||e[45]!==p||e[46]!==g||e[47]!==m?(b={summary:n.summary,allPaths:n.allPaths,canDiscard:h,canDiscardAll:f,changedFilesTotal:n.changedFilesTotal,changedFilesTruncated:n.changedFilesTruncated,diff:n.diff,bodiesPending:n.bodiesPending,bodiesFailed:n.bodiesFailed,cardsPending:n.cardsPending,refresh:n.refresh,gate:l,headBranch:p,expectedHeadSha:g,...m,hosted:!1,otherWork:!1},e[33]=l,e[34]=n.allPaths,e[35]=n.bodiesFailed,e[36]=n.bodiesPending,e[37]=n.cardsPending,e[38]=n.changedFilesTotal,e[39]=n.changedFilesTruncated,e[40]=n.diff,e[41]=n.refresh,e[42]=n.summary,e[43]=h,e[44]=f,e[45]=p,e[46]=g,e[47]=m,e[48]=b):b=e[48];let x;return e[49]!==t||e[50]!==b?(x=r.jsx(jn,{...t,source:b}),e[49]=t,e[50]=b,e[51]=x):x=e[51],x}function ur(t,e){return{summary:t.summary,allPaths:[],canDiscard:()=>!0,canDiscardAll:!0,changedFilesTotal:t.summary.count,changedFilesTruncated:!1,diff:null,bodiesPending:t.sidesPending,bodiesFailed:t.sidesFailed,cardsPending:!1,refresh:t.refresh,protocol:{backend:e,entries:t.entries},v8:{blocks:t.blocks}}}function Yo(t){const e=B.c(24),{backend:s,cacheKey:a,...n}=t,o=gn({backend:s,cacheKey:a,scope:{orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch}}),d=s.source==="github",l=zt.hostedPublishReview(n.orgSlug,n.virtualMcpId,n.branch);let i;e[0]!==n.branch||e[1]!==n.orgSlug||e[2]!==n.virtualMcpId?(i=()=>jl({orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch}),e[0]=n.branch,e[1]=n.orgSlug,e[2]=n.virtualMcpId,e[3]=i):i=e[3];let u;e[4]!==d||e[5]!==l||e[6]!==i?(u={queryKey:l,queryFn:i,enabled:d,staleTime:0},e[4]=d,e[5]=l,e[6]=i,e[7]=u):u=e[7];const c=Rt(u);let h;e[8]!==s||e[9]!==o?(h=ur(o,s),e[8]=s,e[9]=o,e[10]=h):h=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f={allowed:!0,reason:null},e[11]=f):f=e[11];let p;e[12]!==c.data?.alsoChanged?(p=c.data?.alsoChanged??[],e[12]=c.data?.alsoChanged,e[13]=p):p=e[13];let g;e[14]!==p?(g=new Set(p),e[14]=p,e[15]=g):g=e[15];let m;e[16]!==d||e[17]!==n.branch||e[18]!==h||e[19]!==g?(m={...h,gate:f,headBranch:n.branch,hosted:d,alsoChanged:g,otherWork:!1},e[16]=d,e[17]=n.branch,e[18]=h,e[19]=g,e[20]=m):m=e[20];let b;return e[21]!==n||e[22]!==m?(b=r.jsx(jn,{...n,source:m}),e[21]=n,e[22]=m,e[23]=b):b=e[23],b}function Xo(t){const e=B.c(58);let s,a,n;e[0]!==t?({backend:s,cacheKey:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);const o=Zt()?.taskId??null;let d;e[4]!==n.branch||e[5]!==n.orgSlug||e[6]!==n.virtualMcpId?(d={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[4]=n.branch,e[5]=n.orgSlug,e[6]=n.virtualMcpId,e[7]=d):d=e[7];let l;e[8]!==s||e[9]!==a||e[10]!==d?(l={backend:s,cacheKey:a,scope:d},e[8]=s,e[9]=a,e[10]=d,e[11]=l):l=e[11];const i=gn(l);let u;e[12]!==n.baseBranch||e[13]!==n.branch||e[14]!==n.fastPreview||e[15]!==n.orgSlug||e[16]!==n.recoverSandbox||e[17]!==n.virtualMcpId||e[18]!==o?(u={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,baseBranch:n.baseBranch,fastPreview:n.fastPreview,recoverSandbox:n.recoverSandbox},e[12]=n.baseBranch,e[13]=n.branch,e[14]=n.fastPreview,e[15]=n.orgSlug,e[16]=n.recoverSandbox,e[17]=n.virtualMcpId,e[18]=o,e[19]=u):u=e[19];const c=ir(u),h=n.mode!=="review";let f;e[20]!==c.allPaths||e[21]!==c.diff||e[22]!==c.status||e[23]!==n.branch||e[24]!==n.fastPreview||e[25]!==n.orgSlug||e[26]!==n.publishPolicy||e[27]!==n.virtualMcpId||e[28]!==h||e[29]!==o?(f={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,fastPreview:n.fastPreview,status:c.status,diff:c.diff,paths:c.allPaths,policy:n.publishPolicy,judgeEnabled:h},e[20]=c.allPaths,e[21]=c.diff,e[22]=c.status,e[23]=n.branch,e[24]=n.fastPreview,e[25]=n.orgSlug,e[26]=n.publishPolicy,e[27]=n.virtualMcpId,e[28]=h,e[29]=o,e[30]=f):f=e[30];const{gate:p}=or(f);let g;if(e[31]!==c.allPaths||e[32]!==i){let N;e[34]!==i?(N=C=>{const R=mn(C);return R===null?!cn(C):!Object.hasOwn(i.changes.changes,R)},e[34]=i,e[35]=N):N=e[35],g=c.allPaths.some(N),e[31]=c.allPaths,e[32]=i,e[33]=g}else g=e[33];const m=g;let b;e[36]!==s||e[37]!==i?(b=ur(i,s),e[36]=s,e[37]=i,e[38]=b):b=e[38];let x;e[39]!==c||e[40]!==i?(x=()=>Promise.all([i.refresh(),c.refresh()]),e[39]=c,e[40]=i,e[41]=x):x=e[41];let P;e[42]!==c.status||e[43]!==n.branch?(P=un(c.status)??n.branch,e[42]=c.status,e[43]=n.branch,e[44]=P):P=e[44];const y=c.headSha??void 0;let v;e[45]!==c.diff?(v=c.diff?{expectedDiffSignature:dn(c.diff)}:{},e[45]=c.diff,e[46]=v):v=e[46];let w;e[47]!==p||e[48]!==m||e[49]!==y||e[50]!==v||e[51]!==b||e[52]!==x||e[53]!==P?(w={...b,refresh:x,gate:p,headBranch:P,expectedHeadSha:y,...v,hosted:!1,otherWork:m},e[47]=p,e[48]=m,e[49]=y,e[50]=v,e[51]=b,e[52]=x,e[53]=P,e[54]=w):w=e[54];let j;return e[55]!==n||e[56]!==w?(j=r.jsx(jn,{...n,source:w}),e[55]=n,e[56]=w,e[57]=j):j=e[57],j}function jn(t){const e=B.c(131),{source:s,publishLockRef:a,onOpenChange:n,mode:o,fastPreview:d,orgSlug:l,virtualMcpId:i,branch:u,baseBranch:c,repoTarget:h,owner:f,repo:p,draftPreviewUrl:g,destinationHost:m,previewServerUrl:b,compareDraft:x,lastPublishedPr:P,onRequestApproval:y,openPullRequest:v,onPullRequestChanged:w,onPublished:j,notLive:N}=t,C=o===void 0?"publish":o,R=P===void 0?null:P,k=v===void 0?null:v,A=N===void 0?!1:N,S=ye(),[$]=ea(),{language:F}=$,T=Zt()?.taskId??null,{data:M}=Ps.useSession(),O=oa(ca(l,i,u)),{allPaths:ee,changedFilesTotal:re,changedFilesTruncated:H,diff:L,bodiesFailed:z,refresh:te,gate:W,hosted:I,otherWork:J}=s;let U;e[0]!==x||e[1]!==s.bodiesPending||e[2]!==s.cardsPending||e[3]!==s.summary?(U={summary:s.summary,cardsPending:s.cardsPending,bodiesPending:s.bodiesPending,compareDraft:x},e[0]=x,e[1]=s.bodiesPending,e[2]=s.cardsPending,e[3]=s.summary,e[4]=U):U=e[4];const oe=U;let Y;e[5]!==I?(Y={hosted:I},e[5]=I,e[6]=Y):Y=e[6];const ne=Ii(oe,Y),{summary:D,cardsPending:se,bodiesPending:le,compareDraft:he}=ne.shown,[G,pe]=V.useState(null),[Z,E]=V.useState(!1),[q,ce]=V.useState(Zo);let we;e[7]===Symbol.for("react.memo_cache_sentinel")?(we=Q=>ce(be=>be.has(Q)?be:new Set(be).add(Q)),e[7]=we):we=e[7];const fe=we,[Me,_]=V.useState(null);let ae;e[8]===Symbol.for("react.memo_cache_sentinel")?(ae=[],e[8]=ae):ae=e[8];const[Oe,_e]=V.useState(ae);let Ee;e[9]!==s.v8?(Ee=Q=>{_(Q),_e(be=>[Q,...be.filter(me=>me!==Q)]),s.v8&&setTimeout(()=>fe(Q),Ho)},e[9]=s.v8,e[10]=Ee):Ee=e[10];const ft=Ee,[tt,je]=V.useState(null);let Ie;e[11]!==G||e[12]!==D?(Ie=Ki(G,Wi(D)),e[11]=G,e[12]=D,e[13]=Ie):Ie=e[13];const $e=Ie,De=[...D.pages,...D.blocks,...D.other],Pe=De.find(Q=>Be(Q)===Me)??De[0]??null,Fe=Pe?Be(Pe):null,Se=[...new Set([...Fe?[Fe]:[],...Oe,...De.map(Be)])].filter(Q=>De.some(be=>Be(be)===Q)).slice(0,Vo),Le=!!s.v8,[st,mt]=V.useState(null),Re=Le?qo({selectedId:Fe,readyIds:q,lastShownId:st,liveIds:Se}):Fe;Le&&Re===Fe&&Re!==st&&mt(Re);const de=C==="review"&&!I,K=se?"loading":le?"manifest":"ready",xe=k?.state==="open",ke=s.headBranch,Ne=M?.user;let Ce;e[14]!==Ne?(Ce=qa(Ne),e[14]=Ne,e[15]=Ce):Ce=e[15];let Ue;e[16]!==s.expectedDiffSignature?(Ue=s.expectedDiffSignature?{expectedDiffSignature:s.expectedDiffSignature}:{},e[16]=s.expectedDiffSignature,e[17]=Ue):Ue=e[17];let nt;e[18]!==c||e[19]!==u||e[20]!==d||e[21]!==l||e[22]!==f||e[23]!==p||e[24]!==h||e[25]!==s.expectedHeadSha||e[26]!==s.headBranch||e[27]!==Ce||e[28]!==Ue||e[29]!==T||e[30]!==i?(nt={orgSlug:l,virtualMcpId:i,branch:u,threadId:T,fastPreview:d,baseBranch:c,target:h,owner:f,repo:p,headBranch:ke,coAuthor:Ce,expectedHeadSha:s.expectedHeadSha,...Ue},e[18]=c,e[19]=u,e[20]=d,e[21]=l,e[22]=f,e[23]=p,e[24]=h,e[25]=s.expectedHeadSha,e[26]=s.headBranch,e[27]=Ce,e[28]=Ue,e[29]=T,e[30]=i,e[31]=nt):nt=e[31];const pt=nt,bt=de?"review":"publish",We=M?.user?.name;let Qe;e[32]!==ee||e[33]!==m||e[34]!==I||e[35]!==$e||e[36]!==n||e[37]!==j||e[38]!==w||e[39]!==a||e[40]!==te||e[41]!==s.protocol||e[42]!==bt||e[43]!==We||e[44]!==pt?(Qe={mode:bt,target:pt,note:$e,allPaths:ee,destinationHost:m,publishLockRef:a,onOpenChange:n,refresh:te,onPullRequestChanged:w,onPublished:j,hosted:I,authorName:We,protocol:s.protocol},e[32]=ee,e[33]=m,e[34]=I,e[35]=$e,e[36]=n,e[37]=j,e[38]=w,e[39]=a,e[40]=te,e[41]=s.protocol,e[42]=bt,e[43]=We,e[44]=pt,e[45]=Qe):Qe=e[45];const{isPublishing:Ae,publishError:at,publishErrorDetail:rt,submit:gt,discardChange:Tt,discardAll:xt}=Nl(Qe),Je=fa(l,i).phase==="saving",Ye=I&&A&&D.count===0,Xe=D.count>0||J||Ye,Bt=!Ae&&Xe&&(de||W.allowed);let lt;e[46]!==c||e[47]!==de||e[48]!==Ye||e[49]!==s.v8||e[50]!==D.count||e[51]!==S?(lt=de?D.count===0?S("thread.publishPopover.submitForReview"):D.count===1?S("thread.publishPopover.submitOneForReview"):S("thread.publishPopover.submitCountForReview",{count:D.count}):Ye?S("thread.publishPopover.notLive"):zo(D.count,c,!!s.v8,S),e[46]=c,e[47]=de,e[48]=Ye,e[49]=s.v8,e[50]=D.count,e[51]=S,e[52]=lt):lt=e[52];const vt=lt;let it;e:{if(de&&xe){let me;e[53]!==k.number||e[54]!==S?(me=S("thread.publishPopover.updatesPullRequest",{number:k.number}),e[53]=k.number,e[54]=S,e[55]=me):me=e[55],it=me;break e}const Q=R;if(!Q?.mergedAt){it=null;break e}let be;if(e[56]!==F||e[57]!==Q||e[58]!==S){const me=Ar(new Date(Q.mergedAt),F),Te=To(Q);be=Te?S("thread.publishPopover.lastPublishedBy",{when:me,name:Te}):S("thread.publishPopover.lastPublished",{when:me}),e[56]=F,e[57]=Q,e[58]=S,e[59]=be}else be=e[59];it=be}const It=it;let Dt;e[60]!==de||e[61]!==D.count||e[62]!==S?(Dt=de?S("thread.publishPopover.submitForReview"):D.count===1?S("thread.publishPopover.publishOne"):D.count>1?S("thread.publishPopover.publishCount",{count:D.count}):S("thread.publishPopover.publish"),e[60]=de,e[61]=D.count,e[62]=S,e[63]=Dt):Dt=e[63];const _t=Dt,Ft=(Q,be)=>be.length===0?null:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:Q}),be.map(me=>{const Te=Be(me);return r.jsx(er,{change:me,bodyPending:le,selected:Pe!==null&&Be(Pe)===Te,onSelect:()=>ft(Te),confirming:tt===Te,onConfirmingChange:ge=>je(ge?Te:null),onDiscard:s.canDiscard(me)?()=>{Tt(me)}:void 0,isPublishing:Ae,isDiscarding:Je,v8:!!s.v8,alsoChangedOnMain:!!s.alsoChanged&&s.alsoChanged.has(me.entry?.name??me.blockKey??"")},Te)})]});let Ze;e:{if(de||!Xe){Ze=null;break e}if(W.pending){let Te;e[64]===Symbol.for("react.memo_cache_sentinel")?(Te=r.jsx(Qt,{className:"size-3.5 motion-reduce:animate-none"}),e[64]=Te):Te=e[64];let ge;e[65]!==S?(ge=S("thread.publishPopover.reviewing"),e[65]=S,e[66]=ge):ge=e[66];let Ct;e[67]!==ge?(Ct=r.jsxs("div",{className:"flex items-center gap-2 border-t px-4 py-2.5 text-xs text-muted-foreground",children:[Te,ge]}),e[67]=ge,e[68]=Ct):Ct=e[68],Ze=Ct;break e}if(W.allowed){Ze=null;break e}let Q;e[69]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(ia,{className:"mt-0.5 size-3.5 shrink-0"}),e[69]=Q):Q=e[69];let be;e[70]!==W.reason||e[71]!==S?(be=W.reason??S("thread.publishPopover.needsReviewGeneric"),e[70]=W.reason,e[71]=S,e[72]=be):be=e[72];let me;e[73]!==be?(me=r.jsxs("div",{className:"flex items-start gap-2 border-t px-4 py-2.5 text-xs text-warning",children:[Q,r.jsx("span",{children:be})]}),e[73]=be,e[74]=me):me=e[74],Ze=me}const yt=Ze;let ot;e[75]!==xt||e[76]!==Z||e[77]!==Je||e[78]!==Ae||e[79]!==s.canDiscardAll||e[80]!==D.count||e[81]!==S?(ot=D.count<=1||!s.canDiscardAll?null:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>E(!0),disabled:Ae||Je,children:S("thread.publishPopover.discardAll")}),r.jsx(Qs,{open:Z,onOpenChange:E,children:r.jsxs(Ws,{children:[r.jsxs(qs,{children:[r.jsx(zs,{children:S("thread.publishPopover.discardAllTitle")}),r.jsx(Hs,{children:S("thread.publishPopover.discardAllConfirm")})]}),r.jsxs(Gs,{children:[r.jsx(Ks,{children:S("thread.publishDialog.cancel")}),r.jsx(Vs,{onClick:()=>{xt()},disabled:Je,className:X(la({variant:"destructive"})),children:S("thread.publishPopover.discardAll")})]})]})})]}),e[75]=xt,e[76]=Z,e[77]=Je,e[78]=Ae,e[79]=s.canDiscardAll,e[80]=D.count,e[81]=S,e[82]=ot):ot=e[82];const jt=ot,Pt=se?r.jsx(Xt,{children:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Ut,{}),r.jsx(Ut,{})]})}):D.count===0&&J?r.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:S("thread.publishPopover.onlyOtherWork")}):Ye?r.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[r.jsx(ja,{className:"mb-1 size-5 text-muted-foreground"}),r.jsx("p",{className:"text-sm font-medium",children:S("thread.publishPopover.notLiveBody")}),r.jsx("p",{className:"text-xs text-muted-foreground",children:S("thread.publishPopover.notLiveHint")})]}):D.count===0?r.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[r.jsx(on,{className:"mb-1 size-5 text-success"}),r.jsx("p",{className:"text-sm font-medium",children:S(de?"thread.publishPopover.nothingToSubmit":"thread.publishPopover.everythingLive")}),r.jsx("p",{className:"text-xs text-muted-foreground",children:S(de?"thread.publishPopover.submitEmptyHint":"thread.publishPopover.emptyHint")})]}):r.jsxs(Xt,{children:[H?r.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.showingFirst",{shown:D.count,total:re})}):null,Ft(S("thread.publishPopover.pagesGroup"),D.pages),Ft(S("thread.publishPopover.blocksGroup"),D.blocks),Ft(S("thread.publishPopover.otherGroup"),D.other),z?r.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.detailsUnavailable")}):null,J?r.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.alsoOtherWork")}):null]}),wt=se?r.jsx(xn,{}):Pe?r.jsx("div",{className:X(Yt,"relative"),children:De.filter(Q=>Se.includes(Be(Q))).map(Q=>r.jsx("div",{className:X("absolute inset-0 flex",Le?Be(Q)===Re?"z-10":"pointer-events-none opacity-0":Be(Q)!==Fe&&"hidden"),inert:Le&&Be(Q)!==Re,"aria-hidden":Le&&Be(Q)!==Re?!0:void 0,children:r.jsx(lr,{change:Q,diff:L,bodyPending:le,previewServerUrl:b,draft:he,lastPage:O,v8:s.v8,onReady:Le?()=>fe(Be(Q)):void 0})},Be(Q)))}):r.jsx("div",{className:X(Yt,"bg-muted/40")});let ze;e[83]!==vt?(ze=r.jsx("span",{className:"truncate",children:vt}),e[83]=vt,e[84]=ze):ze=e[84];let He;e[85]!==jt||e[86]!==C||e[87]!==It||e[88]!==ze?(He=r.jsx(vn,{mode:C,title:ze,subLine:It,trailing:jt}),e[85]=jt,e[86]=C,e[87]=It,e[88]=ze,e[89]=He):He=e[89];let qe;e[90]!==Ae||e[91]!==de||e[92]!==$e||e[93]!==D.count||e[94]!==S?(qe=D.count===0?null:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-sm font-medium",children:S(de?"thread.publishPopover.reviewNote":"thread.publishPopover.versionNote")}),r.jsx(yl,{value:$e,onChange:Q=>pe(Q.target.value),placeholder:S(de?"thread.publishPopover.reviewNotePlaceholder":"thread.publishPopover.versionNotePlaceholder"),rows:2,maxLength:Cl,className:"resize-none text-sm",disabled:Ae})]}),e[90]=Ae,e[91]=de,e[92]=$e,e[93]=D.count,e[94]=S,e[95]=qe):qe=e[95];let Ke;e[96]!==g||e[97]!==S?(Ke=r.jsx(yn,{draftPreviewUrl:g,t:S}),e[96]=g,e[97]=S,e[98]=Ke):Ke=e[98];let Ve;e[99]!==Bt||e[100]!==W||e[101]!==Xe||e[102]!==I||e[103]!==Ae||e[104]!==de||e[105]!==y||e[106]!==_t||e[107]!==ne||e[108]!==gt||e[109]!==S?(Ve=!de&&!I&&Xe&&!W.allowed&&!W.pending?r.jsx(ve,{type:"button",className:"flex-1",onClick:y,disabled:Ae,children:S("thread.publishPopover.requestApproval")}):r.jsxs(ve,{type:"button",variant:de?"default":"brand",className:"flex-1",onClick:()=>{ne.hold(),gt().then(Q=>{Q===!1&&ne.release()})},disabled:!Bt,children:[Ae?r.jsx(Qt,{className:"size-4 motion-reduce:animate-none"}):null,Ae?S(de?"thread.publishPopover.submitting":"thread.publishPopover.publishing"):_t]}),e[99]=Bt,e[100]=W,e[101]=Xe,e[102]=I,e[103]=Ae,e[104]=de,e[105]=y,e[106]=_t,e[107]=ne,e[108]=gt,e[109]=S,e[110]=Ve):Ve=e[110];let Ge;e[111]!==Ke||e[112]!==Ve?(Ge=r.jsxs("div",{className:"flex gap-2",children:[Ke,Ve]}),e[111]=Ke,e[112]=Ve,e[113]=Ge):Ge=e[113];let ct;e[114]!==at||e[115]!==rt||e[116]!==S?(ct=at?r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-destructive",children:at}),rt?r.jsx(Er,{label:S("siteEditor.details"),detail:rt}):null]}):null,e[114]=at,e[115]=rt,e[116]=S,e[117]=ct):ct=e[117];let ue;e[118]!==Ge||e[119]!==ct?(ue=r.jsxs(r.Fragment,{children:[Ge,ct]}),e[118]=Ge,e[119]=ct,e[120]=ue):ue=e[120];let dt;e[121]!==Pt||e[122]!==yt||e[123]!==K||e[124]!==He||e[125]!==qe||e[126]!==ue?(dt=r.jsx(Cs,{state:K,header:He,body:Pt,note:qe,gate:yt,footer:ue}),e[121]=Pt,e[122]=yt,e[123]=K,e[124]=He,e[125]=qe,e[126]=ue,e[127]=dt):dt=e[127];let Kt;return e[128]!==wt||e[129]!==dt?(Kt=r.jsx(es,{pane:wt,list:dt}),e[128]=wt,e[129]=dt,e[130]=Kt):Kt=e[130],Kt}function Zo(){return new Set}function ec(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return Zl[t].short}const tc=new Set(["failure","timed_out","cancelled","action_required"]);function hr(t){return t.status==="completed"&&tc.has(t.conclusion)}function Pn(t){return t.status==="queued"||t.status==="in_progress"}function ps(t){return t.isPending&&t.fetchStatus!=="idle"}function sc(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr-page"}}function At(t,e,s){return e?[...t,sc(s)]:t}function ut(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"sync",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function Hn(t){return{key:"submit-for-review",label:t("thread.headerActions.submitForReview"),action:"create-pr"}}function hs(t,e,s){if(e.filter(Pn).length===0)return t;const n=e.filter(o=>o.status==="completed").length;return{...t,tooltip:s("thread.cmsActions.checksRunning",{done:n,total:e.length})}}function nc(t){const{lifecycle:e,branch:s,pr:a,checks:n,reviews:o,loading:d,t:l}=t;if(d)return{label:l("thread.headerActions.loading"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.loadingBranchTooltip"),menu:[]};switch(e.phase){case"idle":return{label:t.claimPhase&&ec(t.claimPhase.kind)||l("thread.headerActions.startingSandbox"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForDaemonTooltip"),menu:[]};case"cloning":return{label:l("thread.headerActions.cloningRepo"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.cloningRepoTooltip"),menu:[]};case"clone-failed":return{label:l("thread.headerActions.cloneFailed"),disabled:!0,variant:"outline",tooltip:e.error||l("thread.headerActions.cloneFailedDefaultTooltip"),menu:[]};case"checking-out":return{label:l("thread.headerActions.switchingTo",{branch:e.to}),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.checkingOutTooltip",{branch:e.to}),menu:[]};case"installing":return{label:l("thread.headerActions.installingPackages"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.installingPackagesTooltip"),menu:[]};case"starting":{if(!(s.kind==="ready"&&(s.workingTreeDirty||s.aheadOfBase>0||s.unpushed>0))&&!t.noReviewableDiff)return{label:l("thread.headerActions.startingApp"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.startingAppTooltip"),menu:[]};break}}if(s.kind!=="ready")return{label:l("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForBranchTooltip"),menu:[]};const i=s,u=i.unpushed>0&&!(a&&i.headSha&&a.headSha&&i.headSha===a.headSha);if(t.noReviewableDiff&&!a)return{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:ut([],i,l)};if(i.workingTreeDirty||u)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ut(At([Hn(l)],a,l),i,l)};if(za("no local work — checking PR/sync state",{workingTreeDirty:i.workingTreeDirty,unpushed:i.unpushed,aheadOfBase:i.aheadOfBase,behindBase:i.behindBase,branch:i.branch,base:i.base,prMerged:a?.merged??null,prState:a?.state??null}),a?.merged)return!!i.headSha&&!!a.headSha&&i.headSha!==a.headSha?{label:l("thread.headerActions.continue"),action:"create-pr",variant:"special",tooltip:l("thread.headerActions.openNewPrTooltip"),menu:ut(At([],a,l),i,l)}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.prMergedTooltip",{prNumber:String(a.number),base:a.base}),menu:ut(At([],a,l),i,l)};if(i.aheadOfBase>0){if(a&&a.state==="closed"&&!a.merged)return{label:l("thread.headerActions.reopenPr"),action:"reopen",variant:"default",tooltip:l("thread.headerActions.reopenPrTooltip",{prNumber:String(a.number)}),menu:ut(At([],a,l),i,l)};if(!a)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ut([Hn(l)],i,l)};if((o?.mergeableState??"unknown")==="dirty")return{label:l("thread.cmsActions.getLatest"),action:"rebase",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:l("thread.cmsActions.resolveOnProvider"),action:"open-pr-page"}]};const h=n.filter(Pn).length,f=n.filter(hr).map(g=>g.name);if(h===0&&f.length>0)return{label:l("thread.headerActions.fixChecks"),action:"fix-checks",variant:"default",tooltip:l("thread.headerActions.failingChecksTooltip",{checks:f.join(", ")}),meta:{failingChecks:f},menu:ut(At([{key:"publish-anyway",label:l("thread.headerActions.publishAnyway"),action:"merge",tooltip:l("thread.headerActions.squashMergeTooltip",{prNumber:String(a.number),base:a.base})}],a,l),i,l)};if(o?.draft)return hs({label:l("thread.headerActions.markReady"),action:"mark-ready",variant:"default",tooltip:l("thread.headerActions.markDraftReadyTooltip"),menu:ut(At([],a,l),i,l)},n,l);const p=o?.unresolvedConversations??0;return p>0?hs({label:l("thread.headerActions.addressFeedback"),action:"resolve-comments",variant:"default",tooltip:l("thread.headerActions.unresolvedConversationsTooltip",{count:String(p)}),menu:ut(At([],a,l),i,l)},n,l):o?.missingRequiredApprovals?hs({label:l("thread.cmsActions.waitingForReview"),action:"open-pr-page",variant:"outline",tooltip:l("thread.headerActions.waitingForApprovalsTooltip"),menu:ut(At([],a,l),i,l)},n,l):hs({label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",meta:{publishPolicyOverride:"open"},menu:ut(At([{key:"review",label:l("thread.headerActions.review"),action:"review"}],a,l),i,l)},n,l)}return i.behindBase>0?{label:l("thread.cmsActions.getLatest"),action:"sync",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[]}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:[]}}function qn(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr"}}function fs(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"get-latest",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function Kn(t,e,s,a){const n=e.length;if(n===0)return t;if(e.filter(Pn).length>0){const l=e.filter(u=>u.status==="completed").length,i=a("thread.cmsActions.checksRunning",{done:l,total:n});return s==="loading"?{...t,loading:!0,tooltip:i}:{...t,tooltip:i}}const d=e.filter(hr).length;return d>0?{...t,variant:"warning",tooltip:a("thread.cmsActions.checksFailing",{failed:d,total:n})}:t}function ac(t,e){return!!(t?.merged&&t.headSha&&e.kind==="ready"&&!e.workingTreeDirty&&e.headSha===t.headSha)}function rc(t){return ps(t.prQuery)?!0:t.pr?.state!=="open"||t.pr.merged?!1:ps(t.checksQuery)||ps(t.reviewsQuery)}function lc(t,e){return t.workingTreeDirty?!0:e!==null?e>0:t.aheadOfBase>0}function ic(t,e){if(!t)return{branchMeta:{kind:"unknown"},publishableChangeCount:null};const s=Object.keys(t.changes).length;return{branchMeta:{kind:"ready",branch:e,base:t.base.resolvedRef??"main",workingTreeDirty:!1,unpushed:0,aheadOfBase:s,behindBase:0,headSha:t.revision},publishableChangeCount:s}}function oc(t,e){return e?.notLive&&!t.action&&!t.loading?{label:e.t("thread.publishPopover.publish"),action:"publish",variant:"brand",tooltip:e.t("thread.cmsActions.notLiveTooltip"),status:e.t("thread.cmsActions.notLive"),menu:[]}:{...t,menu:[]}}function cc(t){if(!t)return!1;const{current:e,commits:s}=t;return e?s.findIndex(a=>a.sha===e.revision)>0:!1}function dc(t){const{branch:e,pr:s,checks:a,reviews:n,publishing:o,saving:d,loading:l,publishableChangeCount:i,t:u}=t;if(e.kind!=="ready"&&t.statusError)return{label:u("thread.cmsActions.retry"),action:"retry-status",variant:"outline",disabled:t.statusRetrying,loading:t.statusRetrying,tooltip:t.statusError,menu:[]};if(l||e.kind!=="ready")return{label:u("thread.headerActions.loading"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(o)return{label:u("thread.cmsActions.publishing"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(t.syncing)return{label:u("thread.cmsActions.gettingLatest"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(d)return{label:u("thread.headerActions.saving"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(s&&s.state==="open"&&!s.merged?s:null){const h=n?.mergeableState??"unknown";return h==="dirty"?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:u("thread.cmsActions.resolveOnProvider"),action:"open-pr"}]}:h==="blocked"||n?.draft?Kn({label:u("thread.cmsActions.waitingForReview"),action:"open-pr",variant:"outline",menu:fs([qn(u)],e,u)},a,"loading",u):Kn({label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:fs([qn(u)],e,u)},a,"none",u)}return ac(s,e)?{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:fs([],e,u)}:lc(e,i)?{label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:fs([{key:"request-approval",label:u("thread.headerActions.submitForReview"),action:"request-approval"}],e,u)}:e.behindBase>0?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[],autoRun:e.aheadOfBase===0}:{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:[]}}function uc(t){return t.conflicting===!0?"dirty":t.conflicting===null?"unknown":t.reviewBlocked||t.unresolvedConversations>0?"blocked":"clean"}function fr(t){const e=B.c(4);let s;e[0]!==t?(s=il(t),e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a={...s,select:hc},e[2]=s,e[3]=a):a=e[3],Rt(a)}function hc(t){const e=t.changeRequest;return e?{draft:e.draft,mergeableState:uc(e),unresolvedConversations:e.unresolvedConversations,missingRequiredApprovals:e.reviewBlocked}:null}function Vn(t,e){return t==="open-pr"||e==="resolve-on-provider"?r.jsx(Da,{size:16}):t==="publish"?r.jsx(Pa,{className:"size-4"}):t==="get-latest"||t==="retry-status"?r.jsx(Xs,{className:"size-4"}):r.jsx(ks,{className:"size-4"})}function fc(t){const e=B.c(65),{virtualMcpId:s}=t,a=ye(),{org:n}=ws(),o=Zn(),d=nn(s),{data:l}=Ps.useSession(),{deleteRelease:i}=en(s),{currentBranch:u,setCurrentTaskBranch:c,taskId:h,createTask:f}=da();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={open:!1,mode:"publish"},e[0]=p):p=e[0];const[g,m]=V.useState(p);let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=K=>m({open:!0,mode:K}),e[1]=b):b=e[1];const x=b,P=Aa(d),y=P.status==="attached"||P.status==="public-clone"?P.repo:null,{previewServerUrl:v}=an(s),w=u?oa(ca(n.slug,s,u)):null,j=w?ln(w.path,w.params):"/",N=dl(u?{orgSlug:n.slug,virtualMcpId:s,branch:u,previewServerUrl:v,path:j}:null);let C;e[2]!==u||e[3]!==n.slug||e[4]!==s?(C=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[2]=u,e[3]=n.slug,e[4]=s,e[5]=C):C=e[5];const R=ul(C),k=Ht(s,u),A=k.kind==="protocol"&&k.source==="github";let S;e[6]!==u||e[7]!==n.slug||e[8]!==s?(S=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[6]=u,e[7]=n.slug,e[8]=s,e[9]=S):S=e[9];const $=Zs(S),F=ma(A?k:null,$);let T;e[10]!==A?(T={enabled:A},e[10]=A,e[11]=T):T=e[11];const M=ei(n.slug,s,T),O=A&&cc(M.data?.pages[0]);let ee;e[12]!==n.slug||e[13]!==s?(ee=Ur(n.slug,s),e[12]=n.slug,e[13]=s,e[14]=ee):ee=e[14];const re=hl(ee,A?R:null),H=A?fl(v,j,re):N.url,L=u??"",z=h??null;let te;e[15]!==n.slug||e[16]!==L||e[17]!==z||e[18]!==s?(te=La({orgSlug:n.slug,virtualMcpId:s,branch:L,threadId:z}),e[15]=n.slug,e[16]=L,e[17]=z,e[18]=s,e[19]=te):te=e[19];const W=!!u&&k.kind!=="pending"&&!A;let I;e[20]!==W||e[21]!==te?(I={...te,enabled:W},e[20]=W,e[21]=te,e[22]=I):I=e[22];const J=Rt(I),U=A?null:J.data??null,oe=A?ic(F.data,u??""):null,Y=oe?oe.branchMeta:U?{kind:"ready",branch:un(U)??u??"",base:U.base??"main",workingTreeDirty:Kl(U),unpushed:U.unpushed??0,aheadOfBase:U.aheadOfBase??0,behindBase:U.behindBase??0,headSha:U.headSha??""}:{kind:"unknown"},ne=oe?oe.publishableChangeCount:U?.changedFiles?Ya({files:U.changedFiles}).count:null,D=A?F:J,se=(Y.kind==="ready"?Y.branch:null)??u??null,le=Y.kind==="ready"?Y.base:"main",he=Ra({orgId:n.id,orgSlug:n.slug,target:et(y),owner:y?.owner??"",repo:y?.name??"",branch:se}),G=he.data??null,pe=Ta({orgId:n.id,orgSlug:n.slug,target:et(y),owner:y?.owner??"",repo:y?.name??"",base:le}),Z=Ba({orgId:n.id,orgSlug:n.slug,target:et(y),owner:y?.owner??"",repo:y?.name??"",branch:se}),E=fr({orgId:n.id,orgSlug:n.slug,target:et(y),owner:y?.owner??"",repo:y?.name??"",branch:se});let q;e[23]!==Z||e[24]!==G||e[25]!==he||e[26]!==E?(q=rc({pr:G,prQuery:he,checksQuery:Z,reviewsQuery:E}),e[23]=Z,e[24]=G,e[25]=he,e[26]=E,e[27]=q):q=e[27];const ce=q;let we;e[28]!==he?(we=async()=>{await he.refetch()},e[28]=he,e[29]=we):we=e[29];const fe=we,Me=Sn({mutationFn:()=>Ti({hosted:A,branch:u,baseBranch:le,nextBranch:()=>tn(sn(l?.user)),setCurrentTaskBranch:c,deleteRelease:i}),onError:bc});let _;e[30]!==n.slug||e[31]!==h||e[32]!==s?(_=async K=>(await Vl({orgSlug:n.slug,virtualMcpId:s,branch:K.branch,threadId:h??null},K.base),K),e[30]=n.slug,e[31]=h,e[32]=s,e[33]=_):_=e[33];let ae;e[34]!==u||e[35]!==n.slug||e[36]!==o||e[37]!==a||e[38]!==h||e[39]!==s?(ae=async K=>{$t.success(a("thread.headerActions.syncedWithBase",{base:K.base})),await Promise.all([o.invalidateQueries({queryKey:Ea({orgSlug:n.slug,virtualMcpId:s,branch:u??K.branch,threadId:h??null})}),o.invalidateQueries({queryKey:zt.decofile(`${n.slug}/${s}/${K.branch}`)})])},e[34]=u,e[35]=n.slug,e[36]=o,e[37]=a,e[38]=h,e[39]=s,e[40]=ae):ae=e[40];let Oe;e[41]!==_||e[42]!==ae?(Oe={mutationFn:_,onSuccess:ae,onError:pc},e[41]=_,e[42]=ae,e[43]=Oe):Oe=e[43];const _e=Sn(Oe),Ee=pa(n.slug,s),ft=Me.isPending,tt=dc({branch:Y,pr:G,checks:Z.data??[],reviews:E.data??null,publishing:ft,saving:Ee,syncing:_e.isPending,statusRetrying:D.isFetching&&!!D.error,statusError:D.error instanceof Error?D.error.message:D.error?String(D.error):null,loading:!!ce,publishableChangeCount:ne,t:a}),je=A?oc(tt,{notLive:O,t:a}):tt,Ie=je.autoRun&&Y.kind==="ready"&&y&&v?`${se}@${Y.headSha}`:null,$e=V.useRef(null);if(V.useEffect(()=>{!Ie||!se||$e.current!==Ie&&($e.current=Ie,_e.mutate({branch:se,base:le}))},[Ie,se,le,_e]),P.status==="detached"){let K;e[44]!==a?(K=a("thread.headerActions.reconnectGithub"),e[44]=a,e[45]=K):K=e[45];let xe;e[46]!==K?(xe=r.jsx(kt,{asChild:!0,children:r.jsx("span",{children:r.jsx(ve,{size:"sm",variant:"outline",disabled:!0,children:K})})}),e[46]=K,e[47]=xe):xe=e[47];let ke;e[48]!==a?(ke=a("thread.headerActions.githubConnectionRemoved"),e[48]=a,e[49]=ke):ke=e[49];let Ne;e[50]!==ke?(Ne=r.jsx(Nt,{children:ke}),e[50]=ke,e[51]=Ne):Ne=e[51];let Ce;return e[52]!==xe||e[53]!==Ne?(Ce=r.jsx(Ss,{children:r.jsxs(St,{children:[xe,Ne]})}),e[52]=xe,e[53]=Ne,e[54]=Ce):Ce=e[54],Ce}if(!d)return null;if(!y||!v){const K=y?"noPreviewServer":"noRepo";let xe;e[55]!==u||e[56]!==f?(xe=u?()=>{const Ne=f?.({runtime:"sandbox",branch:u});Ne&&Rr("coding_session_started",{thread_id:Ne})}:void 0,e[55]=u,e[56]=f,e[57]=xe):xe=e[57];let ke;return e[58]!==K||e[59]!==xe?(ke=r.jsx(gc,{reason:K,onStartCodingSession:xe}),e[58]=K,e[59]=xe,e[60]=ke):ke=e[60],ke}if(!u)return null;const De=K=>{switch(K){case"publish":{x("publish");return}case"request-approval":{x("review");return}case"get-latest":{if(!se||_e.isPending)return;_e.mutate({branch:se,base:le});return}case"retry-status":{D.refetch();return}case"open-pr":{G?.htmlUrl&&window.open(G.htmlUrl,"_blank","noopener,noreferrer");return}}};let Pe;e[61]!==De?(Pe=K=>({key:K.key,label:K.label,icon:Vn(K.action,K.key),...K.tooltip?{tooltip:K.tooltip}:{},onSelect:()=>De(K.action)}),e[61]=De,e[62]=Pe):Pe=e[62];const Fe=je.menu.map(Pe),Se=je.action,Le=je.label,st=je.variant,mt=!!je.loading;let Re;e[63]!==a?(Re=a("thread.cmsActions.moreActionsAriaLabel"),e[63]=a,e[64]=Re):Re=e[64];const de=r.jsx(Ha,{size:"sm",label:Le,variant:st,disabled:!!je.disabled||!Se,loading:mt,...Se&&!je.loading?{icon:Vn(Se)}:{},...je.tooltip?{tooltip:je.tooltip}:{},items:Fe,menuAriaLabel:Re,onClick:Se?()=>De(Se):void 0});return r.jsxs(r.Fragment,{children:[je.status?r.jsx("span",{className:"mr-1 hidden shrink-0 text-xs text-muted-foreground sm:inline",children:je.status}):null,de,u?r.jsx(cr,{open:g.open,mode:g.mode,fastPreview:!0,notLive:O,onOpenChange:K=>{K||m(mc)},orgSlug:n.slug,virtualMcpId:s,branch:u,baseBranch:le,repoTarget:et(y),owner:y.owner,repo:y.name,publishPolicy:Oa(d?.metadata?.publishPolicy),draftPreviewUrl:H,destinationHost:N.host,previewServerUrl:v,compareDraft:R?{kind:"pointer",pointer:R,...re?{link:re}:{}}:null,lastPublishedPr:pe.data??null,onRequestApproval:()=>x("review"),openPullRequest:G?.state==="open"?G:null,onPullRequestChanged:fe,onPublished:()=>Me.mutateAsync()}):null]})}function mc(t){return{...t,open:!1}}function pc(t){$t.error(t instanceof Error?t.message:String(t))}function bc(t){console.error("site editor: settling after publish failed",t)}function gc(t){const e=B.c(14),{reason:s,onStartCodingSession:a}=t,n=ye(),o=!a;let d;e[0]!==n?(d=n("sandbox.cmsUnavailable.startCodingSession"),e[0]=n,e[1]=d):d=e[1];let l;e[2]!==a||e[3]!==o||e[4]!==d?(l=r.jsx(kt,{asChild:!0,children:r.jsx("span",{children:r.jsx(ve,{size:"sm",variant:"outline",disabled:o,onClick:a,children:d})})}),e[2]=a,e[3]=o,e[4]=d,e[5]=l):l=e[5];let i;e[6]!==s||e[7]!==n?(i=n(s==="noPreviewServer"?"sandbox.cmsUnavailable.noPreviewServer":"sandbox.cmsUnavailable.noRepo"),e[6]=s,e[7]=n,e[8]=i):i=e[8];let u;e[9]!==i?(u=r.jsx(Nt,{children:i}),e[9]=i,e[10]=u):u=e[10];let c;return e[11]!==l||e[12]!==u?(c=r.jsx(Ss,{children:r.jsxs(St,{children:[l,u]})}),e[11]=l,e[12]=u,e[13]=c):c=e[13],c}const qt="The user clicked this action deliberately — execute directly. Do not call user_ask unless you hit an actual problem outside the scope of this intent (missing auth, unresolvable conflict, a check with multiple plausible fixes).";function xc(t){return`Reopen PR #${t.prNumber}. ${qt}`}function vc(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${qt}`}function yc(t){return`Sync \`${t.branch}\` with everyone else's work: \`git add -A\`, commit any pending local changes with a concise conventional-commit message (skip if the working tree is clean), \`git pull --rebase\` to bring in anything pushed directly to \`origin/${t.branch}\`, then \`git rebase origin/${t.base}\` to catch up with the base branch. Resolve any conflicts that come up, then push the result (force-with-lease only if the rebase rewrote commits already on the remote). ${qt}`}function jc(t){const e=(t.failingChecks??[]).map(s=>`\`${s}\``).join(", ");return`PR #${t.prNumber} has failing checks: ${e}. For each: read the logs, diagnose the root cause, apply the smallest fix that makes it pass, commit, and push. ${qt}`}function Pc(t){return`Mark PR #${t.prNumber} ready for review. ${qt}`}function wc(t){return`Read the unresolved review threads on PR #${t.prNumber}. For each thread: understand the reviewer's ask, apply the needed changes, commit, push, reply explaining what changed, and resolve the thread. If a comment is a question that doesn't need a code change, reply with the answer and resolve. ${qt}`}function Sc(t){return`Review PR #${t.prNumber}. Read the full diff, analyze every changed file for correctness, security, code quality, and alignment with the repo's patterns. Post specific line-level review comments on concerns, then submit an overall review (approve / request changes / comment) with a concise summary. Do not modify the code — this is a read-and-comment pass. ${qt}`}function Gn(t){switch(t){case"publish":return r.jsx(Pa,{className:"size-4"});case"create-pr":case"reopen":return r.jsx(ks,{className:"size-4"});case"rebase":case"sync":return r.jsx(Xs,{className:"size-4"});case"fix-checks":return r.jsx(ia,{className:"size-4"});case"mark-ready":return r.jsx(on,{className:"size-4"});case"resolve-comments":return r.jsx(Xr,{className:"size-4"});case"merge":return r.jsx(Dl,{className:"size-4"});case"review":return r.jsx(gs,{className:"size-4"});case"open-pr-page":return r.jsx(Da,{size:16})}}const Wn=new Set(["reopen","rebase","fix-checks","mark-ready","resolve-comments","review","sync"]),Qn=new Set(["publish","create-pr"]);function kc(t){const e=B.c(44),{t:s,button:a,actionBusy:n,changeRequestPending:o,savePending:d,onAction:l}=t,i=a.action;let u;e[0]!==i||e[1]!==n?(u=n&&i!==void 0&&Wn.has(i),e[0]=i,e[1]=n,e[2]=u):u=e[2];const c=u,h=o&&i==="merge";let f;e[3]!==i||e[4]!==d?(f=d&&i!==void 0&&Qn.has(i),e[3]=i,e[4]=d,e[5]=f):f=e[5];const p=f,g=!!a.disabled||c||h||p||!i,m=!!a.loading||h;let b;e[6]!==a.tooltip||e[7]!==c||e[8]!==p||e[9]!==s?(b=c?s("thread.headerActions.chatIsRunning"):p?s("thread.headerActions.saving"):a.tooltip,e[6]=a.tooltip,e[7]=c,e[8]=p,e[9]=s,e[10]=b):b=e[10];const x=b;let P;if(e[11]!==n||e[12]!==a.menu||e[13]!==o||e[14]!==l||e[15]!==d||e[16]!==s){let A;e[18]!==n||e[19]!==o||e[20]!==l||e[21]!==d||e[22]!==s?(A=S=>{const $=n&&Wn.has(S.action),F=d&&Qn.has(S.action),T=S.action==="merge"&&o,M=F?s("thread.headerActions.saving"):$?s("thread.headerActions.chatIsRunning"):S.tooltip;return{key:S.key,label:S.label,icon:Gn(S.action),disabled:!!($||F||T),...M?{tooltip:M}:{},onSelect:()=>l(S.action)}},e[18]=n,e[19]=o,e[20]=l,e[21]=d,e[22]=s,e[23]=A):A=e[23],P=a.menu.map(A),e[11]=n,e[12]=a.menu,e[13]=o,e[14]=l,e[15]=d,e[16]=s,e[17]=P}else P=e[17];const y=P,v=a.label,w=a.variant;let j;e[24]!==i||e[25]!==m?(j=i&&!m?{icon:Gn(i)}:{},e[24]=i,e[25]=m,e[26]=j):j=e[26];let N;e[27]!==x?(N=x?{tooltip:x}:{},e[27]=x,e[28]=N):N=e[28];let C;e[29]!==s?(C=s("thread.headerActions.moreActionsAriaLabel"),e[29]=s,e[30]=C):C=e[30];let R;e[31]!==i||e[32]!==l?(R=i?()=>l(i):void 0,e[31]=i,e[32]=l,e[33]=R):R=e[33];let k;return e[34]!==a.label||e[35]!==a.variant||e[36]!==g||e[37]!==y||e[38]!==m||e[39]!==j||e[40]!==N||e[41]!==C||e[42]!==R?(k=r.jsx(Ha,{size:"sm",label:v,variant:w,disabled:g,loading:m,...j,...N,items:y,menuAriaLabel:C,onClick:R}),e[34]=a.label,e[35]=a.variant,e[36]=g,e[37]=y,e[38]=m,e[39]=j,e[40]=N,e[41]=C,e[42]=R,e[43]=k):k=e[43],k}function Nc(t){const e=B.c(9),{label:s,children:a}=t;if(!s){let l;return e[0]!==a?(l=r.jsx(r.Fragment,{children:a}),e[0]=a,e[1]=l):l=e[1],l}let n;e[2]!==a?(n=r.jsx(kt,{asChild:!0,children:r.jsx("span",{children:a})}),e[2]=a,e[3]=n):n=e[3];let o;e[4]!==s?(o=r.jsx(Nt,{children:s}),e[4]=s,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==o?(d=r.jsx(Ss,{children:r.jsxs(St,{children:[n,o]})}),e[6]=n,e[7]=o,e[8]=d):d=e[8],d}function Cc(t){return{label:t("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:t("thread.headerActions.waitingForSandboxBranchTooltip"),menu:[]}}function Ac({virtualMcpId:t}){const e=ye(),{org:s}=ws(),{data:a}=Ps.useSession(),n=nn(t),{deleteRelease:o}=en(t),{currentBranch:d,setCurrentTaskBranch:l,createTask:i,taskId:u}=da(),c=Dr(),{openSidePanel:h}=Hr(),[f,p]=V.useState({open:!1,mode:"publish",policyOverride:null}),g=ti({connectionId:Tr,orgId:s.id,orgSlug:s.slug}),m=ni(g),[b,x]=V.useState(!1),P=V.useRef(""),y=Aa(n),v=y.status==="attached"||y.status==="public-clone"?y.repo:null,{lifecycle:w,branch:j,phase:N}=si(),C={orgSlug:s.slug,virtualMcpId:t,branch:d??"",threadId:u??null},k=Rt({queryKey:Ea(C),queryFn:()=>_a(C),enabled:!!d,staleTime:15e3,refetchInterval:q=>Ds(q.state.data)?5e3:!1}).data??null,A=j,S=w,$=A.kind==="ready"?A.branch:null,F=d??$??void 0,T=(A.kind==="ready"?A.branch:null)??F??null,M=Ra({orgId:s.id,orgSlug:s.slug,target:et(v),owner:v?.owner??"",repo:v?.name??"",branch:T}),O=M.data??null,ee=Ba({orgId:s.id,orgSlug:s.slug,target:et(v),owner:v?.owner??"",repo:v?.name??"",branch:T}),re=fr({orgId:s.id,orgSlug:s.slug,target:et(v),owner:v?.owner??"",repo:v?.name??"",branch:T}),H=Ta({orgId:s.id,orgSlug:s.slug,target:et(v),owner:v?.owner??"",repo:v?.name??"",base:A.kind==="ready"?A.base:null}),L=A,z=Oa(n?.metadata?.publishPolicy),te=pa(s.slug,t),{previewUrl:W}=ai(),{previewServerUrl:I,projectDefault:J}=an(t);if(y.status==="detached")return r.jsx(Nc,{label:e("thread.headerActions.githubConnectionRemoved"),children:r.jsx(ve,{size:"sm",variant:"outline",disabled:!0,children:e("thread.headerActions.reconnectGithub")})});if(!v)return null;const U=T?nc({lifecycle:S,branch:L,claimPhase:N,pr:O,checks:ee.data??[],reviews:re.data??null,noReviewableDiff:Ds(k),loading:ps(M),t:e}):Cc(e),oe=JSON.stringify({label:U.label,branchKind:L.kind,workingTreeDirty:L.kind==="ready"?L.workingTreeDirty:null,unpushed:L.kind==="ready"?L.unpushed:null,aheadOfBase:L.kind==="ready"?L.aheadOfBase:null,lifecycle:S.phase,headBranch:T,noReviewableDiff:Ds(k)});P.current!==oe&&(P.current=oe,za("header button",{label:U.label,tooltip:U.tooltip,action:U.action,chatBranch:d,sandboxBranch:$,sandboxRouteBranch:F,headBranch:T,branchMeta:A,effectiveBranchMeta:L,lifecyclePhase:S.phase,prNumber:O?.number??null,prState:O?.state??null}));const Y=q=>(h(),c.sendMessage({parts:[{type:"text",text:q}]})),ne=c.isStreaming,D=L.kind==="ready"?L.base:"main",se=async()=>{await M.refetch()},le=async()=>{const q=d,ce=tn(sn(a?.user));J==="cms"?i({runtime:"cms",branch:ce}):await l(ce),q&&q!==D&&await o(q)},he=async q=>{if(!(!v||b)){x(!0);try{const ce=qa(a?.user);await Al(s.slug,et(v),{number:q,coAuthor:ce}),$t.success(e("thread.headerActions.publishedPr",{prNumber:String(q)})),await se(),await le()}catch(ce){$t.error(ce instanceof Rl?ce.detail??Tl(ce.reason,e):ce instanceof Error?ce.message:e("thread.headerActions.failedToMergePullRequest"))}finally{x(!1)}}},G=(q,ce)=>p({open:!0,mode:q,policyOverride:ce}),pe=q=>{if(T)switch(q){case"publish":G("publish",U.meta?.publishPolicyOverride??null);return;case"create-pr":G("review",null);return;case"merge":O&&he(O.number);return;case"sync":if(ne)return;Y(yc({branch:T,base:D}));return;case"open-pr-page":O?.htmlUrl&&window.open(O.htmlUrl,"_blank","noopener,noreferrer");return;case"review":if(ne)return;O&&Y(Sc({prNumber:O.number}));return;case"reopen":if(ne)return;O&&Y(xc({prNumber:O.number}));return;case"rebase":if(ne)return;Y(vc({branch:T}));return;case"fix-checks":if(ne)return;O&&Y(jc({prNumber:O.number,failingChecks:U.meta?.failingChecks??[]}));return;case"mark-ready":if(ne)return;O&&Y(Pc({prNumber:O.number}));return;case"resolve-comments":if(ne)return;O&&Y(wc({prNumber:O.number}));return}},Z=b||ne,E=r.jsx(kc,{t:e,button:U,actionBusy:Z,changeRequestPending:b,savePending:te,onAction:pe});return F?r.jsxs(r.Fragment,{children:[E,r.jsx(cr,{open:f.open,mode:f.mode,fastPreview:!1,recoverSandbox:()=>m.mutateAsync({virtualMcpId:t,branch:F,...u?{threadId:u}:{}}),onOpenChange:q=>{q||p(ce=>({...ce,open:!1}))},orgSlug:s.slug,virtualMcpId:t,branch:F,baseBranch:D,repoTarget:et(v),owner:v.owner,repo:v.name,publishPolicy:f.policyOverride??z,draftPreviewUrl:W,destinationHost:null,previewServerUrl:I,compareDraft:W?{kind:"sandbox",previewUrl:W}:null,lastPublishedPr:H.data??null,onRequestApproval:()=>p(q=>({...q,open:!0,mode:"review"})),openPullRequest:O?.state==="open"?O:null,onPullRequestChanged:se,onPublished:le})]}):E}function Rc(t){const e=B.c(33),{orgSlug:s,virtualMcpId:a,branch:n}=t,o=ye(),[d,l]=V.useState(!1),i=Ht(a,n),u=i.kind==="protocol"&&i.source==="local"?i:null;let c;e[0]!==n||e[1]!==s||e[2]!==a?(c=n?{orgSlug:s,virtualMcpId:a,branch:n}:null,e[0]=n,e[1]=s,e[2]=a,e[3]=c):c=e[3];const h=Zs(c),{data:f}=ma(u,h);if(!u||!h||!n)return null;let p;e[4]!==f?(p=f?Object.keys(f.changes).length:0,e[4]=f,e[5]=p):p=e[5];const g=p;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),e[6]=m):m=e[6];let b;e[7]!==g||e[8]!==o?(b=g>0?o("decoServe.changes.buttonCount",{count:g}):o("decoServe.changes.button"),e[7]=g,e[8]=o,e[9]=b):b=e[9];let x;e[10]!==b?(x=r.jsx(ve,{size:"sm",variant:"outline","data-testid":"local-changes-button",onClick:m,children:b}),e[10]=b,e[11]=x):x=e[11];let P;e[12]!==o?(P=o("decoServe.changes.title"),e[12]=o,e[13]=P):P=e[13];let y;e[14]!==P?(y=r.jsx(sa,{className:"sr-only",children:P}),e[14]=P,e[15]=y):y=e[15];let v;e[16]!==n||e[17]!==h||e[18]!==u||e[19]!==d||e[20]!==s||e[21]!==o||e[22]!==a?(v=d?r.jsx(aa,{children:C=>{const{reset:R}=C;return r.jsx(ra,{fallback:k=>{const{resetError:A}=k;return r.jsx(Us,{title:o("decoServe.changes.title"),body:r.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:o("decoServe.changes.loadFailed")}),onClose:()=>{R(),A(),l(!1)}})},children:r.jsx(V.Suspense,{fallback:r.jsx(es,{pane:r.jsx(xn,{}),list:r.jsx(Us,{title:o("decoServe.changes.title"),loading:!0,body:r.jsx(Xt,{children:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Ut,{}),r.jsx(Ut,{})]})}),onClose:()=>l(!1)})}),children:r.jsx(Tc,{orgSlug:s,virtualMcpId:a,branch:n,backend:u,cacheKey:h,onClose:()=>l(!1)})})})}}):null,e[16]=n,e[17]=h,e[18]=u,e[19]=d,e[20]=s,e[21]=o,e[22]=a,e[23]=v):v=e[23];let w;e[24]!==y||e[25]!==v?(w=r.jsxs(na,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[y,v]}),e[24]=y,e[25]=v,e[26]=w):w=e[26];let j;e[27]!==d||e[28]!==w?(j=r.jsx(ta,{open:d,onOpenChange:l,children:w}),e[27]=d,e[28]=w,e[29]=j):j=e[29];let N;return e[30]!==j||e[31]!==x?(N=r.jsxs(r.Fragment,{children:[x,j]}),e[30]=j,e[31]=x,e[32]=N):N=e[32],N}function Us(t){const e=B.c(22),{title:s,trailing:a,body:n,loading:o,onClose:d}=t,l=o===void 0?!1:o,i=ye(),u=l?"loading":"ready";let c;e[0]!==s?(c=r.jsx("span",{className:"truncate",children:s}),e[0]=s,e[1]=c):c=e[1];let h;e[2]!==c||e[3]!==a?(h=r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[c,a]}),e[2]=c,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==i?(f=i("decoServe.changes.hint"),e[5]=i,e[6]=f):f=e[6];let p;e[7]!==f?(p=r.jsx("p",{className:"text-2xs text-muted-foreground",children:r.jsx(Ua,{text:f})}),e[7]=f,e[8]=p):p=e[8];let g;e[9]!==i?(g=i("decoServe.changes.close"),e[9]=i,e[10]=g):g=e[10];let m;e[11]!==d||e[12]!==g?(m=r.jsx(ve,{type:"button",variant:"outline",className:"w-full",onClick:d,children:g}),e[11]=d,e[12]=g,e[13]=m):m=e[13];let b;e[14]!==p||e[15]!==m?(b=r.jsxs(r.Fragment,{children:[p,m]}),e[14]=p,e[15]=m,e[16]=b):b=e[16];let x;return e[17]!==n||e[18]!==u||e[19]!==h||e[20]!==b?(x=r.jsx(Cs,{state:u,header:h,body:n,footer:b}),e[17]=n,e[18]=u,e[19]=h,e[20]=b,e[21]=x):x=e[21],x}function Tc(t){const e=B.c(54),{orgSlug:s,virtualMcpId:a,branch:n,backend:o,cacheKey:d,onClose:l}=t,i=ye();let u;e[0]!==n||e[1]!==s||e[2]!==a?(u={orgSlug:s,virtualMcpId:a,branch:n},e[0]=n,e[1]=s,e[2]=a,e[3]=u):u=e[3];let c;e[4]!==o||e[5]!==d||e[6]!==u?(c={backend:o,cacheKey:d,scope:u},e[4]=o,e[5]=d,e[6]=u,e[7]=c):c=e[7];const h=gn(c);let f;e[8]!==n||e[9]!==s||e[10]!==h.refresh||e[11]!==a?(f={orgSlug:s,virtualMcpId:a,branch:n,refresh:h.refresh},e[8]=n,e[9]=s,e[10]=h.refresh,e[11]=a,e[12]=f):f=e[12];const p=Bl(f),g=fa(s,a).phase==="saving",m=o.describe.readOnly,[b,x]=V.useState(null),[P,y]=V.useState(null),[v,w]=V.useState(!1),{summary:j}=h;let N,C,R,k,A;if(e[13]!==b||e[14]!==o||e[15]!==P||e[16]!==p||e[17]!==v||e[18]!==g||e[19]!==m||e[20]!==h.blocks||e[21]!==h.entries||e[22]!==h.sidesFailed||e[23]!==h.sidesPending||e[24]!==j.blocks||e[25]!==j.count||e[26]!==j.pages||e[27]!==i){const F=[...j.pages,...j.blocks],T=F.find(re=>Be(re)===b)??F[0]??null;let M;e[33]!==j.count||e[34]!==i?(M=j.count===0?i("decoServe.changes.title"):j.count===1?i("decoServe.changes.titleOne"):i("decoServe.changes.titleCount",{count:j.count}),e[33]=j.count,e[34]=i,e[35]=M):M=e[35],A=M;const O=(re,H)=>H.length===0?null:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:re}),H.map(L=>{const z=Be(L);return r.jsx(er,{change:L,bodyPending:h.sidesPending,v8:!0,selected:T!==null&&Be(T)===z,onSelect:()=>x(z),confirming:P===z,onConfirmingChange:te=>y(te?z:null),onDiscard:m||!L.entry?void 0:()=>{p(o,[L.entry],i("thread.publishPopover.discarded",{name:L.name}))},isPublishing:!1,isDiscarding:g},z)})]});let ee;e[36]!==o||e[37]!==p||e[38]!==v||e[39]!==g||e[40]!==m||e[41]!==h.entries||e[42]!==j.count||e[43]!==i?(ee=m||j.count<=1?null:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>w(!0),disabled:g,children:i("thread.publishPopover.discardAll")}),r.jsx(Qs,{open:v,onOpenChange:w,children:r.jsxs(Ws,{children:[r.jsxs(qs,{children:[r.jsx(zs,{children:i("thread.publishPopover.discardAllTitle")}),r.jsx(Hs,{children:i("thread.publishPopover.discardAllConfirm")})]}),r.jsxs(Gs,{children:[r.jsx(Ks,{children:i("thread.publishDialog.cancel")}),r.jsx(Vs,{onClick:()=>{p(o,h.entries,i("thread.publishDialog.allChangesDiscarded"))},disabled:g,className:X(la({variant:"destructive"})),children:i("thread.publishPopover.discardAll")})]})]})})]}),e[36]=o,e[37]=p,e[38]=v,e[39]=g,e[40]=m,e[41]=h.entries,e[42]=j.count,e[43]=i,e[44]=ee):ee=e[44],R=ee,C=j.count===0?r.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[r.jsx(on,{className:"mb-1 size-5 text-success"}),r.jsx("p",{className:"text-sm font-medium",children:i("decoServe.changes.empty")})]}):r.jsxs(Xt,{children:[O(i("thread.publishPopover.pagesGroup"),j.pages),O(i("thread.publishPopover.blocksGroup"),j.blocks),h.sidesFailed?r.jsx("p",{className:"text-2xs text-muted-foreground",children:i("thread.publishPopover.detailsUnavailable")}):null]}),N=es,k=T?r.jsx("div",{className:X(Yt,"relative flex"),children:r.jsx(lr,{change:T,diff:null,bodyPending:h.sidesPending,previewServerUrl:null,draft:null,lastPage:null,v8:{blocks:h.blocks}},Be(T))}):r.jsx("div",{className:X(Yt,"bg-muted/40")}),e[13]=b,e[14]=o,e[15]=P,e[16]=p,e[17]=v,e[18]=g,e[19]=m,e[20]=h.blocks,e[21]=h.entries,e[22]=h.sidesFailed,e[23]=h.sidesPending,e[24]=j.blocks,e[25]=j.count,e[26]=j.pages,e[27]=i,e[28]=N,e[29]=C,e[30]=R,e[31]=k,e[32]=A}else N=e[28],C=e[29],R=e[30],k=e[31],A=e[32];let S;e[45]!==C||e[46]!==R||e[47]!==l||e[48]!==A?(S=r.jsx(Us,{title:A,trailing:R,body:C,onClose:l}),e[45]=C,e[46]=R,e[47]=l,e[48]=A,e[49]=S):S=e[49];let $;return e[50]!==N||e[51]!==k||e[52]!==S?($=r.jsx(N,{pane:k,list:S}),e[50]=N,e[51]=k,e[52]=S,e[53]=$):$=e[53],$}function Bc(t){const e=B.c(5),{virtualMcpId:s,branch:a}=t,n=ye(),o=Ht(s,a);if(!Ic(o))return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(kt,{asChild:!0,children:r.jsx("span",{"data-testid":"content-version-badge",className:"shrink-0 rounded border border-border px-1.5 py-px font-mono text-2xs leading-4 text-muted-foreground",children:"v8"})}),e[0]=d):d=e[0];let l;e[1]!==n?(l=n("decoServe.version.v8"),e[1]=n,e[2]=l):l=e[2];let i;return e[3]!==l?(i=r.jsxs(St,{children:[d,r.jsx(Nt,{side:"bottom",className:"max-w-xs",children:l})]}),e[3]=l,e[4]=i):i=e[4],i}function Ic(t){return t.kind==="protocol"?t.hasSchema!==!1:t.kind==="unavailable"&&t.source!=="local"}function Dc(t){const e=B.c(11),{virtualMcpId:s,branch:a}=t,n=ye(),o=Ht(s,a);if(!(o.kind==="protocol"&&o.source==="local"&&o.describe.readOnly))return null;let l;e[0]!==n?(l=n("decoServe.readOnly.label"),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==l?(i=r.jsx(kt,{asChild:!0,children:r.jsx("span",{tabIndex:0,"data-testid":"deco-serve-read-only",className:"shrink-0 rounded-full bg-warning/10 px-2 py-0.5 text-xs font-medium text-foreground",children:l})}),e[2]=l,e[3]=i):i=e[3];let u;e[4]!==n?(u=n("decoServe.readOnly.tooltip"),e[4]=n,e[5]=u):u=e[5];let c;e[6]!==u?(c=r.jsx(Nt,{side:"bottom",className:"max-w-xs",children:r.jsx(Ua,{text:u})}),e[6]=u,e[7]=c):c=e[7];let h;return e[8]!==i||e[9]!==c?(h=r.jsxs(St,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=h):h=e[10],h}function Fc(t){const e=!t.hasEntity&&!t.servingLocally,s=t.hasEntity&&!t.localPreview&&!t.tunnelUndecided&&!t.servingLocally&&t.showsRepositoryActions;return{hidden:e,localFiles:!e&&t.servingLocally,draftSelect:!e&&t.hasEntity,publish:e||!s?null:t.runtime==="cms"?"cms":"code"}}function Id(t){const e=B.c(2),{blocksOnly:s}=t;let a;return e[0]!==s?(a=s?r.jsx($c,{}):r.jsx(mr,{}),e[0]=s,e[1]=a):a=e[1],a}function $c(){const t=B.c(2),e=Ia(ri());let s;return t[0]!==e?(s=cl(e)?r.jsx(ar,{value:!1,children:r.jsx(mr,{})}):null,t[0]=e,t[1]=s):s=t[1],s}function mr(){const t=B.c(32),e=Zt(),{org:s}=ws(),a=nn(e?.virtualMcpId),n=e?.currentBranch??null,o=an(a?.id).runtime,{url:d,undecided:l}=ua(a?.id),{connection:i}=ha(a?.id??e?.virtualMcpId),u=a?.id??e?.virtualMcpId,c=!!a,h=!!i,f=!!d,p=!!l;let g;t[0]!==a||t[1]!==o||t[2]!==c||t[3]!==h||t[4]!==f||t[5]!==p?(g=Fc({hasEntity:c,servingLocally:h,localPreview:f,tunnelUndecided:p,showsRepositoryActions:!!a&&ol(a),runtime:o}),t[0]=a,t[1]=o,t[2]=c,t[3]=h,t[4]=f,t[5]=p,t[6]=g):g=t[6];const m=g;if(!u||m.hidden)return null;let b;t[7]!==n||t[8]!==u?(b=r.jsx(Bc,{virtualMcpId:u,branch:n}),t[7]=n,t[8]=u,t[9]=b):b=t[9];let x;t[10]!==n||t[11]!==m.localFiles||t[12]!==u?(x=m.localFiles&&r.jsx(Dc,{virtualMcpId:u,branch:n}),t[10]=n,t[11]=m.localFiles,t[12]=u,t[13]=x):x=t[13];let P;t[14]!==n||t[15]!==s||t[16]!==m.localFiles||t[17]!==u?(P=m.localFiles&&r.jsx(Rc,{orgSlug:s.slug,virtualMcpId:u,branch:n}),t[14]=n,t[15]=s,t[16]=m.localFiles,t[17]=u,t[18]=P):P=t[18];let y;t[19]!==n||t[20]!==a||t[21]!==m.draftSelect?(y=a&&m.draftSelect&&r.jsx("div",{className:"flex min-w-0 shrink items-center justify-end",children:r.jsx(ki,{virtualMcp:a,currentBranch:n})}),t[19]=n,t[20]=a,t[21]=m.draftSelect,t[22]=y):y=t[22];let v;t[23]!==a||t[24]!==m.publish?(v=a&&m.publish&&r.jsxs(r.Fragment,{children:[r.jsx(Br,{orientation:"vertical",className:"mx-1 data-[orientation=vertical]:h-4"}),r.jsx("div",{className:"flex shrink-0 items-center justify-end gap-1",children:m.publish==="cms"?r.jsx(fc,{virtualMcpId:a.id}):r.jsx(Ac,{virtualMcpId:a.id})})]}),t[23]=a,t[24]=m.publish,t[25]=v):v=t[25];let w;return t[26]!==b||t[27]!==x||t[28]!==P||t[29]!==y||t[30]!==v?(w=r.jsxs(r.Fragment,{children:[b,x,P,y,v]}),t[26]=b,t[27]=x,t[28]=P,t[29]=y,t[30]=v,t[31]=w):w=t[31],w}export{Id as S};