decocms 4.425.0 → 4.426.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 (385) hide show
  1. package/dist/client/assets/{AlertCircle-CQU3FO2-.js → AlertCircle-Dh9lwUAJ.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Caz7K4-P.js → AreaChart-CjdJMEma.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-r9k0gxde.js → ArrowLeft-BGYsJwr2.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CJiUKB0e.js → ArrowRight-9nkv_n33.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-D1uaoIEr.js → ArrowUp-BEUKMR1b.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-CsM3ceFL.js → CartesianChart-DomSSzyF.js} +1 -1
  7. package/dist/client/assets/{Check-soPAeKca.js → Check-C7XCKaVD.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-BdRkKVcj.js → CheckCircle-ChjcsQ6e.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-B4upaCys.js → ChevronUp-BLjBJuX1.js} +1 -1
  10. package/dist/client/assets/{Copy01-Ck1CQt9c.js → Copy01-COSj2yl3.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-C5LQldm8.js → CreditCard01-c7ALaNdl.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DMsZySzr.js → DotsVertical-BY6GOg69.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-bwtijj2s.js → ErrorBarContext-C6Ka2dZX.js} +1 -1
  14. package/dist/client/assets/{Image01-AxefwT4b.js → Image01-BUoc7dul.js} +1 -1
  15. package/dist/client/assets/{Key01-V9W0a2Yy.js → Key01-CpDPClSw.js} +1 -1
  16. package/dist/client/assets/{Line-CPF3zU9K.js → Line-CREaQkr3.js} +1 -1
  17. package/dist/client/assets/{Link01-C9tHLmLh.js → Link01-Cl8TmSAu.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CkkaHQ43.js → LinkExternal01-BpwEo5mX.js} +1 -1
  19. package/dist/client/assets/{Monitor01-DYA_QMf2.js → Monitor01-DjVxT7Ye.js} +1 -1
  20. package/dist/client/assets/{Palette-Bk3UCvKx.js → Palette-qYxOT-Eu.js} +1 -1
  21. package/dist/client/assets/{Plus-kHt_8stA.js → Plus-coArzCGt.js} +1 -1
  22. package/dist/client/assets/{SearchMd-DFB2ha4T.js → SearchMd-D7DbuO-r.js} +1 -1
  23. package/dist/client/assets/{Sector-D22gYKYq.js → Sector-CO3EFLIZ.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-IkLiZTCG.js → ShoppingBag01-Dutlk1ra.js} +1 -1
  25. package/dist/client/assets/{Sun-CttdH4aG.js → Sun-BVBkARhS.js} +1 -1
  26. package/dist/client/assets/{Tool01-BVUW3itu.js → Tool01-fHsiwx5R.js} +1 -1
  27. package/dist/client/assets/{Trash01-CKOL_3ja.js → Trash01-B9q9XwwI.js} +1 -1
  28. package/dist/client/assets/{Upload01-DlR8CSo4.js → Upload01-CphgSD0x.js} +1 -1
  29. package/dist/client/assets/{User01-dc7WIl5M.js → User01-CMYGXzFL.js} +1 -1
  30. package/dist/client/assets/{UserSquare-D1bS09Fm.js → UserSquare-CAix9ifC.js} +1 -1
  31. package/dist/client/assets/{Users01-BaIVzoZ3.js → Users01-DPFEioN5.js} +1 -1
  32. package/dist/client/assets/{X-Dp6J1NZk.js → X-Dt1AZixL.js} +1 -1
  33. package/dist/client/assets/{XAxis-B8-Lgf5y.js → XAxis-KeaaSo7A.js} +1 -1
  34. package/dist/client/assets/{XClose-CVE8Vs6Q.js → XClose-B9Q2XRVd.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-ekFDVqJi.js → ZoomOut-PSTvj6r8.js} +1 -1
  36. package/dist/client/assets/{access-gate-DVZHCUBi.js → access-gate-1aCLkdeG.js} +1 -1
  37. package/dist/client/assets/{add-connection-dialog-B-zUvMaq.js → add-connection-dialog-CzZDruYr.js} +1 -1
  38. package/dist/client/assets/agent-analytics-CWZFiPCw.js +2 -0
  39. package/dist/client/assets/agent-app-8SMd_DwT.js +1 -0
  40. package/dist/client/assets/agent-assets-DLcrq17_.js +1 -0
  41. package/dist/client/assets/{agent-automation-Bj4sGNvm.js → agent-automation-BheAYOxQ.js} +2 -2
  42. package/dist/client/assets/agent-automations-BBHKFwf5.js +1 -0
  43. package/dist/client/assets/agent-connect-sources-DOLP3sAe.js +1 -0
  44. package/dist/client/assets/agent-deck-B_OTY_ON.js +1 -0
  45. package/dist/client/assets/agent-e2e-BwaP7Ol7.js +1 -0
  46. package/dist/client/assets/agent-experiments-uazbcmJ1.js +1 -0
  47. package/dist/client/assets/agent-file-ClIiGvtE.js +1 -0
  48. package/dist/client/assets/{agent-git-BcKeYOTv.js → agent-git-CJpnrZtD.js} +2 -2
  49. package/dist/client/assets/agent-hosting-VrZ6s8Mj.js +1 -0
  50. package/dist/client/assets/{agent-icon-C8wu-T9B.js → agent-icon-Cju9Okbj.js} +1 -1
  51. package/dist/client/assets/agent-library-AbCCGd2u.js +1 -0
  52. package/dist/client/assets/agent-library-file-BX8G-q2Z.js +1 -0
  53. package/dist/client/assets/agent-monitor-zqfxBaH-.js +1 -0
  54. package/dist/client/assets/agent-overview-DCKnKeTr.js +1 -0
  55. package/dist/client/assets/agent-settings-DcXtdgfi.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-BManvh2p.js → agent-site-editor-CG-imoFz.js} +2 -2
  57. package/dist/client/assets/agent-site-editor-code-ZkCFJITj.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-DVWOt-Lp.js → agent-site-editor-content-dfB0FrOl.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-DqrFB9eA.js → agent-site-editor-preview-BSlCBpoz.js} +3 -3
  60. package/dist/client/assets/{agent-view-guard-DP6rr7-6.js → agent-view-guard-CMzjdLr_.js} +1 -1
  61. package/dist/client/assets/agent-view-qJLawiIP.js +1 -0
  62. package/dist/client/assets/{agents-list-BHJZEiO4.js → agents-list-C3UyUc19.js} +1 -1
  63. package/dist/client/assets/{ai-providers-BU1J8_R5.js → ai-providers-Dw19IBmh.js} +1 -1
  64. package/dist/client/assets/{alert-B_aVDXWu.js → alert-DMoz9rms.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-DJcNPQjm.js → alert-dialog-dGExRb-e.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-BXAEbLgR.js → analytics-sections-H0bMI5TT.js} +1 -1
  67. package/dist/client/assets/api-keys-1N7itRHA.js +1 -0
  68. package/dist/client/assets/{api-keys-yyXIMQJI.js → api-keys-CAGHyjGG.js} +1 -1
  69. package/dist/client/assets/app-editor-R5yzsqfq.js +1 -0
  70. package/dist/client/assets/{asset-utils-BV839mqx.js → asset-utils-m3RtaS65.js} +1 -1
  71. package/dist/client/assets/{auth-i4uSZxqM.js → auth-AjdxyXQQ.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-B38U7kv-.js → auth-catchall-CFm9414S.js} +1 -1
  73. package/dist/client/assets/{auth-entry-CKSK4iYs.js → auth-entry-DgYkGEvE.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-D02-xSkU.js → auth-split-layout-CKwfbNYt.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-D-PqEdfN.js → authenticate-and-persist-oauth-qbq5LuiV.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-Cj0lVdtQ.js → automation-list-row-Dh3DCjT7.js} +1 -1
  77. package/dist/client/assets/{automation-runs-BNfzkXtY.js → automation-runs-2dGVqxIx.js} +1 -1
  78. package/dist/client/assets/{automations-CcA3VvLO.js → automations-BPw-0_2G.js} +1 -1
  79. package/dist/client/assets/{autosend-BgamBAXS.js → autosend-DtAhWrvb.js} +1 -1
  80. package/dist/client/assets/{avatar-By9-J1G7.js → avatar-BugbqVXb.js} +1 -1
  81. package/dist/client/assets/{badge-BLmau0Ea.js → badge-D1nBHfyl.js} +1 -1
  82. package/dist/client/assets/{block-document-DNf3E-rZ.js → block-document-CxKjCcIO.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-Dp3GVv9B.js → blocks-preview-workspace-context-CtTYA1qe.js} +1 -1
  84. package/dist/client/assets/{buckets-CfOh79gF.js → buckets-CnRzWdap.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-bnw-geKz.js → build-improve-prompt-doc-Bqv4jK3j.js} +1 -1
  86. package/dist/client/assets/{calendar-C_3zvYnn.js → calendar-4zS_oOft.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-_sxFuxMW.js → capability-load-error-CDEMn6wp.js} +1 -1
  88. package/dist/client/assets/category-editor-C2JizcgQ.js +1 -0
  89. package/dist/client/assets/{chart-DUDR_GLh.js → chart-UpLMYPC1.js} +1 -1
  90. package/dist/client/assets/{chat-context-DSOY14Dl.js → chat-context-iBhAWaTl.js} +1 -1
  91. package/dist/client/assets/{chat-draft-Db3gWleH.js → chat-draft-2b__RL23.js} +1 -1
  92. package/dist/client/assets/{checkbox-YgstniWn.js → checkbox-9Hass2fp.js} +1 -1
  93. package/dist/client/assets/{choose-editor-Cvv0YS80.js → choose-editor-4VkBBo9f.js} +1 -1
  94. package/dist/client/assets/{claim-phase-copy-Byy3Q6us.js → claim-phase-copy-Cu7y7gag.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-CF33WEDl.js → cli-auth-success-DYkPcG65.js} +1 -1
  96. package/dist/client/assets/{client-icons-3lGatXeB.js → client-icons-D1yY3hrH.js} +1 -1
  97. package/dist/client/assets/{collapsible-Pi90xi-e.js → collapsible-CLujQiBB.js} +1 -1
  98. package/dist/client/assets/{collection-detail-DHdecaB7.js → collection-detail-CSQIvwEO.js} +1 -1
  99. package/dist/client/assets/{collection-display-button-Cb5VEBCx.js → collection-display-button-Bp5cubVL.js} +1 -1
  100. package/dist/client/assets/{collection-search-CZPfBwnt.js → collection-search-RCkR7knL.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-CR8wWqYX.js → collection-table-wrapper-CRdyF4Ce.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-CDyR4kzk.js → collection-tabs-BOAoqV16.js} +1 -1
  103. package/dist/client/assets/{combobox-BIrYGyuF.js → combobox-B3MSOcaK.js} +1 -1
  104. package/dist/client/assets/{command-DxWpNp1x.js → command-Ca_7Byfo.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section-BT3BpapS.js → companion-mcps-section-DGYlCg35.js} +1 -1
  106. package/dist/client/assets/{config-BfXHrI3c.js → config-B-Fm6YG0.js} +1 -1
  107. package/dist/client/assets/{connect-BaV0v-Tu.js → connect-D6q-DV5B.js} +1 -1
  108. package/dist/client/assets/{connect-layout-BUm5geCN.js → connect-layout-DoIJwbJx.js} +1 -1
  109. package/dist/client/assets/{connection-sgm4TBxZ.js → connection-BZR_b2EN.js} +1 -1
  110. package/dist/client/assets/{connection-card-KlghLDwU.js → connection-card-BCurehFX.js} +1 -1
  111. package/dist/client/assets/{connection-detail-DclD8xq_.js → connection-detail-DFi0lXEc.js} +1 -1
  112. package/dist/client/assets/{connection-form-helpers-i009QpGu.js → connection-form-helpers-BJ_8FXIG.js} +1 -1
  113. package/dist/client/assets/{connections-_X80BGGI.js → connections-QHuZp1-J.js} +1 -1
  114. package/dist/client/assets/context-Bv0D5-Uj.js +1 -0
  115. package/dist/client/assets/{create-organization-dialog-DhSGIMf_.js → create-organization-dialog-IH2noFuZ.js} +1 -1
  116. package/dist/client/assets/{decopilot-ZxSRkfiB.js → decopilot-D626jWMz.js} +1 -1
  117. package/dist/client/assets/{dialog-1dafL4bi.js → dialog-BAKH_-im.js} +1 -1
  118. package/dist/client/assets/discover-DJLBtlMy.js +1 -0
  119. package/dist/client/assets/{domain-settings-CGpwkGbK.js → domain-settings-LFpXpUtA.js} +1 -1
  120. package/dist/client/assets/{download-app-dialog-BcCXsaD8.js → download-app-dialog-DPWcze5R.js} +1 -1
  121. package/dist/client/assets/{drawer-wrrjDRlR.js → drawer-D6W2ZApA.js} +1 -1
  122. package/dist/client/assets/{editor-BiYdYoAb.js → editor-DfRgyxZb.js} +1 -1
  123. package/dist/client/assets/{empty-state-LYCOTuMl.js → empty-state-DBsD3RKy.js} +1 -1
  124. package/dist/client/assets/{empty-state-Ck9uwtW-.js → empty-state-L1uIcmaC.js} +1 -1
  125. package/dist/client/assets/{extract-connection-data-Cm7kjryi.js → extract-connection-data-B2HBCx7f.js} +1 -1
  126. package/dist/client/assets/{feature-gate-VDho3P9i.js → feature-gate-DPOwo3io.js} +1 -1
  127. package/dist/client/assets/{feature-paywall-O59PQJQ4.js → feature-paywall-CZbbYxob.js} +1 -1
  128. package/dist/client/assets/{file-explorer-M_603rD8.js → file-explorer-C6CV7wTj.js} +1 -1
  129. package/dist/client/assets/{file-preview-DNv-TeY5.js → file-preview-CDV38dJ5.js} +1 -1
  130. package/dist/client/assets/{file-share-button-CcJT8SCR.js → file-share-button-CcTG-Rnk.js} +1 -1
  131. package/dist/client/assets/{file-type-icon-buBDg-03.js → file-type-icon-Ec1QqaNx.js} +1 -1
  132. package/dist/client/assets/flat-project-653S9BeK.js +1 -0
  133. package/dist/client/assets/{folder-icon-Da9ULcDI.js → folder-icon-D9bi_tlQ.js} +1 -1
  134. package/dist/client/assets/{form-D5LPXjPj.js → form-CBoGvDdc.js} +1 -1
  135. package/dist/client/assets/{gateway-client-CeKj8qiL.js → gateway-client-CvISKT37.js} +1 -1
  136. package/dist/client/assets/{general-BPN087Lc.js → general-DYy7Wql9.js} +1 -1
  137. package/dist/client/assets/home-F-3beLau.js +1 -0
  138. package/dist/client/assets/{index-D88JS0Yx.js → index-B3_om_ve.js} +1 -1
  139. package/dist/client/assets/{index-D8akGTh4.js → index-BQBD06Wh.js} +1 -1
  140. package/dist/client/assets/{index-D5-xqq3P.js → index-BpSkcbyR.js} +1 -1
  141. package/dist/client/assets/{index-LgfzCRc4.js → index-BusYqxFz.js} +1 -1
  142. package/dist/client/assets/index-BxC54emP.js +10 -0
  143. package/dist/client/assets/{index-H2LrQn17.js → index-CZzi-MMq.js} +1 -1
  144. package/dist/client/assets/index-CoamuzBl.css +1 -0
  145. package/dist/client/assets/{index-D3__nJJk.js → index-Cz9ngF1R.js} +1 -1
  146. package/dist/client/assets/{index-CBLynFUh.js → index-DX_ORy-2.js} +1 -1
  147. package/dist/client/assets/{index-CeFrI_-f.js → index-DqR5nN5p.js} +8 -8
  148. package/dist/client/assets/{index-Ct9y-yVl.js → index-DuhdHeRI.js} +1 -1
  149. package/dist/client/assets/{index-Do5wILaI.js → index-RqXfa7FZ.js} +1 -1
  150. package/dist/client/assets/{index-MebkKt8H.js → index-SkTn342u.js} +1 -1
  151. package/dist/client/assets/{index-CY8bQG9C.js → index-VZYC9f6Y.js} +1 -1
  152. package/dist/client/assets/{index-DFK3AqOd.js → index-Vd7iTgVD.js} +1 -1
  153. package/dist/client/assets/{index-DJzoBp2L.js → index-cDs0qWSp.js} +1 -1
  154. package/dist/client/assets/{index-redirect-DNJpUKHR.js → index-redirect-Bq0S9TJ8.js} +1 -1
  155. package/dist/client/assets/{infiniteQueryObserver-DX9QHkGe.js → infiniteQueryObserver-Cug9ZMk0.js} +1 -1
  156. package/dist/client/assets/{infra-billing-CJc_xWtO.js → infra-billing-CeCsQNYD.js} +1 -1
  157. package/dist/client/assets/{input-C2XryqlS.js → input-05oF9Lbq.js} +1 -1
  158. package/dist/client/assets/{input-BLNFqzUM.js → input-BAlEkL74.js} +3 -3
  159. package/dist/client/assets/{input-CQlMbJrR.js → input-Buk-AyEm.js} +1 -1
  160. package/dist/client/assets/{integration-icon-60YSBd47.js → integration-icon-C2IglhA_.js} +1 -1
  161. package/dist/client/assets/{label-CTaphTs2.js → label-CerbhQb5.js} +1 -1
  162. package/dist/client/assets/{last-preview-page-vt2OtvKU.js → last-preview-page-DQXUWH3N.js} +1 -1
  163. package/dist/client/assets/{layout-COlkqmIQ.js → layout-DBLL0gbn.js} +1 -1
  164. package/dist/client/assets/{legacy-agents-deep-Ctzjouqt.js → legacy-agents-deep-CJWjMQYt.js} +1 -1
  165. package/dist/client/assets/{legacy-main-redirect-BaZYUmuc.js → legacy-main-redirect-BzyT0GCQ.js} +1 -1
  166. package/dist/client/assets/library-CeMGestS.js +1 -0
  167. package/dist/client/assets/{library-tab-D4iQdrlE.js → library-tab-CkLCm4AQ.js} +1 -1
  168. package/dist/client/assets/{login-QNIhU9dz.js → login-BlE85Tt-.js} +1 -1
  169. package/dist/client/assets/{markdown-Ck-11dhN.js → markdown-DN9FJYvL.js} +1 -1
  170. package/dist/client/assets/{mcp-app-renderer-BemaHPoe.js → mcp-app-renderer-Gt3_oNY0.js} +1 -1
  171. package/dist/client/assets/{mcp-oauth-DA7uY-37.js → mcp-oauth-D4EkuyvW.js} +1 -1
  172. package/dist/client/assets/{members-BEhHXB0V.js → members-t7upXcYE.js} +1 -1
  173. package/dist/client/assets/{message-templates-CX1OJ7C8.js → message-templates-_1ehs9jp.js} +1 -1
  174. package/dist/client/assets/{mini-report-page-s_c2MmRH.js → mini-report-page-AErQ23Qz.js} +1 -1
  175. package/dist/client/assets/{mock-board-DPOuVqy_.js → mock-board-3dn_zk_P.js} +1 -1
  176. package/dist/client/assets/{monaco-editor-CyLZqoPt.js → monaco-editor-YjPjw4dd.js} +1 -1
  177. package/dist/client/assets/{monitoring-stats-row-pkJdXLku.js → monitoring-stats-row-axTaoyNT.js} +1 -1
  178. package/dist/client/assets/{multi-select-CtEcT2Fm.js → multi-select-oCVVhjFs.js} +1 -1
  179. package/dist/client/assets/{mustache-BIygiTUj.js → mustache-BGVTVChV.js} +1 -1
  180. package/dist/client/assets/{new-project-dialog-BJkFsBCH.js → new-project-dialog-Db3wbOfy.js} +1 -1
  181. package/dist/client/assets/{oauth-callback-DLIV3MGz.js → oauth-callback-CvBiDgeP.js} +1 -1
  182. package/dist/client/assets/{oauth-callback-ai-provider-r46g0CGE.js → oauth-callback-ai-provider-BJJp8tI5.js} +1 -1
  183. package/dist/client/assets/{onboarding-BdNB509_.js → onboarding-DlTCKcYF.js} +1 -1
  184. package/dist/client/assets/openai-conversation-BMs24YX9.js +3 -0
  185. package/dist/client/assets/{optimistic-project-sidebar-views-CTxHKwky.js → optimistic-project-sidebar-views-Dqb0YVzb.js} +1 -1
  186. package/dist/client/assets/{org-file-open-context-CNhQ4sPa.js → org-file-open-context-0m9nAn5k.js} +1 -1
  187. package/dist/client/assets/{organization-choice-ClD3tqal.js → organization-choice-xKuRw7bv.js} +1 -1
  188. package/dist/client/assets/{orgs-bdVnOGJG.js → orgs-DfOHNNY4.js} +1 -1
  189. package/dist/client/assets/{page-seo-form-B0GpL4jq.js → page-seo-form-B4Q_F9eC.js} +1 -1
  190. package/dist/client/assets/{pair-BqbLIj1t.js → pair--ffwMsVi.js} +1 -1
  191. package/dist/client/assets/{plan-ladder-HHjxIVXp.js → plan-ladder-BTuOH_rJ.js} +1 -1
  192. package/dist/client/assets/{popover-Dp4MK1ls.js → popover-DhlDrafq.js} +1 -1
  193. package/dist/client/assets/post-calendar-XHFsJXTd.js +1 -0
  194. package/dist/client/assets/{post-editor-C1RmWFY5.js → post-editor-rZtul2Mk.js} +2 -2
  195. package/dist/client/assets/{preview-content-CNIJYNak.js → preview-content-BbJuU6df.js} +1 -1
  196. package/dist/client/assets/{preview-dialog-C7esJb4w.js → preview-dialog-CN5SqfyX.js} +1 -1
  197. package/dist/client/assets/{profile-CXYVNdpP.js → profile-De6YAqIA.js} +1 -1
  198. package/dist/client/assets/{project-app-view-CDgS0ywj.js → project-app-view-B5Khqz7f.js} +1 -1
  199. package/dist/client/assets/project-feed-Xa6qyXJX.js +1 -0
  200. package/dist/client/assets/{project-icon-BY9kpN8_.js → project-icon-C5xEY8i8.js} +1 -1
  201. package/dist/client/assets/project-reports-DBs57ScD.js +1 -0
  202. package/dist/client/assets/project-tasks-sTauAi5t.js +1 -0
  203. package/dist/client/assets/{projects-evwU_QXd.js → projects-DvXGBhjm.js} +1 -1
  204. package/dist/client/assets/{projects-empty-state-DfwkZhS9.js → projects-empty-state-CfKzWklQ.js} +1 -1
  205. package/dist/client/assets/{prompts-CyLjyHbX.js → prompts-Bu1_dfj_.js} +1 -1
  206. package/dist/client/assets/record-editor-Dbd0VnCw.js +1 -0
  207. package/dist/client/assets/redirect-editor-CoTmBQAz.js +1 -0
  208. package/dist/client/assets/{reports-BM-fsbYD.js → reports-6rPnZcpV.js} +1 -1
  209. package/dist/client/assets/reports-BJK0_clK.js +1 -0
  210. package/dist/client/assets/{reports-onboarding-BkOfNX6c.js → reports-onboarding-CFVeWEvH.js} +1 -1
  211. package/dist/client/assets/{reports-tab-akHTbMf0.js → reports-tab-Bt1EL-mi.js} +2 -2
  212. package/dist/client/assets/{repositories-BhXqf3Sh.js → repositories-D33kHvo2.js} +1 -1
  213. package/dist/client/assets/{repository-binding-Bye6exhX.js → repository-binding-DaBjdkOf.js} +1 -1
  214. package/dist/client/assets/{repository-import-picker-9N2XFQro.js → repository-import-picker-BGWkh1A1.js} +1 -1
  215. package/dist/client/assets/{repository-picker-Hvr1qnSW.js → repository-picker-CmwzBQy1.js} +1 -1
  216. package/dist/client/assets/{require-capability-BikcW72U.js → require-capability-DDFk2jJq.js} +1 -1
  217. package/dist/client/assets/{required-auth-layout-DWm1sqaG.js → required-auth-layout-LAfCgKok.js} +1 -1
  218. package/dist/client/assets/{reset-password-DBUxrz7S.js → reset-password-BP6-J1gf.js} +1 -1
  219. package/dist/client/assets/{resizable-xSdhf8k8.js → resizable-B-Hd9Zws.js} +1 -1
  220. package/dist/client/assets/{resolve-tab-icon-BViYoAOc.js → resolve-tab-icon-DwfEk1eS.js} +1 -1
  221. package/dist/client/assets/{review-settings-CxdhHh4I.js → review-settings-5U78zDHO.js} +1 -1
  222. package/dist/client/assets/{rich-text-link-control-DNolPdT4.js → rich-text-link-control-Cs8PKwyq.js} +1 -1
  223. package/dist/client/assets/{roles-CTJqjtAt.js → roles-CGuvhC2z.js} +1 -1
  224. package/dist/client/assets/route-2nbAqjlk.js +1 -0
  225. package/dist/client/assets/route-DXCnMQY3.js +1 -0
  226. package/dist/client/assets/route-ZDM9K_hG.js +1 -0
  227. package/dist/client/assets/{runnable-block-editor-D_v3Y6XS.js → runnable-block-editor-COBrimGH.js} +1 -1
  228. package/dist/client/assets/{sandbox-lifecycle-context-YRF_Tndn.js → sandbox-lifecycle-context-BC8wxuhd.js} +1 -1
  229. package/dist/client/assets/{schema-Dx8S5UKv.js → schema-CB-ciFqj.js} +1 -1
  230. package/dist/client/assets/{scroll-area-Ni1BHDLk.js → scroll-area-CRvpPUz2.js} +1 -1
  231. package/dist/client/assets/{search-input-C2C6IDR9.js → search-input-Dop1zFXq.js} +1 -1
  232. package/dist/client/assets/{search-toggle-XrzCP3HU.js → search-toggle-vhj3ytur.js} +1 -1
  233. package/dist/client/assets/{secret-picker-MfuGbD7z.js → secret-picker-KL5Q_RET.js} +1 -1
  234. package/dist/client/assets/{secrets-BKa3uo1t.js → secrets-BOAmN8Yi.js} +1 -1
  235. package/dist/client/assets/sections-editor-BSc_WwD-.js +1 -0
  236. package/dist/client/assets/{select-CKIWskoO.js → select-l0paibPQ.js} +1 -1
  237. package/dist/client/assets/{select-model-By0BbJXF.js → select-model-D70HFSdU.js} +1 -1
  238. package/dist/client/assets/seo-editor-CJOT6SSo.js +1 -0
  239. package/dist/client/assets/{separator-5ldU5iPA.js → separator-Bx46Hnui.js} +1 -1
  240. package/dist/client/assets/settings-tab-CaF_cC_h.js +5 -0
  241. package/dist/client/assets/{sheet-CAco8v5i.js → sheet-DuI8hTNu.js} +1 -1
  242. package/dist/client/assets/{shell-layout-Dc8bj9Qy.js → shell-layout-BpAT-xed.js} +1 -1
  243. package/dist/client/assets/{skills-CL3xHerv.js → skills-BYZ7f-kn.js} +1 -1
  244. package/dist/client/assets/{sso-8H5cn8Jj.js → sso-CSsvneR9.js} +1 -1
  245. package/dist/client/assets/{suggestion-Bk-rJje-.js → suggestion-Bcihs8ZP.js} +1 -1
  246. package/dist/client/assets/{switch-DwueOTYO.js → switch-0GCfvPjG.js} +1 -1
  247. package/dist/client/assets/{synced-repos-CNdTZ24Q.js → synced-repos-B-QJI5P5.js} +1 -1
  248. package/dist/client/assets/{tab-icon-glyph-h36dkcJK.js → tab-icon-glyph-DnRLlRv0.js} +1 -1
  249. package/dist/client/assets/{table-hEbek0Ft.js → table-DOK6zr3O.js} +1 -1
  250. package/dist/client/assets/{tabs-CdtjXlat.js → tabs-CNMiZCNd.js} +1 -1
  251. package/dist/client/assets/task-board-BShelgWZ.js +1 -0
  252. package/dist/client/assets/{task-route-DR9eVvuK.js → task-route-ymdu34TZ.js} +1 -1
  253. package/dist/client/assets/{task-status-Dt_MbhgH.js → task-status-B9gVcAxt.js} +1 -1
  254. package/dist/client/assets/taskboard-analytics-BClkIHV6.js +1 -0
  255. package/dist/client/assets/{tasks-DFiZjBSg.js → tasks-BRB-En1H.js} +1 -1
  256. package/dist/client/assets/tasks-DoNztSvK.js +1 -0
  257. package/dist/client/assets/{textarea-3tXmq-Wc.js → textarea-C2rYHq-c.js} +1 -1
  258. package/dist/client/assets/thread-analytics-C7DNUKj1.js +1 -0
  259. package/dist/client/assets/thread-button-BeI9G--l.js +1 -0
  260. package/dist/client/assets/{thread-intent-Y1VdgKwx.js → thread-intent-DvIpA8uQ.js} +1 -1
  261. package/dist/client/assets/{thread-route-BRshsfjF.js → thread-route-3OSBRLJC.js} +1 -1
  262. package/dist/client/assets/{thread-route-CvFAwFyQ.js → thread-route-BLSSXm6P.js} +1 -1
  263. package/dist/client/assets/{thread-sheet-body-CuFuqQDP.js → thread-sheet-body-BX2uZd1t.js} +1 -1
  264. package/dist/client/assets/{toggle-group-BBUMgsw-.js → toggle-group-rUyQhxO1.js} +1 -1
  265. package/dist/client/assets/{toolbar-icon-button-DMjHAwX1.js → toolbar-icon-button-CGADLxvK.js} +1 -1
  266. package/dist/client/assets/{tooltip-CCq3uglU.js → tooltip-C_zuUaOC.js} +1 -1
  267. package/dist/client/assets/{track-BQopacYb.js → track-DCeAbYjY.js} +1 -1
  268. package/dist/client/assets/{types-By6vVcI1.js → types-B4I82BK0.js} +1 -1
  269. package/dist/client/assets/{usage-stats-CUGPskaJ.js → usage-stats-BSKAHrH7.js} +1 -1
  270. package/dist/client/assets/{use-ai-providers-BdgkW-rz.js → use-ai-providers-Dq5hmlKk.js} +1 -1
  271. package/dist/client/assets/{use-automations-DRY01_uG.js → use-automations-BkR51GpW.js} +1 -1
  272. package/dist/client/assets/{use-autosave-BKedxvfh.js → use-autosave-CBElvX-u.js} +1 -1
  273. package/dist/client/assets/use-chat-layout-state-sYWhuOwp.js +1 -0
  274. package/dist/client/assets/{use-connect-companion-BQlD5V75.js → use-connect-companion-CfBam6TA.js} +1 -1
  275. package/dist/client/assets/{use-connection-B1Onu2Kt.js → use-connection-B7lWDEkg.js} +1 -1
  276. package/dist/client/assets/{use-copy-DmHXHCnz.js → use-copy-Bxzmp3bO.js} +1 -1
  277. package/dist/client/assets/{use-create-virtual-mcp-fQ6K6_pG.js → use-create-virtual-mcp-BAxvpf9T.js} +1 -1
  278. package/dist/client/assets/{use-date-fns-locale-C185nROT.js → use-date-fns-locale-tEPwP1Z5.js} +1 -1
  279. package/dist/client/assets/{use-debounced-autosave-BRJCxv7e.js → use-debounced-autosave-CMV-MoWD.js} +1 -1
  280. package/dist/client/assets/{use-debounced-value-yPMYT1PN.js → use-debounced-value-D-F2ClXC.js} +1 -1
  281. package/dist/client/assets/{use-deco-credits-CrxCz8CE.js → use-deco-credits-C4SdRl1J.js} +1 -1
  282. package/dist/client/assets/{use-decopilot-events-CypL9wDE.js → use-decopilot-events-RXaXesu8.js} +1 -1
  283. package/dist/client/assets/{use-delete-connection-BM3IJ70N.js → use-delete-connection-CntLkIur.js} +1 -1
  284. package/dist/client/assets/{use-deployment-admin-DeIDIzSg.js → use-deployment-admin-D-qDDuk1.js} +1 -1
  285. package/dist/client/assets/{use-fast-preview-draft-url-DGgr9dv2.js → use-fast-preview-draft-url-czyVDta1.js} +1 -1
  286. package/dist/client/assets/{use-file-configs-CLG1iL92.js → use-file-configs-BqBvHsey.js} +1 -1
  287. package/dist/client/assets/{use-infinite-scroll-9-lAGo5q.js → use-infinite-scroll-Mtyk8Q0g.js} +1 -1
  288. package/dist/client/assets/{use-join-requests-BhpyUEa7.js → use-join-requests-BrLCpupo.js} +1 -1
  289. package/dist/client/assets/use-main-panel-tabs-QkTFj72o.js +1 -0
  290. package/dist/client/assets/{use-mcp-auth-status-e-d864j-.js → use-mcp-auth-status-9FqZ1eaO.js} +1 -1
  291. package/dist/client/assets/{use-mcp-client-CFwJWbBp.js → use-mcp-client-BPL_EWAU.js} +1 -1
  292. package/dist/client/assets/{use-mcp-prompts-Dt5SCeuL.js → use-mcp-prompts-DPQ9PBYp.js} +1 -1
  293. package/dist/client/assets/{use-mcp-tools-Ddw8pP4s.js → use-mcp-tools-DZPcwH6I.js} +1 -1
  294. package/dist/client/assets/{use-members-o--3mm1V.js → use-members-BznZqHvf.js} +1 -1
  295. package/dist/client/assets/{use-mobile-BcAqan0X.js → use-mobile-BTq1Cy6A.js} +1 -1
  296. package/dist/client/assets/{use-navigate-to-agent-CjjoA5M6.js → use-navigate-to-agent-DYjNTZEe.js} +1 -1
  297. package/dist/client/assets/use-new-blocks-editor-V3EhO6Xe.js +1 -0
  298. package/dist/client/assets/{use-open-billing-url-m1RP8Kag.js → use-open-billing-url-C42sAajC.js} +1 -1
  299. package/dist/client/assets/{use-org-auth-client-DEUGdiVk.js → use-org-auth-client-SPO1PFOn.js} +1 -1
  300. package/dist/client/assets/{use-org-fs-BSupMC3v.js → use-org-fs-CHoKBUvQ.js} +1 -1
  301. package/dist/client/assets/{use-org-repo-syncs-O-NtvfvJ.js → use-org-repo-syncs-DHnNqghz.js} +1 -1
  302. package/dist/client/assets/{use-org-sso-C8eq4Vdd.js → use-org-sso-BhqNUA_g.js} +1 -1
  303. package/dist/client/assets/{use-organization-roles-reY1_o4k.js → use-organization-roles-DMTBMJIb.js} +1 -1
  304. package/dist/client/assets/{use-organization-settings-DiTNcxQS.js → use-organization-settings-7JQv2bha.js} +1 -1
  305. package/dist/client/assets/{use-panel-navigate-CFUA8opi.js → use-panel-navigate-BCZgeLOH.js} +1 -1
  306. package/dist/client/assets/{use-project-scope-nSXqOJGj.js → use-project-scope-CfQAh61-.js} +1 -1
  307. package/dist/client/assets/use-recent-apps-CIZIMNq3.js +1 -0
  308. package/dist/client/assets/{use-releases-BbGaY8US.js → use-releases-BXFQEoVJ.js} +1 -1
  309. package/dist/client/assets/{use-reports-diagnostic-BT8MtXS3.js → use-reports-diagnostic-BONoWqN1.js} +1 -1
  310. package/dist/client/assets/{use-secrets-FJu3iWhY.js → use-secrets-BgHZaAe-.js} +1 -1
  311. package/dist/client/assets/{use-section-preview-base-CxPC0M-d.js → use-section-preview-base-CjxZD1As.js} +1 -1
  312. package/dist/client/assets/{use-session-runtime-CNsfPJpj.js → use-session-runtime-BhqEJTFD.js} +1 -1
  313. package/dist/client/assets/{use-tags-BXGxCIku.js → use-tags-D18QiQFO.js} +1 -1
  314. package/dist/client/assets/{use-task-board-analytics-DNKSgirc.js → use-task-board-analytics-CHyrlJdR.js} +1 -1
  315. package/dist/client/assets/{use-task-board-events-C7j5aBlD.js → use-task-board-events-2DTfUd8b.js} +1 -1
  316. package/dist/client/assets/{use-task-metadata-D3Ciwarw.js → use-task-metadata-LZhy7A-X.js} +1 -1
  317. package/dist/client/assets/{use-thread-analytics-D27BLIsa.js → use-thread-analytics-BFFe95Y-.js} +1 -1
  318. package/dist/client/assets/{use-thread-outputs-D0UmTPT7.js → use-thread-outputs-DHNNx8Ws.js} +1 -1
  319. package/dist/client/assets/useInfiniteQuery-cbQywZ3L.js +1 -0
  320. package/dist/client/assets/{useQueries-CrAKGEfH.js → useQueries-3Ghz9to5.js} +1 -1
  321. package/dist/client/assets/useSuspenseInfiniteQuery-CL-DZoeM.js +1 -0
  322. package/dist/client/assets/{users-CQYodV6R.js → users-BFlW1Qqv.js} +1 -1
  323. package/dist/client/assets/{utils-D94emI8J.js → utils-DaYQyxgr.js} +1 -1
  324. package/dist/client/assets/variant-calendar-pbRcz2zJ.js +1 -0
  325. package/dist/client/assets/{variant-matcher-override-BFWepI_H.js → variant-matcher-override-Cng-aq7T.js} +1 -1
  326. package/dist/client/assets/{view-mode-toggle-a9S8LD9H.js → view-mode-toggle-CNo4raIS.js} +1 -1
  327. package/dist/client/assets/{virtual-mcp-BC9jxxUg.js → virtual-mcp-DPVA40iH.js} +1 -1
  328. package/dist/client/index.html +2 -2
  329. package/dist/server/cli.js +1 -1
  330. package/dist/server/server.js +1 -1
  331. package/package.json +1 -1
  332. package/dist/client/assets/agent-analytics-BHngg3aN.js +0 -2
  333. package/dist/client/assets/agent-app-eih7qmuw.js +0 -1
  334. package/dist/client/assets/agent-assets-CojSmNaz.js +0 -1
  335. package/dist/client/assets/agent-automations-BQwnmsqe.js +0 -1
  336. package/dist/client/assets/agent-connect-sources-DC_snIij.js +0 -1
  337. package/dist/client/assets/agent-deck-BHvHS_x2.js +0 -1
  338. package/dist/client/assets/agent-e2e-BScuCsCp.js +0 -1
  339. package/dist/client/assets/agent-experiments-0ZSUWJyV.js +0 -1
  340. package/dist/client/assets/agent-file-A2jLB4uh.js +0 -1
  341. package/dist/client/assets/agent-hosting-C03IBXsD.js +0 -1
  342. package/dist/client/assets/agent-library-Bndr3ZTh.js +0 -1
  343. package/dist/client/assets/agent-library-file-DHNrLn15.js +0 -1
  344. package/dist/client/assets/agent-monitor-C2UpDGeU.js +0 -1
  345. package/dist/client/assets/agent-overview-vGVfOmzC.js +0 -1
  346. package/dist/client/assets/agent-settings-CKUunA9x.js +0 -1
  347. package/dist/client/assets/agent-site-editor-code-DNEtxYix.js +0 -2
  348. package/dist/client/assets/agent-view-Eu0cDk5o.js +0 -1
  349. package/dist/client/assets/api-keys-DTPxsqpA.js +0 -1
  350. package/dist/client/assets/app-editor-OxAoUr_m.js +0 -1
  351. package/dist/client/assets/category-editor-BX5BNfiN.js +0 -1
  352. package/dist/client/assets/context-CHxPejUn.js +0 -1
  353. package/dist/client/assets/discover-1nnz5mE8.js +0 -1
  354. package/dist/client/assets/flat-project-DxrfpqU8.js +0 -1
  355. package/dist/client/assets/home-R2M47XKc.js +0 -1
  356. package/dist/client/assets/index-DFBQfnNq.css +0 -1
  357. package/dist/client/assets/index-w4vR7oJd.js +0 -10
  358. package/dist/client/assets/library-CpDr8cUt.js +0 -1
  359. package/dist/client/assets/match-site-slug-config-D3fUJ6vX.js +0 -1
  360. package/dist/client/assets/openai-conversation-Bidm8HKX.js +0 -3
  361. package/dist/client/assets/post-calendar-DVsOpmKX.js +0 -1
  362. package/dist/client/assets/project-feed-DsVk1K7o.js +0 -1
  363. package/dist/client/assets/project-reports-DKz6hsTO.js +0 -1
  364. package/dist/client/assets/project-tasks-DEHeH6xm.js +0 -1
  365. package/dist/client/assets/record-editor-BG6JZBAo.js +0 -1
  366. package/dist/client/assets/redirect-editor-BSixOpkn.js +0 -1
  367. package/dist/client/assets/reports-DQHzs4c2.js +0 -1
  368. package/dist/client/assets/route-C4g7C29_.js +0 -1
  369. package/dist/client/assets/route-iDn0dH_W.js +0 -1
  370. package/dist/client/assets/route-mD1G8miY.js +0 -1
  371. package/dist/client/assets/sections-editor-DQXGqVXO.js +0 -1
  372. package/dist/client/assets/seo-editor-BI6yz1SI.js +0 -1
  373. package/dist/client/assets/settings-tab-DjCUiptn.js +0 -5
  374. package/dist/client/assets/task-board-X-0Zbika.js +0 -1
  375. package/dist/client/assets/taskboard-analytics-DGE69gm2.js +0 -1
  376. package/dist/client/assets/tasks-DEV8yvUO.js +0 -1
  377. package/dist/client/assets/thread-analytics-Batrg_G6.js +0 -1
  378. package/dist/client/assets/thread-button-1m1VWTYv.js +0 -1
  379. package/dist/client/assets/use-chat-layout-state-ffnO3cas.js +0 -1
  380. package/dist/client/assets/use-main-panel-tabs-Ex0Ebdb5.js +0 -1
  381. package/dist/client/assets/use-new-blocks-editor-DqR1bcfV.js +0 -1
  382. package/dist/client/assets/use-project-native-view-presence-xh82wo73.js +0 -1
  383. package/dist/client/assets/useInfiniteQuery-DXdUQ48R.js +0 -1
  384. package/dist/client/assets/useSuspenseInfiniteQuery-BmynEKtw.js +0 -1
  385. package/dist/client/assets/variant-calendar-Dfcw4asd.js +0 -1
@@ -1,9 +1,9 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-OxAoUr_m.js","assets/index-CeFrI_-f.js","assets/index-DFBQfnNq.css","assets/chat-context-DSOY14Dl.js","assets/use-panel-navigate-CFUA8opi.js","assets/thread-route-BRshsfjF.js","assets/use-project-scope-nSXqOJGj.js","assets/repository-binding-Bye6exhX.js","assets/use-mcp-client-CFwJWbBp.js","assets/auth-i4uSZxqM.js","assets/autosend-BgamBAXS.js","assets/thread-intent-Y1VdgKwx.js","assets/backoff-8mStPHYB.js","assets/task-board-X-0Zbika.js","assets/schema-Dx8S5UKv.js","assets/slugify-CEUa2lfQ.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-decopilot-events-CypL9wDE.js","assets/use-ai-providers-BdgkW-rz.js","assets/location-DBePU4bz.js","assets/use-organization-settings-DiTNcxQS.js","assets/scroll-area-Ni1BHDLk.js","assets/select-CKIWskoO.js","assets/index-DFK3AqOd.js","assets/Check-soPAeKca.js","assets/ChevronUp-B4upaCys.js","assets/use-section-preview-base-CxPC0M-d.js","assets/UserSquare-D1bS09Fm.js","assets/agent-icon-C8wu-T9B.js","assets/AlertCircle-CQU3FO2-.js","assets/Tool01-BVUW3itu.js","assets/ArrowUp-D1uaoIEr.js","assets/ArrowLeft-r9k0gxde.js","assets/ArrowRight-CJiUKB0e.js","assets/ShoppingBag01-IkLiZTCG.js","assets/ZoomOut-ekFDVqJi.js","assets/Palette-Bk3UCvKx.js","assets/CheckCircle-BdRkKVcj.js","assets/Copy01-Ck1CQt9c.js","assets/CreditCard01-C5LQldm8.js","assets/DotsVertical-DMsZySzr.js","assets/Image01-AxefwT4b.js","assets/XClose-CVE8Vs6Q.js","assets/Key01-V9W0a2Yy.js","assets/Link01-C9tHLmLh.js","assets/LinkExternal01-CkkaHQ43.js","assets/Monitor01-DYA_QMf2.js","assets/Sun-CttdH4aG.js","assets/Plus-kHt_8stA.js","assets/SearchMd-DFB2ha4T.js","assets/Trash01-CKOL_3ja.js","assets/Upload01-DlR8CSo4.js","assets/User01-dc7WIl5M.js","assets/Users01-BaIVzoZ3.js","assets/X-Dp6J1NZk.js","assets/dialog-1dafL4bi.js","assets/input-CQlMbJrR.js","assets/use-new-blocks-editor-DqR1bcfV.js","assets/claim-phase-copy-Byy3Q6us.js","assets/section-preview-url-Csj0_ZDg.js","assets/use-session-runtime-CNsfPJpj.js","assets/runnable-block-editor-D_v3Y6XS.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-BqbLIj1t.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-Pi90xi-e.js","assets/use-copy-DmHXHCnz.js","assets/usage-stats-CUGPskaJ.js","assets/markdown-Ck-11dhN.js","assets/org-file-open-context-CNhQ4sPa.js","assets/use-mobile-BcAqan0X.js","assets/tooltip-CCq3uglU.js","assets/shell-layout-Dc8bj9Qy.js","assets/avatar-By9-J1G7.js","assets/download-app-dialog-BcCXsaD8.js","assets/command-DxWpNp1x.js","assets/index-MebkKt8H.js","assets/integration-icon-60YSBd47.js","assets/project-icon-BY9kpN8_.js","assets/new-project-dialog-BJkFsBCH.js","assets/label-CTaphTs2.js","assets/repository-import-picker-9N2XFQro.js","assets/use-navigate-to-agent-CjjoA5M6.js","assets/repository-picker-Hvr1qnSW.js","assets/useInfiniteQuery-DXdUQ48R.js","assets/infiniteQueryObserver-DX9QHkGe.js","assets/collection-search-CZPfBwnt.js","assets/use-debounced-value-yPMYT1PN.js","assets/required-auth-layout-DWm1sqaG.js","assets/use-org-sso-C8eq4Vdd.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-BemaHPoe.js","assets/types-By6vVcI1.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-CeKj8qiL.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/sheet-CAco8v5i.js","assets/use-connection-B1Onu2Kt.js","assets/use-mcp-prompts-Dt5SCeuL.js","assets/index-CBLynFUh.js","assets/form-D5LPXjPj.js","assets/use-thread-outputs-D0UmTPT7.js","assets/file-type-icon-buBDg-03.js","assets/popover-Dp4MK1ls.js","assets/utils-D94emI8J.js","assets/monaco-editor-CyLZqoPt.js","assets/editor-BiYdYoAb.js","assets/calendar-C_3zvYnn.js","assets/textarea-3tXmq-Wc.js","assets/rich-text-link-control-DNolPdT4.js","assets/switch-DwueOTYO.js","assets/combobox-BIrYGyuF.js","assets/alert-dialog-DJcNPQjm.js","assets/sandbox-url-D3mC8qhT.js","assets/search-input-C2C6IDR9.js","assets/tabs-CdtjXlat.js","assets/use-file-configs-CLG1iL92.js","assets/asset-utils-BV839mqx.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/toggle-group-BBUMgsw-.js","assets/sandbox-git-api-B1R0585s.js","assets/agent-view-guard-DP6rr7-6.js","assets/use-main-panel-tabs-Ex0Ebdb5.js","assets/use-chat-layout-state-ffnO3cas.js","assets/use-mcp-tools-Ddw8pP4s.js","assets/index-D3__nJJk.js","assets/drawer-wrrjDRlR.js","assets/input-BLNFqzUM.js","assets/chat-draft-Db3gWleH.js","assets/use-deco-credits-CrxCz8CE.js","assets/use-open-billing-url-m1RP8Kag.js","assets/decopilot-ZxSRkfiB.js","assets/checkbox-YgstniWn.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-LgfzCRc4.js","assets/input-C2XryqlS.js","assets/suggestion-Bk-rJje-.js","assets/use-org-fs-BSupMC3v.js","assets/question-004-sINsf4GQ.js","assets/use-members-o--3mm1V.js","assets/use-org-auth-client-DEUGdiVk.js","assets/feature-paywall-O59PQJQ4.js","assets/plan-ladder-HHjxIVXp.js","assets/add-connection-dialog-B-zUvMaq.js","assets/extract-connection-data-Cm7kjryi.js","assets/metadata-D72DunRR.js","assets/connection-sgm4TBxZ.js","assets/connection-card-KlghLDwU.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-i009QpGu.js","assets/authenticate-and-persist-oauth-D-PqEdfN.js","assets/mcp-oauth-DA7uY-37.js","assets/collection-tabs-CDyR4kzk.js","assets/badge-BLmau0Ea.js","assets/use-infinite-scroll-9-lAGo5q.js","assets/useSuspenseInfiniteQuery-BmynEKtw.js","assets/use-task-board-events-C7j5aBlD.js","assets/input-Bwd_JSM8.css","assets/sandbox-lifecycle-context-YRF_Tndn.js","assets/resolve-tab-icon-BViYoAOc.js","assets/use-task-metadata-D3Ciwarw.js","assets/use-project-native-view-presence-xh82wo73.js","assets/site-slug-DebpOoQq.js","assets/virtual-mcp-BC9jxxUg.js","assets/feature-gate-VDho3P9i.js","assets/mustache-BIygiTUj.js","assets/empty-state-Ck9uwtW-.js","assets/empty-state-LYCOTuMl.js","assets/post-editor-C1RmWFY5.js","assets/multi-select-CtEcT2Fm.js","assets/block-document-DNf3E-rZ.js","assets/index-D5-xqq3P.js","assets/use-fast-preview-draft-url-DGgr9dv2.js","assets/use-autosave-BKedxvfh.js","assets/record-editor-BG6JZBAo.js","assets/context-CHxPejUn.js","assets/index-H2LrQn17.js","assets/get-initials-D-f_fDFw.js","assets/category-editor-BX5BNfiN.js","assets/sections-editor-DQXGqVXO.js","assets/page-seo-form-B0GpL4jq.js","assets/variant-matcher-override-BFWepI_H.js","assets/seo-editor-BI6yz1SI.js","assets/variant-calendar-Dfcw4asd.js","assets/view-mode-toggle-a9S8LD9H.js","assets/post-calendar-DVsOpmKX.js","assets/alert-B_aVDXWu.js","assets/redirect-editor-BSixOpkn.js"])))=>i.map(i=>d[i]);
2
- import{c as ae,b as Se,j as n,m as xs,K as Pt,l as be,r as $,h as lt,B as _e,o as Po,e as To,t as me,a2 as js,az as St,aI as bt,F as It,aA as Fs,H as Rt,I as Ft,au as Bo,U as Eo,V as _o,G as Je,af as Tt,aJ as ds,aK as Do,X as Ao,u as kn,aG as He}from"./index-CeFrI_-f.js";import{A as $o}from"./agent-view-guard-DP6rr7-6.js";import{F as Lo}from"./feature-gate-VDho3P9i.js";import{u as Bt,b as Sn}from"./chat-context-DSOY14Dl.js";import{i as Wt}from"./AlertCircle-CQU3FO2-.js";import{H as Oo,S as wn,T as et,U as Nn,V as ks,W as Io,X as Cn,Y as Ro,b as Kt,N as Pn,Z as Fo,_ as Ko,$ as wt,a0 as zo,a1 as Mo,n as Vo,a2 as Go,a3 as Tn,a4 as Uo,a5 as Ho,a6 as qo,l as Ks,a7 as Jo,F as Bn}from"./agent-icon-C8wu-T9B.js";import{a as En,i as Ss,d as zs}from"./UserSquare-D1bS09Fm.js";import{b as _n,i as Dn}from"./ZoomOut-ekFDVqJi.js";import{c as An,i as Wo}from"./XClose-CVE8Vs6Q.js";import{s as ws}from"./Plus-kHt_8stA.js";import{t as $n}from"./Users01-BaIVzoZ3.js";import{f as Yo,e as Qo,b as Xo,A as Zo,a as ea,d as ta,c as sa,g as na}from"./alert-dialog-DJcNPQjm.js";import{S as Yt}from"./scroll-area-Ni1BHDLk.js";import{T as We,a as Ye,b as Qe}from"./tooltip-CCq3uglU.js";import{B as nt}from"./badge-BLmau0Ea.js";import{S as us,n as oa,c as aa,g as Ln,B as ms,P as la,h as On,o as ia,i as gs,s as ra,u as Qt,l as ca,q as da,R as ua,t as In,r as ma,v as fa,d as Rn,w as pa,x as ha,y as Fn,z as xa,M as ga,j as ba,A as ya,p as va,C as ja,D as ka,e as Sa,f as wa,E as Ms,F as Kn,k as Na,G as Ca}from"./runnable-block-editor-D_v3Y6XS.js";import{r as Ns,S as Pa,m as Cs,i as Ta,o as Ba,q as Ea,n as Lt,v as _a,R as zn,t as Da,l as Aa,w as $a,x as La,y as Vs,G as Ps,g as Oa,z as Ia,e as Gs,A as Ra,d as Fa,B as Ka,D as Us,h as za,E as Ma,F as Va}from"./claim-phase-copy-Byy3Q6us.js";import{u as Mn,P as Ga}from"./mustache-BIygiTUj.js";import{n as Vn}from"./ShoppingBag01-IkLiZTCG.js";import{t as ft}from"./ChevronUp-B4upaCys.js";import{C as Ua,a as Ha,b as qa}from"./collapsible-Pi90xi-e.js";import{c as Ja,d as Wa}from"./sandbox-lifecycle-context-YRF_Tndn.js";import{u as Gn}from"./use-session-runtime-CNsfPJpj.js";import{c as pt,d as it,e as ht,b as rt,D as ct,h as zt,a as Ya}from"./dialog-1dafL4bi.js";import{I as Xe}from"./input-CQlMbJrR.js";import{C as Xt}from"./checkbox-YgstniWn.js";import{L as ze}from"./label-CTaphTs2.js";import{c as Qa,b as Xa,a as Za,d as el,S as tl}from"./select-CKIWskoO.js";import{o as sl}from"./sandbox-git-api-B1R0585s.js";import{a as Hs}from"./utils-D94emI8J.js";import{i as nl}from"./CheckCircle-BdRkKVcj.js";import{s as Ts}from"./Trash01-CKOL_3ja.js";import{i as fs}from"./Upload01-DlR8CSo4.js";import{E as ol}from"./empty-state-Ck9uwtW-.js";import{T as Ot}from"./textarea-3tXmq-Wc.js";import{u as al}from"./use-ai-providers-BdgkW-rz.js";import{M as Un}from"./monaco-editor-CyLZqoPt.js";import{i as Bs}from"./X-Dp6J1NZk.js";import{f as Hn,a as ll}from"./repository-binding-Bye6exhX.js";import"./rich-text-link-control-DNolPdT4.js";import{a as il}from"./Copy01-Ck1CQt9c.js";import{b as rl}from"./Tool01-BVUW3itu.js";import{b as qs}from"./use-project-scope-nSXqOJGj.js";import{E as cl}from"./empty-state-LYCOTuMl.js";import{G as Js}from"./repository-picker-Hvr1qnSW.js";import{R as dl}from"./repository-import-picker-9N2XFQro.js";import{b as ul}from"./thread-route-BRshsfjF.js";function ml(t){const e=ae.c(18),{title:s,description:o,children:a}=t,l=Se();let i;e[0]!==a?(i=n.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Oo,{}),e[2]=c):c=e[2];let r;e[3]!==l?(r=l("common.soon"),e[3]=l,e[4]=r):r=e[4];let d;e[5]!==r?(d=n.jsxs(nt,{variant:"secondary",children:[c,r]}),e[5]=r,e[6]=d):d=e[6];let p;e[7]!==s?(p=n.jsx("p",{className:"text-base font-semibold text-foreground",children:s}),e[7]=s,e[8]=p):p=e[8];let m;e[9]!==o?(m=o&&n.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=m):m=e[10];let h;e[11]!==d||e[12]!==p||e[13]!==m?(h=n.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:n.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,p,m]})}),e[11]=d,e[12]=p,e[13]=m,e[14]=h):h=e[14];let u;return e[15]!==i||e[16]!==h?(u=n.jsxs("div",{className:"relative h-full min-h-0",children:[i,h]}),e[15]=i,e[16]=h,e[17]=u):u=e[17],u}function fl(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(s).length>0?{...t,properties:s}:t}function pl(t,e,s){return typeof t!="string"?null:fl(Ns(t,e),s)}function qn(t,e,s){if(!e||typeof t!="string")return!1;const o=pl(t,e,s);return!!o&&Object.keys(o.properties??{}).length>0}function yt(t){const e=ae.c(6),{hasItems:s,emptyLabel:o,emptyHint:a}=t;let l;e[0]!==a||e[1]!==o||e[2]!==s?(l=s?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:o}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=s,e[3]=l):l=e[3];let i;return e[4]!==l?(i=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function Zt(t,e){return`${t}-${e}`}function Jn(t,e){return`site/apps/${t}/${e}.ts`}function Wn(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function hl(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function xl(t){return t==="local"?"Custom":"Installed"}function Yn(t,e,s){const o=new Set([Zt(t,e),e].map(l=>l.toLowerCase())),a=Jn(t,e);for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=i;if(o.has(l.toLowerCase())||c.__resolveType===a)return l}return null}function gl(t,e){const s=t.vendor.alias,o=t.name,a=Yn(s,o,e);return{id:Zt(s,o),app:o,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:Jn(s,o),blockKey:a,installed:a!==null}}function bl(t,e,s){if(t===Pa)return null;const o=Wn(t);if(!o)return null;const{vendor:a,app:l}=o,i=Yn(a,l,s),c=Cs(t,e);return{id:Zt(a,l),app:l,vendor:a,title:c.title??l,description:c.description??"",category:"Others",logo:c.logo??c.icon,resolveType:t,blockKey:i,installed:i!==null}}function yl(t,e,s){const o=e.__resolveType;if(typeof o!="string"||Ta(t,e)||!Ba(o))return null;const a=Wn(o)??hl(t);if(!a)return null;const l=Cs(o,s),{vendor:i,app:c}=a;return{id:Zt(i,c),app:c,vendor:i,title:l.title??Ea(t,e,s),description:l.description??"",category:xl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function vl(t,e,s){const o=new Map;for(const l of t){const i=gl(l,s);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=bl(l,e,s);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=yl(l,i,e);!c||o.has(c.id)||o.set(c.id,c)}return[...o.values()].sort(jl)}function jl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function kl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function Sl(t,e,s){const o=ae.c(12),a=s?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=Pt.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:kl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const c=xs(i);let r;o[3]!==e||o[4]!==t||o[5]!==c.data?(r=t&&e?vl(c.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=c.data,o[6]=r):r=o[6];const d=r,p=c.isLoading&&!c.isError;let m;return o[7]!==d||o[8]!==c.isError||o[9]!==c.refetch||o[10]!==p?(m={catalog:d,isLoading:p,isError:c.isError,refetch:c.refetch},o[7]=d,o[8]=c.isError,o[9]=c.refetch,o[10]=p,o[11]=m):m=o[11],m}const wl=["sections","apps","loaders","actions"];function Nl(t){const e=ae.c(59),{active:s,counts:o,showBlog:a,onSelect:l}=t,i=Se();let c;e[0]!==i?(c=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:c})}),e[2]=c,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const p=s==="pages";let m;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==p?(m=n.jsx(Re,{id:"pages",icon:En,label:d,count:o.pages,active:p,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const u=s==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==u?(f=n.jsx(Re,{id:"redirects",icon:wn,label:h,count:o.redirects,active:u,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=u,e[17]=f):f=e[17];let g;e[18]!==i?(g=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=g):g=e[19];const x=s==="site";let y;e[20]!==l||e[21]!==x||e[22]!==g?(y=n.jsx(Re,{id:"site",icon:Io,label:g,active:x,onSelect:l}),e[20]=l,e[21]=x,e[22]=g,e[23]=y):y=e[23];let v;e[24]!==i?(v=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=v):v=e[25];const j=s==="seo";let w;e[26]!==l||e[27]!==v||e[28]!==j?(w=n.jsx(Re,{id:"seo",icon:Cn,label:v,active:j,onSelect:l}),e[26]=l,e[27]=v,e[28]=j,e[29]=w):w=e[29];let C;e[30]!==i?(C=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=C):C=e[31];const E=s==="calendar";let B;e[32]!==l||e[33]!==C||e[34]!==E?(B=n.jsx(Re,{id:"calendar",icon:Ro,label:C,active:E,onSelect:l}),e[32]=l,e[33]=C,e[34]=E,e[35]=B):B=e[35];let k;e[36]!==s||e[37]!==o||e[38]!==l?(k=n.jsx(Cl,{active:s,counts:o,onSelect:l}),e[36]=s,e[37]=o,e[38]=l,e[39]=k):k=e[39];let D;e[40]!==s||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(D=a&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[n.jsx(Vn,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),n.jsx(Re,{id:"context",icon:et,label:i("sandbox.collectionsSidebar.context"),active:s==="context",onSelect:l}),n.jsx(Re,{id:"posts",icon:_n,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:s==="posts",onSelect:l}),n.jsx(Re,{id:"authors",icon:$n,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:s==="authors",onSelect:l}),n.jsx(Re,{id:"categories",icon:Nn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:s==="categories",onSelect:l}),n.jsx(Re,{id:"post-schedule",icon:ks,label:i("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onSelect:l})]}),e[40]=s,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=D):D=e[47];let O;e[48]!==y||e[49]!==w||e[50]!==B||e[51]!==k||e[52]!==D||e[53]!==m||e[54]!==f?(O=n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[m,f,y,w,B,k,D]}),e[48]=y,e[49]=w,e[50]=B,e[51]=k,e[52]=D,e[53]=m,e[54]=f,e[55]=O):O=e[55];let L;return e[56]!==r||e[57]!==O?(L=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[r,O]}),e[56]=r,e[57]=O,e[58]=L):L=e[58],L}function Cl(t){const e=ae.c(52),{active:s,counts:o,onSelect:a}=t,l=Se();let i;e[0]!==s?(i=wl.includes(s),e[0]=s,e[1]=i):i=e[1];const c=i,[r,d]=$.useState(!1),p=r||c;let m,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=be("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),h=n.jsx(Fo,{size:16,className:"shrink-0"}),e[2]=m,e[3]=h):(m=e[2],h=e[3]);let u;e[4]!==l?(u=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=u):u=e[5];let f;e[6]!==u?(f=n.jsx("span",{className:"flex-1 truncate",children:u}),e[6]=u,e[7]=f):f=e[7];const g=p&&"rotate-180";let x;e[8]!==g?(x=be("shrink-0 text-muted-foreground/70 transition-transform",g),e[8]=g,e[9]=x):x=e[9];let y;e[10]!==x?(y=n.jsx(ft,{size:16,className:x}),e[10]=x,e[11]=y):y=e[11];let v;e[12]!==f||e[13]!==y?(v=n.jsxs(Ua,{className:m,children:[h,f,y]}),e[12]=f,e[13]=y,e[14]=v):v=e[14];let j;e[15]!==l?(j=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=j):j=e[16];const w=s==="sections";let C;e[17]!==o.sections||e[18]!==a||e[19]!==j||e[20]!==w?(C=n.jsx(Re,{id:"sections",icon:Kt,label:j,count:o.sections,active:w,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=j,e[20]=w,e[21]=C):C=e[21];let E;e[22]!==l?(E=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=E):E=e[23];const B=s==="apps";let k;e[24]!==o.apps||e[25]!==a||e[26]!==E||e[27]!==B?(k=n.jsx(Re,{id:"apps",icon:An,label:E,count:o.apps,active:B,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=E,e[27]=B,e[28]=k):k=e[28];let D;e[29]!==l?(D=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=D):D=e[30];const O=s==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==D||e[34]!==O?(L=n.jsx(Re,{id:"loaders",icon:Pn,label:D,count:o.loaders,active:O,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=D,e[34]=O,e[35]=L):L=e[35];let K;e[36]!==l?(K=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=K):K=e[37];const F=s==="actions";let _;e[38]!==o.actions||e[39]!==a||e[40]!==K||e[41]!==F?(_=n.jsx(Re,{id:"actions",icon:Dn,label:K,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=K,e[41]=F,e[42]=_):_=e[42];let A;e[43]!==C||e[44]!==k||e[45]!==L||e[46]!==_?(A=n.jsxs(Ha,{className:"flex flex-col gap-0.5 pt-0.5",children:[C,k,L,_]}),e[43]=C,e[44]=k,e[45]=L,e[46]=_,e[47]=A):A=e[47];let I;return e[48]!==p||e[49]!==A||e[50]!==v?(I=n.jsxs(qa,{open:p,onOpenChange:d,children:[v,A]}),e[48]=p,e[49]=A,e[50]=v,e[51]=I):I=e[51],I}function Re(t){const e=ae.c(19),{id:s,icon:o,label:a,count:l,active:i,onSelect:c,indent:r}=t;let d;e[0]!==s||e[1]!==c?(d=()=>c(s),e[0]=s,e[1]=c,e[2]=d):d=e[2];const p=r&&"pl-6",m=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==p||e[4]!==m?(h=be("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",p,m),e[3]=p,e[4]=m,e[5]=h):h=e[5];let u;e[6]!==o?(u=n.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==a?(f=n.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=f):f=e[9];let g;e[10]!==i||e[11]!==l?(g=l!==void 0&&n.jsx("span",{className:be("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=g):g=e[12];let x;return e[13]!==d||e[14]!==h||e[15]!==u||e[16]!==f||e[17]!==g?(x=n.jsxs("button",{type:"button",onClick:d,className:h,children:[u,f,g]}),e[13]=d,e[14]=h,e[15]=u,e[16]=f,e[17]=g,e[18]=x):x=e[18],x}function Pl(t){const e=ae.c(12),{state:s,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=t;switch(s.kind){case"starting":{let c;e[0]!==o||e[1]!==a?(c=oa({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==c?(r=n.jsx(us,{kind:"starting",progress:c,claimPhase:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5],r}case"suspended":{let c;return e[6]!==l?(c=n.jsx(us,{kind:"suspended",onResume:l}),e[6]=l,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==i||e[9]!==l||e[10]!==s.error?(c=n.jsx(us,{kind:"errored",error:s.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=s.error,e[11]=c):c=e[11],c}}}const Tl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Bl(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",s=!e&&!Tl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function Ws(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${s} (copy)`;if(!t.has(o))return o;for(let a=2;a<1e3;a++){const l=`${s} (copy ${a})`;if(!t.has(l))return l}return`${s} (copy ${Date.now()})`}function El(t,e){const s=Lt,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!t.has(s(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(s(i)))return i}return`${o}-copy-${Date.now()}`}function _l(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),o=`${s}_copy`;if(!Object.hasOwn(t,o))return o;for(let a=2;a<1e3;a++){const l=`${s}_copy_${a}`;if(!Object.hasOwn(t,l))return l}return`${s}_copy_${Date.now()}`}function Dl(t){const e=Ln(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function Al(t,e){return aa(t,e)}const $l=1e3;function Ll(t,e){for(let s=0;s<$l;s++){const o=Ln(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const Ol={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},Il={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Rl={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Fl(t){const e=ae.c(88),{open:s,mode:o,initialName:a,initialPath:l,isPending:i,error:c,templates:r,validate:d,onSubmit:p,onOpenChange:m}=t,h=i===void 0?!1:i,u=Se(),[f,g]=$.useState(a),[x,y]=$.useState(l),[v,j]=$.useState(ms),[w,C]=$.useState(null),[E,B]=$.useState(s);s!==E&&(B(s),s&&(g(a),y(l),j(ms),C(null)));const k=o==="create"&&!!r?.length;let D;e[0]!==h||e[1]!==m?(D=pe=>{!pe&&!h&&(C(null),m(!1))},e[0]=h,e[1]=m,e[2]=D):D=e[2];const O=D;let L;e[3]!==h||e[4]!==f||e[5]!==p||e[6]!==x||e[7]!==k||e[8]!==v||e[9]!==d?(L=async pe=>{pe.preventDefault();const ke=f.trim(),he=x.trim();if(!ke||!he||h)return;const we=_a(he);if(we){C(we);return}const Pe=d?.({name:ke,path:he});if(Pe){C(Pe);return}C(null),await p({name:ke,path:he,templateKey:k&&v!==ms?v:null})},e[3]=h,e[4]=f,e[5]=p,e[6]=x,e[7]=k,e[8]=v,e[9]=d,e[10]=L):L=e[10];const K=L,F=w??c,_=Ol[o];let A;e[11]!==u||e[12]!==_?(A=u(_),e[11]=u,e[12]=_,e[13]=A):A=e[13];let I;e[14]!==A?(I=n.jsx(pt,{children:n.jsx(it,{children:A})}),e[14]=A,e[15]=I):I=e[15];let R;e[16]!==h||e[17]!==k||e[18]!==u||e[19]!==v||e[20]!==r?(R=k&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),n.jsx(la,{id:"page-form-template",value:v,onChange:j,templates:r??[],disabled:h})]}),e[16]=h,e[17]=k,e[18]=u,e[19]=v,e[20]=r,e[21]=R):R=e[21];let G;e[22]!==u?(G=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=G):G=e[23];let z;e[24]!==G?(z=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:G}),e[24]=G,e[25]=z):z=e[25];let W;e[26]===Symbol.for("react.memo_cache_sentinel")?(W=pe=>g(pe.target.value),e[26]=W):W=e[26];let T;e[27]!==u?(T=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=T):T=e[28];let U;e[29]!==h||e[30]!==f||e[31]!==T?(U=n.jsx(Xe,{id:"page-form-name",value:f,onChange:W,placeholder:T,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=T,e[32]=U):U=e[32];let Y;e[33]!==U||e[34]!==z?(Y=n.jsxs("div",{className:"space-y-1.5",children:[z,U]}),e[33]=U,e[34]=z,e[35]=Y):Y=e[35];let q;e[36]!==u?(q=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=q):q=e[37];let X;e[38]!==q?(X=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[38]=q,e[39]=X):X=e[39];let de;e[40]===Symbol.for("react.memo_cache_sentinel")?(de=pe=>y(pe.target.value),e[40]=de):de=e[40];let ne;e[41]!==u?(ne=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=ne):ne=e[42];let ue;e[43]!==h||e[44]!==x||e[45]!==ne?(ue=n.jsx(Xe,{id:"page-form-path",value:x,onChange:de,placeholder:ne,disabled:h}),e[43]=h,e[44]=x,e[45]=ne,e[46]=ue):ue=e[46];let te;e[47]!==X||e[48]!==ue?(te=n.jsxs("div",{className:"space-y-1.5",children:[X,ue]}),e[47]=X,e[48]=ue,e[49]=te):te=e[49];let re;e[50]!==F?(re=F&&n.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=re):re=e[51];let le;e[52]!==Y||e[53]!==te||e[54]!==re||e[55]!==R?(le=n.jsxs("div",{className:"space-y-4 py-4",children:[R,Y,te,re]}),e[52]=Y,e[53]=te,e[54]=re,e[55]=R,e[56]=le):le=e[56];let N;e[57]!==m?(N=()=>m(!1),e[57]=m,e[58]=N):N=e[58];let J;e[59]!==u?(J=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=J):J=e[60];let Z;e[61]!==h||e[62]!==N||e[63]!==J?(Z=n.jsx(_e,{type:"button",variant:"outline",onClick:N,disabled:h,children:J}),e[61]=h,e[62]=N,e[63]=J,e[64]=Z):Z=e[64];let oe;e[65]!==h||e[66]!==f||e[67]!==x?(oe=!f.trim()||!x.trim()||h,e[65]=h,e[66]=f,e[67]=x,e[68]=oe):oe=e[68];let S;e[69]!==h||e[70]!==o||e[71]!==u?(S=h?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),u(Rl[o])]}):u(Il[o]),e[69]=h,e[70]=o,e[71]=u,e[72]=S):S=e[72];let se;e[73]!==oe||e[74]!==S?(se=n.jsx(_e,{type:"submit",disabled:oe,children:S}),e[73]=oe,e[74]=S,e[75]=se):se=e[75];let H;e[76]!==Z||e[77]!==se?(H=n.jsxs(ht,{children:[Z,se]}),e[76]=Z,e[77]=se,e[78]=H):H=e[78];let ie;e[79]!==K||e[80]!==le||e[81]!==H||e[82]!==I?(ie=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:K,children:[I,le,H]})}),e[79]=K,e[80]=le,e[81]=H,e[82]=I,e[83]=ie):ie=e[83];let ve;return e[84]!==O||e[85]!==s||e[86]!==ie?(ve=n.jsx(ct,{open:s,onOpenChange:O,children:ie}),e[84]=O,e[85]=s,e[86]=ie,e[87]=ve):ve=e[87],ve}const Kl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Ys={from:"",to:"",type:"temporary",discardQueryParameters:!1};function zl(t){const e=ae.c(111),{open:s,isPending:o,error:a,onSubmit:l,onOpenChange:i}=t,c=o===void 0?!1:o,r=Se(),[d,p]=$.useState(Ys),[m,h]=$.useState(null),[u,f]=$.useState(s);s!==u&&(f(s),s&&(p(Ys),h(null)));let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=xe=>p($e=>({...$e,...xe})),e[0]=g):g=e[0];const x=g;let y;e[1]!==c||e[2]!==i?(y=xe=>{!xe&&!c&&(h(null),i(!1))},e[1]=c,e[2]=i,e[3]=y):y=e[3];const v=y;let j;e[4]!==c||e[5]!==l||e[6]!==d||e[7]!==r?(j=async xe=>{xe.preventDefault();const $e=d.from.trim(),Fe=d.to.trim();if(!$e||!Fe||c){h(r("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...d,from:$e,to:Fe})},e[4]=c,e[5]=l,e[6]=d,e[7]=r,e[8]=j):j=e[8];const w=j,C=m??a;let E;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(E=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=E):E=e[12];const B=E;let k;e[13]!==r?(k=r("sandbox.redirectFormDialog.title"),e[13]=r,e[14]=k):k=e[14];let D;e[15]!==k?(D=n.jsx(pt,{children:n.jsx(it,{children:k})}),e[15]=k,e[16]=D):D=e[16];let O;e[17]!==r?(O=r("sandbox.redirectEditor.fromLabel"),e[17]=r,e[18]=O):O=e[18];let L;e[19]!==O?(L=n.jsx(ze,{htmlFor:"redirect-form-from",children:O}),e[19]=O,e[20]=L):L=e[20];const K=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=xe=>x({from:xe.target.value}),e[21]=F):F=e[21];let _;e[22]!==r?(_=r("sandbox.redirectEditor.fromPlaceholder"),e[22]=r,e[23]=_):_=e[23];let A;e[24]!==c||e[25]!==d.from||e[26]!==_?(A=n.jsx(Xe,{id:"redirect-form-from",value:K,onChange:F,placeholder:_,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=_,e[27]=A):A=e[27];let I;e[28]!==A||e[29]!==L?(I=n.jsxs("div",{className:"space-y-1.5",children:[L,A]}),e[28]=A,e[29]=L,e[30]=I):I=e[30];let R;e[31]!==r?(R=r("sandbox.redirectEditor.toLabel"),e[31]=r,e[32]=R):R=e[32];let G;e[33]!==R?(G=n.jsx(ze,{htmlFor:"redirect-form-to",children:R}),e[33]=R,e[34]=G):G=e[34];const z=d.to;let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W=xe=>x({to:xe.target.value}),e[35]=W):W=e[35];let T;e[36]!==r?(T=r("sandbox.redirectEditor.toPlaceholder"),e[36]=r,e[37]=T):T=e[37];let U;e[38]!==c||e[39]!==d.to||e[40]!==T?(U=n.jsx(Xe,{id:"redirect-form-to",value:z,onChange:W,placeholder:T,disabled:c}),e[38]=c,e[39]=d.to,e[40]=T,e[41]=U):U=e[41];let Y;e[42]!==G||e[43]!==U?(Y=n.jsxs("div",{className:"space-y-1.5",children:[G,U]}),e[42]=G,e[43]=U,e[44]=Y):Y=e[44];let q;e[45]!==r?(q=r("sandbox.redirectEditor.typeLabel"),e[45]=r,e[46]=q):q=e[46];let X;e[47]!==q?(X=n.jsx(ze,{htmlFor:"redirect-form-type",children:q}),e[47]=q,e[48]=X):X=e[48];const de=d.type;let ne;e[49]===Symbol.for("react.memo_cache_sentinel")?(ne=xe=>x({type:xe}),e[49]=ne):ne=e[49];let ue;e[50]!==r?(ue=r("sandbox.redirectEditor.typePlaceholder"),e[50]=r,e[51]=ue):ue=e[51];let te;e[52]!==ue?(te=n.jsx(Xa,{id:"redirect-form-type",className:"w-full",children:n.jsx(Za,{placeholder:ue})}),e[52]=ue,e[53]=te):te=e[53];let re;e[54]!==r?(re=Kl.map(xe=>n.jsx(Qa,{value:xe.value,children:r(xe.labelKey,{status:zn[xe.value]})},xe.value)),e[54]=r,e[55]=re):re=e[55];let le;e[56]!==re?(le=n.jsx(el,{children:re}),e[56]=re,e[57]=le):le=e[57];let N;e[58]!==c||e[59]!==d.type||e[60]!==te||e[61]!==le?(N=n.jsxs(tl,{value:de,onValueChange:ne,disabled:c,children:[te,le]}),e[58]=c,e[59]=d.type,e[60]=te,e[61]=le,e[62]=N):N=e[62];let J;e[63]!==X||e[64]!==N?(J=n.jsxs("div",{className:"space-y-1.5",children:[X,N]}),e[63]=X,e[64]=N,e[65]=J):J=e[65];let Z;e[66]===Symbol.for("react.memo_cache_sentinel")?(Z=xe=>x({discardQueryParameters:xe===!0}),e[66]=Z):Z=e[66];let oe;e[67]!==c||e[68]!==d.discardQueryParameters?(oe=n.jsx(Xt,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:Z}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=oe):oe=e[69];let S;e[70]!==r?(S=r("sandbox.redirectEditor.discardQueryParameters"),e[70]=r,e[71]=S):S=e[71];let se;e[72]!==S?(se=n.jsx("span",{className:"text-sm",children:S}),e[72]=S,e[73]=se):se=e[73];let H;e[74]!==oe||e[75]!==se?(H=n.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[oe,se]}),e[74]=oe,e[75]=se,e[76]=H):H=e[76];let ie;e[77]!==C?(ie=C&&n.jsx("p",{className:"text-xs text-destructive",children:C}),e[77]=C,e[78]=ie):ie=e[78];let ve;e[79]!==I||e[80]!==Y||e[81]!==J||e[82]!==H||e[83]!==ie?(ve=n.jsxs("div",{className:"space-y-4 py-4",children:[I,Y,J,H,ie]}),e[79]=I,e[80]=Y,e[81]=J,e[82]=H,e[83]=ie,e[84]=ve):ve=e[84];let pe;e[85]!==i?(pe=()=>i(!1),e[85]=i,e[86]=pe):pe=e[86];let ke;e[87]!==r?(ke=r("sandbox.redirectFormDialog.cancel"),e[87]=r,e[88]=ke):ke=e[88];let he;e[89]!==c||e[90]!==pe||e[91]!==ke?(he=n.jsx(_e,{type:"button",variant:"outline",onClick:pe,disabled:c,children:ke}),e[89]=c,e[90]=pe,e[91]=ke,e[92]=he):he=e[92];const we=!B;let Pe;e[93]!==c||e[94]!==r?(Pe=c?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),r("sandbox.redirectFormDialog.pending")]}):r("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=r,e[95]=Pe):Pe=e[95];let Te;e[96]!==we||e[97]!==Pe?(Te=n.jsx(_e,{type:"submit",disabled:we,children:Pe}),e[96]=we,e[97]=Pe,e[98]=Te):Te=e[98];let Ne;e[99]!==he||e[100]!==Te?(Ne=n.jsxs(ht,{children:[he,Te]}),e[99]=he,e[100]=Te,e[101]=Ne):Ne=e[101];let Be;e[102]!==w||e[103]!==ve||e[104]!==Ne||e[105]!==D?(Be=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[D,ve,Ne]})}),e[102]=w,e[103]=ve,e[104]=Ne,e[105]=D,e[106]=Be):Be=e[106];let De;return e[107]!==v||e[108]!==s||e[109]!==Be?(De=n.jsx(ct,{open:s,onOpenChange:v,children:Be}),e[107]=v,e[108]=s,e[109]=Be,e[110]=De):De=e[110],De}function Ml(t){const e=ae.c(70),{open:s,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:c}=t,r=l===void 0?!1:l,d=Se(),[p,m]=$.useState(a),[h,u]=$.useState(s);s!==h&&(u(s),s&&m(a));let f;e[0]!==r||e[1]!==c?(f=de=>{!de&&!r&&c(!1)},e[0]=r,e[1]=c,e[2]=f):f=e[2];const g=f;let x;e[3]!==r||e[4]!==p||e[5]!==i?(x=async de=>{de.preventDefault();const ne=p.trim();!ne||r||await i(ne)},e[3]=r,e[4]=p,e[5]=i,e[6]=x):x=e[6];const y=x;let v;e[7]!==d?(v=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=v):v=e[8];let j;e[9]!==v?(j=n.jsx(it,{children:v}),e[9]=v,e[10]=j):j=e[10];let w;e[11]!==d?(w=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=w):w=e[12];let C;e[13]!==w?(C=n.jsx(zt,{children:w}),e[13]=w,e[14]=C):C=e[14];let E;e[15]!==j||e[16]!==C?(E=n.jsxs(pt,{children:[j,C]}),e[15]=j,e[16]=C,e[17]=E):E=e[17];let B;e[18]!==d?(B=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=B):B=e[19];let k;e[20]!==B?(k=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:B}),e[20]=B,e[21]=k):k=e[21];let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=de=>m(de.target.value),e[22]=D):D=e[22];let O;e[23]!==r||e[24]!==p?(O=n.jsx(Xe,{id:"section-rename-name",value:p,onChange:D,autoFocus:!0,disabled:r}),e[23]=r,e[24]=p,e[25]=O):O=e[25];let L;e[26]!==k||e[27]!==O?(L=n.jsxs("div",{className:"space-y-1.5",children:[k,O]}),e[26]=k,e[27]=O,e[28]=L):L=e[28];let K;e[29]!==d?(K=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=K):K=e[30];let F;e[31]!==K?(F=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:K}),e[31]=K,e[32]=F):F=e[32];let _;e[33]!==o?(_=n.jsx(Xe,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=_):_=e[34];let A;e[35]!==F||e[36]!==_?(A=n.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[35]=F,e[36]=_,e[37]=A):A=e[37];let I;e[38]!==L||e[39]!==A?(I=n.jsxs("div",{className:"space-y-4 py-4",children:[L,A]}),e[38]=L,e[39]=A,e[40]=I):I=e[40];let R;e[41]!==c?(R=()=>c(!1),e[41]=c,e[42]=R):R=e[42];let G;e[43]!==d?(G=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=G):G=e[44];let z;e[45]!==r||e[46]!==R||e[47]!==G?(z=n.jsx(_e,{type:"button",variant:"outline",onClick:R,disabled:r,children:G}),e[45]=r,e[46]=R,e[47]=G,e[48]=z):z=e[48];let W;e[49]!==r||e[50]!==p?(W=!p.trim()||r,e[49]=r,e[50]=p,e[51]=W):W=e[51];let T;e[52]!==r||e[53]!==d?(T=r?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=r,e[53]=d,e[54]=T):T=e[54];let U;e[55]!==W||e[56]!==T?(U=n.jsx(_e,{type:"submit",disabled:W,children:T}),e[55]=W,e[56]=T,e[57]=U):U=e[57];let Y;e[58]!==z||e[59]!==U?(Y=n.jsxs(ht,{children:[z,U]}),e[58]=z,e[59]=U,e[60]=Y):Y=e[60];let q;e[61]!==y||e[62]!==I||e[63]!==Y||e[64]!==E?(q=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:y,children:[E,I,Y]})}),e[61]=y,e[62]=I,e[63]=Y,e[64]=E,e[65]=q):q=e[65];let X;return e[66]!==g||e[67]!==s||e[68]!==q?(X=n.jsx(ct,{open:s,onOpenChange:g,children:q}),e[66]=g,e[67]=s,e[68]=q,e[69]=X):X=e[69],X}function Vl(t){const e=ae.c(7),{type:s}=t,o=zn[s];let a;e[0]!==o?(a=n.jsx(We,{asChild:!0,children:n.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=a):a=e[1];const l=s==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=n.jsx(Ye,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=n.jsxs(Qe,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c}const Gl=60,ps={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},Es=["posts","authors","categories"],Nt={posts:"post",authors:"author",categories:"category"};function ot(t){return Es.includes(t)}const es={posts:"post",authors:"author",categories:"category"},Qn={posts:ps.post,authors:ps.author,categories:ps.category},Ul=Object.fromEntries(Object.entries(Qn).map(([t,e])=>[e,t]));function Hl(t){return typeof t=="string"?Ul[t]??null:null}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ee(t){return typeof t=="string"?t:""}function ql(t,e){switch(t){case"posts":return{label:ee(e.title)||"Untitled post",subtitle:ee(e.slug)};case"authors":return{label:ee(e.name)||"Unnamed author",subtitle:ee(e.email)};case"categories":return{label:ee(e.name)||"Unnamed category",subtitle:ee(e.slug)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function Xn(t){const e={posts:[],authors:[],categories:[]};for(const[s,o]of Object.entries(t)){const a=Ie(o);if(!a)continue;const l=Hl(a.__resolveType);if(!l)continue;const i=Ie(a[es[l]])??{},{label:c,subtitle:r}=ql(l,i);e[l].push({key:s,kind:l,label:c,subtitle:r})}for(const s of Es)e[s].sort((o,a)=>o.label.localeCompare(a.label));return e}function Jl(t,e){return Xn(t)[e]}function Ge(t,e){return Jl(t,e).map(s=>({key:s.key,payload:dt(Ie(t[s.key])??void 0,e)}))}const Qs=Object.freeze({});function dt(t,e){return t?Ie(t[es[e]])??Qs:Qs}function at(t,e,s){return{name:t,__resolveType:Qn[e],[es[e]]:s}}function cd({records:t,selected:e,valueField:s,toRef:o}){const a=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:ee(Ie(h)?.[s]),i=h=>typeof h=="string"?h:ee(Ie(h)?.name),c=h=>{const u=l(h),f=u?t.find(({payload:x})=>ee(x[s])===u):void 0;if(f)return f;const g=i(h);return g?t.find(({payload:x})=>ee(x.name)===g):void 0},r=t.map(({key:h,payload:u})=>({value:h,label:ee(u.name)||ee(u[s])||h})),d=new Map,p=[];return a.forEach((h,u)=>{const f=c(h);if(f){p.includes(f.key)||p.push(f.key);return}const g=`unresolved:${u}`;d.set(g,h),p.push(g),r.push({value:g,label:i(h)||l(h)||"Unknown"})}),{options:r,selectedValues:p,refsForValues:h=>h.map(u=>{const f=t.find(g=>g.key===u);return f?o(f.payload):d.get(u)}).filter(u=>u!==void 0)}}function Ze(t){return Array.isArray(t)?t:[]}function st(t){if(typeof t=="string")return t;const e=Ie(t);return e?ee(e.slug):""}function Zn(t){if(typeof t=="string")return t;const e=Ie(t);return e?ee(e.email):""}function _s(t){const e=[];return ee(t.title).trim()||e.push("Title"),ee(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(st).filter(Boolean).length===0&&e.push("Category"),ee(t.excerpt).trim()||e.push("Excerpt"),ee(t.image).trim()||e.push("Cover image"),e}const Ds=["draft","generating","awaiting_review","scheduled","published","archived"],eo=8;function Et(t){switch(ee(t.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function Wl(t,e){return e!=="published"&&e!=="scheduled"||Et(t)===e?!1:_s(t).length>0}function Yl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,eo).toISOString()}function Mt(t,e,s){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=ee(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?Yl(s):o}}function to(t){return Ge(t,"posts").map(({key:e,payload:s})=>({key:e,title:ee(s.title)||"Untitled post",slug:ee(s.slug),date:ee(s.date),scheduledDatetime:ee(s.scheduledDatetime),categorySlugs:Ze(s.categories).map(st).filter(Boolean),authorEmails:Ze(s.authors).map(Zn).filter(Boolean),missing:_s(s),status:Et(s),form:"live"}))}const so="blog-manager/posts/";function no(t){return t.startsWith(so)}function Ct(t){return t.split("/").pop()??t}function Vt(t){return`${so}${t}`}function Ql(t){return`collections/blog/posts/${t}`}function bs(){return xt(12)}function Xl(t){const e=Ie(t.planning)??{},s=Ie(e.format);return{ideaKey:ee(e.ideaKey)||void 0,pillarKey:ee(e.pillarKey)||void 0,pillarTitle:ee(e.pillarTitle)||void 0,format:s?{name:ee(s.name),value:ee(s.value)}:void 0,brief:ee(e.brief)||void 0}}function oo(t){return{title:t.title,slug:"",excerpt:"",date:t.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:t.planning??{}}}function ut(t,e){return{name:t,[es.posts]:e}}function dd(t,e){return no(t)?ut(t,e):at(t,"posts",e)}function Zl(t){const e=[];for(const[s,o]of Object.entries(t)){if(!no(s))continue;const a=Ie(o);a&&e.push({key:s,payload:dt(a,"posts")})}return e}function ei(t){return[...Zl(t).map(({key:s,payload:o})=>({key:s,title:ee(o.title)||"Untitled post",slug:ee(o.slug),date:ee(o.date),scheduledDatetime:ee(o.scheduledDatetime),categorySlugs:Ze(o.categories).map(st).filter(Boolean),authorEmails:Ze(o.authors).map(Zn).filter(Boolean),missing:_s(o),status:Et(o),form:"planning"})),...to(t)]}function ti(t,e,s){const o=Mt(t.payload,e,s),a=Ct(t.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?Ql(a):Vt(a),c=l==="live"?at(i,"posts",o):ut(i,o);return{writes:{[i]:c},deletes:i===t.key?[]:[t.key]}}function ud(t,e,s){const o=Ze(t.categories);if(!o.some(c=>st(c)===e))return t;const a=o.map(c=>{const r=st(c);return r===e||r===s.slug?{name:s.name,slug:s.slug}:c}),l=new Set,i=a.filter(c=>{const r=st(c);return r?l.has(r)?!1:(l.add(r),!0):!0});return{...t,categories:i}}function si(t,e){const s=Ze(t.categories);return s.some(o=>st(o)===e)?{...t,categories:s.filter(o=>st(o)!==e)}:t}function ni(t){const e=ee(t.status),s=e==="idea"||e==="in_review"?{status:Et(t)}:{};return{...t,...s,dateModified:new Date().toISOString()}}function xt(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,s=>s.toString(16).padStart(2,"0")).join("").slice(0,t)}function hs(t,e){const s=`collections/blog/${e}/${xt(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function ao(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${xt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${xt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const oi={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},Xs="Box";function ai(t){return t.startsWith("site/")?"site":"app"}function li(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function vt(...t){for(const e of t)if(e!==void 0)return e}function Zs(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function ii(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():t}function lo(t){const e=new Set,s=[],o=t.manifest?.blocks??{};for(const a of Object.values(o))for(const l of Object.keys(a)){if(!ci(l)||e.has(l))continue;e.add(l);const i=Cs(l,t),c=ts(l),r=oi[c],d=ai(l),p=Zs(i.title),m=Zs(i.description),h=(d==="site"?vt(p,r?.title):vt(r?.title,p))??ii(c),u=d==="site"?vt(m,r?.description):vt(r?.description,m),f=d==="site"?i.icon:void 0,g=f&&li(f)?f:void 0,x=g!==void 0?r?.iconName??Xs:vt(f,r?.iconName)??Xs;s.push({resolveType:l,title:h,description:u,iconName:x,iconUrl:g,source:d})}return s.sort((a,l)=>a.title.localeCompare(l.title))}function ts(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const ri=["blog/sections/blocks/","site/sections/Blog/Post/"];function ci(t){return ri.some(e=>t.startsWith(e))}const As="blog-manager-brand";function Ke(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){s.trim()&&e.push({name:s,value:""});continue}const o=Ie(s);o&&e.push({name:ee(o.name),value:ee(o.value)})}return e}function Me(t){return t.filter(e=>e.name.trim()||e.value.trim())}const di=6e4,ui=4e3;function mi(t){const e=[],s=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(s.has(i))return;s.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,c]of Object.entries(a))i!=="__resolveType"&&o(c,i)};return o(t,"block"),e.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-R5yzsqfq.js","assets/index-DqR5nN5p.js","assets/index-CoamuzBl.css","assets/chat-context-iBhAWaTl.js","assets/use-panel-navigate-BCZgeLOH.js","assets/thread-route-3OSBRLJC.js","assets/use-project-scope-CfQAh61-.js","assets/repository-binding-DaBjdkOf.js","assets/use-mcp-client-BPL_EWAU.js","assets/auth-AjdxyXQQ.js","assets/autosend-DtAhWrvb.js","assets/thread-intent-DvIpA8uQ.js","assets/backoff-8mStPHYB.js","assets/task-board-BShelgWZ.js","assets/schema-CB-ciFqj.js","assets/slugify-CEUa2lfQ.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-decopilot-events-RXaXesu8.js","assets/use-ai-providers-Dq5hmlKk.js","assets/location-DBePU4bz.js","assets/use-organization-settings-7JQv2bha.js","assets/scroll-area-CRvpPUz2.js","assets/select-l0paibPQ.js","assets/index-Vd7iTgVD.js","assets/Check-C7XCKaVD.js","assets/ChevronUp-BLjBJuX1.js","assets/use-section-preview-base-CjxZD1As.js","assets/UserSquare-CAix9ifC.js","assets/agent-icon-Cju9Okbj.js","assets/AlertCircle-Dh9lwUAJ.js","assets/Tool01-fHsiwx5R.js","assets/ArrowUp-BEUKMR1b.js","assets/ArrowLeft-BGYsJwr2.js","assets/ArrowRight-9nkv_n33.js","assets/ShoppingBag01-Dutlk1ra.js","assets/ZoomOut-PSTvj6r8.js","assets/Palette-qYxOT-Eu.js","assets/CheckCircle-ChjcsQ6e.js","assets/Copy01-COSj2yl3.js","assets/CreditCard01-c7ALaNdl.js","assets/DotsVertical-BY6GOg69.js","assets/Image01-BUoc7dul.js","assets/XClose-B9Q2XRVd.js","assets/Key01-CpDPClSw.js","assets/Link01-Cl8TmSAu.js","assets/LinkExternal01-BpwEo5mX.js","assets/Monitor01-DjVxT7Ye.js","assets/Sun-BVBkARhS.js","assets/Plus-coArzCGt.js","assets/SearchMd-D7DbuO-r.js","assets/Trash01-B9q9XwwI.js","assets/Upload01-CphgSD0x.js","assets/User01-CMYGXzFL.js","assets/Users01-DPFEioN5.js","assets/X-Dt1AZixL.js","assets/dialog-BAKH_-im.js","assets/input-Buk-AyEm.js","assets/use-new-blocks-editor-V3EhO6Xe.js","assets/claim-phase-copy-Cu7y7gag.js","assets/section-preview-url-Csj0_ZDg.js","assets/use-session-runtime-BhqEJTFD.js","assets/runnable-block-editor-COBrimGH.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair--ffwMsVi.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-CLujQiBB.js","assets/use-copy-Bxzmp3bO.js","assets/usage-stats-BSKAHrH7.js","assets/markdown-DN9FJYvL.js","assets/org-file-open-context-0m9nAn5k.js","assets/use-mobile-BTq1Cy6A.js","assets/tooltip-C_zuUaOC.js","assets/shell-layout-BpAT-xed.js","assets/avatar-BugbqVXb.js","assets/download-app-dialog-DPWcze5R.js","assets/command-Ca_7Byfo.js","assets/index-SkTn342u.js","assets/integration-icon-C2IglhA_.js","assets/project-icon-C5xEY8i8.js","assets/new-project-dialog-Db3wbOfy.js","assets/label-CerbhQb5.js","assets/repository-import-picker-BGWkh1A1.js","assets/use-navigate-to-agent-DYjNTZEe.js","assets/repository-picker-CmwzBQy1.js","assets/useInfiniteQuery-cbQywZ3L.js","assets/infiniteQueryObserver-Cug9ZMk0.js","assets/collection-search-RCkR7knL.js","assets/use-debounced-value-D-F2ClXC.js","assets/required-auth-layout-LAfCgKok.js","assets/use-org-sso-BhqNUA_g.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-Gt3_oNY0.js","assets/types-B4I82BK0.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-CvISKT37.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/sheet-DuI8hTNu.js","assets/use-connection-B7lWDEkg.js","assets/use-mcp-prompts-DPQ9PBYp.js","assets/index-DX_ORy-2.js","assets/form-CBoGvDdc.js","assets/use-thread-outputs-DHNNx8Ws.js","assets/file-type-icon-Ec1QqaNx.js","assets/popover-DhlDrafq.js","assets/utils-DaYQyxgr.js","assets/monaco-editor-YjPjw4dd.js","assets/editor-DfRgyxZb.js","assets/calendar-4zS_oOft.js","assets/textarea-C2rYHq-c.js","assets/rich-text-link-control-Cs8PKwyq.js","assets/switch-0GCfvPjG.js","assets/combobox-B3MSOcaK.js","assets/alert-dialog-dGExRb-e.js","assets/sandbox-url-D3mC8qhT.js","assets/search-input-Dop1zFXq.js","assets/tabs-CNMiZCNd.js","assets/use-file-configs-BqBvHsey.js","assets/asset-utils-m3RtaS65.js","assets/use-chat-layout-state-sYWhuOwp.js","assets/site-slug-DebpOoQq.js","assets/toggle-group-rUyQhxO1.js","assets/sandbox-git-api-B1R0585s.js","assets/agent-view-guard-CMzjdLr_.js","assets/use-main-panel-tabs-QkTFj72o.js","assets/use-mcp-tools-DZPcwH6I.js","assets/index-Cz9ngF1R.js","assets/drawer-D6W2ZApA.js","assets/input-BAlEkL74.js","assets/chat-draft-2b__RL23.js","assets/use-deco-credits-C4SdRl1J.js","assets/use-open-billing-url-C42sAajC.js","assets/decopilot-D626jWMz.js","assets/checkbox-9Hass2fp.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-BusYqxFz.js","assets/input-05oF9Lbq.js","assets/suggestion-Bcihs8ZP.js","assets/use-org-fs-CHoKBUvQ.js","assets/question-004-sINsf4GQ.js","assets/use-members-BznZqHvf.js","assets/use-org-auth-client-SPO1PFOn.js","assets/feature-paywall-CZbbYxob.js","assets/plan-ladder-BTuOH_rJ.js","assets/add-connection-dialog-CzZDruYr.js","assets/extract-connection-data-B2HBCx7f.js","assets/metadata-D72DunRR.js","assets/connection-BZR_b2EN.js","assets/connection-card-BCurehFX.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-BJ_8FXIG.js","assets/authenticate-and-persist-oauth-qbq5LuiV.js","assets/mcp-oauth-D4EkuyvW.js","assets/collection-tabs-BOAoqV16.js","assets/badge-D1nBHfyl.js","assets/use-infinite-scroll-Mtyk8Q0g.js","assets/useSuspenseInfiniteQuery-CL-DZoeM.js","assets/use-task-board-events-2DTfUd8b.js","assets/input-Bwd_JSM8.css","assets/sandbox-lifecycle-context-BC8wxuhd.js","assets/resolve-tab-icon-DwfEk1eS.js","assets/use-task-metadata-LZhy7A-X.js","assets/virtual-mcp-DPVA40iH.js","assets/feature-gate-DPOwo3io.js","assets/mustache-BGVTVChV.js","assets/empty-state-L1uIcmaC.js","assets/empty-state-DBsD3RKy.js","assets/post-editor-rZtul2Mk.js","assets/multi-select-oCVVhjFs.js","assets/block-document-CxKjCcIO.js","assets/index-BpSkcbyR.js","assets/use-fast-preview-draft-url-czyVDta1.js","assets/use-autosave-CBElvX-u.js","assets/record-editor-Dbd0VnCw.js","assets/context-Bv0D5-Uj.js","assets/index-CZzi-MMq.js","assets/get-initials-D-f_fDFw.js","assets/category-editor-C2JizcgQ.js","assets/sections-editor-BSc_WwD-.js","assets/page-seo-form-B4Q_F9eC.js","assets/variant-matcher-override-Cng-aq7T.js","assets/seo-editor-CJOT6SSo.js","assets/variant-calendar-pbRcz2zJ.js","assets/view-mode-toggle-CNo4raIS.js","assets/post-calendar-XHFsJXTd.js","assets/alert-DMoz9rms.js","assets/redirect-editor-CoTmBQAz.js"])))=>i.map(i=>d[i]);
2
+ import{c as ae,b as Se,j as n,m as xs,K as Pt,l as be,r as $,h as lt,B as _e,o as Po,e as To,t as me,a2 as js,az as St,aI as bt,F as It,aA as Fs,H as Rt,I as Ft,au as Bo,U as Eo,V as _o,G as Je,af as Tt,aJ as ds,aK as Do,X as Ao,u as kn,aG as He}from"./index-DqR5nN5p.js";import{A as $o}from"./agent-view-guard-CMzjdLr_.js";import{F as Lo}from"./feature-gate-DPOwo3io.js";import{u as Bt,b as Sn}from"./chat-context-iBhAWaTl.js";import{i as Wt}from"./AlertCircle-Dh9lwUAJ.js";import{H as Oo,S as wn,T as et,U as Nn,V as ks,W as Io,X as Cn,Y as Ro,b as Kt,N as Pn,Z as Fo,_ as Ko,$ as wt,a0 as zo,a1 as Mo,n as Vo,a2 as Go,a3 as Tn,a4 as Uo,a5 as Ho,a6 as qo,l as Ks,a7 as Jo,F as Bn}from"./agent-icon-Cju9Okbj.js";import{a as En,i as Ss,d as zs}from"./UserSquare-CAix9ifC.js";import{b as _n,i as Dn}from"./ZoomOut-PSTvj6r8.js";import{c as An,i as Wo}from"./XClose-B9Q2XRVd.js";import{s as ws}from"./Plus-coArzCGt.js";import{t as $n}from"./Users01-DPFEioN5.js";import{f as Yo,e as Qo,b as Xo,A as Zo,a as ea,d as ta,c as sa,g as na}from"./alert-dialog-dGExRb-e.js";import{S as Yt}from"./scroll-area-CRvpPUz2.js";import{T as We,a as Ye,b as Qe}from"./tooltip-C_zuUaOC.js";import{B as nt}from"./badge-D1nBHfyl.js";import{S as us,n as oa,c as aa,g as Ln,B as ms,P as la,h as On,o as ia,i as gs,s as ra,u as Qt,l as ca,q as da,R as ua,t as In,r as ma,v as fa,d as Rn,w as pa,x as ha,y as Fn,z as xa,M as ga,j as ba,A as ya,p as va,C as ja,D as ka,e as Sa,f as wa,E as Ms,F as Kn,k as Na,G as Ca}from"./runnable-block-editor-COBrimGH.js";import{r as Ns,S as Pa,m as Cs,i as Ta,o as Ba,q as Ea,n as Lt,v as _a,R as zn,t as Da,l as Aa,w as $a,x as La,y as Vs,G as Ps,g as Oa,z as Ia,e as Gs,A as Ra,d as Fa,B as Ka,D as Us,h as za,E as Ma,F as Va}from"./claim-phase-copy-Cu7y7gag.js";import{u as Mn,P as Ga}from"./mustache-BGVTVChV.js";import{n as Vn}from"./ShoppingBag01-Dutlk1ra.js";import{t as ft}from"./ChevronUp-BLjBJuX1.js";import{C as Ua,a as Ha,b as qa}from"./collapsible-CLujQiBB.js";import{c as Ja,d as Wa}from"./sandbox-lifecycle-context-BC8wxuhd.js";import{u as Gn}from"./use-session-runtime-BhqEJTFD.js";import{c as pt,d as it,e as ht,b as rt,D as ct,h as zt,a as Ya}from"./dialog-BAKH_-im.js";import{I as Xe}from"./input-Buk-AyEm.js";import{C as Xt}from"./checkbox-9Hass2fp.js";import{L as ze}from"./label-CerbhQb5.js";import{c as Qa,b as Xa,a as Za,d as el,S as tl}from"./select-l0paibPQ.js";import{o as sl}from"./sandbox-git-api-B1R0585s.js";import{a as Hs}from"./utils-DaYQyxgr.js";import{i as nl}from"./CheckCircle-ChjcsQ6e.js";import{s as Ts}from"./Trash01-B9q9XwwI.js";import{i as fs}from"./Upload01-CphgSD0x.js";import{E as ol}from"./empty-state-L1uIcmaC.js";import{T as Ot}from"./textarea-C2rYHq-c.js";import{u as al}from"./use-ai-providers-Dq5hmlKk.js";import{M as Un}from"./monaco-editor-YjPjw4dd.js";import{i as Bs}from"./X-Dt1AZixL.js";import{f as Hn,a as ll}from"./repository-binding-DaBjdkOf.js";import"./rich-text-link-control-Cs8PKwyq.js";import{a as il}from"./Copy01-COSj2yl3.js";import{b as rl}from"./Tool01-fHsiwx5R.js";import{b as qs}from"./use-project-scope-CfQAh61-.js";import{E as cl}from"./empty-state-DBsD3RKy.js";import{G as Js}from"./repository-picker-CmwzBQy1.js";import{R as dl}from"./repository-import-picker-BGWkh1A1.js";import{b as ul}from"./thread-route-3OSBRLJC.js";function ml(t){const e=ae.c(18),{title:s,description:o,children:a}=t,l=Se();let i;e[0]!==a?(i=n.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Oo,{}),e[2]=c):c=e[2];let r;e[3]!==l?(r=l("common.soon"),e[3]=l,e[4]=r):r=e[4];let d;e[5]!==r?(d=n.jsxs(nt,{variant:"secondary",children:[c,r]}),e[5]=r,e[6]=d):d=e[6];let p;e[7]!==s?(p=n.jsx("p",{className:"text-base font-semibold text-foreground",children:s}),e[7]=s,e[8]=p):p=e[8];let m;e[9]!==o?(m=o&&n.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=m):m=e[10];let h;e[11]!==d||e[12]!==p||e[13]!==m?(h=n.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:n.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,p,m]})}),e[11]=d,e[12]=p,e[13]=m,e[14]=h):h=e[14];let u;return e[15]!==i||e[16]!==h?(u=n.jsxs("div",{className:"relative h-full min-h-0",children:[i,h]}),e[15]=i,e[16]=h,e[17]=u):u=e[17],u}function fl(t,e){if(!t||!e?.length)return t;const s=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(s).length>0?{...t,properties:s}:t}function pl(t,e,s){return typeof t!="string"?null:fl(Ns(t,e),s)}function qn(t,e,s){if(!e||typeof t!="string")return!1;const o=pl(t,e,s);return!!o&&Object.keys(o.properties??{}).length>0}function yt(t){const e=ae.c(6),{hasItems:s,emptyLabel:o,emptyHint:a}=t;let l;e[0]!==a||e[1]!==o||e[2]!==s?(l=s?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:o}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=s,e[3]=l):l=e[3];let i;return e[4]!==l?(i=n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function Zt(t,e){return`${t}-${e}`}function Jn(t,e){return`site/apps/${t}/${e}.ts`}function Wn(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function hl(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function xl(t){return t==="local"?"Custom":"Installed"}function Yn(t,e,s){const o=new Set([Zt(t,e),e].map(l=>l.toLowerCase())),a=Jn(t,e);for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=i;if(o.has(l.toLowerCase())||c.__resolveType===a)return l}return null}function gl(t,e){const s=t.vendor.alias,o=t.name,a=Yn(s,o,e);return{id:Zt(s,o),app:o,vendor:s,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:Jn(s,o),blockKey:a,installed:a!==null}}function bl(t,e,s){if(t===Pa)return null;const o=Wn(t);if(!o)return null;const{vendor:a,app:l}=o,i=Yn(a,l,s),c=Cs(t,e);return{id:Zt(a,l),app:l,vendor:a,title:c.title??l,description:c.description??"",category:"Others",logo:c.logo??c.icon,resolveType:t,blockKey:i,installed:i!==null}}function yl(t,e,s){const o=e.__resolveType;if(typeof o!="string"||Ta(t,e)||!Ba(o))return null;const a=Wn(o)??hl(t);if(!a)return null;const l=Cs(o,s),{vendor:i,app:c}=a;return{id:Zt(i,c),app:c,vendor:i,title:l.title??Ea(t,e,s),description:l.description??"",category:xl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function vl(t,e,s){const o=new Map;for(const l of t){const i=gl(l,s);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=bl(l,e,s);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(s)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=yl(l,i,e);!c||o.has(c.id)||o.set(c.id,c)}return[...o.values()].sort(jl)}function jl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function kl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function Sl(t,e,s){const o=ae.c(12),a=s?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=Pt.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:kl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const c=xs(i);let r;o[3]!==e||o[4]!==t||o[5]!==c.data?(r=t&&e?vl(c.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=c.data,o[6]=r):r=o[6];const d=r,p=c.isLoading&&!c.isError;let m;return o[7]!==d||o[8]!==c.isError||o[9]!==c.refetch||o[10]!==p?(m={catalog:d,isLoading:p,isError:c.isError,refetch:c.refetch},o[7]=d,o[8]=c.isError,o[9]=c.refetch,o[10]=p,o[11]=m):m=o[11],m}const wl=["sections","apps","loaders","actions"];function Nl(t){const e=ae.c(59),{active:s,counts:o,showBlog:a,onSelect:l}=t,i=Se();let c;e[0]!==i?(c=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:c})}),e[2]=c,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const p=s==="pages";let m;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==p?(m=n.jsx(Re,{id:"pages",icon:En,label:d,count:o.pages,active:p,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const u=s==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==u?(f=n.jsx(Re,{id:"redirects",icon:wn,label:h,count:o.redirects,active:u,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=u,e[17]=f):f=e[17];let g;e[18]!==i?(g=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=g):g=e[19];const x=s==="site";let y;e[20]!==l||e[21]!==x||e[22]!==g?(y=n.jsx(Re,{id:"site",icon:Io,label:g,active:x,onSelect:l}),e[20]=l,e[21]=x,e[22]=g,e[23]=y):y=e[23];let v;e[24]!==i?(v=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=v):v=e[25];const j=s==="seo";let w;e[26]!==l||e[27]!==v||e[28]!==j?(w=n.jsx(Re,{id:"seo",icon:Cn,label:v,active:j,onSelect:l}),e[26]=l,e[27]=v,e[28]=j,e[29]=w):w=e[29];let C;e[30]!==i?(C=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=C):C=e[31];const E=s==="calendar";let B;e[32]!==l||e[33]!==C||e[34]!==E?(B=n.jsx(Re,{id:"calendar",icon:Ro,label:C,active:E,onSelect:l}),e[32]=l,e[33]=C,e[34]=E,e[35]=B):B=e[35];let k;e[36]!==s||e[37]!==o||e[38]!==l?(k=n.jsx(Cl,{active:s,counts:o,onSelect:l}),e[36]=s,e[37]=o,e[38]=l,e[39]=k):k=e[39];let D;e[40]!==s||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(D=a&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[n.jsx(Vn,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),n.jsx(Re,{id:"context",icon:et,label:i("sandbox.collectionsSidebar.context"),active:s==="context",onSelect:l}),n.jsx(Re,{id:"posts",icon:_n,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:s==="posts",onSelect:l}),n.jsx(Re,{id:"authors",icon:$n,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:s==="authors",onSelect:l}),n.jsx(Re,{id:"categories",icon:Nn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:s==="categories",onSelect:l}),n.jsx(Re,{id:"post-schedule",icon:ks,label:i("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onSelect:l})]}),e[40]=s,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=D):D=e[47];let O;e[48]!==y||e[49]!==w||e[50]!==B||e[51]!==k||e[52]!==D||e[53]!==m||e[54]!==f?(O=n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[m,f,y,w,B,k,D]}),e[48]=y,e[49]=w,e[50]=B,e[51]=k,e[52]=D,e[53]=m,e[54]=f,e[55]=O):O=e[55];let L;return e[56]!==r||e[57]!==O?(L=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[r,O]}),e[56]=r,e[57]=O,e[58]=L):L=e[58],L}function Cl(t){const e=ae.c(52),{active:s,counts:o,onSelect:a}=t,l=Se();let i;e[0]!==s?(i=wl.includes(s),e[0]=s,e[1]=i):i=e[1];const c=i,[r,d]=$.useState(!1),p=r||c;let m,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=be("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),h=n.jsx(Fo,{size:16,className:"shrink-0"}),e[2]=m,e[3]=h):(m=e[2],h=e[3]);let u;e[4]!==l?(u=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=u):u=e[5];let f;e[6]!==u?(f=n.jsx("span",{className:"flex-1 truncate",children:u}),e[6]=u,e[7]=f):f=e[7];const g=p&&"rotate-180";let x;e[8]!==g?(x=be("shrink-0 text-muted-foreground/70 transition-transform",g),e[8]=g,e[9]=x):x=e[9];let y;e[10]!==x?(y=n.jsx(ft,{size:16,className:x}),e[10]=x,e[11]=y):y=e[11];let v;e[12]!==f||e[13]!==y?(v=n.jsxs(Ua,{className:m,children:[h,f,y]}),e[12]=f,e[13]=y,e[14]=v):v=e[14];let j;e[15]!==l?(j=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=j):j=e[16];const w=s==="sections";let C;e[17]!==o.sections||e[18]!==a||e[19]!==j||e[20]!==w?(C=n.jsx(Re,{id:"sections",icon:Kt,label:j,count:o.sections,active:w,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=j,e[20]=w,e[21]=C):C=e[21];let E;e[22]!==l?(E=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=E):E=e[23];const B=s==="apps";let k;e[24]!==o.apps||e[25]!==a||e[26]!==E||e[27]!==B?(k=n.jsx(Re,{id:"apps",icon:An,label:E,count:o.apps,active:B,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=E,e[27]=B,e[28]=k):k=e[28];let D;e[29]!==l?(D=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=D):D=e[30];const O=s==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==D||e[34]!==O?(L=n.jsx(Re,{id:"loaders",icon:Pn,label:D,count:o.loaders,active:O,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=D,e[34]=O,e[35]=L):L=e[35];let K;e[36]!==l?(K=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=K):K=e[37];const F=s==="actions";let _;e[38]!==o.actions||e[39]!==a||e[40]!==K||e[41]!==F?(_=n.jsx(Re,{id:"actions",icon:Dn,label:K,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=K,e[41]=F,e[42]=_):_=e[42];let A;e[43]!==C||e[44]!==k||e[45]!==L||e[46]!==_?(A=n.jsxs(Ha,{className:"flex flex-col gap-0.5 pt-0.5",children:[C,k,L,_]}),e[43]=C,e[44]=k,e[45]=L,e[46]=_,e[47]=A):A=e[47];let I;return e[48]!==p||e[49]!==A||e[50]!==v?(I=n.jsxs(qa,{open:p,onOpenChange:d,children:[v,A]}),e[48]=p,e[49]=A,e[50]=v,e[51]=I):I=e[51],I}function Re(t){const e=ae.c(19),{id:s,icon:o,label:a,count:l,active:i,onSelect:c,indent:r}=t;let d;e[0]!==s||e[1]!==c?(d=()=>c(s),e[0]=s,e[1]=c,e[2]=d):d=e[2];const p=r&&"pl-6",m=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==p||e[4]!==m?(h=be("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",p,m),e[3]=p,e[4]=m,e[5]=h):h=e[5];let u;e[6]!==o?(u=n.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==a?(f=n.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=f):f=e[9];let g;e[10]!==i||e[11]!==l?(g=l!==void 0&&n.jsx("span",{className:be("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=g):g=e[12];let x;return e[13]!==d||e[14]!==h||e[15]!==u||e[16]!==f||e[17]!==g?(x=n.jsxs("button",{type:"button",onClick:d,className:h,children:[u,f,g]}),e[13]=d,e[14]=h,e[15]=u,e[16]=f,e[17]=g,e[18]=x):x=e[18],x}function Pl(t){const e=ae.c(12),{state:s,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=t;switch(s.kind){case"starting":{let c;e[0]!==o||e[1]!==a?(c=oa({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==c?(r=n.jsx(us,{kind:"starting",progress:c,claimPhase:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5],r}case"suspended":{let c;return e[6]!==l?(c=n.jsx(us,{kind:"suspended",onResume:l}),e[6]=l,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==i||e[9]!==l||e[10]!==s.error?(c=n.jsx(us,{kind:"errored",error:s.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=s.error,e[11]=c):c=e[11],c}}}const Tl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Bl(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",s=!e&&!Tl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function Ws(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${s} (copy)`;if(!t.has(o))return o;for(let a=2;a<1e3;a++){const l=`${s} (copy ${a})`;if(!t.has(l))return l}return`${s} (copy ${Date.now()})`}function El(t,e){const s=Lt,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!t.has(s(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(s(i)))return i}return`${o}-copy-${Date.now()}`}function _l(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),o=`${s}_copy`;if(!Object.hasOwn(t,o))return o;for(let a=2;a<1e3;a++){const l=`${s}_copy_${a}`;if(!Object.hasOwn(t,l))return l}return`${s}_copy_${Date.now()}`}function Dl(t){const e=Ln(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function Al(t,e){return aa(t,e)}const $l=1e3;function Ll(t,e){for(let s=0;s<$l;s++){const o=Ln(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const Ol={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},Il={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Rl={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Fl(t){const e=ae.c(88),{open:s,mode:o,initialName:a,initialPath:l,isPending:i,error:c,templates:r,validate:d,onSubmit:p,onOpenChange:m}=t,h=i===void 0?!1:i,u=Se(),[f,g]=$.useState(a),[x,y]=$.useState(l),[v,j]=$.useState(ms),[w,C]=$.useState(null),[E,B]=$.useState(s);s!==E&&(B(s),s&&(g(a),y(l),j(ms),C(null)));const k=o==="create"&&!!r?.length;let D;e[0]!==h||e[1]!==m?(D=pe=>{!pe&&!h&&(C(null),m(!1))},e[0]=h,e[1]=m,e[2]=D):D=e[2];const O=D;let L;e[3]!==h||e[4]!==f||e[5]!==p||e[6]!==x||e[7]!==k||e[8]!==v||e[9]!==d?(L=async pe=>{pe.preventDefault();const ke=f.trim(),he=x.trim();if(!ke||!he||h)return;const we=_a(he);if(we){C(we);return}const Pe=d?.({name:ke,path:he});if(Pe){C(Pe);return}C(null),await p({name:ke,path:he,templateKey:k&&v!==ms?v:null})},e[3]=h,e[4]=f,e[5]=p,e[6]=x,e[7]=k,e[8]=v,e[9]=d,e[10]=L):L=e[10];const K=L,F=w??c,_=Ol[o];let A;e[11]!==u||e[12]!==_?(A=u(_),e[11]=u,e[12]=_,e[13]=A):A=e[13];let I;e[14]!==A?(I=n.jsx(pt,{children:n.jsx(it,{children:A})}),e[14]=A,e[15]=I):I=e[15];let R;e[16]!==h||e[17]!==k||e[18]!==u||e[19]!==v||e[20]!==r?(R=k&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),n.jsx(la,{id:"page-form-template",value:v,onChange:j,templates:r??[],disabled:h})]}),e[16]=h,e[17]=k,e[18]=u,e[19]=v,e[20]=r,e[21]=R):R=e[21];let G;e[22]!==u?(G=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=G):G=e[23];let z;e[24]!==G?(z=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:G}),e[24]=G,e[25]=z):z=e[25];let W;e[26]===Symbol.for("react.memo_cache_sentinel")?(W=pe=>g(pe.target.value),e[26]=W):W=e[26];let T;e[27]!==u?(T=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=T):T=e[28];let U;e[29]!==h||e[30]!==f||e[31]!==T?(U=n.jsx(Xe,{id:"page-form-name",value:f,onChange:W,placeholder:T,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=T,e[32]=U):U=e[32];let Y;e[33]!==U||e[34]!==z?(Y=n.jsxs("div",{className:"space-y-1.5",children:[z,U]}),e[33]=U,e[34]=z,e[35]=Y):Y=e[35];let q;e[36]!==u?(q=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=q):q=e[37];let X;e[38]!==q?(X=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[38]=q,e[39]=X):X=e[39];let de;e[40]===Symbol.for("react.memo_cache_sentinel")?(de=pe=>y(pe.target.value),e[40]=de):de=e[40];let ne;e[41]!==u?(ne=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=ne):ne=e[42];let ue;e[43]!==h||e[44]!==x||e[45]!==ne?(ue=n.jsx(Xe,{id:"page-form-path",value:x,onChange:de,placeholder:ne,disabled:h}),e[43]=h,e[44]=x,e[45]=ne,e[46]=ue):ue=e[46];let te;e[47]!==X||e[48]!==ue?(te=n.jsxs("div",{className:"space-y-1.5",children:[X,ue]}),e[47]=X,e[48]=ue,e[49]=te):te=e[49];let re;e[50]!==F?(re=F&&n.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=re):re=e[51];let le;e[52]!==Y||e[53]!==te||e[54]!==re||e[55]!==R?(le=n.jsxs("div",{className:"space-y-4 py-4",children:[R,Y,te,re]}),e[52]=Y,e[53]=te,e[54]=re,e[55]=R,e[56]=le):le=e[56];let N;e[57]!==m?(N=()=>m(!1),e[57]=m,e[58]=N):N=e[58];let J;e[59]!==u?(J=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=J):J=e[60];let Z;e[61]!==h||e[62]!==N||e[63]!==J?(Z=n.jsx(_e,{type:"button",variant:"outline",onClick:N,disabled:h,children:J}),e[61]=h,e[62]=N,e[63]=J,e[64]=Z):Z=e[64];let oe;e[65]!==h||e[66]!==f||e[67]!==x?(oe=!f.trim()||!x.trim()||h,e[65]=h,e[66]=f,e[67]=x,e[68]=oe):oe=e[68];let S;e[69]!==h||e[70]!==o||e[71]!==u?(S=h?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),u(Rl[o])]}):u(Il[o]),e[69]=h,e[70]=o,e[71]=u,e[72]=S):S=e[72];let se;e[73]!==oe||e[74]!==S?(se=n.jsx(_e,{type:"submit",disabled:oe,children:S}),e[73]=oe,e[74]=S,e[75]=se):se=e[75];let H;e[76]!==Z||e[77]!==se?(H=n.jsxs(ht,{children:[Z,se]}),e[76]=Z,e[77]=se,e[78]=H):H=e[78];let ie;e[79]!==K||e[80]!==le||e[81]!==H||e[82]!==I?(ie=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:K,children:[I,le,H]})}),e[79]=K,e[80]=le,e[81]=H,e[82]=I,e[83]=ie):ie=e[83];let ve;return e[84]!==O||e[85]!==s||e[86]!==ie?(ve=n.jsx(ct,{open:s,onOpenChange:O,children:ie}),e[84]=O,e[85]=s,e[86]=ie,e[87]=ve):ve=e[87],ve}const Kl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Ys={from:"",to:"",type:"temporary",discardQueryParameters:!1};function zl(t){const e=ae.c(111),{open:s,isPending:o,error:a,onSubmit:l,onOpenChange:i}=t,c=o===void 0?!1:o,r=Se(),[d,p]=$.useState(Ys),[m,h]=$.useState(null),[u,f]=$.useState(s);s!==u&&(f(s),s&&(p(Ys),h(null)));let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=xe=>p($e=>({...$e,...xe})),e[0]=g):g=e[0];const x=g;let y;e[1]!==c||e[2]!==i?(y=xe=>{!xe&&!c&&(h(null),i(!1))},e[1]=c,e[2]=i,e[3]=y):y=e[3];const v=y;let j;e[4]!==c||e[5]!==l||e[6]!==d||e[7]!==r?(j=async xe=>{xe.preventDefault();const $e=d.from.trim(),Fe=d.to.trim();if(!$e||!Fe||c){h(r("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...d,from:$e,to:Fe})},e[4]=c,e[5]=l,e[6]=d,e[7]=r,e[8]=j):j=e[8];const w=j,C=m??a;let E;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(E=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=E):E=e[12];const B=E;let k;e[13]!==r?(k=r("sandbox.redirectFormDialog.title"),e[13]=r,e[14]=k):k=e[14];let D;e[15]!==k?(D=n.jsx(pt,{children:n.jsx(it,{children:k})}),e[15]=k,e[16]=D):D=e[16];let O;e[17]!==r?(O=r("sandbox.redirectEditor.fromLabel"),e[17]=r,e[18]=O):O=e[18];let L;e[19]!==O?(L=n.jsx(ze,{htmlFor:"redirect-form-from",children:O}),e[19]=O,e[20]=L):L=e[20];const K=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=xe=>x({from:xe.target.value}),e[21]=F):F=e[21];let _;e[22]!==r?(_=r("sandbox.redirectEditor.fromPlaceholder"),e[22]=r,e[23]=_):_=e[23];let A;e[24]!==c||e[25]!==d.from||e[26]!==_?(A=n.jsx(Xe,{id:"redirect-form-from",value:K,onChange:F,placeholder:_,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=_,e[27]=A):A=e[27];let I;e[28]!==A||e[29]!==L?(I=n.jsxs("div",{className:"space-y-1.5",children:[L,A]}),e[28]=A,e[29]=L,e[30]=I):I=e[30];let R;e[31]!==r?(R=r("sandbox.redirectEditor.toLabel"),e[31]=r,e[32]=R):R=e[32];let G;e[33]!==R?(G=n.jsx(ze,{htmlFor:"redirect-form-to",children:R}),e[33]=R,e[34]=G):G=e[34];const z=d.to;let W;e[35]===Symbol.for("react.memo_cache_sentinel")?(W=xe=>x({to:xe.target.value}),e[35]=W):W=e[35];let T;e[36]!==r?(T=r("sandbox.redirectEditor.toPlaceholder"),e[36]=r,e[37]=T):T=e[37];let U;e[38]!==c||e[39]!==d.to||e[40]!==T?(U=n.jsx(Xe,{id:"redirect-form-to",value:z,onChange:W,placeholder:T,disabled:c}),e[38]=c,e[39]=d.to,e[40]=T,e[41]=U):U=e[41];let Y;e[42]!==G||e[43]!==U?(Y=n.jsxs("div",{className:"space-y-1.5",children:[G,U]}),e[42]=G,e[43]=U,e[44]=Y):Y=e[44];let q;e[45]!==r?(q=r("sandbox.redirectEditor.typeLabel"),e[45]=r,e[46]=q):q=e[46];let X;e[47]!==q?(X=n.jsx(ze,{htmlFor:"redirect-form-type",children:q}),e[47]=q,e[48]=X):X=e[48];const de=d.type;let ne;e[49]===Symbol.for("react.memo_cache_sentinel")?(ne=xe=>x({type:xe}),e[49]=ne):ne=e[49];let ue;e[50]!==r?(ue=r("sandbox.redirectEditor.typePlaceholder"),e[50]=r,e[51]=ue):ue=e[51];let te;e[52]!==ue?(te=n.jsx(Xa,{id:"redirect-form-type",className:"w-full",children:n.jsx(Za,{placeholder:ue})}),e[52]=ue,e[53]=te):te=e[53];let re;e[54]!==r?(re=Kl.map(xe=>n.jsx(Qa,{value:xe.value,children:r(xe.labelKey,{status:zn[xe.value]})},xe.value)),e[54]=r,e[55]=re):re=e[55];let le;e[56]!==re?(le=n.jsx(el,{children:re}),e[56]=re,e[57]=le):le=e[57];let N;e[58]!==c||e[59]!==d.type||e[60]!==te||e[61]!==le?(N=n.jsxs(tl,{value:de,onValueChange:ne,disabled:c,children:[te,le]}),e[58]=c,e[59]=d.type,e[60]=te,e[61]=le,e[62]=N):N=e[62];let J;e[63]!==X||e[64]!==N?(J=n.jsxs("div",{className:"space-y-1.5",children:[X,N]}),e[63]=X,e[64]=N,e[65]=J):J=e[65];let Z;e[66]===Symbol.for("react.memo_cache_sentinel")?(Z=xe=>x({discardQueryParameters:xe===!0}),e[66]=Z):Z=e[66];let oe;e[67]!==c||e[68]!==d.discardQueryParameters?(oe=n.jsx(Xt,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:Z}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=oe):oe=e[69];let S;e[70]!==r?(S=r("sandbox.redirectEditor.discardQueryParameters"),e[70]=r,e[71]=S):S=e[71];let se;e[72]!==S?(se=n.jsx("span",{className:"text-sm",children:S}),e[72]=S,e[73]=se):se=e[73];let H;e[74]!==oe||e[75]!==se?(H=n.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[oe,se]}),e[74]=oe,e[75]=se,e[76]=H):H=e[76];let ie;e[77]!==C?(ie=C&&n.jsx("p",{className:"text-xs text-destructive",children:C}),e[77]=C,e[78]=ie):ie=e[78];let ve;e[79]!==I||e[80]!==Y||e[81]!==J||e[82]!==H||e[83]!==ie?(ve=n.jsxs("div",{className:"space-y-4 py-4",children:[I,Y,J,H,ie]}),e[79]=I,e[80]=Y,e[81]=J,e[82]=H,e[83]=ie,e[84]=ve):ve=e[84];let pe;e[85]!==i?(pe=()=>i(!1),e[85]=i,e[86]=pe):pe=e[86];let ke;e[87]!==r?(ke=r("sandbox.redirectFormDialog.cancel"),e[87]=r,e[88]=ke):ke=e[88];let he;e[89]!==c||e[90]!==pe||e[91]!==ke?(he=n.jsx(_e,{type:"button",variant:"outline",onClick:pe,disabled:c,children:ke}),e[89]=c,e[90]=pe,e[91]=ke,e[92]=he):he=e[92];const we=!B;let Pe;e[93]!==c||e[94]!==r?(Pe=c?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),r("sandbox.redirectFormDialog.pending")]}):r("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=r,e[95]=Pe):Pe=e[95];let Te;e[96]!==we||e[97]!==Pe?(Te=n.jsx(_e,{type:"submit",disabled:we,children:Pe}),e[96]=we,e[97]=Pe,e[98]=Te):Te=e[98];let Ne;e[99]!==he||e[100]!==Te?(Ne=n.jsxs(ht,{children:[he,Te]}),e[99]=he,e[100]=Te,e[101]=Ne):Ne=e[101];let Be;e[102]!==w||e[103]!==ve||e[104]!==Ne||e[105]!==D?(Be=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:w,children:[D,ve,Ne]})}),e[102]=w,e[103]=ve,e[104]=Ne,e[105]=D,e[106]=Be):Be=e[106];let De;return e[107]!==v||e[108]!==s||e[109]!==Be?(De=n.jsx(ct,{open:s,onOpenChange:v,children:Be}),e[107]=v,e[108]=s,e[109]=Be,e[110]=De):De=e[110],De}function Ml(t){const e=ae.c(70),{open:s,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:c}=t,r=l===void 0?!1:l,d=Se(),[p,m]=$.useState(a),[h,u]=$.useState(s);s!==h&&(u(s),s&&m(a));let f;e[0]!==r||e[1]!==c?(f=de=>{!de&&!r&&c(!1)},e[0]=r,e[1]=c,e[2]=f):f=e[2];const g=f;let x;e[3]!==r||e[4]!==p||e[5]!==i?(x=async de=>{de.preventDefault();const ne=p.trim();!ne||r||await i(ne)},e[3]=r,e[4]=p,e[5]=i,e[6]=x):x=e[6];const y=x;let v;e[7]!==d?(v=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=v):v=e[8];let j;e[9]!==v?(j=n.jsx(it,{children:v}),e[9]=v,e[10]=j):j=e[10];let w;e[11]!==d?(w=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=w):w=e[12];let C;e[13]!==w?(C=n.jsx(zt,{children:w}),e[13]=w,e[14]=C):C=e[14];let E;e[15]!==j||e[16]!==C?(E=n.jsxs(pt,{children:[j,C]}),e[15]=j,e[16]=C,e[17]=E):E=e[17];let B;e[18]!==d?(B=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=B):B=e[19];let k;e[20]!==B?(k=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:B}),e[20]=B,e[21]=k):k=e[21];let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=de=>m(de.target.value),e[22]=D):D=e[22];let O;e[23]!==r||e[24]!==p?(O=n.jsx(Xe,{id:"section-rename-name",value:p,onChange:D,autoFocus:!0,disabled:r}),e[23]=r,e[24]=p,e[25]=O):O=e[25];let L;e[26]!==k||e[27]!==O?(L=n.jsxs("div",{className:"space-y-1.5",children:[k,O]}),e[26]=k,e[27]=O,e[28]=L):L=e[28];let K;e[29]!==d?(K=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=K):K=e[30];let F;e[31]!==K?(F=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:K}),e[31]=K,e[32]=F):F=e[32];let _;e[33]!==o?(_=n.jsx(Xe,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=_):_=e[34];let A;e[35]!==F||e[36]!==_?(A=n.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[35]=F,e[36]=_,e[37]=A):A=e[37];let I;e[38]!==L||e[39]!==A?(I=n.jsxs("div",{className:"space-y-4 py-4",children:[L,A]}),e[38]=L,e[39]=A,e[40]=I):I=e[40];let R;e[41]!==c?(R=()=>c(!1),e[41]=c,e[42]=R):R=e[42];let G;e[43]!==d?(G=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=G):G=e[44];let z;e[45]!==r||e[46]!==R||e[47]!==G?(z=n.jsx(_e,{type:"button",variant:"outline",onClick:R,disabled:r,children:G}),e[45]=r,e[46]=R,e[47]=G,e[48]=z):z=e[48];let W;e[49]!==r||e[50]!==p?(W=!p.trim()||r,e[49]=r,e[50]=p,e[51]=W):W=e[51];let T;e[52]!==r||e[53]!==d?(T=r?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=r,e[53]=d,e[54]=T):T=e[54];let U;e[55]!==W||e[56]!==T?(U=n.jsx(_e,{type:"submit",disabled:W,children:T}),e[55]=W,e[56]=T,e[57]=U):U=e[57];let Y;e[58]!==z||e[59]!==U?(Y=n.jsxs(ht,{children:[z,U]}),e[58]=z,e[59]=U,e[60]=Y):Y=e[60];let q;e[61]!==y||e[62]!==I||e[63]!==Y||e[64]!==E?(q=n.jsx(rt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:y,children:[E,I,Y]})}),e[61]=y,e[62]=I,e[63]=Y,e[64]=E,e[65]=q):q=e[65];let X;return e[66]!==g||e[67]!==s||e[68]!==q?(X=n.jsx(ct,{open:s,onOpenChange:g,children:q}),e[66]=g,e[67]=s,e[68]=q,e[69]=X):X=e[69],X}function Vl(t){const e=ae.c(7),{type:s}=t,o=zn[s];let a;e[0]!==o?(a=n.jsx(We,{asChild:!0,children:n.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=a):a=e[1];const l=s==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=n.jsx(Ye,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=n.jsxs(Qe,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c}const Gl=60,ps={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},Es=["posts","authors","categories"],Nt={posts:"post",authors:"author",categories:"category"};function ot(t){return Es.includes(t)}const es={posts:"post",authors:"author",categories:"category"},Qn={posts:ps.post,authors:ps.author,categories:ps.category},Ul=Object.fromEntries(Object.entries(Qn).map(([t,e])=>[e,t]));function Hl(t){return typeof t=="string"?Ul[t]??null:null}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ee(t){return typeof t=="string"?t:""}function ql(t,e){switch(t){case"posts":return{label:ee(e.title)||"Untitled post",subtitle:ee(e.slug)};case"authors":return{label:ee(e.name)||"Unnamed author",subtitle:ee(e.email)};case"categories":return{label:ee(e.name)||"Unnamed category",subtitle:ee(e.slug)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function Xn(t){const e={posts:[],authors:[],categories:[]};for(const[s,o]of Object.entries(t)){const a=Ie(o);if(!a)continue;const l=Hl(a.__resolveType);if(!l)continue;const i=Ie(a[es[l]])??{},{label:c,subtitle:r}=ql(l,i);e[l].push({key:s,kind:l,label:c,subtitle:r})}for(const s of Es)e[s].sort((o,a)=>o.label.localeCompare(a.label));return e}function Jl(t,e){return Xn(t)[e]}function Ge(t,e){return Jl(t,e).map(s=>({key:s.key,payload:dt(Ie(t[s.key])??void 0,e)}))}const Qs=Object.freeze({});function dt(t,e){return t?Ie(t[es[e]])??Qs:Qs}function at(t,e,s){return{name:t,__resolveType:Qn[e],[es[e]]:s}}function cd({records:t,selected:e,valueField:s,toRef:o}){const a=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:ee(Ie(h)?.[s]),i=h=>typeof h=="string"?h:ee(Ie(h)?.name),c=h=>{const u=l(h),f=u?t.find(({payload:x})=>ee(x[s])===u):void 0;if(f)return f;const g=i(h);return g?t.find(({payload:x})=>ee(x.name)===g):void 0},r=t.map(({key:h,payload:u})=>({value:h,label:ee(u.name)||ee(u[s])||h})),d=new Map,p=[];return a.forEach((h,u)=>{const f=c(h);if(f){p.includes(f.key)||p.push(f.key);return}const g=`unresolved:${u}`;d.set(g,h),p.push(g),r.push({value:g,label:i(h)||l(h)||"Unknown"})}),{options:r,selectedValues:p,refsForValues:h=>h.map(u=>{const f=t.find(g=>g.key===u);return f?o(f.payload):d.get(u)}).filter(u=>u!==void 0)}}function Ze(t){return Array.isArray(t)?t:[]}function st(t){if(typeof t=="string")return t;const e=Ie(t);return e?ee(e.slug):""}function Zn(t){if(typeof t=="string")return t;const e=Ie(t);return e?ee(e.email):""}function _s(t){const e=[];return ee(t.title).trim()||e.push("Title"),ee(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(st).filter(Boolean).length===0&&e.push("Category"),ee(t.excerpt).trim()||e.push("Excerpt"),ee(t.image).trim()||e.push("Cover image"),e}const Ds=["draft","generating","awaiting_review","scheduled","published","archived"],eo=8;function Et(t){switch(ee(t.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function Wl(t,e){return e!=="published"&&e!=="scheduled"||Et(t)===e?!1:_s(t).length>0}function Yl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,eo).toISOString()}function Mt(t,e,s){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=ee(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?Yl(s):o}}function to(t){return Ge(t,"posts").map(({key:e,payload:s})=>({key:e,title:ee(s.title)||"Untitled post",slug:ee(s.slug),date:ee(s.date),scheduledDatetime:ee(s.scheduledDatetime),categorySlugs:Ze(s.categories).map(st).filter(Boolean),authorEmails:Ze(s.authors).map(Zn).filter(Boolean),missing:_s(s),status:Et(s),form:"live"}))}const so="blog-manager/posts/";function no(t){return t.startsWith(so)}function Ct(t){return t.split("/").pop()??t}function Vt(t){return`${so}${t}`}function Ql(t){return`collections/blog/posts/${t}`}function bs(){return xt(12)}function Xl(t){const e=Ie(t.planning)??{},s=Ie(e.format);return{ideaKey:ee(e.ideaKey)||void 0,pillarKey:ee(e.pillarKey)||void 0,pillarTitle:ee(e.pillarTitle)||void 0,format:s?{name:ee(s.name),value:ee(s.value)}:void 0,brief:ee(e.brief)||void 0}}function oo(t){return{title:t.title,slug:"",excerpt:"",date:t.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:t.planning??{}}}function ut(t,e){return{name:t,[es.posts]:e}}function dd(t,e){return no(t)?ut(t,e):at(t,"posts",e)}function Zl(t){const e=[];for(const[s,o]of Object.entries(t)){if(!no(s))continue;const a=Ie(o);a&&e.push({key:s,payload:dt(a,"posts")})}return e}function ei(t){return[...Zl(t).map(({key:s,payload:o})=>({key:s,title:ee(o.title)||"Untitled post",slug:ee(o.slug),date:ee(o.date),scheduledDatetime:ee(o.scheduledDatetime),categorySlugs:Ze(o.categories).map(st).filter(Boolean),authorEmails:Ze(o.authors).map(Zn).filter(Boolean),missing:_s(o),status:Et(o),form:"planning"})),...to(t)]}function ti(t,e,s){const o=Mt(t.payload,e,s),a=Ct(t.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?Ql(a):Vt(a),c=l==="live"?at(i,"posts",o):ut(i,o);return{writes:{[i]:c},deletes:i===t.key?[]:[t.key]}}function ud(t,e,s){const o=Ze(t.categories);if(!o.some(c=>st(c)===e))return t;const a=o.map(c=>{const r=st(c);return r===e||r===s.slug?{name:s.name,slug:s.slug}:c}),l=new Set,i=a.filter(c=>{const r=st(c);return r?l.has(r)?!1:(l.add(r),!0):!0});return{...t,categories:i}}function si(t,e){const s=Ze(t.categories);return s.some(o=>st(o)===e)?{...t,categories:s.filter(o=>st(o)!==e)}:t}function ni(t){const e=ee(t.status),s=e==="idea"||e==="in_review"?{status:Et(t)}:{};return{...t,...s,dateModified:new Date().toISOString()}}function xt(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,s=>s.toString(16).padStart(2,"0")).join("").slice(0,t)}function hs(t,e){const s=`collections/blog/${e}/${xt(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function ao(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${xt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${xt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const oi={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},Xs="Box";function ai(t){return t.startsWith("site/")?"site":"app"}function li(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function vt(...t){for(const e of t)if(e!==void 0)return e}function Zs(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function ii(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():t}function lo(t){const e=new Set,s=[],o=t.manifest?.blocks??{};for(const a of Object.values(o))for(const l of Object.keys(a)){if(!ci(l)||e.has(l))continue;e.add(l);const i=Cs(l,t),c=ts(l),r=oi[c],d=ai(l),p=Zs(i.title),m=Zs(i.description),h=(d==="site"?vt(p,r?.title):vt(r?.title,p))??ii(c),u=d==="site"?vt(m,r?.description):vt(r?.description,m),f=d==="site"?i.icon:void 0,g=f&&li(f)?f:void 0,x=g!==void 0?r?.iconName??Xs:vt(f,r?.iconName)??Xs;s.push({resolveType:l,title:h,description:u,iconName:x,iconUrl:g,source:d})}return s.sort((a,l)=>a.title.localeCompare(l.title))}function ts(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const ri=["blog/sections/blocks/","site/sections/Blog/Post/"];function ci(t){return ri.some(e=>t.startsWith(e))}const As="blog-manager-brand";function Ke(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){s.trim()&&e.push({name:s,value:""});continue}const o=Ie(s);o&&e.push({name:ee(o.name),value:ee(o.value)})}return e}function Me(t){return t.filter(e=>e.name.trim()||e.value.trim())}const di=6e4,ui=4e3;function mi(t){const e=[],s=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(s.has(i))return;s.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,c]of Object.entries(a))i!=="__resolveType"&&o(c,i)};return o(t,"block"),e.join(`
3
3
  `)}function md(t,e){const s=new Map,o=d=>{const p=s.get(d);if(p!==void 0)return p;const m=mi(t[d]).slice(0,ui);return s.set(d,m),m},a=(d,p)=>o(p).length-o(d).length,l=[...Ge(t,"posts").map(d=>d.key).sort(a),...Ge(t,"categories").map(d=>d.key),...[...e].sort(a)],i=[],c=new Set;let r=di;for(const d of l){if(i.length>=Gl)break;if(c.has(d)||!t[d])continue;c.add(d);const p=o(d);if(p.length>r)break;i.push({key:d,content:p}),r-=p.length}return i}const io="blog-manager/themes/";function fi(){return`${io}${crypto.randomUUID()}`}function pi(t,e){return{name:t,title:e.title,body:e.body,pillarKey:e.pillarKey??"",createdAt:e.createdAt}}function ro(t){const e=[];for(const[s,o]of Object.entries(t)){if(!s.startsWith(io))continue;const a=Ie(o);a&&e.push({key:s,title:ee(a.title),body:ee(a.body),pillarKey:ee(a.pillarKey)||void 0,createdAt:ee(a.createdAt)})}return e.sort((s,o)=>o.createdAt.localeCompare(s.createdAt)||s.title.localeCompare(o.title))}const co="blog-manager/pillars/";function fd(){return`${co}${crypto.randomUUID()}`}function uo(t){const e=[];for(const[s,o]of Object.entries(t)){if(!s.startsWith(co))continue;const a=Ie(o);a&&e.push({key:s,title:ee(a.title),body:ee(a.body),createdAt:ee(a.createdAt),formats:Ze(a.formats).map(l=>ee(l)).filter(Boolean)})}return e.sort((s,o)=>o.createdAt.localeCompare(s.createdAt)||s.title.localeCompare(o.title))}const mo="blog-manager-formats",hi=40;function pd(t){return Ge(t,"posts").slice(0,hi).map(({key:e,payload:s})=>({key:e,title:ee(s.title),sections:Ze(s.sections).map(o=>ee(Ie(o)?.__resolveType)).filter(Boolean).map(ts)}))}function xi(t){const e=new Map;for(const s of lo(t)){const o=ts(s.resolveType);e.has(o)||e.set(o,{name:o,title:s.title,description:s.description})}return[...e.values()]}function gi(t){const e=new Set;for(const s of t.matchAll(/(?:^|[\s([{>])@([A-Za-z][\w-]*)/g))s[1]&&e.add(s[1]);return[...e]}function hd(t,e){const s=new Set(e);return gi(t).filter(o=>!s.has(o))}const bi=["Heading","Paragraph","BlockImage","List","Cta"];function xd(t){const e=new Set(t);return bi.filter(s=>e.has(s))}function en(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/\s+/g," ").trim()}function yi(t,e){const s=new Set(t.map(en)),o=[];for(const a of e){const l=en(a.title);!l||s.has(l)||(s.add(l),o.push(a))}return o}const vi=["companyName","language","description","tone","targetAudience"];function ji(t){const e=Ie(t)??{},s=[];for(const o of vi)ee(e[o]).trim()||s.push(o);return Me(Ke(e.dos)).length===0&&s.push("dos"),Me(Ke(e.avoid)).length===0&&s.push("avoid"),s}function fo(t){const e={};for(const s of lo(t)){const o=ts(s.resolveType);o in e||(e[o]=s.resolveType)}return e}function ki(t,e){const s=[];for(const o of t){const a=e[o.type];if(a)switch(o.type){case"Heading":s.push({__resolveType:a,text:ee(o.text),level:o.level??"2"});break;case"Paragraph":s.push({__resolveType:a,html:ee(o.html)});break;case"List":s.push({__resolveType:a,items:(o.items??[]).join(`
4
4
  `),style:o.style??"unordered"});break;case"Quote":s.push({__resolveType:a,quote:ee(o.quote)});break;case"Callout":s.push({__resolveType:a,title:ee(o.title),body:ee(o.body),variant:o.variant??"info"});break;case"Cta":s.push({__resolveType:a,text:ee(o.text),href:ee(o.href)});break;case"Divider":s.push({__resolveType:a});break}}return s}function po(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)}function ho(t,e){const s=po(t)||`post-${xt(6)}`,o=new Set(e);if(!o.has(s))return s;for(let a=2;a<100;a++){const l=`${s}-${a}`;if(!o.has(l))return l}return`${s}-${xt(4)}`}function Si({draft:t,resolveTypes:e,categories:s,authors:o,planning:a,takenSlugs:l,now:i}){const c=new Set(t.categorySlugs),r=new Set(t.authorEmails),d={title:t.title,slug:ho(t.title,l),date:i.toISOString().slice(0,10),excerpt:t.excerpt,image:"",alt:"",authors:o.filter(p=>r.has(p.email)),categories:s.filter(p=>c.has(p.slug)),seo:{title:t.seo.title,description:t.seo.description,image:""},sections:ki(t.sections,e),planning:a??{}};return Mt(d,"awaiting_review",i)}const gd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],bd=["January","February","March","April","May","June","July","August","September","October","November","December"],xo=1440*60*1e3;function mt(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function yd(t){return new Date(t.getFullYear(),t.getMonth(),1)}function vd(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Gt(t,e){const s=new Date(t);return s.setDate(s.getDate()+e),s}function ys(t,e){return Math.round((mt(t).getTime()-mt(e).getTime())/xo)}function wi(t){const e=(t.getTime()-mt(t).getTime())/xo;return Math.min(Math.max(e,0),1)}function tn(t,e){return ys(t,e)+wi(t)}function jd(t){const e=Gt(t,-t.getDay()),s=[];for(let o=0;o<6;o++){const a=[];for(let l=0;l<7;l++)a.push(Gt(e,o*7+l));s.push(a)}for(;s.length>0&&s[s.length-1].every(o=>o.getMonth()!==t.getMonth());)s.pop();return s}function kd(t,e){const s=mt(t[0]),o=Gt(s,7),a=s.getTime(),l=o.getTime(),i=[];for(const d of e){const p=mt(d.start),m=mt(d.end);if(m.getTime()<s.getTime()||p.getTime()>=o.getTime())continue;const h=p.getTime()<s.getTime()?s:p,u=m.getTime()>=o.getTime()?Gt(o,-1):m,f=ys(h,s),g=ys(u,h)+1;if(g<=0)continue;const x=Math.max(d.start.getTime(),a),y=Math.min(d.end.getTime(),l),v=tn(new Date(x),s),j=Math.max(tn(new Date(y),s)-v,0);j<=0||i.push({variant:d,startCol:f,span:g,leftUnits:v,widthUnits:j})}i.sort((d,p)=>d.startCol-p.startCol||p.span-d.span||d.variant.blockKey.localeCompare(p.variant.blockKey));const c=[],r=[];for(const d of i){let p=c.findIndex(m=>m<=d.startCol);p===-1&&(p=c.length,c.push(0)),c[p]=d.startCol+d.span,r.push({...d,lane:p})}return r}function Ut(t){const e=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${s}`}const go=/^(\d{4})-(\d{2})-(\d{2})$/;function Ht(t){const e=t.trim();if(!e)return null;const s=go.exec(e);if(s){const a=Number(s[1]),l=Number(s[2])-1,i=Number(s[3]),c=new Date(a,l,i);return c.getMonth()===l&&c.getDate()===i?c:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:mt(o)}function Ni(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),eo);return{...ao("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Ut(t)}}function Ci(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(go.test(e))return Ht(e);const s=new Date(e);return Number.isNaN(s.getTime())?null:s}function Pi(t,e){const s=Ci(t.scheduledDatetime);if(!s)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),a={...t,scheduledDatetime:o.toISOString()};return(typeof t.date=="string"?t.date:"")===Ut(s)&&(a.date=Ut(o)),a}function Ti(t){return Ht(t.scheduledDatetime)??Ht(t.date)}function Sd(t){const e=new Map,s=[];for(const a of t){const l={post:a,scheduled:Ht(a.scheduledDatetime)!==null},i=Ti(a);if(!i){s.push(l);continue}const c=Ut(i),r=e.get(c);r?r.push(l):e.set(c,[l])}const o=(a,l)=>Number(l.scheduled)-Number(a.scheduled)||a.post.title.localeCompare(l.post.title);for(const a of e.values())a.sort(o);return s.sort(o),{byDay:e,undated:s}}const Bi="0.161.0",Ei="0.162.0",sn="7.53.0",_i="@decocms/apps-blog";function nn(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function on(t,e){const s=nn(t),o=nn(e);if(!s||!o)return 0;for(let a=0;a<3;a++){const l=s[a]-o[a];if(l!==0)return l}return 0}const bo=/deco-cx\/apps@v?(\d+\.\d+\.\d+)/;function Di(t){const e=t?.imports;if(!e||typeof e!="object")return null;for(const s of Object.values(e)){if(typeof s!="string")continue;const o=bo.exec(s)?.[1];if(o)return o}return null}function Ai(t){const e=t?.schema?.definitions;if(!e||typeof e!="object")return null;for(const s of Object.values(e)){const o=s?.title;if(typeof o!="string")continue;const a=bo.exec(o)?.[1];if(a)return a}return null}function $i(t){return vs(t?.schema?.definitions,"scheduledDatetime")}function vs(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t))return t.some(o=>vs(o,e));const s=t.properties;return s&&typeof s=="object"&&e in s?!0:Object.values(t).some(o=>vs(o,e))}function Li(t){const e=t;for(const s of[e?.dependencies,e?.devDependencies]){if(!s||typeof s!="object")continue;const o=s[_i];if(typeof o=="string")return o}return null}function Oi(t){const e=/^[\^~]?v?(\d+\.\d+\.\d+)$/.exec(t.trim());return e?e[1]:null}function Ii(t){const e=t?.packageManager,s=typeof e=="string"?e.split("@")[0]?.trim():null;return s==="pnpm"||s==="yarn"||s==="bun"?s:"npm"}function yo(t){return t==="deno"?[Bi,Ei]:[sn,sn]}function an(t,e){const[s,o]=yo(t);return!e||on(e,s)<0?{kind:"outdated",packageManager:t,version:e}:on(e,o)<0?{kind:"publish-only",packageManager:t,version:e}:{kind:"full",version:e}}function Ri(t){const e=Ai(t.meta);if(t.denoJson.kind==="data"||e){const o=t.denoJson.kind==="data"?Di(t.denoJson.data):null;return an("deno",o??e)}if(t.packageJson.kind==="data"){const o=Li(t.packageJson.data);return o===null?{kind:"unsupported-runtime"}:an(Ii(t.packageJson.data),Oi(o))}return $i(t.meta)?{kind:"full",version:null}:t.denoJson.kind==="unavailable"||t.packageJson.kind==="unavailable"?{kind:"unknown"}:{kind:"unsupported-runtime"}}function Fi(t){return t==="deno"?"deno task update":`npx npm-check-updates -u "@decocms/*" && ${t} install`}function Ki(t){return t.kind==="publish-only"||t.kind==="full"}function wd(t){return t.kind==="full"}function vo(t,e){if(t.kind==="full"||e!=="scheduled"&&e!=="published"||e==="published"&&Ki(t))return null;if(t.kind==="unknown")return{reason:"unknown"};if(t.kind==="unsupported-runtime")return{reason:"no-app"};const[s,o]=yo(t.packageManager);return{reason:"outdated",required:e==="scheduled"?o:s,version:t.version,command:Fi(t.packageManager)}}const ln={kind:"unavailable"};function zi(t){const e=ae.c(26),s=On(t.virtualMcpId),o=Bt()?.taskId??null;let a;e[0]!==s||e[1]!==t||e[2]!==o?(a=y=>({queryFn:()=>ia({...t,threadId:o},gs(s,y)),staleTime:3e5}),e[0]=s,e[1]=t,e[2]=o,e[3]=a):a=e[3];const l=a;let i;e[4]!==t.branch||e[5]!==t.orgSlug||e[6]!==t.virtualMcpId?(i=Pt.denoJson(t.orgSlug,t.virtualMcpId,t.branch),e[4]=t.branch,e[5]=t.orgSlug,e[6]=t.virtualMcpId,e[7]=i):i=e[7];let c;e[8]!==l?(c=l("deno.json"),e[8]=l,e[9]=c):c=e[9];let r;e[10]!==i||e[11]!==c?(r={queryKey:i,...c},e[10]=i,e[11]=c,e[12]=r):r=e[12];const{data:d}=xs(r);let p;e[13]!==t.branch||e[14]!==t.orgSlug||e[15]!==t.virtualMcpId?(p=Pt.packageJson(t.orgSlug,t.virtualMcpId,t.branch),e[13]=t.branch,e[14]=t.orgSlug,e[15]=t.virtualMcpId,e[16]=p):p=e[16];let m;e[17]!==l?(m=l("package.json"),e[17]=l,e[18]=m):m=e[18];let h;e[19]!==p||e[20]!==m?(h={queryKey:p,...m},e[19]=p,e[20]=m,e[21]=h):h=e[21];const{data:u}=xs(h),f=d??ln,g=u??ln;let x;return e[22]!==t.meta||e[23]!==f||e[24]!==g?(x=Ri({denoJson:f,packageJson:g,meta:t.meta}),e[22]=t.meta,e[23]=f,e[24]=g,e[25]=x):x=e[25],x}function Mi(t){const e=ae.c(37),{orgSlug:s,virtualMcpId:o,branch:a}=t,l=Po(),i=Bt()?.taskId??null,c=On(o),r=Gn(o).runtime==="cms";let d;e[0]!==a||e[1]!==s||e[2]!==o?(d=Pt.decofile(`${s}/${o}/${a}`),e[0]=a,e[1]=s,e[2]=o,e[3]=d):d=e[3];const p=d;let m;e[4]!==a||e[5]!==s||e[6]!==o?(m=Aa(s,o,a),e[4]=a,e[5]=s,e[6]=o,e[7]=m):m=e[7];let h;e[8]!==a||e[9]!==s||e[10]!==o?(h=Da(s,o,a),e[8]=a,e[9]=s,e[10]=o,e[11]=h):h=e[11];let u;e[12]!==a||e[13]!==r||e[14]!==s||e[15]!==c||e[16]!==l||e[17]!==i||e[18]!==o?(u=async w=>{const{writes:C,deletes:E}=w,B=ra(C);if(r){const D=await $a({orgSlug:s,virtualMcpId:o,branch:a},{set:B,delete:E});return La(l,{orgSlug:s,virtualMcpId:o,branch:a},D),await l.invalidateQueries({queryKey:sl({orgSlug:s,virtualMcpId:o,branch:a,threadId:i})}),D}const k=`/api/${s}/sandbox/${encodeURIComponent(o)}/${encodeURIComponent(a)}`;for(const[D,O]of Object.entries(B)){const L=await fetch(`${k}/write`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:gs(c,Hs(D)),content:JSON.stringify(O,null,2)})});if(!L.ok)return Vs(L,"Write")}for(const D of E){const O=await fetch(`${k}/unlink`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:gs(c,Hs(D))})});if(!O.ok)return Vs(O,"Delete")}return{ok:!0}},e[12]=a,e[13]=r,e[14]=s,e[15]=c,e[16]=l,e[17]=i,e[18]=o,e[19]=u):u=e[19];let f;e[20]!==a||e[21]!==s||e[22]!==l||e[23]!==o?(f=()=>{l.invalidateQueries({queryKey:Pt.liveMeta(s,o,a)})},e[20]=a,e[21]=s,e[22]=l,e[23]=o,e[24]=f):f=e[24];let g;e[25]!==m||e[26]!==h||e[27]!==u||e[28]!==f?(g={mutationKey:m,scope:h,mutationFn:u,onSuccess:f},e[25]=m,e[26]=h,e[27]=u,e[28]=f,e[29]=g):g=e[29];const x=To(g);let y;e[30]!==x||e[31]!==l||e[32]!==p?(y=async w=>{const C=[...Object.keys(w.writes),...w.deletes],E=l.getQueryData(p),B=new Map;for(const k of C)E&&k in E&&B.set(k,E[k]);l.setQueryData(p,k=>Vi(k,w)),l.cancelQueries({queryKey:p});try{return await x.mutateAsync(w)}catch(k){const D=k;throw l.setQueryData(p,O=>{if(!O)return O;const L={...O};for(const K of C)B.has(K)?L[K]=B.get(K):delete L[K];return L}),D}},e[30]=x,e[31]=l,e[32]=p,e[33]=y):y=e[33];const v=y;let j;return e[34]!==v||e[35]!==x.isPending?(j={move:v,isPending:x.isPending},e[34]=v,e[35]=x.isPending,e[36]=j):j=e[36],j}function Vi(t,{writes:e,deletes:s}){const o={...t??{},...e};for(const a of s)a in e||delete o[a];return o}const qt={draft:"sandbox.postBoard.laneDraft",generating:"sandbox.postBoard.laneGenerating",awaiting_review:"sandbox.postBoard.laneAwaitingReview",scheduled:"sandbox.postBoard.laneScheduled",published:"sandbox.postBoard.lanePublished",archived:"sandbox.postBoard.laneArchived"};function jo(t,e){switch(e.reason){case"unknown":return t("sandbox.postBoard.moveUnknownApp");case"no-app":return t("sandbox.postBoard.moveNoBlogApp");case"outdated":return t("sandbox.postBoard.moveUnsupported",{required:e.required,command:e.command})}}function Gi({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,support:a,onMoved:l}){const i=Se(),c=Mi({orgSlug:t,virtualMcpId:e,branch:s}),[r,d]=$.useState(new Set),p=f=>dt(o[f],"posts"),m=(f,g,x=p(f))=>{if(g==="generating")return{kind:"not-a-target"};if(r.has(Ct(f)))return{kind:"in-flight"};const y=vo(a,g);return y?{kind:"unsupported",...y}:Wl(x,g)?{kind:"incomplete"}:null},h=f=>{switch(f.kind){case"unsupported":return jo(i,f);case"incomplete":return i("sandbox.postBoard.moveBlocked");case"in-flight":return i("sandbox.postBoard.moveInFlight");case"not-a-target":return i("sandbox.postBoard.moveNotATarget");default:return String(f)}};return{apply:async(f,g,x)=>{const y=x??p(f);if(Et(y)===g)return null;const v=m(f,g,y);if(v)return v.kind!=="in-flight"&&me.error(h(v)),null;const j=Ct(f);d(E=>new Set(E).add(j));const w=ti({key:f,payload:y},g,new Date),C=Object.keys(w.writes)[0]??f;C!==f&&l?.(f,C);try{return await c.move(w),C}catch(E){return C!==f&&l?.(C,f),me.error(E instanceof Error?E.message:i("sandbox.postBoard.moveFailed")),null}finally{d(E=>{const B=new Set(E);return B.delete(j),B})}},refuse:m,reasonText:h,isMoving:f=>r.has(Ct(f))}}function Ui(t){const e=ae.c(14),{value:s,onChange:o,placeholder:a,className:l,onFocus:i,onBlur:c,onKeyDown:r,spellCheck:d,inputRef:p}=t,m=d===void 0?!0:d;let h;e[0]!==o?(h=g=>o(g.target.value),e[0]=o,e[1]=h):h=e[1];let u;e[2]!==l?(u=be("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",l),e[2]=l,e[3]=u):u=e[3];let f;return e[4]!==p||e[5]!==c||e[6]!==i||e[7]!==r||e[8]!==a||e[9]!==m||e[10]!==h||e[11]!==u||e[12]!==s?(f=n.jsx("textarea",{ref:p,value:s,onChange:h,onInput:Hi,onFocus:i,onBlur:c,onKeyDown:r,placeholder:a,spellCheck:m,rows:1,className:u}),e[4]=p,e[5]=c,e[6]=i,e[7]=r,e[8]=a,e[9]=m,e[10]=h,e[11]=u,e[12]=s,e[13]=f):f=e[13],f}function Hi(t){const e=t.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function ye(t){return typeof t=="string"?t:""}function Nd(t){const e=ae.c(11);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=be(s,"pr-9"),e[3]=s,e[4]=a):a=e[4];let l;e[5]!==o||e[6]!==a?(l=n.jsx(Ui,{...o,className:a}),e[5]=o,e[6]=a,e[7]=l):l=e[7];let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ko,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=i):i=e[8];let c;return e[9]!==l?(c=n.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[l,i]}),e[9]=l,e[10]=c):c=e[10],c}function Cd(t){const e=ae.c(5),{label:s,onClick:o,disabled:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(ws,{size:13}),e[0]=l):l=e[0];let i;return e[1]!==a||e[2]!==s||e[3]!==o?(i=n.jsxs("button",{type:"button",onClick:o,disabled:a,className:"flex items-center gap-1.5 rounded-lg border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[l,s]}),e[1]=a,e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function Pd(t){const e=ae.c(4),{label:s,onClick:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ts,{size:13}),e[0]=a):a=e[0];let l;return e[1]!==s||e[2]!==o?(l=n.jsx("button",{type:"button","aria-label":s,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=o,e[3]=l):l=e[3],l}function Td(t){const e=ae.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:s}),e[0]=s,e[1]=o):o=e[1],o}function Bd(t){const e=ae.c(8),{active:s,label:o,onClick:a,children:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let c;e[0]!==i?(c=be("flex h-7 min-w-7 items-center justify-center px-1.5 text-sm transition-colors cursor-pointer rounded-lg",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==s||e[3]!==l||e[4]!==o||e[5]!==a||e[6]!==c?(r=n.jsx("button",{type:"button","aria-label":o,"aria-pressed":s,onMouseDown:qi,onClick:a,className:c,children:l}),e[2]=s,e[3]=l,e[4]=o,e[5]=a,e[6]=c,e[7]=r):r=e[7],r}function qi(t){return t.preventDefault()}function Ed(t){if(Array.isArray(t))return t;if(typeof t!="string"||t.trim()==="")return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}function kt(t){const e=ae.c(14),{options:s,value:o,emptyLabel:a,onChange:l}=t;let i;e[0]!==a||e[1]!==l||e[2]!==o?(i=a&&n.jsx(rn,{active:!o,onClick:()=>l(""),children:a}),e[0]=a,e[1]=l,e[2]=o,e[3]=i):i=e[3];let c;if(e[4]!==l||e[5]!==s||e[6]!==o){let d;e[8]!==l||e[9]!==o?(d=p=>n.jsx(rn,{active:p===o,onClick:()=>l(p),children:p},p),e[8]=l,e[9]=o,e[10]=d):d=e[10],c=s.filter(Boolean).map(d),e[4]=l,e[5]=s,e[6]=o,e[7]=c}else c=e[7];let r;return e[11]!==i||e[12]!==c?(r=n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i,c]}),e[11]=i,e[12]=c,e[13]=r):r=e[13],r}function rn(t){const e=ae.c(7),{active:s,onClick:o,children:a}=t,l=s?"border-primary bg-primary text-primary-foreground":"bg-card hover:bg-muted";let i;e[0]!==l?(i=be("cursor-pointer rounded-md border px-2.5 py-1 text-xs font-medium transition-colors",l),e[0]=l,e[1]=i):i=e[1];let c;return e[2]!==s||e[3]!==a||e[4]!==o||e[5]!==i?(c=n.jsx("button",{type:"button","aria-pressed":s,onClick:o,className:i,children:a}),e[2]=s,e[3]=a,e[4]=o,e[5]=i,e[6]=c):c=e[6],c}function _d(t,e=[]){return typeof t=="string"?t:JSON.stringify(t??e)}const cn=[{id:"idea",label:"sandbox.generatePost.stepIdea"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],Ji={companyName:"sandbox.blogBrand.companyNameLabel",language:"sandbox.blogBrand.languageLabel",description:"sandbox.blogBrand.descriptionLabel",tone:"sandbox.blogBrand.toneLabel",targetAudience:"sandbox.blogBrand.audienceLabel",dos:"sandbox.blogBrand.tabDos",avoid:"sandbox.blogBrand.tabGuardrails"};function Wi({open:t,onOpenChange:e,decofile:s,hasAi:o,seed:a,onGenerate:l}){const i=Se(),c=js(),[r,d]=$.useState(a?"format":"idea"),[p,m]=$.useState(a?.key??""),[h,u]=$.useState(a?.title??""),[f,g]=$.useState(a?.body??""),[x,y]=$.useState([]),[v,j]=$.useState(""),[w,C]=$.useState(""),[E,B]=$.useState(""),[k,D]=$.useState(""),[O,L]=$.useState(""),[K,F]=$.useState(!1),_=s[As],A=ji(_),I={companyName:ye(_?.companyName),description:ye(_?.description),language:ye(_?.language),tone:ye(_?.tone),targetAudience:ye(_?.targetAudience),values:Me(Ke(_?.values)),dos:Me(Ke(_?.dos)),avoid:Me(Ke(_?.avoid))},R=ro(s),G=R.find(N=>N.key===p),z=uo(s).find(N=>N.key===G?.pillarKey),W=s[mo],T=Me(Ke(W?.formats)),U=Ge(s,"categories").map(({payload:N})=>({name:ye(N.name),slug:ye(N.slug)})).filter(N=>N.slug),Y=Ge(s,"authors").map(({payload:N})=>({name:ye(N.name),email:ye(N.email)})).filter(N=>N.email),q=()=>{d(a?"format":"idea"),m(a?.key??""),u(a?.title??""),g(a?.body??""),y([]),j(""),C(""),B(""),D(""),L("")},X=N=>{e(N),N||q()},de=async()=>{F(!0);try{const N=await c.call("BLOG_THEME_SUGGEST",{brand:I,existingTitles:[],formats:T.map(J=>J.name).filter(Boolean),guidance:z?`Every idea must be one angle inside the pillar "${z.title}": ${z.body}`:void 0,count:4});y(N.themes)}catch(N){me.error(N instanceof Error?N.message:i("sandbox.generatePost.suggestFailed"))}finally{F(!1)}},ne=a?cn.filter(N=>N.id!=="idea"):cn,ue=ne.findIndex(N=>N.id===r),te=r==="idea"?h.trim().length>0:r==="format"?v.trim().length>0&&w.trim().length>0:!0,re=r==="extra",le=()=>{l({idea:{key:p||void 0,title:h.trim(),body:f.trim()},pillar:z?{key:z.key,title:z.title,body:z.body}:void 0,format:{name:v.trim(),value:w.trim()},category:U.find(N=>N.slug===E),author:Y.find(N=>N.email===k),extraInstructions:O.trim()||void 0}),X(!1)};return n.jsx(ct,{open:t,onOpenChange:X,children:n.jsxs(rt,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[n.jsxs(pt,{children:[n.jsx(it,{children:i("sandbox.generatePost.title")}),n.jsx(zt,{children:i("sandbox.generatePost.subtitle")})]}),A.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:i("sandbox.generatePost.blockedBrand",{fields:A.map(N=>i(Ji[N])).join(", ")})}):n.jsxs(n.Fragment,{children:[n.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:ne.map((N,J)=>n.jsx("li",{className:be("rounded-md px-2 py-1",J===ue?"bg-primary text-primary-foreground":J<ue?"text-foreground":"text-muted-foreground"),children:i(N.label)},N.id))}),n.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[r==="idea"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:z?i("sandbox.generatePost.ideaHintInPillar",{pillar:z.title}):i("sandbox.generatePost.ideaHint")}),R.length>0&&n.jsx(kt,{options:R.map(N=>N.title).filter(Boolean),value:G?.title??"",emptyLabel:i("sandbox.generatePost.writeAnIdea"),onChange:N=>{const J=R.find(Z=>Z.title===N);m(J?.key??""),u(J?.title??""),g(J?.body??"")}}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-idea-title",children:i("sandbox.generatePost.ideaTitleLabel")}),n.jsx(Xe,{id:"generate-idea-title",value:h,onChange:N=>{m(""),u(N.target.value)},placeholder:i("sandbox.generatePost.ideaTitlePlaceholder")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-idea-body",children:i("sandbox.generatePost.ideaBodyLabel")}),n.jsx(Ot,{id:"generate-idea-body",value:f,onChange:N=>g(N.target.value),placeholder:i("sandbox.generatePost.ideaBodyPlaceholder"),rows:3})]}),n.jsx(Yi,{label:i("sandbox.generatePost.suggestIdeas"),hint:i("sandbox.generatePost.suggestIdeasHint"),disabled:!o||K,busy:K,onSuggest:de}),n.jsx(Qi,{suggestions:x,onPick:N=>{u(N.title),g(N.body)}})]}),r==="format"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatHint")}),n.jsx(kt,{options:T.map(N=>N.name),value:v,onChange:N=>{j(N),C(T.find(J=>J.name===N)?.value??"")}}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-format-name",children:i("sandbox.generatePost.formatNameLabel")}),n.jsx(Xe,{id:"generate-format-name",value:v,onChange:N=>j(N.target.value),placeholder:i("sandbox.generatePost.formatNamePlaceholder")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-format-value",children:i("sandbox.generatePost.formatValueLabel")}),n.jsx(Ot,{id:"generate-format-value",value:w,onChange:N=>C(N.target.value),placeholder:i("sandbox.generatePost.formatValuePlaceholder"),rows:4})]})]}),r==="extra"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-category",children:i("sandbox.generatePost.categoryLabel")}),n.jsx(kt,{options:U.map(N=>N.name),value:U.find(N=>N.slug===E)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:N=>B(U.find(J=>J.name===N)?.slug??"")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-author",children:i("sandbox.generatePost.authorLabel")}),n.jsx(kt,{options:Y.map(N=>N.name),value:Y.find(N=>N.email===k)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:N=>D(Y.find(J=>J.name===N)?.email??"")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(ze,{htmlFor:"generate-extra",children:i("sandbox.generatePost.extraLabel")}),n.jsx(Ot,{id:"generate-extra",value:O,onChange:N=>L(N.target.value),placeholder:i("sandbox.generatePost.extraPlaceholder"),rows:3})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.inferHint")})]})]}),n.jsxs(ht,{className:"shrink-0 sm:justify-between",children:[n.jsx(_e,{type:"button",variant:"outline",disabled:ue===0,onClick:()=>d(ne[ue-1].id),children:i("sandbox.generatePost.back")}),re?n.jsxs(_e,{type:"button",disabled:!o,onClick:le,children:[n.jsx(et,{size:14}),i("sandbox.generatePost.generate")]}):n.jsx(_e,{type:"button",disabled:!te,onClick:()=>d(ne[ue+1].id),children:i("sandbox.generatePost.next")})]})]})]})})}function Yi(t){const e=ae.c(12),{label:s,hint:o,disabled:a,busy:l,onSuggest:i}=t;let c;e[0]!==o?(c=n.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==l?(r=l?n.jsx(wt,{size:14,className:"animate-spin"}):n.jsx(et,{size:14}),e[2]=l,e[3]=r):r=e[3];let d;e[4]!==a||e[5]!==s||e[6]!==i||e[7]!==r?(d=n.jsxs(_e,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:i,children:[r,s]}),e[4]=a,e[5]=s,e[6]=i,e[7]=r,e[8]=d):d=e[8];let p;return e[9]!==c||e[10]!==d?(p=n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t pt-3",children:[c,d]}),e[9]=c,e[10]=d,e[11]=p):p=e[11],p}function Qi(t){const e=ae.c(7),{suggestions:s,onPick:o}=t;if(s.length===0)return null;let a;if(e[0]!==o||e[1]!==s){let i;e[3]!==o?(i=c=>n.jsx("li",{children:n.jsxs("button",{type:"button",onClick:()=>o(c),className:"w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",children:[n.jsx("p",{className:"text-sm font-medium",children:c.title}),n.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:c.body})]})},c.title),e[3]=o,e[4]=i):i=e[4],a=s.map(i),e[0]=o,e[1]=s,e[2]=a}else a=e[2];let l;return e[5]!==a?(l=n.jsx("ul",{className:"space-y-1.5",children:a}),e[5]=a,e[6]=l):l=e[6],l}const Xi=["Heading","Paragraph","List","Quote","Callout","Cta","Divider"];function Zi(t){return Xi.includes(t)}function er({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,meta:a,onStarted:l}){const i=Se(),c=js(),r=Qt({orgSlug:t,virtualMcpId:e,branch:s});return async d=>{const p=Vt(bs()),m={ideaKey:d.idea.key,pillarKey:d.pillar?.key,pillarTitle:d.pillar?.title,format:d.format,brief:d.idea.body},h=Mt(oo({title:d.idea.title,planning:m,now:new Date}),"generating",new Date);await r.mutateAsync({blockKey:p,data:ut(p,h)}),l?.(p);const u=o[As],f=d.category?[d.category]:Ge(o,"categories").map(({payload:x})=>({name:ye(x.name),slug:ye(x.slug)})).filter(x=>x.slug),g=d.author?[d.author]:Ge(o,"authors").map(({payload:x})=>({name:ye(x.name),email:ye(x.email)})).filter(x=>x.email);try{const x=await c.call("BLOG_POST_DRAFT",{brand:{companyName:ye(u?.companyName),description:ye(u?.description),language:ye(u?.language),tone:ye(u?.tone),targetAudience:ye(u?.targetAudience),values:Me(Ke(u?.values)),dos:Me(Ke(u?.dos)),avoid:Me(Ke(u?.avoid))},pillar:d.pillar?{title:d.pillar.title,body:d.pillar.body}:void 0,theme:{title:d.idea.title,body:d.idea.body},format:d.format,sections:xi(a).filter(v=>Zi(v.name)).map(v=>({type:v.name,purpose:v.description})),categories:f,authors:g,extraInstructions:d.extraInstructions?.trim()||void 0}),y=Si({draft:x,resolveTypes:fo(a),categories:f,authors:g,planning:m,takenSlugs:to(o).map(v=>v.slug),now:new Date});await r.mutateAsync({blockKey:p,data:ut(p,y)}),me.success(i("sandbox.generatePost.done",{title:x.title}))}catch(x){await r.mutateAsync({blockKey:p,data:ut(p,Mt(h,"draft",new Date))}),me.error(x instanceof Error?x.message:i("sandbox.generatePost.failed"))}}}const tr=/<(h[1-6]|p|ul|ol|div|img|br|blockquote|section|article|figure)\b|<\/[a-z]/i;function ko(t){return tr.test(t)}function sr(t){const e=t.trim();return e?ko(e)?dr(e):mr(e):{title:"",sections:[]}}function $s(t){return t.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#0?39;|&apos;/gi,"'").replace(/&amp;/gi,"&")}function jt(t){let e=t,s;do s=e,e=e.replace(/<[^>]+>/g,"");while(e!==s);return $s(e).replace(/\s+/g," ").trim()}function nr(t){let e=t,s;do s=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==s);return e}function or(t){let e=t,s;do s=e,e=e.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/gi,"");while(e!==s);return e}function So(t){let e=t,s;do s=e,e=or(nr(e));while(e!==s);return e}const ar=/^(a|b|strong|i|em|u|s|code|br|span|sub|sup)$/;function Jt(t){let e="";for(const s of t)s.charCodeAt(0)>31&&(e+=s);return e=e.trim(),!/^[a-z][a-z0-9+.-]*:/i.test(e)||/^(https?|mailto|tel):/i.test(e)}function lr(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const ir=/^<\/?([a-z][a-z0-9]*)\b([^>]*)>/i;function rr(t,e,s){const o=e.toLowerCase();if(!ar.test(o))return"";if(t.startsWith("</"))return`</${o}>`;if(o!=="a")return`<${o}>`;const a=$s(s.match(/href\s*=\s*"([^"]*)"/i)?.[1]??"");return Jt(a)&&a?`<a href="${lr(a)}">`:"<a>"}function wo(t){const e=So(t);let s="",o=0;for(;o<e.length;){const a=e.indexOf("<",o);if(a===-1){s+=e.slice(o);break}s+=e.slice(o,a);const l=ir.exec(e.slice(a));if(!l){s+="&lt;",o=a+1;continue}s+=rr(l[0],l[1]??"",l[2]??""),o=a+l[0].length}return s}function Dt(t,e){const s=t.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));return s?.[1]?$s(s[1]):""}const cr=/<(h[1-6]|p|ul|ol|blockquote|figure)\b[^>]*>([\s\S]*?)<\/\1\s*>|<hr\b[^>]*\/?>|<img\b[^>]*>/gi;function dr(t){const e=So(t);let s="";const o=[];for(const a of e.matchAll(cr)){const l=a[1]?.toLowerCase(),i=a[2]??"",c=a[0];if(!l){if(/^<img/i.test(c)){const r=Dt(c,"src");r&&Jt(r)&&o.push({kind:"image",url:r,alt:Dt(c,"alt"),caption:""})}else o.push({kind:"divider"});continue}if(/^h[1-6]$/.test(l)){const r=jt(i);if(!r)continue;if(l==="h1"&&!s){s=r;continue}o.push({kind:"heading",text:r,level:l.slice(1)})}else if(l==="p"){const r=wo(i.trim());jt(r)&&o.push({kind:"paragraph",html:r})}else if(l==="ul"||l==="ol"){const r=[...i.matchAll(/<li\b[^>]*>([\s\S]*?)<\/li\s*>/gi)].map(d=>jt(d[1]??"")).filter(Boolean);r.length&&o.push({kind:"list",items:r,ordered:l==="ol"})}else if(l==="blockquote"){const r=jt(i);r&&o.push({kind:"quote",text:r})}else if(l==="figure"){const r=i.match(/<img\b[^>]*>/i)?.[0],d=r?Dt(r,"src"):"",p=jt(i.match(/<figcaption\b[^>]*>([\s\S]*?)<\/figcaption\s*>/i)?.[1]??"");d&&Jt(d)&&o.push({kind:"image",url:d,alt:r?Dt(r,"alt"):"",caption:p})}}return{title:s,sections:o}}function ur(t){return t.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,'<a href="$2">$1</a>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^*])\*([^*]+)\*/g,"$1<em>$2</em>").replace(/`([^`]+)`/g,"<code>$1</code>")}function mr(t){const e=t.replace(/\r\n?/g,`
5
5
  `).split(`
6
6
  `);let s="";const o=[];let a=[],l=null,i=[];const c=()=>{a.length&&(o.push({kind:"paragraph",html:wo(ur(a.join(" ")))}),a=[])},r=()=>{l&&(o.push({kind:"list",items:l.items,ordered:l.ordered}),l=null)},d=()=>{i.length&&(o.push({kind:"quote",text:i.join(" ")}),i=[])},p=()=>{c(),r(),d()};for(const m of e){const h=m.trimEnd(),u=h.match(/^(#{1,6})\s+(.*)$/),f=h.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/),g=h.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/),x=/^\s*\d+\./.test(h),y=h.match(/^>\s?(.*)$/);if(!h.trim())p();else if(u){p();const v=u[2]?.trim()??"",j=String(u[1]?.length??1);j==="1"&&!s?s=v:v&&o.push({kind:"heading",text:v,level:j})}else if(/^(-{3,}|\*{3,}|_{3,})$/.test(h.trim()))p(),o.push({kind:"divider"});else if(f){p();const v=f[2]??"";Jt(v)&&o.push({kind:"image",url:v,alt:f[1]??"",caption:""})}else g?(c(),d(),l||(l={items:[],ordered:x}),l.items.push(g[1]?.trim()??"")):y?(c(),r(),i.push(y[1]?.trim()??"")):(r(),d(),a.push(h.trim()))}return p(),{title:s,sections:o}}const fr={heading:"Heading",paragraph:"Paragraph",list:"List",quote:"Quote",divider:"Divider",image:"BlockImage"};function pr(t,e){const s=[];for(const o of t){const a=e[fr[o.kind]];if(a)switch(o.kind){case"heading":s.push({__resolveType:a,text:o.text,level:o.level});break;case"paragraph":s.push({__resolveType:a,html:o.html});break;case"list":s.push({__resolveType:a,items:o.items.join(`
7
7
  `),style:o.ordered?"ordered":"unordered"});break;case"quote":s.push({__resolveType:a,quote:o.text});break;case"divider":s.push({__resolveType:a});break;case"image":s.push({__resolveType:a,url:o.url,alt:o.alt,caption:o.caption,size:"normal"});break}}return s}function hr({title:t,blocks:e,takenSlugs:s,now:o}){const a=t.trim();return{title:a,slug:a?ho(a,s):po(""),date:o.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const dn="__all__",un={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},xr={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},mn="status:";function fn(t){if(!t.startsWith(mn))return null;const e=t.slice(mn.length);return Ds.includes(e)?e:null}const pn=$.forwardRef(function(e,s){const o=ae.c(20);let a,l,i,c,r;o[0]!==e?({icon:a,active:l,value:r,className:i,...c}=e,o[0]=e,o[1]=a,o[2]=l,o[3]=i,o[4]=c,o[5]=r):(a=o[1],l=o[2],i=o[3],c=o[4],r=o[5]);const d=l?"text-foreground":"text-muted-foreground";let p;o[6]!==i||o[7]!==d?(p=be("h-7 gap-1 px-1.5 text-xs",d,i),o[6]=i,o[7]=d,o[8]=p):p=o[8];let m;o[9]!==a?(m=n.jsx(a,{size:14,className:"shrink-0"}),o[9]=a,o[10]=m):m=o[10];let h;o[11]!==r?(h=r&&n.jsx("span",{className:"min-w-0 flex-1 truncate",children:r}),o[11]=r,o[12]=h):h=o[12];let u;o[13]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(ft,{size:12,className:"shrink-0 opacity-60"}),o[13]=u):u=o[13];let f;return o[14]!==c||o[15]!==s||o[16]!==p||o[17]!==m||o[18]!==h?(f=n.jsxs(_e,{ref:s,type:"button",variant:"ghost",size:"sm",className:p,...c,children:[m,h,u]}),o[14]=c,o[15]=s,o[16]=p,o[17]=m,o[18]=h,o[19]=f):f=o[19],f});function Ls(t){const e=ae.c(2),{count:s}=t;let o;return e[0]!==s?(o=n.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=o):o=e[1],o}function gr(t){const e=ae.c(19),{value:s,onChange:o}=t,a=Se();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=l):l=e[0];let i;e[1]!==o?(i=h=>o(h.target.value),e[1]=o,e[2]=i):i=e[2];let c;e[3]!==a?(c=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=c):c=e[4];let r;e[5]!==a?(r=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=r):r=e[6];let d;e[7]!==i||e[8]!==c||e[9]!==r||e[10]!==s?(d=n.jsx("input",{type:"text",value:s,onChange:i,placeholder:c,"aria-label":r,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=i,e[8]=c,e[9]=r,e[10]=s,e[11]=d):d=e[11];let p;e[12]!==o||e[13]!==a||e[14]!==s?(p=s&&n.jsx(No,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>o("")}),e[12]=o,e[13]=a,e[14]=s,e[15]=p):p=e[15];let m;return e[16]!==d||e[17]!==p?(m=n.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[l,d,p]}),e[16]=d,e[17]=p,e[18]=m):m=e[18],m}function br(t){const e=ae.c(100),{categories:s,authors:o,statusCounts:a,categoryFilter:l,authorFilter:i,statusFilter:c,sort:r,onCategoryFilterChange:d,onAuthorFilterChange:p,onStatusFilterChange:m,onSortChange:h}=t,u=Se();let f;if(e[0]!==s||e[1]!==l){let H;e[3]!==l?(H=ie=>ie.slug===l,e[3]=l,e[4]=H):H=e[4],f=s.find(H),e[0]=s,e[1]=l,e[2]=f}else f=e[2];const g=f;let x;if(e[5]!==i||e[6]!==o){let H;e[8]!==i?(H=ie=>ie.email===i,e[8]=i,e[9]=H):H=e[9],x=o.find(H),e[5]=i,e[6]=o,e[7]=x}else x=e[7];const y=x,v=!!(l||i||c);let j;e[10]!==y?.name||e[11]!==g?.name||e[12]!==c||e[13]!==u?(j=g?.name??y?.name??u(c?qt[c]:"sandbox.postToolbar.filterLabel"),e[10]=y?.name,e[11]=g?.name,e[12]=c,e[13]=u,e[14]=j):j=e[14];const w=j,C=l?`cat:${l}`:i?`author:${i}`:c?`status:${c}`:dn;let E;e[15]!==p||e[16]!==d||e[17]!==m?(E=()=>{d(null),p(null),m(null)},e[15]=p,e[16]=d,e[17]=m,e[18]=E):E=e[18];const B=E;let k;e[19]!==B||e[20]!==p||e[21]!==d||e[22]!==m?(k=H=>{H.startsWith("cat:")?(p(null),m(null),d(H.slice(4))):H.startsWith("author:")?(d(null),m(null),p(H.slice(7))):fn(H)?(d(null),p(null),m(fn(H))):B()},e[19]=B,e[20]=p,e[21]=d,e[22]=m,e[23]=k):k=e[23];const D=k;let O;e[24]!==w||e[25]!==v?(O=n.jsx(It,{asChild:!0,children:n.jsx(pn,{icon:zo,active:v,value:w,className:"min-w-0 shrink"})}),e[24]=w,e[25]=v,e[26]=O):O=e[26];let L;e[27]!==u?(L=u("sandbox.postToolbar.filterBy"),e[27]=u,e[28]=L):L=e[28];let K;e[29]!==L?(K=n.jsx(bt,{children:L}),e[29]=L,e[30]=K):K=e[30];let F;e[31]!==u?(F=u("sandbox.postToolbar.allPosts"),e[31]=u,e[32]=F):F=e[32];let _;e[33]!==F?(_=n.jsx(St,{value:dn,children:F}),e[33]=F,e[34]=_):_=e[34];let A;e[35]!==u?(A=u("sandbox.postToolbar.statusLabel"),e[35]=u,e[36]=A):A=e[36];let I;e[37]!==A?(I=n.jsx(bt,{className:"text-muted-foreground/70",children:A}),e[37]=A,e[38]=I):I=e[38];let R;e[39]!==a||e[40]!==u?(R=Ds.map(H=>n.jsxs(St,{value:`status:${H}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:u(qt[H])}),n.jsx(Ls,{count:a[H]??0})]},`status:${H}`)),e[39]=a,e[40]=u,e[41]=R):R=e[41];let G;e[42]!==s.length||e[43]!==u?(G=s.length>0&&n.jsx(bt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=u,e[44]=G):G=e[44];let z;e[45]!==s?(z=s.map(vr),e[45]=s,e[46]=z):z=e[46];let W;e[47]!==o.length||e[48]!==u?(W=o.length>0&&n.jsx(bt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.authorLabel")}),e[47]=o.length,e[48]=u,e[49]=W):W=e[49];let T;e[50]!==o?(T=o.map(yr),e[50]=o,e[51]=T):T=e[51];let U;e[52]!==C||e[53]!==D||e[54]!==_||e[55]!==I||e[56]!==R||e[57]!==G||e[58]!==z||e[59]!==W||e[60]!==T?(U=n.jsxs(Fs,{value:C,onValueChange:D,children:[_,I,R,G,z,W,T]}),e[52]=C,e[53]=D,e[54]=_,e[55]=I,e[56]=R,e[57]=G,e[58]=z,e[59]=W,e[60]=T,e[61]=U):U=e[61];let Y;e[62]!==U||e[63]!==K?(Y=n.jsxs(Rt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[K,U]}),e[62]=U,e[63]=K,e[64]=Y):Y=e[64];let q;e[65]!==Y||e[66]!==O?(q=n.jsxs(Ft,{children:[O,Y]}),e[65]=Y,e[66]=O,e[67]=q):q=e[67];let X;e[68]!==B||e[69]!==v||e[70]!==u?(X=v&&n.jsx(No,{label:u("sandbox.postToolbar.clearFilter"),onClick:B}),e[68]=B,e[69]=v,e[70]=u,e[71]=X):X=e[71];const de=xr[r];let ne;e[72]!==u||e[73]!==de?(ne=u(de),e[72]=u,e[73]=de,e[74]=ne):ne=e[74];let ue;e[75]!==ne?(ue=n.jsx(It,{asChild:!0,children:n.jsx(pn,{icon:Mo,active:!0,value:ne})}),e[75]=ne,e[76]=ue):ue=e[76];let te;e[77]!==u?(te=u("sandbox.postToolbar.sortBy"),e[77]=u,e[78]=te):te=e[78];let re;e[79]!==te?(re=n.jsx(bt,{children:te}),e[79]=te,e[80]=re):re=e[80];let le;e[81]!==h?(le=H=>h(H),e[81]=h,e[82]=le):le=e[82];let N;e[83]===Symbol.for("react.memo_cache_sentinel")?(N=Object.keys(un),e[83]=N):N=e[83];let J;e[84]!==u?(J=N.map(H=>n.jsx(St,{value:H,children:u(un[H])},H)),e[84]=u,e[85]=J):J=e[85];let Z;e[86]!==r||e[87]!==le||e[88]!==J?(Z=n.jsx(Fs,{value:r,onValueChange:le,children:J}),e[86]=r,e[87]=le,e[88]=J,e[89]=Z):Z=e[89];let oe;e[90]!==re||e[91]!==Z?(oe=n.jsxs(Rt,{align:"end",className:"w-44",children:[re,Z]}),e[90]=re,e[91]=Z,e[92]=oe):oe=e[92];let S;e[93]!==ue||e[94]!==oe?(S=n.jsx("div",{className:"ml-auto shrink-0",children:n.jsxs(Ft,{children:[ue,oe]})}),e[93]=ue,e[94]=oe,e[95]=S):S=e[95];let se;return e[96]!==q||e[97]!==X||e[98]!==S?(se=n.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[q,X,S]}),e[96]=q,e[97]=X,e[98]=S,e[99]=se):se=e[99],se}function yr(t){return n.jsxs(St,{value:`author:${t.email}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx(Ls,{count:t.count})]},`author:${t.email}`)}function vr(t){return n.jsxs(St,{value:`cat:${t.slug}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),n.jsx(Ls,{count:t.count})]},`cat:${t.slug}`)}function No(t){const e=ae.c(4),{label:s,onClick:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Bs,{size:12}),e[0]=a):a=e[0];let l;return e[1]!==s||e[2]!==o?(l=n.jsx("button",{type:"button","aria-label":s,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=o,e[3]=l):l=e[3],l}function jr(t){const e=ae.c(18),{checked:s,disabled:o,onToggle:a}=t,l=Se();let i;e[0]!==a?(i=()=>a(),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==s||e[3]!==l?(c=l(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=l,e[4]=c):c=e[4];let r;e[5]!==s||e[6]!==o||e[7]!==i||e[8]!==c?(r=n.jsx(We,{asChild:!0,children:n.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:kr,children:n.jsx(Xt,{checked:s,disabled:o,onCheckedChange:i,"aria-label":c})})}),e[5]=s,e[6]=o,e[7]=i,e[8]=c,e[9]=r):r=e[9];let d;e[10]!==s||e[11]!==l?(d=l(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=l,e[12]=d):d=e[12];let p;e[13]!==d?(p=n.jsx(Ye,{side:"bottom",children:d}),e[13]=d,e[14]=p):p=e[14];let m;return e[15]!==r||e[16]!==p?(m=n.jsxs(Qe,{children:[r,p]}),e[15]=r,e[16]=p,e[17]=m):m=e[17],m}function kr(t){return t.stopPropagation()}function Sr(t){const e=ae.c(42),{count:s,allSelected:o,onToggleSelectAll:a,onArchive:l,onExit:i}=t,c=Se();let r;e[0]!==o||e[1]!==a?(r=n.jsx(jr,{checked:o,onToggle:a}),e[0]=o,e[1]=a,e[2]=r):r=e[2];let d;e[3]!==s||e[4]!==c?(d=c("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=c,e[5]=d):d=e[5];let p;e[6]!==d?(p=n.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=p):p=e[7];const m=s===0;let h;e[8]!==c?(h=c("sandbox.postToolbar.archiveSelectedPosts"),e[8]=c,e[9]=h):h=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Bo,{size:14}),e[10]=u):u=e[10];let f;e[11]!==l||e[12]!==m||e[13]!==h?(f=n.jsx(We,{asChild:!0,children:n.jsx(_e,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:m,onClick:l,"aria-label":h,children:u})}),e[11]=l,e[12]=m,e[13]=h,e[14]=f):f=e[14];let g;e[15]!==c?(g=c("sandbox.postToolbar.archiveSelected"),e[15]=c,e[16]=g):g=e[16];let x;e[17]!==g?(x=n.jsx(Ye,{side:"bottom",children:g}),e[17]=g,e[18]=x):x=e[18];let y;e[19]!==f||e[20]!==x?(y=n.jsxs(Qe,{children:[f,x]}),e[19]=f,e[20]=x,e[21]=y):y=e[21];let v;e[22]!==c?(v=c("sandbox.postToolbar.exitSelection"),e[22]=c,e[23]=v):v=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Bs,{size:14}),e[24]=j):j=e[24];let w;e[25]!==i||e[26]!==v?(w=n.jsx(We,{asChild:!0,children:n.jsx(_e,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":v,children:j})}),e[25]=i,e[26]=v,e[27]=w):w=e[27];let C;e[28]!==c?(C=c("sandbox.postToolbar.exitSelection"),e[28]=c,e[29]=C):C=e[29];let E;e[30]!==C?(E=n.jsx(Ye,{side:"bottom",children:C}),e[30]=C,e[31]=E):E=e[31];let B;e[32]!==w||e[33]!==E?(B=n.jsxs(Qe,{children:[w,E]}),e[32]=w,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==y||e[36]!==B?(k=n.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[y,B]}),e[35]=y,e[36]=B,e[37]=k):k=e[37];let D;return e[38]!==r||e[39]!==k||e[40]!==p?(D=n.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[r,p,k]}),e[38]=r,e[39]=k,e[40]=p,e[41]=D):D=e[41],D}const wr={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},hn="ideas",xn=t=>t.scheduledDatetime||t.date||"",Nr=(t,e)=>xn(e).localeCompare(xn(t)),Cr=t=>t==="scheduled"||t==="published",Co="application/x-post-key";function Pr({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,view:a,selectedKey:l,onViewChange:i,onOpen:c,onClose:r,move:d,support:p,meta:m,renderDetail:h}){const u=Se(),f=js(),g=Qt({orgSlug:t,virtualMcpId:e,branch:s}),x=Mn({orgSlug:t,virtualMcpId:e,branch:s}),y=al().length>0,[v,j]=$.useState(null),[w,C]=$.useState(!1),[E,B]=$.useState(!1),[k,D]=$.useState(""),[O,L]=$.useState(3),[K,F]=$.useState(""),[_,A]=$.useState(!1),[I,R]=$.useState(!1),[G,z]=$.useState(),[W,T]=$.useState(!1),[U,Y]=$.useState(""),q=$.useRef(null),[X,de]=Eo(_o.blogBoardCollapsedLanes(),[]),ne=P=>de(Q=>Q.includes(P)?Q.filter(Ee=>Ee!==P):[...Q,P]),ue=er({orgSlug:t,virtualMcpId:e,branch:s,decofile:o,meta:m,onStarted:c}),te=ei(o),re=ro(o),le=uo(o),N=P=>le.find(Q=>Q.key===P)?.title,J=P=>dt(o[P],"posts"),Z=l&&te.some(P=>P.key===l)?l:te[0]?.key??null,oe=async P=>{await d.apply(P.key,"archived")&&me.success(u("sandbox.postBoard.archived"))},[S,se]=$.useState(null),[H,ie]=$.useState(null),[ve,pe]=$.useState(null),[ke,he]=$.useState("date-desc"),[we,Pe]=$.useState(""),[Te,Ne]=$.useState(new Set),Be=te.reduce((P,Q)=>(P[Q.status]=(P[Q.status]??0)+1,P),{}),De=P=>{const Q=new Map;for(const Ee of te)for(const Ve of P(Ee))Q.set(Ve,(Q.get(Ve)??0)+1);return Q},xe=De(P=>P.categorySlugs),$e=De(P=>P.authorEmails),Fe=Ge(o,"categories").map(({payload:P})=>({slug:ye(P.slug),name:ye(P.name)||ye(P.slug),count:xe.get(ye(P.slug))??0})),M=Ge(o,"authors").map(({payload:P})=>({email:ye(P.email),name:ye(P.name)||ye(P.email),count:$e.get(ye(P.email))??0})),ge=we.trim().toLowerCase(),je=te.filter(P=>!S||P.categorySlugs.includes(S)).filter(P=>!H||P.authorEmails.includes(H)).filter(P=>!ve||P.status===ve).filter(P=>!ge||P.title.toLowerCase().includes(ge)||P.slug.toLowerCase().includes(ge)).sort((P,Q)=>{if(ke==="az")return P.title.localeCompare(Q.title);if(ke==="za")return Q.title.localeCompare(P.title);const Ee=(P.scheduledDatetime||P.date).localeCompare(Q.scheduledDatetime||Q.date);return ke==="date-asc"?Ee:-Ee}),Le=Te.size>0,ss=P=>Ne(Q=>{const Ee=new Set(Q);return Ee.delete(P)||Ee.add(P),Ee}),ns=()=>Ne(P=>je.every(Q=>P.has(Q.key))?new Set:new Set(je.map(Q=>Q.key))),os=async()=>{let P=0;for(const Q of Te)await d.apply(Q,"archived")&&(P+=1);Ne(new Set),P>0&&me.success(u("sandbox.postBoard.archived"))},as=P=>{z({key:P.key,title:P.title,body:P.body}),R(!0)},ls=P=>{x.mutate({blockKey:P.key})},is=(P,Q)=>{j(null),d.apply(Q,P)},_t=()=>{const P=Vt(bs()),Q=oo({title:"",now:new Date});g.mutate({blockKey:P,data:ut(P,Q)}),c(P)},rs=()=>{const P=sr(U),Q=pr(P.sections,fo(m));if(Q.length===0&&!P.title.trim()){me.error(u("sandbox.postBoard.importEmpty"));return}const Ee=Vt(bs()),Ve=hr({title:P.title,blocks:Q,takenSlugs:te.map(qe=>qe.slug).filter(Boolean),now:new Date});g.mutate({blockKey:Ee,data:ut(Ee,Ve)}),T(!1),Y(""),me.success(u("sandbox.postBoard.imported")),c(Ee)},cs=async()=>{C(!0);const P=le.find(Q=>Q.key===K);try{const Q=o[As]??{},Ee=o[mo],Ve=Ke(Ee?.formats).map(b=>b.name).filter(Boolean),qe=await f.call("BLOG_THEME_SUGGEST",{brand:{companyName:ye(Q.companyName),description:ye(Q.description),language:ye(Q.language),tone:ye(Q.tone),targetAudience:ye(Q.targetAudience),values:Me(Ke(Q.values)),dos:Me(Ke(Q.dos)),avoid:Me(Ke(Q.avoid))},existingTitles:re.map(b=>b.title).filter(Boolean),formats:Ve,guidance:[P&&`Every idea must be one angle inside the pillar "${P.title}": ${P.body}`,k.trim()].filter(Boolean).join(`
8
8
 
9
- `)||void 0,count:O}),Ce=yi(re.map(b=>b.title),qe.themes);if(Ce.length===0){me.info(u("sandbox.postBoard.ideasFailed"));return}let gt=0;for(const b of Ce){const V=fi();try{await g.mutateAsync({blockKey:V,data:pi(V,{title:b.title,body:b.body,pillarKey:P?.key,createdAt:new Date().toISOString()})}),gt++}catch(ce){console.warn("[posts] could not save a generated idea",ce)}}if(gt===0){me.error(u("sandbox.postBoard.ideasFailed"));return}me.success(u("sandbox.postBoard.ideasAdded",{count:String(gt)}))}catch(Q){me.error(Q instanceof Error?Q.message:u("sandbox.postBoard.ideasFailed"))}finally{C(!1)}};return n.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[n.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[n.jsx(gn,{active:a==="board",onClick:()=>i("board"),icon:n.jsx(Vo,{size:14}),label:u("sandbox.postBoard.viewBoard")}),n.jsx(gn,{active:a==="list",onClick:()=>i("list"),icon:n.jsx(Wo,{size:14}),label:u("sandbox.postBoard.viewList")})]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[w&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[n.jsx(wt,{size:12,className:"animate-spin"}),u("sandbox.postBoard.generatingLabel")]}),n.jsxs(ct,{open:E,onOpenChange:B,children:[n.jsx(Ya,{asChild:!0,children:n.jsxs(_e,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[n.jsx(et,{size:14}),u("sandbox.postBoard.generateIdeas"),n.jsx(nt,{variant:"secondary",children:u("common.soon")})]})}),n.jsxs(rt,{className:"sm:max-w-lg",children:[n.jsxs(pt,{children:[n.jsx(it,{children:u("sandbox.postBoard.generateIdeas")}),n.jsx(zt,{children:u("sandbox.postBoard.ideaGuidanceLabel")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(Ot,{id:"idea-guidance",value:k,rows:6,autoFocus:!0,onChange:P=>D(P.target.value),placeholder:u("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),le.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(ze,{className:"text-xs",children:u("sandbox.postBoard.ideaPillarLabel")}),n.jsx(kt,{options:le.map(P=>P.title),value:le.find(P=>P.key===K)?.title??"",emptyLabel:u("sandbox.postBoard.ideaNoPillar"),onChange:P=>F(le.find(Q=>Q.title===P)?.key??"")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ze,{htmlFor:"idea-count",className:"text-xs",children:u("sandbox.postBoard.ideaCount")}),n.jsx(Xe,{id:"idea-count",type:"number",min:1,max:8,value:O,onChange:P=>L(Math.max(1,Math.min(8,Number(P.target.value)||1))),className:"h-9 w-16"}),n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:u("sandbox.postBoard.usesCredits")})]})]}),n.jsx(ht,{children:n.jsxs(_e,{type:"button",onClick:()=>{B(!1),cs()},children:[n.jsx(et,{size:14}),u("sandbox.postBoard.generateIdeas")]})})]})]}),n.jsxs(Ft,{children:[n.jsx(It,{asChild:!0,children:n.jsxs(_e,{type:"button",size:"sm",children:[n.jsx(ws,{size:14}),u("sandbox.postBoard.newPost"),n.jsx(ft,{size:14})]})}),n.jsxs(Rt,{align:"end",className:"w-56",children:[n.jsxs(Je,{disabled:!0,onClick:()=>{z(void 0),R(!0)},children:[n.jsx(et,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[u("sandbox.postBoard.newPostGenerate"),n.jsx(nt,{variant:"secondary",children:u("common.soon")})]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostGenerateHint")})]})]}),n.jsxs(Je,{onClick:_t,children:[n.jsx(Go,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.newPostWrite")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostWriteHint")})]})]}),n.jsxs(Je,{onClick:()=>T(!0),children:[n.jsx(fs,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.importContent")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.importContentHint")})]})]})]})]}),n.jsx(Wi,{open:I,onOpenChange:R,decofile:o,hasAi:y,seed:G,onGenerate:P=>{ue(P)}},G?.title??"scratch"),n.jsx(ct,{open:W,onOpenChange:T,children:n.jsxs(rt,{className:"max-h-[85vh] sm:max-w-2xl",children:[n.jsxs(pt,{children:[n.jsx(it,{children:u("sandbox.postBoard.importTitle")}),n.jsx(zt,{children:u("sandbox.postBoard.importDescription")})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:n.jsx(Un,{code:U,language:ko(U)?"html":"markdown",height:"100%",autoFocus:!0,onChange:P=>Y(P??"")})}),n.jsx("input",{ref:q,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async P=>{const Q=P.target.files?.[0];Q&&Y(await Q.text()),P.target.value=""}}),n.jsxs(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>q.current?.click(),children:[n.jsx(fs,{size:14}),u("sandbox.postBoard.importUpload")]})]}),n.jsx(ht,{children:n.jsxs(_e,{type:"button",disabled:!U.trim(),onClick:rs,children:[n.jsx(fs,{size:14}),u("sandbox.postBoard.importRun")]})})]})})]})]}),te.length===0&&re.length===0?n.jsx(ol,{className:"flex-1",icon:n.jsx(et,{size:22}),title:u("sandbox.postBoard.emptyTitle"),description:u("sandbox.postBoard.emptyDescription"),buttonProps:{children:u("sandbox.postBoard.newPost"),onClick:_t}}):a==="board"?n.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[n.jsx(_r,{ideas:re,collapsed:X.includes(hn),pillarTitleOf:N,onToggleCollapsed:()=>ne(hn),onGenerate:as,onDelete:ls}),n.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),Ds.map(P=>{const Q=te.filter(Ce=>Ce.status===P);Cr(P)&&Q.sort(Nr);const Ee=u(qt[P]),Ve=X.includes(P),qe=vo(p,P);return n.jsx("div",{onDragOver:Ce=>{Ce.preventDefault(),j(P)},onDragLeave:()=>j(Ce=>Ce===P?null:Ce),onDrop:Ce=>{Ce.preventDefault(),is(P,Ce.dataTransfer.getData(Co))},title:qe?jo(u,qe):void 0,className:be("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ve?"w-11":"w-72",qe&&"opacity-50",v===P&&"border-primary bg-primary/5"),children:Ve?n.jsxs("button",{type:"button",onClick:()=>ne(P),"aria-label":u("sandbox.postBoard.expandLane",{lane:Ee}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[n.jsx(Tt,{size:14,className:"shrink-0"}),n.jsx("span",{className:"text-xs tabular-nums",children:Q.length}),n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:Ee})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[n.jsxs("button",{type:"button",onClick:()=>ne(P),"aria-label":u("sandbox.postBoard.collapseLane",{lane:Ee}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[n.jsx(ft,{size:14,className:"shrink-0"}),n.jsx("span",{className:"truncate",children:Ee})]}),n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Q.length})]}),n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Q.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:u("sandbox.postBoard.laneEmpty")}):Q.map(Ce=>n.jsx(Er,{post:Ce,payload:J(Ce.key),moving:d.isMoving(Ce.key),onOpen:()=>c(Ce.key),onArchive:Ce.status==="archived"?void 0:()=>{oe(Ce)}},Ce.key))})]})},P)})]}):n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[n.jsx(gr,{value:we,onChange:Pe}),Le?n.jsx(Sr,{count:Te.size,allSelected:je.length>0&&je.every(P=>Te.has(P.key)),onToggleSelectAll:ns,onArchive:()=>{os()},onExit:()=>Ne(new Set)}):n.jsx(br,{categories:Fe,authors:M,statusCounts:Be,categoryFilter:S,authorFilter:H,statusFilter:ve,sort:ke,onCategoryFilterChange:se,onAuthorFilterChange:ie,onStatusFilterChange:pe,onSortChange:he}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(Tr,{posts:je,selectedKey:Z,selectionActive:Le,selectedKeys:Te,onToggleSelect:ss,onOpen:c,isMoving:d.isMoving,onArchive:P=>{oe(P)}})})]}),n.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:Z&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(wt,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(Z)}):n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:u("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&_&&h&&n.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:h(l,{expanded:!0,onToggleExpand:()=>A(!1),onClose:()=>{A(!1),r?.()}})}),n.jsx(ct,{open:a==="board"&&!!l&&!_,onOpenChange:P=>{P||(A(!1),r?.())},children:n.jsxs(rt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[n.jsx(it,{className:"sr-only",children:u("sandbox.collectionsSidebar.posts")}),l&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(wt,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(l,{expanded:!1,onToggleExpand:()=>A(!0),onClose:()=>r?.()})}):null]})})]})}function gn(t){const e=ae.c(7),{active:s,onClick:o,icon:a,label:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==i?(c=be("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==c?(r=n.jsxs("button",{type:"button",onClick:o,className:c,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=c,e[6]=r):r=e[6],r}function Tr(t){const e=ae.c(23),{posts:s,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:c,isMoving:r,onArchive:d}=t,p=Se();if(s.length===0){let u;e[0]!==p?(u=p("sandbox.postList.noMatches"),e[0]=p,e[1]=u):u=e[1];let f;return e[2]!==u?(f=n.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=f):f=e[3],f}let m;if(e[4]!==r||e[5]!==d||e[6]!==c||e[7]!==i||e[8]!==s||e[9]!==o||e[10]!==l||e[11]!==a){let u;e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==i||e[17]!==o||e[18]!==l||e[19]!==a?(u=f=>n.jsx(Br,{post:f,selected:f.key===o,selectionActive:a,checked:l.has(f.key),onToggleSelect:()=>i(f.key),moving:r(f.key),onOpen:()=>c(f.key),onArchive:f.status==="archived"?void 0:()=>d(f)},f.key),e[13]=r,e[14]=d,e[15]=c,e[16]=i,e[17]=o,e[18]=l,e[19]=a,e[20]=u):u=e[20],m=s.map(u),e[4]=r,e[5]=d,e[6]=c,e[7]=i,e[8]=s,e[9]=o,e[10]=l,e[11]=a,e[12]=m}else m=e[12];let h;return e[21]!==m?(h=n.jsx("ul",{className:"divide-y",children:m}),e[21]=m,e[22]=h):h=e[22],h}function Br(t){const e=ae.c(56),{post:s,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:c,onOpen:r,onArchive:d}=t,p=Se(),m=s.status==="awaiting_review"&&s.missing.length>0,h=s.status==="scheduled"||s.status==="published",u=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let f;e[0]!==u?(f=be("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=f):f=e[1];let g;e[2]!==i?(g=()=>i(),e[2]=i,e[3]=g):g=e[3];let x;e[4]!==s.title||e[5]!==p?(x=s.title||p("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=p,e[6]=x):x=e[6];let y;e[7]!==l||e[8]!==g||e[9]!==x?(y=n.jsx(Xt,{checked:l,onCheckedChange:g,"aria-label":x}),e[7]=l,e[8]=g,e[9]=x,e[10]=y):y=e[10];let v;e[11]!==f||e[12]!==y?(v=n.jsx("span",{className:f,children:y}),e[11]=f,e[12]=y,e[13]=v):v=e[13];let j;e[14]!==c||e[15]!==d||e[16]!==a?(j=d&&!a&&n.jsx(Os,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=j):j=e[17];let w;e[18]!==r||e[19]!==i||e[20]!==a?(w=()=>a?i():r(),e[18]=r,e[19]=i,e[20]=a,e[21]=w):w=e[21];const C=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let E;e[22]!==C?(E=be("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",C),e[22]=C,e[23]=E):E=e[23];let B;e[24]!==s.title||e[25]!==p?(B=s.title||p("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=p,e[26]=B):B=e[26];let k;e[27]!==B?(k=n.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:B}),e[27]=B,e[28]=k):k=e[28];const D=wr[s.status],O=qt[s.status];let L;e[29]!==p||e[30]!==O?(L=p(O),e[29]=p,e[30]=O,e[31]=L):L=e[31];let K;e[32]!==D||e[33]!==L?(K=n.jsx(nt,{variant:D,className:"shrink-0",children:L}),e[32]=D,e[33]=L,e[34]=K):K=e[34];let F;e[35]!==m||e[36]!==s.missing?(F=m&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Wt,{size:12}),s.missing.length]}),e[35]=m,e[36]=s.missing,e[37]=F):F=e[37];let _;e[38]!==h||e[39]!==s.date||e[40]!==s.scheduledDatetime?(_=h&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[38]=h,e[39]=s.date,e[40]=s.scheduledDatetime,e[41]=_):_=e[41];let A;e[42]!==K||e[43]!==F||e[44]!==_?(A=n.jsxs("div",{className:"flex items-center gap-2",children:[K,F,_]}),e[42]=K,e[43]=F,e[44]=_,e[45]=A):A=e[45];let I;e[46]!==o||e[47]!==E||e[48]!==k||e[49]!==A||e[50]!==w?(I=n.jsxs("button",{type:"button",onClick:w,"aria-current":o,className:E,children:[k,A]}),e[46]=o,e[47]=E,e[48]=k,e[49]=A,e[50]=w,e[51]=I):I=e[51];let R;return e[52]!==I||e[53]!==v||e[54]!==j?(R=n.jsxs("li",{className:"group/row relative",children:[v,j,I]}),e[52]=I,e[53]=v,e[54]=j,e[55]=R):R=e[55],R}function Er(t){const e=ae.c(46),{post:s,payload:o,moving:a,onOpen:l,onArchive:i}=t,c=Se(),r=s.status!=="generating"&&!a;let d;e[0]!==o?(d=Xl(o),e[0]=o,e[1]=d):d=e[1];const p=d,m=!r&&"opacity-80";let h;e[2]!==m?(h=be("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",m),e[2]=m,e[3]=h):h=e[3];let u;e[4]!==a||e[5]!==i?(u=i&&n.jsx(Os,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=u):u=e[6];let f;e[7]!==s.key?(f=O=>O.dataTransfer.setData(Co,s.key),e[7]=s.key,e[8]=f):f=e[8];const g=r?"cursor-grab active:cursor-grabbing":"cursor-pointer";let x;e[9]!==g?(x=be("block w-full p-3 text-left",g),e[9]=g,e[10]=x):x=e[10];let y;e[11]!==s.title||e[12]!==c?(y=s.title||c("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=c,e[13]=y):y=e[13];let v;e[14]!==y?(v=n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:y}),e[14]=y,e[15]=v):v=e[15];let j;e[16]!==p||e[17]!==s.status?(j=s.status==="draft"&&n.jsxs(n.Fragment,{children:[p.pillarTitle&&n.jsx(nt,{variant:"secondary",className:"max-w-full truncate",children:p.pillarTitle}),p.format?.name&&n.jsx(nt,{variant:"outline",className:"max-w-full truncate",children:p.format.name})]}),e[16]=p,e[17]=s.status,e[18]=j):j=e[18];let w;e[19]!==s.status||e[20]!==c?(w=s.status==="generating"&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(wt,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=c,e[21]=w):w=e[21];let C;e[22]!==s.missing||e[23]!==s.status||e[24]!==c?(C=s.status==="awaiting_review"&&(s.missing.length>0?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Wt,{size:12}),c("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[n.jsx(nl,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=c,e[25]=C):C=e[25];let E;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(E=(s.status==="scheduled"||s.status==="published")&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=E):E=e[29];let B;e[30]!==j||e[31]!==w||e[32]!==C||e[33]!==E?(B=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[j,w,C,E]}),e[30]=j,e[31]=w,e[32]=C,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==r||e[36]!==l||e[37]!==B||e[38]!==f||e[39]!==x||e[40]!==v?(k=n.jsxs("button",{type:"button",draggable:r,onDragStart:f,onClick:l,className:x,children:[v,B]}),e[35]=r,e[36]=l,e[37]=B,e[38]=f,e[39]=x,e[40]=v,e[41]=k):k=e[41];let D;return e[42]!==k||e[43]!==h||e[44]!==u?(D=n.jsxs("div",{className:h,children:[u,k]}),e[42]=k,e[43]=h,e[44]=u,e[45]=D):D=e[45],D}function _r(t){const e=ae.c(40),{ideas:s,collapsed:o,pillarTitleOf:a,onToggleCollapsed:l,onGenerate:i,onDelete:c}=t,r=Se();let d,p,m,h,u,f,g;if(e[0]!==o||e[1]!==s.length||e[2]!==l||e[3]!==r){g=Symbol.for("react.early_return_sentinel");e:{if(d=r("sandbox.postBoard.ideasTray"),o){let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Tt,{size:14,className:"shrink-0"}),e[11]=k):k=e[11];let D;e[12]!==s.length?(D=n.jsx("span",{className:"text-xs tabular-nums",children:s.length}),e[12]=s.length,e[13]=D):D=e[13],g=n.jsxs("button",{type:"button",onClick:l,"aria-label":r("sandbox.postBoard.expandLane",{lane:d}),"aria-expanded":!1,className:"flex w-11 shrink-0 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[k,D,n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:d})]});break e}f="flex w-72 shrink-0 flex-col",u="flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",p="button",m=l,h=r("sandbox.postBoard.collapseLane",{lane:d})}e[0]=o,e[1]=s.length,e[2]=l,e[3]=r,e[4]=d,e[5]=p,e[6]=m,e[7]=h,e[8]=u,e[9]=f,e[10]=g}else d=e[4],p=e[5],m=e[6],h=e[7],u=e[8],f=e[9],g=e[10];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ft,{size:14,className:"shrink-0"}),e[14]=x):x=e[14];let y;e[15]!==d?(y=n.jsx("span",{className:"truncate",children:d}),e[15]=d,e[16]=y):y=e[16];let v;e[17]!==p||e[18]!==m||e[19]!==h||e[20]!==y?(v=n.jsxs("button",{type:p,onClick:m,"aria-label":h,"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[x,y]}),e[17]=p,e[18]=m,e[19]=h,e[20]=y,e[21]=v):v=e[21];let j;e[22]!==s.length?(j=n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:s.length}),e[22]=s.length,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==u||e[26]!==v?(w=n.jsxs("div",{className:u,children:[v,j]}),e[24]=j,e[25]=u,e[26]=v,e[27]=w):w=e[27];let C;e[28]!==s||e[29]!==c||e[30]!==i||e[31]!==a||e[32]!==r?(C=s.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.postBoard.ideasEmpty")}):s.map(k=>{const D=a(k.pillarKey);return n.jsxs("div",{className:"group/card relative rounded-lg border border-dashed bg-card shadow-sm transition-colors hover:border-primary/40",children:[n.jsx(Os,{label:r("sandbox.postBoard.deleteIdea"),onArchive:()=>c(k),className:"top-2"}),n.jsxs("div",{className:"p-3",children:[n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:k.title||r("sandbox.postBoard.untitledIdea")}),k.body&&n.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:k.body}),D&&n.jsx(nt,{variant:"secondary",className:"mt-2 max-w-full truncate",children:D})]}),n.jsx("div",{className:"border-t px-3 py-2",children:n.jsxs(_e,{type:"button",variant:"ghost",size:"sm",disabled:!0,className:"h-7 w-full justify-start px-1.5 text-xs",onClick:()=>i(k),children:[n.jsx(et,{size:13}),r("sandbox.postBoard.writeFromIdea"),n.jsx(nt,{variant:"secondary",className:"ml-auto",children:r("common.soon")})]})})]},k.key)}),e[28]=s,e[29]=c,e[30]=i,e[31]=a,e[32]=r,e[33]=C):C=e[33];let E;e[34]!==C?(E=n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto pb-2 pr-1",children:C}),e[34]=C,e[35]=E):E=e[35];let B;return e[36]!==w||e[37]!==E||e[38]!==f?(B=n.jsxs("div",{className:f,children:[w,E]}),e[36]=w,e[37]=E,e[38]=f,e[39]=B):B=e[39],B}function Os(t){const e=ae.c(13),{label:s,onArchive:o,disabled:a,className:l}=t,i=Se();let c;e[0]!==s||e[1]!==i?(c=s??i("sandbox.postBoard.delete"),e[0]=s,e[1]=i,e[2]=c):c=e[2];const r=c;let d;e[3]!==o?(d=u=>{u.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let p;e[5]!==l?(p=be("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[5]=l,e[6]=p):p=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ts,{size:13}),e[7]=m):m=e[7];let h;return e[8]!==a||e[9]!==d||e[10]!==p||e[11]!==r?(h=n.jsx("button",{type:"button",disabled:a,"aria-label":r,title:r,onClick:d,className:p,children:m}),e[8]=a,e[9]=d,e[10]=p,e[11]=r,e[12]=h):h=e[12],h}function Ue(t){const e=ae.c(50),{icon:s,logoUrl:o,title:a,subtitle:l,active:i,accent:c,variantCount:r,trailing:d,selectable:p,selectionActive:m,selected:h,invalid:u,invalidReason:f,onToggleSelect:g,onClick:x,menu:y}=t,v=Se(),j=c==="global";let w;e[0]!==s||e[1]!==i||e[2]!==j||e[3]!==o?(w=o?n.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:be("flex size-8 shrink-0 items-center justify-center rounded-lg",j?"bg-global-section/15":"bg-muted"),children:n.jsx(s,{size:16,className:be("shrink-0",!j&&(i?"text-accent-foreground":"text-muted-foreground")),style:j?{color:Ps}:void 0})}),e[0]=s,e[1]=i,e[2]=j,e[3]=o,e[4]=w):w=e[4];const C=w,E=i?j?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":j?"hover:bg-global-section/10":"hover:bg-muted";let B;e[5]!==E?(B=be("group relative flex min-w-0 items-center rounded-md transition-colors",E),e[5]=E,e[6]=B):B=e[6];let k;e[7]!==g||e[8]!==p||e[9]!==h||e[10]!==m||e[11]!==v||e[12]!==a?(k=p&&n.jsx("span",{className:be("flex shrink-0 items-center pl-2.5 transition-opacity",h||m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Dr,children:n.jsx(Xt,{checked:h,onCheckedChange:()=>g?.(),"aria-label":v("sandbox.itemRow.selectItem",{title:a})})}),e[7]=g,e[8]=p,e[9]=h,e[10]=m,e[11]=v,e[12]=a,e[13]=k):k=e[13];const D=u&&!i&&"text-destructive";let O;e[14]!==D?(O=be("block truncate text-sm font-medium",D),e[14]=D,e[15]=O):O=e[15];let L;e[16]!==O||e[17]!==a?(L=n.jsx("span",{className:O,children:a}),e[16]=O,e[17]=a,e[18]=L):L=e[18];const K=i?"text-accent-foreground/70":"text-muted-foreground";let F;e[19]!==K?(F=be("block truncate text-xs",K),e[19]=K,e[20]=F):F=e[20];let _;e[21]!==l||e[22]!==F?(_=n.jsx("span",{className:F,children:l}),e[21]=l,e[22]=F,e[23]=_):_=e[23];let A;e[24]!==_||e[25]!==L?(A=n.jsxs("span",{className:"min-w-0 flex-1",children:[L,_]}),e[24]=_,e[25]=L,e[26]=A):A=e[26];let I;e[27]!==i||e[28]!==v||e[29]!==r?(I=r!==void 0&&r>1&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsxs("span",{className:be("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[n.jsx(Tn,{size:14}),r]})}),n.jsx(Ye,{side:"bottom",children:v("sandbox.itemRow.variantCount",{count:r})})]}),e[27]=i,e[28]=v,e[29]=r,e[30]=I):I=e[30];let R;e[31]!==i||e[32]!==u||e[33]!==f?(R=u&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx("span",{className:be("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:n.jsx(Wt,{size:14})})}),f&&n.jsx(Ye,{side:"bottom",children:f})]}),e[31]=i,e[32]=u,e[33]=f,e[34]=R):R=e[34];let G;e[35]!==x||e[36]!==C||e[37]!==A||e[38]!==I||e[39]!==R||e[40]!==d?(G=n.jsxs("button",{type:"button",onClick:x,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[C,A,I,R,d]}),e[35]=x,e[36]=C,e[37]=A,e[38]=I,e[39]=R,e[40]=d,e[41]=G):G=e[41];let z;e[42]!==i||e[43]!==y?(z=y&&n.jsx("div",{className:be("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:y}),e[42]=i,e[43]=y,e[44]=z):z=e[44];let W;return e[45]!==G||e[46]!==z||e[47]!==B||e[48]!==k?(W=n.jsxs("div",{className:B,children:[k,G,z]}),e[45]=G,e[46]=z,e[47]=B,e[48]=k,e[49]=W):W=e[49],W}function Dr(t){return t.stopPropagation()}function tt(t){const e=ae.c(10),{icon:s,title:o,description:a}=t;let l;e[0]!==s?(l=s&&n.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==o?(i=n.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==l||e[7]!==i||e[8]!==c?(r=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,c]}),e[6]=l,e[7]=i,e[8]=c,e[9]=r):r=e[9],r}const Ar={loaders:Pn,actions:Dn},$r={loaders:"Loaders",actions:"Actions"},Lr={analytics:qo,blog:Vn,commerce:Ho,site:Uo,website:Kt};function Or(t,e){return e===0?Lr[t.toLowerCase()]??Ks:Ks}function At(t,e){return e===0?fa(t):t}function Ir(t){const e=ae.c(98),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r}=t,d=Se();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[m,h]=$.useState(p),[u,f]=$.useState(null),[g,x]=$.useState(""),[y,v]=$.useState(Ur),[j,w]=$.useState(r);j!==r&&(w(r),h([]),f(null),x(""),v(new Set));let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=q=>{v(X=>{const de=new Set(X);return de.has(q)?de.delete(q):de.add(q),de})},e[1]=C):C=e[1];const E=C;let B;e[2]!==a||e[3]!==s||e[4]!==o?(B={orgSlug:s,virtualMcpId:o,branch:a},e[2]=a,e[3]=s,e[4]=o,e[5]=B):B=e[5];const k=Qt(B);let D;e[6]!==k?(D=Rn((q,X)=>k.mutate({blockKey:q,data:X})),e[6]=k,e[7]=D):D=e[7];const O=D;let L;e[8]!==r?(L=pa(r),e[8]=r,e[9]=L):L=e[9];const K=L,F=Ar[r];let _,A,I,R,G,z,W;if(e[10]!==F||e[11]!==a||e[12]!==c||e[13]!==r||e[14]!==i||e[15]!==y||e[16]!==s||e[17]!==m||e[18]!==l||e[19]!==k||e[20]!==O||e[21]!==g||e[22]!==u||e[23]!==K||e[24]!==d||e[25]!==o){I=Symbol.for("react.early_return_sentinel");e:{const q=[...ca(i,c,r).map(Gr),...da(i,r).map(Vr)],X=g.trim().toLowerCase(),de=X.length>0,ne=de?q.filter(M=>M.title.toLowerCase().includes(X)||M.resolveType.toLowerCase().includes(X)):[],ue=new Map,te=[],re=new Map;if(!de){for(const M of q){const ge=M.folderPath;if(!(ge.length<m.length)&&m.every((je,Le)=>ge[Le]===je))if(ge.length===m.length)if(M.savedKey!==void 0){const je=re.get(M.resolveType);je?je.push(M):re.set(M.resolveType,[M])}else te.push(M);else{const je=ge[m.length],Le=ue.get(je)??{count:0,savedCount:0};M.savedKey!==void 0?Le.savedCount=Le.savedCount+1:Le.count=Le.count+1,ue.set(je,Le)}}te.sort(Mr);for(const M of re.values())M.sort(zr)}const le=[...re.entries()].filter(M=>{const[ge]=M;return!te.some(je=>je.resolveType===ge)}).flatMap(Kr).sort(Fr);let N;e[33]!==m?(N=(M,ge)=>At(M.name,m.length).localeCompare(At(ge.name,m.length)),e[33]=m,e[34]=N):N=e[34];const J=[...ue.entries()].map(Rr).sort(N);let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=M=>{f(M.savedKey!==void 0?{mode:"saved",key:M.savedKey}:{mode:"available",resolveType:M.resolveType,title:M.title})},e[35]=Z):Z=e[35];const oe=Z;let S;e[36]!==k||e[37]!==K||e[38]!==d?(S=async(M,ge)=>{await k.mutateAsync({blockKey:M,data:ge}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:K,blockId:M})),f({mode:"saved",key:M})},e[36]=k,e[37]=K,e[38]=d,e[39]=S):S=e[39];const se=S;let H;e[40]!==c||e[41]!==u?(H=Hr(u,c),e[40]=c,e[41]=u,e[42]=H):H=e[42];const ie=H;if(ie){const M=`${ie.mode}:${ie.mode==="saved"?ie.blockKey:ie.resolveType}`;let ge;e[43]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>f(null),e[43]=ge):ge=e[43];let je;e[44]!==a||e[45]!==c||e[46]!==se||e[47]!==r||e[48]!==i||e[49]!==s||e[50]!==l||e[51]!==k.isPending||e[52]!==O||e[53]!==M||e[54]!==ie.editorTarget||e[55]!==ie.initialValue||e[56]!==o?(je=n.jsx(ua,{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r,target:ie.editorTarget,initialValue:ie.initialValue,isCreating:k.isPending,onCreate:se,onSaveReferencedBlock:O,onBack:ge},M),e[44]=a,e[45]=c,e[46]=se,e[47]=r,e[48]=i,e[49]=s,e[50]=l,e[51]=k.isPending,e[52]=O,e[53]=M,e[54]=ie.editorTarget,e[55]=ie.initialValue,e[56]=o,e[57]=je):je=e[57],I=je;break e}W="flex h-full w-full min-w-0 flex-col";let ve;e[58]!==d?(ve=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=ve):ve=e[59];let pe;e[60]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>h([]),e[60]=pe):pe=e[60];const ke=m.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==ke?(he=be("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ke),e[61]=ke,e[62]=he):he=e[62];const we=$r[r];let Pe;e[63]!==he||e[64]!==we?(Pe=n.jsx("button",{type:"button",onClick:pe,className:he,children:we}),e[63]=he,e[64]=we,e[65]=Pe):Pe=e[65];let Te;e[66]!==m?(Te=m.map((M,ge)=>{const je=ge===m.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.jsx(Tt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>h(m.slice(0,ge+1)),className:be("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",je?"font-medium text-foreground":"text-muted-foreground"),children:At(M,ge)})]},`${M}-${ge}`)}),e[66]=m,e[67]=Te):Te=e[67];let Ne;e[68]!==ve||e[69]!==Pe||e[70]!==Te?(Ne=n.jsxs("nav",{"aria-label":ve,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[Pe,Te]}),e[68]=ve,e[69]=Pe,e[70]=Te,e[71]=Ne):Ne=e[71];let Be;e[72]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Be):Be=e[72];let De;e[73]===Symbol.for("react.memo_cache_sentinel")?(De=M=>x(M.target.value),e[73]=De):De=e[73];let xe;e[74]!==r||e[75]!==d?(xe=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:r}),e[74]=r,e[75]=d,e[76]=xe):xe=e[76];let $e;e[77]!==r||e[78]!==d?($e=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:r}),e[77]=r,e[78]=d,e[79]=$e):$e=e[79];let Fe;e[80]!==g||e[81]!==xe||e[82]!==$e?(Fe=n.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Be,n.jsx("input",{type:"text",value:g,onChange:De,placeholder:xe,"aria-label":$e,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=g,e[81]=xe,e[82]=$e,e[83]=Fe):Fe=e[83],e[84]!==Ne||e[85]!==Fe?(A=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Ne,Fe]}),e[84]=Ne,e[85]=Fe,e[86]=A):A=e[86],_=Yt,z="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",R="mx-auto w-full max-w-4xl px-6 py-5",G=de?ne.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:r,query:g.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):n.jsx("div",{className:"flex flex-col gap-1",children:ne.map(M=>n.jsx(Ue,{icon:F,accent:M.savedKey!==void 0?"global":void 0,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey??M.resolveType))}):J.length===0&&te.length===0&&le.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:r}),description:m.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):n.jsxs(n.Fragment,{children:[J.length>0&&n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:J.map(M=>{const ge=Or(M.name,m.length);return n.jsxs("button",{type:"button",onClick:()=>h([...m,M.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[n.jsx(ge,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:At(M.name,m.length)}),n.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[M.count," ",M.count===1?K:r,M.savedCount>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:M.savedCount})]})]})]})]},M.name)})}),(te.length>0||le.length>0)&&n.jsxs("div",{className:be("flex flex-col gap-1",J.length>0&&"mt-4"),children:[te.map(M=>{const ge=re.get(M.resolveType)??[],je=y.has(M.resolveType);return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(Ue,{icon:F,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)}),ge.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>E(M.resolveType),"aria-expanded":je,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Ps},children:[je?n.jsx(ft,{size:12,className:"shrink-0"}):n.jsx(Tt,{size:12,className:"shrink-0"}),d(je?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",ge.length,")"]}),je&&n.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:ge.map(Le=>n.jsx(Ue,{icon:F,accent:"global",title:Le.title,subtitle:Le.resolveType,active:!1,onClick:()=>oe(Le)},Le.savedKey))})]})]},M.resolveType)}),le.map(M=>n.jsx(Ue,{icon:F,accent:"global",title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=c,e[13]=r,e[14]=i,e[15]=y,e[16]=s,e[17]=m,e[18]=l,e[19]=k,e[20]=O,e[21]=g,e[22]=u,e[23]=K,e[24]=d,e[25]=o,e[26]=_,e[27]=A,e[28]=I,e[29]=R,e[30]=G,e[31]=z,e[32]=W}else _=e[26],A=e[27],I=e[28],R=e[29],G=e[30],z=e[31],W=e[32];if(I!==Symbol.for("react.early_return_sentinel"))return I;let T;e[87]!==R||e[88]!==G?(T=n.jsx("div",{className:R,children:G}),e[87]=R,e[88]=G,e[89]=T):T=e[89];let U;e[90]!==_||e[91]!==T||e[92]!==z?(U=n.jsx(_,{className:z,children:T}),e[90]=_,e[91]=T,e[92]=z,e[93]=U):U=e[93];let Y;return e[94]!==A||e[95]!==U||e[96]!==W?(Y=n.jsxs("div",{className:W,children:[A,U]}),e[94]=A,e[95]=U,e[96]=W,e[97]=Y):Y=e[97],Y}function Rr(t){const[e,s]=t;return{name:e,...s}}function Fr(t,e){return t.title.localeCompare(e.title)}function Kr(t){const[,e]=t;return e}function zr(t,e){return t.title.localeCompare(e.title)}function Mr(t,e){return t.title.localeCompare(e.title)}function Vr(t){return{resolveType:t.resolveType,title:t.title,folderPath:In(t.resolveType)}}function Gr(t){return{resolveType:t.resolveType,title:t.title,folderPath:In(t.resolveType),savedKey:t.key}}function Ur(){return new Set}function Hr(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:s,props:o,title:a}=ma(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:o}}function qr(t){const e=ae.c(106),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,resolveType:r,title:d,defaultBlockId:p,isCreating:m,onCreate:h,onSaveReferencedBlock:u}=t,f=Se(),g=Bt(),x=g?.virtualMcpId,v=Hn(x===o?o:null)?.metadata?.siteSlug??null;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={},e[0]=j):j=e[0];const[w,C]=$.useState(j);let E;e[1]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[1]=E):E=e[1];const[B,k]=$.useState(E),[D,O]=$.useState(0),[L,K]=$.useState(!1);let F;e[2]!==i||e[3]!==r?(F=Ns(r,i),e[2]=i,e[3]=r,e[4]=F):F=e[4];const _=F;let A,I,R,G,z,W,T,U;if(e[5]!==v||e[6]!==a||e[7]!==c||e[8]!==B||e[9]!==w||e[10]!==m||e[11]!==h||e[12]!==s||e[13]!==l||e[14]!==r||e[15]!==f||e[16]!==g?.taskId||e[17]!==d||e[18]!==o){const te=r.split("/").pop()?.replace(/\.tsx?$/,"")??r,re=g?.taskId??null,le=l??void 0;let N;e[27]!==v||e[28]!==a||e[29]!==s||e[30]!==le||e[31]!==re||e[32]!==o?(N={orgSlug:s,virtualMcpId:o,branch:a,threadId:re,previewUrl:le,siteSlug:v},e[27]=v,e[28]=a,e[29]=s,e[30]=le,e[31]=re,e[32]=o,e[33]=N):N=e[33],I=N;let J,Z,oe,S;if(e[34]!==c||e[35]!==B||e[36]!==w||e[37]!==h||e[38]!==f||e[39]!==d){const Pe=[d,...B],Te=Be=>{k(B.slice(0,Be)),O(Jr)};let Ne;e[48]!==c||e[49]!==w||e[50]!==h?(Ne=async Be=>{const De=xa(Be,c);if(De){me.error(De);return}await h(Be,w),K(!1)},e[48]=c,e[49]=w,e[50]=h,e[51]=Ne):Ne=e[51],A=Ne,U="flex h-full w-full min-w-0",T="flex min-w-0 flex-1 flex-col",z="shrink-0 border-b px-3 py-2.5",S="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(J=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=J):J=e[53],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",oe=Pe.map((Be,De)=>{const xe=De===Pe.length-1,$e=ha(Be);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[De>0&&n.jsx(Tt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Te(De),title:$e,className:be("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",xe?"font-medium text-foreground":"text-muted-foreground"),children:$e})]},`${$e}-${De}`)}),e[34]=c,e[35]=B,e[36]=w,e[37]=h,e[38]=f,e[39]=d,e[40]=A,e[41]=J,e[42]=Z,e[43]=oe,e[44]=S,e[45]=z,e[46]=T,e[47]=U}else A=e[40],J=e[41],Z=e[42],oe=e[43],S=e[44],z=e[45],T=e[46],U=e[47];let se;e[54]!==J||e[55]!==Z||e[56]!==oe?(se=n.jsx("nav",{"aria-label":J,className:Z,children:oe}),e[54]=J,e[55]=Z,e[56]=oe,e[57]=se):se=e[57];let H;e[58]===Symbol.for("react.memo_cache_sentinel")?(H=()=>K(!0),e[58]=H):H=e[58];let ie;e[59]!==f?(ie=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=ie):ie=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Jo,{size:14}),e[61]=ve):ve=e[61];let pe;e[62]!==m||e[63]!==ie?(pe=n.jsx(We,{asChild:!0,children:n.jsx(_e,{size:"icon",className:"size-8 shrink-0",disabled:m,onClick:H,"aria-label":ie,children:ve})}),e[62]=m,e[63]=ie,e[64]=pe):pe=e[64];let ke;e[65]!==f?(ke=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=ke):ke=e[66];let he;e[67]!==ke?(he=n.jsx(Ye,{side:"bottom",children:ke}),e[67]=ke,e[68]=he):he=e[68];let we;e[69]!==pe||e[70]!==he?(we=n.jsxs(Qe,{children:[pe,he]}),e[69]=pe,e[70]=he,e[71]=we):we=e[71],e[72]!==S||e[73]!==se||e[74]!==we?(W=n.jsxs("div",{className:S,children:[se,we]}),e[72]=S,e[73]=se,e[74]=we,e[75]=W):W=e[75],R="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",G=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:te}),e[5]=v,e[6]=a,e[7]=c,e[8]=B,e[9]=w,e[10]=m,e[11]=h,e[12]=s,e[13]=l,e[14]=r,e[15]=f,e[16]=g?.taskId,e[17]=d,e[18]=o,e[19]=A,e[20]=I,e[21]=R,e[22]=G,e[23]=z,e[24]=W,e[25]=T,e[26]=U}else A=e[19],I=e[20],R=e[21],G=e[22],z=e[23],W=e[24],T=e[25],U=e[26];let Y;e[76]!==R||e[77]!==G?(Y=n.jsx("p",{className:R,children:G}),e[76]=R,e[77]=G,e[78]=Y):Y=e[78];let q;e[79]!==Y||e[80]!==z||e[81]!==W?(q=n.jsxs("div",{className:z,children:[W,Y]}),e[79]=Y,e[80]=z,e[81]=W,e[82]=q):q=e[82];let X;e[83]!==c||e[84]!==B||e[85]!==D||e[86]!==w||e[87]!==i||e[88]!==u||e[89]!==I||e[90]!==_||e[91]!==f?(X=n.jsx(Yt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:_?n.jsx(Fn,{schema:_,value:w,onChange:te=>C(te),basePath:"",breadcrumbPath:B,onBreadcrumbChange:k,meta:i,decofile:c,onSaveReferencedBlock:u,sandbox:I},D):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=B,e[85]=D,e[86]=w,e[87]=i,e[88]=u,e[89]=I,e[90]=_,e[91]=f,e[92]=X):X=e[92];let de;e[93]!==q||e[94]!==X||e[95]!==T?(de=n.jsxs("div",{className:T,children:[q,X]}),e[93]=q,e[94]=X,e[95]=T,e[96]=de):de=e[96];let ne;e[97]!==p||e[98]!==A||e[99]!==m||e[100]!==L?(ne=n.jsx(ga,{open:L,onOpenChange:K,defaultBlockId:p,isPending:m,onSubmit:A}),e[97]=p,e[98]=A,e[99]=m,e[100]=L,e[101]=ne):ne=e[101];let ue;return e[102]!==de||e[103]!==ne||e[104]!==U?(ue=n.jsxs("div",{className:U,children:[de,ne]}),e[102]=de,e[103]=ne,e[104]=U,e[105]=ue):ue=e[105],ue}function Jr(t){return t+1}function Wr(t,e){const s={__resolveType:t},o=va([s],e)[0];return o?ja(s,o,e):null}function Yr({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:c}){const r=Se(),d=Bt(),p=d?.virtualMcpId,h=Hn(p===e?e:null)?.metadata?.siteSlug??null,[u]=$.useState(()=>Wr(i,l)),[f,g]=$.useState(u?.data??{}),[x,y]=$.useState([]),[v,j]=$.useState(0),[w,C]=$.useState(!1),[E,B]=$.useState(null),k=E!==null,{save:D,flush:O}=ba({orgSlug:t,virtualMcpId:e,branch:s}),L=u?.resolveType?Ns(u.resolveType,a):null,K=l[i],F=K?Oa(i,K):i,_=d?.taskId??null,A={orgSlug:t,virtualMcpId:e,branch:s,threadId:_,previewUrl:o??void 0,siteSlug:h},I=T=>{g(T),D(i,T)},R=()=>{k?(B(null),C(!1),j(T=>T+1)):B(JSON.stringify(f,null,2))},G=T=>{const U=T??"";try{const Y=JSON.parse(U);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){C(!1),I(Y);return}C(!0)}catch{C(!0)}},z=[F,...x],W=T=>{y(x.slice(0,T)),j(U=>U+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx(ya,{crumbs:z,onSelect:W}),n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ps},"aria-hidden":!0}),n.jsx("div",{className:"flex-1"}),n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx(_e,{variant:k?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:R,"aria-label":r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":k,children:k?n.jsx(Bs,{size:14}):n.jsx(Bn,{size:14})})}),n.jsx(Ye,{side:"bottom",children:r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:r("sandbox.savedSectionEditor.globalSectionDescription")})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Yt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:L?n.jsx(Fn,{schema:L,value:f,onChange:T=>I(T),basePath:"",breadcrumbPath:x,onBreadcrumbChange:y,meta:a,decofile:l,onSaveReferencedBlock:c,sandbox:A},v):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.savedSectionEditor.noEditableFields")})})})}),E!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[w&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:r("sandbox.savedSectionEditor.invalidJsonError")}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(Un,{language:"json",height:"100%",code:E,onChange:G,onSave:T=>{G(T),O()}})})]})]})]})})}function Qr(t){const e=ae.c(36),{selection:s,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,isCreating:d,onCreateAvailable:p,onSaveReferencedBlock:m}=t,h=Se();if(!s){let g;e[0]!==h?(g=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=g):g=e[1];let x;e[2]!==h?(x=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=x):x=e[3];let y;return e[4]!==g||e[5]!==x?(y=n.jsx(tt,{title:g,description:x}),e[4]=g,e[5]=x,e[6]=y):y=e[6],y}if(s.collection==="available-section"){const g=`available:${s.resolveType}`,x=s.resolveType,y=s.title;let v;e[7]!==s.title?(v=ka(s.title),e[7]=s.title,e[8]=v):v=e[8];let j;e[9]!==p||e[10]!==s.resolveType?(j=(C,E)=>p(s.resolveType,C,E),e[9]=p,e[10]=s.resolveType,e[11]=j):j=e[11];let w;return e[12]!==l||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==m||e[17]!==o||e[18]!==i||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==g||e[22]!==v||e[23]!==j||e[24]!==a?(w=n.jsx(qr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,resolveType:x,title:y,defaultBlockId:v,isCreating:d,onCreate:j,onSaveReferencedBlock:m},g),e[12]=l,e[13]=r,e[14]=d,e[15]=c,e[16]=m,e[17]=o,e[18]=i,e[19]=s.resolveType,e[20]=s.title,e[21]=g,e[22]=v,e[23]=j,e[24]=a,e[25]=w):w=e[25],w}const u=`saved:${s.key}`;let f;return e[26]!==l||e[27]!==r||e[28]!==c||e[29]!==m||e[30]!==o||e[31]!==i||e[32]!==s.key||e[33]!==u||e[34]!==a?(f=n.jsx(Yr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,blockKey:s.key,onSaveReferencedBlock:m},u),e[26]=l,e[27]=r,e[28]=c,e[29]=m,e[30]=o,e[31]=i,e[32]=s.key,e[33]=u,e[34]=a,e[35]=f):f=e[35],f}function $t(t){const e=ae.c(34),{onDuplicate:s,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:c}=t,r=Se();let d;e[0]!==r?(d=r("sandbox.itemActions.moreActions"),e[0]=r,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Do,{size:14}),e[2]=p):p=e[2];let m;e[3]!==d?(m=n.jsx(It,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Xr,children:p})}),e[3]=d,e[4]=m):m=e[4];let h;e[5]!==o||e[6]!==r?(h=o&&n.jsxs(Je,{onClick:o,children:[n.jsx(rl,{size:14}),r("sandbox.itemActions.rename")]}),e[5]=o,e[6]=r,e[7]=h):h=e[7];let u;e[8]!==s||e[9]!==r?(u=s&&n.jsxs(Je,{onClick:s,children:[n.jsx(il,{size:14}),r("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=r,e[10]=u):u=e[10];let f;e[11]!==a||e[12]!==r?(f=a&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{}),n.jsxs(Je,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[n.jsx(Tn,{size:14}),r("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=r,e[13]=f):f=e[13];let g;e[14]!==l||e[15]!==i||e[16]!==r?(g=(l||i)&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{}),l&&n.jsxs(Je,{onClick:l,children:[n.jsx(Cn,{size:14}),r("sandbox.itemActions.editSeo")]}),i&&n.jsxs(Je,{onClick:i,children:[n.jsx(Bn,{size:14}),r("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=r,e[17]=g):g=e[17];let x;e[18]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ds,{}),e[18]=x):x=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ts,{size:14}),e[19]=y):y=e[19];let v;e[20]!==r?(v=r("sandbox.itemActions.delete"),e[20]=r,e[21]=v):v=e[21];let j;e[22]!==c||e[23]!==v?(j=n.jsxs(Je,{onClick:c,className:"text-destructive focus:text-destructive",children:[y,v]}),e[22]=c,e[23]=v,e[24]=j):j=e[24];let w;e[25]!==j||e[26]!==h||e[27]!==u||e[28]!==f||e[29]!==g?(w=n.jsxs(Rt,{align:"end",className:"w-44",children:[h,u,f,g,x,j]}),e[25]=j,e[26]=h,e[27]=u,e[28]=f,e[29]=g,e[30]=w):w=e[30];let C;return e[31]!==w||e[32]!==m?(C=n.jsxs(Ft,{children:[m,w]}),e[31]=w,e[32]=m,e[33]=C):C=e[33],C}function Xr(t){return t.stopPropagation()}function Zr(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function ec(t){const e=new Map;for(const s of t){const o=Zr(s.resolveType),a=e.get(o);a?a.push(s):e.set(o,[s])}return[...e.entries()].map(([s,o])=>({label:s,sections:o})).sort((s,o)=>s.label.localeCompare(o.label))}function bn(t){const e=ae.c(8),{icon:s,label:o,className:a}=t;let l;e[0]!==a?(l=be("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==s?(i=n.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==l||e[6]!==i?(c=n.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=c):c=e[7],c}const yn=$.lazy(()=>He(()=>import("./app-editor-OxAoUr_m.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(t=>({default:t.AppEditor}))),tc=$.lazy(()=>He(()=>import("./post-editor-C1RmWFY5.js"),__vite__mapDeps([171,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,81,172,156,135,76,77,55,106,118,113,111,61,60,58,62,63,64,65,66,67,68,69,70,71,72,23,73,74,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,21,22,108,109,110,57,112,114,115,116,117,119,120,121,122,123,173,139,59,174,175,176,124,125,126,127,128,129,130,131,132,133,134,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(t=>({default:t.PostEditor}))),sc=$.lazy(()=>He(()=>import("./record-editor-BG6JZBAo.js"),__vite__mapDeps([177,1,2,56,81,22,23,24,25,111,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,108,109,110,57,112,113,114,115,116,117,118,119,120,121,122,123,176,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(t=>({default:t.RecordEditor}))),nc=$.lazy(()=>He(()=>import("./context-CHxPejUn.js"),__vite__mapDeps([178,1,2,25,28,29,30,31,32,33,34,35,36,37,24,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,81,111,106,18,179,102,96,55,103,98,70,71,4,5,6,7,8,9,72,23,139,174,112,69,74,76,77,180,143,140,61,60,11,12,13,14,15,3,10,16,17,19,20,58,62,63,64,65,66,67,68,73,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,99,100,101,104,105,107,21,22,108,109,110,57,113,114,115,116,117,118,119,120,121,122,123,168,176,177,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,141,142,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,169,170,181,173,59,175])).then(t=>({default:t.BlogContext}))),oc=$.lazy(()=>He(()=>import("./category-editor-BX5BNfiN.js"),__vite__mapDeps([181,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,33,35,45,28,29,30,31,32,34,36,37,24,25,27,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,115,56,81,173,112,76,77,55,106,61,60,58,62,63,64,65,66,67,68,69,70,71,72,23,73,74,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,21,22,108,109,110,111,57,113,114,116,117,118,119,120,121,122,123,139,59,174,175,176,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(t=>({default:t.CategoryEditor}))),ac=$.lazy(()=>He(()=>import("./sections-editor-DQXGqVXO.js"),__vite__mapDeps([182,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,57,61,60,58,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,23,73,74,75,76,77,78,79,80,56,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,22,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,168,183,26,59,184])).then(t=>({default:t.SectionsEditor}))),lc=$.lazy(()=>He(()=>import("./seo-editor-BI6yz1SI.js"),__vite__mapDeps([185,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,21,22,23,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,56,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,57,112,113,114,115,116,117,118,119,120,121,122,123,183])).then(t=>({default:t.SeoEditor}))),ic=$.lazy(()=>He(()=>import("./variant-calendar-Dfcw4asd.js"),__vite__mapDeps([186,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,81,21,22,23,113,72,187,124,125,126,5,4,6,7,8,9,11,12,13,14,15,100,127,94,98,128,3,10,16,17,18,19,20,96,55,129,87,71,101,102,103,56,70,130,73,74,75,76,77,78,79,80,82,83,84,85,86,88,89,90,91,131,60,68,67,69,64,65,118,132,122,97,133,134,135,136,106,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,111,152,153,154,155,156,157,158,159,160,63,66,92,93,95,99,104,105,161,116,62,162,163,164,121,119,165,166,167,115,61,58,107,108,109,110,57,112,114,117,120,123,168,169,170])).then(t=>({default:t.VariantCalendar}))),rc=$.lazy(()=>He(()=>import("./post-calendar-DVsOpmKX.js"),__vite__mapDeps([188,1,2,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,189,21,22,23,124,125,126,5,4,6,7,8,9,11,12,13,14,15,100,127,94,98,128,3,10,16,17,18,19,20,96,72,55,129,87,71,101,102,103,81,56,70,130,73,74,75,76,77,78,79,80,82,83,84,85,86,88,89,90,91,131,60,68,67,69,64,65,118,132,122,97,133,134,135,136,106,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,111,152,153,154,155,156,157,158,159,160,63,66,92,93,95,99,104,105,161,116,62,162,163,164,121,119,165,166,167,115,61,58,107,108,109,110,57,112,113,114,117,120,123,168,169,170])).then(t=>({default:t.PostCalendar}))),cc=$.lazy(()=>He(()=>import("./redirect-editor-BSixOpkn.js"),__vite__mapDeps([190,1,2,135,24,56,81,22,23,25,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,108,109,110,111,57,112,113,114,115,116,117,118,119,120,121,122,123,176])).then(t=>({default:t.RedirectEditor})));function dc(t){const e=ae.c(20),{deepLinkPage:s}=t,{currentBranch:o,virtualMcpId:a}=Sn(),{org:l}=Ao(),i=Ja(),c=Wa(),{runtime:r,previewServerUrl:d}=Gn(a),p=r==="cms";let m;e[0]!==p||e[1]!==c.previewState||e[2]!==i.lifecycle.phase?(m=Bl({fastPreviewActive:p,previewState:c.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=p,e[1]=c.previewState,e[2]=i.lifecycle.phase,e[3]=m):m=e[3];const h=m;if(h.kind==="sandbox-card"){const g=`/${l.slug}/settings/connections`;let x;return e[4]!==h.state||e[5]!==c.start||e[6]!==g||e[7]!==i.lifecycle||e[8]!==i.phase?(x=n.jsx(Pl,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:c.start,connectionsHref:g}),e[4]=h.state,e[5]=c.start,e[6]=g,e[7]=i.lifecycle,e[8]=i.phase,e[9]=x):x=e[9],x}if(!a||!o){let g;return e[10]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(tt,{title:"Waiting for sandbox context…"}),e[10]=g):g=e[10],g}const u=p?d:c.previewUrl;let f;return e[11]!==o||e[12]!==s||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==c.previewUrl||e[16]!==l.slug||e[17]!==u||e[18]!==a?(f=n.jsx(mc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:c.previewUrl,sitePreviewUrl:u,deepLinkPage:s,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=s,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=c.previewUrl,e[16]=l.slug,e[17]=u,e[18]=a,e[19]=f):f=e[19],f}const vn=2e3,uc=15;function jn(t,e,s,o){return typeof e!="string"||s&&(qn(e,s,o)||t.state.dataUpdateCount>=uc)?!1:vn}function mc({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:c}){const r=Se(),d=Bt()?.taskId??null,p={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:o},{data:m,isLoading:h}=Sa(p,{fetchEnabled:i}),u=kn({strict:!1}),[f,g]=$.useState(()=>u.contentCollection&&ot(u.contentCollection)&&u.contentCollection||"pages"),[x,y]=$.useState(()=>u.contentItem&&ot(f)?{collection:f,key:u.contentItem}:null),[v,j]=$.useState(null),w=!!(l?.pageId||l?.path||l?.pathTemplate),[C,E]=$.useState(!1);if(w&&!C&&x===null&&m){E(!0);const b=Ia(Gs(m),l??{});b&&(g("pages"),y({collection:"pages",key:b.key,path:b.path}))}const[B,k]=$.useState(""),[D,O]=$.useState("board"),L=b=>{y(b),j(null)},[K,F]=$.useState(f);K!==f&&(F(f),k(""));const{data:_,isLoading:A,isFetching:I}=wa(p,{fetchEnabled:i,refetchInterval:b=>{const V=b.state.data;if(f==="apps"&&x&&x.collection==="apps"){const ce=m?.[x.key];return jn(b,typeof ce?.__resolveType=="string"?ce.__resolveType:void 0,V)}if(f==="site"&&m){const ce=V?Us(m,V):null,fe=m.site,Ae=ce?.resolveType??(typeof fe?.__resolveType=="string"?fe.__resolveType:void 0);return jn(b,Ae,V,["seo"])}return!1}}),R=(b,V)=>!qn(b,_,V)&&(A||I),{catalog:G,isLoading:z}=Sl(_??void 0,m??void 0,{enabled:f==="apps"}),W=zi({orgSlug:t,virtualMcpId:e,branch:s,meta:_}),T=Qt(p),U=Mn(p),Y=Gi({orgSlug:t,virtualMcpId:e,branch:s,decofile:m??{},support:W,onMoved:(b,V)=>y(ce=>ce?.collection==="posts"&&ce.key===b?{collection:"posts",key:V}:ce)}),[q,X]=$.useState(null),[de,ne]=$.useState(),[ue,te]=$.useState(!1),[re,le]=$.useState(),[N,J]=$.useState(null),[Z,oe]=$.useState(null),[S,se]=$.useState(null),H=!m||!_;if(h||A||H&&c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(lt,{className:"size-5 text-muted-foreground"})});if(H)return n.jsx(tt,{title:"Could not load site data."});const ie=Gs(m).sort((b,V)=>b.name.localeCompare(V.name)),ve=Ra(m).sort((b,V)=>b.from.localeCompare(V.from)),pe=Fa(m,_),ke=f==="sections"?Ka(_):[],he=Us(m,_),we=Xn(m),Pe=Es.some(b=>we[b].length>0),Te=ot(f)?we[f]:[],Ne=Ms(_,"loaders"),Be=Ms(_,"actions");if(!za(m,_)&&!Pe&&Ne===0&&Be===0)return n.jsx(tt,{icon:Wt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const De={pages:ie.length,sections:pe.length,apps:G.length,loaders:Ne,actions:Be,redirects:ve.length,posts:we.posts.length,authors:we.authors.length,categories:we.categories.length},xe=new Set(ie.map(b=>Lt(b.path))),$e=new Set(ie.map(b=>b.name)),Fe=new Set(pe.map(b=>b.name)),M=async b=>{const V=m[b.key];if(!V)return;const ce=Kn(m,b.key),fe=Na(m,b.key,Math.max(0,ce-1)),Ae=Ca(V.sections,fe);if(Ae)try{await T.mutateAsync({blockKey:b.key,data:{...V,sections:Ae}}),me.success(`Variant added to "${b.name}"`),y({collection:"pages",key:b.key,path:b.path})}catch(Oe){me.error(Oe instanceof Error?Oe.message:"Could not add variant")}},ge=()=>{ne(void 0),X({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},je=b=>{ne(void 0),X({mode:"duplicate",sourceKey:b.key,initialName:Ws($e,b.name),initialPath:El(xe,b.path)})},Le=b=>{ne(void 0),X({mode:"rename",sourceKey:b.key,initialName:b.name,initialPath:b.path})},ss=async b=>{if(!q)return;const{mode:V,sourceKey:ce}=q;try{if(V==="create"){let fe;if(b.templateKey){const Oe=m[b.templateKey];if(!Oe)throw new Error("Selected template no longer exists.");fe={...Oe,name:b.name,path:b.path}}else fe=Al(b.name,b.path);const Ae=Ll(m,b.name);await T.mutateAsync({blockKey:Ae,data:fe}),me.success(`Created "${b.name}"`),y({collection:"pages",key:Ae,path:b.path})}else if(V==="duplicate"&&ce){const fe=m[ce];if(!fe)throw new Error("Source page not found");const{key:Ae,data:Oe}=Dl({source:fe,pages:ie,newName:b.name,newPath:b.path});await T.mutateAsync({blockKey:Ae,data:Oe}),me.success(`Duplicated as "${b.name}"`),y({collection:"pages",key:Ae,path:b.path})}else if(V==="rename"&&ce){const fe=m[ce];if(!fe)throw new Error("Page not found");const Ae={...fe,name:b.name,path:b.path};await T.mutateAsync({blockKey:ce,data:Ae}),me.success("Page updated"),x?.collection==="pages"&&x.key===ce&&y({collection:"pages",key:ce,path:b.path})}X(null)}catch(fe){ne(fe instanceof Error?fe.message:"Save failed")}},ns=({path:b})=>{if(!q)return null;const V=Lt(b);return(q.mode==="rename"?Lt(q.initialPath):null)!==V&&xe.has(V)?`A page with path "${b}" already exists.`:null},os=async(b,V,ce)=>{await T.mutateAsync({blockKey:V,data:{...ce,name:V,__resolveType:b}}),me.success(r("sandbox.contentBrowser.createdSection",{name:V})),y({collection:"sections",key:V})},as=Rn((b,V)=>T.mutate({blockKey:b,data:V})),ls=async b=>{const V=m[b.key];if(!V){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}const ce=_l(m,b.key),fe=Ws(Fe,b.name),Ae={...V,name:fe};try{await T.mutateAsync({blockKey:ce,data:Ae}),me.success(r("sandbox.contentBrowser.duplicatedSection",{name:b.name})),y({collection:"sections",key:ce})}catch(Oe){me.error(Oe instanceof Error?Oe.message:r("sandbox.contentBrowser.duplicateFailed"))}},is=async b=>{if(!N)return;const V=m[N];if(!V){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}try{await T.mutateAsync({blockKey:N,data:{...V,name:b}}),me.success(r("sandbox.contentBrowser.sectionRenamed")),J(null)}catch(ce){me.error(ce instanceof Error?ce.message:r("sandbox.contentBrowser.renameFailed"))}},_t=()=>{le(void 0),te(!0)},rs=async b=>{const V=Ma(m,b.from),ce=Va(b);try{await T.mutateAsync({blockKey:V,data:ce}),me.success("Created redirect"),te(!1),y({collection:"redirects",key:V})}catch(fe){le(fe instanceof Error?fe.message:"Could not create redirect")}},cs=async b=>{const V=hs(m,b),ce=at(V,b,ao(b));try{await T.mutateAsync({blockKey:V,data:ce}),me.success(`Created ${Nt[b]}`),y({collection:b,key:V})}catch(fe){me.error(fe instanceof Error?fe.message:"Could not create")}},P=async b=>{const V=hs(m,"posts"),ce=at(V,"posts",Ni(b));try{await T.mutateAsync({blockKey:V,data:ce}),me.success(r("sandbox.postCalendar.createdScheduledPost")),g("posts"),F("posts"),y({collection:"posts",key:V}),j(null)}catch(fe){me.error(fe instanceof Error?fe.message:r("sandbox.postCalendar.couldNotCreate"))}},Q=async(b,V)=>{const ce=m[b],fe=ce?Pi(dt(ce,"posts"),V):null;if(!fe){me.error(r("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await T.mutateAsync({blockKey:b,data:at(b,"posts",fe)})}catch(Ae){me.error(Ae instanceof Error?Ae.message:r("sandbox.postCalendar.couldNotReschedule"))}},Ee=async b=>{const V=m[b.key];if(!V){me.error("Record not found.");return}const ce=hs(m,b.kind),fe=b.kind==="posts"?"title":"name",Ae={...structuredClone(dt(V,b.kind)),[fe]:`${b.label} (copy)`};try{await T.mutateAsync({blockKey:ce,data:at(ce,b.kind,Ae)}),me.success(`Duplicated "${b.label}"`),y({collection:b.kind,key:ce})}catch(Oe){me.error(Oe instanceof Error?Oe.message:"Duplicate failed")}},Ve=()=>{g("posts"),F("posts"),y(null),j(null),k("")},qe=async()=>{if(Z)try{const{kind:b,key:V,label:ce}=Z;if(b==="blog"){if(Z.blogKind==="categories"){const fe=dt(m[V],"categories").slug,Ae=typeof fe=="string"?fe:"";if(Ae)for(const{key:Oe,payload:Is}of Ge(m,"posts")){const Rs=si(Is,Ae);Rs!==Is&&await T.mutateAsync({blockKey:Oe,data:at(Oe,"posts",ni(Rs))})}}await U.mutateAsync({blockKey:V})}else await U.mutateAsync({blockKey:V});me.success(`Deleted "${ce}"`),x&&x.collection!=="available-section"&&x.key===V&&y(null),oe(null)}catch(b){me.error(b instanceof Error?b.message:"Delete failed")}},Ce=U.isPending||T.isPending,gt=Z?.kind==="blog"?Nt[Z.blogKind]:Z?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(Nl,{active:f,counts:De,showBlog:Pe,onSelect:b=>{g(b),y(null),j(null)}}),f!=="seo"&&f!=="site"&&f!=="context"&&f!=="calendar"&&f!=="post-schedule"&&f!=="posts"&&f!=="loaders"&&f!=="actions"&&n.jsx(fc,{activeCollection:f,pages:ie,redirects:ve,sections:pe,availableSections:ke,appCatalog:G,appCatalogLoading:z,blogEntries:Te,decofile:m,searchQuery:B,onSearchChange:k,selection:x,onSelect:L,onCreate:()=>{f==="pages"?ge():f==="redirects"?_t():ot(f)&&cs(f)},onDuplicatePage:je,onRenamePage:Le,onAddPageVariant:M,onDeletePage:b=>oe({kind:"page",key:b.key,label:b.name}),onEditPageSeo:b=>{const V={collection:"pages",key:b.key,path:b.path};y(V),j(b.key)},onViewPageJson:b=>se(b.key),onDuplicateSection:ls,onRenameSection:b=>J(b.key),onDeleteSection:b=>oe({kind:"section",key:b.key,label:b.name}),onDeleteRedirect:b=>oe({kind:"redirect",key:b.key,label:b.from||b.key}),onDuplicateBlog:Ee,onDeleteBlog:b=>oe({kind:"blog",blogKind:b.kind,key:b.key,label:b.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?n.jsx(Ir,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,kind:f}):n.jsx($.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(lt,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?n.jsx(ic,{decofile:m}):f==="post-schedule"?n.jsx(rc,{decofile:m,support:W,isCreating:T.isPending,onCreate:b=>{P(b)},onReschedule:(b,V)=>{Q(b,V)},onSelect:b=>{g("posts"),F("posts"),y({collection:"posts",key:b}),j(null)}}):f==="site"?he?n.jsx(yn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:he.key,block:m[he.key],decofile:m,meta:_,title:"Site",excludeFields:["seo"],schemaPending:R(he.resolveType,["seo"]),previewBaseUrl:o},`site:${he.key}`):n.jsx(tt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="context"?n.jsx(ml,{title:r("sandbox.blogContext.soonTitle"),description:r("sandbox.blogContext.soonDescription"),children:n.jsx(nc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,onOpenPost:b=>{g("posts"),F("posts"),y({collection:"posts",key:b}),j(null)},onManageCategoryPosts:()=>{g("posts"),F("posts"),y(null),j(null)}})}):f==="seo"?n.jsx(lc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,target:{kind:"site"},previewBaseUrl:a}):f==="sections"?n.jsx(Qr,{selection:x?.collection==="sections"||x?.collection==="available-section"?x:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,isCreating:T.isPending,onCreateAvailable:os,onSaveReferencedBlock:as}):f==="posts"?n.jsx(Pr,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,view:D,selectedKey:x?.collection==="posts"?x.key:null,onViewChange:b=>{O(b),y(null)},onClose:()=>y(null),onOpen:b=>{y({collection:"posts",key:b}),j(null)},move:Y,support:W,meta:_,renderDetail:(b,V)=>n.jsx(tc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b,block:m[b],decofile:m,meta:_,previewBaseUrl:a,move:Y,onClose:V?.onClose,expanded:V?.expanded,onToggleExpand:V?.onToggleExpand},`post:${Ct(b)}`)}):x&&x.collection!=="available-section"?x.collection==="apps"?n.jsx(yn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:x.key,block:m[x.key],decofile:m,meta:_,previewBaseUrl:o,schemaPending:R(typeof m[x.key]?.__resolveType=="string"?String(m[x.key].__resolveType):void 0)},`app:${x.key}`):x.collection==="categories"?n.jsx(oc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:x.key,block:m[x.key],decofile:m,meta:_,onManagePosts:()=>Ve(),onOpenPost:b=>{g("posts"),F("posts"),y({collection:"posts",key:b}),j(null)},previewBaseUrl:a},`category:${x.key}`):x.collection==="authors"?n.jsx(sc,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:x.key,block:m[x.key]},`authors:${x.key}`):x.collection==="redirects"?n.jsx(cc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:x.key,block:m[x.key]},`redirect:${x.key}`):n.jsx(ac,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:o??void 0,currentPath:x.collection==="pages"?x.path:"/",activePageBlockKey:x.collection==="pages"?x.key:null,activeGlobalBlockKey:x.collection==="sections"?x.key:null,initialEditSeo:x.collection==="pages"&&v===x.key,onExitSeo:()=>j(null),onSelectRoot:()=>{y(null),j(null)}},x.collection==="pages"?`page:${x.key}`:`section:${x.key}`):n.jsx(tt,{title:`Select ${ot(f)?`a ${Nt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),q&&n.jsx(Fl,{open:!!q,mode:q.mode,initialName:q.initialName,initialPath:q.initialPath,isPending:T.isPending,error:de,templates:ie,validate:ns,onSubmit:ss,onOpenChange:b=>{b||(X(null),ne(void 0))}}),n.jsx(zl,{open:ue,isPending:T.isPending,error:re,onSubmit:rs,onOpenChange:b=>{b||(te(!1),le(void 0))}}),N&&n.jsx(Ml,{open:!!N,blockKey:N,initialName:pe.find(b=>b.key===N)?.name??N,isPending:T.isPending,onSubmit:is,onOpenChange:b=>{b||J(null)}}),S&&n.jsx(Ga,{open:!!S,onOpenChange:b=>{b||se(null)},pageKey:S,decofile:m,onSave:b=>T.mutateAsync({blockKey:S,data:b})}),n.jsx(Yo,{open:!!Z,onOpenChange:b=>{!b&&!Ce&&oe(null)},children:n.jsxs(Qo,{children:[n.jsxs(Xo,{children:[n.jsx(Zo,{children:`Delete ${gt}?`}),n.jsx(ea,{children:Z?.kind==="section"?`"${Z.label}" will be removed. Pages that still reference it will lose this section.`:Z?`"${Z.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs(ta,{children:[n.jsx(sa,{disabled:Ce,children:"Cancel"}),n.jsx(na,{onClick:b=>{b.preventDefault(),qe()},disabled:Ce,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ce?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function fc(t){const e=ae.c(57),{activeCollection:s,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:c,appCatalogLoading:r,blogEntries:d,decofile:p,searchQuery:m,onSearchChange:h,selection:u,onSelect:f,onCreate:g,onDuplicatePage:x,onRenamePage:y,onAddPageVariant:v,onDeletePage:j,onEditPageSeo:w,onViewPageJson:C,onDuplicateSection:E,onRenameSection:B,onDeleteSection:k,onDeleteRedirect:D,onDuplicateBlog:O,onDeleteBlog:L}=t;let K,F,_,A,I,R;if(e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==d||e[5]!==p||e[6]!==v||e[7]!==g||e[8]!==L||e[9]!==j||e[10]!==D||e[11]!==k||e[12]!==O||e[13]!==x||e[14]!==E||e[15]!==w||e[16]!==y||e[17]!==B||e[18]!==h||e[19]!==f||e[20]!==C||e[21]!==o||e[22]!==a||e[23]!==m||e[24]!==l||e[25]!==u){const T=m.toLowerCase(),U=o.filter(S=>!T||S.name.toLowerCase().includes(T)||S.path.toLowerCase().includes(T)),Y=a.filter(S=>!T||S.from.toLowerCase().includes(T)||S.to.toLowerCase().includes(T)),q=l.filter(S=>!T||S.name.toLowerCase().includes(T)||S.key.toLowerCase().includes(T)||S.resolveType.toLowerCase().includes(T)),X=i.filter(S=>!T||S.title.toLowerCase().includes(T)||S.resolveType.toLowerCase().includes(T)||(S.description?.toLowerCase().includes(T)??!1)),de=ec(q),ne=c.filter(S=>!T||S.title.toLowerCase().includes(T)||S.app.toLowerCase().includes(T)||S.vendor.toLowerCase().includes(T)||S.category.toLowerCase().includes(T)),ue=d.filter(S=>!T||S.label.toLowerCase().includes(T)||S.subtitle.toLowerCase().includes(T)),te=`Search ${s}…`,re=ot(s)?`Create new ${Nt[s]}`:s==="redirects"?"Create new redirect":"Create new page",le=s!=="apps"&&s!=="sections";I="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[32]=N):N=e[32];let J;e[33]!==h?(J=S=>h(S.target.value),e[33]=h,e[34]=J):J=e[34];let Z;e[35]!==te||e[36]!==m||e[37]!==J?(Z=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[N,n.jsx("input",{type:"text",value:m,onChange:J,placeholder:te,"aria-label":te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[35]=te,e[36]=m,e[37]=J,e[38]=Z):Z=e[38];let oe;e[39]!==re||e[40]!==g||e[41]!==le?(oe=le&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx(_e,{variant:"ghost",size:"icon",onClick:g,"aria-label":re,children:n.jsx(ws,{size:14})})}),n.jsx(Ye,{side:"bottom",children:re})]}),e[39]=re,e[40]=g,e[41]=le,e[42]=oe):oe=e[42],e[43]!==Z||e[44]!==oe?(R=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Z,oe]}),e[43]=Z,e[44]=oe,e[45]=R):R=e[45],K=Yt,A="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",F="flex flex-col gap-1 p-1.5",_=s==="pages"?U.length===0?n.jsx(yt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(S=>{const se=u?.collection==="pages"&&u.key===S.key,H=Kn(p,S.key);return n.jsx(Ue,{icon:En,title:S.name,subtitle:S.path,active:se,variantCount:H,onClick:()=>f({collection:"pages",key:S.key,path:S.path}),menu:n.jsx($t,{onDuplicate:()=>x(S),onRename:()=>y(S),onAddVariant:()=>v(S),onEditSeo:()=>w(S),onViewJson:()=>C(S),onDelete:()=>j(S)})},S.key)}):s==="sections"?q.length===0&&X.length===0?n.jsx(yt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[de.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(bn,{icon:Kt,label:"Saved sections"}),de.map(S=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:S.label}),S.sections.map(se=>{const H=u?.collection==="sections"&&u.key===se.key;return n.jsx(Ue,{icon:Kt,accent:"global",title:se.name,subtitle:S.label,active:H,onClick:()=>f({collection:"sections",key:se.key}),menu:n.jsx($t,{onDuplicate:()=>E(se),onRename:()=>B(se),onDelete:()=>k(se)})},se.key)})]},S.label))]}),X.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(bn,{icon:zs,label:"Available sections",className:be(de.length>0&&"mt-3")}),X.map(S=>{const se=u?.collection==="available-section"&&u.resolveType===S.resolveType,H=S.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(Ue,{icon:zs,title:S.title,subtitle:H??S.resolveType,active:se,onClick:()=>f({collection:"available-section",resolveType:S.resolveType,title:S.title})},S.resolveType)})]})]}):s==="apps"?r?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(lt,{className:"size-4.5 text-muted-foreground"})}):ne.length===0?n.jsx(yt,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ne.map(S=>{const se=u?.collection==="apps"&&S.blockKey!==null&&u.key===S.blockKey;return n.jsx(Ue,{icon:An,logoUrl:S.logo,title:S.title,subtitle:S.category,active:se,trailing:S.installed?n.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!S.installed||!S.blockKey){me.message(`${S.title} is not installed on this site.`);return}f({collection:"apps",key:S.blockKey})}},S.id)}):s==="redirects"?Y.length===0?n.jsx(yt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):Y.map(S=>n.jsx(Ue,{icon:wn,title:S.from||"(no source)",subtitle:`→ ${S.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===S.key,trailing:n.jsx(Vl,{type:S.type}),onClick:()=>f({collection:"redirects",key:S.key}),menu:n.jsx($t,{onDelete:()=>D(S)})},S.key)):ue.length===0?n.jsx(yt,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${ot(s)?Nt[s]:"item"}.`}):ue.map(S=>{const se=u?.collection===S.kind&&u.key===S.key;return n.jsx(Ue,{icon:S.kind==="posts"?_n:S.kind==="authors"?$n:Nn,title:S.label,subtitle:S.subtitle,active:se,onClick:()=>f({collection:S.kind,key:S.key}),menu:n.jsx($t,{onDuplicate:()=>O(S),onDelete:()=>L(S)})},S.key)}),e[0]=s,e[1]=c,e[2]=r,e[3]=i,e[4]=d,e[5]=p,e[6]=v,e[7]=g,e[8]=L,e[9]=j,e[10]=D,e[11]=k,e[12]=O,e[13]=x,e[14]=E,e[15]=w,e[16]=y,e[17]=B,e[18]=h,e[19]=f,e[20]=C,e[21]=o,e[22]=a,e[23]=m,e[24]=l,e[25]=u,e[26]=K,e[27]=F,e[28]=_,e[29]=A,e[30]=I,e[31]=R}else K=e[26],F=e[27],_=e[28],A=e[29],I=e[30],R=e[31];let G;e[46]!==F||e[47]!==_?(G=n.jsx("div",{className:F,children:_}),e[46]=F,e[47]=_,e[48]=G):G=e[48];let z;e[49]!==K||e[50]!==A||e[51]!==G?(z=n.jsx(K,{className:A,children:G}),e[49]=K,e[50]=A,e[51]=G,e[52]=z):z=e[52];let W;return e[53]!==I||e[54]!==R||e[55]!==z?(W=n.jsxs("div",{className:I,children:[R,z]}),e[53]=I,e[54]=R,e[55]=z,e[56]=W):W=e[56],W}function pc(t){const e=ae.c(25),{virtualMcpId:s}=t,o=Se(),[a,l]=$.useState(!1),i=ll(s),{activeTask:c}=Sn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const d=kn(r);if(!(qs(i?.metadata)||qs(c?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(Js,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let u;e[2]!==o?(u=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=u):u=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let g,x;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=()=>l(!0),x=n.jsx(Js,{className:"size-4"}),e[6]=g,e[7]=x):(g=e[6],x=e[7]);let y;e[8]!==o?(y=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=y):y=e[9];let v;e[10]!==y?(v=n.jsxs(_e,{onClick:g,children:[x,y]}),e[10]=y,e[11]=v):v=e[11];let j;e[12]!==u||e[13]!==f||e[14]!==v?(j=n.jsx(cl,{className:"h-full",image:h,title:u,description:f,actions:v}),e[12]=u,e[13]=f,e[14]=v,e[15]=j):j=e[15];let w;e[16]!==a?(w=n.jsx(dl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=w):w=e[17];let C;return e[18]!==w||e[19]!==j?(C=n.jsxs(n.Fragment,{children:[j,w]}),e[18]=w,e[19]=j,e[20]=C):C=e[20],C}let m;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(m=n.jsx(dc,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=m):m=e[24],m}function hc(){const t=ae.c(2),e=ul();let s;return t[0]!==e?(s=n.jsx($o,{tabId:"content",children:n.jsx(Lo,{feature:"cms",children:n.jsx(pc,{virtualMcpId:e})})}),t[0]=e,t[1]=s):s=t[1],s}const Dd=Object.freeze(Object.defineProperty({__proto__:null,default:hc},Symbol.toStringTag,{value:"Module"}));export{vo as $,Cd as A,As as B,xd as C,pd as D,Nd as E,Td as F,Xn as G,uo as H,Ui as I,en as J,yi as K,fd as L,hs as M,ao as N,ud as O,Ds as P,bd as Q,Pd as R,yd as S,Bd as T,jd as U,mt as V,kd as W,vd as X,gd as Y,Sd as Z,Ut as _,dd as a,Dd as a0,ts as b,ni as c,wd as d,cd as e,Ge as f,dt as g,qt as h,Ed as i,ci as j,_d as k,to as l,_s as m,_l as n,lo as o,Et as p,at as q,pl as r,ye as s,mo as t,zi as u,Ke as v,xi as w,md as x,hd as y,Me as z};
9
+ `)||void 0,count:O}),Ce=yi(re.map(b=>b.title),qe.themes);if(Ce.length===0){me.info(u("sandbox.postBoard.ideasFailed"));return}let gt=0;for(const b of Ce){const V=fi();try{await g.mutateAsync({blockKey:V,data:pi(V,{title:b.title,body:b.body,pillarKey:P?.key,createdAt:new Date().toISOString()})}),gt++}catch(ce){console.warn("[posts] could not save a generated idea",ce)}}if(gt===0){me.error(u("sandbox.postBoard.ideasFailed"));return}me.success(u("sandbox.postBoard.ideasAdded",{count:String(gt)}))}catch(Q){me.error(Q instanceof Error?Q.message:u("sandbox.postBoard.ideasFailed"))}finally{C(!1)}};return n.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[n.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[n.jsx(gn,{active:a==="board",onClick:()=>i("board"),icon:n.jsx(Vo,{size:14}),label:u("sandbox.postBoard.viewBoard")}),n.jsx(gn,{active:a==="list",onClick:()=>i("list"),icon:n.jsx(Wo,{size:14}),label:u("sandbox.postBoard.viewList")})]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[w&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[n.jsx(wt,{size:12,className:"animate-spin"}),u("sandbox.postBoard.generatingLabel")]}),n.jsxs(ct,{open:E,onOpenChange:B,children:[n.jsx(Ya,{asChild:!0,children:n.jsxs(_e,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[n.jsx(et,{size:14}),u("sandbox.postBoard.generateIdeas"),n.jsx(nt,{variant:"secondary",children:u("common.soon")})]})}),n.jsxs(rt,{className:"sm:max-w-lg",children:[n.jsxs(pt,{children:[n.jsx(it,{children:u("sandbox.postBoard.generateIdeas")}),n.jsx(zt,{children:u("sandbox.postBoard.ideaGuidanceLabel")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(Ot,{id:"idea-guidance",value:k,rows:6,autoFocus:!0,onChange:P=>D(P.target.value),placeholder:u("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),le.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(ze,{className:"text-xs",children:u("sandbox.postBoard.ideaPillarLabel")}),n.jsx(kt,{options:le.map(P=>P.title),value:le.find(P=>P.key===K)?.title??"",emptyLabel:u("sandbox.postBoard.ideaNoPillar"),onChange:P=>F(le.find(Q=>Q.title===P)?.key??"")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ze,{htmlFor:"idea-count",className:"text-xs",children:u("sandbox.postBoard.ideaCount")}),n.jsx(Xe,{id:"idea-count",type:"number",min:1,max:8,value:O,onChange:P=>L(Math.max(1,Math.min(8,Number(P.target.value)||1))),className:"h-9 w-16"}),n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:u("sandbox.postBoard.usesCredits")})]})]}),n.jsx(ht,{children:n.jsxs(_e,{type:"button",onClick:()=>{B(!1),cs()},children:[n.jsx(et,{size:14}),u("sandbox.postBoard.generateIdeas")]})})]})]}),n.jsxs(Ft,{children:[n.jsx(It,{asChild:!0,children:n.jsxs(_e,{type:"button",size:"sm",children:[n.jsx(ws,{size:14}),u("sandbox.postBoard.newPost"),n.jsx(ft,{size:14})]})}),n.jsxs(Rt,{align:"end",className:"w-56",children:[n.jsxs(Je,{disabled:!0,onClick:()=>{z(void 0),R(!0)},children:[n.jsx(et,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[u("sandbox.postBoard.newPostGenerate"),n.jsx(nt,{variant:"secondary",children:u("common.soon")})]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostGenerateHint")})]})]}),n.jsxs(Je,{onClick:_t,children:[n.jsx(Go,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.newPostWrite")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.newPostWriteHint")})]})]}),n.jsxs(Je,{onClick:()=>T(!0),children:[n.jsx(fs,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:u("sandbox.postBoard.importContent")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:u("sandbox.postBoard.importContentHint")})]})]})]})]}),n.jsx(Wi,{open:I,onOpenChange:R,decofile:o,hasAi:y,seed:G,onGenerate:P=>{ue(P)}},G?.title??"scratch"),n.jsx(ct,{open:W,onOpenChange:T,children:n.jsxs(rt,{className:"max-h-[85vh] sm:max-w-2xl",children:[n.jsxs(pt,{children:[n.jsx(it,{children:u("sandbox.postBoard.importTitle")}),n.jsx(zt,{children:u("sandbox.postBoard.importDescription")})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:n.jsx(Un,{code:U,language:ko(U)?"html":"markdown",height:"100%",autoFocus:!0,onChange:P=>Y(P??"")})}),n.jsx("input",{ref:q,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async P=>{const Q=P.target.files?.[0];Q&&Y(await Q.text()),P.target.value=""}}),n.jsxs(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>q.current?.click(),children:[n.jsx(fs,{size:14}),u("sandbox.postBoard.importUpload")]})]}),n.jsx(ht,{children:n.jsxs(_e,{type:"button",disabled:!U.trim(),onClick:rs,children:[n.jsx(fs,{size:14}),u("sandbox.postBoard.importRun")]})})]})})]})]}),te.length===0&&re.length===0?n.jsx(ol,{className:"flex-1",icon:n.jsx(et,{size:22}),title:u("sandbox.postBoard.emptyTitle"),description:u("sandbox.postBoard.emptyDescription"),buttonProps:{children:u("sandbox.postBoard.newPost"),onClick:_t}}):a==="board"?n.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[n.jsx(_r,{ideas:re,collapsed:X.includes(hn),pillarTitleOf:N,onToggleCollapsed:()=>ne(hn),onGenerate:as,onDelete:ls}),n.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),Ds.map(P=>{const Q=te.filter(Ce=>Ce.status===P);Cr(P)&&Q.sort(Nr);const Ee=u(qt[P]),Ve=X.includes(P),qe=vo(p,P);return n.jsx("div",{onDragOver:Ce=>{Ce.preventDefault(),j(P)},onDragLeave:()=>j(Ce=>Ce===P?null:Ce),onDrop:Ce=>{Ce.preventDefault(),is(P,Ce.dataTransfer.getData(Co))},title:qe?jo(u,qe):void 0,className:be("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ve?"w-11":"w-72",qe&&"opacity-50",v===P&&"border-primary bg-primary/5"),children:Ve?n.jsxs("button",{type:"button",onClick:()=>ne(P),"aria-label":u("sandbox.postBoard.expandLane",{lane:Ee}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[n.jsx(Tt,{size:14,className:"shrink-0"}),n.jsx("span",{className:"text-xs tabular-nums",children:Q.length}),n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:Ee})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[n.jsxs("button",{type:"button",onClick:()=>ne(P),"aria-label":u("sandbox.postBoard.collapseLane",{lane:Ee}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[n.jsx(ft,{size:14,className:"shrink-0"}),n.jsx("span",{className:"truncate",children:Ee})]}),n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Q.length})]}),n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Q.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:u("sandbox.postBoard.laneEmpty")}):Q.map(Ce=>n.jsx(Er,{post:Ce,payload:J(Ce.key),moving:d.isMoving(Ce.key),onOpen:()=>c(Ce.key),onArchive:Ce.status==="archived"?void 0:()=>{oe(Ce)}},Ce.key))})]})},P)})]}):n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[n.jsx(gr,{value:we,onChange:Pe}),Le?n.jsx(Sr,{count:Te.size,allSelected:je.length>0&&je.every(P=>Te.has(P.key)),onToggleSelectAll:ns,onArchive:()=>{os()},onExit:()=>Ne(new Set)}):n.jsx(br,{categories:Fe,authors:M,statusCounts:Be,categoryFilter:S,authorFilter:H,statusFilter:ve,sort:ke,onCategoryFilterChange:se,onAuthorFilterChange:ie,onStatusFilterChange:pe,onSortChange:he}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(Tr,{posts:je,selectedKey:Z,selectionActive:Le,selectedKeys:Te,onToggleSelect:ss,onOpen:c,isMoving:d.isMoving,onArchive:P=>{oe(P)}})})]}),n.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:Z&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(wt,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(Z)}):n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:u("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&_&&h&&n.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:h(l,{expanded:!0,onToggleExpand:()=>A(!1),onClose:()=>{A(!1),r?.()}})}),n.jsx(ct,{open:a==="board"&&!!l&&!_,onOpenChange:P=>{P||(A(!1),r?.())},children:n.jsxs(rt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[n.jsx(it,{className:"sr-only",children:u("sandbox.collectionsSidebar.posts")}),l&&h?n.jsx($.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(wt,{size:20,className:"animate-spin text-muted-foreground"})}),children:h(l,{expanded:!1,onToggleExpand:()=>A(!0),onClose:()=>r?.()})}):null]})})]})}function gn(t){const e=ae.c(7),{active:s,onClick:o,icon:a,label:l}=t,i=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==i?(c=be("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==c?(r=n.jsxs("button",{type:"button",onClick:o,className:c,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=c,e[6]=r):r=e[6],r}function Tr(t){const e=ae.c(23),{posts:s,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:c,isMoving:r,onArchive:d}=t,p=Se();if(s.length===0){let u;e[0]!==p?(u=p("sandbox.postList.noMatches"),e[0]=p,e[1]=u):u=e[1];let f;return e[2]!==u?(f=n.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=f):f=e[3],f}let m;if(e[4]!==r||e[5]!==d||e[6]!==c||e[7]!==i||e[8]!==s||e[9]!==o||e[10]!==l||e[11]!==a){let u;e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==i||e[17]!==o||e[18]!==l||e[19]!==a?(u=f=>n.jsx(Br,{post:f,selected:f.key===o,selectionActive:a,checked:l.has(f.key),onToggleSelect:()=>i(f.key),moving:r(f.key),onOpen:()=>c(f.key),onArchive:f.status==="archived"?void 0:()=>d(f)},f.key),e[13]=r,e[14]=d,e[15]=c,e[16]=i,e[17]=o,e[18]=l,e[19]=a,e[20]=u):u=e[20],m=s.map(u),e[4]=r,e[5]=d,e[6]=c,e[7]=i,e[8]=s,e[9]=o,e[10]=l,e[11]=a,e[12]=m}else m=e[12];let h;return e[21]!==m?(h=n.jsx("ul",{className:"divide-y",children:m}),e[21]=m,e[22]=h):h=e[22],h}function Br(t){const e=ae.c(56),{post:s,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:c,onOpen:r,onArchive:d}=t,p=Se(),m=s.status==="awaiting_review"&&s.missing.length>0,h=s.status==="scheduled"||s.status==="published",u=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let f;e[0]!==u?(f=be("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=f):f=e[1];let g;e[2]!==i?(g=()=>i(),e[2]=i,e[3]=g):g=e[3];let x;e[4]!==s.title||e[5]!==p?(x=s.title||p("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=p,e[6]=x):x=e[6];let y;e[7]!==l||e[8]!==g||e[9]!==x?(y=n.jsx(Xt,{checked:l,onCheckedChange:g,"aria-label":x}),e[7]=l,e[8]=g,e[9]=x,e[10]=y):y=e[10];let v;e[11]!==f||e[12]!==y?(v=n.jsx("span",{className:f,children:y}),e[11]=f,e[12]=y,e[13]=v):v=e[13];let j;e[14]!==c||e[15]!==d||e[16]!==a?(j=d&&!a&&n.jsx(Os,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=j):j=e[17];let w;e[18]!==r||e[19]!==i||e[20]!==a?(w=()=>a?i():r(),e[18]=r,e[19]=i,e[20]=a,e[21]=w):w=e[21];const C=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let E;e[22]!==C?(E=be("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",C),e[22]=C,e[23]=E):E=e[23];let B;e[24]!==s.title||e[25]!==p?(B=s.title||p("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=p,e[26]=B):B=e[26];let k;e[27]!==B?(k=n.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:B}),e[27]=B,e[28]=k):k=e[28];const D=wr[s.status],O=qt[s.status];let L;e[29]!==p||e[30]!==O?(L=p(O),e[29]=p,e[30]=O,e[31]=L):L=e[31];let K;e[32]!==D||e[33]!==L?(K=n.jsx(nt,{variant:D,className:"shrink-0",children:L}),e[32]=D,e[33]=L,e[34]=K):K=e[34];let F;e[35]!==m||e[36]!==s.missing?(F=m&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Wt,{size:12}),s.missing.length]}),e[35]=m,e[36]=s.missing,e[37]=F):F=e[37];let _;e[38]!==h||e[39]!==s.date||e[40]!==s.scheduledDatetime?(_=h&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[38]=h,e[39]=s.date,e[40]=s.scheduledDatetime,e[41]=_):_=e[41];let A;e[42]!==K||e[43]!==F||e[44]!==_?(A=n.jsxs("div",{className:"flex items-center gap-2",children:[K,F,_]}),e[42]=K,e[43]=F,e[44]=_,e[45]=A):A=e[45];let I;e[46]!==o||e[47]!==E||e[48]!==k||e[49]!==A||e[50]!==w?(I=n.jsxs("button",{type:"button",onClick:w,"aria-current":o,className:E,children:[k,A]}),e[46]=o,e[47]=E,e[48]=k,e[49]=A,e[50]=w,e[51]=I):I=e[51];let R;return e[52]!==I||e[53]!==v||e[54]!==j?(R=n.jsxs("li",{className:"group/row relative",children:[v,j,I]}),e[52]=I,e[53]=v,e[54]=j,e[55]=R):R=e[55],R}function Er(t){const e=ae.c(46),{post:s,payload:o,moving:a,onOpen:l,onArchive:i}=t,c=Se(),r=s.status!=="generating"&&!a;let d;e[0]!==o?(d=Xl(o),e[0]=o,e[1]=d):d=e[1];const p=d,m=!r&&"opacity-80";let h;e[2]!==m?(h=be("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",m),e[2]=m,e[3]=h):h=e[3];let u;e[4]!==a||e[5]!==i?(u=i&&n.jsx(Os,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=u):u=e[6];let f;e[7]!==s.key?(f=O=>O.dataTransfer.setData(Co,s.key),e[7]=s.key,e[8]=f):f=e[8];const g=r?"cursor-grab active:cursor-grabbing":"cursor-pointer";let x;e[9]!==g?(x=be("block w-full p-3 text-left",g),e[9]=g,e[10]=x):x=e[10];let y;e[11]!==s.title||e[12]!==c?(y=s.title||c("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=c,e[13]=y):y=e[13];let v;e[14]!==y?(v=n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:y}),e[14]=y,e[15]=v):v=e[15];let j;e[16]!==p||e[17]!==s.status?(j=s.status==="draft"&&n.jsxs(n.Fragment,{children:[p.pillarTitle&&n.jsx(nt,{variant:"secondary",className:"max-w-full truncate",children:p.pillarTitle}),p.format?.name&&n.jsx(nt,{variant:"outline",className:"max-w-full truncate",children:p.format.name})]}),e[16]=p,e[17]=s.status,e[18]=j):j=e[18];let w;e[19]!==s.status||e[20]!==c?(w=s.status==="generating"&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(wt,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=c,e[21]=w):w=e[21];let C;e[22]!==s.missing||e[23]!==s.status||e[24]!==c?(C=s.status==="awaiting_review"&&(s.missing.length>0?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Wt,{size:12}),c("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[n.jsx(nl,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=c,e[25]=C):C=e[25];let E;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(E=(s.status==="scheduled"||s.status==="published")&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(ks,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=E):E=e[29];let B;e[30]!==j||e[31]!==w||e[32]!==C||e[33]!==E?(B=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[j,w,C,E]}),e[30]=j,e[31]=w,e[32]=C,e[33]=E,e[34]=B):B=e[34];let k;e[35]!==r||e[36]!==l||e[37]!==B||e[38]!==f||e[39]!==x||e[40]!==v?(k=n.jsxs("button",{type:"button",draggable:r,onDragStart:f,onClick:l,className:x,children:[v,B]}),e[35]=r,e[36]=l,e[37]=B,e[38]=f,e[39]=x,e[40]=v,e[41]=k):k=e[41];let D;return e[42]!==k||e[43]!==h||e[44]!==u?(D=n.jsxs("div",{className:h,children:[u,k]}),e[42]=k,e[43]=h,e[44]=u,e[45]=D):D=e[45],D}function _r(t){const e=ae.c(40),{ideas:s,collapsed:o,pillarTitleOf:a,onToggleCollapsed:l,onGenerate:i,onDelete:c}=t,r=Se();let d,p,m,h,u,f,g;if(e[0]!==o||e[1]!==s.length||e[2]!==l||e[3]!==r){g=Symbol.for("react.early_return_sentinel");e:{if(d=r("sandbox.postBoard.ideasTray"),o){let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Tt,{size:14,className:"shrink-0"}),e[11]=k):k=e[11];let D;e[12]!==s.length?(D=n.jsx("span",{className:"text-xs tabular-nums",children:s.length}),e[12]=s.length,e[13]=D):D=e[13],g=n.jsxs("button",{type:"button",onClick:l,"aria-label":r("sandbox.postBoard.expandLane",{lane:d}),"aria-expanded":!1,className:"flex w-11 shrink-0 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[k,D,n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:d})]});break e}f="flex w-72 shrink-0 flex-col",u="flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",p="button",m=l,h=r("sandbox.postBoard.collapseLane",{lane:d})}e[0]=o,e[1]=s.length,e[2]=l,e[3]=r,e[4]=d,e[5]=p,e[6]=m,e[7]=h,e[8]=u,e[9]=f,e[10]=g}else d=e[4],p=e[5],m=e[6],h=e[7],u=e[8],f=e[9],g=e[10];if(g!==Symbol.for("react.early_return_sentinel"))return g;let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ft,{size:14,className:"shrink-0"}),e[14]=x):x=e[14];let y;e[15]!==d?(y=n.jsx("span",{className:"truncate",children:d}),e[15]=d,e[16]=y):y=e[16];let v;e[17]!==p||e[18]!==m||e[19]!==h||e[20]!==y?(v=n.jsxs("button",{type:p,onClick:m,"aria-label":h,"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[x,y]}),e[17]=p,e[18]=m,e[19]=h,e[20]=y,e[21]=v):v=e[21];let j;e[22]!==s.length?(j=n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:s.length}),e[22]=s.length,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==u||e[26]!==v?(w=n.jsxs("div",{className:u,children:[v,j]}),e[24]=j,e[25]=u,e[26]=v,e[27]=w):w=e[27];let C;e[28]!==s||e[29]!==c||e[30]!==i||e[31]!==a||e[32]!==r?(C=s.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.postBoard.ideasEmpty")}):s.map(k=>{const D=a(k.pillarKey);return n.jsxs("div",{className:"group/card relative rounded-lg border border-dashed bg-card shadow-sm transition-colors hover:border-primary/40",children:[n.jsx(Os,{label:r("sandbox.postBoard.deleteIdea"),onArchive:()=>c(k),className:"top-2"}),n.jsxs("div",{className:"p-3",children:[n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:k.title||r("sandbox.postBoard.untitledIdea")}),k.body&&n.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:k.body}),D&&n.jsx(nt,{variant:"secondary",className:"mt-2 max-w-full truncate",children:D})]}),n.jsx("div",{className:"border-t px-3 py-2",children:n.jsxs(_e,{type:"button",variant:"ghost",size:"sm",disabled:!0,className:"h-7 w-full justify-start px-1.5 text-xs",onClick:()=>i(k),children:[n.jsx(et,{size:13}),r("sandbox.postBoard.writeFromIdea"),n.jsx(nt,{variant:"secondary",className:"ml-auto",children:r("common.soon")})]})})]},k.key)}),e[28]=s,e[29]=c,e[30]=i,e[31]=a,e[32]=r,e[33]=C):C=e[33];let E;e[34]!==C?(E=n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto pb-2 pr-1",children:C}),e[34]=C,e[35]=E):E=e[35];let B;return e[36]!==w||e[37]!==E||e[38]!==f?(B=n.jsxs("div",{className:f,children:[w,E]}),e[36]=w,e[37]=E,e[38]=f,e[39]=B):B=e[39],B}function Os(t){const e=ae.c(13),{label:s,onArchive:o,disabled:a,className:l}=t,i=Se();let c;e[0]!==s||e[1]!==i?(c=s??i("sandbox.postBoard.delete"),e[0]=s,e[1]=i,e[2]=c):c=e[2];const r=c;let d;e[3]!==o?(d=u=>{u.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let p;e[5]!==l?(p=be("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[5]=l,e[6]=p):p=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ts,{size:13}),e[7]=m):m=e[7];let h;return e[8]!==a||e[9]!==d||e[10]!==p||e[11]!==r?(h=n.jsx("button",{type:"button",disabled:a,"aria-label":r,title:r,onClick:d,className:p,children:m}),e[8]=a,e[9]=d,e[10]=p,e[11]=r,e[12]=h):h=e[12],h}function Ue(t){const e=ae.c(50),{icon:s,logoUrl:o,title:a,subtitle:l,active:i,accent:c,variantCount:r,trailing:d,selectable:p,selectionActive:m,selected:h,invalid:u,invalidReason:f,onToggleSelect:g,onClick:x,menu:y}=t,v=Se(),j=c==="global";let w;e[0]!==s||e[1]!==i||e[2]!==j||e[3]!==o?(w=o?n.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:be("flex size-8 shrink-0 items-center justify-center rounded-lg",j?"bg-global-section/15":"bg-muted"),children:n.jsx(s,{size:16,className:be("shrink-0",!j&&(i?"text-accent-foreground":"text-muted-foreground")),style:j?{color:Ps}:void 0})}),e[0]=s,e[1]=i,e[2]=j,e[3]=o,e[4]=w):w=e[4];const C=w,E=i?j?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":j?"hover:bg-global-section/10":"hover:bg-muted";let B;e[5]!==E?(B=be("group relative flex min-w-0 items-center rounded-md transition-colors",E),e[5]=E,e[6]=B):B=e[6];let k;e[7]!==g||e[8]!==p||e[9]!==h||e[10]!==m||e[11]!==v||e[12]!==a?(k=p&&n.jsx("span",{className:be("flex shrink-0 items-center pl-2.5 transition-opacity",h||m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Dr,children:n.jsx(Xt,{checked:h,onCheckedChange:()=>g?.(),"aria-label":v("sandbox.itemRow.selectItem",{title:a})})}),e[7]=g,e[8]=p,e[9]=h,e[10]=m,e[11]=v,e[12]=a,e[13]=k):k=e[13];const D=u&&!i&&"text-destructive";let O;e[14]!==D?(O=be("block truncate text-sm font-medium",D),e[14]=D,e[15]=O):O=e[15];let L;e[16]!==O||e[17]!==a?(L=n.jsx("span",{className:O,children:a}),e[16]=O,e[17]=a,e[18]=L):L=e[18];const K=i?"text-accent-foreground/70":"text-muted-foreground";let F;e[19]!==K?(F=be("block truncate text-xs",K),e[19]=K,e[20]=F):F=e[20];let _;e[21]!==l||e[22]!==F?(_=n.jsx("span",{className:F,children:l}),e[21]=l,e[22]=F,e[23]=_):_=e[23];let A;e[24]!==_||e[25]!==L?(A=n.jsxs("span",{className:"min-w-0 flex-1",children:[L,_]}),e[24]=_,e[25]=L,e[26]=A):A=e[26];let I;e[27]!==i||e[28]!==v||e[29]!==r?(I=r!==void 0&&r>1&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsxs("span",{className:be("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[n.jsx(Tn,{size:14}),r]})}),n.jsx(Ye,{side:"bottom",children:v("sandbox.itemRow.variantCount",{count:r})})]}),e[27]=i,e[28]=v,e[29]=r,e[30]=I):I=e[30];let R;e[31]!==i||e[32]!==u||e[33]!==f?(R=u&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx("span",{className:be("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:n.jsx(Wt,{size:14})})}),f&&n.jsx(Ye,{side:"bottom",children:f})]}),e[31]=i,e[32]=u,e[33]=f,e[34]=R):R=e[34];let G;e[35]!==x||e[36]!==C||e[37]!==A||e[38]!==I||e[39]!==R||e[40]!==d?(G=n.jsxs("button",{type:"button",onClick:x,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[C,A,I,R,d]}),e[35]=x,e[36]=C,e[37]=A,e[38]=I,e[39]=R,e[40]=d,e[41]=G):G=e[41];let z;e[42]!==i||e[43]!==y?(z=y&&n.jsx("div",{className:be("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:y}),e[42]=i,e[43]=y,e[44]=z):z=e[44];let W;return e[45]!==G||e[46]!==z||e[47]!==B||e[48]!==k?(W=n.jsxs("div",{className:B,children:[k,G,z]}),e[45]=G,e[46]=z,e[47]=B,e[48]=k,e[49]=W):W=e[49],W}function Dr(t){return t.stopPropagation()}function tt(t){const e=ae.c(10),{icon:s,title:o,description:a}=t;let l;e[0]!==s?(l=s&&n.jsx(s,{size:24,className:"text-muted-foreground/60"}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==o?(i=n.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==l||e[7]!==i||e[8]!==c?(r=n.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,c]}),e[6]=l,e[7]=i,e[8]=c,e[9]=r):r=e[9],r}const Ar={loaders:Pn,actions:Dn},$r={loaders:"Loaders",actions:"Actions"},Lr={analytics:qo,blog:Vn,commerce:Ho,site:Uo,website:Kt};function Or(t,e){return e===0?Lr[t.toLowerCase()]??Ks:Ks}function At(t,e){return e===0?fa(t):t}function Ir(t){const e=ae.c(98),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r}=t,d=Se();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[0]=p):p=e[0];const[m,h]=$.useState(p),[u,f]=$.useState(null),[g,x]=$.useState(""),[y,v]=$.useState(Ur),[j,w]=$.useState(r);j!==r&&(w(r),h([]),f(null),x(""),v(new Set));let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=q=>{v(X=>{const de=new Set(X);return de.has(q)?de.delete(q):de.add(q),de})},e[1]=C):C=e[1];const E=C;let B;e[2]!==a||e[3]!==s||e[4]!==o?(B={orgSlug:s,virtualMcpId:o,branch:a},e[2]=a,e[3]=s,e[4]=o,e[5]=B):B=e[5];const k=Qt(B);let D;e[6]!==k?(D=Rn((q,X)=>k.mutate({blockKey:q,data:X})),e[6]=k,e[7]=D):D=e[7];const O=D;let L;e[8]!==r?(L=pa(r),e[8]=r,e[9]=L):L=e[9];const K=L,F=Ar[r];let _,A,I,R,G,z,W;if(e[10]!==F||e[11]!==a||e[12]!==c||e[13]!==r||e[14]!==i||e[15]!==y||e[16]!==s||e[17]!==m||e[18]!==l||e[19]!==k||e[20]!==O||e[21]!==g||e[22]!==u||e[23]!==K||e[24]!==d||e[25]!==o){I=Symbol.for("react.early_return_sentinel");e:{const q=[...ca(i,c,r).map(Gr),...da(i,r).map(Vr)],X=g.trim().toLowerCase(),de=X.length>0,ne=de?q.filter(M=>M.title.toLowerCase().includes(X)||M.resolveType.toLowerCase().includes(X)):[],ue=new Map,te=[],re=new Map;if(!de){for(const M of q){const ge=M.folderPath;if(!(ge.length<m.length)&&m.every((je,Le)=>ge[Le]===je))if(ge.length===m.length)if(M.savedKey!==void 0){const je=re.get(M.resolveType);je?je.push(M):re.set(M.resolveType,[M])}else te.push(M);else{const je=ge[m.length],Le=ue.get(je)??{count:0,savedCount:0};M.savedKey!==void 0?Le.savedCount=Le.savedCount+1:Le.count=Le.count+1,ue.set(je,Le)}}te.sort(Mr);for(const M of re.values())M.sort(zr)}const le=[...re.entries()].filter(M=>{const[ge]=M;return!te.some(je=>je.resolveType===ge)}).flatMap(Kr).sort(Fr);let N;e[33]!==m?(N=(M,ge)=>At(M.name,m.length).localeCompare(At(ge.name,m.length)),e[33]=m,e[34]=N):N=e[34];const J=[...ue.entries()].map(Rr).sort(N);let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=M=>{f(M.savedKey!==void 0?{mode:"saved",key:M.savedKey}:{mode:"available",resolveType:M.resolveType,title:M.title})},e[35]=Z):Z=e[35];const oe=Z;let S;e[36]!==k||e[37]!==K||e[38]!==d?(S=async(M,ge)=>{await k.mutateAsync({blockKey:M,data:ge}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:K,blockId:M})),f({mode:"saved",key:M})},e[36]=k,e[37]=K,e[38]=d,e[39]=S):S=e[39];const se=S;let H;e[40]!==c||e[41]!==u?(H=Hr(u,c),e[40]=c,e[41]=u,e[42]=H):H=e[42];const ie=H;if(ie){const M=`${ie.mode}:${ie.mode==="saved"?ie.blockKey:ie.resolveType}`;let ge;e[43]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>f(null),e[43]=ge):ge=e[43];let je;e[44]!==a||e[45]!==c||e[46]!==se||e[47]!==r||e[48]!==i||e[49]!==s||e[50]!==l||e[51]!==k.isPending||e[52]!==O||e[53]!==M||e[54]!==ie.editorTarget||e[55]!==ie.initialValue||e[56]!==o?(je=n.jsx(ua,{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r,target:ie.editorTarget,initialValue:ie.initialValue,isCreating:k.isPending,onCreate:se,onSaveReferencedBlock:O,onBack:ge},M),e[44]=a,e[45]=c,e[46]=se,e[47]=r,e[48]=i,e[49]=s,e[50]=l,e[51]=k.isPending,e[52]=O,e[53]=M,e[54]=ie.editorTarget,e[55]=ie.initialValue,e[56]=o,e[57]=je):je=e[57],I=je;break e}W="flex h-full w-full min-w-0 flex-col";let ve;e[58]!==d?(ve=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=ve):ve=e[59];let pe;e[60]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>h([]),e[60]=pe):pe=e[60];const ke=m.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==ke?(he=be("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ke),e[61]=ke,e[62]=he):he=e[62];const we=$r[r];let Pe;e[63]!==he||e[64]!==we?(Pe=n.jsx("button",{type:"button",onClick:pe,className:he,children:we}),e[63]=he,e[64]=we,e[65]=Pe):Pe=e[65];let Te;e[66]!==m?(Te=m.map((M,ge)=>{const je=ge===m.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.jsx(Tt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>h(m.slice(0,ge+1)),className:be("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",je?"font-medium text-foreground":"text-muted-foreground"),children:At(M,ge)})]},`${M}-${ge}`)}),e[66]=m,e[67]=Te):Te=e[67];let Ne;e[68]!==ve||e[69]!==Pe||e[70]!==Te?(Ne=n.jsxs("nav",{"aria-label":ve,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[Pe,Te]}),e[68]=ve,e[69]=Pe,e[70]=Te,e[71]=Ne):Ne=e[71];let Be;e[72]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Be):Be=e[72];let De;e[73]===Symbol.for("react.memo_cache_sentinel")?(De=M=>x(M.target.value),e[73]=De):De=e[73];let xe;e[74]!==r||e[75]!==d?(xe=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:r}),e[74]=r,e[75]=d,e[76]=xe):xe=e[76];let $e;e[77]!==r||e[78]!==d?($e=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:r}),e[77]=r,e[78]=d,e[79]=$e):$e=e[79];let Fe;e[80]!==g||e[81]!==xe||e[82]!==$e?(Fe=n.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Be,n.jsx("input",{type:"text",value:g,onChange:De,placeholder:xe,"aria-label":$e,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=g,e[81]=xe,e[82]=$e,e[83]=Fe):Fe=e[83],e[84]!==Ne||e[85]!==Fe?(A=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Ne,Fe]}),e[84]=Ne,e[85]=Fe,e[86]=A):A=e[86],_=Yt,z="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",R="mx-auto w-full max-w-4xl px-6 py-5",G=de?ne.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:r,query:g.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):n.jsx("div",{className:"flex flex-col gap-1",children:ne.map(M=>n.jsx(Ue,{icon:F,accent:M.savedKey!==void 0?"global":void 0,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey??M.resolveType))}):J.length===0&&te.length===0&&le.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:r}),description:m.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):n.jsxs(n.Fragment,{children:[J.length>0&&n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:J.map(M=>{const ge=Or(M.name,m.length);return n.jsxs("button",{type:"button",onClick:()=>h([...m,M.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[n.jsx(ge,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:At(M.name,m.length)}),n.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[M.count," ",M.count===1?K:r,M.savedCount>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:M.savedCount})]})]})]})]},M.name)})}),(te.length>0||le.length>0)&&n.jsxs("div",{className:be("flex flex-col gap-1",J.length>0&&"mt-4"),children:[te.map(M=>{const ge=re.get(M.resolveType)??[],je=y.has(M.resolveType);return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(Ue,{icon:F,title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)}),ge.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>E(M.resolveType),"aria-expanded":je,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Ps},children:[je?n.jsx(ft,{size:12,className:"shrink-0"}):n.jsx(Tt,{size:12,className:"shrink-0"}),d(je?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",ge.length,")"]}),je&&n.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:ge.map(Le=>n.jsx(Ue,{icon:F,accent:"global",title:Le.title,subtitle:Le.resolveType,active:!1,onClick:()=>oe(Le)},Le.savedKey))})]})]},M.resolveType)}),le.map(M=>n.jsx(Ue,{icon:F,accent:"global",title:M.title,subtitle:M.resolveType,active:!1,onClick:()=>oe(M)},M.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=c,e[13]=r,e[14]=i,e[15]=y,e[16]=s,e[17]=m,e[18]=l,e[19]=k,e[20]=O,e[21]=g,e[22]=u,e[23]=K,e[24]=d,e[25]=o,e[26]=_,e[27]=A,e[28]=I,e[29]=R,e[30]=G,e[31]=z,e[32]=W}else _=e[26],A=e[27],I=e[28],R=e[29],G=e[30],z=e[31],W=e[32];if(I!==Symbol.for("react.early_return_sentinel"))return I;let T;e[87]!==R||e[88]!==G?(T=n.jsx("div",{className:R,children:G}),e[87]=R,e[88]=G,e[89]=T):T=e[89];let U;e[90]!==_||e[91]!==T||e[92]!==z?(U=n.jsx(_,{className:z,children:T}),e[90]=_,e[91]=T,e[92]=z,e[93]=U):U=e[93];let Y;return e[94]!==A||e[95]!==U||e[96]!==W?(Y=n.jsxs("div",{className:W,children:[A,U]}),e[94]=A,e[95]=U,e[96]=W,e[97]=Y):Y=e[97],Y}function Rr(t){const[e,s]=t;return{name:e,...s}}function Fr(t,e){return t.title.localeCompare(e.title)}function Kr(t){const[,e]=t;return e}function zr(t,e){return t.title.localeCompare(e.title)}function Mr(t,e){return t.title.localeCompare(e.title)}function Vr(t){return{resolveType:t.resolveType,title:t.title,folderPath:In(t.resolveType)}}function Gr(t){return{resolveType:t.resolveType,title:t.title,folderPath:In(t.resolveType),savedKey:t.key}}function Ur(){return new Set}function Hr(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:s,props:o,title:a}=ma(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:o}}function qr(t){const e=ae.c(106),{orgSlug:s,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,resolveType:r,title:d,defaultBlockId:p,isCreating:m,onCreate:h,onSaveReferencedBlock:u}=t,f=Se(),g=Bt(),x=g?.virtualMcpId,v=Hn(x===o?o:null)?.metadata?.siteSlug??null;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={},e[0]=j):j=e[0];const[w,C]=$.useState(j);let E;e[1]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[1]=E):E=e[1];const[B,k]=$.useState(E),[D,O]=$.useState(0),[L,K]=$.useState(!1);let F;e[2]!==i||e[3]!==r?(F=Ns(r,i),e[2]=i,e[3]=r,e[4]=F):F=e[4];const _=F;let A,I,R,G,z,W,T,U;if(e[5]!==v||e[6]!==a||e[7]!==c||e[8]!==B||e[9]!==w||e[10]!==m||e[11]!==h||e[12]!==s||e[13]!==l||e[14]!==r||e[15]!==f||e[16]!==g?.taskId||e[17]!==d||e[18]!==o){const te=r.split("/").pop()?.replace(/\.tsx?$/,"")??r,re=g?.taskId??null,le=l??void 0;let N;e[27]!==v||e[28]!==a||e[29]!==s||e[30]!==le||e[31]!==re||e[32]!==o?(N={orgSlug:s,virtualMcpId:o,branch:a,threadId:re,previewUrl:le,siteSlug:v},e[27]=v,e[28]=a,e[29]=s,e[30]=le,e[31]=re,e[32]=o,e[33]=N):N=e[33],I=N;let J,Z,oe,S;if(e[34]!==c||e[35]!==B||e[36]!==w||e[37]!==h||e[38]!==f||e[39]!==d){const Pe=[d,...B],Te=Be=>{k(B.slice(0,Be)),O(Jr)};let Ne;e[48]!==c||e[49]!==w||e[50]!==h?(Ne=async Be=>{const De=xa(Be,c);if(De){me.error(De);return}await h(Be,w),K(!1)},e[48]=c,e[49]=w,e[50]=h,e[51]=Ne):Ne=e[51],A=Ne,U="flex h-full w-full min-w-0",T="flex min-w-0 flex-1 flex-col",z="shrink-0 border-b px-3 py-2.5",S="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(J=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=J):J=e[53],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",oe=Pe.map((Be,De)=>{const xe=De===Pe.length-1,$e=ha(Be);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[De>0&&n.jsx(Tt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Te(De),title:$e,className:be("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",xe?"font-medium text-foreground":"text-muted-foreground"),children:$e})]},`${$e}-${De}`)}),e[34]=c,e[35]=B,e[36]=w,e[37]=h,e[38]=f,e[39]=d,e[40]=A,e[41]=J,e[42]=Z,e[43]=oe,e[44]=S,e[45]=z,e[46]=T,e[47]=U}else A=e[40],J=e[41],Z=e[42],oe=e[43],S=e[44],z=e[45],T=e[46],U=e[47];let se;e[54]!==J||e[55]!==Z||e[56]!==oe?(se=n.jsx("nav",{"aria-label":J,className:Z,children:oe}),e[54]=J,e[55]=Z,e[56]=oe,e[57]=se):se=e[57];let H;e[58]===Symbol.for("react.memo_cache_sentinel")?(H=()=>K(!0),e[58]=H):H=e[58];let ie;e[59]!==f?(ie=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=ie):ie=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Jo,{size:14}),e[61]=ve):ve=e[61];let pe;e[62]!==m||e[63]!==ie?(pe=n.jsx(We,{asChild:!0,children:n.jsx(_e,{size:"icon",className:"size-8 shrink-0",disabled:m,onClick:H,"aria-label":ie,children:ve})}),e[62]=m,e[63]=ie,e[64]=pe):pe=e[64];let ke;e[65]!==f?(ke=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=ke):ke=e[66];let he;e[67]!==ke?(he=n.jsx(Ye,{side:"bottom",children:ke}),e[67]=ke,e[68]=he):he=e[68];let we;e[69]!==pe||e[70]!==he?(we=n.jsxs(Qe,{children:[pe,he]}),e[69]=pe,e[70]=he,e[71]=we):we=e[71],e[72]!==S||e[73]!==se||e[74]!==we?(W=n.jsxs("div",{className:S,children:[se,we]}),e[72]=S,e[73]=se,e[74]=we,e[75]=W):W=e[75],R="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",G=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:te}),e[5]=v,e[6]=a,e[7]=c,e[8]=B,e[9]=w,e[10]=m,e[11]=h,e[12]=s,e[13]=l,e[14]=r,e[15]=f,e[16]=g?.taskId,e[17]=d,e[18]=o,e[19]=A,e[20]=I,e[21]=R,e[22]=G,e[23]=z,e[24]=W,e[25]=T,e[26]=U}else A=e[19],I=e[20],R=e[21],G=e[22],z=e[23],W=e[24],T=e[25],U=e[26];let Y;e[76]!==R||e[77]!==G?(Y=n.jsx("p",{className:R,children:G}),e[76]=R,e[77]=G,e[78]=Y):Y=e[78];let q;e[79]!==Y||e[80]!==z||e[81]!==W?(q=n.jsxs("div",{className:z,children:[W,Y]}),e[79]=Y,e[80]=z,e[81]=W,e[82]=q):q=e[82];let X;e[83]!==c||e[84]!==B||e[85]!==D||e[86]!==w||e[87]!==i||e[88]!==u||e[89]!==I||e[90]!==_||e[91]!==f?(X=n.jsx(Yt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:_?n.jsx(Fn,{schema:_,value:w,onChange:te=>C(te),basePath:"",breadcrumbPath:B,onBreadcrumbChange:k,meta:i,decofile:c,onSaveReferencedBlock:u,sandbox:I},D):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=B,e[85]=D,e[86]=w,e[87]=i,e[88]=u,e[89]=I,e[90]=_,e[91]=f,e[92]=X):X=e[92];let de;e[93]!==q||e[94]!==X||e[95]!==T?(de=n.jsxs("div",{className:T,children:[q,X]}),e[93]=q,e[94]=X,e[95]=T,e[96]=de):de=e[96];let ne;e[97]!==p||e[98]!==A||e[99]!==m||e[100]!==L?(ne=n.jsx(ga,{open:L,onOpenChange:K,defaultBlockId:p,isPending:m,onSubmit:A}),e[97]=p,e[98]=A,e[99]=m,e[100]=L,e[101]=ne):ne=e[101];let ue;return e[102]!==de||e[103]!==ne||e[104]!==U?(ue=n.jsxs("div",{className:U,children:[de,ne]}),e[102]=de,e[103]=ne,e[104]=U,e[105]=ue):ue=e[105],ue}function Jr(t){return t+1}function Wr(t,e){const s={__resolveType:t},o=va([s],e)[0];return o?ja(s,o,e):null}function Yr({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:c}){const r=Se(),d=Bt(),p=d?.virtualMcpId,h=Hn(p===e?e:null)?.metadata?.siteSlug??null,[u]=$.useState(()=>Wr(i,l)),[f,g]=$.useState(u?.data??{}),[x,y]=$.useState([]),[v,j]=$.useState(0),[w,C]=$.useState(!1),[E,B]=$.useState(null),k=E!==null,{save:D,flush:O}=ba({orgSlug:t,virtualMcpId:e,branch:s}),L=u?.resolveType?Ns(u.resolveType,a):null,K=l[i],F=K?Oa(i,K):i,_=d?.taskId??null,A={orgSlug:t,virtualMcpId:e,branch:s,threadId:_,previewUrl:o??void 0,siteSlug:h},I=T=>{g(T),D(i,T)},R=()=>{k?(B(null),C(!1),j(T=>T+1)):B(JSON.stringify(f,null,2))},G=T=>{const U=T??"";try{const Y=JSON.parse(U);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){C(!1),I(Y);return}C(!0)}catch{C(!0)}},z=[F,...x],W=T=>{y(x.slice(0,T)),j(U=>U+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx(ya,{crumbs:z,onSelect:W}),n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ps},"aria-hidden":!0}),n.jsx("div",{className:"flex-1"}),n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx(_e,{variant:k?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:R,"aria-label":r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":k,children:k?n.jsx(Bs,{size:14}):n.jsx(Bn,{size:14})})}),n.jsx(Ye,{side:"bottom",children:r(k?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:r("sandbox.savedSectionEditor.globalSectionDescription")})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Yt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:L?n.jsx(Fn,{schema:L,value:f,onChange:T=>I(T),basePath:"",breadcrumbPath:x,onBreadcrumbChange:y,meta:a,decofile:l,onSaveReferencedBlock:c,sandbox:A},v):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.savedSectionEditor.noEditableFields")})})})}),E!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[w&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:r("sandbox.savedSectionEditor.invalidJsonError")}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(Un,{language:"json",height:"100%",code:E,onChange:G,onSave:T=>{G(T),O()}})})]})]})]})})}function Qr(t){const e=ae.c(36),{selection:s,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,isCreating:d,onCreateAvailable:p,onSaveReferencedBlock:m}=t,h=Se();if(!s){let g;e[0]!==h?(g=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=g):g=e[1];let x;e[2]!==h?(x=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=x):x=e[3];let y;return e[4]!==g||e[5]!==x?(y=n.jsx(tt,{title:g,description:x}),e[4]=g,e[5]=x,e[6]=y):y=e[6],y}if(s.collection==="available-section"){const g=`available:${s.resolveType}`,x=s.resolveType,y=s.title;let v;e[7]!==s.title?(v=ka(s.title),e[7]=s.title,e[8]=v):v=e[8];let j;e[9]!==p||e[10]!==s.resolveType?(j=(C,E)=>p(s.resolveType,C,E),e[9]=p,e[10]=s.resolveType,e[11]=j):j=e[11];let w;return e[12]!==l||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==m||e[17]!==o||e[18]!==i||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==g||e[22]!==v||e[23]!==j||e[24]!==a?(w=n.jsx(qr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,resolveType:x,title:y,defaultBlockId:v,isCreating:d,onCreate:j,onSaveReferencedBlock:m},g),e[12]=l,e[13]=r,e[14]=d,e[15]=c,e[16]=m,e[17]=o,e[18]=i,e[19]=s.resolveType,e[20]=s.title,e[21]=g,e[22]=v,e[23]=j,e[24]=a,e[25]=w):w=e[25],w}const u=`saved:${s.key}`;let f;return e[26]!==l||e[27]!==r||e[28]!==c||e[29]!==m||e[30]!==o||e[31]!==i||e[32]!==s.key||e[33]!==u||e[34]!==a?(f=n.jsx(Yr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,blockKey:s.key,onSaveReferencedBlock:m},u),e[26]=l,e[27]=r,e[28]=c,e[29]=m,e[30]=o,e[31]=i,e[32]=s.key,e[33]=u,e[34]=a,e[35]=f):f=e[35],f}function $t(t){const e=ae.c(34),{onDuplicate:s,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:c}=t,r=Se();let d;e[0]!==r?(d=r("sandbox.itemActions.moreActions"),e[0]=r,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(Do,{size:14}),e[2]=p):p=e[2];let m;e[3]!==d?(m=n.jsx(It,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Xr,children:p})}),e[3]=d,e[4]=m):m=e[4];let h;e[5]!==o||e[6]!==r?(h=o&&n.jsxs(Je,{onClick:o,children:[n.jsx(rl,{size:14}),r("sandbox.itemActions.rename")]}),e[5]=o,e[6]=r,e[7]=h):h=e[7];let u;e[8]!==s||e[9]!==r?(u=s&&n.jsxs(Je,{onClick:s,children:[n.jsx(il,{size:14}),r("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=r,e[10]=u):u=e[10];let f;e[11]!==a||e[12]!==r?(f=a&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{}),n.jsxs(Je,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[n.jsx(Tn,{size:14}),r("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=r,e[13]=f):f=e[13];let g;e[14]!==l||e[15]!==i||e[16]!==r?(g=(l||i)&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{}),l&&n.jsxs(Je,{onClick:l,children:[n.jsx(Cn,{size:14}),r("sandbox.itemActions.editSeo")]}),i&&n.jsxs(Je,{onClick:i,children:[n.jsx(Bn,{size:14}),r("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=r,e[17]=g):g=e[17];let x;e[18]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ds,{}),e[18]=x):x=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Ts,{size:14}),e[19]=y):y=e[19];let v;e[20]!==r?(v=r("sandbox.itemActions.delete"),e[20]=r,e[21]=v):v=e[21];let j;e[22]!==c||e[23]!==v?(j=n.jsxs(Je,{onClick:c,className:"text-destructive focus:text-destructive",children:[y,v]}),e[22]=c,e[23]=v,e[24]=j):j=e[24];let w;e[25]!==j||e[26]!==h||e[27]!==u||e[28]!==f||e[29]!==g?(w=n.jsxs(Rt,{align:"end",className:"w-44",children:[h,u,f,g,x,j]}),e[25]=j,e[26]=h,e[27]=u,e[28]=f,e[29]=g,e[30]=w):w=e[30];let C;return e[31]!==w||e[32]!==m?(C=n.jsxs(Ft,{children:[m,w]}),e[31]=w,e[32]=m,e[33]=C):C=e[33],C}function Xr(t){return t.stopPropagation()}function Zr(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function ec(t){const e=new Map;for(const s of t){const o=Zr(s.resolveType),a=e.get(o);a?a.push(s):e.set(o,[s])}return[...e.entries()].map(([s,o])=>({label:s,sections:o})).sort((s,o)=>s.label.localeCompare(o.label))}function bn(t){const e=ae.c(8),{icon:s,label:o,className:a}=t;let l;e[0]!==a?(l=be("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==s?(i=n.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==l||e[6]!==i?(c=n.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=c):c=e[7],c}const yn=$.lazy(()=>He(()=>import("./app-editor-R5yzsqfq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.AppEditor}))),tc=$.lazy(()=>He(()=>import("./post-editor-rZtul2Mk.js"),__vite__mapDeps([169,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,81,170,156,135,76,77,55,106,118,113,111,61,60,58,62,63,64,65,66,67,68,69,70,71,72,23,73,74,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,21,22,108,109,110,57,112,114,115,116,117,119,120,121,122,123,124,171,139,59,172,173,174,125,126,127,128,129,130,131,132,133,134,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.PostEditor}))),sc=$.lazy(()=>He(()=>import("./record-editor-Dbd0VnCw.js"),__vite__mapDeps([175,1,2,56,81,22,23,24,25,111,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,108,109,110,57,112,113,114,115,116,117,118,119,120,121,122,123,124,174,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.RecordEditor}))),nc=$.lazy(()=>He(()=>import("./context-Bv0D5-Uj.js"),__vite__mapDeps([176,1,2,25,28,29,30,31,32,33,34,35,36,37,24,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,81,111,106,18,177,102,96,55,103,98,70,71,4,5,6,7,8,9,72,23,139,172,112,69,74,76,77,178,143,140,61,60,11,12,13,14,15,3,10,16,17,19,20,58,62,63,64,65,66,67,68,73,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,99,100,101,104,105,107,21,22,108,109,110,57,113,114,115,116,117,118,119,120,121,122,123,124,166,174,175,125,126,127,128,129,130,131,132,133,134,135,136,137,138,141,142,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,167,168,179,171,59,173])).then(t=>({default:t.BlogContext}))),oc=$.lazy(()=>He(()=>import("./category-editor-C2JizcgQ.js"),__vite__mapDeps([179,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,33,35,45,28,29,30,31,32,34,36,37,24,25,27,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,115,56,81,171,112,76,77,55,106,61,60,58,62,63,64,65,66,67,68,69,70,71,72,23,73,74,75,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,21,22,108,109,110,111,57,113,114,116,117,118,119,120,121,122,123,124,139,59,172,173,174,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168])).then(t=>({default:t.CategoryEditor}))),ac=$.lazy(()=>He(()=>import("./sections-editor-BSc_WwD-.js"),__vite__mapDeps([180,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,57,61,60,58,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,23,73,74,75,76,77,78,79,80,56,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,22,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,166,181,26,59,182])).then(t=>({default:t.SectionsEditor}))),lc=$.lazy(()=>He(()=>import("./seo-editor-CJOT6SSo.js"),__vite__mapDeps([183,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,21,22,23,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,56,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,57,112,113,114,115,116,117,118,119,120,121,122,123,124,181])).then(t=>({default:t.SeoEditor}))),ic=$.lazy(()=>He(()=>import("./variant-calendar-pbRcz2zJ.js"),__vite__mapDeps([184,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,81,21,22,23,113,72,185,125,126,121,119,20,14,13,122,5,4,6,7,8,9,11,12,15,100,127,94,98,128,3,10,16,17,18,19,96,55,129,87,71,101,102,103,56,70,130,73,74,75,76,77,78,79,80,82,83,84,85,86,88,89,90,91,131,60,68,67,69,64,65,118,132,123,97,133,134,135,136,106,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,111,152,153,154,155,156,157,158,159,160,63,66,92,93,95,99,104,105,161,116,62,162,163,164,165,115,61,58,107,108,109,110,57,112,114,117,120,124,166,167,168])).then(t=>({default:t.VariantCalendar}))),rc=$.lazy(()=>He(()=>import("./post-calendar-XHFsJXTd.js"),__vite__mapDeps([186,1,2,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,187,21,22,23,125,126,121,119,20,14,13,122,5,4,6,7,8,9,11,12,15,100,127,94,98,128,3,10,16,17,18,19,96,72,55,129,87,71,101,102,103,81,56,70,130,73,74,75,76,77,78,79,80,82,83,84,85,86,88,89,90,91,131,60,68,67,69,64,65,118,132,123,97,133,134,135,136,106,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,111,152,153,154,155,156,157,158,159,160,63,66,92,93,95,99,104,105,161,116,62,162,163,164,165,115,61,58,107,108,109,110,57,112,113,114,117,120,124,166,167,168])).then(t=>({default:t.PostCalendar}))),cc=$.lazy(()=>He(()=>import("./redirect-editor-CoTmBQAz.js"),__vite__mapDeps([188,1,2,135,24,56,81,22,23,25,61,60,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,58,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,62,63,64,65,66,67,68,69,55,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,21,108,109,110,111,57,112,113,114,115,116,117,118,119,120,121,122,123,124,174])).then(t=>({default:t.RedirectEditor})));function dc(t){const e=ae.c(20),{deepLinkPage:s}=t,{currentBranch:o,virtualMcpId:a}=Sn(),{org:l}=Ao(),i=Ja(),c=Wa(),{runtime:r,previewServerUrl:d}=Gn(a),p=r==="cms";let m;e[0]!==p||e[1]!==c.previewState||e[2]!==i.lifecycle.phase?(m=Bl({fastPreviewActive:p,previewState:c.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=p,e[1]=c.previewState,e[2]=i.lifecycle.phase,e[3]=m):m=e[3];const h=m;if(h.kind==="sandbox-card"){const g=`/${l.slug}/settings/connections`;let x;return e[4]!==h.state||e[5]!==c.start||e[6]!==g||e[7]!==i.lifecycle||e[8]!==i.phase?(x=n.jsx(Pl,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:c.start,connectionsHref:g}),e[4]=h.state,e[5]=c.start,e[6]=g,e[7]=i.lifecycle,e[8]=i.phase,e[9]=x):x=e[9],x}if(!a||!o){let g;return e[10]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(tt,{title:"Waiting for sandbox context…"}),e[10]=g):g=e[10],g}const u=p?d:c.previewUrl;let f;return e[11]!==o||e[12]!==s||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==c.previewUrl||e[16]!==l.slug||e[17]!==u||e[18]!==a?(f=n.jsx(mc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:c.previewUrl,sitePreviewUrl:u,deepLinkPage:s,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=s,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=c.previewUrl,e[16]=l.slug,e[17]=u,e[18]=a,e[19]=f):f=e[19],f}const vn=2e3,uc=15;function jn(t,e,s,o){return typeof e!="string"||s&&(qn(e,s,o)||t.state.dataUpdateCount>=uc)?!1:vn}function mc({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:c}){const r=Se(),d=Bt()?.taskId??null,p={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:o},{data:m,isLoading:h}=Sa(p,{fetchEnabled:i}),u=kn({strict:!1}),[f,g]=$.useState(()=>u.contentCollection&&ot(u.contentCollection)&&u.contentCollection||"pages"),[x,y]=$.useState(()=>u.contentItem&&ot(f)?{collection:f,key:u.contentItem}:null),[v,j]=$.useState(null),w=!!(l?.pageId||l?.path||l?.pathTemplate),[C,E]=$.useState(!1);if(w&&!C&&x===null&&m){E(!0);const b=Ia(Gs(m),l??{});b&&(g("pages"),y({collection:"pages",key:b.key,path:b.path}))}const[B,k]=$.useState(""),[D,O]=$.useState("board"),L=b=>{y(b),j(null)},[K,F]=$.useState(f);K!==f&&(F(f),k(""));const{data:_,isLoading:A,isFetching:I}=wa(p,{fetchEnabled:i,refetchInterval:b=>{const V=b.state.data;if(f==="apps"&&x&&x.collection==="apps"){const ce=m?.[x.key];return jn(b,typeof ce?.__resolveType=="string"?ce.__resolveType:void 0,V)}if(f==="site"&&m){const ce=V?Us(m,V):null,fe=m.site,Ae=ce?.resolveType??(typeof fe?.__resolveType=="string"?fe.__resolveType:void 0);return jn(b,Ae,V,["seo"])}return!1}}),R=(b,V)=>!qn(b,_,V)&&(A||I),{catalog:G,isLoading:z}=Sl(_??void 0,m??void 0,{enabled:f==="apps"}),W=zi({orgSlug:t,virtualMcpId:e,branch:s,meta:_}),T=Qt(p),U=Mn(p),Y=Gi({orgSlug:t,virtualMcpId:e,branch:s,decofile:m??{},support:W,onMoved:(b,V)=>y(ce=>ce?.collection==="posts"&&ce.key===b?{collection:"posts",key:V}:ce)}),[q,X]=$.useState(null),[de,ne]=$.useState(),[ue,te]=$.useState(!1),[re,le]=$.useState(),[N,J]=$.useState(null),[Z,oe]=$.useState(null),[S,se]=$.useState(null),H=!m||!_;if(h||A||H&&c)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(lt,{className:"size-5 text-muted-foreground"})});if(H)return n.jsx(tt,{title:"Could not load site data."});const ie=Gs(m).sort((b,V)=>b.name.localeCompare(V.name)),ve=Ra(m).sort((b,V)=>b.from.localeCompare(V.from)),pe=Fa(m,_),ke=f==="sections"?Ka(_):[],he=Us(m,_),we=Xn(m),Pe=Es.some(b=>we[b].length>0),Te=ot(f)?we[f]:[],Ne=Ms(_,"loaders"),Be=Ms(_,"actions");if(!za(m,_)&&!Pe&&Ne===0&&Be===0)return n.jsx(tt,{icon:Wt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const De={pages:ie.length,sections:pe.length,apps:G.length,loaders:Ne,actions:Be,redirects:ve.length,posts:we.posts.length,authors:we.authors.length,categories:we.categories.length},xe=new Set(ie.map(b=>Lt(b.path))),$e=new Set(ie.map(b=>b.name)),Fe=new Set(pe.map(b=>b.name)),M=async b=>{const V=m[b.key];if(!V)return;const ce=Kn(m,b.key),fe=Na(m,b.key,Math.max(0,ce-1)),Ae=Ca(V.sections,fe);if(Ae)try{await T.mutateAsync({blockKey:b.key,data:{...V,sections:Ae}}),me.success(`Variant added to "${b.name}"`),y({collection:"pages",key:b.key,path:b.path})}catch(Oe){me.error(Oe instanceof Error?Oe.message:"Could not add variant")}},ge=()=>{ne(void 0),X({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},je=b=>{ne(void 0),X({mode:"duplicate",sourceKey:b.key,initialName:Ws($e,b.name),initialPath:El(xe,b.path)})},Le=b=>{ne(void 0),X({mode:"rename",sourceKey:b.key,initialName:b.name,initialPath:b.path})},ss=async b=>{if(!q)return;const{mode:V,sourceKey:ce}=q;try{if(V==="create"){let fe;if(b.templateKey){const Oe=m[b.templateKey];if(!Oe)throw new Error("Selected template no longer exists.");fe={...Oe,name:b.name,path:b.path}}else fe=Al(b.name,b.path);const Ae=Ll(m,b.name);await T.mutateAsync({blockKey:Ae,data:fe}),me.success(`Created "${b.name}"`),y({collection:"pages",key:Ae,path:b.path})}else if(V==="duplicate"&&ce){const fe=m[ce];if(!fe)throw new Error("Source page not found");const{key:Ae,data:Oe}=Dl({source:fe,pages:ie,newName:b.name,newPath:b.path});await T.mutateAsync({blockKey:Ae,data:Oe}),me.success(`Duplicated as "${b.name}"`),y({collection:"pages",key:Ae,path:b.path})}else if(V==="rename"&&ce){const fe=m[ce];if(!fe)throw new Error("Page not found");const Ae={...fe,name:b.name,path:b.path};await T.mutateAsync({blockKey:ce,data:Ae}),me.success("Page updated"),x?.collection==="pages"&&x.key===ce&&y({collection:"pages",key:ce,path:b.path})}X(null)}catch(fe){ne(fe instanceof Error?fe.message:"Save failed")}},ns=({path:b})=>{if(!q)return null;const V=Lt(b);return(q.mode==="rename"?Lt(q.initialPath):null)!==V&&xe.has(V)?`A page with path "${b}" already exists.`:null},os=async(b,V,ce)=>{await T.mutateAsync({blockKey:V,data:{...ce,name:V,__resolveType:b}}),me.success(r("sandbox.contentBrowser.createdSection",{name:V})),y({collection:"sections",key:V})},as=Rn((b,V)=>T.mutate({blockKey:b,data:V})),ls=async b=>{const V=m[b.key];if(!V){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}const ce=_l(m,b.key),fe=Ws(Fe,b.name),Ae={...V,name:fe};try{await T.mutateAsync({blockKey:ce,data:Ae}),me.success(r("sandbox.contentBrowser.duplicatedSection",{name:b.name})),y({collection:"sections",key:ce})}catch(Oe){me.error(Oe instanceof Error?Oe.message:r("sandbox.contentBrowser.duplicateFailed"))}},is=async b=>{if(!N)return;const V=m[N];if(!V){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}try{await T.mutateAsync({blockKey:N,data:{...V,name:b}}),me.success(r("sandbox.contentBrowser.sectionRenamed")),J(null)}catch(ce){me.error(ce instanceof Error?ce.message:r("sandbox.contentBrowser.renameFailed"))}},_t=()=>{le(void 0),te(!0)},rs=async b=>{const V=Ma(m,b.from),ce=Va(b);try{await T.mutateAsync({blockKey:V,data:ce}),me.success("Created redirect"),te(!1),y({collection:"redirects",key:V})}catch(fe){le(fe instanceof Error?fe.message:"Could not create redirect")}},cs=async b=>{const V=hs(m,b),ce=at(V,b,ao(b));try{await T.mutateAsync({blockKey:V,data:ce}),me.success(`Created ${Nt[b]}`),y({collection:b,key:V})}catch(fe){me.error(fe instanceof Error?fe.message:"Could not create")}},P=async b=>{const V=hs(m,"posts"),ce=at(V,"posts",Ni(b));try{await T.mutateAsync({blockKey:V,data:ce}),me.success(r("sandbox.postCalendar.createdScheduledPost")),g("posts"),F("posts"),y({collection:"posts",key:V}),j(null)}catch(fe){me.error(fe instanceof Error?fe.message:r("sandbox.postCalendar.couldNotCreate"))}},Q=async(b,V)=>{const ce=m[b],fe=ce?Pi(dt(ce,"posts"),V):null;if(!fe){me.error(r("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await T.mutateAsync({blockKey:b,data:at(b,"posts",fe)})}catch(Ae){me.error(Ae instanceof Error?Ae.message:r("sandbox.postCalendar.couldNotReschedule"))}},Ee=async b=>{const V=m[b.key];if(!V){me.error("Record not found.");return}const ce=hs(m,b.kind),fe=b.kind==="posts"?"title":"name",Ae={...structuredClone(dt(V,b.kind)),[fe]:`${b.label} (copy)`};try{await T.mutateAsync({blockKey:ce,data:at(ce,b.kind,Ae)}),me.success(`Duplicated "${b.label}"`),y({collection:b.kind,key:ce})}catch(Oe){me.error(Oe instanceof Error?Oe.message:"Duplicate failed")}},Ve=()=>{g("posts"),F("posts"),y(null),j(null),k("")},qe=async()=>{if(Z)try{const{kind:b,key:V,label:ce}=Z;if(b==="blog"){if(Z.blogKind==="categories"){const fe=dt(m[V],"categories").slug,Ae=typeof fe=="string"?fe:"";if(Ae)for(const{key:Oe,payload:Is}of Ge(m,"posts")){const Rs=si(Is,Ae);Rs!==Is&&await T.mutateAsync({blockKey:Oe,data:at(Oe,"posts",ni(Rs))})}}await U.mutateAsync({blockKey:V})}else await U.mutateAsync({blockKey:V});me.success(`Deleted "${ce}"`),x&&x.collection!=="available-section"&&x.key===V&&y(null),oe(null)}catch(b){me.error(b instanceof Error?b.message:"Delete failed")}},Ce=U.isPending||T.isPending,gt=Z?.kind==="blog"?Nt[Z.blogKind]:Z?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(Nl,{active:f,counts:De,showBlog:Pe,onSelect:b=>{g(b),y(null),j(null)}}),f!=="seo"&&f!=="site"&&f!=="context"&&f!=="calendar"&&f!=="post-schedule"&&f!=="posts"&&f!=="loaders"&&f!=="actions"&&n.jsx(fc,{activeCollection:f,pages:ie,redirects:ve,sections:pe,availableSections:ke,appCatalog:G,appCatalogLoading:z,blogEntries:Te,decofile:m,searchQuery:B,onSearchChange:k,selection:x,onSelect:L,onCreate:()=>{f==="pages"?ge():f==="redirects"?_t():ot(f)&&cs(f)},onDuplicatePage:je,onRenamePage:Le,onAddPageVariant:M,onDeletePage:b=>oe({kind:"page",key:b.key,label:b.name}),onEditPageSeo:b=>{const V={collection:"pages",key:b.key,path:b.path};y(V),j(b.key)},onViewPageJson:b=>se(b.key),onDuplicateSection:ls,onRenameSection:b=>J(b.key),onDeleteSection:b=>oe({kind:"section",key:b.key,label:b.name}),onDeleteRedirect:b=>oe({kind:"redirect",key:b.key,label:b.from||b.key}),onDuplicateBlog:Ee,onDeleteBlog:b=>oe({kind:"blog",blogKind:b.kind,key:b.key,label:b.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?n.jsx(Ir,{orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,kind:f}):n.jsx($.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(lt,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?n.jsx(ic,{decofile:m}):f==="post-schedule"?n.jsx(rc,{decofile:m,support:W,isCreating:T.isPending,onCreate:b=>{P(b)},onReschedule:(b,V)=>{Q(b,V)},onSelect:b=>{g("posts"),F("posts"),y({collection:"posts",key:b}),j(null)}}):f==="site"?he?n.jsx(yn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:he.key,block:m[he.key],decofile:m,meta:_,title:"Site",excludeFields:["seo"],schemaPending:R(he.resolveType,["seo"]),previewBaseUrl:o},`site:${he.key}`):n.jsx(tt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="context"?n.jsx(ml,{title:r("sandbox.blogContext.soonTitle"),description:r("sandbox.blogContext.soonDescription"),children:n.jsx(nc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,onOpenPost:b=>{g("posts"),F("posts"),y({collection:"posts",key:b}),j(null)},onManageCategoryPosts:()=>{g("posts"),F("posts"),y(null),j(null)}})}):f==="seo"?n.jsx(lc,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,meta:_,target:{kind:"site"},previewBaseUrl:a}):f==="sections"?n.jsx(Qr,{selection:x?.collection==="sections"||x?.collection==="available-section"?x:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:o,meta:_,decofile:m,isCreating:T.isPending,onCreateAvailable:os,onSaveReferencedBlock:as}):f==="posts"?n.jsx(Pr,{orgSlug:t,virtualMcpId:e,branch:s,decofile:m,view:D,selectedKey:x?.collection==="posts"?x.key:null,onViewChange:b=>{O(b),y(null)},onClose:()=>y(null),onOpen:b=>{y({collection:"posts",key:b}),j(null)},move:Y,support:W,meta:_,renderDetail:(b,V)=>n.jsx(tc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:b,block:m[b],decofile:m,meta:_,previewBaseUrl:a,move:Y,onClose:V?.onClose,expanded:V?.expanded,onToggleExpand:V?.onToggleExpand},`post:${Ct(b)}`)}):x&&x.collection!=="available-section"?x.collection==="apps"?n.jsx(yn,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:x.key,block:m[x.key],decofile:m,meta:_,previewBaseUrl:o,schemaPending:R(typeof m[x.key]?.__resolveType=="string"?String(m[x.key].__resolveType):void 0)},`app:${x.key}`):x.collection==="categories"?n.jsx(oc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:x.key,block:m[x.key],decofile:m,meta:_,onManagePosts:()=>Ve(),onOpenPost:b=>{g("posts"),F("posts"),y({collection:"posts",key:b}),j(null)},previewBaseUrl:a},`category:${x.key}`):x.collection==="authors"?n.jsx(sc,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:x.key,block:m[x.key]},`authors:${x.key}`):x.collection==="redirects"?n.jsx(cc,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:x.key,block:m[x.key]},`redirect:${x.key}`):n.jsx(ac,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:o??void 0,currentPath:x.collection==="pages"?x.path:"/",activePageBlockKey:x.collection==="pages"?x.key:null,activeGlobalBlockKey:x.collection==="sections"?x.key:null,initialEditSeo:x.collection==="pages"&&v===x.key,onExitSeo:()=>j(null),onSelectRoot:()=>{y(null),j(null)}},x.collection==="pages"?`page:${x.key}`:`section:${x.key}`):n.jsx(tt,{title:`Select ${ot(f)?`a ${Nt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),q&&n.jsx(Fl,{open:!!q,mode:q.mode,initialName:q.initialName,initialPath:q.initialPath,isPending:T.isPending,error:de,templates:ie,validate:ns,onSubmit:ss,onOpenChange:b=>{b||(X(null),ne(void 0))}}),n.jsx(zl,{open:ue,isPending:T.isPending,error:re,onSubmit:rs,onOpenChange:b=>{b||(te(!1),le(void 0))}}),N&&n.jsx(Ml,{open:!!N,blockKey:N,initialName:pe.find(b=>b.key===N)?.name??N,isPending:T.isPending,onSubmit:is,onOpenChange:b=>{b||J(null)}}),S&&n.jsx(Ga,{open:!!S,onOpenChange:b=>{b||se(null)},pageKey:S,decofile:m,onSave:b=>T.mutateAsync({blockKey:S,data:b})}),n.jsx(Yo,{open:!!Z,onOpenChange:b=>{!b&&!Ce&&oe(null)},children:n.jsxs(Qo,{children:[n.jsxs(Xo,{children:[n.jsx(Zo,{children:`Delete ${gt}?`}),n.jsx(ea,{children:Z?.kind==="section"?`"${Z.label}" will be removed. Pages that still reference it will lose this section.`:Z?`"${Z.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs(ta,{children:[n.jsx(sa,{disabled:Ce,children:"Cancel"}),n.jsx(na,{onClick:b=>{b.preventDefault(),qe()},disabled:Ce,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ce?n.jsxs(n.Fragment,{children:[n.jsx(lt,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function fc(t){const e=ae.c(57),{activeCollection:s,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:c,appCatalogLoading:r,blogEntries:d,decofile:p,searchQuery:m,onSearchChange:h,selection:u,onSelect:f,onCreate:g,onDuplicatePage:x,onRenamePage:y,onAddPageVariant:v,onDeletePage:j,onEditPageSeo:w,onViewPageJson:C,onDuplicateSection:E,onRenameSection:B,onDeleteSection:k,onDeleteRedirect:D,onDuplicateBlog:O,onDeleteBlog:L}=t;let K,F,_,A,I,R;if(e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==d||e[5]!==p||e[6]!==v||e[7]!==g||e[8]!==L||e[9]!==j||e[10]!==D||e[11]!==k||e[12]!==O||e[13]!==x||e[14]!==E||e[15]!==w||e[16]!==y||e[17]!==B||e[18]!==h||e[19]!==f||e[20]!==C||e[21]!==o||e[22]!==a||e[23]!==m||e[24]!==l||e[25]!==u){const T=m.toLowerCase(),U=o.filter(S=>!T||S.name.toLowerCase().includes(T)||S.path.toLowerCase().includes(T)),Y=a.filter(S=>!T||S.from.toLowerCase().includes(T)||S.to.toLowerCase().includes(T)),q=l.filter(S=>!T||S.name.toLowerCase().includes(T)||S.key.toLowerCase().includes(T)||S.resolveType.toLowerCase().includes(T)),X=i.filter(S=>!T||S.title.toLowerCase().includes(T)||S.resolveType.toLowerCase().includes(T)||(S.description?.toLowerCase().includes(T)??!1)),de=ec(q),ne=c.filter(S=>!T||S.title.toLowerCase().includes(T)||S.app.toLowerCase().includes(T)||S.vendor.toLowerCase().includes(T)||S.category.toLowerCase().includes(T)),ue=d.filter(S=>!T||S.label.toLowerCase().includes(T)||S.subtitle.toLowerCase().includes(T)),te=`Search ${s}…`,re=ot(s)?`Create new ${Nt[s]}`:s==="redirects"?"Create new redirect":"Create new page",le=s!=="apps"&&s!=="sections";I="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Ss,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[32]=N):N=e[32];let J;e[33]!==h?(J=S=>h(S.target.value),e[33]=h,e[34]=J):J=e[34];let Z;e[35]!==te||e[36]!==m||e[37]!==J?(Z=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[N,n.jsx("input",{type:"text",value:m,onChange:J,placeholder:te,"aria-label":te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[35]=te,e[36]=m,e[37]=J,e[38]=Z):Z=e[38];let oe;e[39]!==re||e[40]!==g||e[41]!==le?(oe=le&&n.jsxs(Qe,{children:[n.jsx(We,{asChild:!0,children:n.jsx(_e,{variant:"ghost",size:"icon",onClick:g,"aria-label":re,children:n.jsx(ws,{size:14})})}),n.jsx(Ye,{side:"bottom",children:re})]}),e[39]=re,e[40]=g,e[41]=le,e[42]=oe):oe=e[42],e[43]!==Z||e[44]!==oe?(R=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Z,oe]}),e[43]=Z,e[44]=oe,e[45]=R):R=e[45],K=Yt,A="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",F="flex flex-col gap-1 p-1.5",_=s==="pages"?U.length===0?n.jsx(yt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(S=>{const se=u?.collection==="pages"&&u.key===S.key,H=Kn(p,S.key);return n.jsx(Ue,{icon:En,title:S.name,subtitle:S.path,active:se,variantCount:H,onClick:()=>f({collection:"pages",key:S.key,path:S.path}),menu:n.jsx($t,{onDuplicate:()=>x(S),onRename:()=>y(S),onAddVariant:()=>v(S),onEditSeo:()=>w(S),onViewJson:()=>C(S),onDelete:()=>j(S)})},S.key)}):s==="sections"?q.length===0&&X.length===0?n.jsx(yt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[de.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(bn,{icon:Kt,label:"Saved sections"}),de.map(S=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:S.label}),S.sections.map(se=>{const H=u?.collection==="sections"&&u.key===se.key;return n.jsx(Ue,{icon:Kt,accent:"global",title:se.name,subtitle:S.label,active:H,onClick:()=>f({collection:"sections",key:se.key}),menu:n.jsx($t,{onDuplicate:()=>E(se),onRename:()=>B(se),onDelete:()=>k(se)})},se.key)})]},S.label))]}),X.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(bn,{icon:zs,label:"Available sections",className:be(de.length>0&&"mt-3")}),X.map(S=>{const se=u?.collection==="available-section"&&u.resolveType===S.resolveType,H=S.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(Ue,{icon:zs,title:S.title,subtitle:H??S.resolveType,active:se,onClick:()=>f({collection:"available-section",resolveType:S.resolveType,title:S.title})},S.resolveType)})]})]}):s==="apps"?r?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(lt,{className:"size-4.5 text-muted-foreground"})}):ne.length===0?n.jsx(yt,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ne.map(S=>{const se=u?.collection==="apps"&&S.blockKey!==null&&u.key===S.blockKey;return n.jsx(Ue,{icon:An,logoUrl:S.logo,title:S.title,subtitle:S.category,active:se,trailing:S.installed?n.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!S.installed||!S.blockKey){me.message(`${S.title} is not installed on this site.`);return}f({collection:"apps",key:S.blockKey})}},S.id)}):s==="redirects"?Y.length===0?n.jsx(yt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):Y.map(S=>n.jsx(Ue,{icon:wn,title:S.from||"(no source)",subtitle:`→ ${S.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===S.key,trailing:n.jsx(Vl,{type:S.type}),onClick:()=>f({collection:"redirects",key:S.key}),menu:n.jsx($t,{onDelete:()=>D(S)})},S.key)):ue.length===0?n.jsx(yt,{hasItems:d.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${ot(s)?Nt[s]:"item"}.`}):ue.map(S=>{const se=u?.collection===S.kind&&u.key===S.key;return n.jsx(Ue,{icon:S.kind==="posts"?_n:S.kind==="authors"?$n:Nn,title:S.label,subtitle:S.subtitle,active:se,onClick:()=>f({collection:S.kind,key:S.key}),menu:n.jsx($t,{onDuplicate:()=>O(S),onDelete:()=>L(S)})},S.key)}),e[0]=s,e[1]=c,e[2]=r,e[3]=i,e[4]=d,e[5]=p,e[6]=v,e[7]=g,e[8]=L,e[9]=j,e[10]=D,e[11]=k,e[12]=O,e[13]=x,e[14]=E,e[15]=w,e[16]=y,e[17]=B,e[18]=h,e[19]=f,e[20]=C,e[21]=o,e[22]=a,e[23]=m,e[24]=l,e[25]=u,e[26]=K,e[27]=F,e[28]=_,e[29]=A,e[30]=I,e[31]=R}else K=e[26],F=e[27],_=e[28],A=e[29],I=e[30],R=e[31];let G;e[46]!==F||e[47]!==_?(G=n.jsx("div",{className:F,children:_}),e[46]=F,e[47]=_,e[48]=G):G=e[48];let z;e[49]!==K||e[50]!==A||e[51]!==G?(z=n.jsx(K,{className:A,children:G}),e[49]=K,e[50]=A,e[51]=G,e[52]=z):z=e[52];let W;return e[53]!==I||e[54]!==R||e[55]!==z?(W=n.jsxs("div",{className:I,children:[R,z]}),e[53]=I,e[54]=R,e[55]=z,e[56]=W):W=e[56],W}function pc(t){const e=ae.c(25),{virtualMcpId:s}=t,o=Se(),[a,l]=$.useState(!1),i=ll(s),{activeTask:c}=Sn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const d=kn(r);if(!(qs(i?.metadata)||qs(c?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(Js,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let u;e[2]!==o?(u=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=u):u=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let g,x;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=()=>l(!0),x=n.jsx(Js,{className:"size-4"}),e[6]=g,e[7]=x):(g=e[6],x=e[7]);let y;e[8]!==o?(y=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=y):y=e[9];let v;e[10]!==y?(v=n.jsxs(_e,{onClick:g,children:[x,y]}),e[10]=y,e[11]=v):v=e[11];let j;e[12]!==u||e[13]!==f||e[14]!==v?(j=n.jsx(cl,{className:"h-full",image:h,title:u,description:f,actions:v}),e[12]=u,e[13]=f,e[14]=v,e[15]=j):j=e[15];let w;e[16]!==a?(w=n.jsx(dl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=w):w=e[17];let C;return e[18]!==w||e[19]!==j?(C=n.jsxs(n.Fragment,{children:[j,w]}),e[18]=w,e[19]=j,e[20]=C):C=e[20],C}let m;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(m=n.jsx(dc,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=m):m=e[24],m}function hc(){const t=ae.c(2),e=ul();let s;return t[0]!==e?(s=n.jsx($o,{tabId:"content",children:n.jsx(Lo,{feature:"cms",children:n.jsx(pc,{virtualMcpId:e})})}),t[0]=e,t[1]=s):s=t[1],s}const Dd=Object.freeze(Object.defineProperty({__proto__:null,default:hc},Symbol.toStringTag,{value:"Module"}));export{vo as $,Cd as A,As as B,xd as C,pd as D,Nd as E,Td as F,Xn as G,uo as H,Ui as I,en as J,yi as K,fd as L,hs as M,ao as N,ud as O,Ds as P,bd as Q,Pd as R,yd as S,Bd as T,jd as U,mt as V,kd as W,vd as X,gd as Y,Sd as Z,Ut as _,dd as a,Dd as a0,ts as b,ni as c,wd as d,cd as e,Ge as f,dt as g,qt as h,Ed as i,ci as j,_d as k,to as l,_s as m,_l as n,lo as o,Et as p,at as q,pl as r,ye as s,mo as t,zi as u,Ke as v,xi as w,md as x,hd as y,Me as z};