decocms 4.189.3 → 4.190.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/dist/client/assets/{AlertCircle-CmlqvQvU.js → AlertCircle-DXED6rBH.js} +1 -1
  2. package/dist/client/assets/{AreaChart-_S6ORSTD.js → AreaChart-ClPQaVfK.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-DRIdSN8O.js → ArrowUp-CzxIfAAL.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DpKxs58Z.js → ArrowUpRight-B9MuUChV.js} +1 -1
  5. package/dist/client/assets/{Check-B59ln8yf.js → Check-Cv8jJZ08.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-B7Uc0Lhw.js → CheckCircle-BbQE3ya1.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BXkaTIFo.js → ChevronDown-BANYTkpy.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-YFTtoJP6.js → ChevronRight-DETJ3xj_.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-nqC8TfZe.js → ChevronUp-wqfkaLS5.js} +1 -1
  10. package/dist/client/assets/{Copy01-g955dMab.js → Copy01-CbGbNUH1.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-FduRDGU0.js → CpuChip01-Cu-vc03_.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-ODRSm0h5.js → CreditCard01-CbBbSbmH.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-DEmK4uzz.js → DotsVertical-BBgRvZBo.js} +1 -1
  14. package/dist/client/assets/{Eye-DEdNchPT.js → Eye-AoGWtBSi.js} +1 -1
  15. package/dist/client/assets/{FilterLines-BsqL1Yoh.js → FilterLines-BWq7x_Ul.js} +1 -1
  16. package/dist/client/assets/{HardDrive-DCwE51VB.js → HardDrive-BLvOShvd.js} +1 -1
  17. package/dist/client/assets/{Key01-DfVkeFRe.js → Key01-mErcgxup.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-BmQP-2Nn.js → LayoutLeft-DBT_IJtF.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-BMTNiHtD.js → LinkExternal01-CXhNQP7c.js} +1 -1
  20. package/dist/client/assets/{LogOut01-Dq-G32nE.js → LogOut01-mO0tZsvW.js} +1 -1
  21. package/dist/client/assets/{Monitor01-CqLKHrz4.js → Monitor01-BZEADwc8.js} +1 -1
  22. package/dist/client/assets/{Palette-CIOLCTaE.js → Palette-CnQId6v6.js} +1 -1
  23. package/dist/client/assets/{Play-CkQPweHz.js → Play-B7cP13Me.js} +1 -1
  24. package/dist/client/assets/{Plus-DFKn-2D5.js → Plus-DKjrN_YU.js} +1 -1
  25. package/dist/client/assets/{SearchLg-BZ_U4M0X.js → SearchLg-DwtISFdA.js} +1 -1
  26. package/dist/client/assets/{SearchMd-Bao2Khs6.js → SearchMd-CnFLdgrH.js} +1 -1
  27. package/dist/client/assets/{Settings02-Y5EoKHnL.js → Settings02-CQSeeLoM.js} +1 -1
  28. package/dist/client/assets/{Shield01-DJFLY75_.js → Shield01-CntlcGRR.js} +1 -1
  29. package/dist/client/assets/{Star01-Uw83dsW7.js → Star01-MMb-rmit.js} +1 -1
  30. package/dist/client/assets/{Stars01-BNMN8kI6.js → Stars01-BShDUy4Y.js} +1 -1
  31. package/dist/client/assets/{Stars02-N20sgcpv.js → Stars02-B926KF3Z.js} +1 -1
  32. package/dist/client/assets/{Sun-BFsCgkra.js → Sun-CxglTtSz.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-v-WkSysv.js → SwitchHorizontal01-B1X-VtF4.js} +1 -1
  34. package/dist/client/assets/{Tool01-CuKaYYir.js → Tool01-CbaEqEhy.js} +1 -1
  35. package/dist/client/assets/{Tool02-BhAdrZCc.js → Tool02-BBAH4fGj.js} +1 -1
  36. package/dist/client/assets/{Trash01-C4bB4DeV.js → Trash01-BwbIeVja.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-Cr7GCfFC.js → TrendUp01-Bx1jfyaf.js} +1 -1
  38. package/dist/client/assets/{Upload01-Bg524psL.js → Upload01-CVhasQ21.js} +1 -1
  39. package/dist/client/assets/{User01-qoGENVb3.js → User01-CfaOzYqT.js} +1 -1
  40. package/dist/client/assets/{Users01-DFWjxxFl.js → Users01-Di90kAgB.js} +1 -1
  41. package/dist/client/assets/{Users03-DVZvdomd.js → Users03-Ciz_K4lk.js} +1 -1
  42. package/dist/client/assets/{X-B-bVKpMu.js → X-C9Eo6bsP.js} +1 -1
  43. package/dist/client/assets/{XCircle-ZKQCeczB.js → XCircle-DCx5xBFU.js} +1 -1
  44. package/dist/client/assets/{XClose-BLBZKEFn.js → XClose-DUO7rfyU.js} +1 -1
  45. package/dist/client/assets/{Zap-NbmEih1R.js → Zap-moyChzSY.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-CmjyIfS8.js → ZapSquare-BwgIOjRQ.js} +1 -1
  47. package/dist/client/assets/{access-gate-B5SUruAr.js → access-gate-DyI_QApY.js} +1 -1
  48. package/dist/client/assets/{agent-icon-B8CH6R4U.js → agent-icon-CJcwoAuE.js} +1 -1
  49. package/dist/client/assets/{agents-list-CKfq4tvu.js → agents-list-CE1KtlG_.js} +1 -1
  50. package/dist/client/assets/{ai-providers-Cr1a2cYX.js → ai-providers-9FP8Vgi6.js} +1 -1
  51. package/dist/client/assets/{alert-C_i_307T.js → alert-BgpReGBN.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-C-B7yt3Z.js → alert-dialog-Bk0yvpfE.js} +1 -1
  53. package/dist/client/assets/app-editor-DtoHC0cz.js +1 -0
  54. package/dist/client/assets/{auth-CfcQWvV5.js → auth-DE4bma7Q.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-aNzrntVa.js → auth-catchall-Cl7AYup6.js} +1 -1
  56. package/dist/client/assets/{auth-entry-D2SRMmWt.js → auth-entry-Bi7CumSs.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-415MJ-Je.js → auth-split-layout-B69Ee6U_.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-BRpIojSE.js → authenticate-and-persist-oauth-yvVI9G22.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-BoFaHsiS.js → automation-list-row-Cws0lt-9.js} +1 -1
  60. package/dist/client/assets/{automation-runs-C8Us2aQT.js → automation-runs-6E4exrgY.js} +1 -1
  61. package/dist/client/assets/{automations-CHVjKOyi.js → automations-D07mw889.js} +1 -1
  62. package/dist/client/assets/{avatar-BTbEPnIr.js → avatar-DJS63fnf.js} +1 -1
  63. package/dist/client/assets/{badge-CLVDJQOK.js → badge-6rnM0DeY.js} +1 -1
  64. package/dist/client/assets/{billing-CMsBU_l0.js → billing-B1H3tqw_.js} +1 -1
  65. package/dist/client/assets/{block-document-Cl9R9jnu.js → block-document-BLKYSplP.js} +1 -1
  66. package/dist/client/assets/{brand-context-heF7z0bx.js → brand-context-uQHwIxqs.js} +1 -1
  67. package/dist/client/assets/{buckets-Dd0qf-Lz.js → buckets-2814OOuy.js} +1 -1
  68. package/dist/client/assets/{bulk-category-panel-4U1T6Tx6.js → bulk-category-panel-BBnxMkuV.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-CiNu_2Tk.js → capability-load-error-9bOhNBbe.js} +1 -1
  70. package/dist/client/assets/{card-D23PgnYA.js → card-CrWtG_oD.js} +1 -1
  71. package/dist/client/assets/category-editor-BZMRXgNg.js +1 -0
  72. package/dist/client/assets/{chat-context-Bn1M37IJ.js → chat-context-BT2m2n8F.js} +1 -1
  73. package/dist/client/assets/{checkbox-DSkIhGii.js → checkbox-fApMVB_C.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-BahSN_hd.js → cli-auth-success-Dd6OURUM.js} +1 -1
  75. package/dist/client/assets/{collection-detail-CR45FnZD.js → collection-detail-DYNDiF7d.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-C4UfLz9u.js → collection-display-button-BUEdKLAN.js} +1 -1
  77. package/dist/client/assets/{collection-search-DGDMBO1x.js → collection-search-BaQxIHXt.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-CQZ2ihom.js → collection-table-wrapper-CBokqZrh.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-MOKcdzTO.js → collection-tabs-vD34oS9A.js} +1 -1
  80. package/dist/client/assets/{command-DSlCzGc1.js → command-D8v_nR97.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-tYcQcQ6O.js → commerce-onboarding-C2QOTogc.js} +1 -1
  82. package/dist/client/assets/{connect-D189EaCw.js → connect-BhjYdlYe.js} +1 -1
  83. package/dist/client/assets/{connection-B5BS9cva.js → connection-RtmTb73Q.js} +1 -1
  84. package/dist/client/assets/{connection-card-CP7LwyrZ.js → connection-card-DyjoSNay.js} +1 -1
  85. package/dist/client/assets/{connection-detail-ML5tgmGJ.js → connection-detail-D_psVjHX.js} +1 -1
  86. package/dist/client/assets/{connection-form-helpers-BdDxwsOy.js → connection-form-helpers-BIrwRhdD.js} +1 -1
  87. package/dist/client/assets/{connections-CpGafRX7.js → connections-B6P40q80.js} +1 -1
  88. package/dist/client/assets/{decopilot-sse-pool-DnurAj3t.js → decopilot-sse-pool-B94gAtrR.js} +1 -1
  89. package/dist/client/assets/{dialog-DYY8nxLe.js → dialog-p8J7StLH.js} +1 -1
  90. package/dist/client/assets/{domain-settings-CVA6wv2B.js → domain-settings-Cir0azXg.js} +1 -1
  91. package/dist/client/assets/{drawer-DrUHvNFB.js → drawer-CBT7Eys6.js} +1 -1
  92. package/dist/client/assets/{dropdown-menu-Crgvenwv.js → dropdown-menu-BrXZ6Vm1.js} +1 -1
  93. package/dist/client/assets/{empty-state-BUxoEqhR.js → empty-state-B60k1FtN.js} +1 -1
  94. package/dist/client/assets/{extract-connection-data-B9r7MY28.js → extract-connection-data-DPPQjvw0.js} +1 -1
  95. package/dist/client/assets/{file-explorer-AszwGin4.js → file-explorer-_acp7GfX.js} +1 -1
  96. package/dist/client/assets/{form-BxCEWrFR.js → form-BzB6OSr4.js} +1 -1
  97. package/dist/client/assets/{general-BS7wtrP4.js → general-w04LrnRs.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-bFoU5cKi.js → github-repo-picker-DtcsOf5_.js} +1 -1
  99. package/dist/client/assets/{hooks-C-Yvopo_.js → hooks-Bazbp_1N.js} +1 -1
  100. package/dist/client/assets/{index-B1Wqe50f.js → index-B1pamPTG.js} +3 -3
  101. package/dist/client/assets/{index-oBHYA71u.js → index-C-KqRNgp.js} +1 -1
  102. package/dist/client/assets/{index-D8EGPj8X.js → index-CITe_oq2.js} +44 -44
  103. package/dist/client/assets/{index-CPJ5f-o5.js → index-CU1ur_bP.js} +1 -1
  104. package/dist/client/assets/{index-mCaEAGKB.js → index-CZvV4EXt.js} +1 -1
  105. package/dist/client/assets/{index-BfVGMDbR.js → index-CcARg5YW.js} +1 -1
  106. package/dist/client/assets/{index-eE-z17OQ.js → index-CxA3NuXr.js} +1 -1
  107. package/dist/client/assets/{index-Ca7_AB2I.js → index-DTC5AnWE.js} +1 -1
  108. package/dist/client/assets/{index-Cq_S0ZxI.js → index-DVFVwt0t.js} +1 -1
  109. package/dist/client/assets/{index-Cr4mcBJx.js → index-DaAKYWlK.js} +1 -1
  110. package/dist/client/assets/{index-Dw8WJ24Z.js → index-_-LfDtEQ.js} +1 -1
  111. package/dist/client/assets/{index-redirect-Bil3NHkx.js → index-redirect-Bhh8boBC.js} +1 -1
  112. package/dist/client/assets/{input-BIPflGRD.js → input-8KUKm5_e.js} +1 -1
  113. package/dist/client/assets/{integration-icon-Cqj-HXcq.js → integration-icon-ByCUiVdJ.js} +1 -1
  114. package/dist/client/assets/{invite-member-dialog-Cjc50hVy.js → invite-member-dialog-Dvmz_iJM.js} +1 -1
  115. package/dist/client/assets/{label-C0D4GSim.js → label-B89S6Txq.js} +1 -1
  116. package/dist/client/assets/{layout-CNBwHO6b.js → layout-BZqAHjH_.js} +1 -1
  117. package/dist/client/assets/{login-c_HtxDrS.js → login-CabK5JLY.js} +1 -1
  118. package/dist/client/assets/{mcp-oauth-DckzwyC7.js → mcp-oauth-Di-ad4PD.js} +1 -1
  119. package/dist/client/assets/{members-COTjrrEh.js → members-eHjNNDpv.js} +1 -1
  120. package/dist/client/assets/{monaco-editor-Dh32GK6v.js → monaco-editor-DXS6EpEe.js} +1 -1
  121. package/dist/client/assets/{monitoring-stats-row-DymJSuhP.js → monitoring-stats-row-DMNgnpP1.js} +1 -1
  122. package/dist/client/assets/{multi-select-BWfdfkLh.js → multi-select-DzXLMoLM.js} +1 -1
  123. package/dist/client/assets/{oauth-callback-ai-provider-BiklC55K.js → oauth-callback-ai-provider-C7yfrXoI.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-DhMmYcaR.js → oauth-callback-hWEALUDd.js} +1 -1
  125. package/dist/client/assets/{onboarding-BzKHrSwT.js → onboarding-ChVVg5Tt.js} +1 -1
  126. package/dist/client/assets/{org-layout-BDFDw1Ht.js → org-layout-Gs4YXCJU.js} +1 -1
  127. package/dist/client/assets/{organization-choice-Ca1QTlYX.js → organization-choice-2j0s-URi.js} +1 -1
  128. package/dist/client/assets/{orgs-C1x_FAAB.js → orgs-Bc0T_S8f.js} +1 -1
  129. package/dist/client/assets/{page-seo-form-D2xFmapx.js → page-seo-form-Dhp2UaWO.js} +1 -1
  130. package/dist/client/assets/{popover-BIIjQQDR.js → popover-BH69yCmw.js} +1 -1
  131. package/dist/client/assets/{post-editor-CZPzvkf4.js → post-editor-ClPwBicl.js} +1 -1
  132. package/dist/client/assets/{primitives-2CaNXpzQ.js → primitives-BW5Yu4EI.js} +1 -1
  133. package/dist/client/assets/{profile-CqVYj_EH.js → profile-BztRA1BA.js} +1 -1
  134. package/dist/client/assets/project-app-view-2l1tg7__.js +1 -0
  135. package/dist/client/assets/record-editor-DRypaazn.js +1 -0
  136. package/dist/client/assets/redirect-editor-HMDzyeF7.js +1 -0
  137. package/dist/client/assets/registry-kBVKGTVS.js +2 -0
  138. package/dist/client/assets/{registry-layout-BuCpbtaM.js → registry-layout-6ltnB5Yz.js} +1 -1
  139. package/dist/client/assets/{reports-CxUeLSrt.js → reports-Cxini64Q.js} +1 -1
  140. package/dist/client/assets/{require-capability-D33eHd9x.js → require-capability-f3q71kF5.js} +1 -1
  141. package/dist/client/assets/{required-auth-layout-iJYWjiPs.js → required-auth-layout-Ds7bjGvL.js} +1 -1
  142. package/dist/client/assets/{reset-password-D5hjD3Iz.js → reset-password-CXbq6Tw-.js} +1 -1
  143. package/dist/client/assets/{roles-BnpVwu_g.js → roles-CspygFiB.js} +1 -1
  144. package/dist/client/assets/{search-input-VerZChVs.js → search-input-zK9i-Kh3.js} +1 -1
  145. package/dist/client/assets/{secrets-B2CiVwJ0.js → secrets-L8zybnQm.js} +1 -1
  146. package/dist/client/assets/sections-editor-DPOpZ-tE.js +2 -0
  147. package/dist/client/assets/{select-Bi1NZj5e.js → select-CDC8kviA.js} +1 -1
  148. package/dist/client/assets/{select-model-mrEq8Bm0.js → select-model-Bp5Xd4te.js} +1 -1
  149. package/dist/client/assets/{self-tool-result-C4ZMEaKr.js → self-tool-result-Cuj-33nr.js} +1 -1
  150. package/dist/client/assets/{seo-editor-CCgh3Nx_.js → seo-editor-4TGrgB3S.js} +1 -1
  151. package/dist/client/assets/{settings-layout-sXtG1Hen.js → settings-layout-DlSc777F.js} +1 -1
  152. package/dist/client/assets/{settings-section-Dx1x63iI.js → settings-section-D8TGOGYz.js} +1 -1
  153. package/dist/client/assets/{shell-controls-Co2GKpcL.js → shell-controls-CZERq1n5.js} +1 -1
  154. package/dist/client/assets/{shell-layout-BNjRqTkt.js → shell-layout-D4_bTkUU.js} +1 -1
  155. package/dist/client/assets/{sidebar-D4w_uKP7.js → sidebar-CZTkBKXl.js} +1 -1
  156. package/dist/client/assets/{skeleton-Dji_M3Lr.js → skeleton-CGHtidUO.js} +1 -1
  157. package/dist/client/assets/{spinner-D-ABXbmu.js → spinner-BM_ia_uk.js} +1 -1
  158. package/dist/client/assets/{sso-CHeAA5WY.js → sso-C3QdMV1g.js} +1 -1
  159. package/dist/client/assets/{store-ZF8CS3EX.js → store-DpxJmuD5.js} +1 -1
  160. package/dist/client/assets/store-registry-DExoSMMF.js +2 -0
  161. package/dist/client/assets/{studio-tools-DVCzmbHJ.js → studio-tools-DM-9vWPj.js} +1 -1
  162. package/dist/client/assets/{switch-DzZL0Ygg.js → switch-D4_0M4ba.js} +1 -1
  163. package/dist/client/assets/{tab-id-BJKjbU6c.js → tab-id-DOUygo4c.js} +1 -1
  164. package/dist/client/assets/{table-kECVt-C7.js → table-l5OXWTTW.js} +1 -1
  165. package/dist/client/assets/{tabs-M_slknJr.js → tabs-CZAVib3u.js} +1 -1
  166. package/dist/client/assets/{textarea-Bdupuo1G.js → textarea-C9hZnZoz.js} +1 -1
  167. package/dist/client/assets/{toggle-group-CPDLRn9j.js → toggle-group-DKmas1Id.js} +1 -1
  168. package/dist/client/assets/{toolbar-A_CyeS8I.js → toolbar-BvOLPMGj.js} +1 -1
  169. package/dist/client/assets/{tooltip-D9H3EBf5.js → tooltip-IARwLh0F.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-D1eXWoFr.js → use-ai-providers-B3l8wwZ5.js} +1 -1
  171. package/dist/client/assets/{use-automations-CUk2Ht3V.js → use-automations-DVulOVRH.js} +1 -1
  172. package/dist/client/assets/{use-autosave-BjjKPWlP.js → use-autosave-BEPEE2EQ.js} +1 -1
  173. package/dist/client/assets/{use-capability-_tObqP_-.js → use-capability-DjJpn-d1.js} +1 -1
  174. package/dist/client/assets/{use-clock-tick-DvehNMn7.js → use-clock-tick-DUclydJW.js} +1 -1
  175. package/dist/client/assets/{use-connection-BnPeqk9B.js → use-connection-C7KvffTt.js} +1 -1
  176. package/dist/client/assets/{use-copy-ChS78tRx.js → use-copy-ASUaxQ1g.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-CKtuKCfi.js → use-create-virtual-mcp-BuMDo7HS.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-BfyJI23F.js → use-debounced-autosave-Dr7OLeNB.js} +1 -1
  179. package/dist/client/assets/{use-debounced-value-DwQtvxVS.js → use-debounced-value-TXd87EPp.js} +1 -1
  180. package/dist/client/assets/{use-deco-credits-D9Jyodhs.js → use-deco-credits-DQBmpudk.js} +1 -1
  181. package/dist/client/assets/{use-decopilot-events-DlaxYT1C.js → use-decopilot-events-BtR8Mqm3.js} +1 -1
  182. package/dist/client/assets/{use-delete-connection-CXIkOUBu.js → use-delete-connection-DpZ0gvcX.js} +1 -1
  183. package/dist/client/assets/{use-deployment-admin-Da_fAVY1.js → use-deployment-admin-B-a9-Z3F.js} +1 -1
  184. package/dist/client/assets/{use-file-configs-DltAjEZ8.js → use-file-configs-vPXbDrDt.js} +1 -1
  185. package/dist/client/assets/{use-infinite-scroll-gAPER-ig.js → use-infinite-scroll-0YyrXUEB.js} +1 -1
  186. package/dist/client/assets/{use-join-requests-C4aANuka.js → use-join-requests-L6gA0vgB.js} +1 -1
  187. package/dist/client/assets/{use-mcp-client-BpP-ogps.js → use-mcp-client-DpgCUtQL.js} +1 -1
  188. package/dist/client/assets/{use-mcp-tools-CPxqW22a.js → use-mcp-tools-BpQEjUlC.js} +1 -1
  189. package/dist/client/assets/{use-members-CHlaEa0y.js → use-members-DlNGYhNw.js} +1 -1
  190. package/dist/client/assets/{use-mobile-CWm9GN2y.js → use-mobile-ADgWnTRh.js} +1 -1
  191. package/dist/client/assets/{use-navigate-to-agent-BbauFgS_.js → use-navigate-to-agent-C_I5OT4C.js} +1 -1
  192. package/dist/client/assets/{use-open-billing-url-Dpti172K.js → use-open-billing-url-B4KqcF2I.js} +1 -1
  193. package/dist/client/assets/{use-org-auth-client-CXTWlFpb.js → use-org-auth-client-CJimZSCq.js} +1 -1
  194. package/dist/client/assets/{use-org-sso-Dka-hLl-.js → use-org-sso-k8cw1RWC.js} +1 -1
  195. package/dist/client/assets/{use-organization-roles-DyEoquH3.js → use-organization-roles-3TWNcJlb.js} +1 -1
  196. package/dist/client/assets/{use-organization-settings-BBvx6pdY.js → use-organization-settings-D0OJWoGn.js} +1 -1
  197. package/dist/client/assets/{use-registry-connections-DrkFhyFg.js → use-registry-connections-C661e6FH.js} +1 -1
  198. package/dist/client/assets/{use-secrets-BajYtFVS.js → use-secrets-Cmc4oF-J.js} +1 -1
  199. package/dist/client/assets/use-section-preview-base-D7lAQ6j7.js +1 -0
  200. package/dist/client/assets/{use-status-sounds-pSXHWaI2.js → use-status-sounds-2TtpMK-C.js} +1 -1
  201. package/dist/client/assets/{use-tags-Dq2mbdCO.js → use-tags-Bd6Uv4oo.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-CY7SFCtA.js → use-view-mode-CXw_Kvrf.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-BaMys8Yq.js → use-virtual-mcp-CEINdtXi.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-CbDX819o.js +1 -0
  205. package/dist/client/assets/{useRouterState-C41Qo9se.js → useRouterState-eCBwWfUY.js} +1 -1
  206. package/dist/client/assets/useSuspenseInfiniteQuery-DbnovJ-n.js +1 -0
  207. package/dist/client/assets/{users-BmscmKuH.js → users-DTuWteU5.js} +1 -1
  208. package/dist/client/assets/{variant-calendar-CwZoJ8Fm.js → variant-calendar-C_isZHgL.js} +1 -1
  209. package/dist/client/assets/{view-mode-toggle-BRa_pP_D.js → view-mode-toggle-mVooQxHk.js} +1 -1
  210. package/dist/client/index.html +1 -1
  211. package/dist/server/cli.js +357 -357
  212. package/dist/server/server.js +252 -252
  213. package/package.json +1 -1
  214. package/dist/client/assets/add-section-modal-BQJKPd-i.js +0 -1
  215. package/dist/client/assets/app-editor-CMz5w7LW.js +0 -1
  216. package/dist/client/assets/category-editor-BfkxTgEJ.js +0 -1
  217. package/dist/client/assets/project-app-view-CPikjb1v.js +0 -1
  218. package/dist/client/assets/record-editor-BYDLak_w.js +0 -1
  219. package/dist/client/assets/redirect-editor-D7WmsO7V.js +0 -1
  220. package/dist/client/assets/registry-Bsbf-tFl.js +0 -2
  221. package/dist/client/assets/sections-editor-DigWLNSY.js +0 -2
  222. package/dist/client/assets/store-registry-JD6epZd4.js +0 -2
  223. package/dist/client/assets/useInfiniteQuery-BfELt9Jh.js +0 -1
  224. package/dist/client/assets/useSuspenseInfiniteQuery-DAhtKkRo.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.189.3",
3
+ "version": "4.190.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{c as F,b as X,r as g,j as r,m as Q}from"./index-B1Wqe50f.js";import{ag as _}from"./agent-icon-B8CH6R4U.js";import{i as Y}from"./SearchMd-Bao2Khs6.js";import{e as Z,d as ee,b as te,a as re}from"./dialog-DYY8nxLe.js";import{I as se}from"./input-BIPflGRD.js";import{J as le,K as oe,L as ie,M as J,N as ne}from"./index-D8EGPj8X.js";const ce=12,z=new Set,q=new Set;function ae(){for(const i of q)i()}function fe(i){return z.has(i)?!0:z.size>=ce?!1:(z.add(i),!0)}function K(i){z.delete(i)&&ae()}function ue(i){return q.add(i),()=>{q.delete(i)}}function de(i,e){const t=g.useRef(!1),[v,a]=g.useState(!1),n=g.useRef(null),f=g.useRef(null),o=g.useRef(null),s=g.useRef(i);s.current=i;const[c]=g.useState(()=>{const l=()=>{o.current?.(),o.current=null},u=()=>t.current?!0:fe(e)?(t.current=!0,a(!0),l(),!0):!1;return m=>{if(f.current=m,n.current&&(n.current.disconnect(),n.current=null),l(),!m){t.current&&(K(e),t.current=!1,a(!1));return}queueMicrotask(()=>{if(f.current!==m)return;const x=new IntersectionObserver(d=>{if(d[0]?.isIntersecting??!1){!u()&&!o.current&&(o.current=ue(()=>{f.current===m&&u()}));return}l(),t.current&&(K(e),t.current=!1,a(!1))},{root:s.current.current,rootMargin:"160px 0px"});x.observe(m),n.current=x})}});return{ref:c,iframeActive:v}}function me(i){const e=F.c(8),{previewUrl:t,title:v,scrollRootRef:a,slotId:n}=i,{ref:f,iframeActive:o}=de(a,n),[s,c]=g.useState(!1);let l;e[0]!==o||e[1]!==s||e[2]!==t||e[3]!==v?(l=o?r.jsxs(r.Fragment,{children:[!s&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${v}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>c(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=o,e[1]=s,e[2]=t,e[3]=v,e[4]=l):l=e[4];let u;return e[5]!==f||e[6]!==l?(u=r.jsx("div",{ref:f,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:l}),e[5]=f,e[6]=l,e[7]=u):u=e[7],u}function pe(i){const e=F.c(26),{entry:t,previewUrl:v,scrollRootRef:a,onSelect:n}=i,f=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let o;e[0]!==f?(o=Q("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",f),e[0]=f,e[1]=o):o=e[1];let s;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==v||e[5]!==a?(s=r.jsx(me,{previewUrl:v,title:t.title,scrollRootRef:a,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=v,e[5]=a,e[6]=s):s=e[6];let c;e[7]!==t.isSavedBlock?(c=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=c):c=e[8];let l;e[9]!==c?(l=r.jsx(_,{className:"h-4 w-4 shrink-0",style:c}),e[9]=c,e[10]=l):l=e[10];let u;e[11]!==t.title?(u=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let m;e[13]!==t.description?(m=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=m):m=e[14];let x;e[15]!==u||e[16]!==m?(x=r.jsxs("div",{className:"min-w-0 flex-1",children:[u,m]}),e[15]=u,e[16]=m,e[17]=x):x=e[17];let d;e[18]!==l||e[19]!==x?(d=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[l,x]}),e[18]=l,e[19]=x,e[20]=d):d=e[20];let h;return e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==d?(h=r.jsxs("button",{type:"button",onClick:n,className:o,children:[s,d]}),e[21]=n,e[22]=o,e[23]=s,e[24]=d,e[25]=h):h=e[25],h}function be(i){const e=F.c(51),{open:t,onOpenChange:v,meta:a,decofile:n,previewBaseUrl:f,onSelect:o}=i,s=X(),[c,l]=g.useState(""),[u,m]=g.useState(t),x=g.useRef(null);t!==u&&(m(t),t&&l(""));let d,h,S,b,j,N,y,R,w,C,T;if(e[0]!==n||e[1]!==a||e[2]!==v||e[3]!==o||e[4]!==t||e[5]!==f||e[6]!==c||e[7]!==s){const D=t&&a&&n?le(a,n):[],W=a?oe(a):"",G=n?ie(n):void 0,H=new Map;if(t&&W)for(const p of D)H.set(p.resolveType,J(f,W,p.previewBlock,G));const B=c.trim().toLowerCase(),V=B?D.filter(p=>p.title.toLowerCase().includes(B)||p.resolveType.toLowerCase().includes(B)||p.description?.toLowerCase().includes(B)):D;h=Z,C=t,T=v,d=ee,y="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let A;e[19]!==s?(A=s("sectionsEditor.addSectionModal.title"),e[19]=s,e[20]=A):A=e[20];let E;e[21]!==A?(E=r.jsx(te,{children:A}),e[21]=A,e[22]=E):E=e[22];let U;e[23]===Symbol.for("react.memo_cache_sentinel")?(U=r.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=U):U=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>l(p.target.value),e[24]=$):$=e[24];let M;e[25]!==s?(M=s("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=s,e[26]=M):M=e[26];let O;e[27]!==c||e[28]!==M?(O=r.jsxs("div",{className:"relative pt-2",children:[U,r.jsx(se,{value:c,onChange:$,placeholder:M,className:"h-9 pl-8"})]}),e[27]=c,e[28]=M,e[29]=O):O=e[29],e[30]!==E||e[31]!==O?(w=r.jsxs(re,{className:"shrink-0 border-b px-4 py-3 text-left",children:[E,O]}),e[30]=E,e[31]=O,e[32]=w):w=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:s("sectionsEditor.addSectionModal.noSectionsFound")}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>r.jsx(pe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??J(f,W,p.previewBlock,G),onSelect:()=>o(p)},p.resolveType))}),e[0]=n,e[1]=a,e[2]=v,e[3]=o,e[4]=t,e[5]=f,e[6]=c,e[7]=s,e[8]=d,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=y,e[15]=R,e[16]=w,e[17]=C,e[18]=T}else d=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],y=e[14],R=e[15],w=e[16],C=e[17],T=e[18];let I;e[33]!==S||e[34]!==b?(I=r.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=I):I=e[35];let L;e[36]!==I||e[37]!==j||e[38]!==N?(L=r.jsx("div",{ref:j,className:N,children:I}),e[36]=I,e[37]=j,e[38]=N,e[39]=L):L=e[39];let P;e[40]!==d||e[41]!==L||e[42]!==y||e[43]!==R||e[44]!==w?(P=r.jsxs(d,{closeButtonClassName:y,className:R,children:[w,L]}),e[40]=d,e[41]=L,e[42]=y,e[43]=R,e[44]=w,e[45]=P):P=e[45];let k;return e[46]!==h||e[47]!==P||e[48]!==C||e[49]!==T?(k=r.jsx(h,{open:C,onOpenChange:T,children:P}),e[46]=h,e[47]=P,e[48]=C,e[49]=T,e[50]=k):k=e[50],k}export{be as A};
@@ -1 +0,0 @@
1
- import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-B1Wqe50f.js";import{i as jt}from"./ChevronRight-YFTtoJP6.js";import{C as Bt}from"./automation-runs-C8Us2aQT.js";import{A as At}from"./add-section-modal-BQJKPd-i.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-D8EGPj8X.js";import"./select-Bi1NZj5e.js";import"./tooltip-D9H3EBf5.js";import"./Check-B59ln8yf.js";import"./ChevronDown-BXkaTIFo.js";import"./ChevronUp-nqC8TfZe.js";import"./agent-icon-B8CH6R4U.js";import"./AlertCircle-CmlqvQvU.js";import"./Tool01-CuKaYYir.js";import"./ArrowUp-DRIdSN8O.js";import"./Settings02-Y5EoKHnL.js";import"./Tool02-BhAdrZCc.js";import"./XCircle-ZKQCeczB.js";import"./ArrowUpRight-DpKxs58Z.js";import"./TrendUp01-Cr7GCfFC.js";import"./ZapSquare-CmjyIfS8.js";import"./Users03-DVZvdomd.js";import"./CheckCircle-B7Uc0Lhw.js";import"./DotsVertical-DEmK4uzz.js";import"./Stars02-N20sgcpv.js";import"./Copy01-g955dMab.js";import"./CpuChip01-FduRDGU0.js";import"./CreditCard01-ODRSm0h5.js";import"./Eye-DEdNchPT.js";import"./FilterLines-BsqL1Yoh.js";import"./Star01-Uw83dsW7.js";import"./Palette-CIOLCTaE.js";import"./SwitchHorizontal01-v-WkSysv.js";import"./HardDrive-DCwE51VB.js";import"./Key01-DfVkeFRe.js";import"./LayoutLeft-BmQP-2Nn.js";import"./LinkExternal01-BMTNiHtD.js";import"./LogOut01-Dq-G32nE.js";import"./Monitor01-CqLKHrz4.js";import"./Sun-BFsCgkra.js";import"./Play-CkQPweHz.js";import"./Plus-DFKn-2D5.js";import"./SearchLg-BZ_U4M0X.js";import"./SearchMd-Bao2Khs6.js";import"./Shield01-DJFLY75_.js";import"./Stars01-BNMN8kI6.js";import"./Trash01-C4bB4DeV.js";import"./Upload01-Bg524psL.js";import"./User01-qoGENVb3.js";import"./Users01-DFWjxxFl.js";import"./XClose-BLBZKEFn.js";import"./X-B-bVKpMu.js";import"./Zap-NbmEih1R.js";import"./useInfiniteQuery-BfELt9Jh.js";import"./use-infinite-scroll-gAPER-ig.js";import"./use-connection-BnPeqk9B.js";import"./use-mcp-client-BpP-ogps.js";import"./auth-CfcQWvV5.js";import"./use-virtual-mcp-BaMys8Yq.js";import"./card-D23PgnYA.js";import"./sidebar-D4w_uKP7.js";import"./use-mobile-CWm9GN2y.js";import"./table-kECVt-C7.js";import"./empty-state-BUxoEqhR.js";import"./use-members-CHlaEa0y.js";import"./use-org-auth-client-CXTWlFpb.js";import"./use-clock-tick-DvehNMn7.js";import"./use-automations-CUk2Ht3V.js";import"./studio-tools-DVCzmbHJ.js";import"./useSuspenseInfiniteQuery-DAhtKkRo.js";import"./avatar-BTbEPnIr.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ChS78tRx.js";import"./dialog-DYY8nxLe.js";import"./tab-id-BJKjbU6c.js";import"./hooks-C-Yvopo_.js";import"./decopilot-sse-pool-DnurAj3t.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-Bn1M37IJ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-D1eXWoFr.js";import"./use-decopilot-events-DlaxYT1C.js";import"./use-organization-settings-BBvx6pdY.js";import"./monaco-editor-Dh32GK6v.js";import"./spinner-D-ABXbmu.js";import"./index-BfVGMDbR.js";import"./shell-layout-BNjRqTkt.js";import"./required-auth-layout-iJYWjiPs.js";import"./use-org-sso-Dka-hLl-.js";import"./integration-icon-Cqj-HXcq.js";import"./use-navigate-to-agent-BbauFgS_.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-_S6ORSTD.js";import"./form-BxCEWrFR.js";import"./label-C0D4GSim.js";import"./input-BIPflGRD.js";import"./drawer-DrUHvNFB.js";import"./collection-search-DGDMBO1x.js";import"./tabs-M_slknJr.js";import"./toggle-group-CPDLRn9j.js";import"./use-deco-credits-D9Jyodhs.js";import"./popover-BIIjQQDR.js";import"./alert-dialog-C-B7yt3Z.js";import"./toolbar-A_CyeS8I.js";import"./skeleton-Dji_M3Lr.js";import"./github-repo-picker-bFoU5cKi.js";import"./use-debounced-value-DwQtvxVS.js";import"./authenticate-and-persist-oauth-BRpIojSE.js";import"./mcp-oauth-DckzwyC7.js";import"./use-mcp-tools-CPxqW22a.js";import"./extract-connection-data-B9r7MY28.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CP7LwyrZ.js";import"./use-registry-connections-DrkFhyFg.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Bdupuo1G.js";import"./connection-form-helpers-BdDxwsOy.js";import"./collection-tabs-MOKcdzTO.js";import"./badge-CLVDJQOK.js";import"./use-open-billing-url-Dpti172K.js";import"./select-model-mrEq8Bm0.js";import"./checkbox-DSkIhGii.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dx1x63iI.js";import"./dropdown-menu-Crgvenwv.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-pSXHWaI2.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-_tObqP_-.js";import"./pt-BR-CLy76QW2.js";import"./switch-DzZL0Ygg.js";import"./use-debounced-autosave-BfyJI23F.js";import"./index-eE-z17OQ.js";import"./search-input-VerZChVs.js";import"./index-Ca7_AB2I.js";import"./use-secrets-BajYtFVS.js";import"./self-tool-result-C4ZMEaKr.js";import"./use-tags-Dq2mbdCO.js";import"./get-initials-D-f_fDFw.js";import"./command-DSlCzGc1.js";import"./index-Cr4mcBJx.js";import"./use-file-configs-DltAjEZ8.js";import"./automation-list-row-BoFaHsiS.js";function Pt(c,t){const i=(c.title||c.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),a=/^[A-Za-z]/.test(i)&&i.length>0?i:"Section",s=wt(t,a);return{blockKey:s,data:{__resolveType:c.resolveType,name:s}}}function Br(c){const t=gt.c(83),{orgSlug:i,virtualMcpId:a,branch:s,blockKey:m,block:d,meta:p,decofile:f,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=c,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,l=yt(),b=typeof d?.__resolveType=="string"?d.__resolveType:"";let R;t[0]!==G||t[1]!==p||t[2]!==b?(R=Et(b,p,G),t[0]=G,t[1]=p,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==d||t[7]!==m||t[8]!==p||t[9]!==Z?(K=Z??(d?Nt(m,d,p):m),t[6]=d,t[7]=m,t[8]=p,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==s||t[12]!==i||t[13]!==a?(T={orgSlug:i,virtualMcpId:a,branch:s},t[11]=s,t[12]=i,t[13]=a,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==s||t[16]!==i||t[17]!==a?(F={orgSlug:i,virtualMcpId:a,branch:s},t[15]=s,t[16]=i,t[17]=a,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(m),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[n,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==m&&(bt(m),dt(null),ft(zt),ut([]));let z;t[22]!==d?(z=d??{},t[22]=d,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==m||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(m,{...r,__resolveType:b})},t[29]=m,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==f||t[35]!==W||t[36]!==Y||t[37]!==l?(L=async(e,r)=>{try{const{blockKey:u,data:N}=Pt(e,f);await Y.mutateAsync({blockKey:u,data:N}),xt.success(l("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),W()}catch(u){const N=u,St=N instanceof Error?N.message:l("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=f,t[35]=W,t[36]=Y,t[37]=l,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,u=>{r(u),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==n||t[43]!==v?(H=n.length>0?[v,...n]:[],t[42]=n,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==n||t[46]!==E||t[47]!==l||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":l("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const u=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(n,r)),ft(Ot)},title:e,className:kt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=n,t[46]=E,t[47]=l,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==m||t[56]!==s||t[57]!==n||t[58]!==f||t[59]!==st||t[60]!==ot||t[61]!==y||t[62]!==pt||t[63]!==Q||t[64]!==p||t[65]!==i||t[66]!==x||t[67]!==tt||t[68]!==h||t[69]!==J||t[70]!==l||t[71]!==a?(B=o.jsx(Bt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:n,onBreadcrumbChange:at,decofile:f,meta:p,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt,sandbox:{orgSlug:i,virtualMcpId:a,branch:s}},`${m}:${ot}`):J?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),l("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:l("sandbox.appEditor.noEditableSchema")})})})}),t[55]=m,t[56]=s,t[57]=n,t[58]=f,t[59]=st,t[60]=ot,t[61]=y,t[62]=pt,t[63]=Q,t[64]=p,t[65]=i,t[66]=x,t[67]=tt,t[68]=h,t[69]=J,t[70]=l,t[71]=a,t[72]=B):B=t[72];let A;t[73]!==rt||t[74]!==f||t[75]!==lt||t[76]!==p||t[77]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:p,decofile:f,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[73]=rt,t[74]=f,t[75]=lt,t[76]=p,t[77]=x,t[78]=A):A=t[78];let M;return t[79]!==j||t[80]!==B||t[81]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[79]=j,t[80]=B,t[81]=A,t[82]=M):M=t[82],M}function Ot(c){return c+1}function zt(c){return c+1}export{Br as AppEditor};
@@ -1 +0,0 @@
1
- import{c as J,r as k,m as V,j as t,b as X,B as I,k as Y,t as $}from"./index-B1Wqe50f.js";import{i as Z}from"./XCircle-ZKQCeczB.js";import{b1 as _,y as U}from"./agent-icon-B8CH6R4U.js";import{n as K}from"./LinkExternal01-BMTNiHtD.js";import{g as tt,f as ot,b as et,A as rt,a as it,e as st,c as at,d as nt}from"./alert-dialog-C-B7yt3Z.js";import{I as W}from"./input-BIPflGRD.js";import{L as H}from"./label-C0D4GSim.js";import{P as mt,O as lt,Q as pt,ai as ct,I as dt,T as B,W as gt,aj as ut,U as xt}from"./index-D8EGPj8X.js";import{c as ft,B as ht,a as yt}from"./block-document-Cl9R9jnu.js";import{u as bt}from"./use-autosave-BjjKPWlP.js";import{t as jt}from"./ChevronDown-BXkaTIFo.js";import{ag as vt,ah as Et,af as Nt}from"./automation-runs-C8Us2aQT.js";import{s as b,E as Ct}from"./primitives-2CaNXpzQ.js";import"./AlertCircle-CmlqvQvU.js";import"./Tool01-CuKaYYir.js";import"./ArrowUp-DRIdSN8O.js";import"./Settings02-Y5EoKHnL.js";import"./Tool02-BhAdrZCc.js";import"./ArrowUpRight-DpKxs58Z.js";import"./TrendUp01-Cr7GCfFC.js";import"./ZapSquare-CmjyIfS8.js";import"./Users03-DVZvdomd.js";import"./CheckCircle-B7Uc0Lhw.js";import"./Check-B59ln8yf.js";import"./ChevronRight-YFTtoJP6.js";import"./ChevronUp-nqC8TfZe.js";import"./DotsVertical-DEmK4uzz.js";import"./Stars02-N20sgcpv.js";import"./Copy01-g955dMab.js";import"./CpuChip01-FduRDGU0.js";import"./CreditCard01-ODRSm0h5.js";import"./Eye-DEdNchPT.js";import"./FilterLines-BsqL1Yoh.js";import"./Star01-Uw83dsW7.js";import"./Palette-CIOLCTaE.js";import"./SwitchHorizontal01-v-WkSysv.js";import"./HardDrive-DCwE51VB.js";import"./Key01-DfVkeFRe.js";import"./LayoutLeft-BmQP-2Nn.js";import"./LogOut01-Dq-G32nE.js";import"./Monitor01-CqLKHrz4.js";import"./Sun-BFsCgkra.js";import"./Play-CkQPweHz.js";import"./Plus-DFKn-2D5.js";import"./SearchLg-BZ_U4M0X.js";import"./SearchMd-Bao2Khs6.js";import"./Shield01-DJFLY75_.js";import"./Stars01-BNMN8kI6.js";import"./Trash01-C4bB4DeV.js";import"./Upload01-Bg524psL.js";import"./User01-qoGENVb3.js";import"./Users01-DFWjxxFl.js";import"./XClose-BLBZKEFn.js";import"./X-B-bVKpMu.js";import"./Zap-NbmEih1R.js";import"./chat-context-Bn1M37IJ.js";import"./tab-id-BJKjbU6c.js";import"./dialog-DYY8nxLe.js";import"./hooks-C-Yvopo_.js";import"./use-mcp-client-BpP-ogps.js";import"./auth-CfcQWvV5.js";import"./decopilot-sse-pool-DnurAj3t.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BaMys8Yq.js";import"./use-ai-providers-D1eXWoFr.js";import"./studio-tools-DVCzmbHJ.js";import"./use-decopilot-events-DlaxYT1C.js";import"./use-organization-settings-BBvx6pdY.js";import"./spinner-D-ABXbmu.js";import"./tooltip-D9H3EBf5.js";import"./drawer-DrUHvNFB.js";import"./collection-search-DGDMBO1x.js";import"./use-mobile-CWm9GN2y.js";import"./AreaChart-_S6ORSTD.js";import"./index-BfVGMDbR.js";import"./shell-layout-BNjRqTkt.js";import"./avatar-BTbEPnIr.js";import"./required-auth-layout-iJYWjiPs.js";import"./use-org-sso-Dka-hLl-.js";import"./form-BxCEWrFR.js";import"./select-Bi1NZj5e.js";import"./tabs-M_slknJr.js";import"./toggle-group-CPDLRn9j.js";import"./use-deco-credits-D9Jyodhs.js";import"./sidebar-D4w_uKP7.js";import"./popover-BIIjQQDR.js";import"./toolbar-A_CyeS8I.js";import"./skeleton-Dji_M3Lr.js";import"./github-repo-picker-bFoU5cKi.js";import"./use-debounced-value-DwQtvxVS.js";import"./use-connection-BnPeqk9B.js";import"./authenticate-and-persist-oauth-BRpIojSE.js";import"./mcp-oauth-DckzwyC7.js";import"./use-mcp-tools-CPxqW22a.js";import"./extract-connection-data-B9r7MY28.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-BbauFgS_.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CP7LwyrZ.js";import"./use-registry-connections-DrkFhyFg.js";import"./useInfiniteQuery-BfELt9Jh.js";import"./use-infinite-scroll-gAPER-ig.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-D23PgnYA.js";import"./integration-icon-Cqj-HXcq.js";import"./textarea-Bdupuo1G.js";import"./connection-form-helpers-BdDxwsOy.js";import"./collection-tabs-MOKcdzTO.js";import"./badge-CLVDJQOK.js";import"./useSuspenseInfiniteQuery-DAhtKkRo.js";import"./use-open-billing-url-Dpti172K.js";import"./select-model-mrEq8Bm0.js";import"./checkbox-DSkIhGii.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dx1x63iI.js";import"./dropdown-menu-Crgvenwv.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-pSXHWaI2.js";import"./empty-state-BUxoEqhR.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-_tObqP_-.js";import"./monaco-editor-Dh32GK6v.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./switch-DzZL0Ygg.js";import"./use-debounced-autosave-BfyJI23F.js";import"./index-eE-z17OQ.js";import"./search-input-VerZChVs.js";import"./index-Ca7_AB2I.js";import"./use-secrets-BajYtFVS.js";import"./self-tool-result-C4ZMEaKr.js";import"./format-time-BnbuEtat.js";import"./use-members-CHlaEa0y.js";import"./use-org-auth-client-CXTWlFpb.js";import"./use-copy-ChS78tRx.js";import"./use-tags-Dq2mbdCO.js";import"./get-initials-D-f_fDFw.js";import"./command-DSlCzGc1.js";import"./index-Cr4mcBJx.js";import"./use-file-configs-DltAjEZ8.js";import"./use-automations-CUk2Ht3V.js";import"./automation-list-row-BoFaHsiS.js";import"./table-kECVt-C7.js";import"./use-clock-tick-DvehNMn7.js";function St(j){const o=J.c(18),{icon:x,title:m,defaultOpen:v,children:u}=j,w=v===void 0?!1:v,[f,P]=k.useState(w);let l;o[0]!==x?(l=t.jsx(x,{size:15}),o[0]=x,o[1]=l):l=o[1];let r;o[2]!==m?(r=t.jsx("span",{className:"flex-1 text-left",children:m}),o[2]=m,o[3]=r):r=o[3];const a=f&&"rotate-180";let p;o[4]!==a?(p=V("transition-transform",a),o[4]=a,o[5]=p):p=o[5];let i;o[6]!==p?(i=t.jsx(jt,{size:15,className:p}),o[6]=p,o[7]=i):i=o[7];let c;o[8]!==l||o[9]!==r||o[10]!==i?(c=t.jsx(vt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,r,i]})}),o[8]=l,o[9]=r,o[10]=i,o[11]=c):c=o[11];let d;o[12]!==u?(d=t.jsx(Et,{className:"px-2 pt-4",children:u}),o[12]=u,o[13]=d):d=o[13];let n;return o[14]!==f||o[15]!==c||o[16]!==d?(n=t.jsxs(Nt,{open:f,onOpenChange:P,className:"mt-4",children:[c,d]}),o[14]=f,o[15]=c,o[16]=d,o[17]=n):n=o[17],n}function ur({orgSlug:j,virtualMcpId:o,branch:x,blockKey:m,block:v,decofile:u,meta:w,onManagePosts:f,onOpenPost:P,previewBaseUrl:l}){const r=X(),a=mt({orgSlug:j,virtualMcpId:o,branch:x,packagePath:lt(o)}),p=pt(v,"categories"),[i,c,d]=bt(p,e=>{a.mutate({blockKey:m,data:B(m,"categories",e)})}),n=(e,S)=>c({...i,[e]:S}),A=ft({decofile:u,category:i,previewBaseUrl:l}),s=b(i.slug),[D,y]=k.useState(s),[g,E]=k.useState(null),[N,T]=k.useState(!1),z=s?ct(u).filter(e=>e.categorySlugs.includes(s)):[],C=z.length,M=e=>n("slug",e),Q=async(e,S)=>{const G=b(i.name);T(!0);try{let h=0;for(const{key:O,payload:R}of gt(u,"posts")){const L=ut(R,e,{name:G,slug:S});L!==R&&(await a.mutateAsync({blockKey:O,data:B(O,"posts",xt(L))}),h+=1)}const F={...i,slug:S};await a.mutateAsync({blockKey:m,data:B(m,"categories",F)}),d(F),$.success(h>0?r("sandbox.categoryEditor.renameSuccessWithPosts",{count:String(h)}):r("sandbox.categoryEditor.renameSuccessNoPosts")),E(null)}catch(h){y(e),E(null),$.error(h instanceof Error?h.message:r("sandbox.categoryEditor.renameFailed"))}finally{T(!1)}},q=()=>{const e=D.trim();if(e===s){D!==e&&y(e);return}if(!e){y(s);return}if(C===0){M(e);return}E({oldSlug:s,newSlug:e,count:C})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:b(i.name)||r("sandbox.categoryEditor.untitledCategory")}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(dt,{isPending:a.isPending,isError:a.isError}),A&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:r("sandbox.categoryEditor.previewTooltip"),onClick:()=>window.open(A,"_blank","noopener,noreferrer"),children:[t.jsx(K,{size:14}),r("sandbox.categoryEditor.seeCategoryPreview")]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(Ct,{value:b(i.name),onChange:e=>n("name",e),placeholder:r("sandbox.categoryEditor.categoryNamePlaceholder"),className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-slug",children:r("sandbox.categoryEditor.slugLabel")}),t.jsx(W,{id:"category-slug",value:D,onChange:e=>y(e.target.value),onBlur:q,placeholder:r("sandbox.categoryEditor.slugPlaceholder"),className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-description",children:r("sandbox.categoryEditor.descriptionLabel")}),t.jsx(W,{id:"category-description",value:b(i.description),onChange:e=>n("description",e.target.value),placeholder:r("sandbox.categoryEditor.descriptionPlaceholder"),className:"h-10"})]}),t.jsx(St,{icon:_,title:r("sandbox.categoryEditor.contentTitle"),defaultOpen:!0,children:t.jsx(ht,{value:yt(i.sections),onChange:e=>n("sections",e),meta:w,sandboxRef:{orgSlug:j,virtualMcpId:o,branch:x},emptyMessage:r("sandbox.categoryEditor.noContentEmpty")})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(U,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:r("sandbox.categoryEditor.postsInCategory",{count:String(C)})})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!s,title:r(s?"sandbox.categoryEditor.pickPostsTooltip":"sandbox.categoryEditor.setSlugTooltip"),onClick:()=>f(s),children:[r("sandbox.categoryEditor.addPostsButton"),t.jsx(Z,{size:14})]})]}),C>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(e=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>P(e.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(U,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:e.title||r("sandbox.categoryEditor.untitledPost")}),e.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:e.slug})]})]})},e.key))})]})]})})]}),t.jsx(tt,{open:!!g,onOpenChange:e=>{e||N||(y(s),E(null))},children:t.jsxs(ot,{children:[t.jsxs(et,{children:[t.jsx(rt,{children:r("sandbox.categoryEditor.renameDialogTitle")}),t.jsx(it,{children:g?r("sandbox.categoryEditor.renameDialogDescription",{oldSlug:g.oldSlug,newSlug:g.newSlug,count:String(g.count)}):null})]}),t.jsxs(st,{children:[t.jsx(at,{disabled:N,children:r("sandbox.categoryEditor.cancelButton")}),t.jsx(nt,{onClick:e=>{e.preventDefault(),g&&Q(g.oldSlug,g.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:14,className:"animate-spin"}),r("sandbox.categoryEditor.renamingLabel")]}):r("sandbox.categoryEditor.renameActionButton")})]})]})})]})}export{ur as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as L,F as $,j as b}from"./index-B1Wqe50f.js";import{a as H,g as O,s as j}from"./automation-runs-C8Us2aQT.js";import{s as k,u as B}from"./use-mcp-client-BpP-ogps.js";import{b as V,c as Y}from"./use-mcp-tools-CPxqW22a.js";import{u as q}from"./index-D8EGPj8X.js";import{c as F}from"./monaco-editor-Dh32GK6v.js";import{g as G,M as K,a as D}from"./index-BfVGMDbR.js";import{a as W,u as z}from"./chat-context-Bn1M37IJ.js";import{u as J}from"./shell-layout-BNjRqTkt.js";import{O as Q}from"./tab-id-BJKjbU6c.js";import"./select-Bi1NZj5e.js";import"./tooltip-D9H3EBf5.js";import"./Check-B59ln8yf.js";import"./ChevronDown-BXkaTIFo.js";import"./ChevronUp-nqC8TfZe.js";import"./agent-icon-B8CH6R4U.js";import"./AlertCircle-CmlqvQvU.js";import"./Tool01-CuKaYYir.js";import"./ArrowUp-DRIdSN8O.js";import"./Settings02-Y5EoKHnL.js";import"./Tool02-BhAdrZCc.js";import"./XCircle-ZKQCeczB.js";import"./ArrowUpRight-DpKxs58Z.js";import"./TrendUp01-Cr7GCfFC.js";import"./ZapSquare-CmjyIfS8.js";import"./Users03-DVZvdomd.js";import"./CheckCircle-B7Uc0Lhw.js";import"./ChevronRight-YFTtoJP6.js";import"./DotsVertical-DEmK4uzz.js";import"./Stars02-N20sgcpv.js";import"./Copy01-g955dMab.js";import"./CpuChip01-FduRDGU0.js";import"./CreditCard01-ODRSm0h5.js";import"./Eye-DEdNchPT.js";import"./FilterLines-BsqL1Yoh.js";import"./Star01-Uw83dsW7.js";import"./Palette-CIOLCTaE.js";import"./SwitchHorizontal01-v-WkSysv.js";import"./HardDrive-DCwE51VB.js";import"./Key01-DfVkeFRe.js";import"./LayoutLeft-BmQP-2Nn.js";import"./LinkExternal01-BMTNiHtD.js";import"./LogOut01-Dq-G32nE.js";import"./Monitor01-CqLKHrz4.js";import"./Sun-BFsCgkra.js";import"./Play-CkQPweHz.js";import"./Plus-DFKn-2D5.js";import"./SearchLg-BZ_U4M0X.js";import"./SearchMd-Bao2Khs6.js";import"./Shield01-DJFLY75_.js";import"./Stars01-BNMN8kI6.js";import"./Trash01-C4bB4DeV.js";import"./Upload01-Bg524psL.js";import"./User01-qoGENVb3.js";import"./Users01-DFWjxxFl.js";import"./XClose-BLBZKEFn.js";import"./X-B-bVKpMu.js";import"./Zap-NbmEih1R.js";import"./useInfiniteQuery-BfELt9Jh.js";import"./use-infinite-scroll-gAPER-ig.js";import"./use-connection-BnPeqk9B.js";import"./use-virtual-mcp-BaMys8Yq.js";import"./card-D23PgnYA.js";import"./sidebar-D4w_uKP7.js";import"./use-mobile-CWm9GN2y.js";import"./table-kECVt-C7.js";import"./empty-state-BUxoEqhR.js";import"./use-members-CHlaEa0y.js";import"./use-org-auth-client-CXTWlFpb.js";import"./use-clock-tick-DvehNMn7.js";import"./use-automations-CUk2Ht3V.js";import"./studio-tools-DVCzmbHJ.js";import"./useSuspenseInfiniteQuery-DAhtKkRo.js";import"./avatar-BTbEPnIr.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ChS78tRx.js";import"./dialog-DYY8nxLe.js";import"./hooks-C-Yvopo_.js";import"./decopilot-sse-pool-DnurAj3t.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./integration-icon-Cqj-HXcq.js";import"./use-navigate-to-agent-BbauFgS_.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-_S6ORSTD.js";import"./form-BxCEWrFR.js";import"./label-C0D4GSim.js";import"./input-BIPflGRD.js";import"./spinner-D-ABXbmu.js";import"./auth-CfcQWvV5.js";import"./drawer-DrUHvNFB.js";import"./collection-search-DGDMBO1x.js";import"./tabs-M_slknJr.js";import"./toggle-group-CPDLRn9j.js";import"./use-deco-credits-D9Jyodhs.js";import"./popover-BIIjQQDR.js";import"./alert-dialog-C-B7yt3Z.js";import"./toolbar-A_CyeS8I.js";import"./skeleton-Dji_M3Lr.js";import"./github-repo-picker-bFoU5cKi.js";import"./use-debounced-value-DwQtvxVS.js";import"./authenticate-and-persist-oauth-BRpIojSE.js";import"./mcp-oauth-DckzwyC7.js";import"./extract-connection-data-B9r7MY28.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CP7LwyrZ.js";import"./use-registry-connections-DrkFhyFg.js";import"./use-organization-settings-BBvx6pdY.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Bdupuo1G.js";import"./connection-form-helpers-BdDxwsOy.js";import"./collection-tabs-MOKcdzTO.js";import"./badge-CLVDJQOK.js";import"./use-ai-providers-D1eXWoFr.js";import"./use-open-billing-url-Dpti172K.js";import"./select-model-mrEq8Bm0.js";import"./checkbox-DSkIhGii.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dx1x63iI.js";import"./use-is-desktop-app-BNujXJc_.js";import"./dropdown-menu-Crgvenwv.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-pSXHWaI2.js";import"./use-decopilot-events-DlaxYT1C.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-_tObqP_-.js";import"./pt-BR-CLy76QW2.js";import"./switch-DzZL0Ygg.js";import"./use-debounced-autosave-BfyJI23F.js";import"./index-eE-z17OQ.js";import"./search-input-VerZChVs.js";import"./index-Ca7_AB2I.js";import"./use-secrets-BajYtFVS.js";import"./self-tool-result-C4ZMEaKr.js";import"./use-tags-Dq2mbdCO.js";import"./get-initials-D-f_fDFw.js";import"./command-DSlCzGc1.js";import"./index-Cr4mcBJx.js";import"./use-file-configs-DltAjEZ8.js";import"./automation-list-row-BoFaHsiS.js";import"./required-auth-layout-iJYWjiPs.js";import"./use-org-sso-Dka-hLl-.js";const X="studio://navigate",Z=new Set(["vtex","ga4","gsc","github"]);function tt(v){const[t]=v;if(v.length!==1||t?.type!=="resource_link"||!t.uri.startsWith(X))return{isNavigate:!1};let e=null,p=null;try{const o=new URL(t.uri).searchParams;e=o.get("main"),p=o.get("field")}catch{}return{isNavigate:!0,tab:e&&Q.has(e)?e:null,field:p&&Z.has(p)?p:null}}const ot={};function et(v){const t=L.c(38),{client:e,resourceURI:p,tool:o,connectionId:s,orgId:c,args:M}=v,{sendMessage:I}=W(),{setAppContext:g,clearAppContext:a}=z(),{openSidePanel:h,openTab:n}=J(),i=`${s}:${o.name}`;let u;t[0]!==n?(u=C=>C==="inline"?(n("0"),"inline"):"fullscreen",t[0]=n,t[1]=u):u=t[1];const m=u,l=M??ot;let d;t[2]!==e||t[3]!==o.name||t[4]!==l?(d={client:e,toolName:o.name,toolArguments:l},t[2]=e,t[3]=o.name,t[4]=l,t[5]=d):d=t[5];const{data:r}=Y(d);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=O(o._meta);x=j(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const S=x;let f;t[9]!==o.inputSchema?(f=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=f):f=t[10];let _;t[11]!==S||t[12]!==f||t[13]!==o?(_={...o,name:S,inputSchema:f},t[11]=S,t[12]=f,t[13]=o,t[14]=_):_=t[14];const E=_;let A;t[15]!==h||t[16]!==n||t[17]!==I?(A=C=>{const R=tt(C.content);if(R.isNavigate){R.tab&&n(R.tab,R.field?{field:R.field}:void 0);return}const w=F(C.content);w.content.length>0&&(h("chat"),I({tiptapDoc:w}))},t[15]=h,t[16]=n,t[17]=I,t[18]=A):A=t[18];const y=A;let N;t[19]!==E?(N={tool:E},t[19]=E,t[20]=N):N=t[20];let P;t[21]!==g||t[22]!==i?(P=C=>g(i,C),t[21]=g,t[22]=i,t[23]=P):P=t[23];let T;t[24]!==a||t[25]!==i?(T=()=>a(i),t[24]=a,t[25]=i,t[26]=T):T=t[26];let U;return t[27]!==e||t[28]!==y||t[29]!==m||t[30]!==c||t[31]!==p||t[32]!==N||t[33]!==P||t[34]!==T||t[35]!==l||t[36]!==r?(U=b.jsx(K,{resourceURI:p,orgId:c,toolInfo:N,toolInput:l,toolResult:r,displayMode:"fullscreen",minHeight:D.fullscreen.minHeight,maxHeight:D.fullscreen.maxHeight,client:e,onMessage:y,onUpdateModelContext:P,onTeardown:T,onRequestDisplayMode:m,className:"h-full"}),t[27]=e,t[28]=y,t[29]=m,t[30]=c,t[31]=p,t[32]=N,t[33]=P,t[34]=T,t[35]=l,t[36]=r,t[37]=U):U=t[37],U}function Ve(v){const t=L.c(24),{connectionId:e,toolName:p,args:o}=v,{org:s}=$(),c=q();let M;t[0]!==e||t[1]!==c?(M=k(e)&&c.vmEntry?.sandboxProviderKind==="user-desktop"&&c.previewUrl?`${c.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=e,t[1]=c,t[2]=M):M=t[2];const I=M;let g;t[3]!==e||t[4]!==I||t[5]!==s.id||t[6]!==s.slug?(g={connectionId:e,orgId:s.id,orgSlug:s.slug,mcpUrl:I},t[3]=e,t[4]=I,t[5]=s.id,t[6]=s.slug,t[7]=g):g=t[7];const a=B(g);let h;t[8]!==a?(h={client:a},t[8]=a,t[9]=h):h=t[9];const{data:n}=V(h);let i,u,m;t[10]!==p||t[11]!==n.tools?(i=H(decodeURIComponent(p)),m=n.tools.find(r=>r.name===i)??n.tools.find(r=>{const x=O(r._meta);if(!x)return!1;if(j(r.name,x)===i)return!0;const f=j(i,x);return f!==i&&r.name===f}),u=m?._meta?G(m._meta):void 0,t[10]=p,t[11]=n.tools,t[12]=i,t[13]=u,t[14]=m):(i=t[12],u=t[13],m=t[14]);const l=u;if(!m||!l){let r;return t[15]!==i?(r=b.jsx("div",{className:"flex items-center justify-center h-full w-full",children:b.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',i,'" not found or has no UI']})}),t[15]=i,t[16]=r):r=t[16],r}let d;return t[17]!==o||t[18]!==a||t[19]!==e||t[20]!==s.id||t[21]!==l||t[22]!==m?(d=b.jsx(et,{client:a,resourceURI:l,tool:m,connectionId:e,orgId:s.id,args:o}),t[17]=o,t[18]=a,t[19]=e,t[20]=s.id,t[21]=l,t[22]=m,t[23]=d):d=t[23],d}export{Ve as AppViewContent};
@@ -1 +0,0 @@
1
- import{c as L,b as A,j as r}from"./index-B1Wqe50f.js";import{I as O}from"./input-BIPflGRD.js";import{L as F}from"./label-C0D4GSim.js";import{S as R,a as z,b as V,c as D,d as J}from"./select-Bi1NZj5e.js";import{T as M}from"./textarea-Bdupuo1G.js";import{O as Q,P as Y,Q as $,I as q,T as G,Y as H}from"./index-D8EGPj8X.js";import{s as I}from"./primitives-2CaNXpzQ.js";import{u as U}from"./use-autosave-BjjKPWlP.js";import"./tooltip-D9H3EBf5.js";import"./Check-B59ln8yf.js";import"./ChevronDown-BXkaTIFo.js";import"./ChevronUp-nqC8TfZe.js";import"./ArrowUp-DRIdSN8O.js";import"./chat-context-Bn1M37IJ.js";import"./tab-id-BJKjbU6c.js";import"./dialog-DYY8nxLe.js";import"./X-B-bVKpMu.js";import"./Copy01-g955dMab.js";import"./hooks-C-Yvopo_.js";import"./use-mcp-client-BpP-ogps.js";import"./auth-CfcQWvV5.js";import"./decopilot-sse-pool-DnurAj3t.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BaMys8Yq.js";import"./use-ai-providers-D1eXWoFr.js";import"./studio-tools-DVCzmbHJ.js";import"./use-decopilot-events-DlaxYT1C.js";import"./use-organization-settings-BBvx6pdY.js";import"./automation-runs-C8Us2aQT.js";import"./agent-icon-B8CH6R4U.js";import"./AlertCircle-CmlqvQvU.js";import"./Tool01-CuKaYYir.js";import"./Settings02-Y5EoKHnL.js";import"./Tool02-BhAdrZCc.js";import"./XCircle-ZKQCeczB.js";import"./ArrowUpRight-DpKxs58Z.js";import"./TrendUp01-Cr7GCfFC.js";import"./ZapSquare-CmjyIfS8.js";import"./Users03-DVZvdomd.js";import"./CheckCircle-B7Uc0Lhw.js";import"./ChevronRight-YFTtoJP6.js";import"./DotsVertical-DEmK4uzz.js";import"./Stars02-N20sgcpv.js";import"./CpuChip01-FduRDGU0.js";import"./CreditCard01-ODRSm0h5.js";import"./Eye-DEdNchPT.js";import"./FilterLines-BsqL1Yoh.js";import"./Star01-Uw83dsW7.js";import"./Palette-CIOLCTaE.js";import"./SwitchHorizontal01-v-WkSysv.js";import"./HardDrive-DCwE51VB.js";import"./Key01-DfVkeFRe.js";import"./LayoutLeft-BmQP-2Nn.js";import"./LinkExternal01-BMTNiHtD.js";import"./LogOut01-Dq-G32nE.js";import"./Monitor01-CqLKHrz4.js";import"./Sun-BFsCgkra.js";import"./Play-CkQPweHz.js";import"./Plus-DFKn-2D5.js";import"./SearchLg-BZ_U4M0X.js";import"./SearchMd-Bao2Khs6.js";import"./Shield01-DJFLY75_.js";import"./Stars01-BNMN8kI6.js";import"./Trash01-C4bB4DeV.js";import"./Upload01-Bg524psL.js";import"./User01-qoGENVb3.js";import"./Users01-DFWjxxFl.js";import"./XClose-BLBZKEFn.js";import"./Zap-NbmEih1R.js";import"./useInfiniteQuery-BfELt9Jh.js";import"./use-infinite-scroll-gAPER-ig.js";import"./use-connection-BnPeqk9B.js";import"./card-D23PgnYA.js";import"./sidebar-D4w_uKP7.js";import"./use-mobile-CWm9GN2y.js";import"./table-kECVt-C7.js";import"./empty-state-BUxoEqhR.js";import"./use-members-CHlaEa0y.js";import"./use-org-auth-client-CXTWlFpb.js";import"./use-clock-tick-DvehNMn7.js";import"./use-automations-CUk2Ht3V.js";import"./useSuspenseInfiniteQuery-DAhtKkRo.js";import"./avatar-BTbEPnIr.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ChS78tRx.js";import"./monaco-editor-Dh32GK6v.js";import"./spinner-D-ABXbmu.js";import"./index-BfVGMDbR.js";import"./shell-layout-BNjRqTkt.js";import"./required-auth-layout-iJYWjiPs.js";import"./use-org-sso-Dka-hLl-.js";import"./integration-icon-Cqj-HXcq.js";import"./use-navigate-to-agent-BbauFgS_.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-_S6ORSTD.js";import"./form-BxCEWrFR.js";import"./drawer-DrUHvNFB.js";import"./collection-search-DGDMBO1x.js";import"./tabs-M_slknJr.js";import"./toggle-group-CPDLRn9j.js";import"./use-deco-credits-D9Jyodhs.js";import"./popover-BIIjQQDR.js";import"./alert-dialog-C-B7yt3Z.js";import"./toolbar-A_CyeS8I.js";import"./skeleton-Dji_M3Lr.js";import"./github-repo-picker-bFoU5cKi.js";import"./use-debounced-value-DwQtvxVS.js";import"./authenticate-and-persist-oauth-BRpIojSE.js";import"./mcp-oauth-DckzwyC7.js";import"./use-mcp-tools-CPxqW22a.js";import"./extract-connection-data-B9r7MY28.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CP7LwyrZ.js";import"./use-registry-connections-DrkFhyFg.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./connection-form-helpers-BdDxwsOy.js";import"./collection-tabs-MOKcdzTO.js";import"./badge-CLVDJQOK.js";import"./use-open-billing-url-Dpti172K.js";import"./select-model-mrEq8Bm0.js";import"./checkbox-DSkIhGii.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dx1x63iI.js";import"./dropdown-menu-Crgvenwv.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-pSXHWaI2.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-_tObqP_-.js";import"./pt-BR-CLy76QW2.js";import"./switch-DzZL0Ygg.js";import"./use-debounced-autosave-BfyJI23F.js";import"./index-eE-z17OQ.js";import"./search-input-VerZChVs.js";import"./index-Ca7_AB2I.js";import"./use-secrets-BajYtFVS.js";import"./self-tool-result-C4ZMEaKr.js";import"./use-tags-Dq2mbdCO.js";import"./get-initials-D-f_fDFw.js";import"./command-DSlCzGc1.js";import"./index-Cr4mcBJx.js";import"./use-file-configs-DltAjEZ8.js";import"./automation-list-row-BoFaHsiS.js";const W={authors:[{key:"name",labelKey:"sandbox.recordEditor.fieldName",widget:"text"},{key:"type",labelKey:"sandbox.recordEditor.fieldType",widget:"select",options:[{value:"Person",labelKey:"sandbox.recordEditor.optionPerson"},{value:"Organization",labelKey:"sandbox.recordEditor.optionOrganization"}]},{key:"email",labelKey:"sandbox.recordEditor.fieldEmail",widget:"text",placeholderKey:"sandbox.recordEditor.placeholderEmail"},{key:"jobTitle",labelKey:"sandbox.recordEditor.fieldJobTitle",widget:"text"},{key:"company",labelKey:"sandbox.recordEditor.fieldCompany",widget:"text"},{key:"avatar",labelKey:"sandbox.recordEditor.fieldAvatar",widget:"image"}]},X={authors:"sandbox.recordEditor.titleAuthor"};function Vr(C){const t=L.c(40),{orgSlug:K,virtualMcpId:h,branch:w,kind:a,blockKey:g,block:P}=C,i=A(),f=Q(h);let b;t[0]!==w||t[1]!==K||t[2]!==f||t[3]!==h?(b={orgSlug:K,virtualMcpId:h,branch:w,packagePath:f},t[0]=w,t[1]=K,t[2]=f,t[3]=h,t[4]=b):b=t[4];const p=Y(b);let k;t[5]!==P||t[6]!==a?(k=$(P,a),t[5]=P,t[6]=a,t[7]=k):k=t[7];const B=k;let v;t[8]!==g||t[9]!==a||t[10]!==p?(v=l=>{p.mutate({blockKey:g,data:G(g,a,l)})},t[8]=g,t[9]=a,t[10]=p,t[11]=v):v=t[11];const[e,S]=U(B,v);let j;t[12]!==e||t[13]!==S?(j=(l,o)=>S({...e,[l]:o}),t[12]=e,t[13]=S,t[14]=j):j=t[14];const s=j,T=X[a];let n;t[15]!==i||t[16]!==T?(n=i(T),t[15]=i,t[16]=T,t[17]=n):n=t[17];let c;t[18]!==n?(c=r.jsx("span",{className:"text-sm font-medium",children:n}),t[18]=n,t[19]=c):c=t[19];let d;t[20]!==p.isError||t[21]!==p.isPending?(d=r.jsx(q,{isPending:p.isPending,isError:p.isError}),t[20]=p.isError,t[21]=p.isPending,t[22]=d):d=t[22];let y;t[23]!==c||t[24]!==d?(y=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,d]}),t[23]=c,t[24]=d,t[25]=y):y=t[25];const N=W[a];let x;if(t[26]!==e||t[27]!==s||t[28]!==i||t[29]!==N){let l;t[31]!==e||t[32]!==s||t[33]!==i?(l=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(H,{schema:{type:"string",format:"image-uri",title:i(o.labelKey)},value:e[o.key],onChange:m=>s(o.key,m),path:o.key,label:i(o.labelKey)}):o.widget==="select"?r.jsxs(r.Fragment,{children:[r.jsx(F,{htmlFor:o.key,children:i(o.labelKey)}),r.jsxs(R,{value:I(e[o.key])||o.options?.[0]?.value,onValueChange:m=>s(o.key,m),children:[r.jsx(z,{id:o.key,className:"h-10 w-full",children:r.jsx(V,{placeholder:i(o.labelKey)})}),r.jsx(D,{children:(o.options??[]).map(m=>r.jsx(J,{value:m.value,children:i(m.labelKey)},m.value))})]})]}):r.jsxs(r.Fragment,{children:[r.jsx(F,{htmlFor:o.key,children:i(o.labelKey)}),o.widget==="textarea"?r.jsx(M,{id:o.key,value:I(e[o.key]),onChange:m=>s(o.key,m.target.value),rows:3}):r.jsx(O,{id:o.key,value:I(e[o.key]),placeholder:o.placeholderKey?i(o.placeholderKey):void 0,onChange:m=>s(o.key,m.target.value),className:"h-10"})]})},o.key),t[31]=e,t[32]=s,t[33]=i,t[34]=l):l=t[34],x=N.map(l),t[26]=e,t[27]=s,t[28]=i,t[29]=N,t[30]=x}else x=t[30];let u;t[35]!==x?(u=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:x})}),t[35]=x,t[36]=u):u=t[36];let E;return t[37]!==y||t[38]!==u?(E=r.jsxs("div",{className:"flex h-full flex-col",children:[y,u]}),t[37]=y,t[38]=u,t[39]=E):E=t[39],E}export{Vr as RecordEditor};
@@ -1 +0,0 @@
1
- import{c as pt,b as at,j as r}from"./index-B1Wqe50f.js";import{C as ct}from"./checkbox-DSkIhGii.js";import{I as rt}from"./input-BIPflGRD.js";import{L as et}from"./label-C0D4GSim.js";import{d as dt,a as nt,b as ft,c as xt,S as ht}from"./select-Bi1NZj5e.js";import{F as ut,br as bt,I as yt,bs as jt,bt as vt}from"./index-D8EGPj8X.js";import{u as gt}from"./use-autosave-BjjKPWlP.js";import"./Check-B59ln8yf.js";import"./tooltip-D9H3EBf5.js";import"./ChevronDown-BXkaTIFo.js";import"./ChevronUp-nqC8TfZe.js";import"./ArrowUp-DRIdSN8O.js";import"./chat-context-Bn1M37IJ.js";import"./tab-id-BJKjbU6c.js";import"./dialog-DYY8nxLe.js";import"./X-B-bVKpMu.js";import"./Copy01-g955dMab.js";import"./hooks-C-Yvopo_.js";import"./use-mcp-client-BpP-ogps.js";import"./auth-CfcQWvV5.js";import"./decopilot-sse-pool-DnurAj3t.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BaMys8Yq.js";import"./use-ai-providers-D1eXWoFr.js";import"./studio-tools-DVCzmbHJ.js";import"./use-decopilot-events-DlaxYT1C.js";import"./use-organization-settings-BBvx6pdY.js";import"./automation-runs-C8Us2aQT.js";import"./agent-icon-B8CH6R4U.js";import"./AlertCircle-CmlqvQvU.js";import"./Tool01-CuKaYYir.js";import"./Settings02-Y5EoKHnL.js";import"./Tool02-BhAdrZCc.js";import"./XCircle-ZKQCeczB.js";import"./ArrowUpRight-DpKxs58Z.js";import"./TrendUp01-Cr7GCfFC.js";import"./ZapSquare-CmjyIfS8.js";import"./Users03-DVZvdomd.js";import"./CheckCircle-B7Uc0Lhw.js";import"./ChevronRight-YFTtoJP6.js";import"./DotsVertical-DEmK4uzz.js";import"./Stars02-N20sgcpv.js";import"./CpuChip01-FduRDGU0.js";import"./CreditCard01-ODRSm0h5.js";import"./Eye-DEdNchPT.js";import"./FilterLines-BsqL1Yoh.js";import"./Star01-Uw83dsW7.js";import"./Palette-CIOLCTaE.js";import"./SwitchHorizontal01-v-WkSysv.js";import"./HardDrive-DCwE51VB.js";import"./Key01-DfVkeFRe.js";import"./LayoutLeft-BmQP-2Nn.js";import"./LinkExternal01-BMTNiHtD.js";import"./LogOut01-Dq-G32nE.js";import"./Monitor01-CqLKHrz4.js";import"./Sun-BFsCgkra.js";import"./Play-CkQPweHz.js";import"./Plus-DFKn-2D5.js";import"./SearchLg-BZ_U4M0X.js";import"./SearchMd-Bao2Khs6.js";import"./Shield01-DJFLY75_.js";import"./Stars01-BNMN8kI6.js";import"./Trash01-C4bB4DeV.js";import"./Upload01-Bg524psL.js";import"./User01-qoGENVb3.js";import"./Users01-DFWjxxFl.js";import"./XClose-BLBZKEFn.js";import"./Zap-NbmEih1R.js";import"./useInfiniteQuery-BfELt9Jh.js";import"./use-infinite-scroll-gAPER-ig.js";import"./use-connection-BnPeqk9B.js";import"./card-D23PgnYA.js";import"./sidebar-D4w_uKP7.js";import"./use-mobile-CWm9GN2y.js";import"./table-kECVt-C7.js";import"./empty-state-BUxoEqhR.js";import"./use-members-CHlaEa0y.js";import"./use-org-auth-client-CXTWlFpb.js";import"./use-clock-tick-DvehNMn7.js";import"./use-automations-CUk2Ht3V.js";import"./useSuspenseInfiniteQuery-DAhtKkRo.js";import"./avatar-BTbEPnIr.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ChS78tRx.js";import"./monaco-editor-Dh32GK6v.js";import"./spinner-D-ABXbmu.js";import"./index-BfVGMDbR.js";import"./shell-layout-BNjRqTkt.js";import"./required-auth-layout-iJYWjiPs.js";import"./use-org-sso-Dka-hLl-.js";import"./integration-icon-Cqj-HXcq.js";import"./use-navigate-to-agent-BbauFgS_.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-_S6ORSTD.js";import"./form-BxCEWrFR.js";import"./drawer-DrUHvNFB.js";import"./collection-search-DGDMBO1x.js";import"./tabs-M_slknJr.js";import"./toggle-group-CPDLRn9j.js";import"./use-deco-credits-D9Jyodhs.js";import"./popover-BIIjQQDR.js";import"./alert-dialog-C-B7yt3Z.js";import"./toolbar-A_CyeS8I.js";import"./skeleton-Dji_M3Lr.js";import"./github-repo-picker-bFoU5cKi.js";import"./use-debounced-value-DwQtvxVS.js";import"./authenticate-and-persist-oauth-BRpIojSE.js";import"./mcp-oauth-DckzwyC7.js";import"./use-mcp-tools-CPxqW22a.js";import"./extract-connection-data-B9r7MY28.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CP7LwyrZ.js";import"./use-registry-connections-DrkFhyFg.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Bdupuo1G.js";import"./connection-form-helpers-BdDxwsOy.js";import"./collection-tabs-MOKcdzTO.js";import"./badge-CLVDJQOK.js";import"./use-open-billing-url-Dpti172K.js";import"./select-model-mrEq8Bm0.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dx1x63iI.js";import"./dropdown-menu-Crgvenwv.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-pSXHWaI2.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-_tObqP_-.js";import"./pt-BR-CLy76QW2.js";import"./switch-DzZL0Ygg.js";import"./use-debounced-autosave-BfyJI23F.js";import"./index-eE-z17OQ.js";import"./search-input-VerZChVs.js";import"./index-Ca7_AB2I.js";import"./use-secrets-BajYtFVS.js";import"./self-tool-result-C4ZMEaKr.js";import"./use-tags-Dq2mbdCO.js";import"./get-initials-D-f_fDFw.js";import"./command-DSlCzGc1.js";import"./index-Cr4mcBJx.js";import"./use-file-configs-DltAjEZ8.js";import"./automation-list-row-BoFaHsiS.js";const Et=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}];function pi(it){const t=pt.c(106),{orgSlug:H,virtualMcpId:J,branch:W,blockKey:X,block:Z}=it,e=at();let V;t[0]!==W||t[1]!==H||t[2]!==J?(V={orgSlug:H,virtualMcpId:J,branch:W},t[0]=W,t[1]=H,t[2]=J,t[3]=V):V=t[3];const s=ut(V);let M;t[4]!==Z?(M=bt(Z),t[4]=Z,t[5]=M):M=t[5];const ot=M;let Y;t[6]!==X||t[7]!==s?(Y=i=>{s.mutate({blockKey:X,data:vt(i)})},t[6]=X,t[7]=s,t[8]=Y):Y=t[8];const[o,tt]=gt(ot,Y);let $;t[9]!==o||t[10]!==tt?($=i=>tt({...o,...i}),t[9]=o,t[10]=tt,t[11]=$):$=t[11];const m=$;let l;t[12]!==e?(l=e("sandbox.redirectEditor.title"),t[12]=e,t[13]=l):l=t[13];let p;t[14]!==l?(p=r.jsx("span",{className:"text-sm font-medium",children:l}),t[14]=l,t[15]=p):p=t[15];let a;t[16]!==s.isError||t[17]!==s.isPending?(a=r.jsx(yt,{isPending:s.isPending,isError:s.isError}),t[16]=s.isError,t[17]=s.isPending,t[18]=a):a=t[18];let c;t[19]!==p||t[20]!==a?(c=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[p,a]}),t[19]=p,t[20]=a,t[21]=c):c=t[21];let d;t[22]!==e?(d=e("sandbox.redirectEditor.fromLabel"),t[22]=e,t[23]=d):d=t[23];let n;t[24]!==d?(n=r.jsx(et,{htmlFor:"redirect-from",children:d}),t[24]=d,t[25]=n):n=t[25];const mt=o.from;let f;t[26]!==e?(f=e("sandbox.redirectEditor.fromPlaceholder"),t[26]=e,t[27]=f):f=t[27];let x;t[28]!==m?(x=i=>m({from:i.target.value}),t[28]=m,t[29]=x):x=t[29];let h;t[30]!==o.from||t[31]!==f||t[32]!==x?(h=r.jsx(rt,{id:"redirect-from",value:mt,placeholder:f,onChange:x,className:"h-10"}),t[30]=o.from,t[31]=f,t[32]=x,t[33]=h):h=t[33];let u;t[34]!==e?(u=e("sandbox.redirectEditor.fromDescription"),t[34]=e,t[35]=u):u=t[35];let b;t[36]!==u?(b=r.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[36]=u,t[37]=b):b=t[37];let y;t[38]!==n||t[39]!==h||t[40]!==b?(y=r.jsxs("div",{className:"space-y-2",children:[n,h,b]}),t[38]=n,t[39]=h,t[40]=b,t[41]=y):y=t[41];let j;t[42]!==e?(j=e("sandbox.redirectEditor.toLabel"),t[42]=e,t[43]=j):j=t[43];let v;t[44]!==j?(v=r.jsx(et,{htmlFor:"redirect-to",children:j}),t[44]=j,t[45]=v):v=t[45];const st=o.to;let g;t[46]!==e?(g=e("sandbox.redirectEditor.toPlaceholder"),t[46]=e,t[47]=g):g=t[47];let E;t[48]!==m?(E=i=>m({to:i.target.value}),t[48]=m,t[49]=E):E=t[49];let P;t[50]!==o.to||t[51]!==g||t[52]!==E?(P=r.jsx(rt,{id:"redirect-to",value:st,placeholder:g,onChange:E,className:"h-10"}),t[50]=o.to,t[51]=g,t[52]=E,t[53]=P):P=t[53];let N;t[54]!==e?(N=e("sandbox.redirectEditor.toDescription"),t[54]=e,t[55]=N):N=t[55];let S;t[56]!==N?(S=r.jsx("p",{className:"text-xs text-muted-foreground",children:N}),t[56]=N,t[57]=S):S=t[57];let C;t[58]!==v||t[59]!==P||t[60]!==S?(C=r.jsxs("div",{className:"space-y-2",children:[v,P,S]}),t[58]=v,t[59]=P,t[60]=S,t[61]=C):C=t[61];let T;t[62]!==e?(T=e("sandbox.redirectEditor.typeLabel"),t[62]=e,t[63]=T):T=t[63];let k;t[64]!==T?(k=r.jsx(et,{htmlFor:"redirect-type",children:T}),t[64]=T,t[65]=k):k=t[65];const lt=o.type;let w;t[66]!==m?(w=i=>m({type:i}),t[66]=m,t[67]=w):w=t[67];let I;t[68]!==e?(I=e("sandbox.redirectEditor.typePlaceholder"),t[68]=e,t[69]=I):I=t[69];let R;t[70]!==I?(R=r.jsx(nt,{id:"redirect-type",className:"h-10 w-full",children:r.jsx(ft,{placeholder:I})}),t[70]=I,t[71]=R):R=t[71];let _;t[72]!==e?(_=Et.map(i=>r.jsx(dt,{value:i.value,children:e(i.labelKey,{status:jt[i.value]})},i.value)),t[72]=e,t[73]=_):_=t[73];let F;t[74]!==_?(F=r.jsx(xt,{children:_}),t[74]=_,t[75]=F):F=t[75];let L;t[76]!==o.type||t[77]!==w||t[78]!==R||t[79]!==F?(L=r.jsxs(ht,{value:lt,onValueChange:w,children:[R,F]}),t[76]=o.type,t[77]=w,t[78]=R,t[79]=F,t[80]=L):L=t[80];let q;t[81]===Symbol.for("react.memo_cache_sentinel")?(q=r.jsx("strong",{children:"Temporary"}),t[81]=q):q=t[81];let z;t[82]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",q," when the redirect may change;"," ",r.jsx("strong",{children:"Permanent"})," lets browsers cache it."]}),t[82]=z):z=t[82];let Q;t[83]!==k||t[84]!==L?(Q=r.jsxs("div",{className:"space-y-2",children:[k,L,z]}),t[83]=k,t[84]=L,t[85]=Q):Q=t[85];let K;t[86]!==m?(K=i=>m({discardQueryParameters:i===!0}),t[86]=m,t[87]=K):K=t[87];let D;t[88]!==o.discardQueryParameters||t[89]!==K?(D=r.jsx(ct,{checked:o.discardQueryParameters,onCheckedChange:K}),t[88]=o.discardQueryParameters,t[89]=K,t[90]=D):D=t[90];let A;t[91]!==e?(A=e("sandbox.redirectEditor.discardQueryParameters"),t[91]=e,t[92]=A):A=t[92];let B;t[93]!==A?(B=r.jsx("span",{className:"text-sm",children:A}),t[93]=A,t[94]=B):B=t[94];let O;t[95]!==D||t[96]!==B?(O=r.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[D,B]}),t[95]=D,t[96]=B,t[97]=O):O=t[97];let U;t[98]!==y||t[99]!==C||t[100]!==Q||t[101]!==O?(U=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsxs("div",{className:"mx-auto max-w-xl space-y-6",children:[y,C,Q,O]})}),t[98]=y,t[99]=C,t[100]=Q,t[101]=O,t[102]=U):U=t[102];let G;return t[103]!==U||t[104]!==c?(G=r.jsxs("div",{className:"flex h-full flex-col",children:[c,U]}),t[103]=U,t[104]=c,t[105]=G):G=t[105],G}export{pi as RedirectEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BuCpbtaM.js","assets/index-B1Wqe50f.js","assets/index-BZ6FY5YW.css","assets/Tool02-BhAdrZCc.js","assets/CheckCircle-B7Uc0Lhw.js","assets/Settings02-Y5EoKHnL.js","assets/use-mcp-client-BpP-ogps.js","assets/auth-CfcQWvV5.js","assets/useInfiniteQuery-BfELt9Jh.js","assets/use-infinite-scroll-gAPER-ig.js","assets/studio-tools-DVCzmbHJ.js","assets/badge-CLVDJQOK.js","assets/input-BIPflGRD.js","assets/dropdown-menu-Crgvenwv.js","assets/Check-B59ln8yf.js","assets/ChevronRight-YFTtoJP6.js","assets/DotsVertical-DEmK4uzz.js","assets/table-kECVt-C7.js","assets/toggle-group-CPDLRn9j.js","assets/use-view-mode-CY7SFCtA.js","assets/use-mobile-CWm9GN2y.js","assets/FilterLines-BsqL1Yoh.js","assets/SearchMd-Bao2Khs6.js","assets/dialog-DYY8nxLe.js","assets/X-B-bVKpMu.js","assets/AlertCircle-CmlqvQvU.js","assets/Upload01-Bg524psL.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-C-B7yt3Z.js","assets/card-D23PgnYA.js","assets/Trash01-C4bB4DeV.js","assets/label-C0D4GSim.js","assets/select-Bi1NZj5e.js","assets/tooltip-D9H3EBf5.js","assets/ChevronDown-BXkaTIFo.js","assets/ChevronUp-nqC8TfZe.js","assets/switch-DzZL0Ygg.js","assets/textarea-Bdupuo1G.js","assets/XCircle-ZKQCeczB.js","assets/checkbox-DSkIhGii.js","assets/Eye-DEdNchPT.js","assets/LinkExternal01-BMTNiHtD.js","assets/use-copy-ChS78tRx.js","assets/Copy01-g955dMab.js","assets/Key01-DfVkeFRe.js","assets/Plus-DFKn-2D5.js","assets/mcp-oauth-DckzwyC7.js","assets/Play-CkQPweHz.js"])))=>i.map(i=>d[i]);
2
- import{c as i,j as e,r as s,k as a,aG as o}from"./index-B1Wqe50f.js";import{R as m}from"./require-capability-D33eHd9x.js";import"./use-capability-_tObqP_-.js";import"./access-gate-B5SUruAr.js";import"./capability-load-error-CiNu_2Tk.js";const n=s.lazy(()=>o(()=>import("./registry-layout-BuCpbtaM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])));function f(){const r=i.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
@@ -1,2 +0,0 @@
1
- import{c as Ue,b as ct,r as w,m as Ie,j as n,ae as Jn,B as Qe,k as Qn,o as Va,t as Q,K as Da}from"./index-B1Wqe50f.js";import{am as Pa,an as Aa,ao as Ca,a1 as Xn,a2 as Jt,ap as Zn,aq as es,a3 as ts,a4 as ns,ar as ss,as as Ma,ab as as,ac as os,at as Ka,au as Ba,N as La,a5 as rs,a6 as Ct,a9 as is,aa as ls,a7 as cs,ah as us,av as Fa,aw as Mt,ax as Oa,S as ds,ay as lt,az as Ia,aA as $a,aB as za,aC as Ha,D as Ga,F as Ua,aD as Wa,aE as qa,aF as Ya,aG as Ja,af as Gt,aH as Ut,aI as Qa,aJ as St,aK as Dt,aL as Xa,aM as Za,aN as et,aO as Kn,aP as eo,aQ as Pt,aR as Wt,aS as to,aT as dn,aU as no,aV as wt,aW as so,aX as ao,aY as oo,aZ as ro,a_ as io,a$ as xt,b0 as lo,b1 as co,b2 as uo,H as mo,b3 as Bn,b4 as At,b5 as Ln,b6 as Fn,b7 as fo,b8 as po,b9 as go,ba as ho,bb as mn,bc as On,bd as In,be as Nt,bf as qt,bg as $n,bh as vo,bi as fn,bj as bo,bk as So,bl as xo,bm as yo,bn as _o}from"./index-D8EGPj8X.js";import{t as jo}from"./ChevronDown-BXkaTIFo.js";import{ag as hn,v as Eo,W as ms,G as ko,u as fs,ai as Ro,a1 as wo}from"./agent-icon-B8CH6R4U.js";import{i as ps}from"./ChevronRight-YFTtoJP6.js";import{n as No}from"./ChevronUp-nqC8TfZe.js";import{i as To}from"./Tool02-BhAdrZCc.js";import{C as Yt}from"./automation-runs-C8Us2aQT.js";import{c as yt,T as _t,a as jt}from"./tooltip-D9H3EBf5.js";import{b as Vo,h as Do,a as Po,c as Ao,d as Co,e as Mo}from"./dialog-DYY8nxLe.js";import{I as Ko}from"./input-BIPflGRD.js";import{a as gs}from"./Copy01-g955dMab.js";import{b as Bo}from"./Settings02-Y5EoKHnL.js";import{s as Lo}from"./Eye-DEdNchPT.js";import{s as hs}from"./TrendUp01-Cr7GCfFC.js";import{s as vn}from"./Plus-DFKn-2D5.js";import{s as vs}from"./Trash01-C4bB4DeV.js";import{i as Fo}from"./Zap-NbmEih1R.js";import{D as bs,a as ht,c as Ss,b as xs,i as Oo}from"./dropdown-menu-Crgvenwv.js";import{S as Io,r as zn,u as $o,d as zo,a as Ho,i as Go,f as Uo,P as Wo,b as qo}from"./page-seo-form-D2xFmapx.js";import{c as Yo}from"./Tool01-CuKaYYir.js";import{A as Jo}from"./add-section-modal-BQJKPd-i.js";import"./ArrowUp-DRIdSN8O.js";import"./chat-context-Bn1M37IJ.js";import"./tab-id-BJKjbU6c.js";import"./Check-B59ln8yf.js";import"./hooks-C-Yvopo_.js";import"./use-mcp-client-BpP-ogps.js";import"./auth-CfcQWvV5.js";import"./decopilot-sse-pool-DnurAj3t.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BaMys8Yq.js";import"./use-ai-providers-D1eXWoFr.js";import"./studio-tools-DVCzmbHJ.js";import"./use-decopilot-events-DlaxYT1C.js";import"./use-organization-settings-BBvx6pdY.js";import"./spinner-D-ABXbmu.js";import"./drawer-DrUHvNFB.js";import"./collection-search-DGDMBO1x.js";import"./SearchMd-Bao2Khs6.js";import"./use-mobile-CWm9GN2y.js";import"./AreaChart-_S6ORSTD.js";import"./index-BfVGMDbR.js";import"./X-B-bVKpMu.js";import"./shell-layout-BNjRqTkt.js";import"./avatar-BTbEPnIr.js";import"./User01-qoGENVb3.js";import"./Users03-DVZvdomd.js";import"./SearchLg-BZ_U4M0X.js";import"./Stars02-N20sgcpv.js";import"./XClose-BLBZKEFn.js";import"./CheckCircle-B7Uc0Lhw.js";import"./CpuChip01-FduRDGU0.js";import"./FilterLines-BsqL1Yoh.js";import"./Monitor01-CqLKHrz4.js";import"./required-auth-layout-iJYWjiPs.js";import"./use-org-sso-Dka-hLl-.js";import"./ZapSquare-CmjyIfS8.js";import"./Star01-Uw83dsW7.js";import"./Upload01-Bg524psL.js";import"./AlertCircle-CmlqvQvU.js";import"./form-BxCEWrFR.js";import"./label-C0D4GSim.js";import"./select-Bi1NZj5e.js";import"./XCircle-ZKQCeczB.js";import"./tabs-M_slknJr.js";import"./toggle-group-CPDLRn9j.js";import"./use-deco-credits-D9Jyodhs.js";import"./sidebar-D4w_uKP7.js";import"./LayoutLeft-BmQP-2Nn.js";import"./popover-BIIjQQDR.js";import"./alert-dialog-C-B7yt3Z.js";import"./toolbar-A_CyeS8I.js";import"./skeleton-Dji_M3Lr.js";import"./github-repo-picker-bFoU5cKi.js";import"./use-debounced-value-DwQtvxVS.js";import"./use-connection-BnPeqk9B.js";import"./authenticate-and-persist-oauth-BRpIojSE.js";import"./mcp-oauth-DckzwyC7.js";import"./LinkExternal01-BMTNiHtD.js";import"./use-mcp-tools-CPxqW22a.js";import"./extract-connection-data-B9r7MY28.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-BbauFgS_.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CP7LwyrZ.js";import"./use-registry-connections-DrkFhyFg.js";import"./useInfiniteQuery-BfELt9Jh.js";import"./use-infinite-scroll-gAPER-ig.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-D23PgnYA.js";import"./integration-icon-Cqj-HXcq.js";import"./textarea-Bdupuo1G.js";import"./connection-form-helpers-BdDxwsOy.js";import"./collection-tabs-MOKcdzTO.js";import"./badge-CLVDJQOK.js";import"./useSuspenseInfiniteQuery-DAhtKkRo.js";import"./use-open-billing-url-Dpti172K.js";import"./select-model-mrEq8Bm0.js";import"./checkbox-DSkIhGii.js";import"./Key01-DfVkeFRe.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dx1x63iI.js";import"./ArrowUpRight-DpKxs58Z.js";import"./Stars01-BNMN8kI6.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-pSXHWaI2.js";import"./empty-state-BUxoEqhR.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-_tObqP_-.js";import"./monaco-editor-Dh32GK6v.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./switch-DzZL0Ygg.js";import"./Play-CkQPweHz.js";import"./use-debounced-autosave-BfyJI23F.js";import"./index-eE-z17OQ.js";import"./search-input-VerZChVs.js";import"./index-Ca7_AB2I.js";import"./Users01-DFWjxxFl.js";import"./use-secrets-BajYtFVS.js";import"./DotsVertical-DEmK4uzz.js";import"./self-tool-result-C4ZMEaKr.js";import"./format-time-BnbuEtat.js";import"./use-members-CHlaEa0y.js";import"./use-org-auth-client-CXTWlFpb.js";import"./use-copy-ChS78tRx.js";import"./SwitchHorizontal01-v-WkSysv.js";import"./use-tags-Dq2mbdCO.js";import"./get-initials-D-f_fDFw.js";import"./command-DSlCzGc1.js";import"./index-Cr4mcBJx.js";import"./Palette-CIOLCTaE.js";import"./use-file-configs-DltAjEZ8.js";import"./use-automations-CUk2Ht3V.js";import"./automation-list-row-BoFaHsiS.js";import"./CreditCard01-ODRSm0h5.js";import"./HardDrive-DCwE51VB.js";import"./LogOut01-Dq-G32nE.js";import"./Sun-BFsCgkra.js";import"./Shield01-DJFLY75_.js";import"./table-kECVt-C7.js";import"./use-clock-tick-DvehNMn7.js";function Qo(g){return g.schema?.definitions??g.schema?.$defs??{}}function Xo(g,e){const r=Qo(e),d=r[btoa(g)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const S=d.allOf.find(x=>typeof x.$ref=="string")?.$ref;if(typeof S=="string"){const x=S.replace("#/definitions/",""),f=r[x];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Zo(g,e){if(!e)return;const r=Pa(g);if(!r)return;const d=Xo(r.resolveType,e);if(!d)return;const m=Aa(d,r.data);if(m)return Ca(m)}const er="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",tr="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 Hn(g){return Array.from({length:g},(e,r)=>({id:crypto.randomUUID(),index:r}))}function ys(g){return g.map((e,r)=>({...e,index:r}))}function nr(g,e){if(e===g.length)return g;if(e<g.length)return ys(g.slice(0,e));const r=Array.from({length:e-g.length},(d,m)=>({id:crypto.randomUUID(),index:g.length+m}));return[...g,...r]}function _s(g){const e=Ue.c(20),{section:r,raw:d,meta:m}=g,S=r.isSavedBlock===!0,x=r.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Zo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const h=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Eo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==h?(y=h&&n.jsx("img",{src:h,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=h,e[5]=y):y=e[5];let T;e[6]!==x||e[7]!==S?(T=S?{color:La}:x?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=x,e[7]=S,e[8]=T):T=e[8];let D;e[9]!==T?(D=n.jsx(hn,{className:"h-4 w-4 shrink-0",style:T}),e[9]=T,e[10]=D):D=e[10];const E=r.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Ie("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let v;e[13]!==r.label||e[14]!==i?(v=n.jsx("span",{className:i,children:r.label}),e[13]=r.label,e[14]=i,e[15]=v):v=e[15];let o;return e[16]!==y||e[17]!==D||e[18]!==v?(o=n.jsxs(n.Fragment,{children:[u,y,D,v]}),e[16]=y,e[17]=D,e[18]=v,e[19]=o):o=e[19],o}const sr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",ar="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]",or="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function pn(g,e){return Ie("h-7 shrink-0 overflow-hidden",e?sr:g?or:ar)}function js(g,e){const r=g.isSavedBlock===!0,d=g.isMultivariate===!0;return Ie("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?er:d?"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)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function rr(g){const e=Ue.c(82),{section:r,raw:d,meta:m,sortableId:S,selected:x,onSelect:f,onDelete:h,onDuplicate:u,onMakeReusable:y,onToggleHidden:T,onToggleLazy:D,onAddVariant:E,onDetach:i}=g,v=ct(),o=d?ss(d.__resolveType??""):!1,P=r.isHidden===!0,l=o||P;let R;e[0]!==r?(R=Ma(r),e[0]=r,e[1]=R):R=e[1];const K=R;let I;e[2]!==S?(I={id:S,animateLayoutChanges:dr},e[2]=S,e[3]=I):I=e[3];const{attributes:p,listeners:V,setNodeRef:ae,transform:L,isDragging:fe}=as(I);let C;e[4]!==L?(C=os.Transform.toString(L?{...L,x:0}:null),e[4]=L,e[5]=C):C=e[5];const Se=fe?0:void 0;let O;e[6]!==C||e[7]!==Se?(O={transform:C,opacity:Se},e[6]=C,e[7]=Se,e[8]=O):O=e[8];const te=O;let re;e[9]!==r?(re=Ka(r),e[9]=r,e[10]=re):re=e[10];const ie=re,q="button",ne=0;let X;e[11]!==f?(X=k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),f())},e[11]=f,e[12]=X):X=e[12];const le=fe?"cursor-grabbing":"cursor-pointer";let B;e[13]!==r||e[14]!==x||e[15]!==le?(B=Ie("touch-none transition-colors",le,js(r,x)),e[13]=r,e[14]=x,e[15]=le,e[16]=B):B=e[16];let Fe;e[17]!==m||e[18]!==d||e[19]!==r?(Fe=n.jsx(_s,{section:r,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=r,e[20]=Fe):Fe=e[20];const Ge=!r.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":v(o?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ie(pn(l,o)),onClick:k=>{k.stopPropagation(),D()},onPointerDown:ur,children:n.jsx(Fo,{className:Ie("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:v(o?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),tt=!r.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":v(P?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:Ie(pn(l,P)),onClick:k=>{k.stopPropagation(),T()},onPointerDown:cr,children:P?n.jsx(Bo,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:v(P?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=Ss,Y=bs,me=!0,pe=Qe,Ve="button",ye="ghost",De="icon";let ce;e[21]!==v?(ce=v("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=v,e[22]=ce):ce=e[22];const ke=Ie(pn(l,!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 Be;e[23]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(ms,{className:"h-3.5 w-3.5"}),e[23]=Be):Be=e[23];let Re;e[24]!==pe||e[25]!==ce||e[26]!==ke?(Re=n.jsx(pe,{type:Ve,variant:ye,size:De,"aria-label":ce,className:ke,onClick:lr,onPointerDown:ir,children:Be}),e[24]=pe,e[25]=ce,e[26]=ke,e[27]=Re):Re=e[27];let oe;e[28]!==Y||e[29]!==Re?(oe=n.jsx(Y,{asChild:me,children:Re}),e[28]=Y,e[29]=Re,e[30]=oe):oe=e[30];let ge;e[31]!==u?(ge=k=>{k.stopPropagation(),u()},e[31]=u,e[32]=ge):ge=e[32];let Pe;e[33]===Symbol.for("react.memo_cache_sentinel")?(Pe=n.jsx(gs,{className:"h-4 w-4"}),e[33]=Pe):Pe=e[33];let he;e[34]!==v?(he=v("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=v,e[35]=he):he=e[35];let $;e[36]!==ge||e[37]!==he?($=n.jsxs(ht,{onClick:ge,children:[Pe,he]}),e[36]=ge,e[37]=he,e[38]=$):$=e[38];let ve;e[39]!==K||e[40]!==E||e[41]!==v?(ve=K&&n.jsxs(ht,{className:Ba,onClick:k=>{k.stopPropagation(),E()},children:[n.jsx(hs,{className:"h-4 w-4"}),v("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=K,e[40]=E,e[41]=v,e[42]=ve):ve=e[42];let _e;e[43]!==ie||e[44]!==y||e[45]!==v?(_e=ie&&n.jsxs(ht,{className:tr,onClick:k=>{k.stopPropagation(),y()},children:[n.jsx(hn,{className:"h-4 w-4"}),v("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ie,e[44]=y,e[45]=v,e[46]=_e):_e=e[46];let Ae;e[47]!==i||e[48]!==r.isMultivariate||e[49]!==r.isSavedBlock||e[50]!==v?(Ae=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(ht,{onClick:k=>{k.stopPropagation(),i()},children:[n.jsx(hn,{className:"h-4 w-4"}),v("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=r.isMultivariate,e[49]=r.isSavedBlock,e[50]=v,e[51]=Ae):Ae=e[51];let je;e[52]!==h?(je=k=>{k.stopPropagation(),h()},e[52]=h,e[53]=je):je=e[53];let ue;e[54]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(vs,{className:"h-4 w-4"}),e[54]=ue):ue=e[54];let Z;e[55]!==v?(Z=v("sectionsEditor.sectionList.deleteMenuItem"),e[55]=v,e[56]=Z):Z=e[56];let se;e[57]!==je||e[58]!==Z?(se=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:je,children:[ue,Z]}),e[57]=je,e[58]=Z,e[59]=se):se=e[59];let be;e[60]!==$||e[61]!==ve||e[62]!==_e||e[63]!==Ae||e[64]!==se?(be=n.jsxs(xs,{align:"end",className:"w-44",children:[$,ve,_e,Ae,se]}),e[60]=$,e[61]=ve,e[62]=_e,e[63]=Ae,e[64]=se,e[65]=be):be=e[65];let de;e[66]!==Ke||e[67]!==oe||e[68]!==be?(de=n.jsxs(Ke,{children:[oe,be]}),e[66]=Ke,e[67]=oe,e[68]=be,e[69]=de):de=e[69];let Ce;return e[70]!==p||e[71]!==V||e[72]!==f||e[73]!==ae||e[74]!==te||e[75]!==B||e[76]!==Fe||e[77]!==Ge||e[78]!==tt||e[79]!==de||e[80]!==X?(Ce=n.jsxs("div",{ref:ae,style:te,...p,...V,role:q,tabIndex:ne,onClick:f,onKeyDown:X,className:B,children:[Fe,Ge,tt,de]}),e[70]=p,e[71]=V,e[72]=f,e[73]=ae,e[74]=te,e[75]=B,e[76]=Fe,e[77]=Ge,e[78]=tt,e[79]=de,e[80]=X,e[81]=Ce):Ce=e[81],Ce}function ir(g){return g.stopPropagation()}function lr(g){return g.stopPropagation()}function cr(g){return g.stopPropagation()}function ur(g){return g.stopPropagation()}function dr(){return!1}function mr(g){const e=Ue.c(104),{listKey:r,rawSections:d,sections:m,meta:S,selectedIndex:x,onSelect:f,onReorder:h,onDelete:u,onDuplicate:y,onMakeReusable:T,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:v,onAddSection:o,canAddSection:P}=g,l=P===void 0?!0:P,R=ct();let K;e[0]!==m.length?(K=()=>Hn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[I,p]=w.useState(K),[V,ae]=w.useState(null),[L,fe]=w.useState(r),[C,Se]=w.useState(m.length),O=w.useRef(!1);L!==r?(fe(r),Se(m.length),p(Hn(m.length))):C!==m.length&&(Se(m.length),p(Ce=>nr(Ce,m.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let re;e[3]===Symbol.for("react.memo_cache_sentinel")?(re={coordinateGetter:rs},e[3]=re):re=e[3];const ie=Xn(Jt(ns,te),Jt(ts,re));let q;e[4]!==I?(q=I.map(fr),e[4]=I,e[5]=q):q=e[5];const ne=q;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=Ce=>{ae(String(Ce.active.id))},e[6]=X):X=e[6];const le=X;let B;e[7]!==ne||e[8]!==h?(B=Ce=>{ae(null);const{active:k,over:F}=Ce;if(!F||k.id===F.id)return;const z=ne.indexOf(String(k.id)),nt=ne.indexOf(String(F.id));z===-1||nt===-1||(p(we=>ys(Ct([...we],z,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),h?.(z,nt))},e[7]=ne,e[8]=h,e[9]=B):B=e[9];const Fe=B;let Ge;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ge=()=>{ae(null)},e[10]=Ge):Ge=e[10];const tt=Ge;let Ke,Y,me,pe,Ve,ye,De,ce,ke,Be,Re,oe,ge,Pe,he;if(e[11]!==V||e[12]!==l||e[13]!==I||e[14]!==ne||e[15]!==Fe||e[16]!==S||e[17]!==o||e[18]!==i||e[19]!==u||e[20]!==v||e[21]!==y||e[22]!==T||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==x||e[29]!==ie||e[30]!==R){Pe=Symbol.for("react.early_return_sentinel");e:{const Ce=k=>{O.current||f(k)};if(e[46]!==V||e[47]!==l||e[48]!==I||e[49]!==o||e[50]!==d||e[51]!==m||e[52]!==R){const k=V?I.find(F=>F.id===V):null;if(pe=k!=null?m[k.index]:null,me=k!=null?d[k.index]:void 0,I.length===0){let F;e[56]!==R?(F=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=F):F=e[57];let z;e[58]!==F?(z=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F}),e[58]=F,e[59]=z):z=e[59];const nt=!l;let we;e[60]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx(vn,{size:14}),e[60]=we):we=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Me;e[63]!==o||e[64]!==nt||e[65]!==We?(Me=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:o,children:[we,We]}),e[63]=o,e[64]=nt,e[65]=We,e[66]=Me):Me=e[66];let vt;e[67]!==z||e[68]!==Me?(vt=n.jsxs("div",{className:"space-y-2",children:[z,Me]}),e[67]=z,e[68]=Me,e[69]=vt):vt=e[69],Pe=vt;break e}ge=Ie(k&&"cursor-grabbing"),e[46]=V,e[47]=l,e[48]=I,e[49]=o,e[50]=d,e[51]=m,e[52]=R,e[53]=me,e[54]=pe,e[55]=ge}else me=e[53],pe=e[54],ge=e[55];Y=is,ce=ie,ke=ls,Be=le,Re=Fe,oe=tt,Ke=cs,ye=ne,De=us,he="space-y-1",Ve=I.map(k=>{const F=m[k.index];return F?n.jsx(rr,{sortableId:k.id,section:F,raw:d[k.index],meta:S,selected:x===k.index,onSelect:()=>Ce(k.index),onDelete:()=>u(k.index),onDuplicate:()=>y(k.index),onMakeReusable:()=>T(k.index),onToggleHidden:()=>D(k.index),onToggleLazy:()=>E(k.index),onAddVariant:()=>i(k.index),onDetach:()=>v(k.index)},k.id):null})}e[11]=V,e[12]=l,e[13]=I,e[14]=ne,e[15]=Fe,e[16]=S,e[17]=o,e[18]=i,e[19]=u,e[20]=v,e[21]=y,e[22]=T,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=x,e[29]=ie,e[30]=R,e[31]=Ke,e[32]=Y,e[33]=me,e[34]=pe,e[35]=Ve,e[36]=ye,e[37]=De,e[38]=ce,e[39]=ke,e[40]=Be,e[41]=Re,e[42]=oe,e[43]=ge,e[44]=Pe,e[45]=he}else Ke=e[31],Y=e[32],me=e[33],pe=e[34],Ve=e[35],ye=e[36],De=e[37],ce=e[38],ke=e[39],Be=e[40],Re=e[41],oe=e[42],ge=e[43],Pe=e[44],he=e[45];if(Pe!==Symbol.for("react.early_return_sentinel"))return Pe;let $;e[70]!==Ve||e[71]!==he?($=n.jsx("div",{className:he,children:Ve}),e[70]=Ve,e[71]=he,e[72]=$):$=e[72];let ve;e[73]!==Ke||e[74]!==ye||e[75]!==De||e[76]!==$?(ve=n.jsx(Ke,{items:ye,strategy:De,children:$}),e[73]=Ke,e[74]=ye,e[75]=De,e[76]=$,e[77]=ve):ve=e[77];let _e;e[78]!==me||e[79]!==pe||e[80]!==S?(_e=pe?n.jsx("div",{className:Ie("cursor-grabbing shadow-lg ring-1 ring-border/60",js(pe,!1)),children:n.jsx(_s,{section:pe,raw:me,meta:S})}):null,e[78]=me,e[79]=pe,e[80]=S,e[81]=_e):_e=e[81];let Ae;e[82]!==_e?(Ae=Jn.createPortal(n.jsx(Zn,{dropAnimation:es,children:_e}),document.body),e[82]=_e,e[83]=Ae):Ae=e[83];let je;e[84]!==Y||e[85]!==ce||e[86]!==ke||e[87]!==Be||e[88]!==Re||e[89]!==oe||e[90]!==ve||e[91]!==Ae?(je=n.jsxs(Y,{sensors:ce,collisionDetection:ke,onDragStart:Be,onDragEnd:Re,onDragCancel:oe,children:[ve,Ae]}),e[84]=Y,e[85]=ce,e[86]=ke,e[87]=Be,e[88]=Re,e[89]=oe,e[90]=ve,e[91]=Ae,e[92]=je):je=e[92];const ue=!l;let Z;e[93]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(vn,{size:14}),e[93]=Z):Z=e[93];let se;e[94]!==R?(se=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=se):se=e[95];let be;e[96]!==o||e[97]!==ue||e[98]!==se?(be=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ue,onClick:o,children:[Z,se]}),e[96]=o,e[97]=ue,e[98]=se,e[99]=be):be=e[99];let de;return e[100]!==ge||e[101]!==je||e[102]!==be?(de=n.jsxs("div",{className:ge,children:[je,be]}),e[100]=ge,e[101]=je,e[102]=be,e[103]=de):de=e[103],de}function fr(g){return g.id}function Gn(g){const e=Ue.c(57),{open:r,initialName:d,autoLabel:m,isPending:S,onSubmit:x,onOpenChange:f}=g,h=S===void 0?!1:S,u=ct(),[y,T]=w.useState(d),[D,E]=w.useState(r);r!==D&&(E(r),r&&T(d));let i;e[0]!==h||e[1]!==f?(i=le=>{!le&&!h&&f(!1)},e[0]=h,e[1]=f,e[2]=i):i=e[2];const v=i;let o;e[3]!==h||e[4]!==y||e[5]!==x?(o=async le=>{le.preventDefault(),!h&&await x(y.trim())},e[3]=h,e[4]=y,e[5]=x,e[6]=o):o=e[6];const P=o;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(Vo,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let I;e[14]!==K?(I=n.jsx(Do,{children:K}),e[14]=K,e[15]=I):I=e[15];let p;e[16]!==R||e[17]!==I?(p=n.jsxs(Po,{children:[R,I]}),e[16]=R,e[17]=I,e[18]=p):p=e[18];let V;e[19]!==u?(V=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=V):V=e[20];let ae;e[21]!==V?(ae=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:V}),e[21]=V,e[22]=ae):ae=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=le=>T(le.target.value),e[23]=L):L=e[23];let fe;e[24]!==m||e[25]!==h||e[26]!==y?(fe=n.jsx(Ko,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:h}),e[24]=m,e[25]=h,e[26]=y,e[27]=fe):fe=e[27];let C;e[28]!==ae||e[29]!==fe?(C=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ae,fe]}),e[28]=ae,e[29]=fe,e[30]=C):C=e[30];let Se;e[31]!==f?(Se=()=>f(!1),e[31]=f,e[32]=Se):Se=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let te;e[35]!==h||e[36]!==Se||e[37]!==O?(te=n.jsx(Qe,{type:"button",variant:"outline",onClick:Se,disabled:h,children:O}),e[35]=h,e[36]=Se,e[37]=O,e[38]=te):te=e[38];let re;e[39]!==h||e[40]!==u?(re=h?n.jsxs(n.Fragment,{children:[n.jsx(Qn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=h,e[40]=u,e[41]=re):re=e[41];let ie;e[42]!==h||e[43]!==re?(ie=n.jsx(Qe,{type:"submit",disabled:h,children:re}),e[42]=h,e[43]=re,e[44]=ie):ie=e[44];let q;e[45]!==te||e[46]!==ie?(q=n.jsxs(Ao,{children:[te,ie]}),e[45]=te,e[46]=ie,e[47]=q):q=e[47];let ne;e[48]!==P||e[49]!==C||e[50]!==q||e[51]!==p?(ne=n.jsx(Co,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:P,children:[p,C,q]})}),e[48]=P,e[49]=C,e[50]=q,e[51]=p,e[52]=ne):ne=e[52];let X;return e[53]!==v||e[54]!==r||e[55]!==ne?(X=n.jsx(Mo,{open:r,onOpenChange:v,children:ne}),e[53]=v,e[54]=r,e[55]=ne,e[56]=X):X=e[56],X}const pr="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)]",Es="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function ks(g){const e=Ue.c(5),{rule:r,matchers:d}=g,m=r?.__resolveType??"";let S;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Fa(m);S=ko(u),e[0]=d,e[1]=m,e[2]=S}else S=e[2];const x=S;if(!x)return null;let f;return e[3]!==x?(f=n.jsx(x,{size:14,className:"shrink-0"}),e[3]=x,e[4]=f):f=e[4],f}function Un(g){return g.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function gn(g){return g.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function gr(g){return g.map((e,r)=>({...e,index:r}))}function Rs(g){const e=Ue.c(17),{label:r,effectiveRule:d,matchers:m,canDelete:S,dragging:x,onRename:f,onDuplicate:h,onDelete:u}=g,y=ct();let T;e[0]!==d||e[1]!==m?(T=n.jsx(ks,{rule:d,matchers:m}),e[0]=d,e[1]=m,e[2]=T):T=e[2];let D;e[3]!==r?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=D):D=e[4];let E;e[5]!==S||e[6]!==x||e[7]!==r||e[8]!==u||e[9]!==h||e[10]!==f||e[11]!==y?(E=!x&&n.jsxs(Ss,{children:[n.jsx(bs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:r}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:vr,onPointerDown:hr,children:n.jsx(ms,{size:14})})}),n.jsxs(xs,{align:"end",className:"w-36",children:[n.jsxs(ht,{onClick:v=>{v.stopPropagation(),f?.()},children:[n.jsx(Yo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(ht,{onClick:v=>{v.stopPropagation(),h?.()},children:[n.jsx(gs,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Oo,{}),n.jsxs(ht,{variant:"destructive",disabled:!S,onClick:v=>{v.stopPropagation(),u?.()},children:[n.jsx(vs,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=S,e[6]=x,e[7]=r,e[8]=u,e[9]=h,e[10]=f,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==T||e[14]!==D||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[T,D,E]}),e[13]=T,e[14]=D,e[15]=E,e[16]=i):i=e[16],i}function hr(g){return g.stopPropagation()}function vr(g){return g.stopPropagation()}function br(g){const e=Ue.c(33),{entry:r,sortableId:d,isActive:m,canDelete:S,decofile:x,meta:f,matchers:h,onSelect:u,onRename:y,onDuplicate:T,onDelete:D}=g;let E;e[0]!==d?(E={id:d,animateLayoutChanges:Sr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:v,setNodeRef:o,transform:P,isDragging:l}=as(E);let R;e[2]!==P?(R=os.Transform.toString(P?{...P,x:0}:null),e[2]=P,e[3]=R):R=e[3];const K=l?0:void 0;let I;e[4]!==R||e[5]!==K?(I={transform:R,opacity:K},e[4]=R,e[5]=K,e[6]=I):I=e[6];const p=I,V=f??void 0;let ae;e[7]!==x||e[8]!==r.variant.rule||e[9]!==V?(ae=Mt(r.variant.rule,x,V),e[7]=x,e[8]=r.variant.rule,e[9]=V,e[10]=ae):ae=e[10];const L=ae;let fe;e[11]!==u?(fe=ie=>{ie.target===ie.currentTarget&&(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),u())},e[11]=u,e[12]=fe):fe=e[12];const C=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",Se=m?Es:pr;let O;e[13]!==C||e[14]!==Se?(O=Ie("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",C,Se),e[13]=C,e[14]=Se,e[15]=O):O=e[15];let te;e[16]!==S||e[17]!==L||e[18]!==r.variant.label||e[19]!==h||e[20]!==D||e[21]!==T||e[22]!==y?(te=n.jsx(Rs,{label:r.variant.label,effectiveRule:L,matchers:h,canDelete:S,onRename:y,onDuplicate:T,onDelete:D}),e[16]=S,e[17]=L,e[18]=r.variant.label,e[19]=h,e[20]=D,e[21]=T,e[22]=y,e[23]=te):te=e[23];let re;return e[24]!==i||e[25]!==v||e[26]!==u||e[27]!==o||e[28]!==p||e[29]!==O||e[30]!==te||e[31]!==fe?(re=n.jsx("div",{ref:o,style:p,...i,...v,onClick:u,onKeyDown:fe,className:O,children:te}),e[24]=i,e[25]=v,e[26]=u,e[27]=o,e[28]=p,e[29]=O,e[30]=te,e[31]=fe,e[32]=re):re=e[32],re}function Sr(){return!1}function xr(g){const e=Ue.c(9),{variant:r,decofile:d,meta:m,matchers:S}=g,x=m??void 0;let f;e[0]!==d||e[1]!==x||e[2]!==r.rule?(f=Mt(r.rule,d,x),e[0]=d,e[1]=x,e[2]=r.rule,e[3]=f):f=e[3];const h=f;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Ie("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",Es),e[4]=u):u=e[4];let y;return e[5]!==h||e[6]!==S||e[7]!==r.label?(y=n.jsx("div",{className:u,children:n.jsx(Rs,{label:r.label,effectiveRule:h,matchers:S,canDelete:!1,dragging:!0})}),e[5]=h,e[6]=S,e[7]=r.label,e[8]=y):y=e[8],y}function yr(g){const e=Ue.c(91),{listKey:r,variants:d,activeIndex:m,decofile:S,meta:x,matchers:f,onSelect:h,onReorder:u,onRename:y,onDuplicate:T,onDelete:D,onAdd:E}=g,i=ct();let v;e[0]!==d?(v=()=>gn(d),e[0]=d,e[1]=v):v=e[1];const[o,P]=w.useState(v),[l,R]=w.useState(null),[K,I]=w.useState(r),[p,V]=w.useState(d.length);let ae;e[2]!==d?(ae=()=>Un(d),e[2]=d,e[3]=ae):ae=e[3];const[L,fe]=w.useState(ae),C=w.useRef(!1),Se=Un(d);K!==r?(I(r),V(d.length),fe(Se),P(gn(d))):p!==d.length?(V(d.length),fe(Se),P(gn(d))):L!==Se&&(fe(Se),P(je=>d.map((ue,Z)=>({id:je[Z]?.id??crypto.randomUUID(),index:Z,variant:ue}))));let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[4]=O):O=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:rs},e[5]=te):te=e[5];const re=Xn(Jt(ns,O),Jt(ts,te));let ie;e[6]!==o?(ie=o.map(_r),e[6]=o,e[7]=ie):ie=e[7];const q=ie,ne=d.length>1;let X;e[8]!==o?(X=je=>{const ue=String(je.active.id);R(o.find(Z=>Z.id===ue)??null)},e[8]=o,e[9]=X):X=e[9];const le=X;let B;e[10]!==q||e[11]!==u?(B=je=>{R(null);const{active:ue,over:Z}=je;if(!Z||ue.id===Z.id)return;const se=q.indexOf(String(ue.id)),be=q.indexOf(String(Z.id));se===-1||be===-1||(P(de=>gr(Ct([...de],se,be))),C.current=!0,requestAnimationFrame(()=>{C.current=!1}),u(se,be))},e[10]=q,e[11]=u,e[12]=B):B=e[12];const Fe=B;let Ge;e[13]===Symbol.for("react.memo_cache_sentinel")?(Ge=()=>{R(null)},e[13]=Ge):Ge=e[13];const tt=Ge;let Ke,Y,me,pe,Ve,ye,De,ce,ke,Be,Re,oe,ge;if(e[14]!==m||e[15]!==ne||e[16]!==S||e[17]!==o||e[18]!==q||e[19]!==Fe||e[20]!==le||e[21]!==f||e[22]!==x||e[23]!==E||e[24]!==D||e[25]!==T||e[26]!==y||e[27]!==h||e[28]!==re||e[29]!==i){const je=z=>{C.current||h(z)};Re="space-y-1 border-b p-2";let ue;e[43]!==i?(ue=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=ue):ue=e[44];let Z;e[45]!==ue?(Z=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ue}),e[45]=ue,e[46]=Z):Z=e[46];let se;e[47]!==i?(se=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=se):se=e[48];let be;e[49]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx(vn,{size:14}),e[49]=be):be=e[49];let de;e[50]!==E||e[51]!==se?(de=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":se,className:"size-6",onClick:E,children:be})}),e[50]=E,e[51]=se,e[52]=de):de=e[52];let Ce;e[53]!==i?(Ce=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=Ce):Ce=e[54];let k;e[55]!==Ce?(k=n.jsx(jt,{children:Ce}),e[55]=Ce,e[56]=k):k=e[56];let F;e[57]!==de||e[58]!==k?(F=n.jsxs(yt,{children:[de,k]}),e[57]=de,e[58]=k,e[59]=F):F=e[59],e[60]!==Z||e[61]!==F?(oe=n.jsxs("div",{className:"flex items-center justify-between",children:[Z,F]}),e[60]=Z,e[61]=F,e[62]=oe):oe=e[62],Y=is,ye=re,De=ls,ce=le,ke=Fe,Be=tt,Ke=cs,pe=q,Ve=us,ge="space-y-0.5",me=o.map(z=>n.jsx(br,{sortableId:z.id,entry:z,isActive:z.index===m,canDelete:ne,decofile:S,meta:x,matchers:f,onSelect:()=>je(z.index),onRename:()=>y(z.index),onDuplicate:()=>T(z.index),onDelete:()=>D(z.index)},z.id)),e[14]=m,e[15]=ne,e[16]=S,e[17]=o,e[18]=q,e[19]=Fe,e[20]=le,e[21]=f,e[22]=x,e[23]=E,e[24]=D,e[25]=T,e[26]=y,e[27]=h,e[28]=re,e[29]=i,e[30]=Ke,e[31]=Y,e[32]=me,e[33]=pe,e[34]=Ve,e[35]=ye,e[36]=De,e[37]=ce,e[38]=ke,e[39]=Be,e[40]=Re,e[41]=oe,e[42]=ge}else Ke=e[30],Y=e[31],me=e[32],pe=e[33],Ve=e[34],ye=e[35],De=e[36],ce=e[37],ke=e[38],Be=e[39],Re=e[40],oe=e[41],ge=e[42];let Pe;e[63]!==me||e[64]!==ge?(Pe=n.jsx("div",{className:ge,children:me}),e[63]=me,e[64]=ge,e[65]=Pe):Pe=e[65];let he;e[66]!==Ke||e[67]!==pe||e[68]!==Ve||e[69]!==Pe?(he=n.jsx(Ke,{items:pe,strategy:Ve,children:Pe}),e[66]=Ke,e[67]=pe,e[68]=Ve,e[69]=Pe,e[70]=he):he=e[70];let $;e[71]!==l||e[72]!==S||e[73]!==f||e[74]!==x?($=l?n.jsx(xr,{variant:l.variant,decofile:S,meta:x,matchers:f}):null,e[71]=l,e[72]=S,e[73]=f,e[74]=x,e[75]=$):$=e[75];let ve;e[76]!==$?(ve=Jn.createPortal(n.jsx(Zn,{dropAnimation:es,children:$}),document.body),e[76]=$,e[77]=ve):ve=e[77];let _e;e[78]!==Y||e[79]!==ye||e[80]!==De||e[81]!==ce||e[82]!==ke||e[83]!==Be||e[84]!==he||e[85]!==ve?(_e=n.jsxs(Y,{sensors:ye,collisionDetection:De,onDragStart:ce,onDragEnd:ke,onDragCancel:Be,children:[he,ve]}),e[78]=Y,e[79]=ye,e[80]=De,e[81]=ce,e[82]=ke,e[83]=Be,e[84]=he,e[85]=ve,e[86]=_e):_e=e[86];let Ae;return e[87]!==Re||e[88]!==oe||e[89]!==_e?(Ae=n.jsxs("div",{className:Re,children:[oe,_e]}),e[87]=Re,e[88]=oe,e[89]=_e,e[90]=Ae):Ae=e[90],Ae}function _r(g){return g.id}function jr(g){const e=Ue.c(16),{schema:r,value:d,onChange:m,meta:S,decofile:x,onSaveReferencedBlock:f,sandbox:h}=g,u=ct();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[T,D]=w.useState(y);let E;e[1]!==T||e[2]!==u?(E=T.length>0&&n.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(fs,{className:"size-3.5"})}),T.map((o,P)=>{const l=P===T.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[P>0&&n.jsx(ps,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(T.slice(0,P+1)),title:o,className:Ie("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${P}`)})]}),e[1]=T,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==T||e[5]!==x||e[6]!==S||e[7]!==m||e[8]!==f||e[9]!==h||e[10]!==r||e[11]!==d?(i=n.jsx(ds,{schema:r,value:d,onChange:m,basePath:"",breadcrumbPath:T,onBreadcrumbChange:D,meta:S,decofile:x,onSaveReferencedBlock:f,sandbox:h}),e[4]=T,e[5]=x,e[6]=S,e[7]=m,e[8]=f,e[9]=h,e[10]=r,e[11]=d,e[12]=i):i=e[12];let v;return e[13]!==E||e[14]!==i?(v=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=v):v=e[15],v}function Wn(g){const e=Ue.c(23),{activeSchema:r,formValue:d,formResetKey:m,onFormChange:S,onBreadcrumbChange:x,breadcrumbPath:f,emptyMessage:h,beforeForm:u,seoResolveType:y,siteDefaultSeo:T,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:v,previewBaseUrl:o,onRequestAddSection:P}=g;let l;e[0]!==f?(l=f===void 0?[]:f,e[0]=f,e[1]=l):l=e[1];const R=l;let K;e[2]!==r||e[3]!==R||e[4]!==E||e[5]!==m||e[6]!==d||e[7]!==D||e[8]!==x||e[9]!==S||e[10]!==P||e[11]!==i||e[12]!==o||e[13]!==v||e[14]!==y||e[15]!==T?(K=r&&d?y?n.jsx(Io,{schema:r,resolveType:y,value:d,formResetKey:m,onChange:S,onBreadcrumbChange:x,siteDefaultSeo:T}):n.jsx(ds,{schema:r,value:d,onChange:S,basePath:"",breadcrumbPath:R,onBreadcrumbChange:x,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:v,previewBaseUrl:o,onRequestAddSection:P},m):null,e[2]=r,e[3]=R,e[4]=E,e[5]=m,e[6]=d,e[7]=D,e[8]=x,e[9]=S,e[10]=P,e[11]=i,e[12]=o,e[13]=v,e[14]=y,e[15]=T,e[16]=K):K=e[16];const I=K;let p;e[17]!==h||e[18]!==I?(p=I??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:h}),e[17]=h,e[18]=I,e[19]=p):p=e[19];let V;return e[20]!==u||e[21]!==p?(V=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[u,p]})}),e[20]=u,e[21]=p,e[22]=V):V=e[22],V}const Er="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function kr(g,e){return Oa(g,e,lt)}function Rr(g){const e=Ue.c(19),{pageKey:r,initialName:d,initialPath:m,onFieldChange:S}=g,x=ct(),[f,h]=w.useState(d),[u,y]=w.useState(m),[T,D]=w.useState(r);T!==r&&(D(r),h(d),y(m));let E;e[0]!==S?(E=K=>{h(K.target.value),S("name",K.target.value)},e[0]=S,e[1]=E):E=e[1];let i;e[2]!==x?(i=x("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=x,e[3]=i):i=e[3];let v;e[4]!==f||e[5]!==E||e[6]!==i?(v=n.jsx("input",{type:"text",value:f,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:i}),e[4]=f,e[5]=E,e[6]=i,e[7]=v):v=e[7];let o;e[8]!==S?(o=K=>{y(K.target.value),S("path",K.target.value)},e[8]=S,e[9]=o):o=e[9];let P;e[10]!==x?(P=x("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=x,e[11]=P):P=e[11];let l;e[12]!==u||e[13]!==o||e[14]!==P?(l=n.jsx("input",{type:"text",value:u,onChange:o,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:P}),e[12]=u,e[13]=o,e[14]=P,e[15]=l):l=e[15];let R;return e[16]!==v||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[v,l]}),e[16]=v,e[17]=l,e[18]=R):R=e[18],R}function qn(g){const e=Ue.c(13),{onClick:r}=g,d=ct();let m;e[0]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=m):m=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(hs,{size:14}),e[2]=S):S=e[2];let x;e[3]!==r||e[4]!==m?(x=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":m,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:S})}),e[3]=r,e[4]=m,e[5]=x):x=e[5];let f;e[6]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=f):f=e[7];let h;e[8]!==f?(h=n.jsx(jt,{side:"bottom",children:f}),e[8]=f,e[9]=h):h=e[9];let u;return e[10]!==x||e[11]!==h?(u=n.jsxs(yt,{children:[x,h]}),e[10]=x,e[11]=h,e[12]=u):u=e[12],u}function Yn(g){const e=Ue.c(21),{currentRt:r,currentLabel:d,currentGlobalKey:m,matchers:S,globals:x,onSelect:f,onSelectGlobal:h,schema:u,formValue:y,onChange:T,formKey:D,formWrapperClassName:E,meta:i,decofile:v,onSaveReferencedBlock:o,sandbox:P}=g;let l;e[0]!==m||e[1]!==d||e[2]!==r||e[3]!==x||e[4]!==S||e[5]!==f||e[6]!==h?(l=n.jsx(Ia,{currentRt:r,currentLabel:d,currentGlobalKey:m,matchers:S,globals:x,onSelect:f,onSelectGlobal:h}),e[0]=m,e[1]=d,e[2]=r,e[3]=x,e[4]=S,e[5]=f,e[6]=h,e[7]=l):l=e[7];let R;e[8]!==v||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==T||e[14]!==o||e[15]!==P||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(jr,{schema:u,value:y,onChange:T,meta:i,decofile:v,onSaveReferencedBlock:o,sandbox:P},D)}),e[8]=v,e[9]=D,e[10]=y,e[11]=E,e[12]=i,e[13]=T,e[14]=o,e[15]=P,e[16]=u,e[17]=R):R=e[17];let K;return e[18]!==l||e[19]!==R?(K=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=K):K=e[20],K}function fc({orgSlug:g,virtualMcpId:e,branch:r,previewReady:d=!0,previewUrl:m,currentPath:S,activePageBlockKey:x=null,activeGlobalBlockKey:f=null,externalSelectedIndex:h,onSaved:u,initialEditSeo:y=!1,onExitSeo:T,onViewJsonFile:D,onVariantPreviewOverride:E}){const i=ct(),v=d?{orgSlug:g,virtualMcpId:e,branch:r,previewUrl:m}:null,{data:o,isLoading:P}=$a(v),{data:l,isLoading:R}=za(v),K=Ha(),I=K?.entity?.id===e?K.entity.metadata?.siteSlug??null:null,[p,V]=w.useState(null),[ae,L]=w.useState(null),[fe,C]=w.useState(null),[Se,O]=w.useState(0),[te,re]=w.useState(void 0),[ie,q]=w.useState(null),[ne,X]=w.useState(null),[le,B]=w.useState([]),Fe=w.useRef(null),[Ge,tt]=w.useState(le.length);Ge!==le.length&&(tt(le.length),requestAnimationFrame(()=>{Fe.current&&(Fe.current.scrollTop=0)}));const[Ke,Y]=w.useState(0),[me,pe]=w.useState(null),[Ve,ye]=w.useState(null),[De,ce]=w.useState(null),[ke,Be]=w.useState(!0),[Re,oe]=w.useState(!1),[ge,Pe]=w.useState(!1),he=w.useRef(null),[$,ve]=w.useState(y),[_e,Ae]=w.useState(y);y&&!_e&&(Ae(!0),ve(!0),V(null),L(null),C(null),B([])),!y&&_e&&Ae(!1);const[je,ue]=w.useState(null),[Z,se]=w.useState(void 0),[be,de]=w.useState([]),[Ce,k]=w.useState(0),[F,z]=w.useState(0),[nt,we]=w.useState(null),[We,Me]=w.useState(null),[vt,bn]=w.useState(null),ws=Va(),Ns=`${g}/${e}/${r}`,Qt=Ga({orgSlug:g,virtualMcpId:e,branch:r}),[Ts,Vs]=w.useState(S),[Ds,Ps]=w.useState(x),[As,Cs]=w.useState(f);(Ts!==S||Ds!==x||As!==f)&&(queueMicrotask(()=>Qt.flush()),Vs(S),Ps(x),Cs(f),V(null),L(null),C(null),O(0),q(null),X(null),z(0),we(null),Me(null),B([]),Y(t=>t+1),ve(!1),ue(null),se(void 0),de([]),k(t=>t+1));const Ne=Ua({orgSlug:g,virtualMcpId:e,branch:r}),Kt=mo((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=Wa({orgSlug:g,virtualMcpId:e,branch:r}),[Tt,Bt]=w.useState(!1),$e=w.useRef(null),st=w.useRef(null),at=w.useRef(null),Zt=w.useRef({}),Xe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||P||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Qn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ms=qa(o),Te=!!f,qe=Te?null:Ya(Ms,S,x),N=Te?f:qe?.key??null,en=Te&&f?o[f]:void 0,Sn=Te&&f&&en?Ja(f,en):Te&&f?f:"",Lt=!Te&&N&&o[N]?o[N]:null,tn=$&&o&&l&&N&&qe?zn(o,{kind:"page",pageKey:N,pageName:String(qe.name??""),path:String(qe.path??"")},l):null,Ks=$?Lt?.seo:void 0,nn=Z!==void 0?Z:Ks,Bs=$?$o(nn):void 0,Ls=tn?.seoTypeOptions??[],Fs=$&&l?zo(l):"",xn=je??Bs??{},sn=$&&tn?Ho(xn,tn):null,Os=$&&sn&&Go(nn)?Gt(sn,l):null,Is=$?Uo(o,l)?.seoData:void 0,He=Te?[{label:"Default",sections:[{__resolveType:f}]}]:kr(Lt?.sections,o??{}),Ft=He.length>1,Oe=Math.min(Se,He.length-1),ut=He[Oe],U=ut?.sections??[],ze=Ut(U,o),yn=!Te&&Qa(Lt?.sections);if(Te&&f&&vt!==f){bn(f);const t=U[0],s=ze[0];if(t&&s){V(0),z(0),B([]);const a=St(t,s,o);a&&(L(a.data),C(a.resolveType),Me(null),we(null))}}!Te&&vt!==null&&bn(null),Xe.current={rawSections:U,parsedSections:ze,decofile:o??{},activePageKey:N,pageVariants:He,variantIndex:Oe,sectionVariantIndex:F,selectedSectionIndex:p};const $s=()=>({multivariate:yn,index:Oe,variants:He.map(t=>({rule:t.rule}))}),_n=(t,s)=>{if(!E)return;if(!N||!yn||t.length<=1){E(null);return}const a=$n(N,{multivariate:!0,index:s,variants:t},o,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!N){E(null);return}const c=$s(),b=$n(N,c,o,l);if(!t||s<0){E(b.length>0?b:null);return}const j=vo({pageKey:N,page:c,sectionIndex:s,sectionLazy:ze[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:o,meta:l}),_=[...b,...j];E(_.length>0?_:null)},dt=(t,s,a,c=p??-1,b=!1)=>{const j=et(t,s);if(!j){L(null),C(null),Me(null),we(null),b&&Et(null,c,a);return}const A=Kn(j,lt)[a];if(!A){L(null),C(null),Me(null),we(null),b&&Et(null,c,a);return}const ee=so(A.value,o);L(ee?.data??null),C(ee?.resolveType??null);const{resolveType:M,formValue:H}=Dt(A.rule,o,l??void 0);Me(M),we(H),b&&Et(j,c,a)};if(h!==void 0&&h!==te&&(re(h??null),typeof h=="number")){const t=U[h],s=ze[h];if(t&&s)if(V(h),z(0),B([]),Y(a=>a+1),s.isMultivariate)dt(t,s,0,h);else{const a=St(t,s,o);a?(L(a.data),C(a.resolveType)):(L(null),C(null)),Me(null),we(null)}}const Ot={orgSlug:g,virtualMcpId:e,branch:r,previewUrl:m??void 0,siteSlug:I},an=fe&&l?Gt(fe,l):null,Ye=(t,s)=>{if(!N)return;$e.current&&(clearTimeout($e.current),$e.current=null),at.current&&(clearTimeout(at.current),at.current=null),st.current&&(clearTimeout(st.current),st.current=null);const a=At(o,N,t,Oe,He);Ne.mutate({blockKey:N,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{V(null),L(null),C(null),z(0),we(null),Me(null),B([]),Y(t=>t+1)},zs=(t,s)=>{$e.current&&clearTimeout($e.current);const a=Xe.current.sectionVariantIndex;$e.current=setTimeout(()=>{const{rawSections:c,parsedSections:b,decofile:j,activePageKey:_,pageVariants:A,variantIndex:ee}=Xe.current,M=c[s];if(!M)return;const H=b[s];if(!H)return;if(H.isSavedBlock){const W=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Ne.mutate({blockKey:W,data:t},{onSuccess:()=>u?.(),onError:J=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}if(!_)return;const G={...j[_]},Ee=[...c];if(H.isMultivariate){const W=et(M,H);if(!W||!_)return;const J=So(W,a,t);Ee[s]=xt(M,H,J)}else if(H.isHidden){const W=ss(M.__resolveType),J=W?{...M.section}:{...M},Le=Array.isArray(J.variants)?[...J.variants]:[];Le[0]&&(Le[0]={...Le[0],value:t}),J.variants=Le,W?Ee[s]={...M,section:J}:Ee[s]=J}else H.isLazy?Ee[s]={...M,section:t}:Ee[s]=t;if(A.length>1){const W=G.sections,J=[...W?.variants??[]];J[ee]&&(J[ee]={...J[ee],value:Ee}),G.sections={...W,variants:J}}else G.sections=Ee;Ne.mutate({blockKey:_,data:G},{onSuccess:()=>u?.(),onError:W=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:W.message}))})},fn)},Hs=t=>{V(t),z(0),B([]),Y(b=>b+1);const s=U[t],a=ze[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const c=St(s,a,o);if(!c){L(null),C(null),Me(null),we(null),Et(null,t,0);return}L(c.data),C(c.resolveType),Me(null),we(null),Et(null,t,0)},jn=t=>{const s=t;L(s),p!==null&&zs(s,p)},on=t=>{if(!N||!o||!l||!qe)return;const s={kind:"page",pageKey:N,pageName:String(qe.name??""),path:String(qe.path??"")},a=zn(o,s,l);a&&Qt.save(N,()=>{const c=ws.getQueryData(Da.decofile(Ns))?.[N];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const b={...c,...Zt.current};return Zt.current={},t?.raw!==void 0?{...b,seo:t.raw}:t?.inner!==void 0?qo(s,a,b,t.inner):b})},Gs=(t,s)=>{N&&(Zt.current[t]=s,on())},Us=(t,s)=>{if(!N)return;const a=Ct([...U],t,s);p!==null&&(p===t?V(s):t<p&&s>=p?V(p-1):t>p&&s<=p&&V(p+1)),Ye(a)},Ws=t=>{if(!N)return;const s=U.filter((a,c)=>c!==t);p===t?kt():p!==null&&p>t&&V(p-1),Ye(s)},qs=t=>{if(!N)return;const s=U[t];if(!s)return;const a=[...U];a.splice(t+1,0,ho(s)),p!==null&&p>t&&V(p+1),Ye(a)},Ys=t=>{if(!N)return;const s=U[t],a=ze[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?po(s):go(s);if(!c)return;const b=[...U];b[t]=c,p===t&&kt(),Ye(b)},Js=t=>{if(!N)return;const s=U[t],a=ze[t];if(!s||!a||a.isMultivariate)return;const c=fo(s);if(!c)return;const b=[...U];b[t]=c,p===t&&kt(),Ye(b)},Qs=t=>{if(!N)return;const s=U[t],a=ze[t];if(!s||!a?.isSavedBlock)return;const c=St(s,a,o);if(!c?.data)return;const{name:b,...j}=c.data,_=[...U];a.isLazy?_[t]={...s,section:j}:_[t]=j,p===t&&kt(),Ye(_)},Xs=t=>{if(!N)return;const s=[...U,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{oe(!1),V(a),z(0),B([]),Y(_=>_+1);const c=s[a],b=Ut(s,o)[a];if(!c||!b)return;if(b.isMultivariate){dt(c,b,0);return}const j=St(c,b,o);if(!j){L(null),C(null),Me(null),we(null);return}L(j.data),C(j.resolveType),Me(null),we(null)}})},En=t=>{he.current=t.append,oe(!0)},Zs=t=>{const s=he.current;if(!s){Xs(t);return}s({__resolveType:t.resolveType}),oe(!1),he.current=null},ea=t=>{if(p===null)return;const s=U[p],a=ze[p];!s||!a?.isMultivariate||(z(t),B([]),Y(c=>c+1),dt(s,a,t,p,!0))},ta=t=>{if(p===null||!N)return;const s=U[p],a=ze[p];if(!s||!a?.isMultivariate)return;const c=et(s,a);if(!c)return;const b=co(c,t);if(!b){Q.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...U];j[p]=xt(s,a,b);const _=b.variants;let A=F;t===F?A=Math.min(t,_.length-1):t<F&&(A=F-1),z(A),B([]),Y(ee=>ee+1),dt(j[p],a,A),Ye(j)},na=t=>{if(p===null||!N)return;const s=U[p],a=ze[p];if(!s||!a?.isMultivariate)return;const c=et(s,a);if(!c)return;const b=uo(c,t),j=[...U];j[p]=xt(s,a,b);const _=t+1;z(_),B([]),Y(A=>A+1),dt(j[p],a,_),Ye(j)},sa=(t,s)=>{if(p===null||!N||t===s)return;const a=U[p],c=ze[p];if(!a||!c?.isMultivariate)return;const b=et(a,c);if(!b)return;const j=io(b,t,s),_=[...U];_[p]=xt(a,c,j);let A=F;F===t?A=s:t<F&&s>=F?A=F-1:t>F&&s<=F&&(A=F+1),z(A),dt(_[p],c,A),Ye(_)},rn=t=>{const s=t??p;if(s===null||!N)return;const a=U[s],c=ze[s];if(!a||!c)return;const b=ao(a,c);if(!b){Q.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...U];j[s]=b.section;const _=Ut(j,o)[s];if(!_?.isMultivariate){Q.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}V(s),z(b.newVariantIndex),B([]),Y(A=>A+1),dt(b.section,_,b.newVariantIndex,s),Ye(j)},aa=()=>{if(p===null||!N)return;const t=U[p],s=ze[p];if(!t||!s?.isMultivariate)return;const a=et(t,s);if(!a)return;const c=lo(t,s,a);if(!c){Q.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const b=[...U];b[p]=c;const j=Ut(b,o)[p];if(!j)return;z(0),Me(null),we(null),B([]),Y(A=>A+1);const _=St(c,j,o);_?(L(_.data),C(_.resolveType)):(L(null),C(null)),Et(null,p,0),Ye(b)},oa=async t=>{if(me===null||!N)return;const s=mn(t,o);if(s){Q.error(s);return}const a=U[me],c=ze[me];if(!a||!c)return;const b=St(a,c,o);if(!b){Q.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...b.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:j});const _=[...U];_[me]={__resolveType:t},await Ne.mutateAsync({blockKey:N,data:At(o,N,_,Oe,He)}),p===me&&kt(),pe(null),Q.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){Q.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=ut?.rule;if(Ft&&p===null&&ne===null&&kn){const{resolveType:t,formValue:s}=Dt(kn,o??{},l??void 0);X(t),q(s)}const It=l?Xa(l):[],Rn=l&&o?Za(l,o):[],ra=!Te&&!!(m&&l&&o),ia=ne&&l?Gt(ne,l):null,Rt=()=>{st.current&&(clearTimeout(st.current),st.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Vt=async(t,s)=>{if(!(bo(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},wn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const b={...a[s]},j={...b.sections},_=[...j.variants??[]],A=_[c],ee=A?.rule;if(wt(ee,a,l)){const M=ee?.__resolveType??"",H=a[M],G=typeof H?.name=="string"?H.name:M,{__resolveType:Ee,...W}=t;Ne.mutate({blockKey:M,data:Nt(Ee??"",W,G)},{onSuccess:()=>u?.(),onError:J=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}A&&(_[c]={...A,rule:t}),b.sections={...j,variants:_},Ne.mutate({blockKey:s,data:b},{onSuccess:()=>u?.(),onError:M=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},fn)},la=t=>{X(t);const s=t?Ln(t,l):{__resolveType:Fn};q(t?s:{}),wn(s)},ca=t=>{const s=t;q(s);const a=ne?{__resolveType:ne,...s}:{...s};wn(a)},ua=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const b=a[s],j=b?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const A=[..._.variants],ee=A[c];if(!ee)return;const M=Pt(ee.rule,a,l),H=qt(t);A[c]={...ee,rule:H};const G={...a,[s]:{...b,sections:{..._,variants:A}}},{resolveType:Ee,formValue:W}=Dt(H,G,l??void 0);X(Ee),q(W);try{await Ne.mutateAsync({blockKey:s,data:G[s]}),M&&M!==t&&await Vt(M,G),u?.()}catch(J){Q.error(J instanceof Error?J.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:c,parsedSections:b,decofile:j,activePageKey:_,pageVariants:A,variantIndex:ee}=Xe.current;if(!_)return;const M=c[s],H=b[s];if(!M||!H?.isMultivariate)return;const G=et(M,H);if(!G)return;const W=(G.variants??[])[a]?.rule;if(wt(W,j,l)){const xe=W?.__resolveType??"",Je=j[xe],rt=typeof Je?.name=="string"?Je.name:xe,{__resolveType:pt,...it}=t;Ne.mutate({blockKey:xe,data:Nt(pt??"",it,rt)},{onSuccess:()=>u?.(),onError:gt=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const J=Bn(G,a,t),Le=[...c];Le[s]=xt(M,H,J);const Ze=At(j,_,Le,ee,A);Ne.mutate({blockKey:_,data:Ze},{onSuccess:()=>u?.(),onError:xe=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:xe.message}))})},fn))},da=t=>{Me(t);const s=t?Ln(t,l):{__resolveType:Fn};we(t?s:{}),Nn(s)},ma=t=>{const s=t;we(s);const a=We?{__resolveType:We,...s}:{...s};Nn(a)},fa=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:b,decofile:j,activePageKey:_,pageVariants:A,variantIndex:ee}=Xe.current;if(s===null||!_)return;const M=c[s],H=b[s];if(!M||!H?.isMultivariate)return;const G=et(M,H);if(!G)return;const Ee=G.variants??[],W=Pt(Ee[a]?.rule,j,l),J=qt(t),Le=Bn(G,a,J),Ze=[...c];Ze[s]=xt(M,H,Le);const xe=At(j,_,Ze,ee,A),Je={...j,[_]:xe},{resolveType:rt,formValue:pt}=Dt(J,Je,l??void 0);Me(rt),we(pt);try{await Ne.mutateAsync({blockKey:_,data:xe}),W&&W!==t&&await Vt(W,Je),u?.()}catch(it){Q.error(it instanceof Error?it.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Te&&!qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:S})});if(Te&&!en)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=p!==null?ze[p]??null:null,Tn=p!==null?U[p]:null,Vn=Tn&&mt?.isMultivariate?et(Tn,mt):null,bt=Vn?Kn(Vn,lt):[],ln=Math.min(F,Math.max(bt.length-1,0)),$t=bt[ln]??null,ft=mt?.isMultivariate===!0,Dn=p!==null&&mt!==null,zt=Dn&&(ft||!!(an&&ae)),pa=zt&&!Te&&mt?.isSavedBlock===!0,ot=Te||pa,ga=Te?Sn:mt?.label??"",ha=We&&l?Gt(We,l):null,cn=zt&&(!Te||le.length>0)?Te?[Sn,...le]:[qe.name,mt.label,...ft&&$t?[$t.label]:[],...le]:[],va=$&&qe?[qe.name,"SEO",...be]:[],Ht=$?va:ot?cn.length>0?cn:[ga]:cn,ba=!$&&!Te&&ft&&le.length===0,Pn=()=>{if(!N)return;Rt(),$e.current&&(clearTimeout($e.current),$e.current=null);const t=o[N],s=oo(t.sections,U);if(!s)return;const a=ro(s);Ne.mutate({blockKey:N,data:{...t,sections:s}},{onSuccess:()=>{O(a),V(null),L(null),C(null),B([]),q(null),X(null)},onError:c=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},un=(t,s,a)=>{if(!N)return;Rt(),$e.current&&(clearTimeout($e.current),$e.current=null);const c=o[N],b=c.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const j=b;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const A=xo(j,_),ee={...o,[N]:{...c,sections:A}};Ne.mutate({blockKey:N,data:ee[N]},{onSuccess:()=>{s?.(),a&&Vt(a,ee)},onError:M=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},Sa=t=>{ye(null),O(t),V(null),L(null),C(null),B([]);const s=He[t]?.rule,{resolveType:a,formValue:c}=Dt(s,o??{},l??void 0);X(a),q(c),_n(He.map(b=>({rule:b.rule})),t)},xa=(t,s)=>{if(t===s)return;let a=Oe;Oe===t?a=s:t<Oe&&s>=Oe?a=Oe-1:t>Oe&&s<=Oe&&(a=Oe+1),O(a);const c=Ct(He.map(b=>({rule:b.rule})),t,s);_n(c,a),un(b=>Ct(b,t,s))},ya=t=>{const s=He[t]?.rule,a=Pt(s,o??{},l??void 0);un(c=>c.length<=1?null:(c.splice(t,1),c),()=>{He.length-1===1?O(0):t<Oe?O(Oe-1):t===Oe&&O(Math.max(0,t-1)),V(null),L(null),C(null),B([]),q(null),X(null)},a)},_a=t=>{un(s=>yo(s,t),()=>{O(t+1),V(null),L(null),C(null),B([]),q(null),X(null)})},ja=async(t,s)=>{Rt(),$e.current&&(clearTimeout($e.current),$e.current=null);const a=Xe.current.activePageKey,c=Xe.current.decofile;if(!a)return;const b=c[a],j=b.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const A=[..._.variants],ee=A[t];if(!ee?.rule||typeof ee.rule!="object"){Q.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=ee.rule,H=s.trim();Bt(!0);try{if(!H){if(!wt(M,c,l)){ye(null);return}const Ze=M.__resolveType??"";A[t]={...ee,rule:On(M,c,l)};const xe={...c,[a]:{...b,sections:{..._,variants:A}}};await Ne.mutateAsync({blockKey:a,data:xe[a]}),await Vt(Ze,xe),ye(null),u?.();return}const G=In(M,c,l);if(!G){Q.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(G.blockKey){await Ne.mutateAsync({blockKey:G.blockKey,data:Nt(G.resolveType,G.data,H)}),ye(null),u?.();return}const Ee=dn(H),W=mn(Ee,c);if(W){Q.error(W);return}const J=Nt(G.resolveType,G.data,H);let Le=null;try{await Ne.mutateAsync({blockKey:Ee,data:J}),Le=Ee,A[t]={...ee,rule:qt(Ee)},await Ne.mutateAsync({blockKey:a,data:{...b,sections:{..._,variants:A}}}),Le=null}catch(Ze){throw Le&&await Xt.mutateAsync({blockKey:Le}).catch(()=>{}),Ze}ye(null),Q.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),u?.()}catch(G){Q.error(G instanceof Error?G.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Bt(!1)}},Ea=async(t,s)=>{Rt(),$e.current&&(clearTimeout($e.current),$e.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:b,decofile:j,activePageKey:_,pageVariants:A,variantIndex:ee}=Xe.current;if(a===null||!_)return;const M=c[a],H=b[a];if(!M||!H?.isMultivariate)return;const G=et(M,H);if(!G)return;const Ee=G.variants??[],W=Ee[t];if(!W?.rule||typeof W.rule!="object"){Q.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const J=W.rule,Le=s.trim();Bt(!0);const Ze=async xe=>{const Je={...G,variants:xe},rt=[...c];rt[a]=xt(M,H,Je);const pt=At(j,_,rt,ee,A);return await Ne.mutateAsync({blockKey:_,data:pt}),{...j,[_]:pt}};try{if(!Le){if(!wt(J,j,l)){ce(null);return}const gt=J.__resolveType??"",Mn=[...Ee];Mn[t]={...W,rule:On(J,j,l)};const Ta=await Ze(Mn);await Vt(gt,Ta),ce(null),u?.();return}const xe=In(J,j,l);if(!xe){Q.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(xe.blockKey){await Ne.mutateAsync({blockKey:xe.blockKey,data:Nt(xe.resolveType,xe.data,Le)}),ce(null),u?.();return}const Je=dn(Le),rt=mn(Je,j);if(rt){Q.error(rt);return}const pt=Nt(xe.resolveType,xe.data,Le);let it=null;try{await Ne.mutateAsync({blockKey:Je,data:pt}),it=Je;const gt=[...Ee];gt[t]={...W,rule:qt(Je)},await Ze(gt),it=null}catch(gt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),gt}ce(null),Q.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Le})),u?.()}catch(xe){Q.error(xe instanceof Error?xe.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Bt(!1)}},An=()=>{kt()},ka=t=>{ue(t),on({inner:t})},Ra=t=>{se(t),on({raw:t})},wa=()=>{ue(null),de([])},Na=()=>k(t=>t+1),Cn=t=>{if($){if(t===0){Qt.flush(),ve(!1),ue(null),se(void 0),de([]),k(a=>a+1),T?.();return}if(t===1){de([]),k(a=>a+1);return}de(be.slice(0,t-1)),k(a=>a+1);return}if(Te){B(le.slice(0,t)),Y(a=>a+1);return}if(t===0){An();return}if(t===1){B([]),Y(a=>a+1);return}if(ft&&t===2){B([]),Y(a=>a+1);return}const s=ft?2:1;B(le.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:ot||zt||$?n.jsxs("div",{className:Ie("border-b px-3 py-2.5",ot&&"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:[Ht.length>1&&n.jsx("button",{type:"button",onClick:()=>Cn(_o(Ht.length,{isMultivariateSectionTop:ba})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:Ie("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",ot?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(fs,{className:"size-4"})}),!Te&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:An,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ie("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Er),children:[n.jsx(ks,{rule:Mt(ut.rule,o??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ht.map((t,s)=>{const a=s===Ht.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ps,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Cn(s),title:t,className:Ie("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?ot?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":ot?"text-foreground/80":"text-muted-foreground",ot?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),ot&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(To,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Dn&&!ft&&!mt?.isHidden&&N&&n.jsx(qn,{onClick:()=>rn()})]}),ot&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("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(Rr,{pageKey:N,initialName:qe.name,initialPath:qe.path,onFieldChange:Gs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>ve(!0),children:n.jsx(Ro,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&N?D(N):Pe(!0),children:n.jsx(wo,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(qn,{onClick:Pn})]})}),$?n.jsx(Yt,{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:Lt&&N?n.jsx(Wo,{rawSeo:nn,innerSeo:xn,defaultResolveType:Fs,seoSchema:Os,activeResolveType:sn,seoTypeOptions:Ls,formResetKey:Ce,siteDefaultSeo:Is,onBreadcrumbChange:de,onPersistRaw:Ra,onInnerChange:ka,onClearForm:wa,onBumpFormKey:Na}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Yt,{viewportRef:Fe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&bt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(eo,{listKey:`${N??""}:${p??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:ln,onSelect:ea,onRename:ce,onDuplicate:na,onDelete:ta,onRemoveAll:aa,onReorder:sa,onAdd:()=>rn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Yn,{currentRt:We??"",currentLabel:Wt($t?.rule,o??{},lt,l??void 0),currentGlobalKey:Pt($t?.rule,o??{},l??void 0)??void 0,matchers:It,globals:Rn,onSelect:da,onSelectGlobal:fa,schema:ha,formValue:nt,onChange:ma,formKey:`${p??"none"}:${ln}:${We??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:o,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx(Wn,{activeSchema:an,formValue:ae,formResetKey:Ke,onFormChange:jn,onBreadcrumbChange:B,breadcrumbPath:le,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:o,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:En})]}):Te?n.jsx(Yt,{viewportRef:Fe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Wn,{activeSchema:an,formValue:ae,formResetKey:Ke,onFormChange:jn,onBreadcrumbChange:B,breadcrumbPath:le,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:o,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:En})}):n.jsxs(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&N&&n.jsx(yr,{listKey:N,variants:He,activeIndex:Oe,decofile:o??{},meta:l,matchers:It,onSelect:Sa,onReorder:xa,onRename:ye,onDuplicate:_a,onDelete:ya,onAdd:Pn}),Ft&&ne!==null&&n.jsxs("div",{className:Ie("px-3 border-b",ke?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>Be(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":ke,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),ke?n.jsx(No,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(jo,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ke&&n.jsx("div",{className:Ie("space-y-3",Tt&&"pointer-events-none opacity-50"),children:n.jsx(Yn,{currentRt:ne,currentLabel:Wt(ut?.rule,o??{},lt,l??void 0),currentGlobalKey:Pt(ut?.rule,o??{},l??void 0)??void 0,matchers:It,globals:Rn,onSelect:la,onSelectGlobal:ua,schema:ia,formValue:ie,onChange:ca,formKey:`${Oe}:${ne??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:o,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(mr,{listKey:`${N??""}-${Oe}`,rawSections:U,sections:ze,meta:l,selectedIndex:p,onSelect:Hs,onReorder:Us,onDelete:Ws,onDuplicate:qs,onMakeReusable:pe,onToggleHidden:Ys,onToggleLazy:Js,onAddVariant:rn,onDetach:Qs,onAddSection:()=>oe(!0),canAddSection:ra})})]}),n.jsx(to,{open:me!==null,onOpenChange:t=>{t||pe(null)},defaultBlockId:me!==null?dn(ze[me]?.label??""):"",isPending:Ne.isPending,onSubmit:oa}),m&&n.jsx(Jo,{open:Re,onOpenChange:t=>{oe(t),t||(he.current=null)},meta:l,decofile:o,previewBaseUrl:m,onSelect:Zs}),ge&&N&&o&&n.jsx(no,{open:ge,onOpenChange:Pe,pageKey:N,decofile:o}),Ve!==null&&n.jsx(Gn,{open:!0,initialName:wt(He[Ve]?.rule,o??{},l??void 0)?Wt(He[Ve]?.rule,o??{},lt,l??void 0):"",autoLabel:lt(Mt(He[Ve]?.rule,o??{},l??void 0)),isPending:Tt,onSubmit:async t=>{await ja(Ve,t)},onOpenChange:t=>{!t&&!Tt&&ye(null)}}),De!==null&&n.jsx(Gn,{open:!0,initialName:wt(bt[De]?.rule,o??{},l??void 0)?Wt(bt[De]?.rule,o??{},lt,l??void 0):"",autoLabel:lt(Mt(bt[De]?.rule,o??{},l??void 0)),isPending:Tt,onSubmit:async t=>{await Ea(De,t)},onOpenChange:t=>{!t&&!Tt&&ce(null)}})]})}export{fc as SectionsEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BuCpbtaM.js","assets/index-B1Wqe50f.js","assets/index-BZ6FY5YW.css","assets/Tool02-BhAdrZCc.js","assets/CheckCircle-B7Uc0Lhw.js","assets/Settings02-Y5EoKHnL.js","assets/use-mcp-client-BpP-ogps.js","assets/auth-CfcQWvV5.js","assets/useInfiniteQuery-BfELt9Jh.js","assets/use-infinite-scroll-gAPER-ig.js","assets/studio-tools-DVCzmbHJ.js","assets/badge-CLVDJQOK.js","assets/input-BIPflGRD.js","assets/dropdown-menu-Crgvenwv.js","assets/Check-B59ln8yf.js","assets/ChevronRight-YFTtoJP6.js","assets/DotsVertical-DEmK4uzz.js","assets/table-kECVt-C7.js","assets/toggle-group-CPDLRn9j.js","assets/use-view-mode-CY7SFCtA.js","assets/use-mobile-CWm9GN2y.js","assets/FilterLines-BsqL1Yoh.js","assets/SearchMd-Bao2Khs6.js","assets/dialog-DYY8nxLe.js","assets/X-B-bVKpMu.js","assets/AlertCircle-CmlqvQvU.js","assets/Upload01-Bg524psL.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-C-B7yt3Z.js","assets/card-D23PgnYA.js","assets/Trash01-C4bB4DeV.js","assets/label-C0D4GSim.js","assets/select-Bi1NZj5e.js","assets/tooltip-D9H3EBf5.js","assets/ChevronDown-BXkaTIFo.js","assets/ChevronUp-nqC8TfZe.js","assets/switch-DzZL0Ygg.js","assets/textarea-Bdupuo1G.js","assets/XCircle-ZKQCeczB.js","assets/checkbox-DSkIhGii.js","assets/Eye-DEdNchPT.js","assets/LinkExternal01-BMTNiHtD.js","assets/use-copy-ChS78tRx.js","assets/Copy01-g955dMab.js","assets/Key01-DfVkeFRe.js","assets/Plus-DFKn-2D5.js","assets/mcp-oauth-DckzwyC7.js","assets/Play-CkQPweHz.js"])))=>i.map(i=>d[i]);
2
- import{c as m,d as n,f as c,j as t,k as f,r as l,aG as p}from"./index-B1Wqe50f.js";import{R as u}from"./require-capability-D33eHd9x.js";import"./use-capability-_tObqP_-.js";import"./access-gate-B5SUruAr.js";import"./capability-load-error-CiNu_2Tk.js";const g=l.lazy(()=>p(()=>import("./registry-layout-BuCpbtaM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-gAPER-ig.js";import{e5 as i}from"./index-B1Wqe50f.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-gAPER-ig.js";import{e5 as u,b2 as n}from"./index-B1Wqe50f.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};