decocms 4.462.2 → 4.462.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/dist/client/assets/{AlertCircle-BOqaZFXA.js → AlertCircle-rm9vrEtW.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BVBZ_mBW.js → AreaChart-Bxeu7Flp.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BsFMaTJ5.js → ArrowLeft-q0aoA66K.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-Bi8YJGtE.js → ArrowUp-wgeukGJg.js} +1 -1
  5. package/dist/client/assets/{Building02-BG4IPwQ3.js → Building02-BPTZeJ83.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-BROP1iuM.js → CartesianChart-CeNVmGpJ.js} +1 -1
  7. package/dist/client/assets/{Check-ChBZV9OV.js → Check-ycQN3J2t.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-D49A5hws.js → CheckCircle-C2px0gfY.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-wB5J5ntl.js → ChevronUp-B8UqekRj.js} +1 -1
  10. package/dist/client/assets/{Copy01-C4tt-_AN.js → Copy01-DFSuVPvj.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-DCvyy0kz.js → CreditCard01-C13hgCp6.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BWwzMO41.js → DotsVertical-8YiGOIqq.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-Ct0GvI3W.js → ErrorBarContext-DRxvuP2h.js} +1 -1
  14. package/dist/client/assets/{Image01-B4l0All3.js → Image01-CgjyCWgG.js} +1 -1
  15. package/dist/client/assets/{Key01-DNpH0NnO.js → Key01-B1-8KpSg.js} +1 -1
  16. package/dist/client/assets/{Line-Bq7EY1pw.js → Line-DkNHkEZJ.js} +1 -1
  17. package/dist/client/assets/{Link01-DZVgeeWe.js → Link01-B8ajBJDc.js} +1 -1
  18. package/dist/client/assets/{LinkBroken01-CNbQoBrl.js → LinkBroken01-C78kyif5.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-D73wyIiU.js → LinkExternal01-Bn0SPqIC.js} +1 -1
  20. package/dist/client/assets/{Monitor01-BJ23zU-n.js → Monitor01-DC2k418g.js} +1 -1
  21. package/dist/client/assets/{Palette-BKZ5R7W4.js → Palette-DOpFqZPK.js} +1 -1
  22. package/dist/client/assets/{Plus-CP_oegJ7.js → Plus-DC_7nhbs.js} +1 -1
  23. package/dist/client/assets/{SearchMd-D2OTQFME.js → SearchMd-Be3GMdpX.js} +1 -1
  24. package/dist/client/assets/{Sector-OlKrChyD.js → Sector-CASMflPE.js} +1 -1
  25. package/dist/client/assets/{ShoppingBag01-BfMGWAwv.js → ShoppingBag01-DNQzuGTX.js} +1 -1
  26. package/dist/client/assets/{Sun-BAfhxpb-.js → Sun-COaeigjT.js} +1 -1
  27. package/dist/client/assets/{Tool01-B_dduyQs.js → Tool01-BNeCU30E.js} +1 -1
  28. package/dist/client/assets/{Trash01-C4sE_NGv.js → Trash01-BTpCOmuX.js} +1 -1
  29. package/dist/client/assets/{Upload01-qBk1AINH.js → Upload01-Dfmvp3DJ.js} +1 -1
  30. package/dist/client/assets/{User01-DcjCdViP.js → User01-4R_aUn4g.js} +1 -1
  31. package/dist/client/assets/{UserSquare-CQZbVq0f.js → UserSquare-DJ8hiuYq.js} +1 -1
  32. package/dist/client/assets/{Users01-DR0sKzFO.js → Users01-v0Jyk4Ot.js} +1 -1
  33. package/dist/client/assets/{X-DJN31Nfv.js → X-DLYqFuX1.js} +1 -1
  34. package/dist/client/assets/{XAxis-C3Bf1J_u.js → XAxis-Dt1OJoaL.js} +1 -1
  35. package/dist/client/assets/{XClose-D0KEw8ZX.js → XClose-BbdvFCiX.js} +1 -1
  36. package/dist/client/assets/{ZoomOut-UxLkEy8R.js → ZoomOut-DFERFVow.js} +1 -1
  37. package/dist/client/assets/{access-gate-RAaA3S4I.js → access-gate-CDypY0PL.js} +1 -1
  38. package/dist/client/assets/{add-connection-dialog-BY0I55_H.js → add-connection-dialog-C7D8wNe0.js} +1 -1
  39. package/dist/client/assets/{agent-analytics-BkAfBBox.js → agent-analytics-BImzDnhS.js} +1 -1
  40. package/dist/client/assets/agent-app-CoPaMo44.js +1 -0
  41. package/dist/client/assets/{agent-assets-B3yLb2yB.js → agent-assets-TjuTBaEj.js} +1 -1
  42. package/dist/client/assets/{agent-automation-B2a9NwZW.js → agent-automation-jGaRzmAt.js} +1 -1
  43. package/dist/client/assets/{agent-automations-4swr6ii9.js → agent-automations-Dfj6v173.js} +1 -1
  44. package/dist/client/assets/{agent-connect-sources-DScLzDRG.js → agent-connect-sources-BGMBLNVm.js} +1 -1
  45. package/dist/client/assets/agent-deck-LRjwh5gJ.js +1 -0
  46. package/dist/client/assets/{agent-e2e-BYVtzJn1.js → agent-e2e-D-iDy0X1.js} +1 -1
  47. package/dist/client/assets/{agent-experiments-BytI8p3-.js → agent-experiments-CrLfobcW.js} +1 -1
  48. package/dist/client/assets/{agent-file-YzyYVZ_N.js → agent-file-CpxoMhYy.js} +1 -1
  49. package/dist/client/assets/{agent-hosting-XjyAni_P.js → agent-hosting-Ccr3JHE_.js} +1 -1
  50. package/dist/client/assets/{agent-icon-DGDGzDPg.js → agent-icon-BhZZd37x.js} +1 -1
  51. package/dist/client/assets/agent-library-Bg7R_pV5.js +1 -0
  52. package/dist/client/assets/agent-library-file-C8OO6Uy9.js +1 -0
  53. package/dist/client/assets/{agent-monitor-BeZr1N-B.js → agent-monitor-tFj42gZE.js} +1 -1
  54. package/dist/client/assets/{agent-overview-qqA1EvR2.js → agent-overview-nEVkVUxO.js} +1 -1
  55. package/dist/client/assets/agent-settings-OH2hBY9j.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-3yAc0dAv.js → agent-site-editor-CSh7k9QL.js} +1 -1
  57. package/dist/client/assets/agent-site-editor-code-DEtiY7c_.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-BVsrDzv_.js → agent-site-editor-content-nUoK_dJG.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-CWeO_adL.js → agent-site-editor-preview-Bz2ZTG6q.js} +3 -3
  60. package/dist/client/assets/agent-view-ByM1tns8.js +1 -0
  61. package/dist/client/assets/{agent-view-guard--aoytX6B.js → agent-view-guard-w0LVmZ_n.js} +1 -1
  62. package/dist/client/assets/{agents-list-Bh-3TBuf.js → agents-list-DgxnnHSC.js} +1 -1
  63. package/dist/client/assets/{ai-providers-DKS3l98n.js → ai-providers-B6rDuzxD.js} +1 -1
  64. package/dist/client/assets/{alert-DSsZdX1z.js → alert-DjgCgioe.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-CiySziMD.js → alert-dialog-PTVX9d3Y.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-Cl2mCPG9.js → analytics-sections-DBNJksaf.js} +1 -1
  67. package/dist/client/assets/{api-keys-DT79lla9.js → api-keys-CRRGgTH5.js} +1 -1
  68. package/dist/client/assets/api-keys-DwkggND0.js +1 -0
  69. package/dist/client/assets/app-editor-uI7CZhyW.js +1 -0
  70. package/dist/client/assets/{asset-utils-Co49serB.js → asset-utils-Dv9Q2xbg.js} +1 -1
  71. package/dist/client/assets/{auth-Cs4gU6Jt.js → auth-CWILNz-R.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-472LoEBQ.js → auth-catchall-Cc5_u2IL.js} +1 -1
  73. package/dist/client/assets/{auth-entry-wcuFRPik.js → auth-entry-C9RssKbo.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-wSdRvsPt.js → auth-split-layout-D_hmCTq4.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-VlIk_G_o.js → authenticate-and-persist-oauth-_u_GUn2l.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-CuueSCf2.js → automation-list-row-DfDWaaDG.js} +1 -1
  77. package/dist/client/assets/{automation-runs-BnertJ4X.js → automation-runs-CiGqMkAr.js} +1 -1
  78. package/dist/client/assets/{automations-DdJEP87b.js → automations-17MTzB0I.js} +1 -1
  79. package/dist/client/assets/{autosend-D7eBSjvh.js → autosend-C7DyeWiW.js} +1 -1
  80. package/dist/client/assets/{avatar-BeFOPb9J.js → avatar-Dl_cPf4a.js} +1 -1
  81. package/dist/client/assets/{badge-SOygJ_ut.js → badge-DhrYVT6A.js} +1 -1
  82. package/dist/client/assets/{block-document-Cu1aHoUW.js → block-document-C4jgXyrX.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-BUj7HSJ8.js → blocks-preview-workspace-context-CJB53TYU.js} +1 -1
  84. package/dist/client/assets/{blog-schema-BMIbFol2.js → blog-schema-Cm8V0ekp.js} +1 -1
  85. package/dist/client/assets/{buckets-BA7hLRYf.js → buckets-Cu7VxrxX.js} +1 -1
  86. package/dist/client/assets/{build-improve-prompt-doc-DRPd_i83.js → build-improve-prompt-doc-DzdB1psZ.js} +1 -1
  87. package/dist/client/assets/{calendar-oXQevmTG.js → calendar-BLwaxQ6A.js} +1 -1
  88. package/dist/client/assets/{capability-load-error-dMTmC9nh.js → capability-load-error-Gcuy_zZQ.js} +1 -1
  89. package/dist/client/assets/{category-editor-1_2fvb3e.js → category-editor-qccGK1pF.js} +1 -1
  90. package/dist/client/assets/{chart-VsbCVKFV.js → chart-m7qkl4bi.js} +1 -1
  91. package/dist/client/assets/{chat-context-DiXJfhIa.js → chat-context-Dx9zNHfj.js} +1 -1
  92. package/dist/client/assets/{chat-draft-Bpba7nd9.js → chat-draft-BmX0POEt.js} +1 -1
  93. package/dist/client/assets/{checkbox-Dz205M-t.js → checkbox-BGY2RDHl.js} +1 -1
  94. package/dist/client/assets/{choose-editor-sM1ArvsC.js → choose-editor-Drm1rWH4.js} +1 -1
  95. package/dist/client/assets/{claim-phase-copy-Dd94Yylk.js → claim-phase-copy-B4wRGWwJ.js} +1 -1
  96. package/dist/client/assets/{cli-auth-success-B9VS9AxW.js → cli-auth-success-Bhd55UzL.js} +1 -1
  97. package/dist/client/assets/{client-icons-pHlGrnda.js → client-icons-Nclcrk8y.js} +1 -1
  98. package/dist/client/assets/{collapsible-CfObde3Q.js → collapsible-BUVugLgs.js} +1 -1
  99. package/dist/client/assets/{collection-detail-Db-KUOBe.js → collection-detail-DP3jpGJn.js} +1 -1
  100. package/dist/client/assets/{collection-display-button-BkekuxeX.js → collection-display-button-T5vUt9Xp.js} +1 -1
  101. package/dist/client/assets/{collection-search-D2PZ787d.js → collection-search-CKuVhNj4.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-CiNVnoGZ.js → collection-table-wrapper-DjPT86lv.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-BPj0wxo8.js → collection-tabs-BamuvkGL.js} +1 -1
  104. package/dist/client/assets/{column-rules-DHSys_Pp.js → column-rules-Xz3xzzP-.js} +1 -1
  105. package/dist/client/assets/{combobox-Cio7ykEV.js → combobox-CgUwJrOG.js} +1 -1
  106. package/dist/client/assets/{command-CxzepSXP.js → command-Czt06b2r.js} +1 -1
  107. package/dist/client/assets/{companion-mcps-section-Cv04Xa58.js → companion-mcps-section-KDtsEeuf.js} +1 -1
  108. package/dist/client/assets/{config-Ct9Qi8LT.js → config-CGLxG-Gg.js} +1 -1
  109. package/dist/client/assets/{connect-CGibdNE5.js → connect-Dz_UGWIS.js} +1 -1
  110. package/dist/client/assets/{connect-layout-BxAxcInI.js → connect-layout-Diov8B69.js} +1 -1
  111. package/dist/client/assets/{connection-DbyDLRig.js → connection-Dyn6n84s.js} +1 -1
  112. package/dist/client/assets/{connection-card-DUnGN1LQ.js → connection-card-ZezUc4CB.js} +1 -1
  113. package/dist/client/assets/{connection-detail-CYpkfAUI.js → connection-detail-BJExNdyL.js} +1 -1
  114. package/dist/client/assets/{connection-form-helpers-B-IGiex0.js → connection-form-helpers-DBYs_bI7.js} +1 -1
  115. package/dist/client/assets/{connections-8PptZe-N.js → connections-oiXlAgUF.js} +1 -1
  116. package/dist/client/assets/{context-CqJX50Y5.js → context-BjfN_2Ri.js} +1 -1
  117. package/dist/client/assets/{context-menu-X12cIwS3.js → context-menu-DlkAUkV8.js} +1 -1
  118. package/dist/client/assets/{core.esm-BND19H8a.js → core.esm-B3puu65K.js} +1 -1
  119. package/dist/client/assets/{create-organization-dialog-DvoetHmh.js → create-organization-dialog-CQl1wPgd.js} +1 -1
  120. package/dist/client/assets/{daily-pulse-VPctcCpq.js → daily-pulse-Cap6vUBG.js} +1 -1
  121. package/dist/client/assets/{decopilot-RuTJJBbl.js → decopilot-CVtUuYjj.js} +1 -1
  122. package/dist/client/assets/{device-hint-BJfRFQKk.js → device-hint-EZG6wkKu.js} +1 -1
  123. package/dist/client/assets/{dialog-D_5RxDc9.js → dialog-C8AdhrG0.js} +1 -1
  124. package/dist/client/assets/{discover-DtRS1x6t.js → discover-DzeJVPL8.js} +1 -1
  125. package/dist/client/assets/{domain-settings-BGARHR_o.js → domain-settings-DSaE4wpm.js} +1 -1
  126. package/dist/client/assets/{download-app-dialog-RU0ZYOfB.js → download-app-dialog-URSdQ4ke.js} +1 -1
  127. package/dist/client/assets/{drawer-Br_av5UR.js → drawer-BZnmFrAT.js} +1 -1
  128. package/dist/client/assets/{editor-KC3-U1Hv.js → editor-CK9raNB0.js} +1 -1
  129. package/dist/client/assets/{empty-state-DNTQ1C-X.js → empty-state-CmS3chTn.js} +1 -1
  130. package/dist/client/assets/{empty-state-Bzg2RaeW.js → empty-state-CoOL0M6Y.js} +1 -1
  131. package/dist/client/assets/{extract-connection-data-BFG_cq-0.js → extract-connection-data-Ch1WBTd_.js} +1 -1
  132. package/dist/client/assets/{feature-gate-B2dCnM8L.js → feature-gate-Dzatwf08.js} +1 -1
  133. package/dist/client/assets/{feature-paywall-CVOfOt8x.js → feature-paywall-BoMIgBMw.js} +1 -1
  134. package/dist/client/assets/{file-explorer-wKCmBF67.js → file-explorer-nSFWWRTB.js} +1 -1
  135. package/dist/client/assets/{file-preview-VEd_A7P9.js → file-preview-DGEdQu7O.js} +1 -1
  136. package/dist/client/assets/{file-share-button-DkiNZpp9.js → file-share-button-CpGZhwcv.js} +1 -1
  137. package/dist/client/assets/{file-type-icon-CfnH9Twn.js → file-type-icon-D3P3r_PX.js} +1 -1
  138. package/dist/client/assets/flat-project-Crgd2_CA.js +1 -0
  139. package/dist/client/assets/{folder-icon-CzsWuPW5.js → folder-icon-DmaVPQUY.js} +1 -1
  140. package/dist/client/assets/{form-juLaUBrF.js → form-C_wkYdWR.js} +1 -1
  141. package/dist/client/assets/{gateway-client-CZQ4II3C.js → gateway-client-n3scD1Cq.js} +1 -1
  142. package/dist/client/assets/{general-DxW1EaZc.js → general-DY3X6fO5.js} +1 -1
  143. package/dist/client/assets/{home-m5VhYXeH.js → home-D9b2CIU1.js} +1 -1
  144. package/dist/client/assets/{icon-button-CMxGCJDP.js → icon-button-C_Cp_29j.js} +1 -1
  145. package/dist/client/assets/{index-CCXcZJGG.js → index-B-oPHPrA.js} +1 -1
  146. package/dist/client/assets/{index-CyAv4Ino.js → index-BADmvvU8.js} +1 -1
  147. package/dist/client/assets/{index-C1hd3ai4.js → index-BIGakDd7.js} +1 -1
  148. package/dist/client/assets/{index-CsKm2ubF.js → index-BSg0zn4o.js} +2 -2
  149. package/dist/client/assets/{index-C5X8q_Pi.js → index-BWQjqyyC.js} +1 -1
  150. package/dist/client/assets/{index-WJJsnt-n.js → index-BfKeTOyQ.js} +1 -1
  151. package/dist/client/assets/{index-CzdEzd_G.js → index-BmBDGBX2.js} +1 -1
  152. package/dist/client/assets/{index-DCcjp4nP.js → index-CFZz__Xz.js} +1 -1
  153. package/dist/client/assets/{index-BC7i1Aoz.js → index-CYmKWEH9.js} +1 -1
  154. package/dist/client/assets/{index-DyC292ZS.js → index-Cd-_V0_9.js} +1 -1
  155. package/dist/client/assets/{index-G0I4ayW-.js → index-CrcosZHv.js} +1 -1
  156. package/dist/client/assets/{index-CpnRViDi.js → index-Crqv9xoR.js} +3 -3
  157. package/dist/client/assets/{index-CycACfp6.js → index-D-Q4GsTp.js} +1 -1
  158. package/dist/client/assets/{index-BgwBy5oM.js → index-DZYzJ3Ve.js} +1 -1
  159. package/dist/client/assets/{index-CZNblbQa.js → index-hcdrCnDP.js} +1 -1
  160. package/dist/client/assets/{index-redirect-_gwqEShi.js → index-redirect-CTFASjG4.js} +1 -1
  161. package/dist/client/assets/{infiniteQueryObserver-DaqTQDCS.js → infiniteQueryObserver-ByHfufml.js} +1 -1
  162. package/dist/client/assets/{infra-billing-DCtNAzlT.js → infra-billing-xdyFXGeK.js} +1 -1
  163. package/dist/client/assets/{input-hKftpNOz.js → input-CCnRshRN.js} +1 -1
  164. package/dist/client/assets/{input-DFO5Hmip.js → input-D1Ki90Pm.js} +3 -3
  165. package/dist/client/assets/{input-BhJziSQi.js → input-DyRkn4pn.js} +1 -1
  166. package/dist/client/assets/{integration-icon-CTkfXIOR.js → integration-icon-BiZmEnVi.js} +1 -1
  167. package/dist/client/assets/{label-Bfbz6otc.js → label-Du2iAGWx.js} +1 -1
  168. package/dist/client/assets/{layout-ZwTrfTZi.js → layout-D_g2vZ02.js} +1 -1
  169. package/dist/client/assets/{legacy-agents-deep-DMwbwAKI.js → legacy-agents-deep-CzmcMxWx.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-BGY6ia4w.js → legacy-main-redirect-CVsh9CL4.js} +1 -1
  171. package/dist/client/assets/library-D0xoHpix.js +1 -0
  172. package/dist/client/assets/{library-tab-BcgjMyrL.js → library-tab-C48kInYl.js} +1 -1
  173. package/dist/client/assets/{login-DCqry8Ay.js → login-CWsZk4Ka.js} +1 -1
  174. package/dist/client/assets/{markdown-Bx2p9OGj.js → markdown-DienvDaS.js} +1 -1
  175. package/dist/client/assets/{mcp-app-renderer-d-JulMSx.js → mcp-app-renderer-CNPl_E2S.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-BOCq2t4w.js → mcp-oauth-BEjgJ8S3.js} +1 -1
  177. package/dist/client/assets/{members-xhc9KLWq.js → members-2EErop1f.js} +1 -1
  178. package/dist/client/assets/{memory-VJT_lSNB.js → memory-yCjJoNDd.js} +1 -1
  179. package/dist/client/assets/{mini-report-page-YCYdK64Z.js → mini-report-page-pXF8ynkH.js} +1 -1
  180. package/dist/client/assets/{mock-board-DcCpR66D.js → mock-board-TQ8xh6Aq.js} +1 -1
  181. package/dist/client/assets/{monaco-editor-CkJpx19Y.js → monaco-editor-Ddyrxhnd.js} +1 -1
  182. package/dist/client/assets/{monitoring-stats-row-Cqs-6_S6.js → monitoring-stats-row-k_A2nsj4.js} +1 -1
  183. package/dist/client/assets/{multi-select-DW-NLuy4.js → multi-select-C5JMY5HA.js} +1 -1
  184. package/dist/client/assets/{mustache-Q-UGwUPM.js → mustache-2Fdvii3x.js} +1 -1
  185. package/dist/client/assets/{new-project-dialog-BR_BdAk-.js → new-project-dialog-B7NjXDr6.js} +1 -1
  186. package/dist/client/assets/{oauth-callback-CRloSDTl.js → oauth-callback-D5zHk1ID.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-ai-provider-2uzVHGZK.js → oauth-callback-ai-provider-CpRYlq4A.js} +1 -1
  188. package/dist/client/assets/{onboarding-DkT61UKY.js → onboarding-C6mBd0qU.js} +1 -1
  189. package/dist/client/assets/{openai-conversation-Bo2nNgKY.js → openai-conversation-BwKz3ZIx.js} +1 -1
  190. package/dist/client/assets/{optimistic-project-sidebar-views-DfbOaqQl.js → optimistic-project-sidebar-views-B5YhmCh5.js} +1 -1
  191. package/dist/client/assets/{org-file-open-context-BHXXOOHS.js → org-file-open-context-CYLtVxSO.js} +1 -1
  192. package/dist/client/assets/{organization-choice-B8_GAtl-.js → organization-choice-BkwWYz2E.js} +1 -1
  193. package/dist/client/assets/{orgs-BuJtkddf.js → orgs-DlLwRria.js} +1 -1
  194. package/dist/client/assets/{page-seo-form-5o5iVNld.js → page-seo-form-D8Vne1WG.js} +1 -1
  195. package/dist/client/assets/{pair-gpe5yzQs.js → pair-BRY0hFhL.js} +1 -1
  196. package/dist/client/assets/{plan-ladder-DionZok_.js → plan-ladder-CqI-1A4t.js} +1 -1
  197. package/dist/client/assets/{popover-DH3Sl61q.js → popover-CXCkGdFS.js} +1 -1
  198. package/dist/client/assets/{post-calendar-tH162nXm.js → post-calendar-tlpRGAwb.js} +1 -1
  199. package/dist/client/assets/{post-editor-D1gbYoHN.js → post-editor-DrQUoUR6.js} +1 -1
  200. package/dist/client/assets/{preview-content-SoUMkfQg.js → preview-content-C6-NXNqs.js} +1 -1
  201. package/dist/client/assets/{preview-dialog-DPOzbA4Y.js → preview-dialog-mKfjI5de.js} +1 -1
  202. package/dist/client/assets/{preview-panel-CywYdFpJ.js → preview-panel-CYOl_eyz.js} +1 -1
  203. package/dist/client/assets/{profile-Dmb0eg_9.js → profile-DolOUYa-.js} +1 -1
  204. package/dist/client/assets/{project-app-view-gFsgFZJs.js → project-app-view-BT7xMHiG.js} +1 -1
  205. package/dist/client/assets/{project-feed-LDtRi-aY.js → project-feed-DzOwWrsA.js} +1 -1
  206. package/dist/client/assets/{project-icon-DxklOC8j.js → project-icon-BtaqB0ne.js} +1 -1
  207. package/dist/client/assets/project-reports-CUmY8yFG.js +1 -0
  208. package/dist/client/assets/project-tasks-B-l5cw7H.js +1 -0
  209. package/dist/client/assets/{projects-Dq4GZ2RU.js → projects-Ox8W8ETP.js} +1 -1
  210. package/dist/client/assets/{projects-empty-state-LXUf6lw8.js → projects-empty-state-C6gu1t-4.js} +1 -1
  211. package/dist/client/assets/{prompts-DpoYq-C8.js → prompts-CoL_Tpxk.js} +1 -1
  212. package/dist/client/assets/record-editor-BrASt4GH.js +1 -0
  213. package/dist/client/assets/{redirect-editor-h2jfnY0r.js → redirect-editor-lIGVngPQ.js} +1 -1
  214. package/dist/client/assets/{reports-BkGvj-AQ.js → reports-BEsbbpXT.js} +1 -1
  215. package/dist/client/assets/reports-C91C_dGk.js +1 -0
  216. package/dist/client/assets/{reports-onboarding-D2nAyEQg.js → reports-onboarding-nf8zCR8E.js} +1 -1
  217. package/dist/client/assets/{reports-tab-C4Iuixxf.js → reports-tab-B-zoXuhY.js} +2 -2
  218. package/dist/client/assets/{repositories-CInM2D5H.js → repositories-C6qG4TgY.js} +1 -1
  219. package/dist/client/assets/{repository-binding-ebck0c8n.js → repository-binding-CKlCwDDd.js} +1 -1
  220. package/dist/client/assets/{repository-import-picker-CTs8TUdw.js → repository-import-picker-BWcgounQ.js} +1 -1
  221. package/dist/client/assets/{repository-picker-BwC54VM6.js → repository-picker-DJEubVOt.js} +1 -1
  222. package/dist/client/assets/{require-capability-C0TsXxTO.js → require-capability-CMsD4Xq5.js} +1 -1
  223. package/dist/client/assets/{required-auth-layout-D4fpdDYn.js → required-auth-layout-DXP1Sqka.js} +1 -1
  224. package/dist/client/assets/{reset-password-BW6tqvrs.js → reset-password-YWpHSvq5.js} +1 -1
  225. package/dist/client/assets/{resizable-DENddsry.js → resizable-Cvf4_ymQ.js} +1 -1
  226. package/dist/client/assets/{resolve-tab-icon-BGgWJEJh.js → resolve-tab-icon-D9ziRjGB.js} +1 -1
  227. package/dist/client/assets/{review-settings-KWioU3vH.js → review-settings-Btnt9yMf.js} +1 -1
  228. package/dist/client/assets/{rich-text-link-control-DdGTIpxo.js → rich-text-link-control-D3iH-JTZ.js} +1 -1
  229. package/dist/client/assets/{roles-B73i-5IT.js → roles-BVDu3Xxj.js} +1 -1
  230. package/dist/client/assets/route-Bt9vgrKS.js +1 -0
  231. package/dist/client/assets/{route-Do1Yrs9w.js → route-D7ZfYats.js} +1 -1
  232. package/dist/client/assets/{route-CwP5bQeO.js → route-DgSk67PK.js} +1 -1
  233. package/dist/client/assets/{runnable-block-editor-Dl0N0zCW.js → runnable-block-editor-Yuh74xe3.js} +1 -1
  234. package/dist/client/assets/{sandbox-lifecycle-context-B_NAJSjm.js → sandbox-lifecycle-context-C5QKAHul.js} +1 -1
  235. package/dist/client/assets/{schema-bIq2BT73.js → schema-XbMJIWRo.js} +1 -1
  236. package/dist/client/assets/{scroll-area-DgvMLOUX.js → scroll-area-rRniZYni.js} +1 -1
  237. package/dist/client/assets/{search-input-Dxc4Q9oE.js → search-input-f14Hs9DC.js} +1 -1
  238. package/dist/client/assets/{search-toggle-BB2lVgeF.js → search-toggle-ydmpt0vj.js} +1 -1
  239. package/dist/client/assets/{secret-picker-CBx3NT_r.js → secret-picker-DA-ZCB_H.js} +1 -1
  240. package/dist/client/assets/{secrets-Bds2fazx.js → secrets-CQ_mYMKv.js} +1 -1
  241. package/dist/client/assets/{sections-editor-BHKheRNV.js → sections-editor-CWdchB_1.js} +1 -1
  242. package/dist/client/assets/{select-ERtFaSl0.js → select-Bur9VSDp.js} +1 -1
  243. package/dist/client/assets/{select-model-DMNOi0UH.js → select-model-zDpmpaQm.js} +1 -1
  244. package/dist/client/assets/{seo-editor-Cl9glbjm.js → seo-editor-DKGGKomG.js} +1 -1
  245. package/dist/client/assets/{separator-CuY7Q1Gl.js → separator-B9VOmM03.js} +1 -1
  246. package/dist/client/assets/{settings-tab-D7GiwWK4.js → settings-tab-DZnwlssY.js} +1 -1
  247. package/dist/client/assets/{sheet-nJD4St3t.js → sheet-BB4O5OwT.js} +1 -1
  248. package/dist/client/assets/{shell-layout-CsK_iJoM.js → shell-layout-BirRSTwU.js} +1 -1
  249. package/dist/client/assets/{skills-BpYdnG8K.js → skills-BKzwcH1e.js} +1 -1
  250. package/dist/client/assets/{sso-CUH5oWF7.js → sso-Cc-0CboC.js} +1 -1
  251. package/dist/client/assets/{suggestion-CVmYJ2-l.js → suggestion-IyavxmVa.js} +1 -1
  252. package/dist/client/assets/{switch-BhR8nlxD.js → switch-DcSUAA1j.js} +1 -1
  253. package/dist/client/assets/{synced-repos-C5uktY6M.js → synced-repos-flwxau-o.js} +1 -1
  254. package/dist/client/assets/{tab-icon-glyph-DDGnTEUb.js → tab-icon-glyph-9bAxbZkC.js} +1 -1
  255. package/dist/client/assets/{table-BghtXeZn.js → table-CRO39QUH.js} +1 -1
  256. package/dist/client/assets/{tabs-BdEjeb3h.js → tabs-Bc9RHMFB.js} +1 -1
  257. package/dist/client/assets/{task-board-CC3VTzd7.js → task-board-Cd9YAvG-.js} +1 -1
  258. package/dist/client/assets/{task-route-CzV6Ggve.js → task-route-CkQytW7C.js} +1 -1
  259. package/dist/client/assets/{task-status-MdR-wgNu.js → task-status-BOm3EuKx.js} +1 -1
  260. package/dist/client/assets/{taskboard-analytics-CjgkuySj.js → taskboard-analytics-OFa_uhmF.js} +1 -1
  261. package/dist/client/assets/{tasks-B7Pdi00T.js → tasks-BG9XYgI5.js} +1 -1
  262. package/dist/client/assets/tasks-D5n9wt3t.js +1 -0
  263. package/dist/client/assets/{textarea-CFMwKhM9.js → textarea-DDxcalk2.js} +1 -1
  264. package/dist/client/assets/{thread-analytics-BeZ0CZhF.js → thread-analytics-DOsXcQeb.js} +1 -1
  265. package/dist/client/assets/{thread-button-DdmUMrmT.js → thread-button-ch7Mep8K.js} +1 -1
  266. package/dist/client/assets/{thread-intent-Dg3GQUH3.js → thread-intent-2fXPHcAu.js} +1 -1
  267. package/dist/client/assets/{thread-route-C5YO0tNH.js → thread-route-2otWdMgJ.js} +1 -1
  268. package/dist/client/assets/{thread-route-BPJPEkBO.js → thread-route-BT336v58.js} +1 -1
  269. package/dist/client/assets/{thread-sheet-body-Ci751mbw.js → thread-sheet-body-BbK1ZoYh.js} +1 -1
  270. package/dist/client/assets/{toggle-group-DLp7Wh-7.js → toggle-group-CdYcnuUH.js} +1 -1
  271. package/dist/client/assets/{toolbar-icon-button-CMClok1k.js → toolbar-icon-button-DUnRowf-.js} +1 -1
  272. package/dist/client/assets/{tooltip-17PKNCMM.js → tooltip-Dmxy6Iwp.js} +1 -1
  273. package/dist/client/assets/{track-A4Z9PFKK.js → track-BtwskyUg.js} +1 -1
  274. package/dist/client/assets/{types-Zt76-Urn.js → types-Bme2CFon.js} +1 -1
  275. package/dist/client/assets/{usage-stats-Di6th6eM.js → usage-stats-DpcWm2xr.js} +1 -1
  276. package/dist/client/assets/{use-ai-providers-DXMywQjn.js → use-ai-providers-Br3ruvyh.js} +1 -1
  277. package/dist/client/assets/{use-automations-BIkU0R2i.js → use-automations-CnXDK6LR.js} +1 -1
  278. package/dist/client/assets/{use-autosave-D7Dc_Y3x.js → use-autosave-CTFYBfkb.js} +1 -1
  279. package/dist/client/assets/{use-chat-layout-state-CcVNkckt.js → use-chat-layout-state-DVSuwZNL.js} +1 -1
  280. package/dist/client/assets/{use-chat-navigation-EErRoLjo.js → use-chat-navigation-ouFeOKae.js} +1 -1
  281. package/dist/client/assets/{use-clock-tick-Bs0g2LMm.js → use-clock-tick-_TChM0B6.js} +1 -1
  282. package/dist/client/assets/{use-connect-companion-BV3jBqGw.js → use-connect-companion-BwQTXyWc.js} +1 -1
  283. package/dist/client/assets/{use-connection-hWK0p_4I.js → use-connection-KD1C-9SB.js} +1 -1
  284. package/dist/client/assets/{use-copy-eIJpbbHo.js → use-copy-DbnPtzRq.js} +1 -1
  285. package/dist/client/assets/{use-create-virtual-mcp-CFCczIE_.js → use-create-virtual-mcp-aO-X73SS.js} +1 -1
  286. package/dist/client/assets/{use-date-fns-locale-CViyxf02.js → use-date-fns-locale-CaAoeC3-.js} +1 -1
  287. package/dist/client/assets/{use-debounced-autosave-B4SAaEhH.js → use-debounced-autosave-BAYPxxZJ.js} +1 -1
  288. package/dist/client/assets/{use-debounced-value-Dws83Fd6.js → use-debounced-value-B8x7v3h2.js} +1 -1
  289. package/dist/client/assets/{use-deco-credits-YDPWVl4H.js → use-deco-credits-8WOAM4-s.js} +1 -1
  290. package/dist/client/assets/{use-decopilot-events-BlCOqvv5.js → use-decopilot-events-Cq-KvUjE.js} +1 -1
  291. package/dist/client/assets/{use-delete-connection-CEwDeoWa.js → use-delete-connection-Bffk9q4E.js} +1 -1
  292. package/dist/client/assets/{use-deployment-admin-B2zM8cA7.js → use-deployment-admin-D0HzXml2.js} +1 -1
  293. package/dist/client/assets/{use-ensure-project-folder-jggJOZhf.js → use-ensure-project-folder-CB3UqvjF.js} +1 -1
  294. package/dist/client/assets/{use-fast-preview-draft-url-B8A09d5h.js → use-fast-preview-draft-url-SLEqabcE.js} +1 -1
  295. package/dist/client/assets/{use-file-configs-WonDx6od.js → use-file-configs-CL6vJq8e.js} +1 -1
  296. package/dist/client/assets/{use-infinite-scroll-CvbHrO1A.js → use-infinite-scroll-CZDZwEPK.js} +1 -1
  297. package/dist/client/assets/{use-join-requests-Dkum0YOb.js → use-join-requests-DDvLcfrT.js} +1 -1
  298. package/dist/client/assets/{use-main-panel-tabs-DM4i9k_8.js → use-main-panel-tabs-CMbieCSL.js} +1 -1
  299. package/dist/client/assets/{use-mcp-auth-status-CifzBBCu.js → use-mcp-auth-status-BUlD-JC0.js} +1 -1
  300. package/dist/client/assets/{use-mcp-client-C7yhsDUq.js → use-mcp-client-DtG-9LNW.js} +1 -1
  301. package/dist/client/assets/{use-mcp-prompts-BZp7FUGA.js → use-mcp-prompts-Dv23JU44.js} +1 -1
  302. package/dist/client/assets/{use-mcp-tools-B-fAu-Lb.js → use-mcp-tools-CZKyId72.js} +1 -1
  303. package/dist/client/assets/{use-members-muYuUKl8.js → use-members-3vohvwE9.js} +1 -1
  304. package/dist/client/assets/{use-mobile-h60o0kDh.js → use-mobile-Bym6FABz.js} +1 -1
  305. package/dist/client/assets/{use-navigate-to-agent-DpJjb9Ad.js → use-navigate-to-agent-nbLDGPuK.js} +1 -1
  306. package/dist/client/assets/use-new-blocks-editor-0oELLtma.js +1 -0
  307. package/dist/client/assets/{use-open-billing-url-CqRpsDrV.js → use-open-billing-url-cGocgOTK.js} +1 -1
  308. package/dist/client/assets/{use-org-auth-client-CPl2reDK.js → use-org-auth-client-CtCYentb.js} +1 -1
  309. package/dist/client/assets/{use-org-fs-DuUomCai.js → use-org-fs-C77pAkF9.js} +1 -1
  310. package/dist/client/assets/{use-org-repo-syncs-4sBt09GE.js → use-org-repo-syncs-UmpiXEvv.js} +1 -1
  311. package/dist/client/assets/{use-org-sso-DHgm8_xi.js → use-org-sso-wmpr49G0.js} +1 -1
  312. package/dist/client/assets/{use-organization-roles-BV3iU524.js → use-organization-roles-Q3cNmSGK.js} +1 -1
  313. package/dist/client/assets/{use-organization-settings-C9LFE9dH.js → use-organization-settings-DZQdd38B.js} +1 -1
  314. package/dist/client/assets/{use-panel-navigate-BoWMxqfw.js → use-panel-navigate-RzIXYjdO.js} +1 -1
  315. package/dist/client/assets/{use-project-scope-Bq9_CxnF.js → use-project-scope--vhdJJ3J.js} +1 -1
  316. package/dist/client/assets/{use-releases-BBaBeMfL.js → use-releases-DBacCX5N.js} +1 -1
  317. package/dist/client/assets/{use-reports-diagnostic-G1zwph_0.js → use-reports-diagnostic-E_xn3Cgh.js} +1 -1
  318. package/dist/client/assets/{use-secrets-Ct52FR_G.js → use-secrets-17a_0cVZ.js} +1 -1
  319. package/dist/client/assets/{use-section-preview-base-DOtesyFx.js → use-section-preview-base-DMPxgaEy.js} +1 -1
  320. package/dist/client/assets/{use-session-runtime-DCyDQGsH.js → use-session-runtime-CLu1QwVf.js} +1 -1
  321. package/dist/client/assets/{use-tags-pyv75hiG.js → use-tags-CuO6eJY0.js} +1 -1
  322. package/dist/client/assets/{use-task-board-analytics-BJyBRcs8.js → use-task-board-analytics-Cs7ROzdM.js} +1 -1
  323. package/dist/client/assets/{use-task-board-events-Bz8ommc9.js → use-task-board-events-Bv_4UM8-.js} +1 -1
  324. package/dist/client/assets/{use-task-metadata-C_1RsAj0.js → use-task-metadata--tlu5jBn.js} +1 -1
  325. package/dist/client/assets/{use-thread-analytics-CVwQKqXG.js → use-thread-analytics-aeaCgBwr.js} +1 -1
  326. package/dist/client/assets/{use-thread-outputs-Co6FxFAd.js → use-thread-outputs-9ggjmILA.js} +1 -1
  327. package/dist/client/assets/useInfiniteQuery-BXyifNbh.js +1 -0
  328. package/dist/client/assets/{useQueries-4js0NmfF.js → useQueries-Cqn1aSQB.js} +1 -1
  329. package/dist/client/assets/useSuspenseInfiniteQuery-Cwe5IPmT.js +1 -0
  330. package/dist/client/assets/{users-DFphiLPz.js → users-CsqcV55O.js} +1 -1
  331. package/dist/client/assets/{utils-7wkojbq8.js → utils-BH5vUtAG.js} +1 -1
  332. package/dist/client/assets/{variant-calendar-hQb_6Knv.js → variant-calendar-DkQ9UHQw.js} +1 -1
  333. package/dist/client/assets/{variant-matcher-override-B7_BSavX.js → variant-matcher-override-BYGwhlzE.js} +1 -1
  334. package/dist/client/assets/{view-mode-toggle-I-eGSI3M.js → view-mode-toggle-X9MGawfA.js} +1 -1
  335. package/dist/client/assets/{virtual-mcp-CZeK9_Zn.js → virtual-mcp-BWO_9b2I.js} +1 -1
  336. package/dist/client/index.html +1 -1
  337. package/dist/server/cli.js +2 -2
  338. package/dist/server/server.js +2 -2
  339. package/package.json +1 -1
  340. package/dist/client/assets/agent-app-BjfUl_0f.js +0 -1
  341. package/dist/client/assets/agent-deck-qy9xDSPf.js +0 -1
  342. package/dist/client/assets/agent-library-DmwLcUW5.js +0 -1
  343. package/dist/client/assets/agent-library-file-BhecoKGR.js +0 -1
  344. package/dist/client/assets/agent-settings-Cg5Aii0O.js +0 -1
  345. package/dist/client/assets/agent-site-editor-code-nkVrwBja.js +0 -2
  346. package/dist/client/assets/agent-view-5udch1Zo.js +0 -1
  347. package/dist/client/assets/api-keys-TdHJQ9tA.js +0 -1
  348. package/dist/client/assets/app-editor-BMX-mtW-.js +0 -1
  349. package/dist/client/assets/flat-project-DkZ9ut26.js +0 -1
  350. package/dist/client/assets/library-DlOv00rX.js +0 -1
  351. package/dist/client/assets/project-reports-DA_DcXq0.js +0 -1
  352. package/dist/client/assets/project-tasks-6O_Gw9mX.js +0 -1
  353. package/dist/client/assets/record-editor-CiRyw1Eu.js +0 -1
  354. package/dist/client/assets/reports-C9YxMpwW.js +0 -1
  355. package/dist/client/assets/route-XcpEoNu9.js +0 -1
  356. package/dist/client/assets/tasks-Lm1DDtMB.js +0 -1
  357. package/dist/client/assets/use-new-blocks-editor-DRLHOxEJ.js +0 -1
  358. package/dist/client/assets/useInfiniteQuery-SgJx2z0R.js +0 -1
  359. package/dist/client/assets/useSuspenseInfiniteQuery-BCL_lLFm.js +0 -1
@@ -1 +1 @@
1
- import{au as n,bK as t,av as e,bL as p,bM as b,bN as c,bO as h}from"./index-CsKm2ubF.js";const i=500;n({title:e().max(i),url:e().max(i),icon:e().max(i)});const s=n({keyId:e().max(i),modelId:e().max(i),title:e().max(i).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const y=n({tiers:n({fast:s,smart:s,thinking:s,image:s,web_search:s,deep_research:s})});n({tiers:n({fast:s.optional(),smart:s.optional(),thinking:s.optional()})});const v=50,m=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).max(i).regex(m).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).max(i).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:b(e().max(i)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const w=n({voice_mode:t().optional(),home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow Studio surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),chat_harness_sandbox_only:t().optional().describe("Run every chat with the claude-code harness in its own sandbox instead of hosted Decopilot. On by default (see DEFAULT_ON_FLAGS); a deployment without hosted sandboxes keeps Decopilot regardless."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:t().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),new_blocks_editor:t().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in."),hide_default_blog_blocks:t().optional().describe("Hide the `deco-cms/blog` built-in post blocks everywhere a post is written — the inserter, the format briefs, and generated drafts — so only the site's own `site/sections/Blog/Post/*` blocks are eligible. Off by default. Blocks already present in a post keep rendering; this only governs what can be added.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model","chat_harness_sandbox_only"]);function x(a,r){const d=a?.[r];return u.has(r)?d!==!1:d===!0}function A(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:b(c(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:c(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as G,w as O,y as S,A as a,m as b,x as o};
1
+ import{au as n,bK as t,av as e,bL as p,bM as b,bN as c,bO as h}from"./index-BSg0zn4o.js";const i=500;n({title:e().max(i),url:e().max(i),icon:e().max(i)});const s=n({keyId:e().max(i),modelId:e().max(i),title:e().max(i).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const y=n({tiers:n({fast:s,smart:s,thinking:s,image:s,web_search:s,deep_research:s})});n({tiers:n({fast:s.optional(),smart:s.optional(),thinking:s.optional()})});const v=50,m=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).max(i).regex(m).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).max(i).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:b(e().max(i)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const w=n({voice_mode:t().optional(),home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow Studio surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),chat_harness_sandbox_only:t().optional().describe("Run every chat with the claude-code harness in its own sandbox instead of hosted Decopilot. On by default (see DEFAULT_ON_FLAGS); a deployment without hosted sandboxes keeps Decopilot regardless."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:t().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),new_blocks_editor:t().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in."),hide_default_blog_blocks:t().optional().describe("Hide the `deco-cms/blog` built-in post blocks everywhere a post is written — the inserter, the format briefs, and generated drafts — so only the site's own `site/sections/Blog/Post/*` blocks are eligible. Off by default. Blocks already present in a post keep rendering; this only governs what can be added.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model","chat_harness_sandbox_only"]);function x(a,r){const d=a?.[r];return u.has(r)?d!==!1:d===!0}function A(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:b(c(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:c(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as G,w as O,y as S,A as a,m as b,x as o};
@@ -1 +1 @@
1
- import{r as d,bm as T,bq as ce,j as b,bo as _,bF as ae,dd as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-CsKm2ubF.js";import{e as de}from"./select-ERtFaSl0.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
1
+ import{r as d,bm as T,bq as ce,j as b,bo as _,bF as ae,dd as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-BSg0zn4o.js";import{e as de}from"./select-Bur9VSDp.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
@@ -1 +1 @@
1
- import{c as b,l as w,j as a,h as j}from"./index-CsKm2ubF.js";import{i as v}from"./SearchMd-D2OTQFME.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
1
+ import{c as b,l as w,j as a,h as j}from"./index-BSg0zn4o.js";import{i as v}from"./SearchMd-Be3GMdpX.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
@@ -1 +1 @@
1
- import{c as K,r as C,l as B,j as a}from"./index-CsKm2ubF.js";import{i as I}from"./SearchMd-D2OTQFME.js";import{i as M}from"./X-DJN31Nfv.js";import{I as O}from"./icon-button-CMxGCJDP.js";function H(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{H as S};
1
+ import{c as K,r as C,l as B,j as a}from"./index-BSg0zn4o.js";import{i as I}from"./SearchMd-Be3GMdpX.js";import{i as M}from"./X-DLYqFuX1.js";import{I as O}from"./icon-button-C_Cp_29j.js";function H(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{H as S};
@@ -1 +1 @@
1
- import{c as x,b as d,j as l}from"./index-CsKm2ubF.js";import{s as j}from"./User01-DcjCdViP.js";import{t as E}from"./Users01-DR0sKzFO.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
1
+ import{c as x,b as d,j as l}from"./index-BSg0zn4o.js";import{s as j}from"./User01-4R_aUn4g.js";import{t as E}from"./Users01-v0Jyk4Ot.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
@@ -1 +1 @@
1
- import{c as j,b as y,j as s,n as C,fp as $,E as F,r as N,aS as L,B as D,a7 as E,t as _}from"./index-CsKm2ubF.js";import{i as O}from"./AlertCircle-BOqaZFXA.js";import{s as B}from"./Plus-CP_oegJ7.js";import{s as A}from"./User01-DcjCdViP.js";import{t as R}from"./Users01-DR0sKzFO.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-D_5RxDc9.js";import{I as z}from"./input-BhJziSQi.js";import{L as w}from"./label-Bfbz6otc.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-ERtFaSl0.js";import{T as W}from"./textarea-CFMwKhM9.js";import{u as X,a as Y}from"./use-secrets-Ct52FR_G.js";import{R as Z}from"./require-capability-C0TsXxTO.js";import"./X-DJN31Nfv.js";import"./index-CZNblbQa.js";import"./Check-ChBZV9OV.js";import"./ChevronUp-wB5J5ntl.js";import"./access-gate-RAaA3S4I.js";import"./capability-load-error-dMTmC9nh.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?A:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(K,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(B,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{ze as default};
1
+ import{c as j,b as y,j as s,n as C,fp as $,E as F,r as N,aS as L,B as D,a7 as E,t as _}from"./index-BSg0zn4o.js";import{i as O}from"./AlertCircle-rm9vrEtW.js";import{s as B}from"./Plus-DC_7nhbs.js";import{s as A}from"./User01-4R_aUn4g.js";import{t as R}from"./Users01-v0Jyk4Ot.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-C8AdhrG0.js";import{I as z}from"./input-DyRkn4pn.js";import{L as w}from"./label-Du2iAGWx.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-Bur9VSDp.js";import{T as W}from"./textarea-DDxcalk2.js";import{u as X,a as Y}from"./use-secrets-17a_0cVZ.js";import{R as Z}from"./require-capability-CMsD4Xq5.js";import"./X-DLYqFuX1.js";import"./index-hcdrCnDP.js";import"./Check-ycQN3J2t.js";import"./ChevronUp-B8UqekRj.js";import"./access-gate-CDypY0PL.js";import"./capability-load-error-Gcuy_zZQ.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?A:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(K,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(B,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{ze as default};
@@ -1 +1 @@
1
- import{c as Jt,b as Yt,r as j,l as oe,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-CsKm2ubF.js";import{u as _o}from"./chat-context-DiXJfhIa.js";import{u as fs}from"./use-new-blocks-editor-DRLHOxEJ.js";import{E as jo,F as Eo,G as ko,H as wo,I as Ro,J as Vo,K as To,V as No,L as Ao,N as Bn,O as Mo,Q as Po,C as cs,y as us,e as Co,f as Do,j as Ko,u as Bo,T as Ln,U as Lo,W as Fo,X as Io,Y as Oo,Z as zo,p as rs,A as kt,_ as $o,$ as Ho,w as Fn,a0 as Go,a1 as qo,a2 as is,a3 as In,a4 as On,a5 as zn,a6 as As,a7 as Wo,a8 as Uo,z as Jo,a9 as $n,aa as Yo,ab as Hn,ac as Gn,M as Qo,ad as qn,ae as lt,d as Xo,af as qt,ag as Zo,ah as er,ai as Ms,aj as tr}from"./runnable-block-editor-Dl0N0zCW.js";import{c as sr}from"./repository-binding-ebck0c8n.js";import{n as nr,t as ar}from"./ChevronUp-wB5J5ntl.js";import{a6 as oa,b as ms,aj as or,z as rr,$ as Wn,I as Un}from"./agent-icon-DGDGzDPg.js";import{S as Bt}from"./scroll-area-DgvMLOUX.js";import{b as ct,T as ut,a as dt}from"./tooltip-17PKNCMM.js";import{m as ir,u as lr,P as cr}from"./mustache-Q-UGwUPM.js";import{aq as ra,c as Is,ar as ia,G as ur,ag as Rt,a4 as Ds,as as Ks,ah as xt,a5 as Lt,j as dr,l as mr,g as fr,r as ls,ak as pr,af as Wt,at as tt,au as Jn,a6 as Ps,ae as bt,ad as Ut,av as hr,aw as gr,K as vr,ax as Sr,ai as Yn,_ as Qn,ay as yr,az as wt,aA as br,aB as xr,aC as _r,aD as Xn,aE as jr,aF as Er,aG as kr,ac as wr,aH as Rr,aI as Vr,aJ as Tr,aK as Nr,ab as Ar,aL as Mr}from"./claim-phase-copy-Dd94Yylk.js";import{a as Pr}from"./Copy01-C4tt-_AN.js";import{a as Bs,e as la}from"./UserSquare-CQZbVq0f.js";import{b as Zn}from"./Tool01-B_dduyQs.js";import{s as ea}from"./Image01-B4l0All3.js";import{s as Cr}from"./Plus-CP_oegJ7.js";import{s as Dr}from"./Trash01-C4sE_NGv.js";import{i as Ls}from"./ZoomOut-UxLkEy8R.js";import{u as Kr,a as ta,b as Br,K as Lr,P as Fr,C as Ir,D as Or,c as zr}from"./core.esm-BND19H8a.js";import{u as $r,s as Hr,a as ds,S as Gr,v as qr}from"./rich-text-link-control-DdGTIpxo.js";import{a as Wr,P as sa,b as Ur}from"./page-seo-form-5o5iVNld.js";import{u as Jr,A as Yr}from"./use-section-preview-base-DOtesyFx.js";import{b as na,a as Qr}from"./variant-matcher-override-B7_BSavX.js";import"./use-panel-navigate-BoWMxqfw.js";import"./thread-route-C5YO0tNH.js";import"./use-project-scope-Bq9_CxnF.js";import"./autosend-D7eBSjvh.js";import"./thread-intent-Dg3GQUH3.js";import"./use-mcp-client-C7yhsDUq.js";import"./auth-Cs4gU6Jt.js";import"./backoff-8mStPHYB.js";import"./task-board-CC3VTzd7.js";import"./schema-bIq2BT73.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-BlCOqvv5.js";import"./use-ai-providers-DXMywQjn.js";import"./use-chat-navigation-EErRoLjo.js";import"./location-zK0I9Ia6.js";import"./use-organization-settings-C9LFE9dH.js";import"./use-session-runtime-DCyDQGsH.js";import"./Sun-BAfhxpb-.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-gpe5yzQs.js";import"./LinkBroken01-CNbQoBrl.js";import"./Check-ChBZV9OV.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-CfObde3Q.js";import"./use-copy-eIJpbbHo.js";import"./usage-stats-Di6th6eM.js";import"./markdown-Bx2p9OGj.js";import"./dialog-D_5RxDc9.js";import"./X-DJN31Nfv.js";import"./org-file-open-context-BHXXOOHS.js";import"./use-mobile-h60o0kDh.js";import"./use-clock-tick-Bs0g2LMm.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-d-JulMSx.js";import"./types-Zt76-Urn.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-CZQ4II3C.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-BOqaZFXA.js";import"./XClose-D0KEw8ZX.js";import"./ShoppingBag01-BfMGWAwv.js";import"./SearchMd-D2OTQFME.js";import"./shell-layout-CsK_iJoM.js";import"./avatar-BeFOPb9J.js";import"./User01-DcjCdViP.js";import"./Building02-BG4IPwQ3.js";import"./download-app-dialog-RU0ZYOfB.js";import"./CheckCircle-D49A5hws.js";import"./Monitor01-BJ23zU-n.js";import"./command-CxzepSXP.js";import"./index-CzdEzd_G.js";import"./integration-icon-CTkfXIOR.js";import"./project-icon-DxklOC8j.js";import"./new-project-dialog-BR_BdAk-.js";import"./ArrowLeft-BsFMaTJ5.js";import"./input-BhJziSQi.js";import"./label-Bfbz6otc.js";import"./repository-import-picker-CTs8TUdw.js";import"./use-navigate-to-agent-DpJjb9Ad.js";import"./repository-picker-BwC54VM6.js";import"./LinkExternal01-D73wyIiU.js";import"./useInfiniteQuery-SgJx2z0R.js";import"./infiniteQueryObserver-DaqTQDCS.js";import"./collection-search-D2PZ787d.js";import"./use-debounced-value-Dws83Fd6.js";import"./required-auth-layout-D4fpdDYn.js";import"./use-org-sso-DHgm8_xi.js";import"./sheet-nJD4St3t.js";import"./use-connection-hWK0p_4I.js";import"./Palette-BKZ5R7W4.js";import"./Link01-DZVgeeWe.js";import"./use-mcp-prompts-BZp7FUGA.js";import"./index-CyAv4Ino.js";import"./form-juLaUBrF.js";import"./use-thread-outputs-Co6FxFAd.js";import"./file-type-icon-CfnH9Twn.js";import"./popover-DH3Sl61q.js";import"./utils-7wkojbq8.js";import"./monaco-editor-CkJpx19Y.js";import"./editor-KC3-U1Hv.js";import"./calendar-oXQevmTG.js";import"./textarea-CFMwKhM9.js";import"./select-ERtFaSl0.js";import"./index-CZNblbQa.js";import"./switch-BhR8nlxD.js";import"./combobox-Cio7ykEV.js";import"./alert-dialog-CiySziMD.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-qBk1AINH.js";import"./DotsVertical-BWwzMO41.js";import"./search-input-Dxc4Q9oE.js";import"./tabs-BdEjeb3h.js";import"./use-file-configs-WonDx6od.js";import"./asset-utils-Co49serB.js";import"./use-chat-layout-state-CcVNkckt.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-DLp7Wh-7.js";import"./sandbox-git-api-DTIjDZTr.js";import"./ArrowUp-Bi8YJGtE.js";import"./CreditCard01-DCvyy0kz.js";import"./Key01-DNpH0NnO.js";import"./Users01-DR0sKzFO.js";import"./section-preview-url-7zfngvgW.js";function Xr(v){return v.schema?.definitions??v.schema?.$defs??{}}function ca(v,e){const u=Xr(e),p=u[btoa(v)];if(!p)return[];const h=[p];if(Array.isArray(p.allOf)){const k=p.allOf.find(w=>typeof w.$ref=="string")?.$ref;if(typeof k=="string"){const w=u[k.replace("#/definitions/","")];w&&h.push(w)}}return h}function Zr(v,e){for(const u of ca(v,e)){const p=typeof u.image=="string"?u.image:void 0;if(p?.includes("{{{"))return p}}function ei(v,e){if(!e)return;const u=ra(v);if(!u)return;const p=Zr(u.resolveType,e);if(!p)return;const h=jo(p,u.data);if(h)return Eo(h)}const ti={escape:ko};function si(v,e){for(const u of ca(v,e)){const p=typeof u.title=="string"?u.title:void 0;if(p?.includes("{{"))return p}}function ni(v,e){if(!e)return;const u=ra(v);if(u)try{const p=si(u.resolveType,e);return p&&ir.render(p,u.data,{},ti).trim()||void 0}catch{return}}function ai(v){const e=Jt.c(13),{icon:u,label:p,className:h}=v;let k;e[0]!==h?(k=oe("size-3.5",h),e[0]=h,e[1]=k):k=e[1];let w;e[2]!==u||e[3]!==k?(w=n.jsx(u,{className:k}),e[2]=u,e[3]=k,e[4]=w):w=e[4];let y;e[5]!==p||e[6]!==w?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:w})}),e[5]=p,e[6]=w,e[7]=y):y=e[7];let T;e[8]!==p?(T=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=T):T=e[9];let b;return e[10]!==y||e[11]!==T?(b=n.jsxs(ct,{children:[y,T]}),e[10]=y,e[11]=T,e[12]=b):b=e[12],b}const oi="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function aa(v){return Array.from({length:v},(e,u)=>({id:crypto.randomUUID(),index:u}))}function ua(v){return v.map((e,u)=>({...e,index:u}))}function ri(v,e){if(e===v.length)return v;if(e<v.length)return ua(v.slice(0,e));const u=Array.from({length:e-v.length},(p,h)=>({id:crypto.randomUUID(),index:v.length+h}));return[...v,...u]}function da(v){const e=Jt.c(44),{section:u,raw:p,meta:h,decofile:k}=v,w=Yt(),y=fs(),T=u.isSavedBlock===!0,b=u.isMultivariate===!0;let X;e[0]!==h||e[1]!==p?(X=p&&h?ei(p,h):void 0,e[0]=h,e[1]=p,e[2]=X):X=e[2];const me=X;let Ke;e[3]!==h||e[4]!==b||e[5]!==p||e[6]!==T?(Ke=p&&h&&!T&&!b?ni(p,h):void 0,e[3]=h,e[4]=b,e[5]=p,e[6]=T,e[7]=Ke):Ke=e[7];const Be=Ke;let Te;e[8]!==k||e[9]!==h||e[10]!==p||e[11]!==u?(Te=Ao(p,u,k,h),e[8]=k,e[9]=h,e[10]=p,e[11]=u,e[12]=Te):Te=e[12];const re=Te;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,ge=T?ms:b?oa:la;let $;e[16]!==b||e[17]!==T?($=T?{color:ur}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=T,e[18]=$):$=e[18];const c=$;let O;e[19]!==ge||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(ge,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(or,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=ge,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==me?(l=me&&n.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=l):l=e[23];let J;e[24]!==y||e[25]!==c?(J=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:c}),e[24]=y,e[25]=c,e[26]=J):J=e[26];const G=y?"shrink":"flex-1",ke=u.isHidden&&"line-through opacity-50";let Ne;e[27]!==ke||e[28]!==G?(Ne=oe("min-w-0 truncate text-sm font-medium",G,ke),e[27]=ke,e[28]=G,e[29]=Ne):Ne=e[29];const qe=Be??u.label;let _e;e[30]!==Ne||e[31]!==qe?(_e=n.jsx("span",{className:Ne,children:qe}),e[30]=Ne,e[31]=qe,e[32]=_e):_e=e[32];let d;e[33]!==V||e[34]!==y||e[35]!==re||e[36]!==w?(d=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:w("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),re&&n.jsx(Bn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):re&&n.jsx(Bn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=re,e[36]=w,e[37]=d):d=e[37];let M;return e[38]!==_e||e[39]!==d||e[40]!==O||e[41]!==l||e[42]!==J?(M=n.jsxs(n.Fragment,{children:[O,l,J,_e,d]}),e[38]=_e,e[39]=d,e[40]=O,e[41]=l,e[42]=J,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function ma(v,e,u){if(u)return Mo({selected:e});const p=v.isSavedBlock===!0,h=v.isMultivariate===!0;return oe("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":p?ii:h?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Cs(v,e){return oe("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function ci(v){const e=Jt.c(90),{section:u,raw:p,meta:h,decofile:k,sortableId:w,selected:y,onSelect:T,onDelete:b,onDuplicate:X,onMakeReusable:me,onToggleHidden:Ke,onToggleLazy:Be,onAddVariant:Te,onDetach:re}=v,r=Yt(),V=fs(),ge=p?Is(p.__resolveType??""):!1,$=u.isHidden===!0,c=ge||$;let O;e[0]!==u?(O=ia(u),e[0]=u,e[1]=O):O=e[1];const l=O;let J;e[2]!==w?(J={id:w,animateLayoutChanges:mi},e[2]=w,e[3]=J):J=e[3];const{attributes:G,listeners:ke,setNodeRef:Ne,transform:qe,isDragging:_e}=$r(J);let d;e[4]!==qe?(d=Ir.Transform.toString(qe?{...qe,x:0}:null),e[4]=qe,e[5]=d):d=e[5];const M=_e?0:void 0;let We;e[6]!==d||e[7]!==M?(We={transform:d,opacity:M},e[6]=d,e[7]=M,e[8]=We):We=e[8];const C=We;let Ue;e[9]!==u?(Ue=Ro(u),e[9]=u,e[10]=Ue):Ue=e[10];const z=Ue,mt="button",fe=0;let ze;e[11]!==T?(ze=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},e[11]=T,e[12]=ze):ze=e[12];const _t=_e?"cursor-grabbing":"cursor-pointer";let Le;e[13]!==V||e[14]!==u||e[15]!==y||e[16]!==_t?(Le=oe("touch-none transition-colors",_t,ma(u,y,V)),e[13]=V,e[14]=u,e[15]=y,e[16]=_t,e[17]=Le):Le=e[17];let ie;e[18]!==k||e[19]!==h||e[20]!==p||e[21]!==u?(ie=n.jsx(da,{section:u,raw:p,meta:h,decofile:k}),e[18]=k,e[19]=h,e[20]=p,e[21]=u,e[22]=ie):ie=e[22];const le=!V&&!u.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Cs(c,ge)),onClick:P=>{P.stopPropagation(),Be()},onPointerDown:di,children:n.jsx(Ls,{className:oe("h-3.5 w-3.5",ge&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ae=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ke,children:$?n.jsx(Zn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Cs(c,$)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ui,children:$?n.jsx(Zn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=vo,A=To;let ce;e[23]!==r?(ce=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ce):ce=e[24];const we=oe(Cs(c,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Me;e[25]!==A||e[26]!==ce||e[27]!==we?(Me=n.jsx(A,{label:ce,classicClassName:we}),e[25]=A,e[26]=ce,e[27]=we,e[28]=Me):Me=e[28];let Re;e[29]!==V||e[30]!==ge||e[31]!==Be||e[32]!==u.isMultivariate||e[33]!==r?(Re=V&&!u.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Be()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=ge,e[31]=Be,e[32]=u.isMultivariate,e[33]=r,e[34]=Re):Re=e[34];let H;e[35]!==X?(H=P=>{P.stopPropagation(),X()},e[35]=X,e[36]=H):H=e[36];let ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=ue):ue=e[37];let je;e[38]!==r?(je=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=je):je=e[39];let pe;e[40]!==H||e[41]!==je?(pe=n.jsxs(Kt,{onClick:H,children:[ue,je]}),e[40]=H,e[41]=je,e[42]=pe):pe=e[42];let ne;e[43]!==V||e[44]!==l||e[45]!==Te||e[46]!==r?(ne=l&&n.jsxs(Kt,{className:oe(!V&&No),onClick:P=>{P.stopPropagation(),Te()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Te,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==V||e[49]!==z||e[50]!==me||e[51]!==r?(he=z&&n.jsxs(Kt,{className:oe(!V&&oi),onClick:P=>{P.stopPropagation(),me()},children:[V?n.jsx(ms,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=me,e[51]=r,e[52]=he):he=e[52];let ae;e[53]!==V||e[54]!==re||e[55]!==u.isMultivariate||e[56]!==u.isSavedBlock||e[57]!==r?(ae=u.isSavedBlock===!0&&!u.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),re()},children:[V?n.jsx(la,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=re,e[55]=u.isMultivariate,e[56]=u.isSavedBlock,e[57]=r,e[58]=ae):ae=e[58];let Pe;e[59]!==b?(Pe=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Pe):Pe=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Dr,{className:"h-4 w-4"}),e[61]=ve):ve=e[61];let Ve;e[62]!==r?(Ve=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ve):Ve=e[63];let Ee;e[64]!==Pe||e[65]!==Ve?(Ee=n.jsxs(Kt,{variant:"destructive",onClick:Pe,children:[ve,Ve]}),e[64]=Pe,e[65]=Ve,e[66]=Ee):Ee=e[66];let Se;e[67]!==Re||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==ae||e[72]!==Ee?(Se=n.jsxs(So,{align:"end",className:"w-44",children:[Re,pe,ne,he,ae,Ee]}),e[67]=Re,e[68]=pe,e[69]=ne,e[70]=he,e[71]=ae,e[72]=Ee,e[73]=Se):Se=e[73];let ye;e[74]!==B||e[75]!==Me||e[76]!==Se?(ye=n.jsxs(B,{children:[Me,Se]}),e[74]=B,e[75]=Me,e[76]=Se,e[77]=ye):ye=e[77];let $e;return e[78]!==G||e[79]!==ke||e[80]!==T||e[81]!==Ne||e[82]!==C||e[83]!==Le||e[84]!==ie||e[85]!==le||e[86]!==Ae||e[87]!==ye||e[88]!==ze?($e=n.jsxs("div",{ref:Ne,style:C,...G,...ke,role:mt,tabIndex:fe,onClick:T,onKeyDown:ze,className:Le,children:[ie,le,Ae,ye]}),e[78]=G,e[79]=ke,e[80]=T,e[81]=Ne,e[82]=C,e[83]=Le,e[84]=ie,e[85]=le,e[86]=Ae,e[87]=ye,e[88]=ze,e[89]=$e):$e=e[89],$e}function ui(v){return v.stopPropagation()}function di(v){return v.stopPropagation()}function mi(){return!1}function Fs(v){const e=Jt.c(11),{canAddSection:u,onAddSection:p,className:h,size:k}=v,w=Yt();let y;e[0]!==h?(y=oe("w-full",h),e[0]=h,e[1]=y):y=e[1];const T=!u;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cr,{size:14}),e[2]=b):b=e[2];let X;e[3]!==w?(X=w("sectionsEditor.sectionList.addSectionButton"),e[3]=w,e[4]=X):X=e[4];let me;return e[5]!==p||e[6]!==k||e[7]!==y||e[8]!==T||e[9]!==X?(me=n.jsxs(Vt,{type:"button",variant:"outline",size:k,className:y,disabled:T,onClick:p,children:[b,X]}),e[5]=p,e[6]=k,e[7]=y,e[8]=T,e[9]=X,e[10]=me):me=e[10],me}function fi(v){const e=Jt.c(101),{listKey:u,rawSections:p,sections:h,meta:k,decofile:w,selectedIndex:y,onSelect:T,onReorder:b,onDelete:X,onDuplicate:me,onMakeReusable:Ke,onToggleHidden:Be,onToggleLazy:Te,onAddVariant:re,onDetach:r,onAddSection:V,canAddSection:ge}=v,$=ge===void 0?!0:ge,c=Yt(),O=fs();let l;e[0]!==h.length?(l=()=>aa(h.length),e[0]=h.length,e[1]=l):l=e[1];const[J,G]=j.useState(l),[ke,Ne]=j.useState(null),[qe,_e]=j.useState(u),[d,M]=j.useState(h.length),We=j.useRef(!1);qe!==u?(_e(u),M(h.length),G(aa(h.length))):d!==h.length&&(M(h.length),G(Ce=>ri(Ce,h.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let Ue;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ue={coordinateGetter:Hr},e[3]=Ue):Ue=e[3];const z=Kr(ta(Fr,C),ta(Lr,Ue));let mt;e[4]!==J?(mt=J.map(pi),e[4]=J,e[5]=mt):mt=e[5];const fe=mt;let ze;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=Ce=>{Ne(String(Ce.active.id))},e[6]=ze):ze=e[6];const _t=ze;let Le;e[7]!==fe||e[8]!==b?(Le=Ce=>{Ne(null);const{active:L,over:D}=Ce;if(!D||L.id===D.id)return;const Fe=fe.indexOf(String(L.id)),Ze=fe.indexOf(String(D.id));Fe===-1||Ze===-1||(G(nt=>ua(ds([...nt],Fe,Ze))),We.current=!0,requestAnimationFrame(()=>{We.current=!1}),b?.(Fe,Ze))},e[7]=fe,e[8]=b,e[9]=Le):Le=e[9];const ie=Le;let le;e[10]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{Ne(null)},e[10]=le):le=e[10];const Ae=le;let B,A,ce,we,Me,Re,H,ue,je,pe,ne,he,ae,Pe,ve;if(e[11]!==ke||e[12]!==$||e[13]!==O||e[14]!==w||e[15]!==J||e[16]!==fe||e[17]!==ie||e[18]!==k||e[19]!==V||e[20]!==re||e[21]!==X||e[22]!==r||e[23]!==me||e[24]!==Ke||e[25]!==T||e[26]!==Be||e[27]!==Te||e[28]!==p||e[29]!==h||e[30]!==y||e[31]!==z||e[32]!==c){Pe=Symbol.for("react.early_return_sentinel");e:{const Ce=L=>{We.current||T(L)};if(e[48]!==ke||e[49]!==$||e[50]!==O||e[51]!==J||e[52]!==V||e[53]!==p||e[54]!==h||e[55]!==c){const L=ke?J.find(D=>D.id===ke):null;if(we=L!=null?h[L.index]:null,ce=L!=null?p[L.index]:void 0,J.length===0){let D;e[59]!==c?(D=c("sectionsEditor.sectionList.noSections"),e[59]=c,e[60]=D):D=e[60];let Fe;e[61]!==D?(Fe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:D}),e[61]=D,e[62]=Fe):Fe=e[62];const Ze=Fe;let nt;e[63]!==$||e[64]!==O||e[65]!==Ze||e[66]!==V?(nt=O?Ze:n.jsxs("div",{className:"space-y-2",children:[Ze,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Ze,e[66]=V,e[67]=nt):nt=e[67],Pe=nt;break e}ae=oe(L&&"cursor-grabbing"),e[48]=ke,e[49]=$,e[50]=O,e[51]=J,e[52]=V,e[53]=p,e[54]=h,e[55]=c,e[56]=ce,e[57]=we,e[58]=ae}else ce=e[56],we=e[57],ae=e[58];A=Or,ue=z,je=zr,pe=_t,ne=ie,he=Ae,B=Gr,Re=fe,H=qr,ve="space-y-1",Me=J.map(L=>{const D=h[L.index];return D?n.jsx(ci,{sortableId:L.id,section:D,raw:p[L.index],meta:k,decofile:w,selected:y===L.index,onSelect:()=>Ce(L.index),onDelete:()=>X(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>Ke(L.index),onToggleHidden:()=>Be(L.index),onToggleLazy:()=>Te(L.index),onAddVariant:()=>re(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=ke,e[12]=$,e[13]=O,e[14]=w,e[15]=J,e[16]=fe,e[17]=ie,e[18]=k,e[19]=V,e[20]=re,e[21]=X,e[22]=r,e[23]=me,e[24]=Ke,e[25]=T,e[26]=Be,e[27]=Te,e[28]=p,e[29]=h,e[30]=y,e[31]=z,e[32]=c,e[33]=B,e[34]=A,e[35]=ce,e[36]=we,e[37]=Me,e[38]=Re,e[39]=H,e[40]=ue,e[41]=je,e[42]=pe,e[43]=ne,e[44]=he,e[45]=ae,e[46]=Pe,e[47]=ve}else B=e[33],A=e[34],ce=e[35],we=e[36],Me=e[37],Re=e[38],H=e[39],ue=e[40],je=e[41],pe=e[42],ne=e[43],he=e[44],ae=e[45],Pe=e[46],ve=e[47];if(Pe!==Symbol.for("react.early_return_sentinel"))return Pe;let Ve;e[68]!==Me||e[69]!==ve?(Ve=n.jsx("div",{className:ve,children:Me}),e[68]=Me,e[69]=ve,e[70]=Ve):Ve=e[70];let Ee;e[71]!==B||e[72]!==Re||e[73]!==H||e[74]!==Ve?(Ee=n.jsx(B,{items:Re,strategy:H,children:Ve}),e[71]=B,e[72]=Re,e[73]=H,e[74]=Ve,e[75]=Ee):Ee=e[75];let Se;e[76]!==ce||e[77]!==we||e[78]!==O||e[79]!==w||e[80]!==k?(Se=we?n.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(we,!1,O)),children:n.jsx(da,{section:we,raw:ce,meta:k,decofile:w})}):null,e[76]=ce,e[77]=we,e[78]=O,e[79]=w,e[80]=k,e[81]=Se):Se=e[81];let ye;e[82]!==Se?(ye=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:Se}),document.body),e[82]=Se,e[83]=ye):ye=e[83];let $e;e[84]!==A||e[85]!==ue||e[86]!==je||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==Ee||e[91]!==ye?($e=n.jsxs(A,{sensors:ue,collisionDetection:je,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[Ee,ye]}),e[84]=A,e[85]=ue,e[86]=je,e[87]=pe,e[88]=ne,e[89]=he,e[90]=Ee,e[91]=ye,e[92]=$e):$e=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==ae||e[98]!==$e||e[99]!==P?(st=n.jsxs("div",{className:ae,children:[$e,P]}),e[97]=ae,e[98]=$e,e[99]=P,e[100]=st):st=e[100],st}function pi(v){return v.id}function hi(v,e,u,p){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const h=e.trim();if(!h)return Rt(v,u,p)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ds(v,u,p)}:{kind:"noop"};const k=Ks(v,u,p);if(!k)return{kind:"error",reason:"unreadable-rule"};if(k.blockKey)return{kind:"updateBlock",blockKey:k.blockKey,blockData:xt(k.resolveType,k.data,h)};const w=cs(h),y=us(w,u);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:w,blockData:xt(k.resolveType,k.data,h),reference:Lt(w)}}function Fc({orgSlug:v,virtualMcpId:e,branch:u,previewReady:p=!0,previewUrl:h,currentPath:k,activePageBlockKey:w=null,activeGlobalBlockKey:y=null,externalSelection:T,onSaved:b,initialEditSeo:X=!1,onExitSeo:me,onSelectRoot:Ke,onViewJsonFile:Be,onFocusedBlockChange:Te,onVariantPreviewOverride:re}){const r=Yt(),V=_o(),ge=V?.taskId??null,$=p?{orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h}:null,{data:c,isLoading:O}=Co($),{data:l,isLoading:J}=Do($),G=fs(),ke=V?.virtualMcpId,qe=sr(ke===e?e:null)?.metadata?.siteSlug??null,_e=Jr({virtualMcpId:e,sandboxUrl:h}),[d,M]=j.useState(null),[We,C]=j.useState(null),[Ue,z]=j.useState(null),[mt,fe]=j.useState(0),[ze,_t]=j.useState(void 0),[Le,ie]=j.useState(null),[le,Ae]=j.useState(null),[B,A]=j.useState([]),ce=j.useRef(null),[we,Me]=j.useState(B.length);we!==B.length&&(Me(B.length),requestAnimationFrame(()=>{ce.current&&(ce.current.scrollTop=0)}));const[Re,H]=j.useState(0),[ue,je]=j.useState(null),[pe,ne]=j.useState(null),[he,ae]=j.useState(null),[Pe,ve]=j.useState(!1),[Ve,Ee]=j.useState(!1),Se=j.useRef(null),[ye,$e]=j.useState(!0),[P,st]=j.useState(!1),[Ce,L]=j.useState(!1),[D,Fe]=j.useState(X),[Ze,nt]=j.useState(X);X&&!Ze&&(nt(!0),Fe(!0),M(null),C(null),z(null),A([])),!X&&Ze&&nt(!1);const[fa,Qt]=j.useState(null),[Os,ps]=j.useState(void 0),[zs,jt]=j.useState([]),[$s,Ft]=j.useState(0),[Ie,Je]=j.useState(0),[pa,De]=j.useState(null),[Tt,Oe]=j.useState(null),[Hs,Gs]=j.useState(null),ha=yo(),ga=`${v}/${e}/${u}`,Xt=Ko({orgSlug:v,virtualMcpId:e,branch:u}),[va,Sa]=j.useState(k),[ya,ba]=j.useState(w),[xa,_a]=j.useState(y);(va!==k||ya!==w||xa!==y)&&(queueMicrotask(()=>Xt.flush()),Sa(k),ba(w),_a(y),M(null),C(null),z(null),fe(0),ie(null),Ae(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1));const Y=Bo({orgSlug:v,virtualMcpId:e,branch:u}),It=Xo((t,s)=>{Y.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Zt=lr({orgSlug:v,virtualMcpId:e,branch:u}),[Nt,At]=j.useState(!1),q=j.useRef(null),qs=j.useRef(null),at=j.useRef(null),ot=j.useRef(null),hs=j.useRef({}),He=j.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=j.useState(null);if(!p||O||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!c||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=dr(c),Q=!!y,te=Q?null:mr(ka,k,w),g=Q?y:te?.key??null,gs=Q&&y?c[y]:void 0,Ws=Q&&y&&gs?fr(y,gs):Q&&y?y:"",Ot=!Q&&g&&c[g]?c[g]:null,vs=D&&c&&l&&g&&te?Ln(c,{kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},l):null,wa=D?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=D?Lo(es):void 0,Us=vs?.seoTypeOptions??[],Js=D&&l?Fo(l):"",Ss=fa??Ra??{},ts=D&&vs?Wr(Ss,vs):null,Ys=D&&ts&&Io(es)?ls(ts,l):null,Qs=D?Oo(c,l)?.seoData:void 0,de=Q?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,c??{}),et=de.length>1,se=Math.min(mt,de.length-1),Ge=de[se],K=Ge?.sections??[],be=rs(K,c),ys=!Q&&pr(Ot?.sections);if(Q&&y&&Hs!==y){Gs(y);const t=K[0],s=be[0];if(t&&s){M(0),Je(0),A([]);const a=kt(t,s,c);a&&(C(a.data),z(a.resolveType),Oe(null),De(null))}}!Q&&Hs!==null&&Gs(null),He.current={rawSections:K,parsedSections:be,decofile:c??{},activePageKey:g,pageVariants:de,variantIndex:se,sectionVariantIndex:Ie,selectedSectionIndex:d};const Va=()=>({multivariate:ys,index:se,variants:de.map(t=>({rule:t.rule}))}),bs=(t,s)=>{if(!re)return;if(!g||!ys||t.length<=1){re(null);return}const a=na(g,{multivariate:!0,index:s,variants:t},c,l);re(a.length>0?a:null)},xs=re&&g&&ys&&et&&!O&&!J?g:null;if(xs!==ja&&(Ea(xs),xs)){const t=de.map(a=>({rule:a.rule})),s=se;queueMicrotask(()=>bs(t,s))}const Mt=(t,s,a)=>{if(!re)return;if(!g){re(null);return}const o=Va(),i=na(g,o,c,l);if(!t||s<0){re(i.length>0?i:null);return}const m=Qr({pageKey:g,page:o,sectionIndex:s,sectionLazy:be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:l}),f=[...i,...m];re(f.length>0?f:null)},ft=(t,s,a,o=d??-1,i=!1)=>{const m=tt(t,s);if(!m){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const x=Jn(m,lt)[a];if(!x){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const R=hr(x.value,c);C(R?.data??null),z(R?.resolveType??null);const{resolveType:S,formValue:E}=Wt(x.rule,c,l??void 0);Oe(S),De(E),i&&Mt(m,o,a)},zt=T?.index;if(T!==void 0&&(T?.seq??null)!==ze&&(_t(T?.seq??null),typeof zt=="number")){const t=K[zt],s=be[zt];if(t&&s)if(M(zt),Je(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,c);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Oe(null),De(null)}}const $t={orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h??void 0,siteSlug:qe},_s=Ue&&l?ls(Ue,l):null,Ye=(t,s)=>{if(!g)return;q.current&&(clearTimeout(q.current),q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=qt(c,g,t,se,de);Y.mutate({blockKey:g,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Te?.(null),M(null),L(!1),C(null),z(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1)},Ta=(t,s)=>{const a=He.current.sectionVariantIndex,o=qs.current;q.current&&(clearTimeout(q.current),q.current=null,o&&(o.sectionIndex!==s||o.sectionVariantIndex!==a)&&o.write());const i=()=>{const{rawSections:m,parsedSections:f,decofile:x,activePageKey:R,pageVariants:S,variantIndex:E}=He.current,_=m[s];if(!_)return;const W=f[s];if(!W)return;if(W.isSavedBlock){const F=tr(_,W);if(!F)return;Y.mutate({blockKey:F,data:t},{onSuccess:()=>b?.(),onError:U=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:U.message}))});return}if(!R)return;const Z={...x[R]},ee=[...m];if(W.isMultivariate){const F=tt(_,W);if(!F||!R)return;const U=Tr(F,a,t);ee[s]=wt(_,W,U)}else if(W.isHidden){const F=Is(_.__resolveType),U=F?{..._.section}:{..._},I=Array.isArray(U.variants)?[...U.variants]:[];I[0]&&(I[0]={...I[0],value:t}),U.variants=I,F?ee[s]={..._,section:U}:ee[s]=U}else W.isLazy?ee[s]={..._,section:t}:ee[s]=t;if(S.length>1){const F=Z.sections,U=[...F?.variants??[]];U[E]&&(U[E]={...U[E],value:ee}),Z.sections={...F,variants:U}}else Z.sections=ee;Y.mutate({blockKey:R,data:Z},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))})};qs.current={sectionIndex:s,sectionVariantIndex:a,write:i},q.current=setTimeout(()=>{q.current=null,i()},Ms)},Na=t=>{M(t),Je(0),A([]),H(i=>i+1);const s=K[t],a=be[t];if(Te?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,c);if(!o){C(null),z(null),Oe(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Oe(null),De(null),Mt(null,t,0)},Xs=t=>{const s=t;C(s),d!==null&&Ta(s,d)},js=t=>{if(!g||!c||!l||!te)return;const s={kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},a=Ln(c,s,l);a&&Xt.save(g,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[g];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...hs.current};return hs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Zs=(t,s)=>{g&&(hs.current[t]=s,js())},Aa=(t,s)=>{if(!g)return;const a=ds([...K],t,s);d!==null&&(d===t?M(s):t<d&&s>=d?M(d-1):t>d&&s<=d&&M(d+1)),Ye(a)},Ma=t=>{if(!g)return;const s=K.filter((a,o)=>o!==t);d===t?Pt():d!==null&&d>t&&M(d-1),Ye(s)},Pa=t=>{if(!g)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,Zo(s)),d!==null&&d>t&&M(d+1),Ye(a)},Ca=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a)return;const o=a.isHidden?Er(s):kr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Da=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a||a.isMultivariate)return;const o=jr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Ka=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,c);if(!o?.data)return;const{name:i,...m}=o.data,f=[...K];a.isLazy?f[t]={...s,section:m}:f[t]=m,d===t&&Pt(),Ye(f)},Ba=t=>{if(!g)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{ve(!1),M(a),Je(0),A([]),H(f=>f+1);const o=s[a],i=rs(s,c)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const m=kt(o,i,c);if(!m){C(null),z(null),Oe(null),De(null);return}C(m.data),z(m.resolveType),Oe(null),De(null)}})},en=t=>{Se.current=t.append,ve(!0)},La=t=>{const s=Se.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ve(!1),Se.current=null},tn=t=>{if(d===null)return;const s=K[d],a=be[d];!s||!a?.isMultivariate||(Je(t),A([]),H(o=>o+1),ft(s,a,t,d,!0))},Fa=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=xr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const m=[...K];m[d]=wt(s,a,i);const f=i.variants;let x=Ie;t===Ie?x=Math.min(t,f.length-1):t<Ie&&(x=Ie-1),Je(x),A([]),H(R=>R+1),ft(m[d],a,x),Ye(m)},Ia=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=_r(o,t),m=[...K];m[d]=wt(s,a,i);const f=t+1;Je(f),A([]),H(x=>x+1),ft(m[d],a,f),Ye(m)},Oa=(t,s)=>{if(d===null||!g||t===s)return;const a=K[d],o=be[d];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const m=yr(i,t,s),f=[...K];f[d]=wt(a,o,m);let x=Ie;Ie===t?x=s:t<Ie&&s>=Ie?x=Ie-1:t>Ie&&s<=Ie&&(x=Ie+1),Je(x),ft(f[d],o,x),Ye(f)},Ht=t=>{const s=t??d;if(s===null||!g)return;const a=K[s],o=be[s];if(!a||!o)return;const i=gr(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const m=[...K];m[s]=i.section;const f=rs(m,c)[s];if(!f?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Je(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,f,i.newVariantIndex,s),Ye(m)},sn=()=>{if(d===null||!g)return;const t=K[d],s=be[d];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=br(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...K];i[d]=o;const m=rs(i,c)[d];if(!m)return;Je(0),Oe(null),De(null),A([]),H(x=>x+1);const f=kt(o,m,c);f?(C(f.data),z(f.resolveType)):(C(null),z(null)),Mt(null,d,0),Ye(i)},za=async t=>{if(ue===null||!g)return;const s=us(t,c);if(s){N.error(s);return}const a=K[ue],o=be[ue];if(!a||!o)return;const i=kt(a,o,c);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const m={...i.data,name:t};try{await Y.mutateAsync({blockKey:t,data:m});const f=[...K];f[ue]={__resolveType:t},await Y.mutateAsync({blockKey:g,data:qt(c,g,f,se,de)}),d===ue&&Pt(),je(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(f){N.error(f instanceof Error?f.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},nn=Ge?.rule;if(et&&d===null&&le===null&&nn){const{resolveType:t,formValue:s}=Wt(nn,c??{},l??void 0);Ae(t),ie(s)}const Ct=l?$o(l):[],Es=l&&c?Ho(l,c):[],an=!Q&&!!(_e&&l&&c),on=le&&l?ls(le,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(Vr(s,t,l)>0))try{await Zt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},rn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i={...a[s]},m={...i.sections},f=[...m.variants??[]],x=f[o],R=x?.rule;if(Rt(R,a,l)){const S=R?.__resolveType??"",E=a[S],_=typeof E?.name=="string"?E.name:S,{__resolveType:W,...Z}=t;Y.mutate({blockKey:S,data:xt(W??"",Z,_)},{onSuccess:()=>b?.(),onError:ee=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ee.message}))});return}x&&(f[o]={...x,rule:t}),i.sections={...m,variants:f},Y.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ms)},ln=t=>{Ae(t);const s=t?Yn(t,l):{__resolveType:Qn};ie(t?s:{}),rn(s)},cn=t=>{const s=t;ie(s);const a=le?{__resolveType:le,...s}:{...s};rn(a)},un=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i=a[s],m=i?.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[o];if(!R)return;const S=bt(R.rule,a,l),E=Lt(t);x[o]={...R,rule:E};const _={...a,[s]:{...i,sections:{...f,variants:x}}},{resolveType:W,formValue:Z}=Wt(E,_,l??void 0);Ae(W),ie(Z);try{await Y.mutateAsync({blockKey:s,data:_[s]}),S&&S!==t&&await Et(S,_),b?.()}catch(ee){N.error(ee instanceof Error?ee.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},dn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=He.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const Z=(_.variants??[])[a]?.rule;if(Rt(Z,m,l)){const I=Z?.__resolveType??"",Xe=m[I],rt=typeof Xe?.name=="string"?Xe.name:I,{__resolveType:St,...it}=t;Y.mutate({blockKey:I,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const ee=Xn(_,a,t),F=[...o];F[s]=wt(S,E,ee);const U=qt(m,f,F,R,x);Y.mutate({blockKey:f,data:U},{onSuccess:()=>b?.(),onError:I=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:I.message}))})},Ms))},$a=t=>{Oe(t);const s=t?Yn(t,l):{__resolveType:Qn};De(t?s:{}),dn(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};dn(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(s===null||!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],Z=bt(W[a]?.rule,m,l),ee=Lt(t),F=Xn(_,a,ee),U=[...o];U[s]=wt(S,E,F);const I=qt(m,f,U,R,x),Xe={...m,[f]:I},{resolveType:rt,formValue:St}=Wt(ee,Xe,l??void 0);Oe(rt),De(St);try{await Y.mutateAsync({blockKey:f,data:I}),Z&&Z!==t&&await Et(Z,Xe),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Q&&!te)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:k})});if(Q&&!gs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const xe=d!==null?be[d]??null:null,mn=d!==null?K[d]:null,fn=mn&&xe?.isMultivariate?tt(mn,xe):null,ht=fn?Jn(fn,lt):[],ss=Math.min(Ie,Math.max(ht.length-1,0)),Dt=ht[ss]??null,gt=xe?.isMultivariate===!0,ks=d!==null&&xe!==null,vt=ks&&(gt||!!(_s&&We)),qa=vt&&!Q&&xe?.isSavedBlock===!0,Qe=Q||qa,pn=Q?Ws:xe?.label??"",Wa=Tt&&l?ls(Tt,l):null,hn=(t,s)=>s&&G?`${t} · ${s}`:t,gn=xe?xe.variantOf??xe.label:"",Ua=(()=>{const t=gt&&Dt?Dt.label:null;return t?G?[hn(gn,t)]:[xe.label,t]:[xe?.label??""]})(),ws=hn(te?.name??"",et?Ge?.label:null),ns=vt&&(!Q||B.length>0)?Q?[Ws,...B]:[ws,...Ua,...B]:[],vn=D&&te?[te.name,"SEO",...zs]:[],Sn=r("sectionsEditor.pageVariantTabs.variantsLabel"),yn=P&&te?[te.name,Sn]:Ce&&te&&xe?[ws,gn,Sn]:[],as=yn.length>0?yn:vn.length>0?vn:Qe?ns.length>0?ns:[pn]:ns.length>0?ns:[ws],bn=ks&&!gt&&!xe?.isHidden&&!!g,Ja=Qe||!Q&&et&&!!Ge||bn,Ya=ks&&!gt&&!Q&&B.length===0&&!!xe&&ia(xe)&&!!g,Qa=G&&vt&&!Ce&&gt&&B.length===0&&!!Dt,xn=G&&B.length>0?Fn(B[B.length-1]):null,Xa=B.length>1?Fn(B[B.length-2]):null,_n=Qe?pn:vt?xe?.label??"":te?.name??"",Za=P||Ce?r("sectionsEditor.pageVariantTabs.variantsLabel"):D?r("sectionsEditor.panelSections.seo"):xn??_n,jn=Ce?xe?.variantOf??xe?.label??"":P||D?te?.name??"":xn?Xa??_n:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?te?.name??"":te?.path??"",Rs=!P&&!Ce&&!D&&!vt&&!Qe,eo=!G&&!D&&!Q&&gt&&B.length===0,Gt=()=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const t=c[g],s=vr(t.sections,K);if(!s)return;const a=Sr(s);Y.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),M(null),C(null),z(null),A([]),ie(null),Ae(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},os=(t,s,a)=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const o=c[g],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const m=i;if(!Array.isArray(m.variants))return;const f=t([...m.variants]);if(!f)return;const x=Rr(m,f),R={...c,[g]:{...o,sections:x}};Y.mutate({blockKey:g,data:R[g]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const E of S)await Et(E,R)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{ne(null),fe(t),M(null),C(null),z(null),A([]);const s=de[t]?.rule,{resolveType:a,formValue:o}=Wt(s,c??{},l??void 0);Ae(a),ie(o),bs(de.map(i=>({rule:i.rule})),t)},En=(t,s)=>{if(t===s)return;let a=se;se===t?a=s:t<se&&s>=se?a=se-1:t>se&&s<=se&&(a=se+1),fe(a);const o=ds(de.map(i=>({rule:i.rule})),t,s);bs(o,a),os(i=>ds(i,t,s))},kn=t=>{const s=de[t]?.rule,a=bt(s,c??{},l??void 0);os(o=>o.length<=1?null:(o.splice(t,1),o),()=>{de.length-1===1?fe(0):t<se?fe(se-1):t===se&&fe(Math.max(0,t-1)),M(null),C(null),z(null),A([]),ie(null),Ae(null)},a)},to=()=>{const t=de.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!wr(s.rule)).map(({variant:s})=>bt(s.rule,c??{},l??void 0)).filter(s=>!!s);os(s=>{const a=Nr({variants:s}),o=s[a];return o?[{...o,rule:Ar()}]:null},()=>{fe(0),M(null),C(null),z(null),A([]),ie(null),Ae(null),st(!1)},t)},wn=t=>{os(s=>Mr(s,t),()=>{fe(t+1),M(null),C(null),z(null),A([]),ie(null),Ae(null)})},so=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const a=He.current.activePageKey,o=He.current.decofile;if(!a)return;const i=o[a],m=i.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=R.rule,E=s.trim();At(!0);try{if(!E){if(!Rt(S,o,l)){ne(null);return}const U=S.__resolveType??"";x[t]={...R,rule:Ds(S,o,l)};const I={...o,[a]:{...i,sections:{...f,variants:x}}};await Y.mutateAsync({blockKey:a,data:I[a]}),await Et(U,I),ne(null),b?.();return}const _=Ks(S,o,l);if(!_){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(_.blockKey){await Y.mutateAsync({blockKey:_.blockKey,data:xt(_.resolveType,_.data,E)}),ne(null),b?.();return}const W=cs(E),Z=us(W,o);if(Z){N.error(Z);return}const ee=xt(_.resolveType,_.data,E);let F=null;try{await Y.mutateAsync({blockKey:W,data:ee}),F=W,x[t]={...R,rule:Lt(W)},await Y.mutateAsync({blockKey:a,data:{...i,sections:{...f,variants:x}}}),F=null}catch(U){throw F&&await Zt.mutateAsync({blockKey:F}).catch(()=>{}),U}ne(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:E})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(a===null||!f)return;const S=o[a],E=i[a];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],Z=W[t];if(!Z?.rule||typeof Z.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ee=Z.rule,F=s.trim();At(!0);const U=async I=>{const Xe={..._,variants:I},rt=[...o];rt[a]=wt(S,E,Xe);const St=qt(m,f,rt,R,x);return await Y.mutateAsync({blockKey:f,data:St}),{...m,[f]:St}};try{if(!F){if(!Rt(ee,m,l)){ae(null);return}const yt=ee.__resolveType??"",Kn=[...W];Kn[t]={...Z,rule:Ds(ee,m,l)};const po=await U(Kn);await Et(yt,po),ae(null),b?.();return}const I=Ks(ee,m,l);if(!I){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(I.blockKey){await Y.mutateAsync({blockKey:I.blockKey,data:xt(I.resolveType,I.data,F)}),ae(null),b?.();return}const Xe=cs(F),rt=us(Xe,m);if(rt){N.error(rt);return}const St=xt(I.resolveType,I.data,F);let it=null;try{await Y.mutateAsync({blockKey:Xe,data:St}),it=Xe;const yt=[...W];yt[t]={...Z,rule:Lt(Xe)},await U(yt),it=null}catch(yt){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),yt}ae(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),b?.()}catch(I){N.error(I instanceof Error?I.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},Rn=async(t,s,a)=>{C(a);try{await Y.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s],x=f?.rule&&typeof f.rule=="object"?f.rule:void 0,R=async E=>{const _={...t,variants:E};return await Rn(o,t,_),{...i,[o]:_}},S=hi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const _=[...m];_[s]={...f,rule:S.inlinedRule};const W=await R(_);await Et(S.blockKey,W),b?.();return}if(S.kind==="updateBlock"){await Y.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let E=null;try{await Y.mutateAsync({blockKey:S.blockId,data:S.blockData}),E=S.blockId;const _=[...m];_[s]={...f,rule:S.reference},await R(_),E=null}catch(_){throw E&&await Zt.mutateAsync({blockKey:E}).catch(()=>{}),_}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s];if(!f)return;const x=bt(f.rule,i,l);m[s]={...f,rule:Lt(a)};const R={...t,variants:m},S={...i,[o]:R};try{await Rn(o,t,R),x&&x!==a&&await Et(x,S),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Vn=()=>{Pt()},Tn=t=>{Qt(t),js({inner:t})},Nn=t=>{ps(t),js({raw:t})},An=()=>{Qt(null),jt([])},Mn=()=>Ft(t=>t+1),Pn=()=>{Xt.flush(),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1),me?.()},oo=()=>{st(!1),L(!1),M(null),Fe(!0)},ro=()=>{D&&Pn(),M(null),st(!0)},io=()=>L(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Ce&&t<2){L(!1),t===0&&M(null);return}if(D){if(t===0){Pn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Q){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){Vn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&&gt&&Dt?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(B.slice(0,t-1-s))},Ns=as.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(er(as.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Qe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(rr,{className:"size-4"})}):null,lo=Qe||vt||D?Ja&&n.jsxs("div",{className:oe("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Q&&et&&Ge&&n.jsxs("button",{type:"button",onClick:Vn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Ge.label}),className:oe("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",qo),children:[n.jsx(Go,{rule:Ps(Ge.rule,c??{},l??void 0),matchers:Ct}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("div",{className:"flex-1"}),Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),bn&&n.jsx(is,{onClick:()=>Ht()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Zs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Fe(!0),children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Be&&g?Be():Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(is,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})})]}),Cn=n.jsxs(n.Fragment,{children:[n.jsx(Wo,{listKey:`${g??""}:${d??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ss,onSelect:tn,onRename:ae,onDuplicate:Ia,onDelete:Fa,onRemoveAll:sn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(As,{currentRt:Tt??"",currentLabel:Ut(Dt?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Dt?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${d??"none"}:${ss}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:oe(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${g??""}-${se}`,rawSections:K,sections:be,meta:l,decofile:c,selectedIndex:d,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:je,onToggleHidden:Ca,onToggleLazy:Da,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ve(!0),canAddSection:an})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&te&&n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Zs}),Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsxs("div",{className:oe("px-3 border-b",ye?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>$e(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-muted/40","aria-expanded":ye,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),ye?n.jsx(nr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ar,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ye&&n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Uo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||as.length>1)&&n.jsx(Jo,{crumbs:as,onSelect:Ts,onSelectRoot:()=>{Xt.flush(),Ke?Ke():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Za}),jn&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:jn})]}),Rs&&et&&Ge&&n.jsx($n,{variants:de,activeIndex:se,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ss,onSelect:tn,onManage:io,onRemoveAll:sn}),Rs&&!et&&n.jsx(is,{onClick:Gt}),Ya&&n.jsx(is,{onClick:()=>Ht()}),n.jsx(Yo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Be&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Ce?n.jsx(Hn,{onAdd:()=>Ht(),children:Cn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&&gt&&ht.length>0&&B.length===0&&Cn,n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Xs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en,onVariantMatcherOp:Q?ao:void 0})]},"editor-section-form"):Q?n.jsx(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Xs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en})},"editor-global-block"):D?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:an,onAddSection:()=>ve(!0)})})]},"editor-section-list"):fo,n.jsx(Qo,{open:ue!==null,onOpenChange:t=>{t||je(null)},defaultBlockId:ue!==null?cs(be[ue]?.label??""):"",isPending:Y.isPending,onSubmit:za}),_e&&n.jsx(Yr,{open:Pe,onOpenChange:t=>{ve(t),t||(Se.current=null)},meta:l,decofile:c,previewBaseUrl:_e,onSelect:La}),Ve&&g&&c&&n.jsx(cr,{open:Ve,onOpenChange:Ee,pageKey:g,decofile:c}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(de[pe]?.rule,c??{},l??void 0)?Ut(de[pe]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(de[pe]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(pe,t)},onOpenChange:t=>{!t&&!Nt&&ne(null)}}),he!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[he]?.rule,c??{},l??void 0)?Ut(ht[he]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(ht[he]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(he,t)},onOpenChange:t=>{!t&&!Nt&&ae(null)}})]})})}export{Fc as SectionsEditor};
1
+ import{c as Jt,b as Yt,r as j,l as oe,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-BSg0zn4o.js";import{u as _o}from"./chat-context-Dx9zNHfj.js";import{u as fs}from"./use-new-blocks-editor-0oELLtma.js";import{E as jo,F as Eo,G as ko,H as wo,I as Ro,J as Vo,K as To,V as No,L as Ao,N as Bn,O as Mo,Q as Po,C as cs,y as us,e as Co,f as Do,j as Ko,u as Bo,T as Ln,U as Lo,W as Fo,X as Io,Y as Oo,Z as zo,p as rs,A as kt,_ as $o,$ as Ho,w as Fn,a0 as Go,a1 as qo,a2 as is,a3 as In,a4 as On,a5 as zn,a6 as As,a7 as Wo,a8 as Uo,z as Jo,a9 as $n,aa as Yo,ab as Hn,ac as Gn,M as Qo,ad as qn,ae as lt,d as Xo,af as qt,ag as Zo,ah as er,ai as Ms,aj as tr}from"./runnable-block-editor-Yuh74xe3.js";import{c as sr}from"./repository-binding-CKlCwDDd.js";import{n as nr,t as ar}from"./ChevronUp-B8UqekRj.js";import{a6 as oa,b as ms,aj as or,z as rr,$ as Wn,I as Un}from"./agent-icon-BhZZd37x.js";import{S as Bt}from"./scroll-area-rRniZYni.js";import{b as ct,T as ut,a as dt}from"./tooltip-Dmxy6Iwp.js";import{m as ir,u as lr,P as cr}from"./mustache-2Fdvii3x.js";import{aq as ra,c as Is,ar as ia,G as ur,ag as Rt,a4 as Ds,as as Ks,ah as xt,a5 as Lt,j as dr,l as mr,g as fr,r as ls,ak as pr,af as Wt,at as tt,au as Jn,a6 as Ps,ae as bt,ad as Ut,av as hr,aw as gr,K as vr,ax as Sr,ai as Yn,_ as Qn,ay as yr,az as wt,aA as br,aB as xr,aC as _r,aD as Xn,aE as jr,aF as Er,aG as kr,ac as wr,aH as Rr,aI as Vr,aJ as Tr,aK as Nr,ab as Ar,aL as Mr}from"./claim-phase-copy-B4wRGWwJ.js";import{a as Pr}from"./Copy01-DFSuVPvj.js";import{a as Bs,e as la}from"./UserSquare-DJ8hiuYq.js";import{b as Zn}from"./Tool01-BNeCU30E.js";import{s as ea}from"./Image01-CgjyCWgG.js";import{s as Cr}from"./Plus-DC_7nhbs.js";import{s as Dr}from"./Trash01-BTpCOmuX.js";import{i as Ls}from"./ZoomOut-DFERFVow.js";import{u as Kr,a as ta,b as Br,K as Lr,P as Fr,C as Ir,D as Or,c as zr}from"./core.esm-B3puu65K.js";import{u as $r,s as Hr,a as ds,S as Gr,v as qr}from"./rich-text-link-control-D3iH-JTZ.js";import{a as Wr,P as sa,b as Ur}from"./page-seo-form-D8Vne1WG.js";import{u as Jr,A as Yr}from"./use-section-preview-base-DMPxgaEy.js";import{b as na,a as Qr}from"./variant-matcher-override-BYGwhlzE.js";import"./use-panel-navigate-RzIXYjdO.js";import"./thread-route-2otWdMgJ.js";import"./use-project-scope--vhdJJ3J.js";import"./autosend-C7DyeWiW.js";import"./thread-intent-2fXPHcAu.js";import"./use-mcp-client-DtG-9LNW.js";import"./auth-CWILNz-R.js";import"./backoff-8mStPHYB.js";import"./task-board-Cd9YAvG-.js";import"./schema-XbMJIWRo.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-Cq-KvUjE.js";import"./use-ai-providers-Br3ruvyh.js";import"./use-chat-navigation-ouFeOKae.js";import"./location-zK0I9Ia6.js";import"./use-organization-settings-DZQdd38B.js";import"./use-session-runtime-CLu1QwVf.js";import"./Sun-COaeigjT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BRY0hFhL.js";import"./LinkBroken01-C78kyif5.js";import"./Check-ycQN3J2t.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BUVugLgs.js";import"./use-copy-DbnPtzRq.js";import"./usage-stats-DpcWm2xr.js";import"./markdown-DienvDaS.js";import"./dialog-C8AdhrG0.js";import"./X-DLYqFuX1.js";import"./org-file-open-context-CYLtVxSO.js";import"./use-mobile-Bym6FABz.js";import"./use-clock-tick-_TChM0B6.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CNPl_E2S.js";import"./types-Bme2CFon.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-n3scD1Cq.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-rm9vrEtW.js";import"./XClose-BbdvFCiX.js";import"./ShoppingBag01-DNQzuGTX.js";import"./SearchMd-Be3GMdpX.js";import"./shell-layout-BirRSTwU.js";import"./avatar-Dl_cPf4a.js";import"./User01-4R_aUn4g.js";import"./Building02-BPTZeJ83.js";import"./download-app-dialog-URSdQ4ke.js";import"./CheckCircle-C2px0gfY.js";import"./Monitor01-DC2k418g.js";import"./command-Czt06b2r.js";import"./index-BmBDGBX2.js";import"./integration-icon-BiZmEnVi.js";import"./project-icon-BtaqB0ne.js";import"./new-project-dialog-B7NjXDr6.js";import"./ArrowLeft-q0aoA66K.js";import"./input-DyRkn4pn.js";import"./label-Du2iAGWx.js";import"./repository-import-picker-BWcgounQ.js";import"./use-navigate-to-agent-nbLDGPuK.js";import"./repository-picker-DJEubVOt.js";import"./LinkExternal01-Bn0SPqIC.js";import"./useInfiniteQuery-BXyifNbh.js";import"./infiniteQueryObserver-ByHfufml.js";import"./collection-search-CKuVhNj4.js";import"./use-debounced-value-B8x7v3h2.js";import"./required-auth-layout-DXP1Sqka.js";import"./use-org-sso-wmpr49G0.js";import"./sheet-BB4O5OwT.js";import"./use-connection-KD1C-9SB.js";import"./Palette-DOpFqZPK.js";import"./Link01-B8ajBJDc.js";import"./use-mcp-prompts-Dv23JU44.js";import"./index-BADmvvU8.js";import"./form-C_wkYdWR.js";import"./use-thread-outputs-9ggjmILA.js";import"./file-type-icon-D3P3r_PX.js";import"./popover-CXCkGdFS.js";import"./utils-BH5vUtAG.js";import"./monaco-editor-Ddyrxhnd.js";import"./editor-CK9raNB0.js";import"./calendar-BLwaxQ6A.js";import"./textarea-DDxcalk2.js";import"./select-Bur9VSDp.js";import"./index-hcdrCnDP.js";import"./switch-DcSUAA1j.js";import"./combobox-CgUwJrOG.js";import"./alert-dialog-PTVX9d3Y.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-Dfmvp3DJ.js";import"./DotsVertical-8YiGOIqq.js";import"./search-input-f14Hs9DC.js";import"./tabs-Bc9RHMFB.js";import"./use-file-configs-CL6vJq8e.js";import"./asset-utils-Dv9Q2xbg.js";import"./use-chat-layout-state-DVSuwZNL.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-CdYcnuUH.js";import"./sandbox-git-api-DTIjDZTr.js";import"./ArrowUp-wgeukGJg.js";import"./CreditCard01-C13hgCp6.js";import"./Key01-B1-8KpSg.js";import"./Users01-v0Jyk4Ot.js";import"./section-preview-url-7zfngvgW.js";function Xr(v){return v.schema?.definitions??v.schema?.$defs??{}}function ca(v,e){const u=Xr(e),p=u[btoa(v)];if(!p)return[];const h=[p];if(Array.isArray(p.allOf)){const k=p.allOf.find(w=>typeof w.$ref=="string")?.$ref;if(typeof k=="string"){const w=u[k.replace("#/definitions/","")];w&&h.push(w)}}return h}function Zr(v,e){for(const u of ca(v,e)){const p=typeof u.image=="string"?u.image:void 0;if(p?.includes("{{{"))return p}}function ei(v,e){if(!e)return;const u=ra(v);if(!u)return;const p=Zr(u.resolveType,e);if(!p)return;const h=jo(p,u.data);if(h)return Eo(h)}const ti={escape:ko};function si(v,e){for(const u of ca(v,e)){const p=typeof u.title=="string"?u.title:void 0;if(p?.includes("{{"))return p}}function ni(v,e){if(!e)return;const u=ra(v);if(u)try{const p=si(u.resolveType,e);return p&&ir.render(p,u.data,{},ti).trim()||void 0}catch{return}}function ai(v){const e=Jt.c(13),{icon:u,label:p,className:h}=v;let k;e[0]!==h?(k=oe("size-3.5",h),e[0]=h,e[1]=k):k=e[1];let w;e[2]!==u||e[3]!==k?(w=n.jsx(u,{className:k}),e[2]=u,e[3]=k,e[4]=w):w=e[4];let y;e[5]!==p||e[6]!==w?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:w})}),e[5]=p,e[6]=w,e[7]=y):y=e[7];let T;e[8]!==p?(T=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=T):T=e[9];let b;return e[10]!==y||e[11]!==T?(b=n.jsxs(ct,{children:[y,T]}),e[10]=y,e[11]=T,e[12]=b):b=e[12],b}const oi="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function aa(v){return Array.from({length:v},(e,u)=>({id:crypto.randomUUID(),index:u}))}function ua(v){return v.map((e,u)=>({...e,index:u}))}function ri(v,e){if(e===v.length)return v;if(e<v.length)return ua(v.slice(0,e));const u=Array.from({length:e-v.length},(p,h)=>({id:crypto.randomUUID(),index:v.length+h}));return[...v,...u]}function da(v){const e=Jt.c(44),{section:u,raw:p,meta:h,decofile:k}=v,w=Yt(),y=fs(),T=u.isSavedBlock===!0,b=u.isMultivariate===!0;let X;e[0]!==h||e[1]!==p?(X=p&&h?ei(p,h):void 0,e[0]=h,e[1]=p,e[2]=X):X=e[2];const me=X;let Ke;e[3]!==h||e[4]!==b||e[5]!==p||e[6]!==T?(Ke=p&&h&&!T&&!b?ni(p,h):void 0,e[3]=h,e[4]=b,e[5]=p,e[6]=T,e[7]=Ke):Ke=e[7];const Be=Ke;let Te;e[8]!==k||e[9]!==h||e[10]!==p||e[11]!==u?(Te=Ao(p,u,k,h),e[8]=k,e[9]=h,e[10]=p,e[11]=u,e[12]=Te):Te=e[12];const re=Te;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,ge=T?ms:b?oa:la;let $;e[16]!==b||e[17]!==T?($=T?{color:ur}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=T,e[18]=$):$=e[18];const c=$;let O;e[19]!==ge||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(ge,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(or,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=ge,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==me?(l=me&&n.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=l):l=e[23];let J;e[24]!==y||e[25]!==c?(J=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:c}),e[24]=y,e[25]=c,e[26]=J):J=e[26];const G=y?"shrink":"flex-1",ke=u.isHidden&&"line-through opacity-50";let Ne;e[27]!==ke||e[28]!==G?(Ne=oe("min-w-0 truncate text-sm font-medium",G,ke),e[27]=ke,e[28]=G,e[29]=Ne):Ne=e[29];const qe=Be??u.label;let _e;e[30]!==Ne||e[31]!==qe?(_e=n.jsx("span",{className:Ne,children:qe}),e[30]=Ne,e[31]=qe,e[32]=_e):_e=e[32];let d;e[33]!==V||e[34]!==y||e[35]!==re||e[36]!==w?(d=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:w("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),re&&n.jsx(Bn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):re&&n.jsx(Bn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=re,e[36]=w,e[37]=d):d=e[37];let M;return e[38]!==_e||e[39]!==d||e[40]!==O||e[41]!==l||e[42]!==J?(M=n.jsxs(n.Fragment,{children:[O,l,J,_e,d]}),e[38]=_e,e[39]=d,e[40]=O,e[41]=l,e[42]=J,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function ma(v,e,u){if(u)return Mo({selected:e});const p=v.isSavedBlock===!0,h=v.isMultivariate===!0;return oe("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":p?ii:h?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Cs(v,e){return oe("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function ci(v){const e=Jt.c(90),{section:u,raw:p,meta:h,decofile:k,sortableId:w,selected:y,onSelect:T,onDelete:b,onDuplicate:X,onMakeReusable:me,onToggleHidden:Ke,onToggleLazy:Be,onAddVariant:Te,onDetach:re}=v,r=Yt(),V=fs(),ge=p?Is(p.__resolveType??""):!1,$=u.isHidden===!0,c=ge||$;let O;e[0]!==u?(O=ia(u),e[0]=u,e[1]=O):O=e[1];const l=O;let J;e[2]!==w?(J={id:w,animateLayoutChanges:mi},e[2]=w,e[3]=J):J=e[3];const{attributes:G,listeners:ke,setNodeRef:Ne,transform:qe,isDragging:_e}=$r(J);let d;e[4]!==qe?(d=Ir.Transform.toString(qe?{...qe,x:0}:null),e[4]=qe,e[5]=d):d=e[5];const M=_e?0:void 0;let We;e[6]!==d||e[7]!==M?(We={transform:d,opacity:M},e[6]=d,e[7]=M,e[8]=We):We=e[8];const C=We;let Ue;e[9]!==u?(Ue=Ro(u),e[9]=u,e[10]=Ue):Ue=e[10];const z=Ue,mt="button",fe=0;let ze;e[11]!==T?(ze=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},e[11]=T,e[12]=ze):ze=e[12];const _t=_e?"cursor-grabbing":"cursor-pointer";let Le;e[13]!==V||e[14]!==u||e[15]!==y||e[16]!==_t?(Le=oe("touch-none transition-colors",_t,ma(u,y,V)),e[13]=V,e[14]=u,e[15]=y,e[16]=_t,e[17]=Le):Le=e[17];let ie;e[18]!==k||e[19]!==h||e[20]!==p||e[21]!==u?(ie=n.jsx(da,{section:u,raw:p,meta:h,decofile:k}),e[18]=k,e[19]=h,e[20]=p,e[21]=u,e[22]=ie):ie=e[22];const le=!V&&!u.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Cs(c,ge)),onClick:P=>{P.stopPropagation(),Be()},onPointerDown:di,children:n.jsx(Ls,{className:oe("h-3.5 w-3.5",ge&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ae=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ke,children:$?n.jsx(Zn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Cs(c,$)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ui,children:$?n.jsx(Zn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=vo,A=To;let ce;e[23]!==r?(ce=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ce):ce=e[24];const we=oe(Cs(c,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Me;e[25]!==A||e[26]!==ce||e[27]!==we?(Me=n.jsx(A,{label:ce,classicClassName:we}),e[25]=A,e[26]=ce,e[27]=we,e[28]=Me):Me=e[28];let Re;e[29]!==V||e[30]!==ge||e[31]!==Be||e[32]!==u.isMultivariate||e[33]!==r?(Re=V&&!u.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Be()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=ge,e[31]=Be,e[32]=u.isMultivariate,e[33]=r,e[34]=Re):Re=e[34];let H;e[35]!==X?(H=P=>{P.stopPropagation(),X()},e[35]=X,e[36]=H):H=e[36];let ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=ue):ue=e[37];let je;e[38]!==r?(je=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=je):je=e[39];let pe;e[40]!==H||e[41]!==je?(pe=n.jsxs(Kt,{onClick:H,children:[ue,je]}),e[40]=H,e[41]=je,e[42]=pe):pe=e[42];let ne;e[43]!==V||e[44]!==l||e[45]!==Te||e[46]!==r?(ne=l&&n.jsxs(Kt,{className:oe(!V&&No),onClick:P=>{P.stopPropagation(),Te()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Te,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==V||e[49]!==z||e[50]!==me||e[51]!==r?(he=z&&n.jsxs(Kt,{className:oe(!V&&oi),onClick:P=>{P.stopPropagation(),me()},children:[V?n.jsx(ms,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=me,e[51]=r,e[52]=he):he=e[52];let ae;e[53]!==V||e[54]!==re||e[55]!==u.isMultivariate||e[56]!==u.isSavedBlock||e[57]!==r?(ae=u.isSavedBlock===!0&&!u.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),re()},children:[V?n.jsx(la,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=re,e[55]=u.isMultivariate,e[56]=u.isSavedBlock,e[57]=r,e[58]=ae):ae=e[58];let Pe;e[59]!==b?(Pe=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Pe):Pe=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Dr,{className:"h-4 w-4"}),e[61]=ve):ve=e[61];let Ve;e[62]!==r?(Ve=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ve):Ve=e[63];let Ee;e[64]!==Pe||e[65]!==Ve?(Ee=n.jsxs(Kt,{variant:"destructive",onClick:Pe,children:[ve,Ve]}),e[64]=Pe,e[65]=Ve,e[66]=Ee):Ee=e[66];let Se;e[67]!==Re||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==ae||e[72]!==Ee?(Se=n.jsxs(So,{align:"end",className:"w-44",children:[Re,pe,ne,he,ae,Ee]}),e[67]=Re,e[68]=pe,e[69]=ne,e[70]=he,e[71]=ae,e[72]=Ee,e[73]=Se):Se=e[73];let ye;e[74]!==B||e[75]!==Me||e[76]!==Se?(ye=n.jsxs(B,{children:[Me,Se]}),e[74]=B,e[75]=Me,e[76]=Se,e[77]=ye):ye=e[77];let $e;return e[78]!==G||e[79]!==ke||e[80]!==T||e[81]!==Ne||e[82]!==C||e[83]!==Le||e[84]!==ie||e[85]!==le||e[86]!==Ae||e[87]!==ye||e[88]!==ze?($e=n.jsxs("div",{ref:Ne,style:C,...G,...ke,role:mt,tabIndex:fe,onClick:T,onKeyDown:ze,className:Le,children:[ie,le,Ae,ye]}),e[78]=G,e[79]=ke,e[80]=T,e[81]=Ne,e[82]=C,e[83]=Le,e[84]=ie,e[85]=le,e[86]=Ae,e[87]=ye,e[88]=ze,e[89]=$e):$e=e[89],$e}function ui(v){return v.stopPropagation()}function di(v){return v.stopPropagation()}function mi(){return!1}function Fs(v){const e=Jt.c(11),{canAddSection:u,onAddSection:p,className:h,size:k}=v,w=Yt();let y;e[0]!==h?(y=oe("w-full",h),e[0]=h,e[1]=y):y=e[1];const T=!u;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cr,{size:14}),e[2]=b):b=e[2];let X;e[3]!==w?(X=w("sectionsEditor.sectionList.addSectionButton"),e[3]=w,e[4]=X):X=e[4];let me;return e[5]!==p||e[6]!==k||e[7]!==y||e[8]!==T||e[9]!==X?(me=n.jsxs(Vt,{type:"button",variant:"outline",size:k,className:y,disabled:T,onClick:p,children:[b,X]}),e[5]=p,e[6]=k,e[7]=y,e[8]=T,e[9]=X,e[10]=me):me=e[10],me}function fi(v){const e=Jt.c(101),{listKey:u,rawSections:p,sections:h,meta:k,decofile:w,selectedIndex:y,onSelect:T,onReorder:b,onDelete:X,onDuplicate:me,onMakeReusable:Ke,onToggleHidden:Be,onToggleLazy:Te,onAddVariant:re,onDetach:r,onAddSection:V,canAddSection:ge}=v,$=ge===void 0?!0:ge,c=Yt(),O=fs();let l;e[0]!==h.length?(l=()=>aa(h.length),e[0]=h.length,e[1]=l):l=e[1];const[J,G]=j.useState(l),[ke,Ne]=j.useState(null),[qe,_e]=j.useState(u),[d,M]=j.useState(h.length),We=j.useRef(!1);qe!==u?(_e(u),M(h.length),G(aa(h.length))):d!==h.length&&(M(h.length),G(Ce=>ri(Ce,h.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let Ue;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ue={coordinateGetter:Hr},e[3]=Ue):Ue=e[3];const z=Kr(ta(Fr,C),ta(Lr,Ue));let mt;e[4]!==J?(mt=J.map(pi),e[4]=J,e[5]=mt):mt=e[5];const fe=mt;let ze;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=Ce=>{Ne(String(Ce.active.id))},e[6]=ze):ze=e[6];const _t=ze;let Le;e[7]!==fe||e[8]!==b?(Le=Ce=>{Ne(null);const{active:L,over:D}=Ce;if(!D||L.id===D.id)return;const Fe=fe.indexOf(String(L.id)),Ze=fe.indexOf(String(D.id));Fe===-1||Ze===-1||(G(nt=>ua(ds([...nt],Fe,Ze))),We.current=!0,requestAnimationFrame(()=>{We.current=!1}),b?.(Fe,Ze))},e[7]=fe,e[8]=b,e[9]=Le):Le=e[9];const ie=Le;let le;e[10]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{Ne(null)},e[10]=le):le=e[10];const Ae=le;let B,A,ce,we,Me,Re,H,ue,je,pe,ne,he,ae,Pe,ve;if(e[11]!==ke||e[12]!==$||e[13]!==O||e[14]!==w||e[15]!==J||e[16]!==fe||e[17]!==ie||e[18]!==k||e[19]!==V||e[20]!==re||e[21]!==X||e[22]!==r||e[23]!==me||e[24]!==Ke||e[25]!==T||e[26]!==Be||e[27]!==Te||e[28]!==p||e[29]!==h||e[30]!==y||e[31]!==z||e[32]!==c){Pe=Symbol.for("react.early_return_sentinel");e:{const Ce=L=>{We.current||T(L)};if(e[48]!==ke||e[49]!==$||e[50]!==O||e[51]!==J||e[52]!==V||e[53]!==p||e[54]!==h||e[55]!==c){const L=ke?J.find(D=>D.id===ke):null;if(we=L!=null?h[L.index]:null,ce=L!=null?p[L.index]:void 0,J.length===0){let D;e[59]!==c?(D=c("sectionsEditor.sectionList.noSections"),e[59]=c,e[60]=D):D=e[60];let Fe;e[61]!==D?(Fe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:D}),e[61]=D,e[62]=Fe):Fe=e[62];const Ze=Fe;let nt;e[63]!==$||e[64]!==O||e[65]!==Ze||e[66]!==V?(nt=O?Ze:n.jsxs("div",{className:"space-y-2",children:[Ze,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Ze,e[66]=V,e[67]=nt):nt=e[67],Pe=nt;break e}ae=oe(L&&"cursor-grabbing"),e[48]=ke,e[49]=$,e[50]=O,e[51]=J,e[52]=V,e[53]=p,e[54]=h,e[55]=c,e[56]=ce,e[57]=we,e[58]=ae}else ce=e[56],we=e[57],ae=e[58];A=Or,ue=z,je=zr,pe=_t,ne=ie,he=Ae,B=Gr,Re=fe,H=qr,ve="space-y-1",Me=J.map(L=>{const D=h[L.index];return D?n.jsx(ci,{sortableId:L.id,section:D,raw:p[L.index],meta:k,decofile:w,selected:y===L.index,onSelect:()=>Ce(L.index),onDelete:()=>X(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>Ke(L.index),onToggleHidden:()=>Be(L.index),onToggleLazy:()=>Te(L.index),onAddVariant:()=>re(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=ke,e[12]=$,e[13]=O,e[14]=w,e[15]=J,e[16]=fe,e[17]=ie,e[18]=k,e[19]=V,e[20]=re,e[21]=X,e[22]=r,e[23]=me,e[24]=Ke,e[25]=T,e[26]=Be,e[27]=Te,e[28]=p,e[29]=h,e[30]=y,e[31]=z,e[32]=c,e[33]=B,e[34]=A,e[35]=ce,e[36]=we,e[37]=Me,e[38]=Re,e[39]=H,e[40]=ue,e[41]=je,e[42]=pe,e[43]=ne,e[44]=he,e[45]=ae,e[46]=Pe,e[47]=ve}else B=e[33],A=e[34],ce=e[35],we=e[36],Me=e[37],Re=e[38],H=e[39],ue=e[40],je=e[41],pe=e[42],ne=e[43],he=e[44],ae=e[45],Pe=e[46],ve=e[47];if(Pe!==Symbol.for("react.early_return_sentinel"))return Pe;let Ve;e[68]!==Me||e[69]!==ve?(Ve=n.jsx("div",{className:ve,children:Me}),e[68]=Me,e[69]=ve,e[70]=Ve):Ve=e[70];let Ee;e[71]!==B||e[72]!==Re||e[73]!==H||e[74]!==Ve?(Ee=n.jsx(B,{items:Re,strategy:H,children:Ve}),e[71]=B,e[72]=Re,e[73]=H,e[74]=Ve,e[75]=Ee):Ee=e[75];let Se;e[76]!==ce||e[77]!==we||e[78]!==O||e[79]!==w||e[80]!==k?(Se=we?n.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(we,!1,O)),children:n.jsx(da,{section:we,raw:ce,meta:k,decofile:w})}):null,e[76]=ce,e[77]=we,e[78]=O,e[79]=w,e[80]=k,e[81]=Se):Se=e[81];let ye;e[82]!==Se?(ye=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:Se}),document.body),e[82]=Se,e[83]=ye):ye=e[83];let $e;e[84]!==A||e[85]!==ue||e[86]!==je||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==Ee||e[91]!==ye?($e=n.jsxs(A,{sensors:ue,collisionDetection:je,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[Ee,ye]}),e[84]=A,e[85]=ue,e[86]=je,e[87]=pe,e[88]=ne,e[89]=he,e[90]=Ee,e[91]=ye,e[92]=$e):$e=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==ae||e[98]!==$e||e[99]!==P?(st=n.jsxs("div",{className:ae,children:[$e,P]}),e[97]=ae,e[98]=$e,e[99]=P,e[100]=st):st=e[100],st}function pi(v){return v.id}function hi(v,e,u,p){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const h=e.trim();if(!h)return Rt(v,u,p)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ds(v,u,p)}:{kind:"noop"};const k=Ks(v,u,p);if(!k)return{kind:"error",reason:"unreadable-rule"};if(k.blockKey)return{kind:"updateBlock",blockKey:k.blockKey,blockData:xt(k.resolveType,k.data,h)};const w=cs(h),y=us(w,u);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:w,blockData:xt(k.resolveType,k.data,h),reference:Lt(w)}}function Fc({orgSlug:v,virtualMcpId:e,branch:u,previewReady:p=!0,previewUrl:h,currentPath:k,activePageBlockKey:w=null,activeGlobalBlockKey:y=null,externalSelection:T,onSaved:b,initialEditSeo:X=!1,onExitSeo:me,onSelectRoot:Ke,onViewJsonFile:Be,onFocusedBlockChange:Te,onVariantPreviewOverride:re}){const r=Yt(),V=_o(),ge=V?.taskId??null,$=p?{orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h}:null,{data:c,isLoading:O}=Co($),{data:l,isLoading:J}=Do($),G=fs(),ke=V?.virtualMcpId,qe=sr(ke===e?e:null)?.metadata?.siteSlug??null,_e=Jr({virtualMcpId:e,sandboxUrl:h}),[d,M]=j.useState(null),[We,C]=j.useState(null),[Ue,z]=j.useState(null),[mt,fe]=j.useState(0),[ze,_t]=j.useState(void 0),[Le,ie]=j.useState(null),[le,Ae]=j.useState(null),[B,A]=j.useState([]),ce=j.useRef(null),[we,Me]=j.useState(B.length);we!==B.length&&(Me(B.length),requestAnimationFrame(()=>{ce.current&&(ce.current.scrollTop=0)}));const[Re,H]=j.useState(0),[ue,je]=j.useState(null),[pe,ne]=j.useState(null),[he,ae]=j.useState(null),[Pe,ve]=j.useState(!1),[Ve,Ee]=j.useState(!1),Se=j.useRef(null),[ye,$e]=j.useState(!0),[P,st]=j.useState(!1),[Ce,L]=j.useState(!1),[D,Fe]=j.useState(X),[Ze,nt]=j.useState(X);X&&!Ze&&(nt(!0),Fe(!0),M(null),C(null),z(null),A([])),!X&&Ze&&nt(!1);const[fa,Qt]=j.useState(null),[Os,ps]=j.useState(void 0),[zs,jt]=j.useState([]),[$s,Ft]=j.useState(0),[Ie,Je]=j.useState(0),[pa,De]=j.useState(null),[Tt,Oe]=j.useState(null),[Hs,Gs]=j.useState(null),ha=yo(),ga=`${v}/${e}/${u}`,Xt=Ko({orgSlug:v,virtualMcpId:e,branch:u}),[va,Sa]=j.useState(k),[ya,ba]=j.useState(w),[xa,_a]=j.useState(y);(va!==k||ya!==w||xa!==y)&&(queueMicrotask(()=>Xt.flush()),Sa(k),ba(w),_a(y),M(null),C(null),z(null),fe(0),ie(null),Ae(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1));const Y=Bo({orgSlug:v,virtualMcpId:e,branch:u}),It=Xo((t,s)=>{Y.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Zt=lr({orgSlug:v,virtualMcpId:e,branch:u}),[Nt,At]=j.useState(!1),q=j.useRef(null),qs=j.useRef(null),at=j.useRef(null),ot=j.useRef(null),hs=j.useRef({}),He=j.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=j.useState(null);if(!p||O||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!c||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=dr(c),Q=!!y,te=Q?null:mr(ka,k,w),g=Q?y:te?.key??null,gs=Q&&y?c[y]:void 0,Ws=Q&&y&&gs?fr(y,gs):Q&&y?y:"",Ot=!Q&&g&&c[g]?c[g]:null,vs=D&&c&&l&&g&&te?Ln(c,{kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},l):null,wa=D?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=D?Lo(es):void 0,Us=vs?.seoTypeOptions??[],Js=D&&l?Fo(l):"",Ss=fa??Ra??{},ts=D&&vs?Wr(Ss,vs):null,Ys=D&&ts&&Io(es)?ls(ts,l):null,Qs=D?Oo(c,l)?.seoData:void 0,de=Q?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,c??{}),et=de.length>1,se=Math.min(mt,de.length-1),Ge=de[se],K=Ge?.sections??[],be=rs(K,c),ys=!Q&&pr(Ot?.sections);if(Q&&y&&Hs!==y){Gs(y);const t=K[0],s=be[0];if(t&&s){M(0),Je(0),A([]);const a=kt(t,s,c);a&&(C(a.data),z(a.resolveType),Oe(null),De(null))}}!Q&&Hs!==null&&Gs(null),He.current={rawSections:K,parsedSections:be,decofile:c??{},activePageKey:g,pageVariants:de,variantIndex:se,sectionVariantIndex:Ie,selectedSectionIndex:d};const Va=()=>({multivariate:ys,index:se,variants:de.map(t=>({rule:t.rule}))}),bs=(t,s)=>{if(!re)return;if(!g||!ys||t.length<=1){re(null);return}const a=na(g,{multivariate:!0,index:s,variants:t},c,l);re(a.length>0?a:null)},xs=re&&g&&ys&&et&&!O&&!J?g:null;if(xs!==ja&&(Ea(xs),xs)){const t=de.map(a=>({rule:a.rule})),s=se;queueMicrotask(()=>bs(t,s))}const Mt=(t,s,a)=>{if(!re)return;if(!g){re(null);return}const o=Va(),i=na(g,o,c,l);if(!t||s<0){re(i.length>0?i:null);return}const m=Qr({pageKey:g,page:o,sectionIndex:s,sectionLazy:be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:l}),f=[...i,...m];re(f.length>0?f:null)},ft=(t,s,a,o=d??-1,i=!1)=>{const m=tt(t,s);if(!m){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const x=Jn(m,lt)[a];if(!x){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const R=hr(x.value,c);C(R?.data??null),z(R?.resolveType??null);const{resolveType:S,formValue:E}=Wt(x.rule,c,l??void 0);Oe(S),De(E),i&&Mt(m,o,a)},zt=T?.index;if(T!==void 0&&(T?.seq??null)!==ze&&(_t(T?.seq??null),typeof zt=="number")){const t=K[zt],s=be[zt];if(t&&s)if(M(zt),Je(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,c);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Oe(null),De(null)}}const $t={orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h??void 0,siteSlug:qe},_s=Ue&&l?ls(Ue,l):null,Ye=(t,s)=>{if(!g)return;q.current&&(clearTimeout(q.current),q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=qt(c,g,t,se,de);Y.mutate({blockKey:g,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Te?.(null),M(null),L(!1),C(null),z(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1)},Ta=(t,s)=>{const a=He.current.sectionVariantIndex,o=qs.current;q.current&&(clearTimeout(q.current),q.current=null,o&&(o.sectionIndex!==s||o.sectionVariantIndex!==a)&&o.write());const i=()=>{const{rawSections:m,parsedSections:f,decofile:x,activePageKey:R,pageVariants:S,variantIndex:E}=He.current,_=m[s];if(!_)return;const W=f[s];if(!W)return;if(W.isSavedBlock){const F=tr(_,W);if(!F)return;Y.mutate({blockKey:F,data:t},{onSuccess:()=>b?.(),onError:U=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:U.message}))});return}if(!R)return;const Z={...x[R]},ee=[...m];if(W.isMultivariate){const F=tt(_,W);if(!F||!R)return;const U=Tr(F,a,t);ee[s]=wt(_,W,U)}else if(W.isHidden){const F=Is(_.__resolveType),U=F?{..._.section}:{..._},I=Array.isArray(U.variants)?[...U.variants]:[];I[0]&&(I[0]={...I[0],value:t}),U.variants=I,F?ee[s]={..._,section:U}:ee[s]=U}else W.isLazy?ee[s]={..._,section:t}:ee[s]=t;if(S.length>1){const F=Z.sections,U=[...F?.variants??[]];U[E]&&(U[E]={...U[E],value:ee}),Z.sections={...F,variants:U}}else Z.sections=ee;Y.mutate({blockKey:R,data:Z},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))})};qs.current={sectionIndex:s,sectionVariantIndex:a,write:i},q.current=setTimeout(()=>{q.current=null,i()},Ms)},Na=t=>{M(t),Je(0),A([]),H(i=>i+1);const s=K[t],a=be[t];if(Te?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,c);if(!o){C(null),z(null),Oe(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Oe(null),De(null),Mt(null,t,0)},Xs=t=>{const s=t;C(s),d!==null&&Ta(s,d)},js=t=>{if(!g||!c||!l||!te)return;const s={kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},a=Ln(c,s,l);a&&Xt.save(g,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[g];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...hs.current};return hs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Zs=(t,s)=>{g&&(hs.current[t]=s,js())},Aa=(t,s)=>{if(!g)return;const a=ds([...K],t,s);d!==null&&(d===t?M(s):t<d&&s>=d?M(d-1):t>d&&s<=d&&M(d+1)),Ye(a)},Ma=t=>{if(!g)return;const s=K.filter((a,o)=>o!==t);d===t?Pt():d!==null&&d>t&&M(d-1),Ye(s)},Pa=t=>{if(!g)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,Zo(s)),d!==null&&d>t&&M(d+1),Ye(a)},Ca=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a)return;const o=a.isHidden?Er(s):kr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Da=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a||a.isMultivariate)return;const o=jr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Ka=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,c);if(!o?.data)return;const{name:i,...m}=o.data,f=[...K];a.isLazy?f[t]={...s,section:m}:f[t]=m,d===t&&Pt(),Ye(f)},Ba=t=>{if(!g)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{ve(!1),M(a),Je(0),A([]),H(f=>f+1);const o=s[a],i=rs(s,c)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const m=kt(o,i,c);if(!m){C(null),z(null),Oe(null),De(null);return}C(m.data),z(m.resolveType),Oe(null),De(null)}})},en=t=>{Se.current=t.append,ve(!0)},La=t=>{const s=Se.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ve(!1),Se.current=null},tn=t=>{if(d===null)return;const s=K[d],a=be[d];!s||!a?.isMultivariate||(Je(t),A([]),H(o=>o+1),ft(s,a,t,d,!0))},Fa=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=xr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const m=[...K];m[d]=wt(s,a,i);const f=i.variants;let x=Ie;t===Ie?x=Math.min(t,f.length-1):t<Ie&&(x=Ie-1),Je(x),A([]),H(R=>R+1),ft(m[d],a,x),Ye(m)},Ia=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=_r(o,t),m=[...K];m[d]=wt(s,a,i);const f=t+1;Je(f),A([]),H(x=>x+1),ft(m[d],a,f),Ye(m)},Oa=(t,s)=>{if(d===null||!g||t===s)return;const a=K[d],o=be[d];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const m=yr(i,t,s),f=[...K];f[d]=wt(a,o,m);let x=Ie;Ie===t?x=s:t<Ie&&s>=Ie?x=Ie-1:t>Ie&&s<=Ie&&(x=Ie+1),Je(x),ft(f[d],o,x),Ye(f)},Ht=t=>{const s=t??d;if(s===null||!g)return;const a=K[s],o=be[s];if(!a||!o)return;const i=gr(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const m=[...K];m[s]=i.section;const f=rs(m,c)[s];if(!f?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Je(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,f,i.newVariantIndex,s),Ye(m)},sn=()=>{if(d===null||!g)return;const t=K[d],s=be[d];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=br(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...K];i[d]=o;const m=rs(i,c)[d];if(!m)return;Je(0),Oe(null),De(null),A([]),H(x=>x+1);const f=kt(o,m,c);f?(C(f.data),z(f.resolveType)):(C(null),z(null)),Mt(null,d,0),Ye(i)},za=async t=>{if(ue===null||!g)return;const s=us(t,c);if(s){N.error(s);return}const a=K[ue],o=be[ue];if(!a||!o)return;const i=kt(a,o,c);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const m={...i.data,name:t};try{await Y.mutateAsync({blockKey:t,data:m});const f=[...K];f[ue]={__resolveType:t},await Y.mutateAsync({blockKey:g,data:qt(c,g,f,se,de)}),d===ue&&Pt(),je(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(f){N.error(f instanceof Error?f.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},nn=Ge?.rule;if(et&&d===null&&le===null&&nn){const{resolveType:t,formValue:s}=Wt(nn,c??{},l??void 0);Ae(t),ie(s)}const Ct=l?$o(l):[],Es=l&&c?Ho(l,c):[],an=!Q&&!!(_e&&l&&c),on=le&&l?ls(le,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(Vr(s,t,l)>0))try{await Zt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},rn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i={...a[s]},m={...i.sections},f=[...m.variants??[]],x=f[o],R=x?.rule;if(Rt(R,a,l)){const S=R?.__resolveType??"",E=a[S],_=typeof E?.name=="string"?E.name:S,{__resolveType:W,...Z}=t;Y.mutate({blockKey:S,data:xt(W??"",Z,_)},{onSuccess:()=>b?.(),onError:ee=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ee.message}))});return}x&&(f[o]={...x,rule:t}),i.sections={...m,variants:f},Y.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ms)},ln=t=>{Ae(t);const s=t?Yn(t,l):{__resolveType:Qn};ie(t?s:{}),rn(s)},cn=t=>{const s=t;ie(s);const a=le?{__resolveType:le,...s}:{...s};rn(a)},un=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i=a[s],m=i?.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[o];if(!R)return;const S=bt(R.rule,a,l),E=Lt(t);x[o]={...R,rule:E};const _={...a,[s]:{...i,sections:{...f,variants:x}}},{resolveType:W,formValue:Z}=Wt(E,_,l??void 0);Ae(W),ie(Z);try{await Y.mutateAsync({blockKey:s,data:_[s]}),S&&S!==t&&await Et(S,_),b?.()}catch(ee){N.error(ee instanceof Error?ee.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},dn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=He.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const Z=(_.variants??[])[a]?.rule;if(Rt(Z,m,l)){const I=Z?.__resolveType??"",Xe=m[I],rt=typeof Xe?.name=="string"?Xe.name:I,{__resolveType:St,...it}=t;Y.mutate({blockKey:I,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const ee=Xn(_,a,t),F=[...o];F[s]=wt(S,E,ee);const U=qt(m,f,F,R,x);Y.mutate({blockKey:f,data:U},{onSuccess:()=>b?.(),onError:I=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:I.message}))})},Ms))},$a=t=>{Oe(t);const s=t?Yn(t,l):{__resolveType:Qn};De(t?s:{}),dn(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};dn(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(s===null||!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],Z=bt(W[a]?.rule,m,l),ee=Lt(t),F=Xn(_,a,ee),U=[...o];U[s]=wt(S,E,F);const I=qt(m,f,U,R,x),Xe={...m,[f]:I},{resolveType:rt,formValue:St}=Wt(ee,Xe,l??void 0);Oe(rt),De(St);try{await Y.mutateAsync({blockKey:f,data:I}),Z&&Z!==t&&await Et(Z,Xe),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Q&&!te)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:k})});if(Q&&!gs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const xe=d!==null?be[d]??null:null,mn=d!==null?K[d]:null,fn=mn&&xe?.isMultivariate?tt(mn,xe):null,ht=fn?Jn(fn,lt):[],ss=Math.min(Ie,Math.max(ht.length-1,0)),Dt=ht[ss]??null,gt=xe?.isMultivariate===!0,ks=d!==null&&xe!==null,vt=ks&&(gt||!!(_s&&We)),qa=vt&&!Q&&xe?.isSavedBlock===!0,Qe=Q||qa,pn=Q?Ws:xe?.label??"",Wa=Tt&&l?ls(Tt,l):null,hn=(t,s)=>s&&G?`${t} · ${s}`:t,gn=xe?xe.variantOf??xe.label:"",Ua=(()=>{const t=gt&&Dt?Dt.label:null;return t?G?[hn(gn,t)]:[xe.label,t]:[xe?.label??""]})(),ws=hn(te?.name??"",et?Ge?.label:null),ns=vt&&(!Q||B.length>0)?Q?[Ws,...B]:[ws,...Ua,...B]:[],vn=D&&te?[te.name,"SEO",...zs]:[],Sn=r("sectionsEditor.pageVariantTabs.variantsLabel"),yn=P&&te?[te.name,Sn]:Ce&&te&&xe?[ws,gn,Sn]:[],as=yn.length>0?yn:vn.length>0?vn:Qe?ns.length>0?ns:[pn]:ns.length>0?ns:[ws],bn=ks&&!gt&&!xe?.isHidden&&!!g,Ja=Qe||!Q&&et&&!!Ge||bn,Ya=ks&&!gt&&!Q&&B.length===0&&!!xe&&ia(xe)&&!!g,Qa=G&&vt&&!Ce&&gt&&B.length===0&&!!Dt,xn=G&&B.length>0?Fn(B[B.length-1]):null,Xa=B.length>1?Fn(B[B.length-2]):null,_n=Qe?pn:vt?xe?.label??"":te?.name??"",Za=P||Ce?r("sectionsEditor.pageVariantTabs.variantsLabel"):D?r("sectionsEditor.panelSections.seo"):xn??_n,jn=Ce?xe?.variantOf??xe?.label??"":P||D?te?.name??"":xn?Xa??_n:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?te?.name??"":te?.path??"",Rs=!P&&!Ce&&!D&&!vt&&!Qe,eo=!G&&!D&&!Q&&gt&&B.length===0,Gt=()=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const t=c[g],s=vr(t.sections,K);if(!s)return;const a=Sr(s);Y.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),M(null),C(null),z(null),A([]),ie(null),Ae(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},os=(t,s,a)=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const o=c[g],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const m=i;if(!Array.isArray(m.variants))return;const f=t([...m.variants]);if(!f)return;const x=Rr(m,f),R={...c,[g]:{...o,sections:x}};Y.mutate({blockKey:g,data:R[g]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const E of S)await Et(E,R)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{ne(null),fe(t),M(null),C(null),z(null),A([]);const s=de[t]?.rule,{resolveType:a,formValue:o}=Wt(s,c??{},l??void 0);Ae(a),ie(o),bs(de.map(i=>({rule:i.rule})),t)},En=(t,s)=>{if(t===s)return;let a=se;se===t?a=s:t<se&&s>=se?a=se-1:t>se&&s<=se&&(a=se+1),fe(a);const o=ds(de.map(i=>({rule:i.rule})),t,s);bs(o,a),os(i=>ds(i,t,s))},kn=t=>{const s=de[t]?.rule,a=bt(s,c??{},l??void 0);os(o=>o.length<=1?null:(o.splice(t,1),o),()=>{de.length-1===1?fe(0):t<se?fe(se-1):t===se&&fe(Math.max(0,t-1)),M(null),C(null),z(null),A([]),ie(null),Ae(null)},a)},to=()=>{const t=de.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!wr(s.rule)).map(({variant:s})=>bt(s.rule,c??{},l??void 0)).filter(s=>!!s);os(s=>{const a=Nr({variants:s}),o=s[a];return o?[{...o,rule:Ar()}]:null},()=>{fe(0),M(null),C(null),z(null),A([]),ie(null),Ae(null),st(!1)},t)},wn=t=>{os(s=>Mr(s,t),()=>{fe(t+1),M(null),C(null),z(null),A([]),ie(null),Ae(null)})},so=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const a=He.current.activePageKey,o=He.current.decofile;if(!a)return;const i=o[a],m=i.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=R.rule,E=s.trim();At(!0);try{if(!E){if(!Rt(S,o,l)){ne(null);return}const U=S.__resolveType??"";x[t]={...R,rule:Ds(S,o,l)};const I={...o,[a]:{...i,sections:{...f,variants:x}}};await Y.mutateAsync({blockKey:a,data:I[a]}),await Et(U,I),ne(null),b?.();return}const _=Ks(S,o,l);if(!_){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(_.blockKey){await Y.mutateAsync({blockKey:_.blockKey,data:xt(_.resolveType,_.data,E)}),ne(null),b?.();return}const W=cs(E),Z=us(W,o);if(Z){N.error(Z);return}const ee=xt(_.resolveType,_.data,E);let F=null;try{await Y.mutateAsync({blockKey:W,data:ee}),F=W,x[t]={...R,rule:Lt(W)},await Y.mutateAsync({blockKey:a,data:{...i,sections:{...f,variants:x}}}),F=null}catch(U){throw F&&await Zt.mutateAsync({blockKey:F}).catch(()=>{}),U}ne(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:E})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(a===null||!f)return;const S=o[a],E=i[a];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],Z=W[t];if(!Z?.rule||typeof Z.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ee=Z.rule,F=s.trim();At(!0);const U=async I=>{const Xe={..._,variants:I},rt=[...o];rt[a]=wt(S,E,Xe);const St=qt(m,f,rt,R,x);return await Y.mutateAsync({blockKey:f,data:St}),{...m,[f]:St}};try{if(!F){if(!Rt(ee,m,l)){ae(null);return}const yt=ee.__resolveType??"",Kn=[...W];Kn[t]={...Z,rule:Ds(ee,m,l)};const po=await U(Kn);await Et(yt,po),ae(null),b?.();return}const I=Ks(ee,m,l);if(!I){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(I.blockKey){await Y.mutateAsync({blockKey:I.blockKey,data:xt(I.resolveType,I.data,F)}),ae(null),b?.();return}const Xe=cs(F),rt=us(Xe,m);if(rt){N.error(rt);return}const St=xt(I.resolveType,I.data,F);let it=null;try{await Y.mutateAsync({blockKey:Xe,data:St}),it=Xe;const yt=[...W];yt[t]={...Z,rule:Lt(Xe)},await U(yt),it=null}catch(yt){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),yt}ae(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),b?.()}catch(I){N.error(I instanceof Error?I.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},Rn=async(t,s,a)=>{C(a);try{await Y.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s],x=f?.rule&&typeof f.rule=="object"?f.rule:void 0,R=async E=>{const _={...t,variants:E};return await Rn(o,t,_),{...i,[o]:_}},S=hi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const _=[...m];_[s]={...f,rule:S.inlinedRule};const W=await R(_);await Et(S.blockKey,W),b?.();return}if(S.kind==="updateBlock"){await Y.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let E=null;try{await Y.mutateAsync({blockKey:S.blockId,data:S.blockData}),E=S.blockId;const _=[...m];_[s]={...f,rule:S.reference},await R(_),E=null}catch(_){throw E&&await Zt.mutateAsync({blockKey:E}).catch(()=>{}),_}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s];if(!f)return;const x=bt(f.rule,i,l);m[s]={...f,rule:Lt(a)};const R={...t,variants:m},S={...i,[o]:R};try{await Rn(o,t,R),x&&x!==a&&await Et(x,S),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Vn=()=>{Pt()},Tn=t=>{Qt(t),js({inner:t})},Nn=t=>{ps(t),js({raw:t})},An=()=>{Qt(null),jt([])},Mn=()=>Ft(t=>t+1),Pn=()=>{Xt.flush(),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1),me?.()},oo=()=>{st(!1),L(!1),M(null),Fe(!0)},ro=()=>{D&&Pn(),M(null),st(!0)},io=()=>L(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Ce&&t<2){L(!1),t===0&&M(null);return}if(D){if(t===0){Pn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Q){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){Vn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&&gt&&Dt?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(B.slice(0,t-1-s))},Ns=as.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(er(as.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Qe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(rr,{className:"size-4"})}):null,lo=Qe||vt||D?Ja&&n.jsxs("div",{className:oe("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Q&&et&&Ge&&n.jsxs("button",{type:"button",onClick:Vn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Ge.label}),className:oe("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",qo),children:[n.jsx(Go,{rule:Ps(Ge.rule,c??{},l??void 0),matchers:Ct}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("div",{className:"flex-1"}),Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),bn&&n.jsx(is,{onClick:()=>Ht()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Zs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Fe(!0),children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Be&&g?Be():Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(is,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})})]}),Cn=n.jsxs(n.Fragment,{children:[n.jsx(Wo,{listKey:`${g??""}:${d??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ss,onSelect:tn,onRename:ae,onDuplicate:Ia,onDelete:Fa,onRemoveAll:sn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(As,{currentRt:Tt??"",currentLabel:Ut(Dt?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Dt?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${d??"none"}:${ss}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:oe(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${g??""}-${se}`,rawSections:K,sections:be,meta:l,decofile:c,selectedIndex:d,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:je,onToggleHidden:Ca,onToggleLazy:Da,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ve(!0),canAddSection:an})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&te&&n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Zs}),Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsxs("div",{className:oe("px-3 border-b",ye?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>$e(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-muted/40","aria-expanded":ye,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),ye?n.jsx(nr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ar,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ye&&n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Uo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||as.length>1)&&n.jsx(Jo,{crumbs:as,onSelect:Ts,onSelectRoot:()=>{Xt.flush(),Ke?Ke():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Za}),jn&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:jn})]}),Rs&&et&&Ge&&n.jsx($n,{variants:de,activeIndex:se,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ss,onSelect:tn,onManage:io,onRemoveAll:sn}),Rs&&!et&&n.jsx(is,{onClick:Gt}),Ya&&n.jsx(is,{onClick:()=>Ht()}),n.jsx(Yo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Be&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Ce?n.jsx(Hn,{onAdd:()=>Ht(),children:Cn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&&gt&&ht.length>0&&B.length===0&&Cn,n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Xs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en,onVariantMatcherOp:Q?ao:void 0})]},"editor-section-form"):Q?n.jsx(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Xs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en})},"editor-global-block"):D?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:an,onAddSection:()=>ve(!0)})})]},"editor-section-list"):fo,n.jsx(Qo,{open:ue!==null,onOpenChange:t=>{t||je(null)},defaultBlockId:ue!==null?cs(be[ue]?.label??""):"",isPending:Y.isPending,onSubmit:za}),_e&&n.jsx(Yr,{open:Pe,onOpenChange:t=>{ve(t),t||(Se.current=null)},meta:l,decofile:c,previewBaseUrl:_e,onSelect:La}),Ve&&g&&c&&n.jsx(cr,{open:Ve,onOpenChange:Ee,pageKey:g,decofile:c}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(de[pe]?.rule,c??{},l??void 0)?Ut(de[pe]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(de[pe]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(pe,t)},onOpenChange:t=>{!t&&!Nt&&ne(null)}}),he!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[he]?.rule,c??{},l??void 0)?Ut(ht[he]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(ht[he]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(he,t)},onOpenChange:t=>{!t&&!Nt&&ae(null)}})]})})}export{Fc as SectionsEditor};