decocms 4.574.10 → 4.575.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (407) hide show
  1. package/dist/client/assets/{AlertCircle-JrI6GhX-.js → AlertCircle-B9jzXYca.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BCQgd1R0.js → AreaChart-iov00wo5.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BY3YUYmg.js → ArrowLeft-CZ3DAg0q.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-Dbd0DsFj.js → ArrowUp-Besm0IZ2.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-D-__q6zo.js → CartesianChart-C3iUwk_u.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-CGbYI81w.js → CategoricalChart-O0wXlREH.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-Lk0BK653.js → CheckCircle-Bg_9Wlgi.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-D-Hk_1B6.js → ChevronSelectorVertical-UvFeI9z1.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CypYcouh.js → ChevronUp-CM8EW0Js.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-D4hEMIBc.js → CreditCard01-Bhqkelsq.js} +1 -1
  11. package/dist/client/assets/{Globe04-BSIf8tfY.js → Globe04-DFEQkAAl.js} +1 -1
  12. package/dist/client/assets/{Key01-CCkW71V8.js → Key01-BfEZ7hLZ.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-dVGcDCd1.js → LinkBroken01-BSh2E4ld.js} +1 -1
  14. package/dist/client/assets/{Minus-B6bCcC1a.js → Minus-Ctt_tNjY.js} +1 -1
  15. package/dist/client/assets/{Monitor01-B1R4t9_g.js → Monitor01-Cp5O9jEx.js} +1 -1
  16. package/dist/client/assets/{Play-nrEhEYaX.js → Play-DqrEB0p_.js} +1 -1
  17. package/dist/client/assets/{Plus-CXFgI-7S.js → Plus-BF39I64m.js} +1 -1
  18. package/dist/client/assets/{ReferenceLine-9SV0TNSu.js → ReferenceLine-y99E66AQ.js} +1 -1
  19. package/dist/client/assets/{SearchMd-BgyEwNMN.js → SearchMd-BCaWPluh.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-C8w58xcy.js → ShoppingBag01-WYt5uke3.js} +1 -1
  21. package/dist/client/assets/{Sun-BbLelrLi.js → Sun-Dniq03T7.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-BKQGE_Gz.js → SwitchHorizontal01-CStChVS2.js} +1 -1
  23. package/dist/client/assets/{Tool01-3EDhR0eh.js → Tool01-wiKWLRCc.js} +1 -1
  24. package/dist/client/assets/{Tooltip-BvsEJkNR.js → Tooltip-BOp5DpDI.js} +1 -1
  25. package/dist/client/assets/{Trash01-Cc7bOGxh.js → Trash01-DR_ZbB22.js} +1 -1
  26. package/dist/client/assets/{Upload01-CUdaL1MP.js → Upload01-BNm-Yhgs.js} +1 -1
  27. package/dist/client/assets/{UserSquare-CgD5WRTE.js → UserSquare-CoAnLSHH.js} +1 -1
  28. package/dist/client/assets/{Users01-D_DratJd.js → Users01-BKvz85-q.js} +1 -1
  29. package/dist/client/assets/{XClose-Ba9vOcHg.js → XClose-BH2b2x6k.js} +1 -1
  30. package/dist/client/assets/{Zap-CGLJP1Pm.js → Zap-C46fglVd.js} +1 -1
  31. package/dist/client/assets/{access-gate-BkmPTKhe.js → access-gate-CJaU-ahh.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-CfkDdpLR.js → add-connection-dialog-Es48OMbQ.js} +1 -1
  33. package/dist/client/assets/agent-app-CgaBp78a.js +1 -0
  34. package/dist/client/assets/{agent-assets-CMHlV0cw.js → agent-assets-rGrpA13N.js} +1 -1
  35. package/dist/client/assets/{agent-automation-D1d_SA1s.js → agent-automation-BgcUa34j.js} +1 -1
  36. package/dist/client/assets/{agent-automations-0O6U_BaC.js → agent-automations-BgScBsF6.js} +1 -1
  37. package/dist/client/assets/{agent-calendar-B5sssWfz.js → agent-calendar-lX-y2EdU.js} +1 -1
  38. package/dist/client/assets/{agent-capabilities-Re3Rcd9U.js → agent-capabilities-BOswsmnU.js} +1 -1
  39. package/dist/client/assets/{agent-connect-sources-CEVb5ZQC.js → agent-connect-sources-Bwre-hne.js} +1 -1
  40. package/dist/client/assets/agent-deck-C5kx-WNw.js +1 -0
  41. package/dist/client/assets/{agent-e2e-DfU5GcgW.js → agent-e2e-DsGMzDFD.js} +1 -1
  42. package/dist/client/assets/agent-experiments-gaiUmFF7.js +1 -0
  43. package/dist/client/assets/agent-file-CXpwIQY7.js +1 -0
  44. package/dist/client/assets/{agent-hosting-BIVmahmR.js → agent-hosting-IG9OvJxO.js} +1 -1
  45. package/dist/client/assets/{agent-icon-De2MEsoK.js → agent-icon-B9ymJOYy.js} +1 -1
  46. package/dist/client/assets/agent-library-B-aIakkE.js +1 -0
  47. package/dist/client/assets/agent-library-file-DdeRXubH.js +1 -0
  48. package/dist/client/assets/agent-overview-Cd2TI_CO.js +1 -0
  49. package/dist/client/assets/{agent-releases-C0fMyr3d.js → agent-releases-6VNqQXqs.js} +1 -1
  50. package/dist/client/assets/agent-settings-tnifGDI-.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-CA2ft33p.js → agent-site-editor-71l5SHI7.js} +1 -1
  52. package/dist/client/assets/agent-site-editor-code-ust0ErKY.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-DmOFTD5k.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-Cr4OmiKF.js +1 -0
  55. package/dist/client/assets/agent-view-BUyaEcso.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-DYNxqeX8.js → agent-view-guard-p3JMpL2i.js} +1 -1
  57. package/dist/client/assets/{ai-providers-BCNCtdBa.js → ai-providers-CO7GyDpT.js} +1 -1
  58. package/dist/client/assets/{alert-uAfMA0iM.js → alert-CQeq0vZr.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-CNoqcvsB.js → analytics-sections-C-EwM79i.js} +1 -1
  60. package/dist/client/assets/{api-keys-B5T8tqGJ.js → api-keys-BQO3VvIl.js} +1 -1
  61. package/dist/client/assets/api-keys-DqZ1Dcsm.js +1 -0
  62. package/dist/client/assets/app-editor-PmWZjr_j.js +1 -0
  63. package/dist/client/assets/{asset-utils-JtmKNz_N.js → asset-utils-DuLZkUyR.js} +1 -1
  64. package/dist/client/assets/{auth-eTld9LX2.js → auth-DYk3j3P5.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-Dzg-edmQ.js → auth-catchall-N-2cp0nv.js} +1 -1
  66. package/dist/client/assets/{auth-entry-BMj8fL-s.js → auth-entry-DcODwlvz.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-Cc8hsshw.js → auth-split-layout-DMz1KnE0.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-CIIpordz.js → authenticate-and-persist-oauth-XzlChMFG.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-DzzZLBM9.js → automation-list-row-ldXN7Wg6.js} +1 -1
  70. package/dist/client/assets/{automation-runs-85Ff33Cw.js → automation-runs-Dmq-RKIH.js} +1 -1
  71. package/dist/client/assets/{automations-BEURwcUG.js → automations-CDBea8A_.js} +1 -1
  72. package/dist/client/assets/{autosend-C7zfiAZa.js → autosend-DPIl8Ow-.js} +1 -1
  73. package/dist/client/assets/{badge-Dmw39gk8.js → badge-sWV0Lz9X.js} +1 -1
  74. package/dist/client/assets/{block-document-BJPvsr5R.js → block-document-CX5LKakr.js} +3 -3
  75. package/dist/client/assets/{blocks-preview-workspace-context-DHCuGpRF.js → blocks-preview-workspace-context-C6uAIZcB.js} +1 -1
  76. package/dist/client/assets/{blocks-tab-states-UGg2OTih.js → blocks-tab-states-CWrGlMnv.js} +1 -1
  77. package/dist/client/assets/{blog-schema-BCoxbBJ-.js → blog-schema-CAFArFfZ.js} +1 -1
  78. package/dist/client/assets/{buckets-BHmMQmes.js → buckets-CHiB8kSO.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc-CtCZmE42.js → build-improve-prompt-doc-DWCL4Usp.js} +1 -1
  80. package/dist/client/assets/{calendar-lV1do84b.js → calendar-Doh9vx1Y.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-J4cHUY10.js → capability-load-error-DAHIgRW0.js} +1 -1
  82. package/dist/client/assets/category-editor-DmF8nidy.js +1 -0
  83. package/dist/client/assets/{chart-CqpI550f.js → chart-CTBX1xJ8.js} +1 -1
  84. package/dist/client/assets/{chat-context-CkHIxm7-.js → chat-context-CMznzxL2.js} +2 -2
  85. package/dist/client/assets/{chat-draft-BiuP1YLO.js → chat-draft-8vQyW9tQ.js} +1 -1
  86. package/dist/client/assets/{checkbox-CTcmxKf9.js → checkbox-BR7eeNRm.js} +1 -1
  87. package/dist/client/assets/{choose-editor-BMMl2UBw.js → choose-editor-DsoM6Awe.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-DzTdo4Jo.js → cli-auth-success-Dc-_DzP0.js} +1 -1
  89. package/dist/client/assets/{client-icons-CO1vrTp-.js → client-icons-DkHG_2rG.js} +1 -1
  90. package/dist/client/assets/cms-settings-editor-CZhxfLk6.js +1 -0
  91. package/dist/client/assets/{cms-store-drafts-Te00tOIa.js → cms-store-drafts-DAUHqZGa.js} +1 -1
  92. package/dist/client/assets/{collapsible-Cef981-n.js → collapsible-BzRZ6mh6.js} +1 -1
  93. package/dist/client/assets/{collection-detail-CimaYbt8.js → collection-detail-of5InSbt.js} +1 -1
  94. package/dist/client/assets/{collection-display-button-DIAxsEaA.js → collection-display-button-DzdTSCUS.js} +1 -1
  95. package/dist/client/assets/{collection-search-RPq6faeR.js → collection-search-CnHLg8Vx.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-CFc_pRSp.js → collection-table-wrapper-BmuSLoPK.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-DZtyDg8t.js → collection-tabs-7Ya9gAB2.js} +1 -1
  98. package/dist/client/assets/{combobox-C7gjhmEU.js → combobox-B41se5lV.js} +1 -1
  99. package/dist/client/assets/{command-D_vABNVv.js → command-CG66jyhm.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-lJWCKZlX.js → companion-mcps-section-mNALQnmz.js} +1 -1
  101. package/dist/client/assets/{config-e0Nvtw2Y.js → config-Bebmx21W.js} +1 -1
  102. package/dist/client/assets/{connect-DZp46x-D.js → connect-BOxbOowz.js} +3 -3
  103. package/dist/client/assets/{connect-layout-DV6kyauB.js → connect-layout-CRU0oD9B.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-DePhFcrr.js → connect-source-dialog-Do1Ol7Lc.js} +1 -1
  105. package/dist/client/assets/{connection-BvqfkXwo.js → connection-CyPXBq-_.js} +1 -1
  106. package/dist/client/assets/{connection-card-BDFmpEai.js → connection-card-DxMw_ATi.js} +1 -1
  107. package/dist/client/assets/{connection-detail-CAgTUs6Z.js → connection-detail-BQWnbjuT.js} +1 -1
  108. package/dist/client/assets/{connection-form-helpers-EN5T3lTJ.js → connection-form-helpers-C2XDuc-v.js} +1 -1
  109. package/dist/client/assets/{connection-slug-CfDyadIo.js → connection-slug-s2iYHyhO.js} +1 -1
  110. package/dist/client/assets/{connections-BANTiWC_.js → connections-pYRqnGDq.js} +1 -1
  111. package/dist/client/assets/content-tab-DVwMjYF_.js +25 -0
  112. package/dist/client/assets/context-CRiBUcdZ.js +1 -0
  113. package/dist/client/assets/{context-menu-BFsADuow.js → context-menu-DUt7Fb0Z.js} +1 -1
  114. package/dist/client/assets/{context-shell-CdL8192k.js → context-shell-o6BvAn5f.js} +3 -3
  115. package/dist/client/assets/{core.esm-OJgsJB-k.js → core.esm-Cdwuvp6V.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-DULZI-ch.js → create-organization-dialog-CRr0zMDH.js} +1 -1
  117. package/dist/client/assets/{device-hint-B4h7argX.js → device-hint-CzI0Cxwe.js} +1 -1
  118. package/dist/client/assets/{discover-BJlgFEIL.js → discover-DV2xyl-v.js} +1 -1
  119. package/dist/client/assets/{domain-settings-CT--UdMT.js → domain-settings-BpStC20M.js} +1 -1
  120. package/dist/client/assets/{drawer-B-H4hfQm.js → drawer-Bl-xKJR_.js} +1 -1
  121. package/dist/client/assets/{editor-CsGz7SqJ.js → editor-CozvZeDY.js} +1 -1
  122. package/dist/client/assets/{editor-classes-_nt7TZ0L.js → editor-classes-C0VdDFt2.js} +1 -1
  123. package/dist/client/assets/{empty-state-BMJVmWPT.js → empty-state-BY5AuJfU.js} +1 -1
  124. package/dist/client/assets/{empty-state-B9Q-olZe.js → empty-state-DjPM3fy8.js} +1 -1
  125. package/dist/client/assets/{experiments-tab-choice-rmEY3th7.js → experiments-tab-choice-DxHtCgvZ.js} +1 -1
  126. package/dist/client/assets/{extract-connection-data-CWUwzdyr.js → extract-connection-data-CzRa4dsB.js} +1 -1
  127. package/dist/client/assets/{feature-gate-Cd7EozQO.js → feature-gate-CecpbIeh.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-XlPt677B.js → feature-paywall-AuKILmgq.js} +1 -1
  129. package/dist/client/assets/{file-explorer-BOVoci0C.js → file-explorer-Djczlqyv.js} +1 -1
  130. package/dist/client/assets/{file-preview-DMLj4MCU.js → file-preview-BoSukKv4.js} +1 -1
  131. package/dist/client/assets/{file-share-button-CvkBxFom.js → file-share-button-BipY8VKx.js} +2 -2
  132. package/dist/client/assets/{file-type-icon-g9-x3_cf.js → file-type-icon-BKtgVCvA.js} +1 -1
  133. package/dist/client/assets/{folder-icon-CA-yyvjC.js → folder-icon-B6Pmbu2w.js} +1 -1
  134. package/dist/client/assets/{form-D9ocAu49.js → form-BcinmXce.js} +1 -1
  135. package/dist/client/assets/{general-BVROjYSK.js → general-Cfumen7X.js} +1 -1
  136. package/dist/client/assets/{github-icon-BuHFJx0u.js → github-icon-lmZhrKkb.js} +1 -1
  137. package/dist/client/assets/{home-CZO-BAxK.js → home-BXszjMgA.js} +1 -1
  138. package/dist/client/assets/{home-overview-Dgo7cAUD.js → home-overview-CBvIMZLG.js} +1 -1
  139. package/dist/client/assets/{hosted-reconcile-CiKTWXGS.js → hosted-reconcile-BwRf3Rhf.js} +1 -1
  140. package/dist/client/assets/{icon-button-cmhhff3C.js → icon-button-BKgqvpeC.js} +1 -1
  141. package/dist/client/assets/index-69S-cBsb.css +1 -0
  142. package/dist/client/assets/index-B-8lp_z-.js +69 -0
  143. package/dist/client/assets/{index-CpKrWBFM.js → index-B1ZvlDM_.js} +37 -37
  144. package/dist/client/assets/{index-BqpQ0Oz6.js → index-BjRujN3I.js} +1 -1
  145. package/dist/client/assets/index-Bmgq1LY9.js +1 -0
  146. package/dist/client/assets/{index-CERqFrvp.js → index-BpS3zp32.js} +1 -1
  147. package/dist/client/assets/{index-DIv66EvA.js → index-BrNhih9e.js} +1 -1
  148. package/dist/client/assets/index-C521Vo2d.js +15 -0
  149. package/dist/client/assets/{index-BvcpEDRp.js → index-CE2oWWvQ.js} +1 -1
  150. package/dist/client/assets/{index-Cu0X1Ryu.js → index-CtHyBR3B.js} +1 -1
  151. package/dist/client/assets/{index-Xu3sMDdX.js → index-CuAzu2ov.js} +3 -3
  152. package/dist/client/assets/{index-DfCff2zl.js → index-Ddc_z0Ej.js} +1 -1
  153. package/dist/client/assets/{index-CCr5d-bq.js → index-DnYGmBYM.js} +1 -1
  154. package/dist/client/assets/{index-BgS_wSN7.js → index-Dodcj-Mw.js} +1 -1
  155. package/dist/client/assets/{index-BWVe-okg.js → index-dh7qVpYI.js} +1 -1
  156. package/dist/client/assets/{index-B2f89yTC.js → index-mDEdivEJ.js} +1 -1
  157. package/dist/client/assets/{index-BH-yAxyT.js → index-rTnBA7ms.js} +1 -1
  158. package/dist/client/assets/{index-redirect-3g0WbUIU.js → index-redirect-BDzsF49E.js} +1 -1
  159. package/dist/client/assets/{index-DYOJSKNv.js → index-zu23C60L.js} +1 -1
  160. package/dist/client/assets/{infiniteQueryObserver-DB_1TZXQ.js → infiniteQueryObserver-CmW3uI_C.js} +1 -1
  161. package/dist/client/assets/{infra-billing-BkNwG0At.js → infra-billing-Xe-QR_aA.js} +1 -1
  162. package/dist/client/assets/{input-CetABZ1t.js → input-BWMKGiG7.js} +1 -1
  163. package/dist/client/assets/{input-BFegQsoJ.js → input-DKvkNLxc.js} +3 -3
  164. package/dist/client/assets/{integration-icon-B40Wh7Yg.js → integration-icon-UdqaK4j5.js} +1 -1
  165. package/dist/client/assets/{jira-icon-DRT1LjUg.js → jira-icon-BXLlnoMi.js} +1 -1
  166. package/dist/client/assets/{label-BfDWtWVd.js → label-PfhFwXDB.js} +1 -1
  167. package/dist/client/assets/{layout-D6GIbXPf.js → layout-LjvCD25R.js} +1 -1
  168. package/dist/client/assets/{legacy-admin-welcome-dialog-CWnygl8t.js → legacy-admin-welcome-dialog-F7XO8XgZ.js} +1 -1
  169. package/dist/client/assets/{legacy-agents-deep-BON-Uap3.js → legacy-agents-deep-Ch8Xa93t.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-7K4gzdWJ.js → legacy-main-redirect-BPNo4KOA.js} +1 -1
  171. package/dist/client/assets/library-DmUN8KJK.js +1 -0
  172. package/dist/client/assets/{library-tab-cPvE59qy.js → library-tab-BSfDHVvp.js} +1 -1
  173. package/dist/client/assets/{login-B1LerdGj.js → login-CoFOfP_J.js} +1 -1
  174. package/dist/client/assets/{markdown-76gpdRfx.js → markdown-Mrho5aZm.js} +7 -7
  175. package/dist/client/assets/{mcp-app-renderer-D2ApozFH.js → mcp-app-renderer-OepBm0xf.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-Ciaq70yo.js → mcp-oauth-CPNuaTw2.js} +1 -1
  177. package/dist/client/assets/{mcp-oauth-Cv9nCTWQ.js → mcp-oauth-D2A3WCc8.js} +1 -1
  178. package/dist/client/assets/{members-DhpI2yjO.js → members-BUCQXk_Z.js} +1 -1
  179. package/dist/client/assets/{memory-C2cklx-U.js → memory-BvgLbCaa.js} +1 -1
  180. package/dist/client/assets/{mock-board-DMtyKhZF.js → mock-board-CkAh1xfR.js} +3 -3
  181. package/dist/client/assets/{monaco-editor-B1sfLlbf.js → monaco-editor-g0g8FNXa.js} +1 -1
  182. package/dist/client/assets/{monitoring-Cko11Af4.js → monitoring-C21z2Ky6.js} +1 -1
  183. package/dist/client/assets/{monitoring-stats-row-CNgZcKxB.js → monitoring-stats-row-CVBzJu2Z.js} +1 -1
  184. package/dist/client/assets/{multi-select-C403rRdD.js → multi-select-BAtpYbAh.js} +1 -1
  185. package/dist/client/assets/{mustache-e4HtHwg-.js → mustache-D54jyG9D.js} +3 -3
  186. package/dist/client/assets/{named-rule-view-Cc1641XV.js → named-rule-view-CT0WGqZQ.js} +1 -1
  187. package/dist/client/assets/{new-project-dialog-CBKXLl_5.js → new-project-dialog-C3_nj5Ml.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-B-w7X7CW.js → oauth-callback-CBi7ICt6.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-BAYGboHu.js → oauth-callback-ai-provider-Dk0zoYp5.js} +1 -1
  190. package/dist/client/assets/{oauth-consent-CoxfO_xS.js → oauth-consent-CuhoZHL3.js} +1 -1
  191. package/dist/client/assets/{onboarding-7GiDV_a-.js → onboarding-Cng8wY1E.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-CWwnbl62.js → openai-conversation-DiGdZuyX.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-BktmZYTP.js → optimistic-project-sidebar-views-BOc7d1-I.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-DCrwQKXh.js → order-monitor-day-DvvGpgk-.js} +1 -1
  195. package/dist/client/assets/{organization-choice--RCqz3ju.js → organization-choice-DNs_V-xg.js} +1 -1
  196. package/dist/client/assets/{orgs-tCNrRFKw.js → orgs-BLLV0cjQ.js} +1 -1
  197. package/dist/client/assets/{own-accounts-section-ChZriIwH.js → own-accounts-section-C_JhIm_f.js} +1 -1
  198. package/dist/client/assets/{pair-tmC6PpOp.js → pair-BZWd7l8i.js} +7 -7
  199. package/dist/client/assets/parse-sections-Chh4kibB.js +20 -0
  200. package/dist/client/assets/plan-C2Rwz4yq.js +1 -0
  201. package/dist/client/assets/{plan-ladder-DK7Z5wEN.js → plan-ladder-C_hexrUw.js} +1 -1
  202. package/dist/client/assets/{plan-usage-card-DHkPqm05.js → plan-usage-card-BoQTuswG.js} +1 -1
  203. package/dist/client/assets/{popover-DsnoY7gE.js → popover-Bmr7L36n.js} +1 -1
  204. package/dist/client/assets/post-calendar-DMhH6lZl.js +1 -0
  205. package/dist/client/assets/post-editor-BXvu8EpI.js +2 -0
  206. package/dist/client/assets/{preview-content-W28O7oBF.js → preview-content-DYnkU4UJ.js} +1 -1
  207. package/dist/client/assets/{preview-dialog-DS-Ukev2.js → preview-dialog-DNx4X2e9.js} +1 -1
  208. package/dist/client/assets/{preview-panel-CtHwojzA.js → preview-panel-CvviPuHY.js} +1 -1
  209. package/dist/client/assets/{preview-tab-B7WKX_jB.js → preview-tab-BNjaDwVm.js} +3 -3
  210. package/dist/client/assets/{product-picker-dialog-DbnA1q8B.js → product-picker-dialog-H-c7S_y6.js} +1 -1
  211. package/dist/client/assets/{profile-6j9OcP2L.js → profile-CIr-8Y5O.js} +1 -1
  212. package/dist/client/assets/{project-app-view-TULDeLlR.js → project-app-view-AO2FGSd6.js} +1 -1
  213. package/dist/client/assets/{project-apps-B8XrqASg.js → project-apps-DBCPlxgH.js} +1 -1
  214. package/dist/client/assets/{project-icon-SG6bYAhL.js → project-icon-CmnD7zSI.js} +1 -1
  215. package/dist/client/assets/{project-index-CKqx4tH5.js → project-index-DSLcGnuq.js} +1 -1
  216. package/dist/client/assets/project-reports-S-kufFKe.js +1 -0
  217. package/dist/client/assets/project-tasks-wzF7Jhs-.js +1 -0
  218. package/dist/client/assets/{projects-ZPSZzS-2.js → projects-ChZ6VlDP.js} +1 -1
  219. package/dist/client/assets/{projects-empty-state-D0MMQ8sq.js → projects-empty-state-DAlIDaDL.js} +1 -1
  220. package/dist/client/assets/{prompts-9qkglIAd.js → prompts-Bvb1OOOC.js} +1 -1
  221. package/dist/client/assets/record-editor-N9NTN0AS.js +1 -0
  222. package/dist/client/assets/redirect-editor-Cr2marAT.js +1 -0
  223. package/dist/client/assets/{reports-DCT8OLXu.js → reports-BXChVA2M.js} +1 -1
  224. package/dist/client/assets/{reports-onboarding-Co5Q5X1T.js → reports-onboarding-mCk-w7k-.js} +1 -1
  225. package/dist/client/assets/reports-sZEBLifc.js +1 -0
  226. package/dist/client/assets/{reports-tab-CUX0tKBD.js → reports-tab-DE8i-fZN.js} +2 -2
  227. package/dist/client/assets/repositories-BgBZ-sk3.js +1 -0
  228. package/dist/client/assets/{repositories-BN38EwkA.js → repositories-DBxw960j.js} +1 -1
  229. package/dist/client/assets/{repository-binding-FcrTKkLc.js → repository-binding-CoMozV78.js} +1 -1
  230. package/dist/client/assets/{repository-picker-uDInunvt.js → repository-picker-Ds67iMZ7.js} +1 -1
  231. package/dist/client/assets/{require-capability-CLtIqMdo.js → require-capability-C9oBXOPC.js} +1 -1
  232. package/dist/client/assets/{required-auth-layout-DYY0v5vc.js → required-auth-layout-BZsZN7yA.js} +1 -1
  233. package/dist/client/assets/{reset-password-DXzM6d6N.js → reset-password-7T8Amd8g.js} +1 -1
  234. package/dist/client/assets/{resizable-Cwvumcp8.js → resizable-CMMESj2f.js} +1 -1
  235. package/dist/client/assets/{resolve-tab-icon-CpKqYylc.js → resolve-tab-icon-CWFgluny.js} +1 -1
  236. package/dist/client/assets/{review-settings-DhXUecFY.js → review-settings-CcRoafom.js} +1 -1
  237. package/dist/client/assets/{role-color-Bmggoorj.js → role-color-BGMgsms5.js} +1 -1
  238. package/dist/client/assets/{roles-CDov6Epa.js → roles-D_ANLmLE.js} +1 -1
  239. package/dist/client/assets/route-Bl9oqEzn.js +1 -0
  240. package/dist/client/assets/{route-ByenP2AC.js → route-CVEfwKUb.js} +1 -1
  241. package/dist/client/assets/route-OcK1C2mu.js +1 -0
  242. package/dist/client/assets/{sandbox-lifecycle-context-CWyZPDgB.js → sandbox-lifecycle-context-Df97dN_A.js} +1 -1
  243. package/dist/client/assets/{schema-BzPNqisL.js → schema-C8mn4zzt.js} +1 -1
  244. package/dist/client/assets/{schema-BtgOmeu0.js → schema-PUU_l55-.js} +1 -1
  245. package/dist/client/assets/{scroll-area-BetFFhjH.js → scroll-area-DPYxTk2f.js} +1 -1
  246. package/dist/client/assets/{search-input-B143wE4b.js → search-input-CxiWeJ7M.js} +1 -1
  247. package/dist/client/assets/{search-toggle-B60V5fY3.js → search-toggle-B2er_d2D.js} +1 -1
  248. package/dist/client/assets/{secret-picker-0dwjcuZ2.js → secret-picker-BGN25hQY.js} +1 -1
  249. package/dist/client/assets/{secrets-CaFiB2gJ.js → secrets-CdS0pLko.js} +1 -1
  250. package/dist/client/assets/{section-array-field-BGVc7GN5.js → section-array-field-CP-WbNwo.js} +1 -1
  251. package/dist/client/assets/{sections-7hWvDZxF.js → sections-B2VbhORA.js} +1 -1
  252. package/dist/client/assets/{sections-editor-DV62ul9c.js → sections-editor-DrJZD-K0.js} +1 -1
  253. package/dist/client/assets/{select-CynqC93H.js → select-DwKpuPDv.js} +1 -1
  254. package/dist/client/assets/{select-model-pbBNqCJO.js → select-model-CYqVBHX-.js} +1 -1
  255. package/dist/client/assets/{seo-editor-D_-BHzsC.js → seo-editor-BZHEYA-M.js} +1 -1
  256. package/dist/client/assets/{separator-BstUCndM.js → separator-ygeWiuaT.js} +1 -1
  257. package/dist/client/assets/settings-tab-DAogag92.js +1 -0
  258. package/dist/client/assets/{sheet-DRzohuTq.js → sheet-Xug5hLAu.js} +1 -1
  259. package/dist/client/assets/{shell-layout-yWlnACBx.js → shell-layout-DP2VC2TO.js} +1 -1
  260. package/dist/client/assets/{site-draft-actions-CezwaYzG.js → site-draft-actions-CwKZJ4xP.js} +1 -1
  261. package/dist/client/assets/{site-draft-view-D3ax_gON.js → site-draft-view-DqJzkrit.js} +1 -1
  262. package/dist/client/assets/site-editor-DBJLt6gM.js +1 -0
  263. package/dist/client/assets/{site-editor-toast-BzBdZBKk.js → site-editor-toast-C2KJeS5V.js} +1 -1
  264. package/dist/client/assets/{skills-BVynzZAe.js → skills-KjFJGU5i.js} +1 -1
  265. package/dist/client/assets/{slider-CVqkGq0u.js → slider-B0Ygf2_6.js} +1 -1
  266. package/dist/client/assets/{sortable.esm-CLb-zEUc.js → sortable.esm-b0bgkepL.js} +1 -1
  267. package/dist/client/assets/{sso-D3L3bPHO.js → sso-BRHmZu4z.js} +1 -1
  268. package/dist/client/assets/{suggestion-ZPwpaecb.js → suggestion-x1hGwkT4.js} +2 -2
  269. package/dist/client/assets/{super-agent-icon-CYwYFCF-.js → super-agent-icon-DVvWAvfT.js} +1 -1
  270. package/dist/client/assets/{switch-DVFRbC37.js → switch-B89m7bUN.js} +1 -1
  271. package/dist/client/assets/{synced-repos-CvJMz8IM.js → synced-repos-GWj1dwBE.js} +1 -1
  272. package/dist/client/assets/{tab-icon-glyph-CSVQlnge.js → tab-icon-glyph-izlIxfMt.js} +1 -1
  273. package/dist/client/assets/{table-B7g6T_zR.js → table-lum-yHpJ.js} +1 -1
  274. package/dist/client/assets/{tabs-_i5AcyEU.js → tabs-qmDGzXtn.js} +1 -1
  275. package/dist/client/assets/{task-board-CwSJI_Nh.js → task-board-CITA4beV.js} +1 -1
  276. package/dist/client/assets/{task-route-DHnjMT6H.js → task-route-DLxggJ7K.js} +1 -1
  277. package/dist/client/assets/{task-status-CoCBESax.js → task-status-DDIH9CGS.js} +1 -1
  278. package/dist/client/assets/{taskboard-analytics-CkN-nZww.js → taskboard-analytics-B4G_sBgg.js} +1 -1
  279. package/dist/client/assets/{tasks-CvuI8Qsn.js → tasks-DbElIgy9.js} +1 -1
  280. package/dist/client/assets/tasks-Df6DY3du.js +1 -0
  281. package/dist/client/assets/{textarea-BJYFhWH0.js → textarea-BYx7yH8o.js} +1 -1
  282. package/dist/client/assets/{thread-analytics-CDKp0-KR.js → thread-analytics-D3o9NsHQ.js} +1 -1
  283. package/dist/client/assets/{thread-intent-CaOco8G4.js → thread-intent-BMcVCMdR.js} +1 -1
  284. package/dist/client/assets/{thread-route-Ddday1Ur.js → thread-route-BX8g4tw-.js} +1 -1
  285. package/dist/client/assets/{thread-route-J75JIOlK.js → thread-route-jIR4gAI_.js} +1 -1
  286. package/dist/client/assets/{thread-sheet-body-BRKc6pTX.js → thread-sheet-body-BaVm1ZBO.js} +1 -1
  287. package/dist/client/assets/{time-range-picker-DFFd7aW8.js → time-range-picker-EQi5kb2q.js} +1 -1
  288. package/dist/client/assets/{toggle-group-u9Wi3ddU.js → toggle-group-6Dx2ZnVa.js} +1 -1
  289. package/dist/client/assets/{tool-namespace-MYfklNim.js → tool-namespace-C8tIomG8.js} +1 -1
  290. package/dist/client/assets/{tool-set-selector-ByaGzWxc.js → tool-set-selector-Dzh4gju3.js} +1 -1
  291. package/dist/client/assets/{toolbar-icon-button-DWFGDofy.js → toolbar-icon-button-qX2Q8Vi7.js} +1 -1
  292. package/dist/client/assets/{tooltip-BN1ul0v0.js → tooltip-D2vb17oX.js} +1 -1
  293. package/dist/client/assets/{tooltipContext-DYJdhWXE.js → tooltipContext-bN8koyv-.js} +1 -1
  294. package/dist/client/assets/{track-BvwOMvDA.js → track-Bx9-uk2h.js} +1 -1
  295. package/dist/client/assets/{types-CZmkZk5S.js → types-Dynv4Wt5.js} +1 -1
  296. package/dist/client/assets/{url-slug-yKaykGVx.js → url-slug-Dqg9nWvP.js} +1 -1
  297. package/dist/client/assets/{usage-stats-B-U2im7t.js → usage-stats-BxAReiDs.js} +32 -32
  298. package/dist/client/assets/{use-ai-providers-DMerS0dR.js → use-ai-providers-CtG5BelZ.js} +1 -1
  299. package/dist/client/assets/{use-apply-named-rule-B_pcj1fJ.js → use-apply-named-rule-DHBY1E38.js} +1 -1
  300. package/dist/client/assets/use-ask-in-chat-B2dGYQPJ.js +1 -0
  301. package/dist/client/assets/{use-automations-CotbuTIN.js → use-automations-TW0JJdqx.js} +1 -1
  302. package/dist/client/assets/{use-autosave-BMHCMWOG.js → use-autosave-BezOS47T.js} +1 -1
  303. package/dist/client/assets/use-blocks-v8-project-Dx_FWHJP.js +1 -0
  304. package/dist/client/assets/{use-chat-layout-state-CKlzZSFB.js → use-chat-layout-state-CakVfv2a.js} +1 -1
  305. package/dist/client/assets/{use-cms-publish-actions-B18WgFwx.js → use-cms-publish-actions-DPLfPXzl.js} +1 -1
  306. package/dist/client/assets/{use-connect-companion-CP2lbL5p.js → use-connect-companion-xyuasG3f.js} +1 -1
  307. package/dist/client/assets/{use-connection-Yeg3sQ-l.js → use-connection-DYtXLDpf.js} +1 -1
  308. package/dist/client/assets/{use-content-sync-DEW9pHRa.js → use-content-sync-BpVEjJ5G.js} +1 -1
  309. package/dist/client/assets/{use-copy-m2oUJF7G.js → use-copy-B1cnS_xX.js} +1 -1
  310. package/dist/client/assets/{use-date-fns-locale-7jMzA5l2.js → use-date-fns-locale-DEbdWDOa.js} +1 -1
  311. package/dist/client/assets/{use-debounced-autosave-C-UsjeaV.js → use-debounced-autosave-CvHwbalF.js} +1 -1
  312. package/dist/client/assets/{use-debounced-value-BlVaTHev.js → use-debounced-value-Z34m5Fyz.js} +1 -1
  313. package/dist/client/assets/{use-deco-credits-BvPiIPxy.js → use-deco-credits-DCZQcwBn.js} +1 -1
  314. package/dist/client/assets/{use-decopilot-events-B0PBK1Av.js → use-decopilot-events-_iazqvpf.js} +1 -1
  315. package/dist/client/assets/{use-delete-connection-DExrJh9G.js → use-delete-connection-M267X1bS.js} +1 -1
  316. package/dist/client/assets/{use-deployment-admin-CRigQkc2.js → use-deployment-admin-DOzhh6sJ.js} +1 -1
  317. package/dist/client/assets/{use-entitlements-Bn1lpTMW.js → use-entitlements-DZIIouH3.js} +1 -1
  318. package/dist/client/assets/{use-fast-preview-draft-url-kLM5HS2Q.js → use-fast-preview-draft-url-DSbBc_J-.js} +1 -1
  319. package/dist/client/assets/{use-file-configs-D7MvTYxK.js → use-file-configs-hDEnq4hr.js} +1 -1
  320. package/dist/client/assets/{use-id-selection-BA3JsAi6.js → use-id-selection-CcHW6d6u.js} +1 -1
  321. package/dist/client/assets/{use-inbox-feed-DwHoJq6j.js → use-inbox-feed-BQSYPM61.js} +1 -1
  322. package/dist/client/assets/{use-infinite-scroll-C87qe8Wa.js → use-infinite-scroll-lJK8P9ZI.js} +1 -1
  323. package/dist/client/assets/{use-join-requests-qfP8I5hc.js → use-join-requests-sJWVcnYg.js} +1 -1
  324. package/dist/client/assets/{use-main-panel-tabs-CPwSHrEE.js → use-main-panel-tabs-C788lFWw.js} +1 -1
  325. package/dist/client/assets/{use-mcp-auth-status-BqFL1hj_.js → use-mcp-auth-status-CgZY_gyC.js} +1 -1
  326. package/dist/client/assets/{use-mcp-client-sJ5tYuZ0.js → use-mcp-client-C_baTEme.js} +1 -1
  327. package/dist/client/assets/{use-mcp-prompts-CLTd7fVx.js → use-mcp-prompts-DpQotIu-.js} +1 -1
  328. package/dist/client/assets/{use-mcp-tools-Ds_pRYTC.js → use-mcp-tools-CVQwrVGE.js} +1 -1
  329. package/dist/client/assets/{use-mobile-Ca0mzlkS.js → use-mobile-CzZEBajI.js} +1 -1
  330. package/dist/client/assets/{use-move-blocks-C4yvAsmR.js → use-move-blocks-CeecxxS_.js} +1 -1
  331. package/dist/client/assets/{use-navigate-to-agent-Cxr48619.js → use-navigate-to-agent-BMQllV2g.js} +1 -1
  332. package/dist/client/assets/{use-org-fs-noLXcqcI.js → use-org-fs-hvIlZzgN.js} +1 -1
  333. package/dist/client/assets/{use-org-repo-syncs-PTxVSrm9.js → use-org-repo-syncs-C0ZbZ18y.js} +1 -1
  334. package/dist/client/assets/{use-org-sso-29QrT10j.js → use-org-sso-C9hOcGok.js} +1 -1
  335. package/dist/client/assets/{use-organization-settings-DEeoFtSz.js → use-organization-settings-D9HfcuG0.js} +1 -1
  336. package/dist/client/assets/{use-project-native-view-presence-BO67nAre.js → use-project-native-view-presence-FcTxBNIu.js} +1 -1
  337. package/dist/client/assets/{use-project-scope-BXftze_e.js → use-project-scope-yhiZWd6i.js} +1 -1
  338. package/dist/client/assets/{use-recent-apps-CIrhZcWD.js → use-recent-apps-CtwsvbPj.js} +1 -1
  339. package/dist/client/assets/{use-reports-diagnostic-oIW-vWNT.js → use-reports-diagnostic-BP7gBCmu.js} +1 -1
  340. package/dist/client/assets/{use-sandbox-events-BG3ieUWQ.js → use-sandbox-events-rlHOSL_u.js} +1 -1
  341. package/dist/client/assets/{use-secrets-DkEnO-x0.js → use-secrets-CjzhxUFP.js} +1 -1
  342. package/dist/client/assets/{use-section-preview-base-BjAgfXf5.js → use-section-preview-base-BRTpm92u.js} +1 -1
  343. package/dist/client/assets/{use-sidebar-collapsed-CvNtqVy2.js → use-sidebar-collapsed-DTqL_ZOd.js} +1 -1
  344. package/dist/client/assets/{use-tags-BHiGxU75.js → use-tags-v5mP3DFy.js} +1 -1
  345. package/dist/client/assets/{use-task-board-analytics-Ckz7K9Sk.js → use-task-board-analytics-CXbWAJgx.js} +1 -1
  346. package/dist/client/assets/{use-task-board-events-N3Hmav6X.js → use-task-board-events-Do0ZxHPd.js} +1 -1
  347. package/dist/client/assets/{use-task-board-item-prs-BrW26Cl1.js → use-task-board-item-prs-DjTo2SIU.js} +1 -1
  348. package/dist/client/assets/{use-task-board-items-Boto1WTW.js → use-task-board-items-8MOWqSEt.js} +1 -1
  349. package/dist/client/assets/{use-task-board-prompts-BU1x5m9R.js → use-task-board-prompts-ECSdw-Pb.js} +1 -1
  350. package/dist/client/assets/{use-task-metadata-BB2iYALn.js → use-task-metadata-X9Mil_QT.js} +1 -1
  351. package/dist/client/assets/{use-thread-outputs-BUT_Bu11.js → use-thread-outputs-Dmf6zhrt.js} +1 -1
  352. package/dist/client/assets/{use-voice-input-BlXyivEI.js → use-voice-input-BJwAU8da.js} +1 -1
  353. package/dist/client/assets/useInfiniteQuery-CvokX1at.js +1 -0
  354. package/dist/client/assets/{useQueries-B4AI0K7c.js → useQueries-DOrZn37R.js} +1 -1
  355. package/dist/client/assets/useSuspenseInfiniteQuery-BiaFhRxh.js +1 -0
  356. package/dist/client/assets/{users-BJUWBQrO.js → users-Daf6ssOQ.js} +1 -1
  357. package/dist/client/assets/{utils-Cwe-foul.js → utils-DfZ0Z1Cp.js} +2 -2
  358. package/dist/client/assets/{variant-calendar-DTdamyQ9.js → variant-calendar-C_C-crL9.js} +1 -1
  359. package/dist/client/assets/{variant-matcher-override-Ve07uZhZ.js → variant-matcher-override-DNI0CzKx.js} +1 -1
  360. package/dist/client/assets/{view-header-CcqynLIn.js → view-header-B99QN9EG.js} +1 -1
  361. package/dist/client/assets/virtual-mcp-CbvCEWCq.js +1 -0
  362. package/dist/client/assets/{watch-sse-pool-C6-OWpzA.js → watch-sse-pool-D0y06VhU.js} +1 -1
  363. package/dist/client/index.html +2 -2
  364. package/dist/server/server.js +2 -2
  365. package/package.json +1 -1
  366. package/dist/client/assets/agent-app-DIOn_zxU.js +0 -1
  367. package/dist/client/assets/agent-deck-D8sIhHcl.js +0 -1
  368. package/dist/client/assets/agent-experiments-CTwWI_LC.js +0 -1
  369. package/dist/client/assets/agent-file-tQpTdSLO.js +0 -1
  370. package/dist/client/assets/agent-library-C8-K4C_A.js +0 -1
  371. package/dist/client/assets/agent-library-file-CUAfUV8b.js +0 -1
  372. package/dist/client/assets/agent-overview-BA99Kh7t.js +0 -1
  373. package/dist/client/assets/agent-settings-BLtzbihE.js +0 -1
  374. package/dist/client/assets/agent-site-editor-code-Cz02M8Vo.js +0 -2
  375. package/dist/client/assets/agent-site-editor-content-BR1zYqRC.js +0 -1
  376. package/dist/client/assets/agent-site-editor-preview-DmnTxDaZ.js +0 -1
  377. package/dist/client/assets/agent-view-zCDPmtYP.js +0 -1
  378. package/dist/client/assets/api-keys-JGOPVjRU.js +0 -1
  379. package/dist/client/assets/app-editor-DToZlbxJ.js +0 -1
  380. package/dist/client/assets/category-editor-DCkmHYcQ.js +0 -1
  381. package/dist/client/assets/cms-settings-editor-CBpfvEej.js +0 -1
  382. package/dist/client/assets/content-tab-Df3tIOmt.js +0 -25
  383. package/dist/client/assets/context-C2o5DQEj.js +0 -1
  384. package/dist/client/assets/index-BYag0D9X.js +0 -83
  385. package/dist/client/assets/index-BkJtJQz4.css +0 -1
  386. package/dist/client/assets/index-Bu4stMck.js +0 -1
  387. package/dist/client/assets/library-DSOuf5_0.js +0 -1
  388. package/dist/client/assets/parse-sections-3ze3XXop.js +0 -20
  389. package/dist/client/assets/plan-BbVPxdYG.js +0 -1
  390. package/dist/client/assets/post-calendar-kAnC_2Hm.js +0 -1
  391. package/dist/client/assets/post-editor-DJ3OH6KB.js +0 -2
  392. package/dist/client/assets/project-reports-DBO5X-h0.js +0 -1
  393. package/dist/client/assets/project-tasks-CfmD3VHL.js +0 -1
  394. package/dist/client/assets/record-editor-BnGOXmOt.js +0 -1
  395. package/dist/client/assets/redirect-editor-OjmSo149.js +0 -1
  396. package/dist/client/assets/reports-DoGHDSe5.js +0 -1
  397. package/dist/client/assets/repositories-btzaY915.js +0 -1
  398. package/dist/client/assets/route-f2InXsa9.js +0 -1
  399. package/dist/client/assets/route-t1xHDXK-.js +0 -1
  400. package/dist/client/assets/settings-tab-CPJwJyA3.js +0 -1
  401. package/dist/client/assets/site-editor-cTg-Jmis.js +0 -1
  402. package/dist/client/assets/tasks-DZsRgr7r.js +0 -1
  403. package/dist/client/assets/use-ask-in-chat-DO48HVtQ.js +0 -1
  404. package/dist/client/assets/use-blocks-v8-project-2aeIHOAc.js +0 -1
  405. package/dist/client/assets/useInfiniteQuery-Dn6_bz5e.js +0 -1
  406. package/dist/client/assets/useSuspenseInfiniteQuery-FPhi-YvF.js +0 -1
  407. package/dist/client/assets/virtual-mcp-DvDiWLao.js +0 -1
@@ -1,3 +1,3 @@
1
- import{c as B,b as be,r as q,j as a,B as ve,m as K,K as ss,ak as ka,t as et,fb as Na,ar as or,ej as cr,Y as Xt,c8 as Ca,aG as ks,aH as Ns,aI as Cs,aJ as As,bj as Rs,aK as Ts,aL as Ds,aM as Bs,X as Ms,Z as _s,_ as Es,a as zs,a4 as hs,cy as Aa,h as Zt,fc as dr,fd as cn,bK as Ra,b7 as Ta,bh as Mn,fe as Da,c2 as Ba,al as Ia,I as $a,a7 as Fa,ff as La,V as ur,i as ft,eW as dn,q as hr,J as fr,D as mr,x as pr,v as br,Q as gr,R as xr,fg as Oa,bk as vr,a5 as un,b2 as hn,e as _n,E as Ma,T as _a}from"./index-CpKrWBFM.js";import{S as Ea}from"./separator-BstUCndM.js";import{f as za,u as ns,r as yr,l as jr,c as wr,b as Ua}from"./chat-context-CkHIxm7-.js";import{u as Bt,at as qa,au as Pr,av as Sr,c as fn,b as mn,M as pn,aw as Ha,L as Ka,ax as Va,ah as Ga,ay as Wa,l as bn,S as kr,az as Qa,a1 as Nr,G as Ja,aA as Ya,aB as Xa,D as Cr}from"./site-editor-toast-BzBdZBKk.js";import{j as Za,L as el,g as tl}from"./shell-layout-yWlnACBx.js";import{I as Ar}from"./toolbar-icon-button-DWFGDofy.js";import{b as sl,P as nl,a as rl}from"./popover-DsnoY7gE.js";import{c as tt,T as st,a as nt,b as Us}from"./tooltip-BN1ul0v0.js";import{f as al,a as ll,c as il,C as En,e as zn,b as Un}from"./command-D_vABNVv.js";import{T as Tt,a as Rr,c as Tr}from"./tabs-_i5AcyEU.js";import{t as Dr}from"./ChevronUp-CypYcouh.js";import{Y as Br,aG as qs,F as ol,a as Ir,aH as cl,b as dl,aI as $r,M as ul}from"./agent-icon-De2MEsoK.js";import{a as Fr}from"./SwitchHorizontal01-BKQGE_Gz.js";import{c as Lr,s as Is}from"./Tool01-3EDhR0eh.js";import{s as Or}from"./Plus-CXFgI-7S.js";import{s as Hs}from"./Trash01-Cc7bOGxh.js";import{l as hl,d as fl}from"./thread-intent-CaOco8G4.js";import{h as Mr,r as _r,g as ml,e as Me,u as Ks,f as Er}from"./repository-binding-FcrTKkLc.js";import{u as pl}from"./use-debounced-value-BlVaTHev.js";import{u as bl}from"./useInfiniteQuery-Dn6_bz5e.js";import{d as gl,b as xl,p as vl,e as zr,g as Ur,h as qr}from"./use-navigate-to-agent-Cxr48619.js";import{u as Vs,g as gn,n as ds,b as Hr,a as yl,d as jl,e as wl,r as cs,f as Pl,s as Sl,h as xs,c as xn}from"./cms-store-drafts-Te00tOIa.js";import{a as $s}from"./virtual-mcp-DvDiWLao.js";import{u as fs}from"./use-voice-input-BlXyivEI.js";import{u as vn}from"./use-blocks-v8-project-2aeIHOAc.js";import{G as Kr}from"./github-icon-BuHFJx0u.js";import{u as kl,a as Nl}from"./use-fast-preview-draft-url-kLM5HS2Q.js";import{a6 as Jt,a7 as Vr,D as Fs,o as yn,a8 as Cl,a9 as Al,G as Rl,aa as Tl,ab as Dl,p as Bl,y as Pt,f as jn,ac as Il}from"./blocks-tab-states-UGg2OTih.js";import"./index-DIv66EvA.js";import{T as $l}from"./textarea-BJYFhWH0.js";import{i as wn}from"./CheckCircle-Lk0BK653.js";import{n as Fl,s as Ll,C as Ol,a as Ml,b as _l,M as El,c as zl,d as Ul,m as ql,u as Hl}from"./use-cms-publish-actions-B18WgFwx.js";import{a as Kl,g as Vl}from"./UserSquare-CgD5WRTE.js";import{i as Pn,b as Sn,m as Gl,h as Wl,c as Gr,f as Wr,d as Ql,r as kn,e as Jl,n as Yl,g as Xl,j as Zl,k as ei,l as Nn,o as ti,p as Qr,q as si,s as Cn,t as Ys}from"./sandbox-git-api-DcqI6XE4.js";import{b as ni,g as ri}from"./utils-Cwe-foul.js";import{i as ai}from"./Monitor01-B1R4t9_g.js";import{w as An,R as Jr}from"./device-hint-B4h7argX.js";import{w as qn}from"./editor-CsGz7SqJ.js";import{x as li,C as ii}from"./section-array-field-BGVc7GN5.js";import{s as Yr}from"./save-changes-debug-nBi-n9eV.js";import{u as oi}from"./use-mcp-client-sJ5tYuZ0.js";import{u as ci}from"./use-sandbox-events-BG3ieUWQ.js";import{b as di,a as ui}from"./sandbox-lifecycle-context-CWyZPDgB.js";import{b as hi}from"./agent-capabilities-Re3Rcd9U.js";import{b as fi}from"./thread-route-Ddday1Ur.js";function mi(t){const{value:e,baseBranch:s,releases:r,baseIsDraft:n=!1,storeDrafts:o=[]}=t,d=!n&&!!e&&e===s,l=r.find(c=>c.branch===e),i=d||l?void 0:o.find(c=>c.name===e),u=!d&&!l&&!i&&!!e;return i?{isBase:d,current:l,storeDraft:i,unlisted:u}:{isBase:d,current:l,unlisted:u}}const pi={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},Hn=1114111;function Kn(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const r=Number.parseInt(s.slice(2),16);return!Number.isFinite(r)||r>Hn?e:String.fromCodePoint(r)}if(s.startsWith("#")){const r=Number.parseInt(s.slice(1),10);return!Number.isFinite(r)||r>Hn?e:String.fromCodePoint(r)}return pi[s]??e}):""}function bi(t){const e=B.c(39),{url:s,onSave:r}=t,n=be(),[o,d]=q.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]!==r||e[3]!==i?(u=()=>r(i?hl(i):null),e[2]=r,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 p;e[7]!==h?(p=a.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=p):p=e[8];let b;e[9]!==n?(b=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=b):b=e[10];let f;e[11]!==n?(f=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=f):f=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=N=>d(N.target.value),e[13]=m):m=e[13];let g;e[14]!==c||e[15]!==i?(g=N=>{N.key==="Enter"&&i&&c()},e[14]=c,e[15]=i,e[16]=g):g=e[16];let x;e[17]!==b||e[18]!==f||e[19]!==g||e[20]!==o?(x=a.jsx("input",{type:"url",inputMode:"url","aria-label":b,placeholder:f,value:o,onChange:m,onKeyDown:g,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=b,e[18]=f,e[19]=g,e[20]=o,e[21]=x):x=e[21];let P;e[22]!==r||e[23]!==n||e[24]!==s?(P=s?a.jsx(ve,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>r(null),children:n("thread.branchPicker.localTurnOff")}):a.jsx("span",{}),e[22]=r,e[23]=n,e[24]=s,e[25]=P):P=e[25];const j=!i;let y;e[26]!==n?(y=n("thread.branchPicker.save"),e[26]=n,e[27]=y):y=e[27];let S;e[28]!==c||e[29]!==j||e[30]!==y?(S=a.jsx(ve,{size:"sm",disabled:j,onClick:c,children:y}),e[28]=c,e[29]=j,e[30]=y,e[31]=S):S=e[31];let w;e[32]!==P||e[33]!==S?(w=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,S]}),e[32]=P,e[33]=S,e[34]=w):w=e[34];let k;return e[35]!==w||e[36]!==p||e[37]!==x?(k=a.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[p,x,w]}),e[35]=w,e[36]=p,e[37]=x,e[38]=k):k=e[38],k}function gi(t){const e=B.c(8),{virtualMcpId:s,branch:r,serve:n,rowRef:o,onPicked:d}=t,l=Bt(s,r),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>xi(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=a.jsx(vi,{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 xi(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??qa})}function vi(t){const e=B.c(19),{rowRef:s,selected:r,connected:n,onSelect:o}=t,d=be(),l=r?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=K("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=a.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=a.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let p;e[7]!==n||e[8]!==d?(p=n&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d("thread.branchPicker.localhost.connected")}),e[7]=n,e[8]=d,e[9]=p):p=e[9];let b;e[10]!==o||e[11]!==r||e[12]!==h||e[13]!==p?(b=a.jsxs("button",{type:"button","aria-pressed":r,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,p]}),e[10]=o,e[11]=r,e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;return e[15]!==s||e[16]!==i||e[17]!==b?(f=a.jsx("div",{ref:s,className:i,children:b}),e[15]=s,e[16]=i,e[17]=b,e[18]=f):f=e[18],f}const yi=10080*60*1e3;function ji({sandboxMap:t,userId:e,rawBranches:s,now:r}){const n=new Map;for(const[h,p]of Object.entries(t??{}))for(const[b,f]of Object.entries(p??{})){let m=n.get(b);m||(m={userIds:new Set,lastActiveAt:0},n.set(b,m)),m.userIds.add(h);for(const g of Object.values(f??{})){const x=g?.createdAt??0;x>m.lastActiveAt&&(m.lastActiveAt=x)}}const o=r-yi,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,p)=>p[1].lastActiveAt-h[1].lastActiveAt).map(([h,p])=>({name:h,source:"recent",contributors:[...p.userIds],lastActiveAt:p.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 wi=100,Pi=50,Si=300;function nn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function ki(t){const e=B.c(39),{orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:u,enabled:c}=t,h=u===void 0?"":u,p=c===void 0?!0:c;let b;e[0]!==h?(b=h.trim(),e[0]=h,e[1]=b):b=e[1];const f=b,m=pl(f,Si);let g;e[2]!==o?(g=Mr(o),e[2]=o,e[3]=g):g=e[3];const x=g,P=f.length>0;let j;e[4]!==m||e[5]!==s||e[6]!==r||e[7]!==l||e[8]!==i||e[9]!==o?(j=ss.githubBranchSearch(s,r,_r(o),l,i,m),e[4]=m,e[5]=s,e[6]=r,e[7]=l,e[8]=i,e[9]=o,e[10]=j):j=e[10];const y=p&&x;let S;e[11]!==m||e[12]!==r||e[13]!==o?(S=D=>{const{pageParam:Z}=D;return ka(r,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?Pi:wi,cursor:Z})},e[11]=m,e[12]=r,e[13]=o,e[14]=S):S=e[14];let w;e[15]!==m?(w=D=>m?void 0:D.nextCursor??void 0,e[15]=m,e[16]=w):w=e[16];let k;e[17]!==j||e[18]!==y||e[19]!==S||e[20]!==w?(k={queryKey:j,enabled:y,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:S,getNextPageParam:w},e[17]=j,e[18]=y,e[19]=S,e[20]=w,e[21]=k):k=e[21];const{data:N,isLoading:C,isError:v,isFetching:A,hasNextPage:T,isFetchingNextPage:I,fetchNextPage:M}=bl(k),$=P&&(m!==f||A),H=(N?.pages??[]).flatMap(Ni),O=Za(6e4),G=ji({sandboxMap:d,userId:n,rawBranches:H,now:O});let E;e[22]!==f?(E=D=>nn(D.name,f),e[22]=f,e[23]=E):E=e[23];const W=G.recent.filter(E);let F;e[24]!==f?(F=D=>nn(D.name,f),e[24]=f,e[25]=F):F=e[25];const V=G.yours.filter(F),te=G.others,Y=N?.pages[0],ne=P&&Y&&!$?Math.max(0,Y.totalCount-Y.branches.length):0,le=!P&&T;let _;e[26]!==M?(_=()=>{M()},e[26]=M,e[27]=_):_=e[27];let X;return e[28]!==ne||e[29]!==v||e[30]!==I||e[31]!==C||e[32]!==$||e[33]!==te||e[34]!==W||e[35]!==le||e[36]!==_||e[37]!==V?(X={recent:W,yours:V,others:te,isLoading:C,isError:v,isSearching:$,hiddenMatchCount:ne,hasMore:le,isFetchingMore:I,fetchMore:_},e[28]=ne,e[29]=v,e[30]=I,e[31]=C,e[32]=$,e[33]=te,e[34]=W,e[35]=le,e[36]=_,e[37]=V,e[38]=X):X=e[38],X}function Ni(t){return t.branches}function Ci(t){const e=B.c(6),s=be(),{releases:r,createRelease:n}=Vs(t.virtualMcpId);let o;return e[0]!==n||e[1]!==t.userId||e[2]!==t.userLabel||e[3]!==r||e[4]!==s?(o=()=>{if(r.length>=$s)return et.error(s("thread.branchPicker.capReached",{max:$s})),null;const d=gn(t.userLabel);return n({branch:d,name:Hr(r,s("thread.branchPicker.defaultVersionName")),color:ds(r.length),createdBy:t.userId,createdAt:new Date().toISOString()}).catch(l=>{et.error(s("thread.branchPicker.saveError"),{description:Pr(s,Sr(l))})}),d},e[0]=n,e[1]=t.userId,e[2]=t.userLabel,e[3]=r,e[4]=s,e[5]=o):o=e[5],o}const Ls="-mx-[3px] h-3.5 w-3.5 shrink-0";function Ai(t){const e=B.c(110),{virtualMcpId:s,isV8:r,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,onChange:m,onCreateBranch:g,onAdoptBranch:x,disabled:P,spawnsNewChat:j,placement:y}=t,S=r===void 0?!1:r,w=l===void 0?!1:l,k=P===void 0?!1:P,N=j===void 0?!1:j,C=y===void 0?"chat":y,v=be(),A=C==="header",[T,I]=q.useState(!1),[M,$]=q.useState(!1),[H,O]=q.useState("branches"),[G,E]=q.useState(null),[W,F]=q.useState(""),[V,te]=q.useState(null),[Y,ne]=q.useState(null),le=q.useRef(null),{releases:_,createRelease:X,renameRelease:D,deleteRelease:Z}=Vs(s);let se;e[0]!==c||e[1]!==n||e[2]!==s?(se={virtualMcpId:s,userLabel:n,userId:c},e[0]=c,e[1]=n,e[2]=s,e[3]=se):se=e[3];const ie=Ci(se),ge=yl(s,S),ue=S?jl(_,ge.data):[],re=ge.refetch,fe=wl(s),{url:ye,setUrl:z,clear:oe}=fn(s),xe=mn(s),Q=S&&!!xe.connection,ee=S?xe.connection?.endpoint??null:ye,ce=!!ee;let J;e[4]!==oe||e[5]!==S||e[6]!==xe?(J=()=>{oe(),S&&xe.clear()},e[4]=oe,e[5]=S,e[6]=xe,e[7]=J):J=e[7];const de=J;let _e;e[8]!==T?(_e={enabled:T},e[8]=T,e[9]=_e):_e=e[9];const{data:mt}=Na(_e);let we;e[10]!==mt?.data?.members?(we=R=>R?mt?.data?.members?.find(pe=>pe.userId===R)?.user?.name??void 0:void 0,e[10]=mt?.data?.members,e[11]=we):we=e[11];const rt=we,Le=_.length>=$s,Re=_.length>1,Te=v("thread.branchPicker.capReached",{max:$s}),{isBase:Ee,current:Ne,storeDraft:at,unlisted:ze}=mi({value:o,baseBranch:d,releases:_,baseIsDraft:w,storeDrafts:ue}),$t=Ee?v("thread.branchPicker.live"):Ne?.name??at?.name??v("thread.branchPicker.defaultVersionName"),Oe=Q?v("thread.branchPicker.localhost.label"):ce?v("thread.branchPicker.localLabel"):o?$t:v("thread.branchPicker.selectVersion"),Qe=Q?"bg-foreground":ce?"bg-special":Ee?"bg-success":at?cs(void 0):cs(Ne?.color??"orange"),L=!Q&&!ce&&!Ee&&Ne?.runtime==="sandbox",me=R=>{de();const pe=ue.some(Ve=>Ve.name===R)?{runtime:"cms"}:_.find(Ve=>Ve.branch===R);m(R,pe&&{runtime:pe.runtime}),I(!1)};let Pe;e[12]!==v?(Pe=R=>{et.error(v("thread.branchPicker.saveError"),{description:Pr(v,Sr(R))})},e[12]=v,e[13]=Pe):Pe=e[13];const Se=Pe;let De;e[14]!==z?(De=R=>{z(R),$(!1),I(!1)},e[14]=z,e[15]=De):De=e[15];const pt=De,bt=(R,pe)=>{if(de(),x){x(R),$(!1),I(!1);return}if(!_.some(Ve=>Ve.branch===R)){if(Le){et.error(Te);return}X({branch:R,name:pe.trim()||R,color:ds(_.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}m(R),$(!1),I(!1)};let lt;e[16]!==de||e[17]!==m||e[18]!==g||e[19]!==ie?(lt=()=>{const R=ie();R&&(de(),(g??m)(R),I(!1))},e[16]=de,e[17]=m,e[18]=g,e[19]=ie,e[20]=lt):lt=e[20];const rs=lt;let gt;e[21]===Symbol.for("react.memo_cache_sentinel")?(gt=()=>{E(null),F(""),$(!1),O("branches")},e[21]=gt):gt=e[21];const as=gt;let it;e[22]===Symbol.for("react.memo_cache_sentinel")?(it=R=>{O(R),$(!0)},e[22]=it):it=e[22];const Ce=it;let ot;e[23]===Symbol.for("react.memo_cache_sentinel")?(ot=R=>{E(R.branch),F(R.name)},e[23]=ot):ot=e[23];const Ft=ot;let xt;e[24]!==W||e[25]!==D||e[26]!==Se?(xt=R=>{const pe=W.trim();pe&&D(R,pe).catch(Se),E(null),F("")},e[24]=W,e[25]=D,e[26]=Se,e[27]=xt):xt=e[27];const Qs=xt,Lt=R=>{const pe=R===void 0?o:R,Ve=W.trim();if(Ve&&pe){if(Le){et.error(Te),E(null),F("");return}X({branch:pe,name:Ve,color:ds(_.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}E(null),F("")};let Je;e[28]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>{E(null),F("")},e[28]=Je):Je=e[28];const ct=Je,kt=()=>{const R=V;if(te(null),!(!R||!Re)){if(R.branch===o){const pe=_.filter(Sa=>Sa.branch!==R.branch),Ve=pe.find(Ri)??pe[0];Ve?me(Ve.branch):I(!1)}else I(!1);Z(R.branch).catch(Se)}},dt=Pl(_),ls=(dt.content.length>0||ue.length>0)&&dt.code.length>0,vt=R=>G===R.branch?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Qs(R.branch),onCancel:ct},R.branch):a.jsx(Zs,{rowRef:!ce&&R.branch===o?le:void 0,dot:cs(R.color),codeIcon:R.runtime==="sandbox"?xs(R.color):void 0,label:R.name,creator:rt(R.createdBy),originTooltip:S?v("thread.branchPicker.viaStudioUi"):void 0,branch:!S||R.runtime==="sandbox"?R.branch:void 0,selected:!ce&&R.branch===o,onSelect:()=>me(R.branch),onRename:()=>Ft(R),onDelete:()=>te(R),deleteBlocked:!Re},R.branch),Nt=()=>{const R=Y;if(ne(null),!(!R||R.name===o&&_.length===0)){if(R.name===o){const pe=_[0];pe?me(pe.branch):I(!1)}fe.mutateAsync(R.name).catch(pe=>{et.error(v("thread.branchPicker.discardStoreDraftError"),{description:pe instanceof Error?pe.message:void 0})})}},Ct=ue.map((R,pe)=>G===R.name?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Lt(R.name),onCancel:ct},`store:${R.name}`):a.jsx(Zs,{rowRef:!ce&&R.name===o?le:void 0,dot:cs(void 0),label:R.name,creator:rt(R.createdBy),agentIcon:xs(ds(pe)),originTooltip:v("thread.branchPicker.storeDraftVia",{via:Sl(R.via)}),selected:!ce&&R.name===o,onSelect:()=>me(R.name),onRename:()=>{E(R.name),F(R.name)},onDelete:()=>ne(R),deleteBlocked:R.name===o&&_.length===0},`store:${R.name}`));let yt;e[29]!==k||e[30]!==S||e[31]!==re?(yt=k?void 0:R=>{R?S&&re():as(),I(R)},e[29]=k,e[30]=S,e[31]=re,e[32]=yt):yt=e[32];const At=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let Ye;e[33]!==At?(Ye=K("shrink min-w-0 max-w-[220px] gap-2",At,Ar),e[33]=At,e[34]=Ye):Ye=e[34];let jt;e[35]!==k?(jt=!k&&a.jsx(Dr,{size:12,className:"opacity-60 shrink-0"}),e[35]=k,e[36]=jt):jt=e[36];let ut;e[37]!==Oe?(ut=a.jsx(nt,{children:Oe}),e[37]=Oe,e[38]=ut):ut=e[38];const Rt=sl,is="w-[min(300px,calc(100vw-2rem))] p-1.5",os="start";let Be;e[39]===Symbol.for("react.memo_cache_sentinel")?(Be=R=>{R.preventDefault(),le.current?.scrollIntoView({block:"nearest"})},e[39]=Be):Be=e[39];let Ie;e[40]!==N||e[41]!==v?(Ie=N&&a.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:v("thread.branchPicker.newChatHint")}),e[40]=N,e[41]=v,e[42]=Ie):Ie=e[42];const Xe=M?a.jsx(Di,{orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,enabled:T,tab:H,onTabChange:O,isV8:S,localUrl:ye,onSaveLocal:pt,onBack:()=>$(!1),onAdopt:bt}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:K("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",S&&"gap-1"),children:[!S&&ce&&ee&&a.jsx(Ti,{rowRef:le,url:ee,onSelect:()=>Ce("local"),onEdit:()=>Ce("local"),onTurnOff:()=>de()}),ze&&o&&(G===o?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Lt(),onCancel:ct}):a.jsx(Zs,{rowRef:ce?void 0:le,dot:cs("orange"),label:v("thread.branchPicker.defaultVersionName"),branch:S?void 0:o,originTooltip:S?v("thread.branchPicker.viaStudioUi"):void 0,selected:!ce,onSelect:()=>me(o),onRename:()=>{E(o),F(Hr(_,v("thread.branchPicker.defaultVersionName")))}})),ls?a.jsxs(a.Fragment,{children:[a.jsx(Vn,{children:v("thread.branchPicker.groupContent")}),dt.content.map(vt),Ct,a.jsx(Vn,{divided:!0,children:v("thread.branchPicker.groupCode")}),dt.code.map(vt)]}):a.jsxs(a.Fragment,{children:[_.map(vt),Ct]}),S&&a.jsx(gi,{virtualMcpId:s,branch:o,serve:xe,rowRef:Q?le:void 0,onPicked:()=>I(!1)})]}),(ze||_.length>0||ue.length>0||S)&&a.jsx("div",{className:"my-1 border-t"}),a.jsxs("button",{type:"button",onClick:()=>{rs()},disabled:Le,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:[a.jsx(Or,{className:"h-4 w-4 shrink-0"}),v("thread.branchPicker.newVersion")]}),Le&&a.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:Te}),a.jsxs("button",{type:"button",onClick:()=>Ce("branches"),className:K("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",S&&"mt-1"),children:[v("thread.branchPicker.advanced"),a.jsx(or,{className:"h-4 w-4 shrink-0"})]})]});let Ue;e[43]!==Rt||e[44]!==Be||e[45]!==Ie||e[46]!==Xe?(Ue=a.jsxs(Rt,{className:is,align:os,onOpenAutoFocus:Be,children:[Ie,Xe]}),e[43]=Rt,e[44]=Be,e[45]=Ie,e[46]=Xe,e[47]=Ue):Ue=e[47];const wt=a.jsxs(nl,{open:T,onOpenChange:yt,children:[a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:"inline-flex min-w-0 shrink",children:a.jsx(rl,{asChild:!0,children:a.jsxs(ve,{"data-tour":el.branchPicker,variant:A?"outline":"ghost",size:A?"sm":"default","aria-label":Oe,disabled:k,className:Ye,children:[L?a.jsx(Br,{className:K(Ls,xs(Ne?.color))}):at&&!ce?a.jsx(cr,{className:K(Ls,xs(ds(ue.indexOf(at))))}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",o||ce?Qe:"bg-muted-foreground")}),a.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:Oe}),jt]})})})}),ut]}),Ue]}),Ze=V!==null;let qe;e[48]===Symbol.for("react.memo_cache_sentinel")?(qe=R=>{R||te(null)},e[48]=qe):qe=e[48];let $e;e[49]!==v?($e=v("thread.branchPicker.deleteTitle"),e[49]=v,e[50]=$e):$e=e[50];let Fe;e[51]!==$e?(Fe=a.jsx(ks,{children:$e}),e[51]=$e,e[52]=Fe):Fe=e[52];let He;e[53]!==V||e[54]!==v?(He=V&&v("thread.branchPicker.deleteConfirm",{name:V.name}),e[53]=V,e[54]=v,e[55]=He):He=e[55];let U;e[56]!==He?(U=a.jsx(Ns,{children:He}),e[56]=He,e[57]=U):U=e[57];let ae;e[58]!==Fe||e[59]!==U?(ae=a.jsxs(Cs,{children:[Fe,U]}),e[58]=Fe,e[59]=U,e[60]=ae):ae=e[60];let he;e[61]!==v?(he=v("thread.branchPicker.cancel"),e[61]=v,e[62]=he):he=e[62];let je;e[63]!==he?(je=a.jsx(As,{children:he}),e[63]=he,e[64]=je):je=e[64];let Ae;e[65]!==v?(Ae=v("thread.branchPicker.delete"),e[65]=v,e[66]=Ae):Ae=e[66];let Ke;e[67]!==kt||e[68]!==Ae?(Ke=a.jsx(Rs,{onClick:kt,variant:"destructive",children:Ae}),e[67]=kt,e[68]=Ae,e[69]=Ke):Ke=e[69];let Ot;e[70]!==je||e[71]!==Ke?(Ot=a.jsxs(Ts,{children:[je,Ke]}),e[70]=je,e[71]=Ke,e[72]=Ot):Ot=e[72];let Mt;e[73]!==ae||e[74]!==Ot?(Mt=a.jsxs(Ds,{children:[ae,Ot]}),e[73]=ae,e[74]=Ot,e[75]=Mt):Mt=e[75];let ps;e[76]!==Ze||e[77]!==Mt?(ps=a.jsx(Bs,{open:Ze,onOpenChange:qe,children:Mt}),e[76]=Ze,e[77]=Mt,e[78]=ps):ps=e[78];const Js=Y!==null;let bs;e[79]===Symbol.for("react.memo_cache_sentinel")?(bs=R=>{R||ne(null)},e[79]=bs):bs=e[79];let _t;e[80]!==v?(_t=v("thread.branchPicker.deleteTitle"),e[80]=v,e[81]=_t):_t=e[81];let Et;e[82]!==_t?(Et=a.jsx(ks,{children:_t}),e[82]=_t,e[83]=Et):Et=e[83];let zt;e[84]!==Y||e[85]!==v?(zt=Y&&v("thread.branchPicker.discardStoreDraftConfirm",{name:Y.name}),e[84]=Y,e[85]=v,e[86]=zt):zt=e[86];let Ut;e[87]!==zt?(Ut=a.jsx(Ns,{children:zt}),e[87]=zt,e[88]=Ut):Ut=e[88];let qt;e[89]!==Et||e[90]!==Ut?(qt=a.jsxs(Cs,{children:[Et,Ut]}),e[89]=Et,e[90]=Ut,e[91]=qt):qt=e[91];let Ht;e[92]!==v?(Ht=v("thread.branchPicker.cancel"),e[92]=v,e[93]=Ht):Ht=e[93];let Kt;e[94]!==Ht?(Kt=a.jsx(As,{children:Ht}),e[94]=Ht,e[95]=Kt):Kt=e[95];let Vt;e[96]!==v?(Vt=v("thread.branchPicker.delete"),e[96]=v,e[97]=Vt):Vt=e[97];let Gt;e[98]!==Nt||e[99]!==Vt?(Gt=a.jsx(Rs,{onClick:Nt,variant:"destructive",children:Vt}),e[98]=Nt,e[99]=Vt,e[100]=Gt):Gt=e[100];let Wt;e[101]!==Kt||e[102]!==Gt?(Wt=a.jsxs(Ts,{children:[Kt,Gt]}),e[101]=Kt,e[102]=Gt,e[103]=Wt):Wt=e[103];let Qt;e[104]!==qt||e[105]!==Wt?(Qt=a.jsxs(Ds,{children:[qt,Wt]}),e[104]=qt,e[105]=Wt,e[106]=Qt):Qt=e[106];let gs;return e[107]!==Js||e[108]!==Qt?(gs=a.jsx(Bs,{open:Js,onOpenChange:bs,children:Qt}),e[107]=Js,e[108]=Qt,e[109]=gs):gs=e[109],a.jsxs(a.Fragment,{children:[wt,ps,gs]})}function Ri(t){return t.runtime!=="sandbox"}function Xs(t){const e=B.c(20),{value:s,onChange:r,onSave:n,onCancel:o}=t,d=be();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==r?(i=f=>r(f.target.value),e[2]=r,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.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=a.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 p;e[14]!==n||e[15]!==h?(p=a.jsx(ve,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=p):p=e[16];let b;return e[17]!==c||e[18]!==p?(b=a.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[c,p]}),e[17]=c,e[18]=p,e[19]=b):b=e[19],b}function Vn(t){const e=B.c(5),{divided:s,children:r}=t,o=(s===void 0?!1:s)&&"mt-1 border-t";let d;e[0]!==o?(d=K("px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",o),e[0]=o,e[1]=d):d=e[1];let l;return e[2]!==r||e[3]!==d?(l=a.jsx("p",{className:d,children:r}),e[2]=r,e[3]=d,e[4]=l):l=e[4],l}function Zs(t){const e=B.c(53),{rowRef:s,dot:r,codeIcon:n,agentIcon:o,originTooltip:d,label:l,creator:i,branch:u,selected:c,onSelect:h,onRename:p,onDelete:b,deleteBlocked:f}=t,m=f===void 0?!1:f,g=be();let x;e[0]!==o||e[1]!==n||e[2]!==r?(x=n?a.jsx(Br,{className:K(Ls,n)}):o?a.jsx(cr,{className:K(Ls,o)}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",r)}),e[0]=o,e[1]=n,e[2]=r,e[3]=x):x=e[3];let P;e[4]!==i?(P=i&&a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:i}),e[4]=i,e[5]=P):P=e[5];let j;e[6]!==l||e[7]!==P?(j=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l,P]}),e[6]=l,e[7]=P,e[8]=j):j=e[8];let y;e[9]!==h||e[10]!==c||e[11]!==x||e[12]!==j?(y=a.jsxs("button",{type:"button","aria-pressed":c,onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[x,j]}),e[9]=h,e[10]=c,e[11]=x,e[12]=j,e[13]=y):y=e[13];const S=y,w=c?"bg-accent":"hover:bg-accent";let k;e[14]!==w?(k=K("group flex items-center rounded-lg",w),e[14]=w,e[15]=k):k=e[15];let N;e[16]!==u||e[17]!==n||e[18]!==d||e[19]!==S||e[20]!==g?(N=u||d?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:S}),a.jsxs(nt,{side:"bottom",className:"text-xs",children:[n&&a.jsx("p",{className:"font-medium",children:g("thread.branchPicker.codeDraftTooltip")}),d&&a.jsx("p",{children:d}),u&&a.jsx("p",{className:"font-mono",children:g("thread.branchPicker.branchTooltip",{branch:u})})]})]}):S,e[16]=u,e[17]=n,e[18]=d,e[19]=S,e[20]=g,e[21]=N):N=e[21];let C;e[22]!==g?(C=g("thread.branchPicker.moreActions"),e[22]=g,e[23]=C):C=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Fr,{className:"h-4 w-4"}),e[24]=v):v=e[24];let A;e[25]!==C?(A=a.jsx(Ms,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon","aria-label":C,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:v})}),e[25]=C,e[26]=A):A=e[26];let T;e[27]===Symbol.for("react.memo_cache_sentinel")?(T=a.jsx(Lr,{className:"h-4 w-4"}),e[27]=T):T=e[27];let I;e[28]!==g?(I=g("thread.branchPicker.rename"),e[28]=g,e[29]=I):I=e[29];let M;e[30]!==p||e[31]!==I?(M=a.jsxs(Xt,{onSelect:p,children:[T,I]}),e[30]=p,e[31]=I,e[32]=M):M=e[32];let $;e[33]!==m||e[34]!==b||e[35]!==g?($=b&&a.jsxs(Xt,{onSelect:b,disabled:m,className:"text-destructive focus:text-destructive",children:[a.jsx(Hs,{className:"h-4 w-4"}),g("thread.branchPicker.delete")]}),e[33]=m,e[34]=b,e[35]=g,e[36]=$):$=e[36];let H;e[37]!==m||e[38]!==b||e[39]!==g?(H=b&&m&&a.jsx("p",{className:"max-w-48 px-2 pb-1.5 text-xs text-muted-foreground",children:g("thread.branchPicker.keepOneDraft")}),e[37]=m,e[38]=b,e[39]=g,e[40]=H):H=e[40];let O;e[41]!==M||e[42]!==$||e[43]!==H?(O=a.jsxs(_s,{align:"end",children:[M,$,H]}),e[41]=M,e[42]=$,e[43]=H,e[44]=O):O=e[44];let G;e[45]!==A||e[46]!==O?(G=a.jsxs(Es,{children:[A,O]}),e[45]=A,e[46]=O,e[47]=G):G=e[47];let E;return e[48]!==s||e[49]!==G||e[50]!==k||e[51]!==N?(E=a.jsxs("div",{ref:s,className:k,children:[N,G]}),e[48]=s,e[49]=G,e[50]=k,e[51]=N,e[52]=E):E=e[52],E}function Ti(t){const e=B.c(40),{rowRef:s,url:r,onSelect:n,onEdit:o,onTurnOff:d}=t,l=be();let i;try{let A;e[0]!==r?(A=new URL(r),e[0]=r,e[1]=A):A=e[1],i=A.host}catch{i=r}const u=i;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.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 p;e[5]!==u?(p=a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=p):p=e[6];let b;e[7]!==h||e[8]!==p?(b=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,p]}),e[7]=h,e[8]=p,e[9]=b):b=e[9];let f;e[10]!==n||e[11]!==b?(f=a.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,b]}),e[10]=n,e[11]=b,e[12]=f):f=e[12];let m;e[13]!==l?(m=l("thread.branchPicker.moreActions"),e[13]=l,e[14]=m):m=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(Fr,{className:"h-4 w-4"}),e[15]=g):g=e[15];let x;e[16]!==m?(x=a.jsx(Ms,{asChild:!0,children:a.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:g})}),e[16]=m,e[17]=x):x=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(Lr,{className:"h-4 w-4"}),e[18]=P):P=e[18];let j;e[19]!==l?(j=l("thread.branchPicker.rename"),e[19]=l,e[20]=j):j=e[20];let y;e[21]!==o||e[22]!==j?(y=a.jsxs(Xt,{onSelect:o,children:[P,j]}),e[21]=o,e[22]=j,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Hs,{className:"h-4 w-4"}),e[24]=S):S=e[24];let w;e[25]!==l?(w=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=w):w=e[26];let k;e[27]!==d||e[28]!==w?(k=a.jsxs(Xt,{onSelect:d,className:"text-destructive focus:text-destructive",children:[S,w]}),e[27]=d,e[28]=w,e[29]=k):k=e[29];let N;e[30]!==y||e[31]!==k?(N=a.jsxs(_s,{align:"end",children:[y,k]}),e[30]=y,e[31]=k,e[32]=N):N=e[32];let C;e[33]!==N||e[34]!==x?(C=a.jsxs(Es,{children:[x,N]}),e[33]=N,e[34]=x,e[35]=C):C=e[35];let v;return e[36]!==s||e[37]!==C||e[38]!==f?(v=a.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[f,C]}),e[36]=s,e[37]=C,e[38]=f,e[39]=v):v=e[39],v}function Di(t){const e=B.c(73),{orgId:s,orgSlug:r,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:u,tab:c,onTabChange:h,isV8:p,localUrl:b,onSaveLocal:f,onBack:m,onAdopt:g}=t,x=be(),[P,j]=q.useState(""),y=c==="branches"?P:"",S=u&&c==="branches";let w;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==l||e[4]!==i||e[5]!==y||e[6]!==S||e[7]!==o||e[8]!==n?(w={orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:y,enabled:S},e[0]=s,e[1]=r,e[2]=d,e[3]=l,e[4]=i,e[5]=y,e[6]=S,e[7]=o,e[8]=n,e[9]=w):w=e[9];const{recent:k,yours:N,others:C,isLoading:v,hasMore:A,isFetchingMore:T,fetchMore:I}=ki(w),M=u&&c==="prs";let $;e[10]!==s||e[11]!==r||e[12]!==d||e[13]!==l||e[14]!==M||e[15]!==o?($={orgId:s,orgSlug:r,target:o,owner:d,repo:l,enabled:M},e[10]=s,e[11]=r,e[12]=d,e[13]=l,e[14]=M,e[15]=o,e[16]=$):$=e[16];const{data:H,isLoading:O}=gl($);let G;if(e[17]!==I||e[18]!==A||e[19]!==T||e[20]!==v||e[21]!==p||e[22]!==b||e[23]!==g||e[24]!==m||e[25]!==f||e[26]!==h||e[27]!==C||e[28]!==d||e[29]!==O||e[30]!==k||e[31]!==l||e[32]!==P||e[33]!==x||e[34]!==H||e[35]!==c||e[36]!==N){const E=H===void 0?[]:H,W=`${d}/${l}`;let F;e[38]!==W?(F=W.toLowerCase(),e[38]=W,e[39]=F):F=e[39];const V=F;let te;e[40]!==V?(te=z=>z.headRepoFullName?.toLowerCase()===V,e[40]=V,e[41]=te):te=e[41];const Y=E.filter(te);let ne;if(e[42]!==C||e[43]!==k||e[44]!==N){const z=new Set;ne=[...k,...N,...C].filter(oe=>z.has(oe.name)?!1:(z.add(oe.name),!0)),e[42]=C,e[43]=k,e[44]=N,e[45]=ne}else ne=e[45];const le=ne;let _;e[46]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(ol,{className:"h-4 w-4 shrink-0"}),e[46]=_):_=e[46];let X;e[47]!==x?(X=x("thread.branchPicker.advancedBack"),e[47]=x,e[48]=X):X=e[48];let D;e[49]!==m||e[50]!==X?(D=a.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:[_,X]}),e[49]=m,e[50]=X,e[51]=D):D=e[51];let Z;e[52]!==h?(Z=z=>{h(z),j("")},e[52]=h,e[53]=Z):Z=e[53];let se;e[54]!==x?(se=x("thread.branchPicker.branchesTab"),e[54]=x,e[55]=se):se=e[55];let ie;e[56]!==se?(ie=a.jsx(Tt,{value:"branches",className:"h-6 px-2.5 text-xs",children:se}),e[56]=se,e[57]=ie):ie=e[57];let ge;e[58]!==x?(ge=x("thread.branchPicker.prsTab"),e[58]=x,e[59]=ge):ge=e[59];let ue;e[60]!==ge?(ue=a.jsx(Tt,{value:"prs",className:"h-6 px-2.5 text-xs",children:ge}),e[60]=ge,e[61]=ue):ue=e[61];let re;e[62]!==p||e[63]!==x?(re=!p&&a.jsx(Tt,{value:"local",className:"h-6 px-2.5 text-xs",children:x("thread.branchPicker.localTab")}),e[62]=p,e[63]=x,e[64]=re):re=e[64];let fe;e[65]!==ie||e[66]!==ue||e[67]!==re?(fe=a.jsxs(Rr,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[ie,ue,re]}),e[65]=ie,e[66]=ue,e[67]=re,e[68]=fe):fe=e[68];let ye;e[69]!==Z||e[70]!==fe||e[71]!==c?(ye=a.jsx(Tr,{className:"px-2 pt-2 pb-1",value:c,onValueChange:Z,children:fe}),e[69]=Z,e[70]=fe,e[71]=c,e[72]=ye):ye=e[72],G=a.jsxs("div",{className:"flex flex-col",children:[D,ye,c==="local"&&!p?a.jsx(bi,{url:b,onSave:f}):a.jsxs(al,{filter:c==="branches"?Bi:void 0,children:[a.jsx(ll,{placeholder:x(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:P,onValueChange:j}),a.jsx(il,{onScroll:z=>{const oe=z.currentTarget;c==="branches"&&oe.scrollHeight-oe.scrollTop-oe.clientHeight<48&&I()},children:c==="branches"?a.jsxs(a.Fragment,{children:[v&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingMore")}),!v&&le.length===0&&a.jsx(En,{children:x("thread.branchPicker.noBranchesFound")}),le.length>0&&a.jsx(zn,{children:le.map(z=>a.jsxs(Un,{value:z.name,className:"cursor-pointer",onSelect:()=>g(z.name,z.name),children:[a.jsx(Ca,{className:"mr-2 h-4 w-4 shrink-0"}),a.jsx("span",{className:"flex-1 truncate",children:z.name})]},z.name))}),A&&a.jsx("div",{className:"p-2",children:a.jsx(ve,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:T,onClick:I,children:x(T?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):a.jsxs(a.Fragment,{children:[O&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingPullRequests")}),!O&&Y.length===0&&a.jsx(En,{children:x("thread.branchPicker.noOpenPullRequests")}),Y.length>0&&a.jsx(zn,{children:Y.map(z=>a.jsxs(Un,{value:`#${z.number} ${z.title} ${z.head}`,className:"cursor-pointer",onSelect:()=>g(z.head,Kn(z.title)),children:[a.jsx(qs,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx("span",{className:"truncate",children:Kn(z.title)}),a.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",z.number," · ",z.head]})]})]},z.number))})]})})]})]}),e[17]=I,e[18]=A,e[19]=T,e[20]=v,e[21]=p,e[22]=b,e[23]=g,e[24]=m,e[25]=f,e[26]=h,e[27]=C,e[28]=d,e[29]=O,e[30]=k,e[31]=l,e[32]=P,e[33]=x,e[34]=H,e[35]=c,e[36]=N,e[37]=G}else G=e[37];return G}function Bi(t,e){return nn(t,e)?1:0}function Ii(t){const e=B.c(19),{locked:s,placement:r,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:p,orgId:b,orgSlug:f,userId:m,target:g,owner:x,repo:P,sandboxMap:j}=t;let y;return e[0]!==i||e[1]!==u||e[2]!==d||e[3]!==s||e[4]!==p||e[5]!==c||e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x||e[10]!==r||e[11]!==P||e[12]!==j||e[13]!==g||e[14]!==m||e[15]!==l||e[16]!==n||e[17]!==o?(y=a.jsx(Ai,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:b,orgSlug:f,userId:m,target:g,owner:x,repo:P,sandboxMap:j,onChange:c,onCreateBranch:h,onAdoptBranch:p,spawnsNewChat:s,placement:r}),e[0]=i,e[1]=u,e[2]=d,e[3]=s,e[4]=p,e[5]=c,e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=r,e[11]=P,e[12]=j,e[13]=g,e[14]=m,e[15]=l,e[16]=n,e[17]=o,e[18]=y):y=e[18],y}function $i(t){const e=B.c(2),{branchPill:s}=t;if(!s)return null;let r;return e[0]!==s?(r=a.jsx(a.Fragment,{children:s}),e[0]=s,e[1]=r):r=e[1],r}function Fi(t){const{locked:e,sessionRuntime:s,projectRuntime:r,draftRuntime:n,current:o}=t;return t.contentOnly&&n==="cms"?s==="cms"&&!e?{kind:"switch"}:{kind:"new-chat",runtime:"cms"}:n==="sandbox"&&s!=="sandbox"?{kind:"new-chat",runtime:"sandbox"}:n==="cms"&&s==="sandbox"&&r==="cms"&&!o?{kind:"new-chat"}:e?s==="sandbox"?{kind:"new-chat",runtime:"sandbox"}:{kind:"new-chat"}:{kind:"switch"}}function Li(t){const e=B.c(25),{virtualMcp:s,currentBranch:r}=t,n=za(),o=ns();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,c=fs(s?.id),h=c.runtime,p=s?.metadata;let b;e[3]!==p?(b=fl(p),e[3]=p,e[4]=b):b=e[4];const f=b,m=f==="cms"&&h==="sandbox",g=ml(s),x=Me(g),{data:P}=zs.useSession(),j=P?.user;let y;e[5]!==j?(y=xn(j),e[5]=j,e[6]=y):y=e[6];const S=y,w=P?.user?.id??"",{org:k}=hs(),N=xl(s,r),C=vn(s?.id),v=C&&h==="cms";let A;e[7]!==u||e[8]!==r||e[9]!==l||e[10]!==f||e[11]!==h||e[12]!==c.resolved||e[13]!==i||e[14]!==C?(A=(E,W)=>{const F=Fi({locked:l,sessionRuntime:c.resolved?h:null,projectRuntime:f,draftRuntime:W&&(W.runtime??f),current:E===r,contentOnly:C});F.kind==="new-chat"&&u?u({branch:E,...F.runtime?{runtime:F.runtime}:{}}):i&&i(E)},e[7]=u,e[8]=r,e[9]=l,e[10]=f,e[11]=h,e[12]=c.resolved,e[13]=i,e[14]=C,e[15]=A):A=e[15];const T=A;let I;e[16]!==m||e[17]!==u||e[18]!==l||e[19]!==i?(I=E=>{(l||m)&&u?u({branch:E}):i&&i(E)},e[16]=m,e[17]=u,e[18]=l,e[19]=i,e[20]=I):I=e[20];const M=I;let $;e[21]!==u?($=u?E=>u({runtime:"sandbox",branch:E}):void 0,e[21]=u,e[22]=$):$=e[22];const H=$,O=g&&Mr(x)?a.jsx(Ii,{userLabel:S,virtualMcpId:s?.id??"",isV8:C,value:r,baseBranch:N,baseIsDraft:v,orgId:k.id,orgSlug:k.slug,userId:w,target:x,owner:g.owner,repo:g.name,sandboxMap:s?.metadata?.sandboxMap,onChange:T,onCreateBranch:M,onAdoptBranch:H,locked:l,placement:"chat"},`${_r(x)}:${g.owner}/${g.name}`):null;let G;return e[23]!==O?(G=a.jsx($i,{branchPill:O}),e[23]=O,e[24]=G):G=e[24],G}const Oi=Aa("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 Mi(t){const e=B.c(11);let s,r,n;e[0]!==t?({className:s,orientation:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let o;e[4]!==s||e[5]!==r?(o=K(Oi({orientation:r}),s),e[4]=s,e[5]=r,e[6]=o):o=e[6];let d;return e[7]!==r||e[8]!==n||e[9]!==o?(d=a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:o,...n}),e[7]=r,e[8]=n,e[9]=o,e[10]=d):d=e[10],d}function _i(t){const e=B.c(14),{item:s}=t;let r;e[0]!==s?(r=()=>{s.onSelect()},e[0]=s,e[1]=r):r=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==r?(n=a.jsxs(Xt,{disabled:s.disabled,onSelect:r,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=r,e[6]=n):n=e[6];const o=n;if(!s.tooltip)return o;let d;e[7]!==o?(d=a.jsx(st,{asChild:!0,children:o}),e[7]=o,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=a.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=a.jsxs(tt,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=i):i=e[13],i}function Xr(t){const e=B.c(20),{label:s,onClick:r,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:u,icon:c,items:h,menuAriaLabel:p,className:b}=t,f=n===void 0?"default":n,m=o===void 0?"default":o,g=d===void 0?!1:d,x=l===void 0?!1:l,P=i===void 0?!1:i,j=(h?.length??0)>0;let y;if(e[0]!==b||e[1]!==g||e[2]!==j||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==x||e[7]!==p||e[8]!==r||e[9]!==P||e[10]!==m||e[11]!==u||e[12]!==f){const S=K(Ar,f==="default"&&"focus-visible:inset-ring-current");let w;e[14]!==c||e[15]!==x?(w=x?a.jsx(Zt,{size:"xs"}):c,e[14]=c,e[15]=x,e[16]=w):w=e[16];const k=a.jsxs(ve,{type:"button",variant:f,size:m,disabled:g,"aria-busy":x||void 0,onClick:x?void 0:r,className:K(S,j&&"rounded-r-none border-r border-current/20"),children:[w,s]}),N=P&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let C;e[17]!==b||e[18]!==N?(C=K(N,b),e[17]=b,e[18]=N,e[19]=C):C=e[19],y=a.jsxs(Mi,{className:C,children:[u?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:K("inline-flex rounded-lg outline-none",S,g&&"cursor-not-allowed"),tabIndex:g?0:void 0,role:g?"button":void 0,"aria-disabled":g||void 0,children:k})}),a.jsx(nt,{children:u})]}):k,j?a.jsxs(Es,{children:[a.jsx(Ms,{asChild:!0,children:a.jsx(ve,{type:"button",variant:f,size:m,"aria-label":p,className:K("has-[>svg]:px-2",S),children:a.jsx(Dr,{className:"size-3.5"})})}),a.jsx(_s,{align:"end",children:h?.map(Ei)})]}):null]}),e[0]=b,e[1]=g,e[2]=j,e[3]=c,e[4]=h,e[5]=s,e[6]=x,e[7]=p,e[8]=r,e[9]=P,e[10]=m,e[11]=u,e[12]=f,e[13]=y}else y=e[13];return y}function Ei(t){return a.jsx(_i,{item:t},t.key)}async function zi(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function Ui(t,e,{hosted:s}){return s&&t!==null?t:e}function qi(t,e){const s=B.c(11),[r,n]=q.useState(null);let o;s[0]!==r||s[1]!==t||s[2]!==e?(o=Ui(r,t,e),s[0]=r,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 Hi({open:t,hosted:e}){return t||e}function Zr(t){return Fl({userName:t?.name,userEmail:t?.email})??void 0}function Gs(t){const e=B.c(18),{state:s,header:r,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let u;e[0]!==r?(u=a.jsx("div",{className:"space-y-0.5 px-4 py-3",children:r}),e[0]=r,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==o?(h=o?a.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 p;e[5]!==n||e[6]!==h?(p=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=p):p=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx("div",{className:"border-t"}),e[8]=b):b=e[8];let f;e[9]!==l?(f=a.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==i||e[14]!==u||e[15]!==p||e[16]!==f?(m=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,c,p,d,b,f]}),e[11]=d,e[12]=s,e[13]=i,e[14]=u,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function us(t){const e=B.c(2),{children:s}=t;let r;return e[0]!==s?(r=a.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]=r):r=e[1],r}function ea(t){const e=B.c(10);let s,r,n;e[0]!==t?({className:r,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let o;e[4]!==r?(o=K("rounded-lg border bg-card px-3 py-2.5",r),e[4]=r,e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==o?(d=a.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function We(t){const e=B.c(4),{className:s}=t;let r;e[0]!==s?(r=K("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=a.jsx("div",{className:r}),e[2]=r,e[3]=n):n=e[3],n}function Dt(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(ea,{children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(We,{className:"size-4 rounded-md"}),a.jsx(We,{className:"h-3 w-24"}),a.jsx(We,{className:"h-2.5 w-16"}),a.jsx(We,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const Ki="secret";function ta(t){return t.kind!=="block"?null:t.namedRule??null}function Vi(t,e){const s=e.find(r=>r&&typeof r=="object");return s?Rl(s.__resolveType):Tl(t)}const Gi=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Rn(t){const e=Gi.exec(t)?.[1];return e?ni(e):null}function Os(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 Wi(t,e){return t===null?"new":e===null?"removed":"edited"}function sa(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 Yt(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t.__resolveType;if(typeof r=="string"&&r.trim()){if(s)return Ra(r);const o=(r.split("/").pop()??r).replace(/\.[jt]sx?$/,"");return sa(o)||o}}return`Section ${e+1}`}function Tn(t){if(dr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Ta(e)?t.section??null:null}const na=6;function Ps(t,e=0){if(e>na||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Ps(n,e+1));const s=t;if(cn(s.__resolveType))return rn(s).flatMap(n=>Ps(n?.value,e+1));const r=Tn(s);return r!==null?Ps(r,e+1):[s]}function rn(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Gn(t){let e=t;for(let s=0;s<na;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;if(cn(r.__resolveType))return r;const n=Tn(r);if(n===null)return null;e=n}return null}function Qi(t,e,s){const r=rn(Gn(t)),n=e?rn(Gn(e)):[],o=e?Array.from({length:Math.max(r.length,n.length)},(i,u)=>u).filter(i=>!Ws(r[i],n[i])):[],l=[...o.map(i=>r[i]??n[i]),...r.filter((i,u)=>!o.includes(u))].flatMap(i=>Ps(i?.value)).map(i=>Yt(i,s,!0));return[...new Set(l)]}function en(t,e,s,r,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(cn(u.__resolveType)){d=!0;break}const c=Tn(u);if(c===null)break;o=c}const l=d?Qi(t,n,e):[];return{name:Yt(d?t:o,e,!0),kind:"section",status:s,fields:r,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function an(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((r,n)=>r&&typeof r=="object"&&!Array.isArray(r)?[{section:r,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const r=s.variants;if(Array.isArray(r))return r.flatMap((n,o)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&dr(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 Wn(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const r=s;return Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{})}return s})}function Ws(t,e){return t===void 0&&e===void 0?!0:Wn(t)===Wn(e)}function St(t,e,s,r=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const d of n){if(d.startsWith("__")||r.has(d))continue;const l=t?t[d]:void 0,i=e?e[d]:void 0;Ws(l,i)||o.push({label:sa(d),path:[...s,d],from:l,to:i})}return o}function Ji(t,e){const s=e.find(r=>r&&typeof r=="object");return s?s.__resolveType===Ol:t===Ml}function Yi(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),r=[];for(const n of St(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?r.push(...St(n.from??{},n.to??{},[o])):r.push(n)}return r}const Xi=new Set(["sections"]);function Dn(t,e,s=!1){const r=t?an(t,s):[],n=e?an(e,s):[],o=[],d=Math.max(r.length,n.length);for(let i=0;i<d;i++){const u=r[i],c=n[i];if(!s){const h=Zi(u,c,i);h&&o.push(h);continue}if(u&&c){if(Ws(u.section,c.section))continue;o.push(en(c.section,i,"edited",St(u.section,c.section,c.basePath),u.section))}else c?o.push(en(c.section,i,"new",[])):u&&o.push(en(u.section,i,"removed",[]))}const l=St(t,e,[],Xi);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function Zi(t,e,s){return t&&e?Ws(t.section,e.section)?null:{name:Yt(e.section,s),kind:"section",status:"edited",fields:St(t.section,e.section,e.basePath)}:e?{name:Yt(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:Yt(t.section,s),kind:"section",status:"removed",fields:[]}:null}function ln(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 eo(t){const e=[],s=[],r=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(Pn(o)){n.push(o);continue}const l=Wi(d.from,d.to),i=Rn(o);if(!i){r.push(ln(o,l));continue}const u=Os(d.from),c=Os(d.to),h=c??u;if(!h){r.push(ln(o,l));continue}const p=Jt(i,h);if(p){e.push({kind:"page",blockKey:i,name:p.name,pagePath:p.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?Dn(u,c):[],fromJson:u,toJson:c});continue}const b=yn(i,h);s.push({kind:"block",blockKey:i,name:Fs(i,h),pagePath:null,isSiteApp:b,status:l,filepaths:[o],sections:l==="edited"?[{name:Fs(i,h),kind:"section",status:"edited",fields:St(u,c,[])}].filter(f=>f.fields.length>0):[],fromJson:u,toJson:c})}return ra({pages:e,blocks:s,other:r,generated:n})}function tn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function ra(t){const{pages:e,blocks:s,other:r,generated:n}=t;return e.sort(tn),s.sort(tn),r.sort(tn),{pages:e,blocks:s,other:r,generated:n,count:e.length+s.length+r.length}}function to(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function aa(t){return t.startsWith("pages-")}function la(t){const{files:e,lookup:s,diff:r}=t,n=[],o=[],d=[],l=[];for(const i of e){const u=i.path;if(Pn(u)){l.push(u);continue}const c=to(i.status),h=Rn(u);if(!h){d.push(ln(u,c));continue}const p=r?.diffs[u],b=Os(p?.from??null),f=Os(p?.to??null),m=ia(s,h),g=m??f??b;if((m?Jt(h,m):null)??(!m&&aa(h))){const j=g?Jt(h,g):null;n.push({kind:"page",blockKey:h,name:j?.name??Vr(h),pagePath:j?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?Dn(b,f):[],fromJson:b,toJson:f??(c==="new"?m:null)});continue}const P=Fs(h,g??{});o.push({kind:"block",blockKey:h,name:P,pagePath:null,isSiteApp:yn(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:P,kind:"section",status:"edited",fields:St(b,f,[])}].filter(j=>j.fields.length>0):[],fromJson:b,toJson:f})}return ra({pages:n,blocks:o,other:d,generated:l})}function ia(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function so(t,e){return t??e}function oa(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const sn=3;function vs(t){if(t.length<=sn)return oa(t);const e=t.length-sn;return`${t.slice(0,sn).join(", ")} and ${e} more`}function no(t,e){if(!e){const r=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return r.length>0?`${t.name} (${r.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(r=>r.kind==="section").flatMap(r=>r.wrapper?r.held??[]:[r.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function ro(t){const e=ta(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function ao(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),r=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${vs(s.map(l=>no(l,!!t.v8)))}`),r.length>0){const l=r.length===1?"page":"pages";e.push(`added the ${vs(r.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${vs(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(ro);if(o.length>0&&e.push(`changed ${vs(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=oa(e);return Ll(d.charAt(0).toUpperCase()+d.slice(1))}function lo(t,e){return t?an(t,e).length:0}function io(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?lo(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const r of t.sections){if(r.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=r.fields.length}return s}const Qn="••••••";function es(t){if(Array.isArray(t))return t.map(es);if(!t||typeof t!="object")return t;const e=t,s={};for(const[r,n]of Object.entries(e))s[r]=es(n);return e.__resolveType===Ki&&"ciphertext"in e&&(s.ciphertext=Qn),Ba(e)&&"encrypted"in e&&(s.encrypted=Qn),s}function Jn(t){return t.map(e=>({...e,from:es(e.from),to:es(e.to)}))}function oo(t){const{changes:e,sides:s,lookup:r,meta:n,hosted:o}=t,d=[],l=[],i=c=>[...new Set((s?.diagnostics??[]).filter(h=>Mn(Da(h.file))===Mn(c)).map(h=>h.side))],u=Object.keys(e).sort((c,h)=>c<h?-1:c>h?1:0);for(const c of u){const h=e[c],p=h.kind==="delete"?"removed":h.baseVersion===null?"new":"edited",b=s?.entries[c],f=b?.before??null,m=b?.after??null,g=ia(r,c),x=g??m??f,P=i(c),j={blockKey:c,status:p,filepaths:[],entry:{name:c,version:h.version},...P.length>0?{unreadable:P}:{},fromJson:es(f),toJson:es(m??(p==="new"?g:null))},y=g?Jt(c,g,n):null,S=!g&&x?Jt(c,x,n):null;if(y??S??(!x&&aa(c))){const v=x?Jt(c,x,n):null;d.push({...j,kind:"page",name:v?.name??Vr(c),pagePath:v?.path??null,isSiteApp:!1,sections:p==="edited"?Dn(f,m,!0).map(A=>({...A,fields:Jn(A.fields)})):[]});continue}const w=o?Cl(c,x,g,m,f):null,k=w?Al(w,[x,g,m,f]):Fs(c,x??{}),N=Vi(c,[g,m,f]),C=Ji(c,[g,m,f]);l.push({...j,kind:"block",name:C?"Settings":k,...C?{cmsSettings:!0}:{},...w?{blogKind:w}:{},...N?{namedRule:N}:{},pagePath:null,isSiteApp:yn(c,g??x??{}),sections:p==="edited"?[{name:C?"Settings":k,kind:"section",status:"edited",fields:Jn(C?Yi(f,m):St(f,m,[]))}].filter(v=>v.fields.length>0):[]})}return{pages:d,blocks:l,other:[],generated:[],count:d.length+l.length,v8:!0}}function ke(t){return t.filepaths[0]??t.blockKey??t.name}function co(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function uo(t,e){const s=t.kind==="block"?Kl:Ir;return a.jsx("span",{title:co(t.status,e),className:"flex shrink-0",children:a.jsx(s,{className:K("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function ho(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return Dl(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=ta(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 fo(t,e,s){const r=io(t,s);if(r.newPageSections!==null)return[r.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:r.newPageSections})];const n=[];return r.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):r.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:r.sections})),r.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):r.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:r.fields})),r.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function ca(t){const e=B.c(46),{change:s,bodyPending:r,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:c,v8:h}=t,p=r===void 0?!1:r,b=h===void 0?!1:h,f=be();let m;e[0]!==s||e[1]!==f?(m=ho(s,f),e[0]=s,e[1]=f,e[2]=m):m=e[2];const g=m;let x;if(e[3]!==p||e[4]!==s||e[5]!==d||e[6]!==g||e[7]!==c||e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==f||e[14]!==b){const P=fo(s,f,b),j=p&&P.length===0&&s.status==="edited",y=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";let S;e[16]!==y?(S=K("cursor-pointer transition-colors hover:bg-accent",y),e[16]=y,e[17]=S):S=e[17];let w;e[18]!==s?(w=ke(s),e[18]=s,e[19]=w):w=e[19];let k;e[20]!==s||e[21]!==f?(k=uo(s,f),e[20]=s,e[21]=f,e[22]=k):k=e[22];let N;e[23]!==s.cmsSettings||e[24]!==s.name||e[25]!==f?(N=s.cmsSettings?f("thread.publishPopover.settings"):s.name,e[23]=s.cmsSettings,e[24]=s.name,e[25]=f,e[26]=N):N=e[26];let C;e[27]!==N?(C=a.jsx("span",{className:"truncate text-sm font-medium",children:N}),e[27]=N,e[28]=C):C=e[28];let v;e[29]!==g?(v=g?a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g}):null,e[29]=g,e[30]=v):v=e[30];let A;e[31]!==n||e[32]!==C||e[33]!==v?(A=a.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[C,v]}),e[31]=n,e[32]=C,e[33]=v,e[34]=A):A=e[34];let T;e[35]!==d||e[36]!==c||e[37]!==u||e[38]!==l||e[39]!==i||e[40]!==f?(T=d?a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:M=>{M.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),a.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:M=>{M.stopPropagation(),l(!1),i?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):i?a.jsx(Us,{children:a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx(ve,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:M=>{M.stopPropagation(),l(!0)},disabled:u||c,children:a.jsx(Hs,{className:"size-3.5"})})}),a.jsx(nt,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=u,e[38]=l,e[39]=i,e[40]=f,e[41]=T):T=e[41];let I;e[42]!==A||e[43]!==T||e[44]!==k?(I=a.jsxs("div",{className:"flex items-center gap-2.5",children:[k,A,T]}),e[42]=A,e[43]=T,e[44]=k,e[45]=I):I=e[45],x=a.jsxs(ea,{className:S,"data-change-id":w,onClick:o,children:[I,P.length>0?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:P.map(mo)}):j?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:a.jsx(We,{className:"h-4 w-2/3"})}):null]}),e[3]=p,e[4]=s,e[5]=d,e[6]=g,e[7]=c,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=f,e[14]=b,e[15]=x}else x=e[15];return x}function mo(t,e){return a.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function da(){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,r]=q.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>r(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 po(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const bo=[{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 Yn(t){const e=B.c(10),{height:s}=t,r=be();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=bo.map(go),e[2]=o):o=e[2];let d;e[3]!==r?(d=r("thread.publishDialog.openingComparison"),e[3]=r,e[4]=d):d=e[4];let l;e[5]!==d?(l=a.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=a.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 go(t,e){return a.jsxs("div",{className:K("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[a.jsx("div",{className:K("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),a.jsx("div",{className:K("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const ua={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},xo={...ua,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function vo(t){const e=B.c(11),{diff:s,emptyMessage:r,rowClassName:n,onDiscardFile:o,hideFileRows:d,editorHeight:l}=t,i=r===void 0?"No file changes in the working tree":r,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=l===void 0?"380px":l,[p,b]=q.useState(null),[f,m]=q.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=po(),e[0]=g):g=e[0];const x=g;if(!s||Object.keys(s.diffs).length===0){let j;return e[1]!==i?(j=a.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=j):j=e[2],j}let P;return e[3]!==s.diffs||e[4]!==f||e[5]!==h||e[6]!==p||e[7]!==c||e[8]!==o||e[9]!==u?(P=a.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(j=>{const[y,S]=j,{from:w,to:k}=S,N=p===y,C=w===null,v=k===null,A=y.startsWith("/")?y.slice(1):y,T=A.lastIndexOf("/"),I=T>=0?A.slice(T+1):A,M=T>=0?A.slice(0,T):null,$=ri(y),H=C?"bg-success":v?"bg-destructive":"bg-warning";return c?a.jsx("div",{children:a.jsx(qn,{original:w??"",modified:k??"",language:$,theme:x,height:h,loading:a.jsx(Yn,{height:h}),options:xo})},y):a.jsxs("div",{children:[a.jsxs("div",{className:K("flex items-center gap-3 py-3 hover:bg-accent",u),children:[a.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:()=>b(N?null:y),children:a.jsx(or,{className:K("h-3.5 w-3.5 transition-transform",N&&"rotate-90")})}),a.jsx("div",{className:K("h-2.5 w-2.5 shrink-0 rounded-full",H)}),a.jsx(Ir,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:I}),M&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:M}),o?a.jsxs(Es,{children:[a.jsx(Ms,{asChild:!0,children:a.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:a.jsx(Ia,{className:"h-3.5 w-3.5"})})}),a.jsx(_s,{align:"end",children:a.jsx(Xt,{className:"text-destructive focus:text-destructive",onSelect:()=>m(y),children:"Discard changes"})})]}):null]}),f===y&&o?a.jsxs("div",{className:K("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[a.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",a.jsx("span",{className:"font-medium",children:I}),"? This cannot be undone."]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),a.jsx(ve,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(y)},children:"Discard"})]})]}):null,N&&a.jsx("div",{className:"border-t",children:a.jsx(qn,{original:w??"",modified:k??"",language:$,theme:x,height:h,loading:a.jsx(Yn,{height:h}),options:ua})})]},y)})}),e[3]=s.diffs,e[4]=f,e[5]=h,e[6]=p,e[7]=c,e[8]=o,e[9]=u,e[10]=P):P=e[10],P}function yo(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&li(e)?t.blockKey:null}function jo(t){return t.kind!=="page"?!0:!t.pagePath||Pt(t.pagePath).length>0}function wo(t,e){try{return Ha(t,Il,e)}catch{return null}}function Po(t,e,s){if(!e)return;const r=Bl(e,t);if(!r)return null;if(Pt(r.path).length===0||s?.path!==r.path)return r.path;const n=jn(r.path,s.params);return Pt(n).length===0?n:r.path}function So(t){return t.sectionKey&&!t.v8?wo(t.previewServerUrl,t.sectionKey):No(t.previewServerUrl,t.path)}function ko(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Pt(s).length===0)return s;if(e?.path!==s)return"";const r=jn(s,e.params);return Pt(r).length===0?r:""}function No(t,e){const s=e.trim();if(!s||Pt(s).length>0)return null;try{const r=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,r);return n.origin===r.origin?n:null}catch{return null}}function Co(t,e){return e?.kind==="pointer"&&e.link?pn(t.toString(),e.link):ha(t,e)}function ha(t,e){if(!e)return null;if(e.kind==="pointer")return pn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Ao(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Ro(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 fa=q.createContext(!0),To=["split","before","after","code"];function Do(t){return To.includes(t)}const ma={desktop:1280,mobile:412};function Bo(t,e){const s=(o,d)=>t.unreadable?.includes(d)?e:o?`${JSON.stringify(o,null,2)}
1
+ import{c as B,b as be,r as q,j as a,B as ve,m as K,K as ss,ak as ka,t as et,fb as Na,ar as or,ej as cr,Y as Xt,c8 as Ca,aG as ks,aH as Ns,aI as Cs,aJ as As,bj as Rs,aK as Ts,aL as Ds,aM as Bs,X as Ms,Z as _s,_ as Es,a as zs,a4 as hs,cy as Aa,h as Zt,fc as dr,fd as cn,bK as Ra,b7 as Ta,bh as Mn,fe as Da,c2 as Ba,al as Ia,I as $a,a7 as Fa,ff as La,V as ur,i as ft,eW as dn,q as hr,J as fr,D as mr,x as pr,v as br,Q as gr,R as xr,fg as Oa,bk as vr,a5 as un,b2 as hn,e as _n,E as Ma,T as _a}from"./index-B1ZvlDM_.js";import{S as Ea}from"./separator-ygeWiuaT.js";import{f as za,u as ns,r as yr,l as jr,c as wr,b as Ua}from"./chat-context-CMznzxL2.js";import{u as Bt,at as qa,au as Pr,av as Sr,c as fn,b as mn,M as pn,aw as Ha,L as Ka,ax as Va,ah as Ga,ay as Wa,l as bn,S as kr,az as Qa,a1 as Nr,G as Ja,aA as Ya,aB as Xa,D as Cr}from"./site-editor-toast-C2KJeS5V.js";import{j as Za,L as el,g as tl}from"./shell-layout-DP2VC2TO.js";import{I as Ar}from"./toolbar-icon-button-qX2Q8Vi7.js";import{b as sl,P as nl,a as rl}from"./popover-Bmr7L36n.js";import{c as tt,T as st,a as nt,b as Us}from"./tooltip-D2vb17oX.js";import{f as al,a as ll,c as il,C as En,e as zn,b as Un}from"./command-CG66jyhm.js";import{T as Tt,a as Rr,c as Tr}from"./tabs-qmDGzXtn.js";import{t as Dr}from"./ChevronUp-CM8EW0Js.js";import{Y as Br,aH as qs,F as ol,a as Ir,aI as cl,b as dl,aJ as $r,M as ul}from"./agent-icon-B9ymJOYy.js";import{a as Fr}from"./SwitchHorizontal01-CStChVS2.js";import{c as Lr,s as Is}from"./Tool01-wiKWLRCc.js";import{s as Or}from"./Plus-BF39I64m.js";import{s as Hs}from"./Trash01-DR_ZbB22.js";import{l as hl,d as fl}from"./thread-intent-BMcVCMdR.js";import{h as Mr,r as _r,g as ml,e as Me,u as Ks,f as Er}from"./repository-binding-CoMozV78.js";import{u as pl}from"./use-debounced-value-Z34m5Fyz.js";import{u as bl}from"./useInfiniteQuery-CvokX1at.js";import{d as gl,b as xl,p as vl,e as zr,g as Ur,h as qr}from"./use-navigate-to-agent-BMQllV2g.js";import{u as Vs,g as gn,n as ds,b as Hr,a as yl,d as jl,e as wl,r as cs,f as Pl,s as Sl,h as xs,c as xn}from"./cms-store-drafts-DAUHqZGa.js";import{a as $s}from"./virtual-mcp-CbvCEWCq.js";import{u as fs}from"./use-voice-input-BJwAU8da.js";import{u as vn}from"./use-blocks-v8-project-Dx_FWHJP.js";import{G as Kr}from"./github-icon-lmZhrKkb.js";import{u as kl,a as Nl}from"./use-fast-preview-draft-url-DSbBc_J-.js";import{a6 as Jt,a7 as Vr,D as Fs,o as yn,a8 as Cl,a9 as Al,G as Rl,aa as Tl,ab as Dl,p as Bl,y as Pt,f as jn,ac as Il}from"./blocks-tab-states-CWrGlMnv.js";import"./index-BrNhih9e.js";import{T as $l}from"./textarea-BYx7yH8o.js";import{i as wn}from"./CheckCircle-Bg_9Wlgi.js";import{n as Fl,s as Ll,C as Ol,a as Ml,b as _l,M as El,c as zl,d as Ul,m as ql,u as Hl}from"./use-cms-publish-actions-DPLfPXzl.js";import{a as Kl,g as Vl}from"./UserSquare-CoAnLSHH.js";import{i as Pn,b as Sn,m as Gl,h as Wl,c as Gr,f as Wr,d as Ql,r as kn,e as Jl,n as Yl,g as Xl,j as Zl,k as ei,l as Nn,o as ti,p as Qr,q as si,s as Cn,t as Ys}from"./sandbox-git-api-DcqI6XE4.js";import{b as ni,g as ri}from"./utils-DfZ0Z1Cp.js";import{i as ai}from"./Monitor01-Cp5O9jEx.js";import{w as An,R as Jr}from"./device-hint-CzI0Cxwe.js";import{w as qn}from"./editor-CozvZeDY.js";import{x as li,C as ii}from"./section-array-field-CP-WbNwo.js";import{s as Yr}from"./save-changes-debug-nBi-n9eV.js";import{u as oi}from"./use-mcp-client-C_baTEme.js";import{u as ci}from"./use-sandbox-events-rlHOSL_u.js";import{b as di,a as ui}from"./sandbox-lifecycle-context-Df97dN_A.js";import{b as hi}from"./agent-capabilities-BOswsmnU.js";import{b as fi}from"./thread-route-BX8g4tw-.js";function mi(t){const{value:e,baseBranch:s,releases:r,baseIsDraft:n=!1,storeDrafts:o=[]}=t,d=!n&&!!e&&e===s,l=r.find(c=>c.branch===e),i=d||l?void 0:o.find(c=>c.name===e),u=!d&&!l&&!i&&!!e;return i?{isBase:d,current:l,storeDraft:i,unlisted:u}:{isBase:d,current:l,unlisted:u}}const pi={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},Hn=1114111;function Kn(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const r=Number.parseInt(s.slice(2),16);return!Number.isFinite(r)||r>Hn?e:String.fromCodePoint(r)}if(s.startsWith("#")){const r=Number.parseInt(s.slice(1),10);return!Number.isFinite(r)||r>Hn?e:String.fromCodePoint(r)}return pi[s]??e}):""}function bi(t){const e=B.c(39),{url:s,onSave:r}=t,n=be(),[o,d]=q.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]!==r||e[3]!==i?(u=()=>r(i?hl(i):null),e[2]=r,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 p;e[7]!==h?(p=a.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=p):p=e[8];let b;e[9]!==n?(b=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=b):b=e[10];let f;e[11]!==n?(f=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=f):f=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=N=>d(N.target.value),e[13]=m):m=e[13];let g;e[14]!==c||e[15]!==i?(g=N=>{N.key==="Enter"&&i&&c()},e[14]=c,e[15]=i,e[16]=g):g=e[16];let x;e[17]!==b||e[18]!==f||e[19]!==g||e[20]!==o?(x=a.jsx("input",{type:"url",inputMode:"url","aria-label":b,placeholder:f,value:o,onChange:m,onKeyDown:g,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=b,e[18]=f,e[19]=g,e[20]=o,e[21]=x):x=e[21];let P;e[22]!==r||e[23]!==n||e[24]!==s?(P=s?a.jsx(ve,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>r(null),children:n("thread.branchPicker.localTurnOff")}):a.jsx("span",{}),e[22]=r,e[23]=n,e[24]=s,e[25]=P):P=e[25];const j=!i;let y;e[26]!==n?(y=n("thread.branchPicker.save"),e[26]=n,e[27]=y):y=e[27];let S;e[28]!==c||e[29]!==j||e[30]!==y?(S=a.jsx(ve,{size:"sm",disabled:j,onClick:c,children:y}),e[28]=c,e[29]=j,e[30]=y,e[31]=S):S=e[31];let w;e[32]!==P||e[33]!==S?(w=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,S]}),e[32]=P,e[33]=S,e[34]=w):w=e[34];let k;return e[35]!==w||e[36]!==p||e[37]!==x?(k=a.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[p,x,w]}),e[35]=w,e[36]=p,e[37]=x,e[38]=k):k=e[38],k}function gi(t){const e=B.c(8),{virtualMcpId:s,branch:r,serve:n,rowRef:o,onPicked:d}=t,l=Bt(s,r),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>xi(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=a.jsx(vi,{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 xi(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??qa})}function vi(t){const e=B.c(19),{rowRef:s,selected:r,connected:n,onSelect:o}=t,d=be(),l=r?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=K("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=a.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=a.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let p;e[7]!==n||e[8]!==d?(p=n&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d("thread.branchPicker.localhost.connected")}),e[7]=n,e[8]=d,e[9]=p):p=e[9];let b;e[10]!==o||e[11]!==r||e[12]!==h||e[13]!==p?(b=a.jsxs("button",{type:"button","aria-pressed":r,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,p]}),e[10]=o,e[11]=r,e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;return e[15]!==s||e[16]!==i||e[17]!==b?(f=a.jsx("div",{ref:s,className:i,children:b}),e[15]=s,e[16]=i,e[17]=b,e[18]=f):f=e[18],f}const yi=10080*60*1e3;function ji({sandboxMap:t,userId:e,rawBranches:s,now:r}){const n=new Map;for(const[h,p]of Object.entries(t??{}))for(const[b,f]of Object.entries(p??{})){let m=n.get(b);m||(m={userIds:new Set,lastActiveAt:0},n.set(b,m)),m.userIds.add(h);for(const g of Object.values(f??{})){const x=g?.createdAt??0;x>m.lastActiveAt&&(m.lastActiveAt=x)}}const o=r-yi,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,p)=>p[1].lastActiveAt-h[1].lastActiveAt).map(([h,p])=>({name:h,source:"recent",contributors:[...p.userIds],lastActiveAt:p.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 wi=100,Pi=50,Si=300;function nn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function ki(t){const e=B.c(39),{orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:u,enabled:c}=t,h=u===void 0?"":u,p=c===void 0?!0:c;let b;e[0]!==h?(b=h.trim(),e[0]=h,e[1]=b):b=e[1];const f=b,m=pl(f,Si);let g;e[2]!==o?(g=Mr(o),e[2]=o,e[3]=g):g=e[3];const x=g,P=f.length>0;let j;e[4]!==m||e[5]!==s||e[6]!==r||e[7]!==l||e[8]!==i||e[9]!==o?(j=ss.githubBranchSearch(s,r,_r(o),l,i,m),e[4]=m,e[5]=s,e[6]=r,e[7]=l,e[8]=i,e[9]=o,e[10]=j):j=e[10];const y=p&&x;let S;e[11]!==m||e[12]!==r||e[13]!==o?(S=D=>{const{pageParam:Z}=D;return ka(r,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?Pi:wi,cursor:Z})},e[11]=m,e[12]=r,e[13]=o,e[14]=S):S=e[14];let w;e[15]!==m?(w=D=>m?void 0:D.nextCursor??void 0,e[15]=m,e[16]=w):w=e[16];let k;e[17]!==j||e[18]!==y||e[19]!==S||e[20]!==w?(k={queryKey:j,enabled:y,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:S,getNextPageParam:w},e[17]=j,e[18]=y,e[19]=S,e[20]=w,e[21]=k):k=e[21];const{data:N,isLoading:C,isError:v,isFetching:A,hasNextPage:T,isFetchingNextPage:I,fetchNextPage:M}=bl(k),$=P&&(m!==f||A),H=(N?.pages??[]).flatMap(Ni),O=Za(6e4),G=ji({sandboxMap:d,userId:n,rawBranches:H,now:O});let E;e[22]!==f?(E=D=>nn(D.name,f),e[22]=f,e[23]=E):E=e[23];const W=G.recent.filter(E);let F;e[24]!==f?(F=D=>nn(D.name,f),e[24]=f,e[25]=F):F=e[25];const V=G.yours.filter(F),te=G.others,Y=N?.pages[0],ne=P&&Y&&!$?Math.max(0,Y.totalCount-Y.branches.length):0,le=!P&&T;let _;e[26]!==M?(_=()=>{M()},e[26]=M,e[27]=_):_=e[27];let X;return e[28]!==ne||e[29]!==v||e[30]!==I||e[31]!==C||e[32]!==$||e[33]!==te||e[34]!==W||e[35]!==le||e[36]!==_||e[37]!==V?(X={recent:W,yours:V,others:te,isLoading:C,isError:v,isSearching:$,hiddenMatchCount:ne,hasMore:le,isFetchingMore:I,fetchMore:_},e[28]=ne,e[29]=v,e[30]=I,e[31]=C,e[32]=$,e[33]=te,e[34]=W,e[35]=le,e[36]=_,e[37]=V,e[38]=X):X=e[38],X}function Ni(t){return t.branches}function Ci(t){const e=B.c(6),s=be(),{releases:r,createRelease:n}=Vs(t.virtualMcpId);let o;return e[0]!==n||e[1]!==t.userId||e[2]!==t.userLabel||e[3]!==r||e[4]!==s?(o=()=>{if(r.length>=$s)return et.error(s("thread.branchPicker.capReached",{max:$s})),null;const d=gn(t.userLabel);return n({branch:d,name:Hr(r,s("thread.branchPicker.defaultVersionName")),color:ds(r.length),createdBy:t.userId,createdAt:new Date().toISOString()}).catch(l=>{et.error(s("thread.branchPicker.saveError"),{description:Pr(s,Sr(l))})}),d},e[0]=n,e[1]=t.userId,e[2]=t.userLabel,e[3]=r,e[4]=s,e[5]=o):o=e[5],o}const Ls="-mx-[3px] h-3.5 w-3.5 shrink-0";function Ai(t){const e=B.c(110),{virtualMcpId:s,isV8:r,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,onChange:m,onCreateBranch:g,onAdoptBranch:x,disabled:P,spawnsNewChat:j,placement:y}=t,S=r===void 0?!1:r,w=l===void 0?!1:l,k=P===void 0?!1:P,N=j===void 0?!1:j,C=y===void 0?"chat":y,v=be(),A=C==="header",[T,I]=q.useState(!1),[M,$]=q.useState(!1),[H,O]=q.useState("branches"),[G,E]=q.useState(null),[W,F]=q.useState(""),[V,te]=q.useState(null),[Y,ne]=q.useState(null),le=q.useRef(null),{releases:_,createRelease:X,renameRelease:D,deleteRelease:Z}=Vs(s);let se;e[0]!==c||e[1]!==n||e[2]!==s?(se={virtualMcpId:s,userLabel:n,userId:c},e[0]=c,e[1]=n,e[2]=s,e[3]=se):se=e[3];const ie=Ci(se),ge=yl(s,S),ue=S?jl(_,ge.data):[],re=ge.refetch,fe=wl(s),{url:ye,setUrl:z,clear:oe}=fn(s),xe=mn(s),Q=S&&!!xe.connection,ee=S?xe.connection?.endpoint??null:ye,ce=!!ee;let J;e[4]!==oe||e[5]!==S||e[6]!==xe?(J=()=>{oe(),S&&xe.clear()},e[4]=oe,e[5]=S,e[6]=xe,e[7]=J):J=e[7];const de=J;let _e;e[8]!==T?(_e={enabled:T},e[8]=T,e[9]=_e):_e=e[9];const{data:mt}=Na(_e);let we;e[10]!==mt?.data?.members?(we=R=>R?mt?.data?.members?.find(pe=>pe.userId===R)?.user?.name??void 0:void 0,e[10]=mt?.data?.members,e[11]=we):we=e[11];const rt=we,Le=_.length>=$s,Re=_.length>1,Te=v("thread.branchPicker.capReached",{max:$s}),{isBase:Ee,current:Ne,storeDraft:at,unlisted:ze}=mi({value:o,baseBranch:d,releases:_,baseIsDraft:w,storeDrafts:ue}),$t=Ee?v("thread.branchPicker.live"):Ne?.name??at?.name??v("thread.branchPicker.defaultVersionName"),Oe=Q?v("thread.branchPicker.localhost.label"):ce?v("thread.branchPicker.localLabel"):o?$t:v("thread.branchPicker.selectVersion"),Qe=Q?"bg-foreground":ce?"bg-special":Ee?"bg-success":at?cs(void 0):cs(Ne?.color??"orange"),L=!Q&&!ce&&!Ee&&Ne?.runtime==="sandbox",me=R=>{de();const pe=ue.some(Ve=>Ve.name===R)?{runtime:"cms"}:_.find(Ve=>Ve.branch===R);m(R,pe&&{runtime:pe.runtime}),I(!1)};let Pe;e[12]!==v?(Pe=R=>{et.error(v("thread.branchPicker.saveError"),{description:Pr(v,Sr(R))})},e[12]=v,e[13]=Pe):Pe=e[13];const Se=Pe;let De;e[14]!==z?(De=R=>{z(R),$(!1),I(!1)},e[14]=z,e[15]=De):De=e[15];const pt=De,bt=(R,pe)=>{if(de(),x){x(R),$(!1),I(!1);return}if(!_.some(Ve=>Ve.branch===R)){if(Le){et.error(Te);return}X({branch:R,name:pe.trim()||R,color:ds(_.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}m(R),$(!1),I(!1)};let lt;e[16]!==de||e[17]!==m||e[18]!==g||e[19]!==ie?(lt=()=>{const R=ie();R&&(de(),(g??m)(R),I(!1))},e[16]=de,e[17]=m,e[18]=g,e[19]=ie,e[20]=lt):lt=e[20];const rs=lt;let gt;e[21]===Symbol.for("react.memo_cache_sentinel")?(gt=()=>{E(null),F(""),$(!1),O("branches")},e[21]=gt):gt=e[21];const as=gt;let it;e[22]===Symbol.for("react.memo_cache_sentinel")?(it=R=>{O(R),$(!0)},e[22]=it):it=e[22];const Ce=it;let ot;e[23]===Symbol.for("react.memo_cache_sentinel")?(ot=R=>{E(R.branch),F(R.name)},e[23]=ot):ot=e[23];const Ft=ot;let xt;e[24]!==W||e[25]!==D||e[26]!==Se?(xt=R=>{const pe=W.trim();pe&&D(R,pe).catch(Se),E(null),F("")},e[24]=W,e[25]=D,e[26]=Se,e[27]=xt):xt=e[27];const Qs=xt,Lt=R=>{const pe=R===void 0?o:R,Ve=W.trim();if(Ve&&pe){if(Le){et.error(Te),E(null),F("");return}X({branch:pe,name:Ve,color:ds(_.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}E(null),F("")};let Je;e[28]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>{E(null),F("")},e[28]=Je):Je=e[28];const ct=Je,kt=()=>{const R=V;if(te(null),!(!R||!Re)){if(R.branch===o){const pe=_.filter(Sa=>Sa.branch!==R.branch),Ve=pe.find(Ri)??pe[0];Ve?me(Ve.branch):I(!1)}else I(!1);Z(R.branch).catch(Se)}},dt=Pl(_),ls=(dt.content.length>0||ue.length>0)&&dt.code.length>0,vt=R=>G===R.branch?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Qs(R.branch),onCancel:ct},R.branch):a.jsx(Zs,{rowRef:!ce&&R.branch===o?le:void 0,dot:cs(R.color),codeIcon:R.runtime==="sandbox"?xs(R.color):void 0,label:R.name,creator:rt(R.createdBy),originTooltip:S?v("thread.branchPicker.viaStudioUi"):void 0,branch:!S||R.runtime==="sandbox"?R.branch:void 0,selected:!ce&&R.branch===o,onSelect:()=>me(R.branch),onRename:()=>Ft(R),onDelete:()=>te(R),deleteBlocked:!Re},R.branch),Nt=()=>{const R=Y;if(ne(null),!(!R||R.name===o&&_.length===0)){if(R.name===o){const pe=_[0];pe?me(pe.branch):I(!1)}fe.mutateAsync(R.name).catch(pe=>{et.error(v("thread.branchPicker.discardStoreDraftError"),{description:pe instanceof Error?pe.message:void 0})})}},Ct=ue.map((R,pe)=>G===R.name?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Lt(R.name),onCancel:ct},`store:${R.name}`):a.jsx(Zs,{rowRef:!ce&&R.name===o?le:void 0,dot:cs(void 0),label:R.name,creator:rt(R.createdBy),agentIcon:xs(ds(pe)),originTooltip:v("thread.branchPicker.storeDraftVia",{via:Sl(R.via)}),selected:!ce&&R.name===o,onSelect:()=>me(R.name),onRename:()=>{E(R.name),F(R.name)},onDelete:()=>ne(R),deleteBlocked:R.name===o&&_.length===0},`store:${R.name}`));let yt;e[29]!==k||e[30]!==S||e[31]!==re?(yt=k?void 0:R=>{R?S&&re():as(),I(R)},e[29]=k,e[30]=S,e[31]=re,e[32]=yt):yt=e[32];const At=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let Ye;e[33]!==At?(Ye=K("shrink min-w-0 max-w-[220px] gap-2",At,Ar),e[33]=At,e[34]=Ye):Ye=e[34];let jt;e[35]!==k?(jt=!k&&a.jsx(Dr,{size:12,className:"opacity-60 shrink-0"}),e[35]=k,e[36]=jt):jt=e[36];let ut;e[37]!==Oe?(ut=a.jsx(nt,{children:Oe}),e[37]=Oe,e[38]=ut):ut=e[38];const Rt=sl,is="w-[min(300px,calc(100vw-2rem))] p-1.5",os="start";let Be;e[39]===Symbol.for("react.memo_cache_sentinel")?(Be=R=>{R.preventDefault(),le.current?.scrollIntoView({block:"nearest"})},e[39]=Be):Be=e[39];let Ie;e[40]!==N||e[41]!==v?(Ie=N&&a.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:v("thread.branchPicker.newChatHint")}),e[40]=N,e[41]=v,e[42]=Ie):Ie=e[42];const Xe=M?a.jsx(Di,{orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,enabled:T,tab:H,onTabChange:O,isV8:S,localUrl:ye,onSaveLocal:pt,onBack:()=>$(!1),onAdopt:bt}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:K("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",S&&"gap-1"),children:[!S&&ce&&ee&&a.jsx(Ti,{rowRef:le,url:ee,onSelect:()=>Ce("local"),onEdit:()=>Ce("local"),onTurnOff:()=>de()}),ze&&o&&(G===o?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Lt(),onCancel:ct}):a.jsx(Zs,{rowRef:ce?void 0:le,dot:cs("orange"),label:v("thread.branchPicker.defaultVersionName"),branch:S?void 0:o,originTooltip:S?v("thread.branchPicker.viaStudioUi"):void 0,selected:!ce,onSelect:()=>me(o),onRename:()=>{E(o),F(Hr(_,v("thread.branchPicker.defaultVersionName")))}})),ls?a.jsxs(a.Fragment,{children:[a.jsx(Vn,{children:v("thread.branchPicker.groupContent")}),dt.content.map(vt),Ct,a.jsx(Vn,{divided:!0,children:v("thread.branchPicker.groupCode")}),dt.code.map(vt)]}):a.jsxs(a.Fragment,{children:[_.map(vt),Ct]}),S&&a.jsx(gi,{virtualMcpId:s,branch:o,serve:xe,rowRef:Q?le:void 0,onPicked:()=>I(!1)})]}),(ze||_.length>0||ue.length>0||S)&&a.jsx("div",{className:"my-1 border-t"}),a.jsxs("button",{type:"button",onClick:()=>{rs()},disabled:Le,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:[a.jsx(Or,{className:"h-4 w-4 shrink-0"}),v("thread.branchPicker.newVersion")]}),Le&&a.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:Te}),a.jsxs("button",{type:"button",onClick:()=>Ce("branches"),className:K("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",S&&"mt-1"),children:[v("thread.branchPicker.advanced"),a.jsx(or,{className:"h-4 w-4 shrink-0"})]})]});let Ue;e[43]!==Rt||e[44]!==Be||e[45]!==Ie||e[46]!==Xe?(Ue=a.jsxs(Rt,{className:is,align:os,onOpenAutoFocus:Be,children:[Ie,Xe]}),e[43]=Rt,e[44]=Be,e[45]=Ie,e[46]=Xe,e[47]=Ue):Ue=e[47];const wt=a.jsxs(nl,{open:T,onOpenChange:yt,children:[a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:"inline-flex min-w-0 shrink",children:a.jsx(rl,{asChild:!0,children:a.jsxs(ve,{"data-tour":el.branchPicker,variant:A?"outline":"ghost",size:A?"sm":"default","aria-label":Oe,disabled:k,className:Ye,children:[L?a.jsx(Br,{className:K(Ls,xs(Ne?.color))}):at&&!ce?a.jsx(cr,{className:K(Ls,xs(ds(ue.indexOf(at))))}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",o||ce?Qe:"bg-muted-foreground")}),a.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:Oe}),jt]})})})}),ut]}),Ue]}),Ze=V!==null;let qe;e[48]===Symbol.for("react.memo_cache_sentinel")?(qe=R=>{R||te(null)},e[48]=qe):qe=e[48];let $e;e[49]!==v?($e=v("thread.branchPicker.deleteTitle"),e[49]=v,e[50]=$e):$e=e[50];let Fe;e[51]!==$e?(Fe=a.jsx(ks,{children:$e}),e[51]=$e,e[52]=Fe):Fe=e[52];let He;e[53]!==V||e[54]!==v?(He=V&&v("thread.branchPicker.deleteConfirm",{name:V.name}),e[53]=V,e[54]=v,e[55]=He):He=e[55];let U;e[56]!==He?(U=a.jsx(Ns,{children:He}),e[56]=He,e[57]=U):U=e[57];let ae;e[58]!==Fe||e[59]!==U?(ae=a.jsxs(Cs,{children:[Fe,U]}),e[58]=Fe,e[59]=U,e[60]=ae):ae=e[60];let he;e[61]!==v?(he=v("thread.branchPicker.cancel"),e[61]=v,e[62]=he):he=e[62];let je;e[63]!==he?(je=a.jsx(As,{children:he}),e[63]=he,e[64]=je):je=e[64];let Ae;e[65]!==v?(Ae=v("thread.branchPicker.delete"),e[65]=v,e[66]=Ae):Ae=e[66];let Ke;e[67]!==kt||e[68]!==Ae?(Ke=a.jsx(Rs,{onClick:kt,variant:"destructive",children:Ae}),e[67]=kt,e[68]=Ae,e[69]=Ke):Ke=e[69];let Ot;e[70]!==je||e[71]!==Ke?(Ot=a.jsxs(Ts,{children:[je,Ke]}),e[70]=je,e[71]=Ke,e[72]=Ot):Ot=e[72];let Mt;e[73]!==ae||e[74]!==Ot?(Mt=a.jsxs(Ds,{children:[ae,Ot]}),e[73]=ae,e[74]=Ot,e[75]=Mt):Mt=e[75];let ps;e[76]!==Ze||e[77]!==Mt?(ps=a.jsx(Bs,{open:Ze,onOpenChange:qe,children:Mt}),e[76]=Ze,e[77]=Mt,e[78]=ps):ps=e[78];const Js=Y!==null;let bs;e[79]===Symbol.for("react.memo_cache_sentinel")?(bs=R=>{R||ne(null)},e[79]=bs):bs=e[79];let _t;e[80]!==v?(_t=v("thread.branchPicker.deleteTitle"),e[80]=v,e[81]=_t):_t=e[81];let Et;e[82]!==_t?(Et=a.jsx(ks,{children:_t}),e[82]=_t,e[83]=Et):Et=e[83];let zt;e[84]!==Y||e[85]!==v?(zt=Y&&v("thread.branchPicker.discardStoreDraftConfirm",{name:Y.name}),e[84]=Y,e[85]=v,e[86]=zt):zt=e[86];let Ut;e[87]!==zt?(Ut=a.jsx(Ns,{children:zt}),e[87]=zt,e[88]=Ut):Ut=e[88];let qt;e[89]!==Et||e[90]!==Ut?(qt=a.jsxs(Cs,{children:[Et,Ut]}),e[89]=Et,e[90]=Ut,e[91]=qt):qt=e[91];let Ht;e[92]!==v?(Ht=v("thread.branchPicker.cancel"),e[92]=v,e[93]=Ht):Ht=e[93];let Kt;e[94]!==Ht?(Kt=a.jsx(As,{children:Ht}),e[94]=Ht,e[95]=Kt):Kt=e[95];let Vt;e[96]!==v?(Vt=v("thread.branchPicker.delete"),e[96]=v,e[97]=Vt):Vt=e[97];let Gt;e[98]!==Nt||e[99]!==Vt?(Gt=a.jsx(Rs,{onClick:Nt,variant:"destructive",children:Vt}),e[98]=Nt,e[99]=Vt,e[100]=Gt):Gt=e[100];let Wt;e[101]!==Kt||e[102]!==Gt?(Wt=a.jsxs(Ts,{children:[Kt,Gt]}),e[101]=Kt,e[102]=Gt,e[103]=Wt):Wt=e[103];let Qt;e[104]!==qt||e[105]!==Wt?(Qt=a.jsxs(Ds,{children:[qt,Wt]}),e[104]=qt,e[105]=Wt,e[106]=Qt):Qt=e[106];let gs;return e[107]!==Js||e[108]!==Qt?(gs=a.jsx(Bs,{open:Js,onOpenChange:bs,children:Qt}),e[107]=Js,e[108]=Qt,e[109]=gs):gs=e[109],a.jsxs(a.Fragment,{children:[wt,ps,gs]})}function Ri(t){return t.runtime!=="sandbox"}function Xs(t){const e=B.c(20),{value:s,onChange:r,onSave:n,onCancel:o}=t,d=be();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==r?(i=f=>r(f.target.value),e[2]=r,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.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=a.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 p;e[14]!==n||e[15]!==h?(p=a.jsx(ve,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=p):p=e[16];let b;return e[17]!==c||e[18]!==p?(b=a.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[c,p]}),e[17]=c,e[18]=p,e[19]=b):b=e[19],b}function Vn(t){const e=B.c(5),{divided:s,children:r}=t,o=(s===void 0?!1:s)&&"mt-1 border-t";let d;e[0]!==o?(d=K("px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",o),e[0]=o,e[1]=d):d=e[1];let l;return e[2]!==r||e[3]!==d?(l=a.jsx("p",{className:d,children:r}),e[2]=r,e[3]=d,e[4]=l):l=e[4],l}function Zs(t){const e=B.c(53),{rowRef:s,dot:r,codeIcon:n,agentIcon:o,originTooltip:d,label:l,creator:i,branch:u,selected:c,onSelect:h,onRename:p,onDelete:b,deleteBlocked:f}=t,m=f===void 0?!1:f,g=be();let x;e[0]!==o||e[1]!==n||e[2]!==r?(x=n?a.jsx(Br,{className:K(Ls,n)}):o?a.jsx(cr,{className:K(Ls,o)}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",r)}),e[0]=o,e[1]=n,e[2]=r,e[3]=x):x=e[3];let P;e[4]!==i?(P=i&&a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:i}),e[4]=i,e[5]=P):P=e[5];let j;e[6]!==l||e[7]!==P?(j=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l,P]}),e[6]=l,e[7]=P,e[8]=j):j=e[8];let y;e[9]!==h||e[10]!==c||e[11]!==x||e[12]!==j?(y=a.jsxs("button",{type:"button","aria-pressed":c,onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[x,j]}),e[9]=h,e[10]=c,e[11]=x,e[12]=j,e[13]=y):y=e[13];const S=y,w=c?"bg-accent":"hover:bg-accent";let k;e[14]!==w?(k=K("group flex items-center rounded-lg",w),e[14]=w,e[15]=k):k=e[15];let N;e[16]!==u||e[17]!==n||e[18]!==d||e[19]!==S||e[20]!==g?(N=u||d?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:S}),a.jsxs(nt,{side:"bottom",className:"text-xs",children:[n&&a.jsx("p",{className:"font-medium",children:g("thread.branchPicker.codeDraftTooltip")}),d&&a.jsx("p",{children:d}),u&&a.jsx("p",{className:"font-mono",children:g("thread.branchPicker.branchTooltip",{branch:u})})]})]}):S,e[16]=u,e[17]=n,e[18]=d,e[19]=S,e[20]=g,e[21]=N):N=e[21];let C;e[22]!==g?(C=g("thread.branchPicker.moreActions"),e[22]=g,e[23]=C):C=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Fr,{className:"h-4 w-4"}),e[24]=v):v=e[24];let A;e[25]!==C?(A=a.jsx(Ms,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon","aria-label":C,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:v})}),e[25]=C,e[26]=A):A=e[26];let T;e[27]===Symbol.for("react.memo_cache_sentinel")?(T=a.jsx(Lr,{className:"h-4 w-4"}),e[27]=T):T=e[27];let I;e[28]!==g?(I=g("thread.branchPicker.rename"),e[28]=g,e[29]=I):I=e[29];let M;e[30]!==p||e[31]!==I?(M=a.jsxs(Xt,{onSelect:p,children:[T,I]}),e[30]=p,e[31]=I,e[32]=M):M=e[32];let $;e[33]!==m||e[34]!==b||e[35]!==g?($=b&&a.jsxs(Xt,{onSelect:b,disabled:m,className:"text-destructive focus:text-destructive",children:[a.jsx(Hs,{className:"h-4 w-4"}),g("thread.branchPicker.delete")]}),e[33]=m,e[34]=b,e[35]=g,e[36]=$):$=e[36];let H;e[37]!==m||e[38]!==b||e[39]!==g?(H=b&&m&&a.jsx("p",{className:"max-w-48 px-2 pb-1.5 text-xs text-muted-foreground",children:g("thread.branchPicker.keepOneDraft")}),e[37]=m,e[38]=b,e[39]=g,e[40]=H):H=e[40];let O;e[41]!==M||e[42]!==$||e[43]!==H?(O=a.jsxs(_s,{align:"end",children:[M,$,H]}),e[41]=M,e[42]=$,e[43]=H,e[44]=O):O=e[44];let G;e[45]!==A||e[46]!==O?(G=a.jsxs(Es,{children:[A,O]}),e[45]=A,e[46]=O,e[47]=G):G=e[47];let E;return e[48]!==s||e[49]!==G||e[50]!==k||e[51]!==N?(E=a.jsxs("div",{ref:s,className:k,children:[N,G]}),e[48]=s,e[49]=G,e[50]=k,e[51]=N,e[52]=E):E=e[52],E}function Ti(t){const e=B.c(40),{rowRef:s,url:r,onSelect:n,onEdit:o,onTurnOff:d}=t,l=be();let i;try{let A;e[0]!==r?(A=new URL(r),e[0]=r,e[1]=A):A=e[1],i=A.host}catch{i=r}const u=i;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.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 p;e[5]!==u?(p=a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=p):p=e[6];let b;e[7]!==h||e[8]!==p?(b=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,p]}),e[7]=h,e[8]=p,e[9]=b):b=e[9];let f;e[10]!==n||e[11]!==b?(f=a.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,b]}),e[10]=n,e[11]=b,e[12]=f):f=e[12];let m;e[13]!==l?(m=l("thread.branchPicker.moreActions"),e[13]=l,e[14]=m):m=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(Fr,{className:"h-4 w-4"}),e[15]=g):g=e[15];let x;e[16]!==m?(x=a.jsx(Ms,{asChild:!0,children:a.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:g})}),e[16]=m,e[17]=x):x=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(Lr,{className:"h-4 w-4"}),e[18]=P):P=e[18];let j;e[19]!==l?(j=l("thread.branchPicker.rename"),e[19]=l,e[20]=j):j=e[20];let y;e[21]!==o||e[22]!==j?(y=a.jsxs(Xt,{onSelect:o,children:[P,j]}),e[21]=o,e[22]=j,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Hs,{className:"h-4 w-4"}),e[24]=S):S=e[24];let w;e[25]!==l?(w=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=w):w=e[26];let k;e[27]!==d||e[28]!==w?(k=a.jsxs(Xt,{onSelect:d,className:"text-destructive focus:text-destructive",children:[S,w]}),e[27]=d,e[28]=w,e[29]=k):k=e[29];let N;e[30]!==y||e[31]!==k?(N=a.jsxs(_s,{align:"end",children:[y,k]}),e[30]=y,e[31]=k,e[32]=N):N=e[32];let C;e[33]!==N||e[34]!==x?(C=a.jsxs(Es,{children:[x,N]}),e[33]=N,e[34]=x,e[35]=C):C=e[35];let v;return e[36]!==s||e[37]!==C||e[38]!==f?(v=a.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[f,C]}),e[36]=s,e[37]=C,e[38]=f,e[39]=v):v=e[39],v}function Di(t){const e=B.c(73),{orgId:s,orgSlug:r,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:u,tab:c,onTabChange:h,isV8:p,localUrl:b,onSaveLocal:f,onBack:m,onAdopt:g}=t,x=be(),[P,j]=q.useState(""),y=c==="branches"?P:"",S=u&&c==="branches";let w;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==l||e[4]!==i||e[5]!==y||e[6]!==S||e[7]!==o||e[8]!==n?(w={orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:y,enabled:S},e[0]=s,e[1]=r,e[2]=d,e[3]=l,e[4]=i,e[5]=y,e[6]=S,e[7]=o,e[8]=n,e[9]=w):w=e[9];const{recent:k,yours:N,others:C,isLoading:v,hasMore:A,isFetchingMore:T,fetchMore:I}=ki(w),M=u&&c==="prs";let $;e[10]!==s||e[11]!==r||e[12]!==d||e[13]!==l||e[14]!==M||e[15]!==o?($={orgId:s,orgSlug:r,target:o,owner:d,repo:l,enabled:M},e[10]=s,e[11]=r,e[12]=d,e[13]=l,e[14]=M,e[15]=o,e[16]=$):$=e[16];const{data:H,isLoading:O}=gl($);let G;if(e[17]!==I||e[18]!==A||e[19]!==T||e[20]!==v||e[21]!==p||e[22]!==b||e[23]!==g||e[24]!==m||e[25]!==f||e[26]!==h||e[27]!==C||e[28]!==d||e[29]!==O||e[30]!==k||e[31]!==l||e[32]!==P||e[33]!==x||e[34]!==H||e[35]!==c||e[36]!==N){const E=H===void 0?[]:H,W=`${d}/${l}`;let F;e[38]!==W?(F=W.toLowerCase(),e[38]=W,e[39]=F):F=e[39];const V=F;let te;e[40]!==V?(te=z=>z.headRepoFullName?.toLowerCase()===V,e[40]=V,e[41]=te):te=e[41];const Y=E.filter(te);let ne;if(e[42]!==C||e[43]!==k||e[44]!==N){const z=new Set;ne=[...k,...N,...C].filter(oe=>z.has(oe.name)?!1:(z.add(oe.name),!0)),e[42]=C,e[43]=k,e[44]=N,e[45]=ne}else ne=e[45];const le=ne;let _;e[46]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(ol,{className:"h-4 w-4 shrink-0"}),e[46]=_):_=e[46];let X;e[47]!==x?(X=x("thread.branchPicker.advancedBack"),e[47]=x,e[48]=X):X=e[48];let D;e[49]!==m||e[50]!==X?(D=a.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:[_,X]}),e[49]=m,e[50]=X,e[51]=D):D=e[51];let Z;e[52]!==h?(Z=z=>{h(z),j("")},e[52]=h,e[53]=Z):Z=e[53];let se;e[54]!==x?(se=x("thread.branchPicker.branchesTab"),e[54]=x,e[55]=se):se=e[55];let ie;e[56]!==se?(ie=a.jsx(Tt,{value:"branches",className:"h-6 px-2.5 text-xs",children:se}),e[56]=se,e[57]=ie):ie=e[57];let ge;e[58]!==x?(ge=x("thread.branchPicker.prsTab"),e[58]=x,e[59]=ge):ge=e[59];let ue;e[60]!==ge?(ue=a.jsx(Tt,{value:"prs",className:"h-6 px-2.5 text-xs",children:ge}),e[60]=ge,e[61]=ue):ue=e[61];let re;e[62]!==p||e[63]!==x?(re=!p&&a.jsx(Tt,{value:"local",className:"h-6 px-2.5 text-xs",children:x("thread.branchPicker.localTab")}),e[62]=p,e[63]=x,e[64]=re):re=e[64];let fe;e[65]!==ie||e[66]!==ue||e[67]!==re?(fe=a.jsxs(Rr,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[ie,ue,re]}),e[65]=ie,e[66]=ue,e[67]=re,e[68]=fe):fe=e[68];let ye;e[69]!==Z||e[70]!==fe||e[71]!==c?(ye=a.jsx(Tr,{className:"px-2 pt-2 pb-1",value:c,onValueChange:Z,children:fe}),e[69]=Z,e[70]=fe,e[71]=c,e[72]=ye):ye=e[72],G=a.jsxs("div",{className:"flex flex-col",children:[D,ye,c==="local"&&!p?a.jsx(bi,{url:b,onSave:f}):a.jsxs(al,{filter:c==="branches"?Bi:void 0,children:[a.jsx(ll,{placeholder:x(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:P,onValueChange:j}),a.jsx(il,{onScroll:z=>{const oe=z.currentTarget;c==="branches"&&oe.scrollHeight-oe.scrollTop-oe.clientHeight<48&&I()},children:c==="branches"?a.jsxs(a.Fragment,{children:[v&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingMore")}),!v&&le.length===0&&a.jsx(En,{children:x("thread.branchPicker.noBranchesFound")}),le.length>0&&a.jsx(zn,{children:le.map(z=>a.jsxs(Un,{value:z.name,className:"cursor-pointer",onSelect:()=>g(z.name,z.name),children:[a.jsx(Ca,{className:"mr-2 h-4 w-4 shrink-0"}),a.jsx("span",{className:"flex-1 truncate",children:z.name})]},z.name))}),A&&a.jsx("div",{className:"p-2",children:a.jsx(ve,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:T,onClick:I,children:x(T?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):a.jsxs(a.Fragment,{children:[O&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingPullRequests")}),!O&&Y.length===0&&a.jsx(En,{children:x("thread.branchPicker.noOpenPullRequests")}),Y.length>0&&a.jsx(zn,{children:Y.map(z=>a.jsxs(Un,{value:`#${z.number} ${z.title} ${z.head}`,className:"cursor-pointer",onSelect:()=>g(z.head,Kn(z.title)),children:[a.jsx(qs,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx("span",{className:"truncate",children:Kn(z.title)}),a.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",z.number," · ",z.head]})]})]},z.number))})]})})]})]}),e[17]=I,e[18]=A,e[19]=T,e[20]=v,e[21]=p,e[22]=b,e[23]=g,e[24]=m,e[25]=f,e[26]=h,e[27]=C,e[28]=d,e[29]=O,e[30]=k,e[31]=l,e[32]=P,e[33]=x,e[34]=H,e[35]=c,e[36]=N,e[37]=G}else G=e[37];return G}function Bi(t,e){return nn(t,e)?1:0}function Ii(t){const e=B.c(19),{locked:s,placement:r,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:p,orgId:b,orgSlug:f,userId:m,target:g,owner:x,repo:P,sandboxMap:j}=t;let y;return e[0]!==i||e[1]!==u||e[2]!==d||e[3]!==s||e[4]!==p||e[5]!==c||e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x||e[10]!==r||e[11]!==P||e[12]!==j||e[13]!==g||e[14]!==m||e[15]!==l||e[16]!==n||e[17]!==o?(y=a.jsx(Ai,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:b,orgSlug:f,userId:m,target:g,owner:x,repo:P,sandboxMap:j,onChange:c,onCreateBranch:h,onAdoptBranch:p,spawnsNewChat:s,placement:r}),e[0]=i,e[1]=u,e[2]=d,e[3]=s,e[4]=p,e[5]=c,e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=r,e[11]=P,e[12]=j,e[13]=g,e[14]=m,e[15]=l,e[16]=n,e[17]=o,e[18]=y):y=e[18],y}function $i(t){const e=B.c(2),{branchPill:s}=t;if(!s)return null;let r;return e[0]!==s?(r=a.jsx(a.Fragment,{children:s}),e[0]=s,e[1]=r):r=e[1],r}function Fi(t){const{locked:e,sessionRuntime:s,projectRuntime:r,draftRuntime:n,current:o}=t;return t.contentOnly&&n==="cms"?s==="cms"&&!e?{kind:"switch"}:{kind:"new-chat",runtime:"cms"}:n==="sandbox"&&s!=="sandbox"?{kind:"new-chat",runtime:"sandbox"}:n==="cms"&&s==="sandbox"&&r==="cms"&&!o?{kind:"new-chat"}:e?s==="sandbox"?{kind:"new-chat",runtime:"sandbox"}:{kind:"new-chat"}:{kind:"switch"}}function Li(t){const e=B.c(25),{virtualMcp:s,currentBranch:r}=t,n=za(),o=ns();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,c=fs(s?.id),h=c.runtime,p=s?.metadata;let b;e[3]!==p?(b=fl(p),e[3]=p,e[4]=b):b=e[4];const f=b,m=f==="cms"&&h==="sandbox",g=ml(s),x=Me(g),{data:P}=zs.useSession(),j=P?.user;let y;e[5]!==j?(y=xn(j),e[5]=j,e[6]=y):y=e[6];const S=y,w=P?.user?.id??"",{org:k}=hs(),N=xl(s,r),C=vn(s?.id),v=C&&h==="cms";let A;e[7]!==u||e[8]!==r||e[9]!==l||e[10]!==f||e[11]!==h||e[12]!==c.resolved||e[13]!==i||e[14]!==C?(A=(E,W)=>{const F=Fi({locked:l,sessionRuntime:c.resolved?h:null,projectRuntime:f,draftRuntime:W&&(W.runtime??f),current:E===r,contentOnly:C});F.kind==="new-chat"&&u?u({branch:E,...F.runtime?{runtime:F.runtime}:{}}):i&&i(E)},e[7]=u,e[8]=r,e[9]=l,e[10]=f,e[11]=h,e[12]=c.resolved,e[13]=i,e[14]=C,e[15]=A):A=e[15];const T=A;let I;e[16]!==m||e[17]!==u||e[18]!==l||e[19]!==i?(I=E=>{(l||m)&&u?u({branch:E}):i&&i(E)},e[16]=m,e[17]=u,e[18]=l,e[19]=i,e[20]=I):I=e[20];const M=I;let $;e[21]!==u?($=u?E=>u({runtime:"sandbox",branch:E}):void 0,e[21]=u,e[22]=$):$=e[22];const H=$,O=g&&Mr(x)?a.jsx(Ii,{userLabel:S,virtualMcpId:s?.id??"",isV8:C,value:r,baseBranch:N,baseIsDraft:v,orgId:k.id,orgSlug:k.slug,userId:w,target:x,owner:g.owner,repo:g.name,sandboxMap:s?.metadata?.sandboxMap,onChange:T,onCreateBranch:M,onAdoptBranch:H,locked:l,placement:"chat"},`${_r(x)}:${g.owner}/${g.name}`):null;let G;return e[23]!==O?(G=a.jsx($i,{branchPill:O}),e[23]=O,e[24]=G):G=e[24],G}const Oi=Aa("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 Mi(t){const e=B.c(11);let s,r,n;e[0]!==t?({className:s,orientation:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let o;e[4]!==s||e[5]!==r?(o=K(Oi({orientation:r}),s),e[4]=s,e[5]=r,e[6]=o):o=e[6];let d;return e[7]!==r||e[8]!==n||e[9]!==o?(d=a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:o,...n}),e[7]=r,e[8]=n,e[9]=o,e[10]=d):d=e[10],d}function _i(t){const e=B.c(14),{item:s}=t;let r;e[0]!==s?(r=()=>{s.onSelect()},e[0]=s,e[1]=r):r=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==r?(n=a.jsxs(Xt,{disabled:s.disabled,onSelect:r,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=r,e[6]=n):n=e[6];const o=n;if(!s.tooltip)return o;let d;e[7]!==o?(d=a.jsx(st,{asChild:!0,children:o}),e[7]=o,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=a.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=a.jsxs(tt,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=i):i=e[13],i}function Xr(t){const e=B.c(20),{label:s,onClick:r,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:u,icon:c,items:h,menuAriaLabel:p,className:b}=t,f=n===void 0?"default":n,m=o===void 0?"default":o,g=d===void 0?!1:d,x=l===void 0?!1:l,P=i===void 0?!1:i,j=(h?.length??0)>0;let y;if(e[0]!==b||e[1]!==g||e[2]!==j||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==x||e[7]!==p||e[8]!==r||e[9]!==P||e[10]!==m||e[11]!==u||e[12]!==f){const S=K(Ar,f==="default"&&"focus-visible:inset-ring-current");let w;e[14]!==c||e[15]!==x?(w=x?a.jsx(Zt,{size:"xs"}):c,e[14]=c,e[15]=x,e[16]=w):w=e[16];const k=a.jsxs(ve,{type:"button",variant:f,size:m,disabled:g,"aria-busy":x||void 0,onClick:x?void 0:r,className:K(S,j&&"rounded-r-none border-r border-current/20"),children:[w,s]}),N=P&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let C;e[17]!==b||e[18]!==N?(C=K(N,b),e[17]=b,e[18]=N,e[19]=C):C=e[19],y=a.jsxs(Mi,{className:C,children:[u?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:K("inline-flex rounded-lg outline-none",S,g&&"cursor-not-allowed"),tabIndex:g?0:void 0,role:g?"button":void 0,"aria-disabled":g||void 0,children:k})}),a.jsx(nt,{children:u})]}):k,j?a.jsxs(Es,{children:[a.jsx(Ms,{asChild:!0,children:a.jsx(ve,{type:"button",variant:f,size:m,"aria-label":p,className:K("has-[>svg]:px-2",S),children:a.jsx(Dr,{className:"size-3.5"})})}),a.jsx(_s,{align:"end",children:h?.map(Ei)})]}):null]}),e[0]=b,e[1]=g,e[2]=j,e[3]=c,e[4]=h,e[5]=s,e[6]=x,e[7]=p,e[8]=r,e[9]=P,e[10]=m,e[11]=u,e[12]=f,e[13]=y}else y=e[13];return y}function Ei(t){return a.jsx(_i,{item:t},t.key)}async function zi(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function Ui(t,e,{hosted:s}){return s&&t!==null?t:e}function qi(t,e){const s=B.c(11),[r,n]=q.useState(null);let o;s[0]!==r||s[1]!==t||s[2]!==e?(o=Ui(r,t,e),s[0]=r,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 Hi({open:t,hosted:e}){return t||e}function Zr(t){return Fl({userName:t?.name,userEmail:t?.email})??void 0}function Gs(t){const e=B.c(18),{state:s,header:r,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let u;e[0]!==r?(u=a.jsx("div",{className:"space-y-0.5 px-4 py-3",children:r}),e[0]=r,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==o?(h=o?a.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 p;e[5]!==n||e[6]!==h?(p=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=p):p=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx("div",{className:"border-t"}),e[8]=b):b=e[8];let f;e[9]!==l?(f=a.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==i||e[14]!==u||e[15]!==p||e[16]!==f?(m=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,c,p,d,b,f]}),e[11]=d,e[12]=s,e[13]=i,e[14]=u,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function us(t){const e=B.c(2),{children:s}=t;let r;return e[0]!==s?(r=a.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]=r):r=e[1],r}function ea(t){const e=B.c(10);let s,r,n;e[0]!==t?({className:r,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let o;e[4]!==r?(o=K("rounded-lg border bg-card px-3 py-2.5",r),e[4]=r,e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==o?(d=a.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function We(t){const e=B.c(4),{className:s}=t;let r;e[0]!==s?(r=K("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=a.jsx("div",{className:r}),e[2]=r,e[3]=n):n=e[3],n}function Dt(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(ea,{children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(We,{className:"size-4 rounded-md"}),a.jsx(We,{className:"h-3 w-24"}),a.jsx(We,{className:"h-2.5 w-16"}),a.jsx(We,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const Ki="secret";function ta(t){return t.kind!=="block"?null:t.namedRule??null}function Vi(t,e){const s=e.find(r=>r&&typeof r=="object");return s?Rl(s.__resolveType):Tl(t)}const Gi=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Rn(t){const e=Gi.exec(t)?.[1];return e?ni(e):null}function Os(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 Wi(t,e){return t===null?"new":e===null?"removed":"edited"}function sa(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 Yt(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t.__resolveType;if(typeof r=="string"&&r.trim()){if(s)return Ra(r);const o=(r.split("/").pop()??r).replace(/\.[jt]sx?$/,"");return sa(o)||o}}return`Section ${e+1}`}function Tn(t){if(dr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Ta(e)?t.section??null:null}const na=6;function Ps(t,e=0){if(e>na||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Ps(n,e+1));const s=t;if(cn(s.__resolveType))return rn(s).flatMap(n=>Ps(n?.value,e+1));const r=Tn(s);return r!==null?Ps(r,e+1):[s]}function rn(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Gn(t){let e=t;for(let s=0;s<na;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;if(cn(r.__resolveType))return r;const n=Tn(r);if(n===null)return null;e=n}return null}function Qi(t,e,s){const r=rn(Gn(t)),n=e?rn(Gn(e)):[],o=e?Array.from({length:Math.max(r.length,n.length)},(i,u)=>u).filter(i=>!Ws(r[i],n[i])):[],l=[...o.map(i=>r[i]??n[i]),...r.filter((i,u)=>!o.includes(u))].flatMap(i=>Ps(i?.value)).map(i=>Yt(i,s,!0));return[...new Set(l)]}function en(t,e,s,r,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(cn(u.__resolveType)){d=!0;break}const c=Tn(u);if(c===null)break;o=c}const l=d?Qi(t,n,e):[];return{name:Yt(d?t:o,e,!0),kind:"section",status:s,fields:r,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function an(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((r,n)=>r&&typeof r=="object"&&!Array.isArray(r)?[{section:r,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const r=s.variants;if(Array.isArray(r))return r.flatMap((n,o)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&dr(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 Wn(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const r=s;return Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{})}return s})}function Ws(t,e){return t===void 0&&e===void 0?!0:Wn(t)===Wn(e)}function St(t,e,s,r=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const d of n){if(d.startsWith("__")||r.has(d))continue;const l=t?t[d]:void 0,i=e?e[d]:void 0;Ws(l,i)||o.push({label:sa(d),path:[...s,d],from:l,to:i})}return o}function Ji(t,e){const s=e.find(r=>r&&typeof r=="object");return s?s.__resolveType===Ol:t===Ml}function Yi(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),r=[];for(const n of St(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?r.push(...St(n.from??{},n.to??{},[o])):r.push(n)}return r}const Xi=new Set(["sections"]);function Dn(t,e,s=!1){const r=t?an(t,s):[],n=e?an(e,s):[],o=[],d=Math.max(r.length,n.length);for(let i=0;i<d;i++){const u=r[i],c=n[i];if(!s){const h=Zi(u,c,i);h&&o.push(h);continue}if(u&&c){if(Ws(u.section,c.section))continue;o.push(en(c.section,i,"edited",St(u.section,c.section,c.basePath),u.section))}else c?o.push(en(c.section,i,"new",[])):u&&o.push(en(u.section,i,"removed",[]))}const l=St(t,e,[],Xi);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function Zi(t,e,s){return t&&e?Ws(t.section,e.section)?null:{name:Yt(e.section,s),kind:"section",status:"edited",fields:St(t.section,e.section,e.basePath)}:e?{name:Yt(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:Yt(t.section,s),kind:"section",status:"removed",fields:[]}:null}function ln(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 eo(t){const e=[],s=[],r=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(Pn(o)){n.push(o);continue}const l=Wi(d.from,d.to),i=Rn(o);if(!i){r.push(ln(o,l));continue}const u=Os(d.from),c=Os(d.to),h=c??u;if(!h){r.push(ln(o,l));continue}const p=Jt(i,h);if(p){e.push({kind:"page",blockKey:i,name:p.name,pagePath:p.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?Dn(u,c):[],fromJson:u,toJson:c});continue}const b=yn(i,h);s.push({kind:"block",blockKey:i,name:Fs(i,h),pagePath:null,isSiteApp:b,status:l,filepaths:[o],sections:l==="edited"?[{name:Fs(i,h),kind:"section",status:"edited",fields:St(u,c,[])}].filter(f=>f.fields.length>0):[],fromJson:u,toJson:c})}return ra({pages:e,blocks:s,other:r,generated:n})}function tn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function ra(t){const{pages:e,blocks:s,other:r,generated:n}=t;return e.sort(tn),s.sort(tn),r.sort(tn),{pages:e,blocks:s,other:r,generated:n,count:e.length+s.length+r.length}}function to(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function aa(t){return t.startsWith("pages-")}function la(t){const{files:e,lookup:s,diff:r}=t,n=[],o=[],d=[],l=[];for(const i of e){const u=i.path;if(Pn(u)){l.push(u);continue}const c=to(i.status),h=Rn(u);if(!h){d.push(ln(u,c));continue}const p=r?.diffs[u],b=Os(p?.from??null),f=Os(p?.to??null),m=ia(s,h),g=m??f??b;if((m?Jt(h,m):null)??(!m&&aa(h))){const j=g?Jt(h,g):null;n.push({kind:"page",blockKey:h,name:j?.name??Vr(h),pagePath:j?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?Dn(b,f):[],fromJson:b,toJson:f??(c==="new"?m:null)});continue}const P=Fs(h,g??{});o.push({kind:"block",blockKey:h,name:P,pagePath:null,isSiteApp:yn(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:P,kind:"section",status:"edited",fields:St(b,f,[])}].filter(j=>j.fields.length>0):[],fromJson:b,toJson:f})}return ra({pages:n,blocks:o,other:d,generated:l})}function ia(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function so(t,e){return t??e}function oa(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const sn=3;function vs(t){if(t.length<=sn)return oa(t);const e=t.length-sn;return`${t.slice(0,sn).join(", ")} and ${e} more`}function no(t,e){if(!e){const r=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return r.length>0?`${t.name} (${r.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(r=>r.kind==="section").flatMap(r=>r.wrapper?r.held??[]:[r.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function ro(t){const e=ta(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function ao(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),r=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${vs(s.map(l=>no(l,!!t.v8)))}`),r.length>0){const l=r.length===1?"page":"pages";e.push(`added the ${vs(r.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${vs(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(ro);if(o.length>0&&e.push(`changed ${vs(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=oa(e);return Ll(d.charAt(0).toUpperCase()+d.slice(1))}function lo(t,e){return t?an(t,e).length:0}function io(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?lo(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const r of t.sections){if(r.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=r.fields.length}return s}const Qn="••••••";function es(t){if(Array.isArray(t))return t.map(es);if(!t||typeof t!="object")return t;const e=t,s={};for(const[r,n]of Object.entries(e))s[r]=es(n);return e.__resolveType===Ki&&"ciphertext"in e&&(s.ciphertext=Qn),Ba(e)&&"encrypted"in e&&(s.encrypted=Qn),s}function Jn(t){return t.map(e=>({...e,from:es(e.from),to:es(e.to)}))}function oo(t){const{changes:e,sides:s,lookup:r,meta:n,hosted:o}=t,d=[],l=[],i=c=>[...new Set((s?.diagnostics??[]).filter(h=>Mn(Da(h.file))===Mn(c)).map(h=>h.side))],u=Object.keys(e).sort((c,h)=>c<h?-1:c>h?1:0);for(const c of u){const h=e[c],p=h.kind==="delete"?"removed":h.baseVersion===null?"new":"edited",b=s?.entries[c],f=b?.before??null,m=b?.after??null,g=ia(r,c),x=g??m??f,P=i(c),j={blockKey:c,status:p,filepaths:[],entry:{name:c,version:h.version},...P.length>0?{unreadable:P}:{},fromJson:es(f),toJson:es(m??(p==="new"?g:null))},y=g?Jt(c,g,n):null,S=!g&&x?Jt(c,x,n):null;if(y??S??(!x&&aa(c))){const v=x?Jt(c,x,n):null;d.push({...j,kind:"page",name:v?.name??Vr(c),pagePath:v?.path??null,isSiteApp:!1,sections:p==="edited"?Dn(f,m,!0).map(A=>({...A,fields:Jn(A.fields)})):[]});continue}const w=o?Cl(c,x,g,m,f):null,k=w?Al(w,[x,g,m,f]):Fs(c,x??{}),N=Vi(c,[g,m,f]),C=Ji(c,[g,m,f]);l.push({...j,kind:"block",name:C?"Settings":k,...C?{cmsSettings:!0}:{},...w?{blogKind:w}:{},...N?{namedRule:N}:{},pagePath:null,isSiteApp:yn(c,g??x??{}),sections:p==="edited"?[{name:C?"Settings":k,kind:"section",status:"edited",fields:Jn(C?Yi(f,m):St(f,m,[]))}].filter(v=>v.fields.length>0):[]})}return{pages:d,blocks:l,other:[],generated:[],count:d.length+l.length,v8:!0}}function ke(t){return t.filepaths[0]??t.blockKey??t.name}function co(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function uo(t,e){const s=t.kind==="block"?Kl:Ir;return a.jsx("span",{title:co(t.status,e),className:"flex shrink-0",children:a.jsx(s,{className:K("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function ho(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return Dl(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=ta(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 fo(t,e,s){const r=io(t,s);if(r.newPageSections!==null)return[r.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:r.newPageSections})];const n=[];return r.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):r.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:r.sections})),r.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):r.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:r.fields})),r.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function ca(t){const e=B.c(46),{change:s,bodyPending:r,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:c,v8:h}=t,p=r===void 0?!1:r,b=h===void 0?!1:h,f=be();let m;e[0]!==s||e[1]!==f?(m=ho(s,f),e[0]=s,e[1]=f,e[2]=m):m=e[2];const g=m;let x;if(e[3]!==p||e[4]!==s||e[5]!==d||e[6]!==g||e[7]!==c||e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==f||e[14]!==b){const P=fo(s,f,b),j=p&&P.length===0&&s.status==="edited",y=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";let S;e[16]!==y?(S=K("cursor-pointer transition-colors hover:bg-accent",y),e[16]=y,e[17]=S):S=e[17];let w;e[18]!==s?(w=ke(s),e[18]=s,e[19]=w):w=e[19];let k;e[20]!==s||e[21]!==f?(k=uo(s,f),e[20]=s,e[21]=f,e[22]=k):k=e[22];let N;e[23]!==s.cmsSettings||e[24]!==s.name||e[25]!==f?(N=s.cmsSettings?f("thread.publishPopover.settings"):s.name,e[23]=s.cmsSettings,e[24]=s.name,e[25]=f,e[26]=N):N=e[26];let C;e[27]!==N?(C=a.jsx("span",{className:"truncate text-sm font-medium",children:N}),e[27]=N,e[28]=C):C=e[28];let v;e[29]!==g?(v=g?a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g}):null,e[29]=g,e[30]=v):v=e[30];let A;e[31]!==n||e[32]!==C||e[33]!==v?(A=a.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[C,v]}),e[31]=n,e[32]=C,e[33]=v,e[34]=A):A=e[34];let T;e[35]!==d||e[36]!==c||e[37]!==u||e[38]!==l||e[39]!==i||e[40]!==f?(T=d?a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:M=>{M.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),a.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:M=>{M.stopPropagation(),l(!1),i?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):i?a.jsx(Us,{children:a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx(ve,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:M=>{M.stopPropagation(),l(!0)},disabled:u||c,children:a.jsx(Hs,{className:"size-3.5"})})}),a.jsx(nt,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=u,e[38]=l,e[39]=i,e[40]=f,e[41]=T):T=e[41];let I;e[42]!==A||e[43]!==T||e[44]!==k?(I=a.jsxs("div",{className:"flex items-center gap-2.5",children:[k,A,T]}),e[42]=A,e[43]=T,e[44]=k,e[45]=I):I=e[45],x=a.jsxs(ea,{className:S,"data-change-id":w,onClick:o,children:[I,P.length>0?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:P.map(mo)}):j?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:a.jsx(We,{className:"h-4 w-2/3"})}):null]}),e[3]=p,e[4]=s,e[5]=d,e[6]=g,e[7]=c,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=f,e[14]=b,e[15]=x}else x=e[15];return x}function mo(t,e){return a.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function da(){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,r]=q.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>r(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 po(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const bo=[{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 Yn(t){const e=B.c(10),{height:s}=t,r=be();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=bo.map(go),e[2]=o):o=e[2];let d;e[3]!==r?(d=r("thread.publishDialog.openingComparison"),e[3]=r,e[4]=d):d=e[4];let l;e[5]!==d?(l=a.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=a.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 go(t,e){return a.jsxs("div",{className:K("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[a.jsx("div",{className:K("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),a.jsx("div",{className:K("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const ua={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},xo={...ua,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function vo(t){const e=B.c(11),{diff:s,emptyMessage:r,rowClassName:n,onDiscardFile:o,hideFileRows:d,editorHeight:l}=t,i=r===void 0?"No file changes in the working tree":r,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=l===void 0?"380px":l,[p,b]=q.useState(null),[f,m]=q.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=po(),e[0]=g):g=e[0];const x=g;if(!s||Object.keys(s.diffs).length===0){let j;return e[1]!==i?(j=a.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=j):j=e[2],j}let P;return e[3]!==s.diffs||e[4]!==f||e[5]!==h||e[6]!==p||e[7]!==c||e[8]!==o||e[9]!==u?(P=a.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(j=>{const[y,S]=j,{from:w,to:k}=S,N=p===y,C=w===null,v=k===null,A=y.startsWith("/")?y.slice(1):y,T=A.lastIndexOf("/"),I=T>=0?A.slice(T+1):A,M=T>=0?A.slice(0,T):null,$=ri(y),H=C?"bg-success":v?"bg-destructive":"bg-warning";return c?a.jsx("div",{children:a.jsx(qn,{original:w??"",modified:k??"",language:$,theme:x,height:h,loading:a.jsx(Yn,{height:h}),options:xo})},y):a.jsxs("div",{children:[a.jsxs("div",{className:K("flex items-center gap-3 py-3 hover:bg-accent",u),children:[a.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:()=>b(N?null:y),children:a.jsx(or,{className:K("h-3.5 w-3.5 transition-transform",N&&"rotate-90")})}),a.jsx("div",{className:K("h-2.5 w-2.5 shrink-0 rounded-full",H)}),a.jsx(Ir,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:I}),M&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:M}),o?a.jsxs(Es,{children:[a.jsx(Ms,{asChild:!0,children:a.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:a.jsx(Ia,{className:"h-3.5 w-3.5"})})}),a.jsx(_s,{align:"end",children:a.jsx(Xt,{className:"text-destructive focus:text-destructive",onSelect:()=>m(y),children:"Discard changes"})})]}):null]}),f===y&&o?a.jsxs("div",{className:K("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[a.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",a.jsx("span",{className:"font-medium",children:I}),"? This cannot be undone."]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),a.jsx(ve,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(y)},children:"Discard"})]})]}):null,N&&a.jsx("div",{className:"border-t",children:a.jsx(qn,{original:w??"",modified:k??"",language:$,theme:x,height:h,loading:a.jsx(Yn,{height:h}),options:ua})})]},y)})}),e[3]=s.diffs,e[4]=f,e[5]=h,e[6]=p,e[7]=c,e[8]=o,e[9]=u,e[10]=P):P=e[10],P}function yo(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&li(e)?t.blockKey:null}function jo(t){return t.kind!=="page"?!0:!t.pagePath||Pt(t.pagePath).length>0}function wo(t,e){try{return Ha(t,Il,e)}catch{return null}}function Po(t,e,s){if(!e)return;const r=Bl(e,t);if(!r)return null;if(Pt(r.path).length===0||s?.path!==r.path)return r.path;const n=jn(r.path,s.params);return Pt(n).length===0?n:r.path}function So(t){return t.sectionKey&&!t.v8?wo(t.previewServerUrl,t.sectionKey):No(t.previewServerUrl,t.path)}function ko(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Pt(s).length===0)return s;if(e?.path!==s)return"";const r=jn(s,e.params);return Pt(r).length===0?r:""}function No(t,e){const s=e.trim();if(!s||Pt(s).length>0)return null;try{const r=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,r);return n.origin===r.origin?n:null}catch{return null}}function Co(t,e){return e?.kind==="pointer"&&e.link?pn(t.toString(),e.link):ha(t,e)}function ha(t,e){if(!e)return null;if(e.kind==="pointer")return pn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Ao(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Ro(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 fa=q.createContext(!0),To=["split","before","after","code"];function Do(t){return To.includes(t)}const ma={desktop:1280,mobile:412};function Bo(t,e){const s=(o,d)=>t.unreadable?.includes(d)?e:o?`${JSON.stringify(o,null,2)}
2
2
  `:null,r=t.status==="new"?null:s(t.fromJson,"before"),n=t.status==="removed"?null:s(t.toJson,"after");return r===null&&n===null?{diffs:{}}:t.status==="edited"&&(r===null||n===null)?{diffs:{}}:{diffs:{[La(t.entry.name)]:{from:r,to:n}}}}function pa(t){const e=B.c(76),{change:s,diff:r,bodyPending:n,previewServerUrl:o,draft:d,lastPage:l,v8:i,onReady:u}=t,c=be(),h=q.use(fa),p=yo(s),b=i?null:p,f=i?p:null,m=f?Po(f,i?.blocks,l):void 0,g=f!==null&&m===null,x=Ao(s.kind,o,d)&&(f===null||typeof m=="string"),[P,j]=q.useState(null),y=x?P??"split":"code",[S,w]=q.useState("desktop"),[k,N]=q.useState(null),C=k??(f?m??"":ko(s,l));let v;e[0]!==s?(v=jo(s),e[0]=s,e[1]=v):v=e[1];const A=v,T=o?So({previewServerUrl:o,sectionKey:p,path:C,v8:!!i}):null,I=T?pn(T.toString(),Ka):null,M=T?ha(T,d):null,$=T?Co(T,d):null;let H;e[2]!==s||e[3]!==r?.diffs||e[4]!==c?(H=s.entry?Bo(s,c("thread.publishCompare.sideUnreadable")):{diffs:Object.fromEntries(s.filepaths.flatMap(J=>{const de=r?.diffs[J];return de?[[J,de]]:[]}))},e[2]=s,e[3]=r?.diffs,e[4]=c,e[5]=H):H=e[5];const O=H;let G;e[6]!==O.diffs?(G=Object.keys(O.diffs),e[6]=O.diffs,e[7]=G):G=e[7];const E=G.length>0;let W;e:{if(b!==null){W=null;break e}if(f!==null){const de=C.trim();if(!de){W=null;break e}W=Pt(de).length>0?c("thread.publishCompare.dynamicHint",{template:de}):c("thread.publishCompare.blockHint",{path:de});break e}if(s.kind!=="page"){let de;e[8]!==c?(de=c("thread.publishCompare.globalHint"),e[8]=c,e[9]=de):de=e[9],W=de;break e}let J;e[10]!==s.pagePath||e[11]!==c?(J=s.pagePath&&Pt(s.pagePath).length>0?c("thread.publishCompare.dynamicHint",{template:s.pagePath}):null,e[10]=s.pagePath,e[11]=c,e[12]=J):J=e[12],W=J}const F=W,V=Ro(s,!!i),[te,Y]=q.useState(Io);let ne;e[13]===Symbol.for("react.memo_cache_sentinel")?(ne=J=>Y(de=>de.has(J)?de:new Set(de).add(J)),e[13]=ne):ne=e[13];const le=ne;let _;e[14]!==i?(_=J=>i?a.jsx(Lo,{...J,onLoaded:le}):a.jsx(Fo,{...J}),e[14]=i,e[15]=_):_=e[15];const X=_,Z=(x?[V.before==="new"?null:I,V.after==="removed"?null:M].flatMap(J=>J?[An(J,S)]:[]):[]).every(J=>te.has(J));let se;e[16]!==u||e[17]!==Z?(se=Z&&u?J=>{J&&u()}:void 0,e[16]=u,e[17]=Z,e[18]=se):se=e[18];const ie=se,ge=V.before==="new"?a.jsx(ys,{icon:a.jsx(Or,{className:"size-5 text-brand"}),title:c("thread.publishCompare.newTitle"),description:c("thread.publishCompare.newDescription")}):X({url:I,device:S,title:c("thread.publishCompare.before"),missing:c("thread.publishCompare.enterPath")}),ue=V.after==="removed"?a.jsx(ys,{icon:a.jsx(Hs,{className:"size-5 text-destructive"}),title:c("thread.publishCompare.removedTitle"),description:c("thread.publishCompare.removedDescription")}):X({url:M,device:S,title:c("thread.publishCompare.after"),missing:c(T?"thread.publishCompare.draftUnavailable":"thread.publishCompare.enterPath")});let re;e[19]!==x||e[20]!==j||e[21]!==h||e[22]!==c||e[23]!==y?(re=x||h?a.jsx(Tr,{value:y,onValueChange:J=>{Do(J)&&j(J)},children:a.jsxs(Rr,{className:"h-8 w-auto",variant:"pill",children:[x?a.jsxs(a.Fragment,{children:[a.jsx(Tt,{value:"split",className:"px-3 text-xs",children:c("thread.publishCompare.sideBySide")}),a.jsx(Tt,{value:"before",className:"px-3 text-xs",children:c("thread.publishCompare.before")}),a.jsx(Tt,{value:"after",className:"px-3 text-xs",children:c("thread.publishCompare.after")})]}):null,h?a.jsx(Tt,{value:"code",className:"px-3 text-xs",children:c("thread.publishCompare.code")}):null]})}):null,e[19]=x,e[20]=j,e[21]=h,e[22]=c,e[23]=y,e[24]=re):re=e[24];let fe;e[25]!==$||e[26]!==x||e[27]!==s.pagePath||e[28]!==S||e[29]!==C||e[30]!==A||e[31]!==b||e[32]!==w||e[33]!==N||e[34]!==c||e[35]!==y?(fe=x&&y!=="code"?a.jsxs(a.Fragment,{children:[b?null:A?a.jsx($a,{value:C,onChange:J=>N(J.target.value),placeholder:s.pagePath??"/","aria-label":c("thread.publishCompare.pathLabel"),className:"h-8 w-56 font-mono text-xs"}):a.jsx("span",{className:"max-w-56 truncate px-1 font-mono text-xs text-muted-foreground",children:C}),a.jsxs("div",{className:"flex items-center rounded-lg border p-0.5",children:[a.jsx(Xn,{active:S==="desktop",label:c("thread.publishCompare.desktop"),onClick:()=>w("desktop"),children:a.jsx(ai,{className:"size-3.5"})}),a.jsx(Xn,{active:S==="mobile",label:c("thread.publishCompare.mobile"),onClick:()=>w("mobile"),children:a.jsx(cl,{className:"size-3.5"})})]}),$?a.jsxs("a",{href:$,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:[a.jsx(Fa,{className:"size-3.5"}),c("thread.publishCompare.openDraft")]}):null]}):null,e[25]=$,e[26]=x,e[27]=s.pagePath,e[28]=S,e[29]=C,e[30]=A,e[31]=b,e[32]=w,e[33]=N,e[34]=c,e[35]=y,e[36]=fe):fe=e[36];let ye;e[37]!==re||e[38]!==fe?(ye=a.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b bg-background px-4 py-2.5 max-md:pr-12",children:[re,fe]}),e[37]=re,e[38]=fe,e[39]=ye):ye=e[39];let z;e[40]!==x||e[41]!==F||e[42]!==y?(z=F&&x&&y!=="code"?a.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:F}):null,e[40]=x,e[41]=F,e[42]=y,e[43]=z):z=e[43];let oe;e[44]!==g||e[45]!==h||e[46]!==c?(oe=g&&h?a.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]=g,e[45]=h,e[46]=c,e[47]=oe):oe=e[47];let xe;e[48]!==o||e[49]!==h||e[50]!==c||e[51]!==f||e[52]!==m||e[53]!==y?(xe=y==="code"&&!h?f!==null&&m===void 0?a.jsx(We,{className:"m-4 h-64 rounded"}):o===null?a.jsx(ys,{icon:a.jsx(Is,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.previewNotReadyTitle"),description:c("thread.publishCompare.draftUnavailable")}):a.jsx(ys,{icon:a.jsx(Is,{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]=f,e[52]=m,e[53]=y,e[54]=xe):xe=e[54];let Q;e[55]!==n||e[56]!==E||e[57]!==O||e[58]!==h||e[59]!==c||e[60]!==y?(Q=y==="code"&&h?a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-width:thin]",children:E?a.jsx(vo,{diff:O,hideFileRows:!0,editorHeight:"70vh"}):n?a.jsx(We,{className:"m-4 h-64 rounded"}):a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:c("thread.publishPopover.detailsUnavailable")})}):null,e[55]=n,e[56]=E,e[57]=O,e[58]=h,e[59]=c,e[60]=y,e[61]=Q):Q=e[61];let ee;e[62]!==ue||e[63]!==ge||e[64]!==x||e[65]!==c||e[66]!==y?(ee=x?a.jsxs("div",{className:K("flex min-h-0 flex-1 gap-3 p-3",y==="code"&&"hidden"),children:[a.jsx(Zn,{label:c("thread.publishCompare.before"),hidden:y==="after",children:ge}),a.jsx(Zn,{label:c("thread.publishCompare.after"),highlight:!0,hidden:y==="before",children:ue})]}):null,e[62]=ue,e[63]=ge,e[64]=x,e[65]=c,e[66]=y,e[67]=ee):ee=e[67];let ce;return e[68]!==ie||e[69]!==ye||e[70]!==z||e[71]!==oe||e[72]!==xe||e[73]!==Q||e[74]!==ee?(ce=a.jsxs("div",{ref:ie,className:"flex min-h-0 min-w-0 flex-1 flex-col bg-muted/40",children:[ye,z,oe,xe,Q,ee]}),e[68]=ie,e[69]=ye,e[70]=z,e[71]=oe,e[72]=xe,e[73]=Q,e[74]=ee,e[75]=ce):ce=e[75],ce}function Io(){return new Set}function Xn(t){const e=B.c(8),{active:s,label:r,onClick:n,children:o}=t,d=s&&"bg-accent text-foreground";let l;e[0]!==d?(l=K("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]!==r||e[5]!==n||e[6]!==l?(i=a.jsx("button",{type:"button","aria-label":r,"aria-pressed":s,title:r,onClick:n,className:l,children:o}),e[2]=s,e[3]=o,e[4]=r,e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function Zn(t){const e=B.c(18),{label:s,highlight:r,hidden:n,children:o}=t,d=r===void 0?!1:r,i=(n===void 0?!1:n)&&"hidden";let u;e[0]!==i?(u=K("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=K("size-1.5 rounded-full bg-muted-foreground/50",c),e[2]=c,e[3]=h):h=e[3];let p;e[4]!==h?(p=a.jsx("span",{className:h}),e[4]=h,e[5]=p):p=e[5];let b;e[6]!==s||e[7]!==p?(b=a.jsxs("div",{className:"flex items-center gap-1.5 px-0.5 text-2xs font-medium text-muted-foreground",children:[p,s]}),e[6]=s,e[7]=p,e[8]=b):b=e[8];const f=d&&"border-brand/60";let m;e[9]!==f?(m=K("relative min-h-0 flex-1 overflow-hidden rounded-lg border bg-background",f),e[9]=f,e[10]=m):m=e[10];let g;e[11]!==o||e[12]!==m?(g=a.jsx("div",{className:m,children:o}),e[11]=o,e[12]=m,e[13]=g):g=e[13];let x;return e[14]!==g||e[15]!==u||e[16]!==b?(x=a.jsxs("div",{className:u,children:[b,g]}),e[14]=g,e[15]=u,e[16]=b,e[17]=x):x=e[17],x}function ys(t){const e=B.c(10),{icon:s,title:r,description:n}=t;let o;e[0]!==s?(o=a.jsx("div",{className:"mb-1",children:s}),e[0]=s,e[1]=o):o=e[1];let d;e[2]!==r?(d=a.jsx("p",{className:"text-sm font-medium",children:r}),e[2]=r,e[3]=d):d=e[3];let l;e[4]!==n?(l=a.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=a.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 $o(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 Fo(t){const e=B.c(24),{url:s,device:r,title:n,missing:o}=t,[d,l]=da(),[i,u]=q.useState(null);if(!s){let w;return e[0]!==o?(w=a.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 c;e[2]!==r||e[3]!==s?(c=An(s,r),e[2]=r,e[3]=s,e[4]=c):c=e[4];const h=c,p=ma[r],b=d.width>0?Math.min(d.width/p,1):1,f=d.width>0?Math.max((d.width-p*b)/2,0):0;let m;e[5]!==h?(m=()=>u(h),e[5]=h,e[6]=m):m=e[6];const g=d.height>0?d.height/b:"100%",x=`scale(${b})`;let P;e[7]!==p||e[8]!==f||e[9]!==g||e[10]!==x?(P={left:f,width:p,height:g,transform:x,transformOrigin:"top left"},e[7]=p,e[8]=f,e[9]=g,e[10]=x,e[11]=P):P=e[11];let j;e[12]!==h||e[13]!==m||e[14]!==P||e[15]!==n?(j=a.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]=j):j=e[16];let y;e[17]!==i||e[18]!==h?(y=i!==h?a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:a.jsx(Zt,{className:"size-5 motion-reduce:animate-none"})}):null,e[17]=i,e[18]=h,e[19]=y):y=e[19];let S;return e[20]!==l||e[21]!==j||e[22]!==y?(S=a.jsxs("div",{ref:l,className:"absolute inset-0",children:[j,y]}),e[20]=l,e[21]=j,e[22]=y,e[23]=S):S=e[23],S}function Lo(t){const e=B.c(21),{url:s,device:r,title:n,missing:o,onLoaded:d}=t,[l,i]=da(),[u,c]=q.useState(null),[h,p]=q.useState(null),b=l.width>0&&l.height>0;b&&(u?.width!==l.width||u?.height!==l.height)&&c(l);const f=b?l:u;if(!s){let S;return e[0]!==o?(S=a.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]=S):S=e[1],S}let m,g,x,P;if(e[2]!==f||e[3]!==r||e[4]!==d||e[5]!==i||e[6]!==h||e[7]!==n||e[8]!==s){const S=An(s,r),w=ma[r];m=h?.src!==S;const k=[...h&&m?[h]:[],{src:S,logicalWidth:w}];g=i,x="absolute inset-0",P=k.map(N=>{const C=N.src===S&&m;return a.jsx("iframe",{src:N.src,title:n,"aria-hidden":C&&h?!0:void 0,sandbox:"allow-scripts allow-same-origin",onLoad:()=>{N.src===S&&(p(N),d?.(N.src))},className:K("absolute top-0 border-0 bg-white",C&&"pointer-events-none opacity-0"),style:$o(f,N.logicalWidth)},N.src)}),e[2]=f,e[3]=r,e[4]=d,e[5]=i,e[6]=h,e[7]=n,e[8]=s,e[9]=m,e[10]=g,e[11]=x,e[12]=P}else m=e[9],g=e[10],x=e[11],P=e[12];let j;e[13]!==m||e[14]!==h?(j=m?h?a.jsx(Zt,{className:"absolute right-2 top-2 size-4 text-muted-foreground motion-reduce:animate-none"}):a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:a.jsx(Zt,{className:"size-5 motion-reduce:animate-none"})}):null,e[13]=m,e[14]=h,e[15]=j):j=e[15];let y;return e[16]!==g||e[17]!==x||e[18]!==P||e[19]!==j?(y=a.jsxs("div",{ref:g,className:x,children:[P,j]}),e[16]=g,e[17]=x,e[18]=P,e[19]=j,e[20]=y):y=e[20],y}const Oo=/^Co-authored-by:\s*([^<\r\n]+?)(?:\s*<[^>\r\n]*>)?\s*$/im;function Mo(t){if(!t)return null;const e=Oo.exec(t)?.[1]?.trim();return e||null}function _o(t){return/\[bot\]$/i.test(t)||/-bot$/i.test(t)}function Eo(t){const e=Mo(t.body);if(e)return e;const s=t.author.trim();return!s||_o(s)?null:s}function zo(t,e,s,r,n,o){return["cms-publish-bodies",t,e,s,r,n,o]}const Uo=6e4;function qo(t,e){return e?null:t.files.map(s=>`${s.index}${s.working_dir} ${s.path}`).sort().join(`
3
3
  `)}function Ho(t,e,s){const r=B.c(6);let n;r[0]!==s||r[1]!==t||r[2]!==e?(n=ss.decofile(`${t}/${e}/${s}`),r[0]=s,r[1]=t,r[2]=e,r[3]=n):n=r[3];let o;r[4]!==n?(o={queryKey:n,queryFn:dn},r[4]=n,r[5]=o):o=r[5];const{data:d}=ft(o);return d}function ba(t){const{orgSlug:e,virtualMcpId:s,branch:r,threadId:n,baseBranch:o,fastPreview:d,recoverSandbox:l}=t,i={orgSlug:e,virtualMcpId:s,branch:r,threadId:n},u=d?{fastPreview:!0}:void 0,c=q.useRef(null),h=async S=>{try{return await S()}catch(w){if(!l||!Gr(w))throw w;return c.current??=l(),await c.current,S()}},p=ur({...Sn(i),queryFn:()=>h(()=>Wr(i))}),b=p.data,f=b.changedFiles??null,m=b.headSha??null,g=f?f.length>0:Gl(b)||Wl(b),x=ft({queryKey:zo(e,s,r,o,m,qo(b,d)),queryFn:()=>h(()=>Ql(i,b,o,u)),enabled:g,staleTime:d?Uo:0,gcTime:d?void 0:0,throwOnError:(S,w)=>!f&&w.state.data===void 0}),P=Ho(e,s,r),j=x.data??null,y=f?la({files:f,lookup:P,diff:j}):eo(j);return{status:b,summary:y,allPaths:f?f.map(S=>S.path):Object.keys(j?.diffs??{}),discardablePaths:d?null:new Set(b.files.map(S=>S.path)),changedFilesTotal:b.changedFilesTotal??y.count,changedFilesTruncated:b.changedFilesTruncated??!1,headSha:m,diff:j,bodiesPending:g&&x.isPending,bodiesFailed:x.isError,cardsPending:!f&&g&&x.isPending,refresh:()=>Promise.all([p.refetch(),d?null:x.refetch()])}}function Ko(t){const e=B.c(4);let s;e[0]!==t?(s=ss.decofile(t),e[0]=t,e[1]=s):s=e[1];let r;e[2]!==s?(r={queryKey:s,queryFn:dn},e[2]=s,e[3]=r):r=e[3];const{data:n}=ft(r);return n}function Vo(t,e){const s=B.c(5);let r;s[0]!==t||s[1]!==e?(r=e?Ga(e,t):ss.liveMeta("","no-scope"),s[0]=t,s[1]=e,s[2]=r):r=s[2];let n;s[3]!==r?(n={queryKey:r,queryFn:dn},s[3]=r,s[4]=n):n=s[4];const{data:o}=ft(n);return o}function Bn(t){const e=B.c(27),{backend:s,cacheKey:r,scope:n}=t,o=hr();let d;e[0]!==r?(d=ss.contentChanges(r),e[0]=r,e[1]=d):d=e[1];let l;e[2]!==s.client||e[3]!==r||e[4]!==o?(l=()=>Wa(o,s.client,r),e[2]=s.client,e[3]=r,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=ur(i),c=u.data,h=Va(s,r,c),p=Ko(r),b=Vo(s,n),f=h.data??null,m=s.source==="github";let g;e[9]!==c.changes||e[10]!==p||e[11]!==b||e[12]!==f||e[13]!==m?(g=oo({changes:c.changes,sides:f,lookup:p,meta:b,hosted:m}),e[9]=c.changes,e[10]=p,e[11]=b,e[12]=f,e[13]=m,e[14]=g):g=e[14];const x=g;let P;e[15]!==c.changes?(P=Object.entries(c.changes).map(Go),e[15]=c.changes,e[16]=P):P=e[16];const j=x.count>0&&h.isPending,y=p??null;let S;e[17]!==u?(S=()=>u.refetch(),e[17]=u,e[18]=S):S=e[18];let w;return e[19]!==c||e[20]!==h.isError||e[21]!==x||e[22]!==P||e[23]!==j||e[24]!==y||e[25]!==S?(w={changes:c,summary:x,entries:P,sidesPending:j,sidesFailed:h.isError,blocks:y,refresh:S},e[19]=c,e[20]=h.isError,e[21]=x,e[22]=P,e[23]=j,e[24]=y,e[25]=S,e[26]=w):w=e[26],w}function Go(t){const[e,s]=t;return{name:e,version:s.version}}function Wo(t){return["smart-review-verdict",t.orgSlug,t.virtualMcpId,t.branch,t.threadId,t.fastPreview?"fast-preview-upstream":"sandbox",t.signature,t.language]}function Qo(t){const e=B.c(27),{orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:u}=t,[c]=fr(),{language:h}=c;let p,b,f;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]!==r){const S=i?kn(i):"";p=u&&!!n&&!!l&&!!i&&S!=="",f=ft,b=Wo({orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,signature:S,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]=r,e[9]=p,e[10]=b,e[11]=f}else p=e[9],b=e[10],f=e[11];let m;e[12]!==n||e[13]!==i||e[14]!==h||e[15]!==s||e[16]!==l||e[17]!==o||e[18]!==r?(m=()=>Jl({orgSlug:s,virtualMcpId:r,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]=r,e[19]=m):m=e[19];let g;e[20]!==p||e[21]!==b||e[22]!==m?(g={queryKey:b,queryFn:m,enabled:p,staleTime:1/0,gcTime:6e5,retry:Jo},e[20]=p,e[21]=b,e[22]=m,e[23]=g):g=e[23];const x=f(g),P=x.data??null,j=p&&x.isFetching&&!x.data;let y;return e[24]!==P||e[25]!==j?(y={verdict:P,loading:j},e[24]=P,e[25]=j,e[26]=y):y=e[26],y}function Jo(t,e){return!Gr(e)&&t<1}function ga(t){const e=B.c(30),{orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,policy:u,judgeEnabled:c,paths:h}=t,p=c===void 0?!0:c,b=h===void 0?null:h;let f;e[0]!==i||e[1]!==p||e[2]!==u?(f=p&&Yl(i,u),e[0]=i,e[1]=p,e[2]=u,e[3]=f):f=e[3];const m=f;let g;e[4]!==n||e[5]!==i||e[6]!==d||e[7]!==m||e[8]!==s||e[9]!==l||e[10]!==o||e[11]!==r?(g={orgSlug:s,virtualMcpId:r,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]=r,e[12]=g):g=e[12];const{verdict:x,loading:P}=Qo(g);if(!i&&b){let w;e[13]!==b||e[14]!==u?(w=Xl(b,u),e[13]=b,e[14]=u,e[15]=w):w=e[15];let k;return e[16]!==w?(k={gate:w,ready:!1},e[16]=w,e[17]=k):k=e[17],k}if(!i){let w;return e[18]===Symbol.for("react.memo_cache_sentinel")?(w={gate:{allowed:!0,reason:null},ready:!1},e[18]=w):w=e[18],w}if(!m){let w;e[19]!==i||e[20]!==u?(w=Zl(i,u),e[19]=i,e[20]=u,e[21]=w):w=e[21];let k;return e[22]!==w?(k={gate:w,ready:!0},e[22]=w,e[23]=k):k=e[23],k}let j;e[24]!==P||e[25]!==x?(j=ei(x,P),e[24]=P,e[25]=x,e[26]=j):j=e[26];const y=!P;let S;return e[27]!==j||e[28]!==y?(S={gate:j,ready:y},e[27]=j,e[28]=y,e[29]=S):S=e[29],S}function Yo(t){return["main","master"].includes(t.trim().toLowerCase())}function Xo(t,e,s,r){return t===0?r("thread.publishPopover.publish"):s||!Yo(e)?t===1?r("thread.publishPopover.publishOne"):r("thread.publishPopover.publishCount",{count:t}):t===1?r("thread.publishPopover.publishOneInProduction"):r("thread.publishPopover.publishCountInProduction",{count:t})}const Zo=2500;function ec(t){const{selectedId:e,readyIds:s,lastShownId:r,liveIds:n}=t;return e===null||s.has(e)?e:r!==null&&r!==e&&n.includes(r)?r:e}function xa(t){const e=B.c(16),s=q.useRef(!1),r=be();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]!==r?(d=t.mode==="review"?r("thread.publishPopover.submitForReview"):r("thread.publishPopover.publish"),e[2]=t.mode,e[3]=r,e[4]=d):d=e[4];let l;e[5]!==d?(l=a.jsx(pr,{className:"sr-only",children:d}),e[5]=d,e[6]=l):l=e[6];let i;e[7]!==t?(i=a.jsx(tc,{...t,publishLockRef:s}),e[7]=t,e[8]=i):i=e[8];let u;e[9]!==l||e[10]!==i?(u=a.jsxs(br,{"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=a.jsx(mr,{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 tc(t){const e=B.c(3),s=Bt(t.virtualMcpId,t.branch),r=s.kind==="protocol"&&s.source==="github";let n;return e[0]!==r||e[1]!==t?(n=Hi({open:t.open,hosted:r})?a.jsx(rc,{...t}):null,e[0]=r,e[1]=t,e[2]=n):n=e[2],n}const sc=4,ts="flex h-[45%] min-h-0 min-w-0 shrink-0 md:h-auto md:flex-1";function ms(t){const e=B.c(5),{list:s,pane:r}=t;let n;e[0]!==s?(n=a.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]!==r||e[3]!==n?(o=a.jsxs(a.Fragment,{children:[r,n]}),e[2]=r,e[3]=n,e[4]=o):o=e[4],o}function In(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:K(ts,"bg-muted/40 p-3"),children:a.jsx(We,{className:"h-full w-full rounded-lg"})}),t[0]=e):e=t[0],e}function $n(t){const e=B.c(11),{mode:s,title:r,subLine:n,trailing:o}=t,d=s==="review"?qs:dl;let l;e[0]!==d?(l=a.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]!==r||e[4]!==o?(i=a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l,r,o]}),e[2]=l,e[3]=r,e[4]=o,e[5]=i):i=e[5];let u;e[6]!==n?(u=n?a.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=a.jsxs(a.Fragment,{children:[i,u]}),e[8]=i,e[9]=u,e[10]=c):c=e[10],c}function Fn(t){const e=B.c(9),{draftPreviewUrl:s,t:r}=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=a.jsx(Is,{className:"size-4"}),e[2]=d):d=e[2];let l;e[3]!==r?(l=r("thread.publishPopover.preview"),e[3]=r,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==o||e[7]!==l?(i=a.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 va(t){const e=B.c(21),{mode:s,draftPreviewUrl:r}=t,n=be();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(In,{}),e[0]=o):o=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(We,{className:"h-3.5 w-48"}),e[1]=d):d=e[1];let l;e[2]!==s?(l=a.jsx($n,{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=a.jsx(us,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Dt,{}),a.jsx(Dt,{}),a.jsx(Dt,{})]})}),u=a.jsxs(a.Fragment,{children:[a.jsx(We,{className:"h-3 w-20"}),a.jsx(We,{className:"h-14 w-full rounded-lg"})]}),e[4]=i,e[5]=u):(i=e[4],u=e[5]);let c;e[6]!==r||e[7]!==n?(c=a.jsx(Fn,{draftPreviewUrl:r,t:n}),e[6]=r,e[7]=n,e[8]=c):c=e[8];const h=s==="review"?"default":"brand";let p;e[9]!==s||e[10]!==n?(p=n(s==="review"?"thread.publishPopover.submitForReview":"thread.publishPopover.publish"),e[9]=s,e[10]=n,e[11]=p):p=e[11];let b;e[12]!==h||e[13]!==p?(b=a.jsx(ve,{type:"button",variant:h,className:"flex-1",disabled:!0,children:p}),e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;e[15]!==c||e[16]!==b?(f=a.jsxs("div",{className:"flex gap-2",children:[c,b]}),e[15]=c,e[16]=b,e[17]=f):f=e[17];let m;return e[18]!==f||e[19]!==l?(m=a.jsx(ms,{pane:o,list:a.jsx(Gs,{state:"loading",header:l,body:i,note:u,footer:f})}),e[18]=f,e[19]=l,e[20]=m):m=e[20],m}function nc(t){const e=B.c(26),{mode:s,draftPreviewUrl:r,message:n,onRetry:o}=t,d=be();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("div",{className:K(ts,"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=a.jsx("span",{className:"truncate",children:i}),e[3]=i,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==u?(c=a.jsx($n,{mode:s,title:u}),e[5]=s,e[6]=u,e[7]=c):c=e[7];let h;e[8]!==n?(h=a.jsx("p",{className:"px-4 py-6 text-xs text-destructive",children:n}),e[8]=n,e[9]=h):h=e[9];let p;e[10]!==r||e[11]!==d?(p=a.jsx(Fn,{draftPreviewUrl:r,t:d}),e[10]=r,e[11]=d,e[12]=p):p=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(hn,{className:"size-4"}),e[13]=b):b=e[13];let f;e[14]!==d?(f=d("thread.publishPopover.retry"),e[14]=d,e[15]=f):f=e[15];let m;e[16]!==o||e[17]!==f?(m=a.jsxs(ve,{type:"button",variant:"outline",className:"flex-1",onClick:o,children:[b,f]}),e[16]=o,e[17]=f,e[18]=m):m=e[18];let g;e[19]!==p||e[20]!==m?(g=a.jsxs("div",{className:"flex gap-2",children:[p,m]}),e[19]=p,e[20]=m,e[21]=g):g=e[21];let x;return e[22]!==g||e[23]!==c||e[24]!==h?(x=a.jsx(ms,{pane:l,list:a.jsx(Gs,{state:"ready",header:c,body:h,footer:g})}),e[22]=g,e[23]=c,e[24]=h,e[25]=x):x=e[25],x}function rc(t){const e=B.c(3),s=t.mode??"publish";let r;return e[0]!==s||e[1]!==t?(r=a.jsx(gr,{children:n=>{const{reset:o}=n;return a.jsx(xr,{fallback:d=>{const{error:l,resetError:i}=d;return a.jsx(nc,{mode:s,draftPreviewUrl:t.draftPreviewUrl,message:l?.message??"",onRetry:()=>{o(),i()}})},children:a.jsx(q.Suspense,{fallback:a.jsx(va,{mode:s,draftPreviewUrl:t.draftPreviewUrl}),children:a.jsx(ac,{...t})})})}}),e[0]=s,e[1]=t,e[2]=r):r=e[2],r}function ac(t){const e=B.c(13),s=Bt(t.virtualMcpId,t.branch);let r;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(r={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch},e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=r):r=e[3];const n=bn(r);if(s.kind==="protocol"&&n){let d;return e[4]!==s||e[5]!==n||e[6]!==t?(d=s.source==="sandbox"?a.jsx(oc,{...t,backend:s,cacheKey:n}):a.jsx(ic,{...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=a.jsx(va,{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=a.jsx(lc,{...t}),e[11]=t,e[12]=o):o=e[12],o}function lc(t){const e=B.c(52),s=ns()?.taskId??null;let r;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?(r={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]=r):r=e[7];const n=ba(r),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}=ga(d),i=n.discardablePaths;let u;e[19]!==i?(u=P=>i===null||P.every(j=>i.has(j)),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 p;e[23]!==c||e[24]!==n.allPaths||e[25]!==n.changedFilesTruncated?(p=!n.changedFilesTruncated&&c(n.allPaths),e[23]=c,e[24]=n.allPaths,e[25]=n.changedFilesTruncated,e[26]=p):p=e[26];let b;e[27]!==t.branch||e[28]!==n.status?(b=Nn(n.status)??t.branch,e[27]=t.branch,e[28]=n.status,e[29]=b):b=e[29];const f=n.headSha??void 0;let m;e[30]!==t.fastPreview||e[31]!==n.diff?(m=!t.fastPreview&&n.diff?{expectedDiffSignature:kn(n.diff)}:{},e[30]=t.fastPreview,e[31]=n.diff,e[32]=m):m=e[32];let g;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]!==p||e[45]!==b||e[46]!==f||e[47]!==m?(g={summary:n.summary,allPaths:n.allPaths,canDiscard:h,canDiscardAll:p,changedFilesTotal:n.changedFilesTotal,changedFilesTruncated:n.changedFilesTruncated,diff:n.diff,bodiesPending:n.bodiesPending,bodiesFailed:n.bodiesFailed,cardsPending:n.cardsPending,refresh:n.refresh,gate:l,headBranch:b,expectedHeadSha:f,...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]=p,e[45]=b,e[46]=f,e[47]=m,e[48]=g):g=e[48];let x;return e[49]!==t||e[50]!==g?(x=a.jsx(Ln,{...t,source:g}),e[49]=t,e[50]=g,e[51]=x):x=e[51],x}function ya(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 ic(t){const e=B.c(23);let s,r,n;e[0]!==t?({backend:s,cacheKey:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let o;e[4]!==n.branch||e[5]!==n.orgSlug||e[6]!==n.virtualMcpId?(o={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[4]=n.branch,e[5]=n.orgSlug,e[6]=n.virtualMcpId,e[7]=o):o=e[7];let d;e[8]!==s||e[9]!==r||e[10]!==o?(d={backend:s,cacheKey:r,scope:o},e[8]=s,e[9]=r,e[10]=o,e[11]=d):d=e[11];const l=Bn(d),i=s.source==="github";let u;e[12]!==s||e[13]!==l?(u=ya(l,s),e[12]=s,e[13]=l,e[14]=u):u=e[14];let c;e[15]===Symbol.for("react.memo_cache_sentinel")?(c={allowed:!0,reason:null},e[15]=c):c=e[15];let h;e[16]!==i||e[17]!==n.branch||e[18]!==u?(h={...u,gate:c,headBranch:n.branch,hosted:i,otherWork:!1},e[16]=i,e[17]=n.branch,e[18]=u,e[19]=h):h=e[19];let p;return e[20]!==n||e[21]!==h?(p=a.jsx(Ln,{...n,source:h}),e[20]=n,e[21]=h,e[22]=p):p=e[22],p}function oc(t){const e=B.c(58);let s,r,n;e[0]!==t?({backend:s,cacheKey:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);const o=ns()?.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]!==r||e[10]!==d?(l={backend:s,cacheKey:r,scope:d},e[8]=s,e[9]=r,e[10]=d,e[11]=l):l=e[11];const i=Bn(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=ba(u),h=n.mode!=="review";let p;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?(p={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]=p):p=e[30];const{gate:b}=ga(p);let f;if(e[31]!==c.allPaths||e[32]!==i){let k;e[34]!==i?(k=N=>{const C=Rn(N);return C===null?!Pn(N):!Object.hasOwn(i.changes.changes,C)},e[34]=i,e[35]=k):k=e[35],f=c.allPaths.some(k),e[31]=c.allPaths,e[32]=i,e[33]=f}else f=e[33];const m=f;let g;e[36]!==s||e[37]!==i?(g=ya(i,s),e[36]=s,e[37]=i,e[38]=g):g=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=Nn(c.status)??n.branch,e[42]=c.status,e[43]=n.branch,e[44]=P):P=e[44];const j=c.headSha??void 0;let y;e[45]!==c.diff?(y=c.diff?{expectedDiffSignature:kn(c.diff)}:{},e[45]=c.diff,e[46]=y):y=e[46];let S;e[47]!==b||e[48]!==m||e[49]!==j||e[50]!==y||e[51]!==g||e[52]!==x||e[53]!==P?(S={...g,refresh:x,gate:b,headBranch:P,expectedHeadSha:j,...y,hosted:!1,otherWork:m},e[47]=b,e[48]=m,e[49]=j,e[50]=y,e[51]=g,e[52]=x,e[53]=P,e[54]=S):S=e[54];let w;return e[55]!==n||e[56]!==S?(w=a.jsx(Ln,{...n,source:S}),e[55]=n,e[56]=S,e[57]=w):w=e[57],w}function Ln(t){const e=B.c(130),{source:s,publishLockRef:r,onOpenChange:n,mode:o,fastPreview:d,orgSlug:l,virtualMcpId:i,branch:u,baseBranch:c,repoTarget:h,owner:p,repo:b,draftPreviewUrl:f,destinationHost:m,previewServerUrl:g,compareDraft:x,lastPublishedPr:P,onRequestApproval:j,openPullRequest:y,onPullRequestChanged:S,onPublished:w}=t,k=o===void 0?"publish":o,N=P===void 0?null:P,C=y===void 0?null:y,v=be(),[A]=fr(),{language:T}=A,I=ns()?.taskId??null,{data:M}=zs.useSession(),$=yr(jr(l,i,u)),{allPaths:H,changedFilesTotal:O,changedFilesTruncated:G,diff:E,bodiesFailed:W,refresh:F,gate:V,hosted:te,otherWork:Y}=s;let ne;e[0]!==x||e[1]!==s.bodiesPending||e[2]!==s.cardsPending||e[3]!==s.summary?(ne={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]=ne):ne=e[4];const le=ne;let _;e[5]!==te?(_={hosted:te},e[5]=te,e[6]=_):_=e[6];const X=qi(le,_),{summary:D,cardsPending:Z,bodiesPending:se,compareDraft:ie}=X.shown,[ge,ue]=q.useState(null),[re,fe]=q.useState(!1),[ye,z]=q.useState(cc);let oe;e[7]===Symbol.for("react.memo_cache_sentinel")?(oe=U=>z(ae=>ae.has(U)?ae:new Set(ae).add(U)),e[7]=oe):oe=e[7];const xe=oe,[Q,ee]=q.useState(null);let ce;e[8]===Symbol.for("react.memo_cache_sentinel")?(ce=[],e[8]=ce):ce=e[8];const[J,de]=q.useState(ce);let _e;e[9]!==s.v8?(_e=U=>{ee(U),de(ae=>[U,...ae.filter(he=>he!==U)]),s.v8&&setTimeout(()=>xe(U),Zo)},e[9]=s.v8,e[10]=_e):_e=e[10];const mt=_e,[we,rt]=q.useState(null);let Le;e[11]!==ge||e[12]!==D?(Le=so(ge,ao(D)),e[11]=ge,e[12]=D,e[13]=Le):Le=e[13];const Re=Le,Te=[...D.pages,...D.blocks,...D.other],Ee=Te.find(U=>ke(U)===Q)??Te[0]??null,Ne=Ee?ke(Ee):null,at=[...new Set([...Ne?[Ne]:[],...J,...Te.map(ke)])].filter(U=>Te.some(ae=>ke(ae)===U)).slice(0,sc),ze=!!s.v8,[$t,Oe]=q.useState(null),Qe=ze?ec({selectedId:Ne,readyIds:ye,lastShownId:$t,liveIds:at}):Ne;ze&&Qe===Ne&&Qe!==$t&&Oe(Qe);const L=k==="review"&&!te,me=Z?"loading":se?"manifest":"ready",Pe=C?.state==="open",Se=s.headBranch,De=M?.user;let pt;e[14]!==De?(pt=Zr(De),e[14]=De,e[15]=pt):pt=e[15];let bt;e[16]!==s.expectedDiffSignature?(bt=s.expectedDiffSignature?{expectedDiffSignature:s.expectedDiffSignature}:{},e[16]=s.expectedDiffSignature,e[17]=bt):bt=e[17];let lt;e[18]!==c||e[19]!==u||e[20]!==d||e[21]!==l||e[22]!==p||e[23]!==b||e[24]!==h||e[25]!==s.expectedHeadSha||e[26]!==s.headBranch||e[27]!==pt||e[28]!==bt||e[29]!==I||e[30]!==i?(lt={orgSlug:l,virtualMcpId:i,branch:u,threadId:I,fastPreview:d,baseBranch:c,target:h,owner:p,repo:b,headBranch:Se,coAuthor:pt,expectedHeadSha:s.expectedHeadSha,...bt},e[18]=c,e[19]=u,e[20]=d,e[21]=l,e[22]=p,e[23]=b,e[24]=h,e[25]=s.expectedHeadSha,e[26]=s.headBranch,e[27]=pt,e[28]=bt,e[29]=I,e[30]=i,e[31]=lt):lt=e[31];const rs=lt,gt=L?"review":"publish",as=M?.user?.name;let it;e[32]!==H||e[33]!==m||e[34]!==te||e[35]!==Re||e[36]!==n||e[37]!==w||e[38]!==S||e[39]!==r||e[40]!==F||e[41]!==s.protocol||e[42]!==gt||e[43]!==as||e[44]!==rs?(it={mode:gt,target:rs,note:Re,allPaths:H,destinationHost:m,publishLockRef:r,onOpenChange:n,refresh:F,onPullRequestChanged:S,onPublished:w,hosted:te,authorName:as,protocol:s.protocol},e[32]=H,e[33]=m,e[34]=te,e[35]=Re,e[36]=n,e[37]=w,e[38]=S,e[39]=r,e[40]=F,e[41]=s.protocol,e[42]=gt,e[43]=as,e[44]=rs,e[45]=it):it=e[45];const{isPublishing:Ce,publishError:ot,publishErrorDetail:Ft,submit:xt,discardChange:Qs,discardAll:Lt}=_l(it),Je=kr(l,i).phase==="saving",ct=D.count>0||Y,kt=!Ce&&ct&&(L||V.allowed);let dt;e[46]!==c||e[47]!==L||e[48]!==s.v8||e[49]!==D.count||e[50]!==v?(dt=L?D.count===0?v("thread.publishPopover.submitForReview"):D.count===1?v("thread.publishPopover.submitOneForReview"):v("thread.publishPopover.submitCountForReview",{count:D.count}):Xo(D.count,c,!!s.v8,v),e[46]=c,e[47]=L,e[48]=s.v8,e[49]=D.count,e[50]=v,e[51]=dt):dt=e[51];const ls=dt;let vt;e:{if(L&&Pe){let he;e[52]!==C.number||e[53]!==v?(he=v("thread.publishPopover.updatesPullRequest",{number:C.number}),e[52]=C.number,e[53]=v,e[54]=he):he=e[54],vt=he;break e}const U=N;if(!U?.mergedAt){vt=null;break e}let ae;if(e[55]!==T||e[56]!==U||e[57]!==v){const he=Oa(new Date(U.mergedAt),T),je=Eo(U);ae=je?v("thread.publishPopover.lastPublishedBy",{when:he,name:je}):v("thread.publishPopover.lastPublished",{when:he}),e[55]=T,e[56]=U,e[57]=v,e[58]=ae}else ae=e[58];vt=ae}const Nt=vt;let Ct;e[59]!==L||e[60]!==D.count||e[61]!==v?(Ct=L?v("thread.publishPopover.submitForReview"):D.count===1?v("thread.publishPopover.publishOne"):D.count>1?v("thread.publishPopover.publishCount",{count:D.count}):v("thread.publishPopover.publish"),e[59]=L,e[60]=D.count,e[61]=v,e[62]=Ct):Ct=e[62];const yt=Ct,At=(U,ae)=>ae.length===0?null:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:U}),ae.map(he=>{const je=ke(he);return a.jsx(ca,{change:he,bodyPending:se,selected:Ee!==null&&ke(Ee)===je,onSelect:()=>mt(je),confirming:we===je,onConfirmingChange:Ae=>rt(Ae?je:null),onDiscard:s.canDiscard(he)?()=>{Qs(he)}:void 0,isPublishing:Ce,isDiscarding:Je,v8:!!s.v8},je)})]});let Ye;e:{if(L||!ct){Ye=null;break e}if(V.pending){let je;e[63]===Symbol.for("react.memo_cache_sentinel")?(je=a.jsx(Zt,{className:"size-3.5 motion-reduce:animate-none"}),e[63]=je):je=e[63];let Ae;e[64]!==v?(Ae=v("thread.publishPopover.reviewing"),e[64]=v,e[65]=Ae):Ae=e[65];let Ke;e[66]!==Ae?(Ke=a.jsxs("div",{className:"flex items-center gap-2 border-t px-4 py-2.5 text-xs text-muted-foreground",children:[je,Ae]}),e[66]=Ae,e[67]=Ke):Ke=e[67],Ye=Ke;break e}if(V.allowed){Ye=null;break e}let U;e[68]===Symbol.for("react.memo_cache_sentinel")?(U=a.jsx(un,{className:"mt-0.5 size-3.5 shrink-0"}),e[68]=U):U=e[68];let ae;e[69]!==V.reason||e[70]!==v?(ae=V.reason??v("thread.publishPopover.needsReviewGeneric"),e[69]=V.reason,e[70]=v,e[71]=ae):ae=e[71];let he;e[72]!==ae?(he=a.jsxs("div",{className:"flex items-start gap-2 border-t px-4 py-2.5 text-xs text-warning",children:[U,a.jsx("span",{children:ae})]}),e[72]=ae,e[73]=he):he=e[73],Ye=he}const jt=Ye;let ut;e[74]!==Lt||e[75]!==re||e[76]!==Je||e[77]!==Ce||e[78]!==s.canDiscardAll||e[79]!==D.count||e[80]!==v?(ut=D.count<=1||!s.canDiscardAll?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>fe(!0),disabled:Ce||Je,children:v("thread.publishPopover.discardAll")}),a.jsx(Bs,{open:re,onOpenChange:fe,children:a.jsxs(Ds,{children:[a.jsxs(Cs,{children:[a.jsx(ks,{children:v("thread.publishPopover.discardAllTitle")}),a.jsx(Ns,{children:v("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(Ts,{children:[a.jsx(As,{children:v("thread.publishDialog.cancel")}),a.jsx(Rs,{onClick:()=>{Lt()},disabled:Je,className:K(vr({variant:"destructive"})),children:v("thread.publishPopover.discardAll")})]})]})})]}),e[74]=Lt,e[75]=re,e[76]=Je,e[77]=Ce,e[78]=s.canDiscardAll,e[79]=D.count,e[80]=v,e[81]=ut):ut=e[81];const Rt=ut,is=Z?a.jsx(us,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Dt,{}),a.jsx(Dt,{})]})}):D.count===0&&Y?a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:v("thread.publishPopover.onlyOtherWork")}):D.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(wn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:v(L?"thread.publishPopover.nothingToSubmit":"thread.publishPopover.everythingLive")}),a.jsx("p",{className:"text-xs text-muted-foreground",children:v(L?"thread.publishPopover.submitEmptyHint":"thread.publishPopover.emptyHint")})]}):a.jsxs(us,{children:[G?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.showingFirst",{shown:D.count,total:O})}):null,At(v("thread.publishPopover.pagesGroup"),D.pages),At(v("thread.publishPopover.blocksGroup"),D.blocks),At(v("thread.publishPopover.otherGroup"),D.other),W?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.detailsUnavailable")}):null,Y?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.alsoOtherWork")}):null]}),os=Z?a.jsx(In,{}):Ee?a.jsx("div",{className:K(ts,"relative"),children:Te.filter(U=>at.includes(ke(U))).map(U=>a.jsx("div",{className:K("absolute inset-0 flex",ze?ke(U)===Qe?"z-10":"pointer-events-none opacity-0":ke(U)!==Ne&&"hidden"),inert:ze&&ke(U)!==Qe,"aria-hidden":ze&&ke(U)!==Qe?!0:void 0,children:a.jsx(pa,{change:U,diff:E,bodyPending:se,previewServerUrl:g,draft:ie,lastPage:$,v8:s.v8,onReady:ze?()=>xe(ke(U)):void 0})},ke(U)))}):a.jsx("div",{className:K(ts,"bg-muted/40")});let Be;e[82]!==ls?(Be=a.jsx("span",{className:"truncate",children:ls}),e[82]=ls,e[83]=Be):Be=e[83];let Ie;e[84]!==Rt||e[85]!==k||e[86]!==Nt||e[87]!==Be?(Ie=a.jsx($n,{mode:k,title:Be,subLine:Nt,trailing:Rt}),e[84]=Rt,e[85]=k,e[86]=Nt,e[87]=Be,e[88]=Ie):Ie=e[88];let Xe;e[89]!==Ce||e[90]!==L||e[91]!==Re||e[92]!==D.count||e[93]!==v?(Xe=D.count===0?null:a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-sm font-medium",children:v(L?"thread.publishPopover.reviewNote":"thread.publishPopover.versionNote")}),a.jsx($l,{value:Re,onChange:U=>ue(U.target.value),placeholder:v(L?"thread.publishPopover.reviewNotePlaceholder":"thread.publishPopover.versionNotePlaceholder"),rows:2,maxLength:El,className:"resize-none text-sm",disabled:Ce})]}),e[89]=Ce,e[90]=L,e[91]=Re,e[92]=D.count,e[93]=v,e[94]=Xe):Xe=e[94];let Ue;e[95]!==f||e[96]!==v?(Ue=a.jsx(Fn,{draftPreviewUrl:f,t:v}),e[95]=f,e[96]=v,e[97]=Ue):Ue=e[97];let wt;e[98]!==kt||e[99]!==V||e[100]!==ct||e[101]!==te||e[102]!==Ce||e[103]!==L||e[104]!==j||e[105]!==yt||e[106]!==X||e[107]!==xt||e[108]!==v?(wt=!L&&!te&&ct&&!V.allowed&&!V.pending?a.jsx(ve,{type:"button",className:"flex-1",onClick:j,disabled:Ce,children:v("thread.publishPopover.requestApproval")}):a.jsxs(ve,{type:"button",variant:L?"default":"brand",className:"flex-1",onClick:()=>{X.hold(),xt().then(U=>{U===!1&&X.release()})},disabled:!kt,children:[Ce?a.jsx(Zt,{className:"size-4 motion-reduce:animate-none"}):null,Ce?v(L?"thread.publishPopover.submitting":"thread.publishPopover.publishing"):yt]}),e[98]=kt,e[99]=V,e[100]=ct,e[101]=te,e[102]=Ce,e[103]=L,e[104]=j,e[105]=yt,e[106]=X,e[107]=xt,e[108]=v,e[109]=wt):wt=e[109];let Ze;e[110]!==Ue||e[111]!==wt?(Ze=a.jsxs("div",{className:"flex gap-2",children:[Ue,wt]}),e[110]=Ue,e[111]=wt,e[112]=Ze):Ze=e[112];let qe;e[113]!==ot||e[114]!==Ft||e[115]!==v?(qe=ot?a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-destructive",children:ot}),Ft?a.jsx(Qa,{label:v("siteEditor.details"),detail:Ft}):null]}):null,e[113]=ot,e[114]=Ft,e[115]=v,e[116]=qe):qe=e[116];let $e;e[117]!==Ze||e[118]!==qe?($e=a.jsxs(a.Fragment,{children:[Ze,qe]}),e[117]=Ze,e[118]=qe,e[119]=$e):$e=e[119];let Fe;e[120]!==is||e[121]!==jt||e[122]!==me||e[123]!==Ie||e[124]!==Xe||e[125]!==$e?(Fe=a.jsx(Gs,{state:me,header:Ie,body:is,note:Xe,gate:jt,footer:$e}),e[120]=is,e[121]=jt,e[122]=me,e[123]=Ie,e[124]=Xe,e[125]=$e,e[126]=Fe):Fe=e[126];let He;return e[127]!==os||e[128]!==Fe?(He=a.jsx(ms,{pane:os,list:Fe}),e[127]=os,e[128]=Fe,e[129]=He):He=e[129],He}function cc(){return new Set}function dc(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return ii[t].short}const uc=new Set(["failure","timed_out","cancelled","action_required"]);function ja(t){return t.status==="completed"&&uc.has(t.conclusion)}function On(t){return t.status==="queued"||t.status==="in_progress"}function Ss(t){return t.isPending&&t.fetchStatus!=="idle"}function hc(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr-page"}}function ht(t,e,s){return e?[...t,hc(s)]:t}function Ge(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 er(t){return{key:"submit-for-review",label:t("thread.headerActions.submitForReview"),action:"create-pr"}}function js(t,e,s){if(e.filter(On).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 fc(t){const{lifecycle:e,branch:s,pr:r,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&&dc(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&&!(r&&i.headSha&&r.headSha&&i.headSha===r.headSha);if(t.noReviewableDiff&&!r)return{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:Ge([],i,l)};if(i.workingTreeDirty||u)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge(ht([er(l)],r,l),i,l)};if(Yr("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:r?.merged??null,prState:r?.state??null}),r?.merged)return!!i.headSha&&!!r.headSha&&i.headSha!==r.headSha?{label:l("thread.headerActions.continue"),action:"create-pr",variant:"special",tooltip:l("thread.headerActions.openNewPrTooltip"),menu:Ge(ht([],r,l),i,l)}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.prMergedTooltip",{prNumber:String(r.number),base:r.base}),menu:Ge(ht([],r,l),i,l)};if(i.aheadOfBase>0){if(r&&r.state==="closed"&&!r.merged)return{label:l("thread.headerActions.reopenPr"),action:"reopen",variant:"default",tooltip:l("thread.headerActions.reopenPrTooltip",{prNumber:String(r.number)}),menu:Ge(ht([],r,l),i,l)};if(!r)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge([er(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(On).length,p=n.filter(ja).map(f=>f.name);if(h===0&&p.length>0)return{label:l("thread.headerActions.fixChecks"),action:"fix-checks",variant:"default",tooltip:l("thread.headerActions.failingChecksTooltip",{checks:p.join(", ")}),meta:{failingChecks:p},menu:Ge(ht([{key:"publish-anyway",label:l("thread.headerActions.publishAnyway"),action:"merge",tooltip:l("thread.headerActions.squashMergeTooltip",{prNumber:String(r.number),base:r.base})}],r,l),i,l)};if(o?.draft)return js({label:l("thread.headerActions.markReady"),action:"mark-ready",variant:"default",tooltip:l("thread.headerActions.markDraftReadyTooltip"),menu:Ge(ht([],r,l),i,l)},n,l);const b=o?.unresolvedConversations??0;return b>0?js({label:l("thread.headerActions.addressFeedback"),action:"resolve-comments",variant:"default",tooltip:l("thread.headerActions.unresolvedConversationsTooltip",{count:String(b)}),menu:Ge(ht([],r,l),i,l)},n,l):o?.missingRequiredApprovals?js({label:l("thread.cmsActions.waitingForReview"),action:"open-pr-page",variant:"outline",tooltip:l("thread.headerActions.waitingForApprovalsTooltip"),menu:Ge(ht([],r,l),i,l)},n,l):js({label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",meta:{publishPolicyOverride:"open"},menu:Ge(ht([{key:"review",label:l("thread.headerActions.review"),action:"review"}],r,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 tr(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr"}}function ws(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 sr(t,e,s,r){const n=e.length;if(n===0)return t;if(e.filter(On).length>0){const l=e.filter(u=>u.status==="completed").length,i=r("thread.cmsActions.checksRunning",{done:l,total:n});return s==="loading"?{...t,loading:!0,tooltip:i}:{...t,tooltip:i}}const d=e.filter(ja).length;return d>0?{...t,variant:"warning",tooltip:r("thread.cmsActions.checksFailing",{failed:d,total:n})}:t}function mc(t,e){return!!(t?.merged&&t.headSha&&e.kind==="ready"&&!e.workingTreeDirty&&e.headSha===t.headSha)}function pc(t){return Ss(t.prQuery)?!0:t.pr?.state!=="open"||t.pr.merged?!1:Ss(t.checksQuery)||Ss(t.reviewsQuery)}function bc(t,e){return t.workingTreeDirty?!0:e!==null?e>0:t.aheadOfBase>0}function gc(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 xc(t){return{...t,menu:[]}}function vc(t){const{branch:e,pr:s,checks:r,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?sr({label:u("thread.cmsActions.waitingForReview"),action:"open-pr",variant:"outline",menu:ws([tr(u)],e,u)},r,"loading",u):sr({label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ws([tr(u)],e,u)},r,"none",u)}return mc(s,e)?{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:ws([],e,u)}:bc(e,i)?{label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ws([{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 yc(t){return t.conflicting===!0?"dirty":t.conflicting===null?"unknown":t.reviewBlocked||t.unresolvedConversations>0?"blocked":"clean"}function wa(t){const e=B.c(4);let s;e[0]!==t?(s=vl(t),e[0]=t,e[1]=s):s=e[1];let r;return e[2]!==s?(r={...s,select:jc},e[2]=s,e[3]=r):r=e[3],ft(r)}function jc(t){const e=t.changeRequest;return e?{draft:e.draft,mergeableState:yc(e),unresolvedConversations:e.unresolvedConversations,missingRequiredApprovals:e.reviewBlocked}:null}function nr(t,e){return t==="open-pr"||e==="resolve-on-provider"?a.jsx(Kr,{size:16}):t==="publish"?a.jsx($r,{className:"size-4"}):t==="get-latest"||t==="retry-status"?a.jsx(hn,{className:"size-4"}):a.jsx(qs,{className:"size-4"})}function wc(t){const e=B.c(63),{virtualMcpId:s}=t,r=be(),{org:n}=hs(),o=hr(),d=Ks(s),{data:l}=zs.useSession(),{deleteRelease:i}=Vs(s),{currentBranch:u,setCurrentTaskBranch:c,taskId:h,createTask:p}=wr();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={open:!1,mode:"publish"},e[0]=b):b=e[0];const[f,m]=q.useState(b);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=L=>m({open:!0,mode:L}),e[1]=g):g=e[1];const x=g,P=Er(d),j=P.status==="attached"||P.status==="public-clone"?P.repo:null,{previewServerUrl:y}=fs(s),S=u?yr(jr(n.slug,s,u)):null,w=S?jn(S.path,S.params):"/",k=kl(u?{orgSlug:n.slug,virtualMcpId:s,branch:u,previewServerUrl:y,path:w}:null);let N;e[2]!==u||e[3]!==n.slug||e[4]!==s?(N=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[2]=u,e[3]=n.slug,e[4]=s,e[5]=N):N=e[5];const C=Nl(N),v=Bt(s,u),A=v.kind==="protocol"&&v.source==="github";let T;e[6]!==u||e[7]!==n.slug||e[8]!==s?(T=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[6]=u,e[7]=n.slug,e[8]=s,e[9]=T):T=e[9];const I=bn(T),M=Nr(A?v:null,I);let $;e[10]!==n.slug||e[11]!==s?($=Ja(n.slug,s),e[10]=n.slug,e[11]=s,e[12]=$):$=e[12];const H=Ya($,A?C:null),O=A?Xa(y,w,H):k.url,G=u??"",E=h??null;let W;e[13]!==n.slug||e[14]!==G||e[15]!==E||e[16]!==s?(W=Sn({orgSlug:n.slug,virtualMcpId:s,branch:G,threadId:E}),e[13]=n.slug,e[14]=G,e[15]=E,e[16]=s,e[17]=W):W=e[17];const F=!!u&&v.kind!=="pending"&&!A;let V;e[18]!==W||e[19]!==F?(V={...W,enabled:F},e[18]=W,e[19]=F,e[20]=V):V=e[20];const te=ft(V),Y=A?null:te.data??null,ne=A?gc(M.data,u??""):null,le=ne?ne.branchMeta:Y?{kind:"ready",branch:Nn(Y)??u??"",base:Y.base??"main",workingTreeDirty:ti(Y),unpushed:Y.unpushed??0,aheadOfBase:Y.aheadOfBase??0,behindBase:Y.behindBase??0,headSha:Y.headSha??""}:{kind:"unknown"},_=ne?ne.publishableChangeCount:Y?.changedFiles?la({files:Y.changedFiles}).count:null,X=A?M:te,D=(le.kind==="ready"?le.branch:null)??u??null,Z=le.kind==="ready"?le.base:"main",se=zr({orgId:n.id,orgSlug:n.slug,target:Me(j),owner:j?.owner??"",repo:j?.name??"",branch:D}),ie=se.data??null,ge=Ur({orgId:n.id,orgSlug:n.slug,target:Me(j),owner:j?.owner??"",repo:j?.name??"",base:Z}),ue=qr({orgId:n.id,orgSlug:n.slug,target:Me(j),owner:j?.owner??"",repo:j?.name??"",branch:D}),re=wa({orgId:n.id,orgSlug:n.slug,target:Me(j),owner:j?.owner??"",repo:j?.name??"",branch:D});let fe;e[21]!==ue||e[22]!==ie||e[23]!==se||e[24]!==re?(fe=pc({pr:ie,prQuery:se,checksQuery:ue,reviewsQuery:re}),e[21]=ue,e[22]=ie,e[23]=se,e[24]=re,e[25]=fe):fe=e[25];const ye=fe;let z;e[26]!==se?(z=async()=>{await se.refetch()},e[26]=se,e[27]=z):z=e[27];const oe=z,xe=_n({mutationFn:()=>zi({hosted:A,branch:u,baseBranch:Z,nextBranch:()=>gn(xn(l?.user)),setCurrentTaskBranch:c,deleteRelease:i}),onError:kc});let Q;e[28]!==n.slug||e[29]!==h||e[30]!==s?(Q=async L=>(await si({orgSlug:n.slug,virtualMcpId:s,branch:L.branch,threadId:h??null},L.base),L),e[28]=n.slug,e[29]=h,e[30]=s,e[31]=Q):Q=e[31];let ee;e[32]!==u||e[33]!==n.slug||e[34]!==o||e[35]!==r||e[36]!==h||e[37]!==s?(ee=async L=>{et.success(r("thread.headerActions.syncedWithBase",{base:L.base})),await Promise.all([o.invalidateQueries({queryKey:Cn({orgSlug:n.slug,virtualMcpId:s,branch:u??L.branch,threadId:h??null})}),o.invalidateQueries({queryKey:ss.decofile(`${n.slug}/${s}/${L.branch}`)})])},e[32]=u,e[33]=n.slug,e[34]=o,e[35]=r,e[36]=h,e[37]=s,e[38]=ee):ee=e[38];let ce;e[39]!==Q||e[40]!==ee?(ce={mutationFn:Q,onSuccess:ee,onError:Sc},e[39]=Q,e[40]=ee,e[41]=ce):ce=e[41];const J=_n(ce),de=Cr(n.slug,s),_e=xe.isPending,mt=vc({branch:le,pr:ie,checks:ue.data??[],reviews:re.data??null,publishing:_e,saving:de,syncing:J.isPending,statusRetrying:X.isFetching&&!!X.error,statusError:X.error instanceof Error?X.error.message:X.error?String(X.error):null,loading:!!ye,publishableChangeCount:_,t:r}),we=A?xc(mt):mt,rt=we.autoRun&&le.kind==="ready"&&j&&y?`${D}@${le.headSha}`:null,Le=q.useRef(null);if(q.useEffect(()=>{!rt||!D||Le.current!==rt&&(Le.current=rt,J.mutate({branch:D,base:Z}))},[rt,D,Z,J]),P.status==="detached"){let L;e[42]!==r?(L=r("thread.headerActions.reconnectGithub"),e[42]=r,e[43]=L):L=e[43];let me;e[44]!==L?(me=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:a.jsx(ve,{size:"sm",variant:"outline",disabled:!0,children:L})})}),e[44]=L,e[45]=me):me=e[45];let Pe;e[46]!==r?(Pe=r("thread.headerActions.githubConnectionRemoved"),e[46]=r,e[47]=Pe):Pe=e[47];let Se;e[48]!==Pe?(Se=a.jsx(nt,{children:Pe}),e[48]=Pe,e[49]=Se):Se=e[49];let De;return e[50]!==me||e[51]!==Se?(De=a.jsx(Us,{children:a.jsxs(tt,{children:[me,Se]})}),e[50]=me,e[51]=Se,e[52]=De):De=e[52],De}if(!d)return null;if(!j||!y){const L=j?"noPreviewServer":"noRepo";let me;e[53]!==u||e[54]!==p?(me=u?()=>{const Se=p?.({runtime:"sandbox",branch:u});Se&&Ma("coding_session_started",{thread_id:Se})}:void 0,e[53]=u,e[54]=p,e[55]=me):me=e[55];let Pe;return e[56]!==L||e[57]!==me?(Pe=a.jsx(Nc,{reason:L,onStartCodingSession:me}),e[56]=L,e[57]=me,e[58]=Pe):Pe=e[58],Pe}if(!u)return null;const Re=L=>{switch(L){case"publish":{x("publish");return}case"request-approval":{x("review");return}case"get-latest":{if(!D||J.isPending)return;J.mutate({branch:D,base:Z});return}case"retry-status":{X.refetch();return}case"open-pr":{ie?.htmlUrl&&window.open(ie.htmlUrl,"_blank","noopener,noreferrer");return}}};let Te;e[59]!==Re?(Te=L=>({key:L.key,label:L.label,icon:nr(L.action,L.key),...L.tooltip?{tooltip:L.tooltip}:{},onSelect:()=>Re(L.action)}),e[59]=Re,e[60]=Te):Te=e[60];const Ee=we.menu.map(Te),Ne=we.action,at=we.label,ze=we.variant,$t=!!we.loading;let Oe;e[61]!==r?(Oe=r("thread.cmsActions.moreActionsAriaLabel"),e[61]=r,e[62]=Oe):Oe=e[62];const Qe=a.jsx(Xr,{size:"sm",label:at,variant:ze,disabled:!!we.disabled||!Ne,loading:$t,...Ne&&!we.loading?{icon:nr(Ne)}:{},...we.tooltip?{tooltip:we.tooltip}:{},items:Ee,menuAriaLabel:Oe,onClick:Ne?()=>Re(Ne):void 0});return a.jsxs(a.Fragment,{children:[we.status?a.jsx("span",{className:"mr-1 hidden shrink-0 text-xs text-muted-foreground sm:inline",children:we.status}):null,Qe,u?a.jsx(xa,{open:f.open,mode:f.mode,fastPreview:!0,onOpenChange:L=>{L||m(Pc)},orgSlug:n.slug,virtualMcpId:s,branch:u,baseBranch:Z,repoTarget:Me(j),owner:j.owner,repo:j.name,publishPolicy:Qr(d?.metadata?.publishPolicy),draftPreviewUrl:O,destinationHost:k.host,previewServerUrl:y,compareDraft:C?{kind:"pointer",pointer:C,...H?{link:H}:{}}:null,lastPublishedPr:ge.data??null,onRequestApproval:()=>x("review"),openPullRequest:ie?.state==="open"?ie:null,onPullRequestChanged:oe,onPublished:()=>xe.mutateAsync()}):null]})}function Pc(t){return{...t,open:!1}}function Sc(t){et.error(t instanceof Error?t.message:String(t))}function kc(t){console.error("site editor: settling after publish failed",t)}function Nc(t){const e=B.c(14),{reason:s,onStartCodingSession:r}=t,n=be(),o=!r;let d;e[0]!==n?(d=n("sandbox.cmsUnavailable.startCodingSession"),e[0]=n,e[1]=d):d=e[1];let l;e[2]!==r||e[3]!==o||e[4]!==d?(l=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:a.jsx(ve,{size:"sm",variant:"outline",disabled:o,onClick:r,children:d})})}),e[2]=r,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=a.jsx(nt,{children:i}),e[9]=i,e[10]=u):u=e[10];let c;return e[11]!==l||e[12]!==u?(c=a.jsx(Us,{children:a.jsxs(tt,{children:[l,u]})}),e[11]=l,e[12]=u,e[13]=c):c=e[13],c}const It="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 Cc(t){return`Reopen PR #${t.prNumber}. ${It}`}function Ac(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${It}`}function Rc(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). ${It}`}function Tc(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. ${It}`}function Dc(t){return`Mark PR #${t.prNumber} ready for review. ${It}`}function Bc(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. ${It}`}function Ic(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. ${It}`}function rr(t){switch(t){case"publish":return a.jsx($r,{className:"size-4"});case"create-pr":case"reopen":return a.jsx(qs,{className:"size-4"});case"rebase":case"sync":return a.jsx(hn,{className:"size-4"});case"fix-checks":return a.jsx(un,{className:"size-4"});case"mark-ready":return a.jsx(wn,{className:"size-4"});case"resolve-comments":return a.jsx(ul,{className:"size-4"});case"merge":return a.jsx(Vl,{className:"size-4"});case"review":return a.jsx(Is,{className:"size-4"});case"open-pr-page":return a.jsx(Kr,{size:16})}}const ar=new Set(["reopen","rebase","fix-checks","mark-ready","resolve-comments","review","sync"]),lr=new Set(["publish","create-pr"]);function $c(t){const e=B.c(44),{t:s,button:r,actionBusy:n,changeRequestPending:o,savePending:d,onAction:l}=t,i=r.action;let u;e[0]!==i||e[1]!==n?(u=n&&i!==void 0&&ar.has(i),e[0]=i,e[1]=n,e[2]=u):u=e[2];const c=u,h=o&&i==="merge";let p;e[3]!==i||e[4]!==d?(p=d&&i!==void 0&&lr.has(i),e[3]=i,e[4]=d,e[5]=p):p=e[5];const b=p,f=!!r.disabled||c||h||b||!i,m=!!r.loading||h;let g;e[6]!==r.tooltip||e[7]!==c||e[8]!==b||e[9]!==s?(g=c?s("thread.headerActions.chatIsRunning"):b?s("thread.headerActions.saving"):r.tooltip,e[6]=r.tooltip,e[7]=c,e[8]=b,e[9]=s,e[10]=g):g=e[10];const x=g;let P;if(e[11]!==n||e[12]!==r.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=T=>{const I=n&&ar.has(T.action),M=d&&lr.has(T.action),$=T.action==="merge"&&o,H=M?s("thread.headerActions.saving"):I?s("thread.headerActions.chatIsRunning"):T.tooltip;return{key:T.key,label:T.label,icon:rr(T.action),disabled:!!(I||M||$),...H?{tooltip:H}:{},onSelect:()=>l(T.action)}},e[18]=n,e[19]=o,e[20]=l,e[21]=d,e[22]=s,e[23]=A):A=e[23],P=r.menu.map(A),e[11]=n,e[12]=r.menu,e[13]=o,e[14]=l,e[15]=d,e[16]=s,e[17]=P}else P=e[17];const j=P,y=r.label,S=r.variant;let w;e[24]!==i||e[25]!==m?(w=i&&!m?{icon:rr(i)}:{},e[24]=i,e[25]=m,e[26]=w):w=e[26];let k;e[27]!==x?(k=x?{tooltip:x}:{},e[27]=x,e[28]=k):k=e[28];let N;e[29]!==s?(N=s("thread.headerActions.moreActionsAriaLabel"),e[29]=s,e[30]=N):N=e[30];let C;e[31]!==i||e[32]!==l?(C=i?()=>l(i):void 0,e[31]=i,e[32]=l,e[33]=C):C=e[33];let v;return e[34]!==r.label||e[35]!==r.variant||e[36]!==f||e[37]!==j||e[38]!==m||e[39]!==w||e[40]!==k||e[41]!==N||e[42]!==C?(v=a.jsx(Xr,{size:"sm",label:y,variant:S,disabled:f,loading:m,...w,...k,items:j,menuAriaLabel:N,onClick:C}),e[34]=r.label,e[35]=r.variant,e[36]=f,e[37]=j,e[38]=m,e[39]=w,e[40]=k,e[41]=N,e[42]=C,e[43]=v):v=e[43],v}function ir(t){const e=B.c(9),{label:s,children:r}=t;if(!s){let l;return e[0]!==r?(l=a.jsx(a.Fragment,{children:r}),e[0]=r,e[1]=l):l=e[1],l}let n;e[2]!==r?(n=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:r})}),e[2]=r,e[3]=n):n=e[3];let o;e[4]!==s?(o=a.jsx(nt,{children:s}),e[4]=s,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==o?(d=a.jsx(Us,{children:a.jsxs(tt,{children:[n,o]})}),e[6]=n,e[7]=o,e[8]=d):d=e[8],d}function Fc(t){return{label:t("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:t("thread.headerActions.waitingForSandboxBranchTooltip"),menu:[]}}function Lc({virtualMcpId:t}){const e=be(),{org:s}=hs(),{data:r}=zs.useSession(),n=Ks(t),{deleteRelease:o}=Vs(t),{currentBranch:d,setCurrentTaskBranch:l,createTask:i,taskId:u}=wr(),c=Ua(),{openSidePanel:h}=tl(),[p,b]=q.useState({open:!1,mode:"publish",policyOverride:null}),f=oi({connectionId:_a,orgId:s.id,orgSlug:s.slug}),m=di(f),[g,x]=q.useState(!1),P=q.useRef(""),j=Er(n),y=j.status==="attached"||j.status==="public-clone"?j.repo:null,{lifecycle:S,branch:w,phase:k}=ci(),N={orgSlug:s.slug,virtualMcpId:t,branch:d??"",threadId:u??null},v=ft({queryKey:Cn(N),queryFn:()=>Wr(N),enabled:!!d,staleTime:15e3,refetchInterval:Q=>Ys(Q.state.data)?5e3:!1}).data??null,A=w,T=S,I=A.kind==="ready"?A.branch:null,M=d??I??void 0,$=(A.kind==="ready"?A.branch:null)??M??null,H=zr({orgId:s.id,orgSlug:s.slug,target:Me(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),O=H.data??null,G=qr({orgId:s.id,orgSlug:s.slug,target:Me(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),E=wa({orgId:s.id,orgSlug:s.slug,target:Me(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),W=Ur({orgId:s.id,orgSlug:s.slug,target:Me(y),owner:y?.owner??"",repo:y?.name??"",base:A.kind==="ready"?A.base:null}),F=A,V=Qr(n?.metadata?.publishPolicy),te=Cr(s.slug,t),{previewUrl:Y}=ui(),{previewServerUrl:ne,projectDefault:le}=fs(t);if(j.status==="detached")return a.jsx(ir,{label:e("thread.headerActions.githubConnectionRemoved"),children:a.jsx(ve,{size:"sm",variant:"outline",disabled:!0,children:e("thread.headerActions.reconnectGithub")})});if(!y)return null;const _=$?fc({lifecycle:T,branch:F,claimPhase:k,pr:O,checks:G.data??[],reviews:E.data??null,noReviewableDiff:Ys(v),loading:Ss(H),t:e}):Fc(e),X=JSON.stringify({label:_.label,branchKind:F.kind,workingTreeDirty:F.kind==="ready"?F.workingTreeDirty:null,unpushed:F.kind==="ready"?F.unpushed:null,aheadOfBase:F.kind==="ready"?F.aheadOfBase:null,lifecycle:T.phase,headBranch:$,noReviewableDiff:Ys(v)});P.current!==X&&(P.current=X,Yr("header button",{label:_.label,tooltip:_.tooltip,action:_.action,chatBranch:d,sandboxBranch:I,sandboxRouteBranch:M,headBranch:$,branchMeta:A,effectiveBranchMeta:F,lifecyclePhase:T.phase,prNumber:O?.number??null,prState:O?.state??null}));const D=Q=>(h(),c.sendMessage({parts:[{type:"text",text:Q}]})),Z=c.isStreaming,se=F.kind==="ready"?F.base:"main",ie=async()=>{await H.refetch()},ge=async()=>{const Q=d,ee=gn(xn(r?.user));le==="cms"?i({runtime:"cms",branch:ee}):await l(ee),Q&&Q!==se&&await o(Q)},ue=async Q=>{if(!(!y||g)){x(!0);try{const ee=Zr(r?.user);await zl(s.slug,Me(y),{number:Q,coAuthor:ee}),et.success(e("thread.headerActions.publishedPr",{prNumber:String(Q)})),await ie(),await ge()}catch(ee){et.error(ee instanceof Ul?ee.detail??ql(ee.reason,e):ee instanceof Error?ee.message:e("thread.headerActions.failedToMergePullRequest"))}finally{x(!1)}}},re=(Q,ee)=>b({open:!0,mode:Q,policyOverride:ee}),fe=Q=>{if($)switch(Q){case"publish":re("publish",_.meta?.publishPolicyOverride??null);return;case"create-pr":re("review",null);return;case"merge":O&&ue(O.number);return;case"sync":if(Z)return;D(Rc({branch:$,base:se}));return;case"open-pr-page":O?.htmlUrl&&window.open(O.htmlUrl,"_blank","noopener,noreferrer");return;case"review":if(Z)return;O&&D(Ic({prNumber:O.number}));return;case"reopen":if(Z)return;O&&D(Cc({prNumber:O.number}));return;case"rebase":if(Z)return;D(Ac({branch:$}));return;case"fix-checks":if(Z)return;O&&D(Tc({prNumber:O.number,failingChecks:_.meta?.failingChecks??[]}));return;case"mark-ready":if(Z)return;O&&D(Dc({prNumber:O.number}));return;case"resolve-comments":if(Z)return;O&&D(Bc({prNumber:O.number}));return}},ye=g||Z,z=a.jsx($c,{t:e,button:_,actionBusy:ye,changeRequestPending:g,savePending:te,onAction:fe}),oe=F.kind==="ready"&&F.pushError&&F.pushFailingSince?e("thread.headerActions.pushFailing",{since:new Date(F.pushFailingSince).toLocaleString(),error:F.pushError}):null,xe=oe?a.jsx(ir,{label:oe,children:a.jsx(un,{role:"img","aria-label":oe,className:"size-4 text-warning"})}):null;return M?a.jsxs(a.Fragment,{children:[xe,z,a.jsx(xa,{open:p.open,mode:p.mode,fastPreview:!1,recoverSandbox:()=>m.mutateAsync({virtualMcpId:t,branch:M,...u?{threadId:u}:{}}),onOpenChange:Q=>{Q||b(ee=>({...ee,open:!1}))},orgSlug:s.slug,virtualMcpId:t,branch:M,baseBranch:se,repoTarget:Me(y),owner:y.owner,repo:y.name,publishPolicy:p.policyOverride??V,draftPreviewUrl:Y,destinationHost:null,previewServerUrl:ne,compareDraft:Y?{kind:"sandbox",previewUrl:Y}:null,lastPublishedPr:W.data??null,onRequestApproval:()=>b(Q=>({...Q,open:!0,mode:"review"})),openPullRequest:O?.state==="open"?O:null,onPullRequestChanged:ie,onPublished:ge})]}):a.jsxs(a.Fragment,{children:[xe,z]})}function Oc(t){const e=B.c(33),{orgSlug:s,virtualMcpId:r,branch:n}=t,o=be(),[d,l]=q.useState(!1),i=Bt(r,n),u=i.kind==="protocol"&&i.source==="local"?i:null;let c;e[0]!==n||e[1]!==s||e[2]!==r?(c=n?{orgSlug:s,virtualMcpId:r,branch:n}:null,e[0]=n,e[1]=s,e[2]=r,e[3]=c):c=e[3];const h=bn(c),{data:p}=Nr(u,h);if(!u||!h||!n)return null;let b;e[4]!==p?(b=p?Object.keys(p.changes).length:0,e[4]=p,e[5]=b):b=e[5];const f=b;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),e[6]=m):m=e[6];let g;e[7]!==f||e[8]!==o?(g=f>0?o("decoServe.changes.buttonCount",{count:f}):o("decoServe.changes.button"),e[7]=f,e[8]=o,e[9]=g):g=e[9];let x;e[10]!==g?(x=a.jsx(ve,{size:"sm",variant:"outline","data-testid":"local-changes-button",onClick:m,children:g}),e[10]=g,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 j;e[14]!==P?(j=a.jsx(pr,{className:"sr-only",children:P}),e[14]=P,e[15]=j):j=e[15];let y;e[16]!==n||e[17]!==h||e[18]!==u||e[19]!==d||e[20]!==s||e[21]!==o||e[22]!==r?(y=d?a.jsx(gr,{children:N=>{const{reset:C}=N;return a.jsx(xr,{fallback:v=>{const{resetError:A}=v;return a.jsx(on,{title:o("decoServe.changes.title"),body:a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:o("decoServe.changes.loadFailed")}),onClose:()=>{C(),A(),l(!1)}})},children:a.jsx(q.Suspense,{fallback:a.jsx(ms,{pane:a.jsx(In,{}),list:a.jsx(on,{title:o("decoServe.changes.title"),loading:!0,body:a.jsx(us,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Dt,{}),a.jsx(Dt,{})]})}),onClose:()=>l(!1)})}),children:a.jsx(Mc,{orgSlug:s,virtualMcpId:r,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]=r,e[23]=y):y=e[23];let S;e[24]!==j||e[25]!==y?(S=a.jsxs(br,{"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:[j,y]}),e[24]=j,e[25]=y,e[26]=S):S=e[26];let w;e[27]!==d||e[28]!==S?(w=a.jsx(mr,{open:d,onOpenChange:l,children:S}),e[27]=d,e[28]=S,e[29]=w):w=e[29];let k;return e[30]!==w||e[31]!==x?(k=a.jsxs(a.Fragment,{children:[x,w]}),e[30]=w,e[31]=x,e[32]=k):k=e[32],k}function on(t){const e=B.c(22),{title:s,trailing:r,body:n,loading:o,onClose:d}=t,l=o===void 0?!1:o,i=be(),u=l?"loading":"ready";let c;e[0]!==s?(c=a.jsx("span",{className:"truncate",children:s}),e[0]=s,e[1]=c):c=e[1];let h;e[2]!==c||e[3]!==r?(h=a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[c,r]}),e[2]=c,e[3]=r,e[4]=h):h=e[4];let p;e[5]!==i?(p=i("decoServe.changes.hint"),e[5]=i,e[6]=p):p=e[6];let b;e[7]!==p?(b=a.jsx("p",{className:"text-2xs text-muted-foreground",children:a.jsx(Jr,{text:p})}),e[7]=p,e[8]=b):b=e[8];let f;e[9]!==i?(f=i("decoServe.changes.close"),e[9]=i,e[10]=f):f=e[10];let m;e[11]!==d||e[12]!==f?(m=a.jsx(ve,{type:"button",variant:"outline",className:"w-full",onClick:d,children:f}),e[11]=d,e[12]=f,e[13]=m):m=e[13];let g;e[14]!==b||e[15]!==m?(g=a.jsxs(a.Fragment,{children:[b,m]}),e[14]=b,e[15]=m,e[16]=g):g=e[16];let x;return e[17]!==n||e[18]!==u||e[19]!==h||e[20]!==g?(x=a.jsx(Gs,{state:u,header:h,body:n,footer:g}),e[17]=n,e[18]=u,e[19]=h,e[20]=g,e[21]=x):x=e[21],x}function Mc(t){const e=B.c(54),{orgSlug:s,virtualMcpId:r,branch:n,backend:o,cacheKey:d,onClose:l}=t,i=be();let u;e[0]!==n||e[1]!==s||e[2]!==r?(u={orgSlug:s,virtualMcpId:r,branch:n},e[0]=n,e[1]=s,e[2]=r,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=Bn(c);let p;e[8]!==n||e[9]!==s||e[10]!==h.refresh||e[11]!==r?(p={orgSlug:s,virtualMcpId:r,branch:n,refresh:h.refresh},e[8]=n,e[9]=s,e[10]=h.refresh,e[11]=r,e[12]=p):p=e[12];const b=Hl(p),f=kr(s,r).phase==="saving",m=o.describe.readOnly,[g,x]=q.useState(null),[P,j]=q.useState(null),[y,S]=q.useState(!1),{summary:w}=h;let k,N,C,v,A;if(e[13]!==g||e[14]!==o||e[15]!==P||e[16]!==b||e[17]!==y||e[18]!==f||e[19]!==m||e[20]!==h.blocks||e[21]!==h.entries||e[22]!==h.sidesFailed||e[23]!==h.sidesPending||e[24]!==w.blocks||e[25]!==w.count||e[26]!==w.pages||e[27]!==i){const M=[...w.pages,...w.blocks],$=M.find(E=>ke(E)===g)??M[0]??null;let H;e[33]!==w.count||e[34]!==i?(H=w.count===0?i("decoServe.changes.title"):w.count===1?i("decoServe.changes.titleOne"):i("decoServe.changes.titleCount",{count:w.count}),e[33]=w.count,e[34]=i,e[35]=H):H=e[35],A=H;const O=(E,W)=>W.length===0?null:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:E}),W.map(F=>{const V=ke(F);return a.jsx(ca,{change:F,bodyPending:h.sidesPending,v8:!0,selected:$!==null&&ke($)===V,onSelect:()=>x(V),confirming:P===V,onConfirmingChange:te=>j(te?V:null),onDiscard:m||!F.entry?void 0:()=>{b(o,[F.entry],i("thread.publishPopover.discarded",{name:F.name}))},isPublishing:!1,isDiscarding:f},V)})]});let G;e[36]!==o||e[37]!==b||e[38]!==y||e[39]!==f||e[40]!==m||e[41]!==h.entries||e[42]!==w.count||e[43]!==i?(G=m||w.count<=1?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>S(!0),disabled:f,children:i("thread.publishPopover.discardAll")}),a.jsx(Bs,{open:y,onOpenChange:S,children:a.jsxs(Ds,{children:[a.jsxs(Cs,{children:[a.jsx(ks,{children:i("thread.publishPopover.discardAllTitle")}),a.jsx(Ns,{children:i("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(Ts,{children:[a.jsx(As,{children:i("thread.publishDialog.cancel")}),a.jsx(Rs,{onClick:()=>{b(o,h.entries,i("thread.publishDialog.allChangesDiscarded"))},disabled:f,className:K(vr({variant:"destructive"})),children:i("thread.publishPopover.discardAll")})]})]})})]}),e[36]=o,e[37]=b,e[38]=y,e[39]=f,e[40]=m,e[41]=h.entries,e[42]=w.count,e[43]=i,e[44]=G):G=e[44],C=G,N=w.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(wn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:i("decoServe.changes.empty")})]}):a.jsxs(us,{children:[O(i("thread.publishPopover.pagesGroup"),w.pages),O(i("thread.publishPopover.blocksGroup"),w.blocks),h.sidesFailed?a.jsx("p",{className:"text-2xs text-muted-foreground",children:i("thread.publishPopover.detailsUnavailable")}):null]}),k=ms,v=$?a.jsx("div",{className:K(ts,"relative flex"),children:a.jsx(pa,{change:$,diff:null,bodyPending:h.sidesPending,previewServerUrl:null,draft:null,lastPage:null,v8:{blocks:h.blocks}},ke($))}):a.jsx("div",{className:K(ts,"bg-muted/40")}),e[13]=g,e[14]=o,e[15]=P,e[16]=b,e[17]=y,e[18]=f,e[19]=m,e[20]=h.blocks,e[21]=h.entries,e[22]=h.sidesFailed,e[23]=h.sidesPending,e[24]=w.blocks,e[25]=w.count,e[26]=w.pages,e[27]=i,e[28]=k,e[29]=N,e[30]=C,e[31]=v,e[32]=A}else k=e[28],N=e[29],C=e[30],v=e[31],A=e[32];let T;e[45]!==N||e[46]!==C||e[47]!==l||e[48]!==A?(T=a.jsx(on,{title:A,trailing:C,body:N,onClose:l}),e[45]=N,e[46]=C,e[47]=l,e[48]=A,e[49]=T):T=e[49];let I;return e[50]!==k||e[51]!==v||e[52]!==T?(I=a.jsx(k,{pane:v,list:T}),e[50]=k,e[51]=v,e[52]=T,e[53]=I):I=e[53],I}function _c(t){const e=B.c(5),{virtualMcpId:s,branch:r}=t,n=be(),o=Bt(s,r);if(!Ec(o))return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(st,{asChild:!0,children:a.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=a.jsxs(tt,{children:[d,a.jsx(nt,{side:"bottom",className:"max-w-xs",children:l})]}),e[3]=l,e[4]=i):i=e[4],i}function Ec(t){return t.kind==="protocol"?t.hasSchema!==!1:t.kind==="unavailable"&&t.source!=="local"}function zc(t){const e=B.c(11),{virtualMcpId:s,branch:r}=t,n=be(),o=Bt(s,r);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=a.jsx(st,{asChild:!0,children:a.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=a.jsx(nt,{side:"bottom",className:"max-w-xs",children:a.jsx(Jr,{text:u})}),e[6]=u,e[7]=c):c=e[7];let h;return e[8]!==i||e[9]!==c?(h=a.jsxs(tt,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=h):h=e[10],h}function Uc(t){return t.servingLocally||t.localPreview?"open":t.runtimeResolved?t.runtime!=="cms"?"open":t.branch?t.blocksV8?"open":t.defaultBranch?t.defaultBranch===t.branch?"blocked":"open":t.listedDraft||t.defaultBranch===null?"open":"pending":"pending":"pending"}function qc(){const t=B.c(27),e=ns(),{org:s}=hs(),r=Ks(e?.virtualMcpId),n=r?.id??e?.virtualMcpId??"",o=e?.currentBranch??null,{runtime:d,resolved:l}=fs(r?.id),i=vn(r?.id),{url:u}=fn(r?.id),{connection:c}=mn(n||null),h=!!r&&!!o&&l&&d==="cms"&&!i&&!u,p=o??"",b=e?.taskId??null;let f,m,g,x;t[0]!==s.slug||t[1]!==p||t[2]!==b||t[3]!==n?(m={orgSlug:s.slug,virtualMcpId:n,branch:p,threadId:b},f=Hc,x=ft,g=Sn(m),t[0]=s.slug,t[1]=p,t[2]=b,t[3]=n,t[4]=f,t[5]=m,t[6]=g,t[7]=x):(f=t[4],m=t[5],g=t[6],x=t[7]);let P;t[8]!==f||t[9]!==m?(P=(T,I)=>f(I?.queryKey)===f(Cn(m))?T:void 0,t[8]=f,t[9]=m,t[10]=P):P=t[10];let j;t[11]!==h||t[12]!==g||t[13]!==P?(j={...g,enabled:h,placeholderData:P},t[11]=h,t[12]=g,t[13]=P,t[14]=j):j=t[14];const y=x(j),S=!!u,w=!!c;let k;if(t[15]!==i||t[16]!==o||t[17]!==r?.metadata?.releases||t[18]!==l||t[19]!==d||t[20]!==y.data||t[21]!==y.isError||t[22]!==S||t[23]!==w){let T;t[25]!==o?(T=I=>I.branch===o,t[25]=o,t[26]=T):T=t[26],k=Uc({runtime:d,runtimeResolved:l,blocksV8:i,localPreview:S,servingLocally:w,branch:o,listedDraft:(r?.metadata?.releases??[]).some(T),defaultBranch:y.data?y.data.base??null:y.isError?null:void 0}),t[15]=i,t[16]=o,t[17]=r?.metadata?.releases,t[18]=l,t[19]=d,t[20]=y.data,t[21]=y.isError,t[22]=S,t[23]=w,t[24]=k}else k=t[24];const N=k,C=`${n}:${o??""}`,[v,A]=q.useState(null);return N!=="pending"&&(v?.key!==C||v.gate!==N)&&A({key:C,gate:N}),N==="pending"&&v?.key===C?v.gate:N}function Hc(t){return t?.[2]}function Kc(t){const e=!t.hasEntity&&!t.servingLocally,s=t.hasEntity&&!t.localPreview&&!t.servingLocally&&!t.onProduction&&t.showsRepositoryActions;return{hidden:e,localFiles:!e&&t.servingLocally,draftSelect:!e&&t.hasEntity,publish:e||!s?null:t.runtime==="cms"?"cms":"code"}}function Md(t){const e=B.c(2),{blocksOnly:s}=t;let r;return e[0]!==s?(r=s?a.jsx(Vc,{}):a.jsx(Pa,{}),e[0]=s,e[1]=r):r=e[1],r}function Vc(){return vn(fi())?a.jsx(fa,{value:!1,children:a.jsx(Pa,{})}):null}function Pa(){const t=B.c(32),e=ns(),{org:s}=hs(),r=Ks(e?.virtualMcpId),n=e?.currentBranch??null,o=fs(r?.id).runtime,{url:d}=fn(r?.id),{connection:l}=mn(r?.id??e?.virtualMcpId),i=r?.id??e?.virtualMcpId,u=qc()!=="open",c=!!r,h=!!l,p=!!d;let b;t[0]!==r||t[1]!==u||t[2]!==o||t[3]!==c||t[4]!==h||t[5]!==p?(b=Kc({hasEntity:c,servingLocally:h,localPreview:p,showsRepositoryActions:!!r&&hi(r),runtime:o,onProduction:u}),t[0]=r,t[1]=u,t[2]=o,t[3]=c,t[4]=h,t[5]=p,t[6]=b):b=t[6];const f=b;if(!i||f.hidden)return null;let m;t[7]!==n||t[8]!==i?(m=a.jsx(_c,{virtualMcpId:i,branch:n}),t[7]=n,t[8]=i,t[9]=m):m=t[9];let g;t[10]!==n||t[11]!==f.localFiles||t[12]!==i?(g=f.localFiles&&a.jsx(zc,{virtualMcpId:i,branch:n}),t[10]=n,t[11]=f.localFiles,t[12]=i,t[13]=g):g=t[13];let x;t[14]!==n||t[15]!==s||t[16]!==f.localFiles||t[17]!==i?(x=f.localFiles&&a.jsx(Oc,{orgSlug:s.slug,virtualMcpId:i,branch:n}),t[14]=n,t[15]=s,t[16]=f.localFiles,t[17]=i,t[18]=x):x=t[18];let P;t[19]!==n||t[20]!==r||t[21]!==f.draftSelect?(P=r&&f.draftSelect&&a.jsx("div",{className:"flex min-w-0 shrink items-center justify-end",children:a.jsx(Li,{virtualMcp:r,currentBranch:n})}),t[19]=n,t[20]=r,t[21]=f.draftSelect,t[22]=P):P=t[22];let j;t[23]!==r||t[24]!==f.publish?(j=r&&f.publish&&a.jsxs(a.Fragment,{children:[a.jsx(Ea,{orientation:"vertical",className:"mx-1 data-[orientation=vertical]:h-4"}),a.jsx("div",{className:"flex shrink-0 items-center justify-end gap-1",children:f.publish==="cms"?a.jsx(wc,{virtualMcpId:r.id}):a.jsx(Lc,{virtualMcpId:r.id})})]}),t[23]=r,t[24]=f.publish,t[25]=j):j=t[25];let y;return t[26]!==m||t[27]!==g||t[28]!==x||t[29]!==P||t[30]!==j?(y=a.jsxs(a.Fragment,{children:[m,g,x,P,j]}),t[26]=m,t[27]=g,t[28]=x,t[29]=P,t[30]=j,t[31]=y):y=t[31],y}export{Md as S,qc as a,Ci as u};
@@ -1 +1 @@
1
- import{c as I,j as r,n as v,b as M,a4 as P,bi as R}from"./index-CpKrWBFM.js";import{E as T}from"./empty-state-BMJVmWPT.js";import{u as w}from"./chat-context-CkHIxm7-.js";import{u as B,k as L,t as _}from"./site-editor-toast-BzBdZBKk.js";import{i as $,u as A,j as Q,S as U}from"./blocks-tab-states-UGg2OTih.js";import{a as G}from"./autosend-C7zfiAZa.js";function H(C){const e=I.c(7),{icon:l,title:i,description:t,action:n}=C;let a;e[0]!==n?(a=n?{children:n.label,onClick:n.onClick,disabled:n.disabled}:void 0,e[0]=n,e[1]=a):a=e[1];let o;return e[2]!==t||e[3]!==l||e[4]!==a||e[5]!==i?(o=r.jsx(v,{children:r.jsx(v.Content,{children:r.jsx(v.Container,{children:r.jsx(T,{icon:l,title:i,description:t,buttonProps:a})})})}),e[2]=t,e[3]=l,e[4]=a,e[5]=i,e[6]=o):o=e[6],o}function Y(C){const e=I.c(33),{virtualMcpId:l,icon:i,copy:t,skeleton:n,children:a}=C,o=M(),{org:p}=P(),k=w(),u=k?.currentBranch??null,g=B(l,u);R(g.kind==="protocol"&&g.source==="github");const{openPanel:D}=G();if(!u){const s=t.noDraftTitle,F=t.noDraftDesc;let d;e[0]!==o?(d=o("sectionsEditor.namedRules.openEditor"),e[0]=o,e[1]=d):d=e[1];let f;e[2]!==D?(f=()=>D("content"),e[2]=D,e[3]=f):f=e[3];let m;e[4]!==d||e[5]!==f?(m={label:d,onClick:f},e[4]=d,e[5]=f,e[6]=m):m=e[6];let j;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==i||e[10]!==m?(j=r.jsx(H,{icon:i,title:s,description:F,action:m}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=i,e[10]=m,e[11]=j):j=e[11],j}if($(g)){let s;return e[12]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(U,{}),e[12]=s):s=e[12],s}if(g.kind==="pending"){let s;return e[13]!==n?(s=r.jsx(r.Fragment,{children:n}),e[13]=n,e[14]=s):s=e[14],s}if(g.kind!=="protocol"){let s;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==i?(s=r.jsx(H,{icon:i,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=i,e[18]=s):s=e[18],s}let c;e[19]!==u||e[20]!==p.slug||e[21]!==l?(c=JSON.stringify([p.slug,l,u]),e[19]=u,e[20]=p.slug,e[21]=l,e[22]=c):c=e[22];const h=k?.taskId??null;let x;return e[23]!==u||e[24]!==a||e[25]!==t||e[26]!==i||e[27]!==p.slug||e[28]!==n||e[29]!==c||e[30]!==h||e[31]!==l?(x=r.jsx(J,{orgSlug:p.slug,virtualMcpId:l,branch:u,threadId:h,icon:i,copy:t,skeleton:n,children:a},c),e[23]=u,e[24]=a,e[25]=t,e[26]=i,e[27]=p.slug,e[28]=n,e[29]=c,e[30]=h,e[31]=l,e[32]=x):x=e[32],x}function J(C){const e=I.c(35),{orgSlug:l,virtualMcpId:i,branch:t,threadId:n,icon:a,copy:o,skeleton:p,children:k}=C,u=M();let g;e[0]!==t||e[1]!==l||e[2]!==n||e[3]!==i?(g={orgSlug:l,virtualMcpId:i,branch:t,threadId:n,previewUrl:null},e[0]=t,e[1]=l,e[2]=n,e[3]=i,e[4]=g):g=e[4];const D=g,c=L(D),h=A(D),x=c.data,s=h.data;let F;e[5]!==t||e[6]!==l||e[7]!==i?(F={orgSlug:l,virtualMcpId:i,branch:t},e[5]=t,e[6]=l,e[7]=i,e[8]=F):F=e[8];const d=_(F,Q);if(!x||!s||!d.ready){if(c.isError||h.isError||d.failed){const N=o.loadFailed,O=o.loadFailedHint;let b;e[9]!==u?(b=u("sectionsEditor.namedRules.tryAgain"),e[9]=u,e[10]=b):b=e[10];let E;e[11]!==c||e[12]!==d||e[13]!==h?(E=()=>{c.isError&&c.refetch(),h.isError&&h.refetch(),d.failed&&d.retry()},e[11]=c,e[12]=d,e[13]=h,e[14]=E):E=e[14];let S;e[15]!==b||e[16]!==E?(S={label:b,onClick:E},e[15]=b,e[16]=E,e[17]=S):S=e[17];let y;return e[18]!==o.loadFailed||e[19]!==o.loadFailedHint||e[20]!==a||e[21]!==S?(y=r.jsx(H,{icon:a,title:N,description:O,action:S}),e[18]=o.loadFailed,e[19]=o.loadFailedHint,e[20]=a,e[21]=S,e[22]=y):y=e[22],y}let j;return e[23]!==p?(j=r.jsx(r.Fragment,{children:p}),e[23]=p,e[24]=j):j=e[24],j}let f;e[25]!==t||e[26]!==k||e[27]!==x||e[28]!==s||e[29]!==l||e[30]!==n||e[31]!==i?(f=k({orgSlug:l,virtualMcpId:i,branch:t,threadId:n,decofile:x,meta:s}),e[25]=t,e[26]=k,e[27]=x,e[28]=s,e[29]=l,e[30]=n,e[31]=i,e[32]=f):f=e[32];let m;return e[33]!==f?(m=r.jsx(r.Fragment,{children:f}),e[33]=f,e[34]=m):m=e[34],m}export{H as S,Y as a};
1
+ import{c as I,j as r,n as v,b as M,a4 as P,bi as R}from"./index-B1ZvlDM_.js";import{E as T}from"./empty-state-BY5AuJfU.js";import{u as w}from"./chat-context-CMznzxL2.js";import{u as B,k as L,t as _}from"./site-editor-toast-C2KJeS5V.js";import{i as $,u as A,j as Q,S as U}from"./blocks-tab-states-CWrGlMnv.js";import{a as G}from"./autosend-DPIl8Ow-.js";function H(C){const e=I.c(7),{icon:l,title:i,description:t,action:n}=C;let a;e[0]!==n?(a=n?{children:n.label,onClick:n.onClick,disabled:n.disabled}:void 0,e[0]=n,e[1]=a):a=e[1];let o;return e[2]!==t||e[3]!==l||e[4]!==a||e[5]!==i?(o=r.jsx(v,{children:r.jsx(v.Content,{children:r.jsx(v.Container,{children:r.jsx(T,{icon:l,title:i,description:t,buttonProps:a})})})}),e[2]=t,e[3]=l,e[4]=a,e[5]=i,e[6]=o):o=e[6],o}function Y(C){const e=I.c(33),{virtualMcpId:l,icon:i,copy:t,skeleton:n,children:a}=C,o=M(),{org:p}=P(),k=w(),u=k?.currentBranch??null,g=B(l,u);R(g.kind==="protocol"&&g.source==="github");const{openPanel:D}=G();if(!u){const s=t.noDraftTitle,F=t.noDraftDesc;let d;e[0]!==o?(d=o("sectionsEditor.namedRules.openEditor"),e[0]=o,e[1]=d):d=e[1];let f;e[2]!==D?(f=()=>D("content"),e[2]=D,e[3]=f):f=e[3];let m;e[4]!==d||e[5]!==f?(m={label:d,onClick:f},e[4]=d,e[5]=f,e[6]=m):m=e[6];let j;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==i||e[10]!==m?(j=r.jsx(H,{icon:i,title:s,description:F,action:m}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=i,e[10]=m,e[11]=j):j=e[11],j}if($(g)){let s;return e[12]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(U,{}),e[12]=s):s=e[12],s}if(g.kind==="pending"){let s;return e[13]!==n?(s=r.jsx(r.Fragment,{children:n}),e[13]=n,e[14]=s):s=e[14],s}if(g.kind!=="protocol"){let s;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==i?(s=r.jsx(H,{icon:i,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=i,e[18]=s):s=e[18],s}let c;e[19]!==u||e[20]!==p.slug||e[21]!==l?(c=JSON.stringify([p.slug,l,u]),e[19]=u,e[20]=p.slug,e[21]=l,e[22]=c):c=e[22];const h=k?.taskId??null;let x;return e[23]!==u||e[24]!==a||e[25]!==t||e[26]!==i||e[27]!==p.slug||e[28]!==n||e[29]!==c||e[30]!==h||e[31]!==l?(x=r.jsx(J,{orgSlug:p.slug,virtualMcpId:l,branch:u,threadId:h,icon:i,copy:t,skeleton:n,children:a},c),e[23]=u,e[24]=a,e[25]=t,e[26]=i,e[27]=p.slug,e[28]=n,e[29]=c,e[30]=h,e[31]=l,e[32]=x):x=e[32],x}function J(C){const e=I.c(35),{orgSlug:l,virtualMcpId:i,branch:t,threadId:n,icon:a,copy:o,skeleton:p,children:k}=C,u=M();let g;e[0]!==t||e[1]!==l||e[2]!==n||e[3]!==i?(g={orgSlug:l,virtualMcpId:i,branch:t,threadId:n,previewUrl:null},e[0]=t,e[1]=l,e[2]=n,e[3]=i,e[4]=g):g=e[4];const D=g,c=L(D),h=A(D),x=c.data,s=h.data;let F;e[5]!==t||e[6]!==l||e[7]!==i?(F={orgSlug:l,virtualMcpId:i,branch:t},e[5]=t,e[6]=l,e[7]=i,e[8]=F):F=e[8];const d=_(F,Q);if(!x||!s||!d.ready){if(c.isError||h.isError||d.failed){const N=o.loadFailed,O=o.loadFailedHint;let b;e[9]!==u?(b=u("sectionsEditor.namedRules.tryAgain"),e[9]=u,e[10]=b):b=e[10];let E;e[11]!==c||e[12]!==d||e[13]!==h?(E=()=>{c.isError&&c.refetch(),h.isError&&h.refetch(),d.failed&&d.retry()},e[11]=c,e[12]=d,e[13]=h,e[14]=E):E=e[14];let S;e[15]!==b||e[16]!==E?(S={label:b,onClick:E},e[15]=b,e[16]=E,e[17]=S):S=e[17];let y;return e[18]!==o.loadFailed||e[19]!==o.loadFailedHint||e[20]!==a||e[21]!==S?(y=r.jsx(H,{icon:a,title:N,description:O,action:S}),e[18]=o.loadFailed,e[19]=o.loadFailedHint,e[20]=a,e[21]=S,e[22]=y):y=e[22],y}let j;return e[23]!==p?(j=r.jsx(r.Fragment,{children:p}),e[23]=p,e[24]=j):j=e[24],j}let f;e[25]!==t||e[26]!==k||e[27]!==x||e[28]!==s||e[29]!==l||e[30]!==n||e[31]!==i?(f=k({orgSlug:l,virtualMcpId:i,branch:t,threadId:n,decofile:x,meta:s}),e[25]=t,e[26]=k,e[27]=x,e[28]=s,e[29]=l,e[30]=n,e[31]=i,e[32]=f):f=e[32];let m;return e[33]!==f?(m=r.jsx(r.Fragment,{children:f}),e[33]=f,e[34]=m):m=e[34],m}export{H as S,Y as a};