decocms 3.36.1 → 3.36.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/dist/client/assets/{AlertCircle-BnqV2fhH.js → AlertCircle-BU9gj1Zb.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DLu3LSuz.js → ArrowUpRight-D2O4sQl3.js} +1 -1
  3. package/dist/client/assets/{Check-eh46ZGML.js → Check-BmF1hQRY.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-C0r3mBzW.js → CheckCircle-C4XwcfjN.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-4LxQ5oPz.js → ChevronDown-BIO7wba7.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-D0NHXMar.js → ChevronLeft-CW2G6JyB.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CxxNo5xV.js → ChevronRight-CwhL8zaw.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-ATBl3MAi.js → ChevronUp-DdLEv_cl.js} +1 -1
  9. package/dist/client/assets/{Container-CV0p7hHO.js → Container-Dyf0TzBH.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CNRvkzVu.js → DotsVertical-DQMFAww2.js} +1 -1
  11. package/dist/client/assets/{Eye-DVlN5jxk.js → Eye-Bi1ejTfS.js} +1 -1
  12. package/dist/client/assets/{FilterLines-L07hHUB-.js → FilterLines-jWyOgIfr.js} +1 -1
  13. package/dist/client/assets/{Globe01-B9VL3QNT.js → Globe01-DF9PUq9k.js} +1 -1
  14. package/dist/client/assets/{HardDrive-COh7IrR0.js → HardDrive-BIzpSh2R.js} +1 -1
  15. package/dist/client/assets/{Key01-aulVwqL7.js → Key01-DJaxTkjl.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-DWk83m69.js → LayoutLeft-C3u21iqS.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-D_x8dxjY.js → LinkExternal01-D7mXn_q6.js} +1 -1
  18. package/dist/client/assets/{Monitor01-2xEKWZVQ.js → Monitor01-B2V0QJVA.js} +1 -1
  19. package/dist/client/assets/{Palette-IBuOwnrk.js → Palette-CvjTgNao.js} +1 -1
  20. package/dist/client/assets/{Play-C1Dc-lf9.js → Play-6yxi-kVu.js} +1 -1
  21. package/dist/client/assets/{Plus-BLTD9g1p.js → Plus-D-k489Hw.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-CXJQK3v9.js → RefreshCcw01-0Z7TeT1O.js} +1 -1
  23. package/dist/client/assets/{SearchMd-B3lNgj0Q.js → SearchMd-BdcI0VcO.js} +1 -1
  24. package/dist/client/assets/{Settings02-BtL-CPg2.js → Settings02-C6hr8Qy9.js} +1 -1
  25. package/dist/client/assets/{Shield01-JtF9z5lI.js → Shield01-DOB3vgca.js} +1 -1
  26. package/dist/client/assets/{Star01-D0denzoA.js → Star01-Du_V1z61.js} +1 -1
  27. package/dist/client/assets/{Stars01-b6QvFAbV.js → Stars01-BAC8f8eM.js} +1 -1
  28. package/dist/client/assets/{Stars02-DiuJq52q.js → Stars02-CpPe-VPg.js} +1 -1
  29. package/dist/client/assets/{Sun-BQHzenzm.js → Sun-C3Zhz8pG.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-C4dRfRR7.js → SwitchHorizontal01-BRvArA9H.js} +1 -1
  31. package/dist/client/assets/{Tool01-DCdaNaEY.js → Tool01-yFL5Dn59.js} +1 -1
  32. package/dist/client/assets/{Trash01-mLRbM1z9.js → Trash01-Br13J6pg.js} +1 -1
  33. package/dist/client/assets/{Upload01-BP26EgoC.js → Upload01-D4q_2hTt.js} +1 -1
  34. package/dist/client/assets/{User01-DpZZxZQw.js → User01-BtejVxVG.js} +1 -1
  35. package/dist/client/assets/{Users01-CTI49oYx.js → Users01-Dy4pn4ki.js} +1 -1
  36. package/dist/client/assets/{Users03-CORMvH6Y.js → Users03-CmfKEZdY.js} +1 -1
  37. package/dist/client/assets/{X-gn1ly4Nc.js → X-DcDNiBgo.js} +1 -1
  38. package/dist/client/assets/{XCircle-BGJwPzuZ.js → XCircle-e29W-Gcn.js} +1 -1
  39. package/dist/client/assets/{XClose-BwlE-Nu8.js → XClose-D4RzaaY5.js} +1 -1
  40. package/dist/client/assets/{Zap-DqD6AduN.js → Zap-Cp6OTaVi.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-B2POR1ZS.js → ZapSquare-CvMxvmoA.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-BM2NUDgV.js → ZoomOut-m5WCE6Ow.js} +1 -1
  43. package/dist/client/assets/{access-gate-DACRNgiY.js → access-gate-B7iLwSTn.js} +1 -1
  44. package/dist/client/assets/{accordion-DggLsDzc.js → accordion-DyJkloNK.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-C3xNe_xo.js → add-section-modal-CRDse3LE.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-Bm-PLFs1.js → agent-capabilities--0Cd735F.js} +1 -1
  47. package/dist/client/assets/{agent-icon-CkXhv6DR.js → agent-icon-MPxc_53p.js} +1 -1
  48. package/dist/client/assets/{agents-list-_LMmNXh7.js → agents-list-DvMDGpVE.js} +1 -1
  49. package/dist/client/assets/{ai-providers-CdE9elzv.js → ai-providers-BZpaXRIt.js} +1 -1
  50. package/dist/client/assets/{alert-Di1nAgGl.js → alert--QwThtUs.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-ZJsAqfzl.js → alert-dialog-DAZnJbEa.js} +1 -1
  52. package/dist/client/assets/app-editor-DOKG-0MP.js +1 -0
  53. package/dist/client/assets/{auth-C28A30Tc.js → auth-Rhn0UUKX.js} +1 -1
  54. package/dist/client/assets/{auth-catchall-Gykc1ayZ.js → auth-catchall-COEk5Dgt.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-BLQZfqqR.js → auth-split-layout-BU5p8xYF.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BS580Xxk.js → automation-list-row-BkqsYOIc.js} +1 -1
  57. package/dist/client/assets/{automation-runs-C1x-2avW.js → automation-runs-CfLYge75.js} +1 -1
  58. package/dist/client/assets/{automations-D045v3lS.js → automations-E9ZspVSN.js} +1 -1
  59. package/dist/client/assets/{avatar-B_BYzpDz.js → avatar-DgWkRz32.js} +1 -1
  60. package/dist/client/assets/{badge-BzbbNtAh.js → badge-Ckvq5EMT.js} +1 -1
  61. package/dist/client/assets/{brand-context-BwCpbN9i.js → brand-context-Cm9JdTeG.js} +1 -1
  62. package/dist/client/assets/{buckets-UoUGoesM.js → buckets-Dja8qKdg.js} +1 -1
  63. package/dist/client/assets/{calendar-CVM_PlWs.js → calendar-C4NMm-GW.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-C8q5gpVF.js → capability-load-error-DGtjMdu6.js} +1 -1
  65. package/dist/client/assets/{card-DV27UhYe.js → card-DV2a7ud0.js} +1 -1
  66. package/dist/client/assets/{chat-context-B17fAiGJ.js → chat-context-CQJ83DKW.js} +1 -1
  67. package/dist/client/assets/{checkbox-C8E6yiOS.js → checkbox-Eb0jgSAR.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-DXKtTRqn.js → cli-auth-success-C5I6pdNq.js} +1 -1
  69. package/dist/client/assets/{collection-detail-DYTXe-vX.js → collection-detail-QmVn7T6P.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-DkvliZfy.js → collection-display-button-k6e_w5_8.js} +1 -1
  71. package/dist/client/assets/{collection-search-6oM8sAkn.js → collection-search-q3LrsDP0.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-BoznEa1p.js → collection-table-wrapper-Wg4_kRAB.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-IWqiXV1e.js → collection-tabs-CvaARsvN.js} +1 -1
  74. package/dist/client/assets/{collections-DFNd7jPX.js → collections-DjlDVd1Q.js} +1 -1
  75. package/dist/client/assets/{command-D1SdiPwD.js → command--rBvALtU.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-D-tmt4pE.js → connect-desktop-dialog-CkEEvZPz.js} +1 -1
  77. package/dist/client/assets/{connection-card-DIcosm0X.js → connection-card-DqPMpeMB.js} +1 -1
  78. package/dist/client/assets/{connection-detail-Bb7E7eEJ.js → connection-detail-Ceck3IrK.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-ChlYhyg6.js → connection-form-helpers-B6xP1FXS.js} +1 -1
  80. package/dist/client/assets/{connections-BkTeF878.js → connections-BvYO4I8Q.js} +1 -1
  81. package/dist/client/assets/{decopilot-D_s8NcrD.js → decopilot-DxHNnnUA.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-CKBDifRl.js +1 -0
  83. package/dist/client/assets/{dialog-BSB689j7.js → dialog-pxIgcxdx.js} +1 -1
  84. package/dist/client/assets/{domain-settings-DHNs_g_j.js → domain-settings-CGcPdYTM.js} +1 -1
  85. package/dist/client/assets/{drawer-C82Ms0Cv.js → drawer-BrCENAAY.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-FYqDJehF.js → dropdown-menu-BS4mK__m.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-5sKc8jyc.js → dynamic-plugin-layout-Cn1BTjpz.js} +1 -1
  88. package/dist/client/assets/{empty-state-C1tavIlq.js → empty-state-Cp1JLYcR.js} +1 -1
  89. package/dist/client/assets/{empty-state-BxzxLrPP.js → empty-state-vCEwHb1v.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-CnLrafQF.js → extract-connection-data-16MvAzOh.js} +1 -1
  91. package/dist/client/assets/{features-BpHY8f6J.js → features-Dc3bQW1I.js} +1 -1
  92. package/dist/client/assets/{file-explorer-BZVx-0O5.js → file-explorer-CelbZiCq.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-Bw8qs6o2.js → file-type-icon-B3ZaCMP2.js} +1 -1
  94. package/dist/client/assets/{files-DxGJVld5.js → files-B5orgVDs.js} +1 -1
  95. package/dist/client/assets/{form-UO3a-lMt.js → form-DsGRrH4I.js} +1 -1
  96. package/dist/client/assets/{general-B1BA_GZn.js → general-DvWuRP0a.js} +1 -1
  97. package/dist/client/assets/{generate-id-CZUSC7-8.js → generate-id-B0UU4AyI.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-FLFbegfT.js → github-repo-picker-BciViNc8.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-BOKDj9bu.js → header-tab-button-elaOU0d9.js} +1 -1
  100. package/dist/client/assets/{hover-card-C3LYC-kn.js → hover-card-DfhDOin0.js} +1 -1
  101. package/dist/client/assets/{image-field-B-axyZ2P.js → image-field-BIrSC9Gs.js} +1 -1
  102. package/dist/client/assets/{index-CPTdDHuM.js → index-3WWLSqtl.js} +1 -1
  103. package/dist/client/assets/{index-B1OoDAS2.js → index-BKFf6V9A.js} +1 -1
  104. package/dist/client/assets/{index-WvB9UFs-.js → index-BLEyVrBm.js} +1 -1
  105. package/dist/client/assets/{index-DEbs6yYd.js → index-BMSOEHke.js} +1 -1
  106. package/dist/client/assets/{index-Cb4WTt-q.js → index-C8saI2Kn.js} +26 -26
  107. package/dist/client/assets/{index-CiybtfLu.js → index-ChdATVAA.js} +3 -3
  108. package/dist/client/assets/{index-CflW-8xl.js → index-CkV2wRTX.js} +1 -1
  109. package/dist/client/assets/{index-BHwbsS0f.js → index-D4tq1hPm.js} +1 -1
  110. package/dist/client/assets/{index-BMLWSX3S.js → index-DLRMbGKZ.js} +1 -1
  111. package/dist/client/assets/{index-DppM2zVg.js → index-DNM2q8BY.js} +1 -1
  112. package/dist/client/assets/{index-DGUKxx9B.js → index-DgyLJoal.js} +1 -1
  113. package/dist/client/assets/{index-C6tCJ6iD.js → index-Dupl0DR-.js} +1 -1
  114. package/dist/client/assets/{index-DR94I8IC.js → index-L_0VXlrp.js} +1 -1
  115. package/dist/client/assets/{index-DJOtAj7h.js → index-m-rxA9SC.js} +1 -1
  116. package/dist/client/assets/{index-redirect-DxTNMkbp.js → index-redirect-Cl16_UY5.js} +1 -1
  117. package/dist/client/assets/{index-SkqPgX26.js → index-xNHaP-xT.js} +1 -1
  118. package/dist/client/assets/{input-BIou7x1s.js → input-BZ-4l6sv.js} +1 -1
  119. package/dist/client/assets/{integration-icon-BG6b6lUb.js → integration-icon-LHjd4NGc.js} +1 -1
  120. package/dist/client/assets/{label-BALZ87Ne.js → label-CGY9toLT.js} +1 -1
  121. package/dist/client/assets/{layout-D3wKVNIg.js → layout-C8nv7dxR.js} +1 -1
  122. package/dist/client/assets/{login-njuJcB71.js → login-D5x6WUee.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-CJ3fuseB.js → mcp-oauth-BeZ96noC.js} +1 -1
  124. package/dist/client/assets/{members-BeYdJt0r.js → members-0_y-hP8y.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-CLILoFVJ.js → monaco-editor-C8DVCvK_.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-u_reVPx1.js → monitoring-stats-row-Dy60nPc4.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-BDRagMAu.js → oauth-callback-ai-provider-CQlojnmt.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-DirC5TV0.js → oauth-callback-rU6P6YYM.js} +1 -1
  129. package/dist/client/assets/{onboarding-DlgWGyxq.js → onboarding-BsFG_79R.js} +1 -1
  130. package/dist/client/assets/{org-install-DVgIW0Qi.js → org-install-CGnSzU4n.js} +1 -1
  131. package/dist/client/assets/{org-layout-Bre11PNt.js → org-layout-ayqAcIyF.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-BXBCHZWd.js → org-plugin-layout-KLX9VenO.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-DUSMHeEJ.js → page-seo-form-DJemjXau.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-CnqIZbrb.js +1 -0
  135. package/dist/client/assets/{pair-lHmdq1Qv.js → pair-BriGg-MY.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-DAWeTPEc.js → plugin-empty-state-CKqj8hWW.js} +1 -1
  137. package/dist/client/assets/{plugin-header-DFfO2BIK.js → plugin-header-Dg_-PVfV.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-syGxbFUV.js → plugin-layout-CFCRHuug.js} +1 -1
  139. package/dist/client/assets/{popover-DwdaLh0V.js → popover-hHdVOt7q.js} +1 -1
  140. package/dist/client/assets/{post-editor-C9ncA3ry.js → post-editor-DZXsYKGZ.js} +1 -1
  141. package/dist/client/assets/{primitives-B-U4LZoe.js → primitives-CNx5bddX.js} +1 -1
  142. package/dist/client/assets/{profile-Ht_-FnbL.js → profile-B3k1aQmn.js} +1 -1
  143. package/dist/client/assets/project-app-view-B-NllsZl.js +1 -0
  144. package/dist/client/assets/record-editor-DxhzZA73.js +1 -0
  145. package/dist/client/assets/registry-D_rElF24.js +2 -0
  146. package/dist/client/assets/{registry-layout-Bw_kbjOh.js → registry-layout-C9QKLcDQ.js} +1 -1
  147. package/dist/client/assets/{require-capability-BJtu48OI.js → require-capability-D5XZoZnS.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DI6zQAQY.js → required-auth-layout-DhqvkBI0.js} +1 -1
  149. package/dist/client/assets/{reset-password-D4hK6pUY.js → reset-password-D7s0P0GF.js} +1 -1
  150. package/dist/client/assets/{resizable-B2XskWDt.js → resizable-BRT-qUaD.js} +1 -1
  151. package/dist/client/assets/{roles-Cqt-ohZl.js → roles-CPQyhIdH.js} +1 -1
  152. package/dist/client/assets/save-referenced-block-VHJ6rXLi.js +1 -0
  153. package/dist/client/assets/{save-status-B5RVyMMa.js → save-status-D1jAW4JE.js} +1 -1
  154. package/dist/client/assets/schema-form-D3MP878L.js +1 -0
  155. package/dist/client/assets/{scroll-area-CUtpZ3i2.js → scroll-area-DKNnXldV.js} +1 -1
  156. package/dist/client/assets/{search-input-D_Czo7sj.js → search-input-BQKJCNNI.js} +1 -1
  157. package/dist/client/assets/{secrets-DqDtbfQI.js → secrets-J5Pwn3p4.js} +1 -1
  158. package/dist/client/assets/{sections-editor-TRTd4goB.js → sections-editor-rePIiHP9.js} +1 -1
  159. package/dist/client/assets/{select-DyYLWAtt.js → select-6yI1bUUl.js} +1 -1
  160. package/dist/client/assets/{select-model-Bgdox0ak.js → select-model-z3ovXylT.js} +1 -1
  161. package/dist/client/assets/{seo-editor-NEYssb1U.js → seo-editor--9JZnrI6.js} +1 -1
  162. package/dist/client/assets/{settings-layout-BjHnX_Rv.js → settings-layout-BKOOm0iL.js} +1 -1
  163. package/dist/client/assets/{settings-section-ByNQkiKy.js → settings-section-BDeKU196.js} +1 -1
  164. package/dist/client/assets/{sheet-CJSR0f_J.js → sheet-l2LhhOCY.js} +1 -1
  165. package/dist/client/assets/{shell-controls-0WsfKqkV.js → shell-controls-BxC6c_cJ.js} +1 -1
  166. package/dist/client/assets/{shell-layout-CvbgPIaO.js → shell-layout-DSzgNlpN.js} +1 -1
  167. package/dist/client/assets/shell-route-loading-D-NySFQN.js +1 -0
  168. package/dist/client/assets/{sidebar-CT4nDj9F.js → sidebar-ZxffB9i3.js} +1 -1
  169. package/dist/client/assets/{skeleton-C0n2MBSC.js → skeleton-DsBtdATm.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-BzXaOB_3.js → sortable.esm-B7SCN4Iq.js} +1 -1
  171. package/dist/client/assets/{spinner-DBVYiKjc.js → spinner-DynhmXJb.js} +1 -1
  172. package/dist/client/assets/{sso-DqRvx49i.js → sso-Bya3BiB0.js} +1 -1
  173. package/dist/client/assets/{store-BYx1pzM7.js → store-C4ZU4zXI.js} +1 -1
  174. package/dist/client/assets/store-registry-WPLrtDu9.js +2 -0
  175. package/dist/client/assets/{studio-tools-ByWE0fVB.js → studio-tools-tx_ynP6E.js} +1 -1
  176. package/dist/client/assets/{switch-CFZgZOoT.js → switch-DWpVVt2b.js} +1 -1
  177. package/dist/client/assets/{tab-id-D6XV4CDL.js → tab-id-CGE8BPr3.js} +1 -1
  178. package/dist/client/assets/{table-DRy0atlv.js → table-1jrYsVvf.js} +1 -1
  179. package/dist/client/assets/{tabs-B4Xt74wj.js → tabs-B9aEuz_5.js} +1 -1
  180. package/dist/client/assets/{task-status-CizXRJxN.js → task-status-BgRp2OfZ.js} +1 -1
  181. package/dist/client/assets/{textarea-CpqLWirc.js → textarea-DbtEiAgf.js} +1 -1
  182. package/dist/client/assets/{toggle-group-CUuptLSP.js → toggle-group-BCauVBxS.js} +1 -1
  183. package/dist/client/assets/{toolbar-Brcztx2Q.js → toolbar-C9WpnxRP.js} +1 -1
  184. package/dist/client/assets/{tools-list-DJunsBR9.js → tools-list-C-j8gu56.js} +1 -1
  185. package/dist/client/assets/{tooltip-BjyXwk4-.js → tooltip-CVKtA6h7.js} +1 -1
  186. package/dist/client/assets/{types-CTAso5N_.js → types-Bik0zSxz.js} +1 -1
  187. package/dist/client/assets/{use-ai-providers-BJZDY8Y9.js → use-ai-providers-Bf7NstiT.js} +1 -1
  188. package/dist/client/assets/{use-automations-Cmrz96gF.js → use-automations-DQhoL7n_.js} +1 -1
  189. package/dist/client/assets/{use-capability-B0pYY0r2.js → use-capability-BekxNShN.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-B7ba5G_w.js → use-clock-tick-CQKT35Lf.js} +1 -1
  191. package/dist/client/assets/{use-collections-DJpkyqRG.js → use-collections-DYulUuYs.js} +1 -1
  192. package/dist/client/assets/{use-connection-B5A06L65.js → use-connection-DpR6JQF5.js} +1 -1
  193. package/dist/client/assets/{use-copy-Dp9AIDyE.js → use-copy-BhHE-xFV.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-DvFTy-qt.js → use-create-virtual-mcp-ZidK7zTv.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-BYXOYkk-.js → use-debounced-autosave-2ixaaEOx.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-WF5NfIcz.js → use-delete-connection-b1BC9mo1.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-DZ1IbDAN.js → use-file-configs-CvNjCdnD.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-DUQ6svQh.js → use-infinite-scroll-BfpP7RsP.js} +1 -1
  199. package/dist/client/assets/{use-list-state-Bx7Ncrk2.js → use-list-state-BvQ5j7vs.js} +1 -1
  200. package/dist/client/assets/{use-mcp-client-D1Wt1Ama.js → use-mcp-client-DjqC1nd8.js} +1 -1
  201. package/dist/client/assets/{use-mcp-prompts-C3lAYJn0.js → use-mcp-prompts-Drzzskll.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-B_6LkwOm.js → use-mcp-tools-BUMls37h.js} +1 -1
  203. package/dist/client/assets/{use-members-Ch8rP11v.js → use-members-BiyrTP5I.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-Df96tRB5.js → use-navigate-to-agent-B7_UOyHZ.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-BafLVU4c.js → use-org-auth-client-BrG8JDW1.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-Dy5nNvp5.js → use-org-sso-mx87uCVa.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-D6FDnuQ7.js → use-organization-roles-_Z-_Ox1y.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-9bjAS-Lz.js → use-organization-settings-BWseGhxw.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-zD4mCaEh.js → use-registry-connections-BFZcaU10.js} +1 -1
  210. package/dist/client/assets/{use-secrets-ClIBWX3M.js → use-secrets-C-XHa3-0.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-DCDAeOy7.js → use-status-sounds-D1fVHGXs.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-lpAtoRqW.js → use-view-mode-DjLpAg7F.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-BsZRrdSO.js → use-virtual-mcp-BldCtSoA.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-aPUoKLwo.js +1 -0
  215. package/dist/client/assets/{useRouterState-D6isJH0F.js → useRouterState-BZKGSD2r.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-CuHxM8XU.js +1 -0
  217. package/dist/client/assets/{user-BLD1kA1s.js → user-Coe1o0e6.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-C-NsBriE.js → view-mode-toggle-GEdPTd_M.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-BSUvJM1x.js → watch-sse-pool-C_YrQqjE.js} +1 -1
  220. package/dist/client/assets/{workflow-BxTaQjnF.js → workflow-ZbQ4bKoz.js} +1 -1
  221. package/dist/client/assets/workflow-detail-DEuNJrY-.js +1 -0
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +1 -1
  224. package/package.json +1 -1
  225. package/dist/client/assets/app-editor-CwrKwl6S.js +0 -1
  226. package/dist/client/assets/decopilot-sse-pool-DqoHsSxc.js +0 -1
  227. package/dist/client/assets/page-seo-sheet-NSwZ2Bog.js +0 -1
  228. package/dist/client/assets/project-app-view-HB2vBeZ5.js +0 -1
  229. package/dist/client/assets/record-editor-8FmeVsnk.js +0 -1
  230. package/dist/client/assets/registry-FHAA-0GH.js +0 -2
  231. package/dist/client/assets/save-referenced-block-CjAVAUIA.js +0 -1
  232. package/dist/client/assets/schema-form-MsvEbpzs.js +0 -1
  233. package/dist/client/assets/shell-route-loading-BQKfSVKy.js +0 -1
  234. package/dist/client/assets/store-registry-6iSO897G.js +0 -2
  235. package/dist/client/assets/useInfiniteQuery-CvW-Zfuj.js +0 -1
  236. package/dist/client/assets/useSuspenseInfiniteQuery-DGYfhNPQ.js +0 -1
  237. package/dist/client/assets/workflow-detail-Dw0wzylw.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as w,dO as $l,bC as ju,j as O,aR as Hu,b2 as St,dP as Wu,a4 as it,a5 as Qe,bh as On,be as Uu,bf as qu,bu as Mt,dI as Fl,ad as _l,bd as Ku,aa as ut,e as Vl,c as jl}from"./index-CiybtfLu.js";import{e as Ju}from"./select-DyYLWAtt.js";function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Q(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Q(t)},addToStart:function(n,e){return new Q([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Q(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Q(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Q.from(n),n.size?new Q(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Q.from(n),n.size?new Q(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Q.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Hl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wl(this,e,t,r)}findIndex(e){if(e==0)return Ln(0,e);if(e==this.size)return Ln(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ln(t+1,i):Ln(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const ls={index:0,offset:0};function Ln(n,e){return ls.index=n,ls.offset=e,ls}function Qn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let z=class Ps{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ps.none;if(e instanceof Ps)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};z.none=[];class Zn extends Error{}class v{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ql(this.content,e+this.openStart,t);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(e,t){return new v(Ul(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return v.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new v(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new v(e,r,s)}}v.empty=new v(k.empty,0,0);function Ul(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ul(i.content,e-s-1,t-s-1)))}function ql(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=ql(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Gu(n,e,t){if(t.openStart>n.depth)throw new Zn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zn("Inconsistent open depths");return Kl(n,e,t,0)}function Kl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return yt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Yu(t,n);return yt(i,Gl(n,o,l,e,r))}else return yt(i,er(n,e,r))}function Jl(n,e){if(!e.type.compatibleContent(n.type))throw new Zn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ls(n,e,t){let r=n.node(t);return Jl(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)gt(s.child(l),r);e&&e.depth==t&&e.textOffset&&gt(e.nodeBefore,r)}function yt(n,e){return n.type.checkContent(e),n.copy(e)}function Gl(n,e,t,r,s){let i=n.depth>s&&Ls(n,e,s+1),o=r.depth>s&&Ls(t,r,s+1),l=[];return an(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jl(i,o),gt(yt(i,Gl(n,e,t,r,s+1)),l)):(i&&gt(yt(i,er(n,e,s+1)),l),an(e,t,s,l),o&&gt(yt(o,er(t,r,s+1)),l)),an(r,null,s,l),new k(l)}function er(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let s=Ls(n,e,t+1);gt(yt(s,er(n,e,t+1)),r)}return an(e,null,t,r),new k(r)}function Yu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new kn(t,r,i)}static resolveCached(e,t){let r=so.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else so.set(e,r=new Xu);let s=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%Qu,s}}class Xu{constructor(){this.elts=[],this.i=0}}const Qu=12,so=new WeakMap;class tr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zu=Object.create(null);class Ee{constructor(e,t,r,s=z.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qn(this.attrs,t||e.defaultAttrs||Zu)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ee(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ee(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new v(c,s.depth-o,i.depth-o)}replace(e,t,r){return Gu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ee.prototype.text=void 0;class nr extends Ee{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new nr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new nr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ed(e,t);if(r.next==null)return wt.empty;let s=Xl(r);r.next&&r.err("Unexpected trailing text");let i=ld(od(s));return ad(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
1
+ import{r as w,dO as $l,bC as ju,j as O,aR as Hu,b2 as St,dP as Wu,a4 as it,a5 as Qe,bh as On,be as Uu,bf as qu,bu as Mt,dI as Fl,ad as _l,bd as Ku,aa as ut,e as Vl,c as jl}from"./index-ChdATVAA.js";import{e as Ju}from"./select-6yI1bUUl.js";function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Q(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Q(t)},addToStart:function(n,e){return new Q([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Q(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Q(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Q.from(n),n.size?new Q(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Q.from(n),n.size?new Q(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Q.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Hl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wl(this,e,t,r)}findIndex(e){if(e==0)return Ln(0,e);if(e==this.size)return Ln(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ln(t+1,i):Ln(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const ls={index:0,offset:0};function Ln(n,e){return ls.index=n,ls.offset=e,ls}function Qn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let z=class Ps{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ps.none;if(e instanceof Ps)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};z.none=[];class Zn extends Error{}class v{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ql(this.content,e+this.openStart,t);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(e,t){return new v(Ul(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return v.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new v(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new v(e,r,s)}}v.empty=new v(k.empty,0,0);function Ul(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ul(i.content,e-s-1,t-s-1)))}function ql(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=ql(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Gu(n,e,t){if(t.openStart>n.depth)throw new Zn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zn("Inconsistent open depths");return Kl(n,e,t,0)}function Kl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return yt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Yu(t,n);return yt(i,Gl(n,o,l,e,r))}else return yt(i,er(n,e,r))}function Jl(n,e){if(!e.type.compatibleContent(n.type))throw new Zn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ls(n,e,t){let r=n.node(t);return Jl(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)gt(s.child(l),r);e&&e.depth==t&&e.textOffset&&gt(e.nodeBefore,r)}function yt(n,e){return n.type.checkContent(e),n.copy(e)}function Gl(n,e,t,r,s){let i=n.depth>s&&Ls(n,e,s+1),o=r.depth>s&&Ls(t,r,s+1),l=[];return an(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jl(i,o),gt(yt(i,Gl(n,e,t,r,s+1)),l)):(i&&gt(yt(i,er(n,e,s+1)),l),an(e,t,s,l),o&&gt(yt(o,er(t,r,s+1)),l)),an(r,null,s,l),new k(l)}function er(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let s=Ls(n,e,t+1);gt(yt(s,er(n,e,t+1)),r)}return an(e,null,t,r),new k(r)}function Yu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new kn(t,r,i)}static resolveCached(e,t){let r=so.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else so.set(e,r=new Xu);let s=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%Qu,s}}class Xu{constructor(){this.elts=[],this.i=0}}const Qu=12,so=new WeakMap;class tr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zu=Object.create(null);class Ee{constructor(e,t,r,s=z.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qn(this.attrs,t||e.defaultAttrs||Zu)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ee(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ee(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new v(c,s.depth-o,i.depth-o)}replace(e,t,r){return Gu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ee.prototype.text=void 0;class nr extends Ee{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new nr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new nr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ed(e,t);if(r.next==null)return wt.empty;let s=Xl(r);r.next&&r.err("Unexpected trailing text");let i=ld(od(s));return ad(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
2
2
  `)}}wt.empty=new wt(!0);class ed{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Xl(n){let e=[];do e.push(td(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function td(n){let e=[];do e.push(nd(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function nd(n){let e=id(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=rd(n,e);else break;return e}function io(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function rd(n,e){let t=io(n),r=t;return n.eat(",")&&(n.next!="}"?r=io(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function sd(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function id(n){if(n.eat("(")){let e=Xl(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=sd(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function od(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Ql(n,e){return e-n}function oo(n,e){let t=[];return r(e),t.sort(Ql);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function ld(n){let e=Object.create(null);return t(oo(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);oo(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new wt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Ql);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function ad(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Zl(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function ea(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function ta(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function na(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ud(n,r,e[r]);return t}let lo=class ra{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=na(e,r.attrs),this.defaultAttrs=Zl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ea(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ee(this,this.computeAttrs(e),k.from(t),z.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new Ee(this,this.computeAttrs(e),t,z.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(k.empty,!0);return i?new Ee(this,e,t.append(i),z.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ta(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:z.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new ra(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function cd(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class ud{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?cd(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class jr{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=na(e,s.attrs),this.excluded=null;let i=Zl(this.attrs);this.instance=i?new z(this,i):null}create(e=null){return!e&&this.instance?this.instance:new z(this,ea(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new jr(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ta(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class sa{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Q.from(e.nodes),t.marks=Q.from(e.marks||{}),this.nodes=lo.compile(this.spec.nodes,this),this.marks=jr.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=wt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?ao(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:ao(this,o.split(" "))}this.nodeFromJSON=s=>Ee.fromJSON(this,s),this.markFromJSON=s=>z.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof lo){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new nr(r,r.defaultAttrs,e,z.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ao(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function dd(n){return n.tag!=null}function fd(n){return n.style!=null}class Ze{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(dd(s))this.tags.push(s);else if(fd(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new uo(this,t,!1);return r.addAll(e,z.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new uo(this,t,!0);return r.addAll(e,z.none,t.from,t.to),v.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(md(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=fo(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=fo(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ze(e,Ze.schemaRules(e)))}}const ia={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},hd={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},oa={ol:!0,ul:!0},xn=1,Bs=2,cn=4;function co(n,e,t){return e!=null?(e?xn:0)|(e==="full"?Bs:0):n&&n.whitespace=="pre"?xn|Bs:t&~cn}class Bn{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=z.none,this.match=i||(o&cn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&xn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ia.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class uo{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=co(null,t.preserveWhitespace,0)|(r?cn:0);s?i=new Bn(s.type,s.attrs,z.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Bn(null,null,z.none,!0,null,o):i=new Bn(e.schema.topNodeType,null,z.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&Bs?"full":this.localPreserveWS||(s.options&xn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;oa.hasOwnProperty(o)&&this.parser.normalizeLists&&pd(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:hd.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(ia.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=z.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):ho(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=co(e,i,o.options);o.options&cn&&o.content.length==0&&(l|=cn);let a=z.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):ho(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Bn(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=xn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function pd(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&oa.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function md(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function fo(n){let e={};for(let t in n)e[t]=n[t];return e}function ho(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class At{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=as(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Kn(as(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Kn(as(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Kn(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new At(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=po(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return po(e.marks)}}function po(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function as(n){return n.document||window.document}const mo=new WeakMap;function gd(n){let e=mo.get(n);return e===void 0&&mo.set(n,e=yd(n)),e}function yd(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Kn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=gd(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Kn(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const la=65535,aa=Math.pow(2,16);function bd(n,e){return n+e*aa}function go(n){return n&la}function kd(n){return(n-(n&la))/aa}const ca=1,ua=2,Jn=4,da=8;class zs{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&da)>0}get deletedBefore(){return(this.delInfo&(ca|Jn))>0}get deletedAfter(){return(this.delInfo&(ua|Jn))>0}get deletedAcross(){return(this.delInfo&Jn)>0}}class fe{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&fe.empty)return fe.empty}recover(e){let t=0,r=go(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+kd(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:bd(l/3,e-a),m=e==a?ua:e==d?ca:Jn;return(t<0?e!=a:e!=d)&&(m|=da),new zs(h,m,p)}s+=u-c}return r?e+s:new zs(e+s,0,null)}touches(e,t){let r=0,s=go(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new fe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?fe.empty:new fe(e<0?[0,-e,0]:[0,0,e])}}fe.empty=new fe([]);class Sn{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Sn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new Sn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new zs(e,s,null)}}const cs=Object.create(null);class se{getMap(){return fe.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=cs[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in cs)throw new RangeError("Duplicate use of step JSON ID "+e);return cs[e]=t,t.prototype.jsonID=e,t}}class q{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new q(e,null)}static fail(e){return new q(null,e)}static fromReplace(e,t,r,s){try{return q.ok(e.replace(t,r,s))}catch(i){if(i instanceof Zn)return q.fail(i.message);throw i}}}function di(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(di(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return k.fromArray(r)}class Ge extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new v(di(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return q.fromReplace(e,this.from,this.to,i)}invert(){return new ve(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ge(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ge(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ge(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("addMark",Ge);class ve extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new v(di(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return q.fromReplace(e,this.from,this.to,r)}invert(){return new Ge(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ve(t.pos,r.pos,this.mark)}merge(e){return e instanceof ve&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ve(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ve(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("removeMark",ve);class Ye extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return q.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Ye(this.pos,t.marks[s]);return new Ye(this.pos,this.mark)}}return new Ct(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ye(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ye(t.pos,e.markFromJSON(t.mark))}}se.jsonID("addNodeMark",Ye);class Ct extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return q.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ye(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ct(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ct(t.pos,e.markFromJSON(t.mark))}}se.jsonID("removeNodeMark",Ct);class U extends se{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&$s(e,this.from,this.to)?q.fail("Structure replace would overwrite content"):q.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new fe([this.from,this.to-this.from,this.slice.size])}invert(e){return new U(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&U.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new U(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof U)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?v.empty:new v(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new U(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?v.empty:new v(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new U(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new U(t.from,t.to,v.fromJSON(e,t.slice),!!t.structure)}}U.MAP_BIAS=1;se.jsonID("replace",U);class Y extends se{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&($s(e,this.from,this.gapFrom)||$s(e,this.gapTo,this.to)))return q.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return q.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?q.fromReplace(e,this.from,this.to,r):q.fail("Content does not fit in gap")}getMap(){return new fe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Y(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new Y(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Y(t.from,t.to,t.gapFrom,t.gapTo,v.fromJSON(e,t.slice),t.insert,!!t.structure)}}se.jsonID("replaceAround",Y);function $s(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function xd(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[m])?o.to=h:s.push(o=new ve(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new Ge(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function Sd(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof jr){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new ve(o.from,o.to,o.style)))}function fi(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new U(l,u,v.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new ve(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new v(k.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new U(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);n.replace(l,l,new v(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function wd(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Yt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!wd(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Cd(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=k.empty,d=0;for(let p=i,m=!1;p>t;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)<s.end(p)?(m=!0,f=k.from(s.node(p).copy(f)),h++):c++;n.step(new Y(a,c,o,l,new v(u.append(f),d,h),u.size-d,!0))}function hi(n,e,t=null,r=n){let s=vd(n,e),i=s&&Ed(r,e);return i?s.map(yo).concat({type:e,attrs:t}).concat(i.map(yo)):null}function yo(n){return{type:n,attrs:null}}function vd(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Ed(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Td(n,e,t){let r=k.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new Y(s,i,s,i,new v(r,0,0),t.length,!0))}function Md(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&Ad(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&ha(n,o,l,i),fi(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new Y(d,f,d+1,f-1,new v(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&fa(n,o,l,i),!1}})}function fa(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function ha(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{e as b,c as w,j as a,l as j}from"./index-CiybtfLu.js";import{i as N}from"./SearchMd-B3lNgj0Q.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{e as b,c as w,j as a,l as j}from"./index-ChdATVAA.js";import{i as N}from"./SearchMd-BdcI0VcO.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{e as p,j as t,E as P,r as j,D as w,B as S,n as y}from"./index-CiybtfLu.js";import{i as k}from"./AlertCircle-BnqV2fhH.js";import{s as z}from"./Plus-BLTD9g1p.js";import{s as E}from"./User01-DpZZxZQw.js";import{t as F}from"./Users01-CTI49oYx.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-BSB689j7.js";import{I as N}from"./input-BIou7x1s.js";import{L as g}from"./label-BALZ87Ne.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-DyYLWAtt.js";import{S as H}from"./skeleton-C0n2MBSC.js";import{T as K}from"./textarea-CpqLWirc.js";import{P as b}from"./index-C6tCJ6iD.js";import{c as W}from"./settings-section-ByNQkiKy.js";import{u as Y,a as G}from"./use-secrets-ClIBWX3M.js";import{R as J}from"./require-capability-BJtu48OI.js";import"./X-gn1ly4Nc.js";import"./tooltip-BjyXwk4-.js";import"./Check-eh46ZGML.js";import"./ChevronDown-4LxQ5oPz.js";import"./ChevronUp-ATBl3MAi.js";import"./sidebar-CT4nDj9F.js";import"./LayoutLeft-DWk83m69.js";import"./sheet-CJSR0f_J.js";import"./card-DV27UhYe.js";import"./ArrowUpRight-DLu3LSuz.js";import"./studio-tools-ByWE0fVB.js";import"./use-capability-B0pYY0r2.js";import"./access-gate-DACRNgiY.js";import"./capability-load-error-C8q5gpVF.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
1
+ import{e as p,j as t,E as P,r as j,D as w,B as S,n as y}from"./index-ChdATVAA.js";import{i as k}from"./AlertCircle-BU9gj1Zb.js";import{s as z}from"./Plus-D-k489Hw.js";import{s as E}from"./User01-BtejVxVG.js";import{t as F}from"./Users01-Dy4pn4ki.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-pxIgcxdx.js";import{I as N}from"./input-BZ-4l6sv.js";import{L as g}from"./label-CGY9toLT.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-6yI1bUUl.js";import{S as H}from"./skeleton-DsBtdATm.js";import{T as K}from"./textarea-DbtEiAgf.js";import{P as b}from"./index-Dupl0DR-.js";import{c as W}from"./settings-section-BDeKU196.js";import{u as Y,a as G}from"./use-secrets-C-XHa3-0.js";import{R as J}from"./require-capability-D5XZoZnS.js";import"./X-DcDNiBgo.js";import"./tooltip-CVKtA6h7.js";import"./Check-BmF1hQRY.js";import"./ChevronDown-BIO7wba7.js";import"./ChevronUp-DdLEv_cl.js";import"./sidebar-ZxffB9i3.js";import"./LayoutLeft-C3u21iqS.js";import"./sheet-l2LhhOCY.js";import"./card-DV2a7ud0.js";import"./ArrowUpRight-D2O4sQl3.js";import"./studio-tools-tx_ynP6E.js";import"./use-capability-BekxNShN.js";import"./access-gate-B7iLwSTn.js";import"./capability-load-error-DGtjMdu6.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
@@ -1,2 +1,2 @@
1
- import{e as Oe,r as D,j as t,B as $e,l as qt,c as xe,F as ea,n as fe,K as ta}from"./index-CiybtfLu.js";import{t as Ln}from"./ChevronDown-4LxQ5oPz.js";import{i as na}from"./ChevronRight-CxxNo5xV.js";import{n as sa}from"./ChevronUp-ATBl3MAi.js";import{E as xt,v as Gt,K as In,g as kt,F as aa,G as oa}from"./agent-icon-CkXhv6DR.js";import{i as ra}from"./Globe01-B9VL3QNT.js";import{S as pt}from"./scroll-area-CUtpZ3i2.js";import{T as qe,a as Ge,b as Je}from"./tooltip-BjyXwk4-.js";import{c as zn,b as Bn,e as Fn,d as Kn,a as Hn,D as Un}from"./dialog-BSB689j7.js";import{I as Wn}from"./input-BIou7x1s.js";import{r as ia,i as bt,a as jn,P as la,S as ca,N as ua,l as We,c as da,G as ma,b as fa,d as St,u as pa,e as ha,f as ga,g as va,h as xa,j as ba,k as Sa,m as ya,n as ht,o as zt,p as ot,q as kn,s as wn,t as _a,v as Bt,w as ja,x as ka,y as wa,z as Na,A as Ca,B as Ta,C as Ra,D as Da,E as gt,F as Aa,H as Pa,I as Va,J as Ma,K as Ea,L as $a,M as Ft,O as Oa,Q as La,R as Ia,T as Kt,U as za,V as Ba,W as Nn}from"./index-Cb4WTt-q.js";import{a as Yn,s as Fa}from"./Eye-DVlN5jxk.js";import{d as Ka}from"./ZoomOut-BM2NUDgV.js";import{a as Ha}from"./RefreshCcw01-CXJQK3v9.js";import{s as yt}from"./Plus-BLTD9g1p.js";import{s as wt}from"./Trash01-mLRbM1z9.js";import{i as Ua}from"./Zap-DqD6AduN.js";import{a as Jt,c as Ye,b as Zt,D as Qt,g as Wa}from"./dropdown-menu-FYqDJehF.js";import{a as qn,b as _t,K as Gn,P as Jn,d as Zn,C as Qn,s as Xn,e as jt,D as es,c as ts,S as ns,v as Ya,f as ss,i as qa}from"./sortable.esm-BzXaOB_3.js";import{r as Ga,s as Ja,u as rt,S as Yt}from"./schema-form-MsvEbpzs.js";import{r as Cn,u as Za,d as Qa,a as Xa,i as eo,f as to,P as no,b as so,S as ao}from"./page-seo-form-DUSMHeEJ.js";import{c as oo,C as ro,e as Tn,d as io,a as lo,g as co}from"./command-D1SdiPwD.js";import{i as uo}from"./FilterLines-L07hHUB-.js";import{i as mo}from"./Tool01-DCdaNaEY.js";import{AddSectionModal as fo}from"./add-section-modal-C3xNe_xo.js";import{c as po}from"./save-referenced-block-CjAVAUIA.js";import"./AlertCircle-BnqV2fhH.js";import"./SwitchHorizontal01-C4dRfRR7.js";import"./XCircle-BGJwPzuZ.js";import"./ArrowUpRight-DLu3LSuz.js";import"./ZapSquare-B2POR1ZS.js";import"./Users03-CORMvH6Y.js";import"./CheckCircle-C0r3mBzW.js";import"./Check-eh46ZGML.js";import"./ChevronLeft-D0NHXMar.js";import"./DotsVertical-CNRvkzVu.js";import"./Container-CV0p7hHO.js";import"./Star01-D0denzoA.js";import"./Palette-IBuOwnrk.js";import"./HardDrive-COh7IrR0.js";import"./Stars02-DiuJq52q.js";import"./Key01-aulVwqL7.js";import"./LayoutLeft-DWk83m69.js";import"./LinkExternal01-D_x8dxjY.js";import"./Monitor01-2xEKWZVQ.js";import"./Sun-BQHzenzm.js";import"./Play-C1Dc-lf9.js";import"./SearchMd-B3lNgj0Q.js";import"./Settings02-BtL-CPg2.js";import"./Shield01-JtF9z5lI.js";import"./Stars01-b6QvFAbV.js";import"./Upload01-BP26EgoC.js";import"./User01-DpZZxZQw.js";import"./Users01-CTI49oYx.js";import"./XClose-BwlE-Nu8.js";import"./X-gn1ly4Nc.js";import"./select-DyYLWAtt.js";import"./agent-capabilities-Bm-PLFs1.js";import"./chat-context-B17fAiGJ.js";import"./tab-id-D6XV4CDL.js";import"./use-mcp-client-D1Wt1Ama.js";import"./auth-C28A30Tc.js";import"./watch-sse-pool-BSUvJM1x.js";import"./decopilot-sse-pool-DqoHsSxc.js";import"./use-virtual-mcp-BsZRrdSO.js";import"./use-collections-DJpkyqRG.js";import"./use-ai-providers-BJZDY8Y9.js";import"./use-organization-settings-9bjAS-Lz.js";import"./pair-lHmdq1Qv.js";import"./use-clock-tick-B7ba5G_w.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dp9AIDyE.js";import"./file-type-icon-Bw8qs6o2.js";import"./content-blocks-o63cs2vh.js";import"./types-CTAso5N_.js";import"./studio-tools-ByWE0fVB.js";import"./shell-layout-CvbgPIaO.js";import"./avatar-B_BYzpDz.js";import"./required-auth-layout-DI6zQAQY.js";import"./useRouterState-D6isJH0F.js";import"./use-org-sso-Dy5nNvp5.js";import"./integration-icon-BG6b6lUb.js";import"./use-navigate-to-agent-Df96tRB5.js";import"./use-connection-B5A06L65.js";import"./use-mcp-prompts-C3lAYJn0.js";import"./form-UO3a-lMt.js";import"./label-BALZ87Ne.js";import"./spinner-DBVYiKjc.js";import"./drawer-C82Ms0Cv.js";import"./collection-search-6oM8sAkn.js";import"./tabs-B4Xt74wj.js";import"./toggle-group-CUuptLSP.js";import"./connect-desktop-dialog-D-tmt4pE.js";import"./decopilot-D_s8NcrD.js";import"./checkbox-C8E6yiOS.js";import"./skeleton-C0n2MBSC.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ByNQkiKy.js";import"./card-DV27UhYe.js";import"./popover-DwdaLh0V.js";import"./useInfiniteQuery-CvW-Zfuj.js";import"./use-infinite-scroll-DUQ6svQh.js";import"./index-DEbs6yYd.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-BQKfSVKy.js";import"./sidebar-CT4nDj9F.js";import"./sheet-CJSR0f_J.js";import"./toolbar-Brcztx2Q.js";import"./use-create-virtual-mcp-DvFTy-qt.js";import"./github-repo-picker-FLFbegfT.js";import"./mcp-oauth-CJ3fuseB.js";import"./use-mcp-tools-B_6LkwOm.js";import"./extract-connection-data-CnLrafQF.js";import"./generate-id-CZUSC7-8.js";import"./collections-DFNd7jPX.js";import"./alert-dialog-ZJsAqfzl.js";import"./index-SkqPgX26.js";import"./use-org-auth-client-BafLVU4c.js";import"./hover-card-C3LYC-kn.js";import"./task-status-CizXRJxN.js";import"./use-status-sounds-DCDAeOy7.js";import"./empty-state-BxzxLrPP.js";import"./resizable-B2XskWDt.js";import"./use-capability-B0pYY0r2.js";import"./header-tab-button-BOKDj9bu.js";import"./index-BMLWSX3S.js";import"./textarea-CpqLWirc.js";import"./user-BLD1kA1s.js";import"./tools-list-DJunsBR9.js";import"./badge-BzbbNtAh.js";import"./connection-slug-eyAPH6o3.js";import"./switch-CFZgZOoT.js";import"./use-debounced-autosave-BYXOYkk-.js";import"./index-C6tCJ6iD.js";import"./search-input-D_Czo7sj.js";import"./collection-tabs-IWqiXV1e.js";import"./use-secrets-ClIBWX3M.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-DggLsDzc.js";import"./view-mode-toggle-C-NsBriE.js";import"./select-model-Bgdox0ak.js";import"./use-automations-Cmrz96gF.js";import"./monaco-editor-CLILoFVJ.js";import"./automation-runs-C1x-2avW.js";import"./table-DRy0atlv.js";import"./use-members-Ch8rP11v.js";import"./useSuspenseInfiniteQuery-DGYfhNPQ.js";import"./automation-list-row-BS580Xxk.js";import"./connection-card-DIcosm0X.js";import"./use-registry-connections-zD4mCaEh.js";import"./connection-form-helpers-ChlYhyg6.js";import"./calendar-CVM_PlWs.js";import"./image-field-B-axyZ2P.js";import"./use-file-configs-DZ1IbDAN.js";import"./index-B1OoDAS2.js";function ho(r){const e=Oe.c(38),{open:n,initialName:a,autoLabel:i,isPending:c,onSubmit:h,onOpenChange:f}=r,l=c===void 0?!1:c,[g,v]=D.useState(a),[b,S]=D.useState(n);n!==b&&(S(n),n&&v(a));let k;e[0]!==l||e[1]!==f?(k=$=>{!$&&!l&&f(!1)},e[0]=l,e[1]=f,e[2]=k):k=e[2];const u=k;let y;e[3]!==l||e[4]!==g||e[5]!==h?(y=async $=>{$.preventDefault(),!l&&await h(g.trim())},e[3]=l,e[4]=g,e[5]=h,e[6]=y):y=e[6];const m=y;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(zn,{children:"Rename variant"}),e[7]=A):A=e[7];const p=i||"the rule";let _;e[8]!==p?(_=t.jsxs(Bn,{children:[A,t.jsxs(Fn,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:p}),"."]})]}),e[8]=p,e[9]=_):_=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=N):N=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=$=>v($.target.value),e[11]=j):j=e[11];let C;e[12]!==i||e[13]!==l||e[14]!==g?(C=t.jsxs("div",{className:"space-y-1.5 py-4",children:[N,t.jsx(Wn,{id:"variant-rename-name",value:g,onChange:j,placeholder:i,autoFocus:!0,disabled:l})]}),e[12]=i,e[13]=l,e[14]=g,e[15]=C):C=e[15];let w;e[16]!==f?(w=()=>f(!1),e[16]=f,e[17]=w):w=e[17];let T;e[18]!==l||e[19]!==w?(T=t.jsx($e,{type:"button",variant:"outline",onClick:w,disabled:l,children:"Cancel"}),e[18]=l,e[19]=w,e[20]=T):T=e[20];let P;e[21]!==l?(P=l?t.jsxs(t.Fragment,{children:[t.jsx(qt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=l,e[22]=P):P=e[22];let V;e[23]!==l||e[24]!==P?(V=t.jsx($e,{type:"submit",disabled:l,children:P}),e[23]=l,e[24]=P,e[25]=V):V=e[25];let z;e[26]!==T||e[27]!==V?(z=t.jsxs(Kn,{children:[T,V]}),e[26]=T,e[27]=V,e[28]=z):z=e[28];let B;e[29]!==m||e[30]!==z||e[31]!==_||e[32]!==C?(B=t.jsx(Hn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:m,children:[_,C,z]})}),e[29]=m,e[30]=z,e[31]=_,e[32]=C,e[33]=B):B=e[33];let M;return e[34]!==u||e[35]!==n||e[36]!==B?(M=t.jsx(Un,{open:n,onOpenChange:u,children:B}),e[34]=u,e[35]=n,e[36]=B,e[37]=M):M=e[37],M}function Ht(r,e,n,a,i){const c={...r[e]};if(i.length>1){const h=c.sections,f=[...h?.variants??[]];f[a]&&(f[a]={...f[a],value:n}),c.sections={...h,variants:f}}else c.sections=n;return c}function go(r){return structuredClone(r)}function vo(r){return!r.isSavedBlock&&!r.isMultivariate&&!r.isHidden}function Rn(r){const e=r.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function Dn(r,e){const n=r.trim();return n?n.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,n)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(n)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}const xo="oklch(0.65 0.15 160)",bo="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)]",So="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)]",yo="text-[oklch(0.45_0.15_160)] focus:bg-[oklch(0.65_0.15_160/0.12)] focus:text-[oklch(0.45_0.15_160)] dark:text-[oklch(0.78_0.15_160)] dark:focus:bg-[oklch(0.65_0.15_160/0.15)] dark:focus:text-[oklch(0.78_0.15_160)]";function _o(r){const e=Oe.c(33),{variant:n,selected:a,canDelete:i,onSelect:c,onDuplicate:h,onDelete:f}=r;let l;e[0]!==c?(l=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),c())},e[0]=c,e[1]=l):l=e[1];const g=a?So:bo;let v;e[2]!==g?(v=xe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors cursor-pointer",g),e[2]=g,e[3]=v):v=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(xt,{className:"h-4 w-4 shrink-0",style:{color:xo}}),e[4]=b):b=e[4];let S;e[5]!==n.label?(S=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n.label}),e[5]=n.label,e[6]=S):S=e[6];const k=`Open actions for ${n.label}`;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Gt,{size:14}),e[7]=u):u=e[7];let y;e[8]!==k?(y=t.jsx(Jt,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":k,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:ko,onPointerDown:jo,children:u})}),e[8]=k,e[9]=y):y=e[9];let m;e[10]!==h?(m=V=>{V.stopPropagation(),h()},e[10]=h,e[11]=m):m=e[11];let A;e[12]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Yn,{size:14}),e[12]=A):A=e[12];let p;e[13]!==m?(p=t.jsxs(Ye,{onClick:m,children:[A,"Duplicate"]}),e[13]=m,e[14]=p):p=e[14];const _=!i;let N;e[15]!==f?(N=V=>{V.stopPropagation(),f()},e[15]=f,e[16]=N):N=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(wt,{size:14}),e[17]=j):j=e[17];let C;e[18]!==_||e[19]!==N?(C=t.jsxs(Ye,{variant:"destructive",disabled:_,onClick:N,children:[j,"Delete"]}),e[18]=_,e[19]=N,e[20]=C):C=e[20];let w;e[21]!==p||e[22]!==C?(w=t.jsxs(Zt,{align:"end",children:[p,C]}),e[21]=p,e[22]=C,e[23]=w):w=e[23];let T;e[24]!==w||e[25]!==y?(T=t.jsxs(Qt,{children:[y,w]}),e[24]=w,e[25]=y,e[26]=T):T=e[26];let P;return e[27]!==c||e[28]!==l||e[29]!==T||e[30]!==v||e[31]!==S?(P=t.jsxs("div",{role:"button",tabIndex:0,onClick:c,onKeyDown:l,className:v,children:[b,S,T]}),e[27]=c,e[28]=l,e[29]=T,e[30]=v,e[31]=S,e[32]=P):P=e[32],P}function jo(r){return r.stopPropagation()}function ko(r){return r.stopPropagation()}function wo(r){const e=Oe.c(34),{variants:n,selectedIndex:a,onSelect:i,onDuplicate:c,onDelete:h,onRemoveAll:f,onAdd:l}=r,g=n.length>1;let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[0]=v):v=e[0];let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(yt,{size:14}),e[1]=b):b=e[1];let S;e[2]!==l?(S=t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:l,children:b})}),e[2]=l,e[3]=S):S=e[3];let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{children:"Add variant"}),e[4]=k):k=e[4];let u;e[5]!==S?(u=t.jsxs(Je,{children:[S,k]}),e[5]=S,e[6]=u):u=e[6];let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(wt,{size:14}),e[7]=y):y=e[7];let m;e[8]!==f?(m=t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove all variants",className:"size-6 text-muted-foreground hover:text-destructive",onClick:f,children:y})}),e[8]=f,e[9]=m):m=e[9];let A;e[10]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ge,{children:"Remove all variants"}),e[10]=A):A=e[10];let p;e[11]!==m?(p=t.jsxs(Je,{children:[m,A]}),e[11]=m,e[12]=p):p=e[12];let _;e[13]!==u||e[14]!==p?(_=t.jsxs("div",{className:"flex items-center justify-between",children:[v,t.jsxs("div",{className:"flex items-center gap-0.5",children:[u,p]})]}),e[13]=u,e[14]=p,e[15]=_):_=e[15];let N;if(e[16]!==g||e[17]!==h||e[18]!==c||e[19]!==i||e[20]!==a||e[21]!==n){let w;e[23]!==g||e[24]!==h||e[25]!==c||e[26]!==i||e[27]!==a?(w=T=>t.jsx(_o,{variant:T,selected:T.index===a,canDelete:g,onSelect:()=>i(T.index),onDuplicate:()=>c(T.index),onDelete:()=>h(T.index)},`${T.label}-${T.index}`),e[23]=g,e[24]=h,e[25]=c,e[26]=i,e[27]=a,e[28]=w):w=e[28],N=n.map(w),e[16]=g,e[17]=h,e[18]=c,e[19]=i,e[20]=a,e[21]=n,e[22]=N}else N=e[22];let j;e[29]!==N?(j=t.jsx("div",{className:"space-y-0.5",children:N}),e[29]=N,e[30]=j):j=e[30];let C;return e[31]!==_||e[32]!==j?(C=t.jsxs("div",{className:"space-y-1 border-b p-2",children:[_,j]}),e[31]=_,e[32]=j,e[33]=C):C=e[33],C}function No(r){return r.schema?.definitions??r.schema?.$defs??{}}function Co(r,e){const n=No(e),a=n[btoa(r)];if(!a)return;let i=typeof a.image=="string"?a.image:void 0;if(!i&&Array.isArray(a.allOf)){const c=a.allOf.find(h=>typeof h.$ref=="string")?.$ref;if(typeof c=="string"){const h=c.replace("#/definitions/",""),f=n[h];i=typeof f?.image=="string"?f.image:void 0}}if(i?.includes("{{{"))return i}function To(r,e){if(!e)return;const n=ia(r);if(!n)return;const a=Co(n.resolveType,e);if(!a)return;const i=Ga(a,n.data);if(i)return Ja(i)}function vt(r,e){return r.map((n,a)=>{const i=n.__resolveType??"",c=bt(i);if(!c&&i!==""&&jn(i)&&i in e){const g=e[i],v=typeof g?.name=="string"&&g.name||i.replace(/[-_]/g," ").replace(/\b\w/g,b=>b.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:i,label:v,isLazy:!1,isSavedBlock:!0}}const h=c?n.section:void 0,f=c?h?.__resolveType??"":i;if(f===la||f===ca){const g=c?h:n,v=Array.isArray(g?.variants)?g.variants:[];if(v.length===1&&(v[0]?.rule?.__resolveType??"")===ua){const k=v[0]?.value??{};let u=k.__resolveType??"";const y=bt(u);return y&&(u=k.section?.__resolveType??u),{index:a,resolveType:i,label:We(u)||`Section ${a+1}`,isHidden:!0,isLazy:y}}const b=v[0]?.value?.__resolveType,S=b?We(b):"Section";return{index:a,resolveType:i,label:`Variants of ${S}`,isMultivariate:!0,isLazy:c}}const l=c?n.section?.__resolveType??i:i;if(c&&l!==""&&jn(l)&&l in e){const g=e[l],v=typeof g?.name=="string"&&g.name||l.replace(/[-_]/g," ").replace(/\b\w/g,b=>b.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:i,label:v,isLazy:!0,isSavedBlock:!0}}return{index:a,resolveType:i,label:We(l)||`Section ${a+1}`,isLazy:c}})}const Ro="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Do="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 An(r){return Array.from({length:r},(e,n)=>({id:crypto.randomUUID(),index:n}))}function as(r){return r.map((e,n)=>({...e,index:n}))}function Ao(r,e){if(e===r.length)return r;if(e<r.length)return as(r.slice(0,e));const n=Array.from({length:e-r.length},(a,i)=>({id:crypto.randomUUID(),index:r.length+i}));return[...r,...n]}function os(r){const e=Oe.c(20),{section:n,raw:a,meta:i}=r,c=n.isSavedBlock===!0,h=n.isMultivariate===!0;let f;e[0]!==i||e[1]!==a?(f=a&&i?To(a,i):void 0,e[0]=i,e[1]=a,e[2]=f):f=e[2];const l=f;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ka,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let v;e[4]!==l?(v=l&&t.jsx("img",{src:l,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=l,e[5]=v):v=e[5];let b;e[6]!==h||e[7]!==c?(b=c?{color:ma}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=h,e[7]=c,e[8]=b):b=e[8];let S;e[9]!==b?(S=t.jsx(xt,{className:"h-4 w-4 shrink-0",style:b}),e[9]=b,e[10]=S):S=e[10];const k=n.isHidden&&"line-through opacity-50";let u;e[11]!==k?(u=xe("min-w-0 flex-1 truncate text-sm font-medium",k),e[11]=k,e[12]=u):u=e[12];let y;e[13]!==n.label||e[14]!==u?(y=t.jsx("span",{className:u,children:n.label}),e[13]=n.label,e[14]=u,e[15]=y):y=e[15];let m;return e[16]!==v||e[17]!==S||e[18]!==y?(m=t.jsxs(t.Fragment,{children:[g,v,S,y]}),e[16]=v,e[17]=S,e[18]=y,e[19]=m):m=e[19],m}function rs(r,e){const n=r.isSavedBlock===!0,a=r.isMultivariate===!0;return xe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":n?Ro:a?"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 Po(r){const e=Oe.c(64),{section:n,raw:a,meta:i,sortableId:c,selected:h,onSelect:f,onDelete:l,onDuplicate:g,onMakeReusable:v,onToggleHidden:b,onToggleLazy:S,onAddVariant:k,onDetach:u}=r,y=a?bt(a.__resolveType??""):!1;let m;e[0]!==n?(m=da(n),e[0]=n,e[1]=m):m=e[1];const A=m;let p;e[2]!==c?(p={id:c,animateLayoutChanges:Oo},e[2]=c,e[3]=p):p=e[3];const{attributes:_,listeners:N,setNodeRef:j,transform:C,isDragging:w}=Zn(p);let T;e[4]!==C?(T=Qn.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=T):T=e[5];const P=w?0:void 0;let V;e[6]!==T||e[7]!==P?(V={transform:T,opacity:P},e[6]=T,e[7]=P,e[8]=V):V=e[8];const z=V;let B;e[9]!==n?(B=vo(n),e[9]=n,e[10]=B):B=e[10];const M=B,$="button",le=0;let ne;e[11]!==f?(ne=H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),f())},e[11]=f,e[12]=ne):ne=e[12];const L=w?"cursor-grabbing":"cursor-pointer";let ue;e[13]!==n||e[14]!==h||e[15]!==L?(ue=xe("touch-none transition-colors",L,rs(n,h)),e[13]=n,e[14]=h,e[15]=L,e[16]=ue):ue=e[16];let K;e[17]!==i||e[18]!==a||e[19]!==n?(K=t.jsx(os,{section:n,raw:a,meta:i}),e[17]=i,e[18]=a,e[19]=n,e[20]=K):K=e[20];const ae=!n.isMultivariate&&t.jsxs(Je,{children:[t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":y?"Disable async render":"Enable async render",className:xe("h-7 w-7 shrink-0",y?"":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),S()},onPointerDown:$o,children:t.jsx(Ua,{className:xe("h-3.5 w-3.5",y&&"text-yellow-500")})})}),t.jsx(Ge,{side:"bottom",children:y?"Disable async render":"Enable async render"})]});let oe;e[21]!==b||e[22]!==n.isHidden||e[23]!==n.isMultivariate?(oe=!n.isMultivariate&&t.jsxs(Je,{children:[t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":n.isHidden?"Show section":"Hide section",className:xe("h-7 w-7 shrink-0",n.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),b()},onPointerDown:Eo,children:n.isHidden?t.jsx(Ha,{className:"h-3.5 w-3.5"}):t.jsx(Fa,{className:"h-3.5 w-3.5"})})}),t.jsx(Ge,{side:"bottom",children:n.isHidden?"Show section":"Hide section"})]}),e[21]=b,e[22]=n.isHidden,e[23]=n.isMultivariate,e[24]=oe):oe=e[24];let pe;e[25]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(Jt,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Mo,onPointerDown:Vo,children:t.jsx(Gt,{className:"h-3.5 w-3.5"})})}),e[25]=pe):pe=e[25];let se;e[26]!==g?(se=H=>{H.stopPropagation(),g()},e[26]=g,e[27]=se):se=e[27];let Q;e[28]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(Yn,{className:"h-4 w-4"}),e[28]=Q):Q=e[28];let G;e[29]!==se?(G=t.jsxs(Ye,{onClick:se,children:[Q,"Duplicate"]}),e[29]=se,e[30]=G):G=e[30];let Y;e[31]!==A||e[32]!==k?(Y=A&&t.jsxs(Ye,{className:yo,onClick:H=>{H.stopPropagation(),k()},children:[t.jsx(In,{className:"h-4 w-4"}),"Add variant"]}),e[31]=A,e[32]=k,e[33]=Y):Y=e[33];let F;e[34]!==M||e[35]!==v?(F=M&&t.jsxs(Ye,{className:Do,onClick:H=>{H.stopPropagation(),v()},children:[t.jsx(xt,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=M,e[35]=v,e[36]=F):F=e[36];let X;e[37]!==u||e[38]!==n.isMultivariate||e[39]!==n.isSavedBlock?(X=n.isSavedBlock===!0&&!n.isMultivariate&&t.jsxs(Ye,{onClick:H=>{H.stopPropagation(),u()},children:[t.jsx(xt,{className:"h-4 w-4"}),"Detach"]}),e[37]=u,e[38]=n.isMultivariate,e[39]=n.isSavedBlock,e[40]=X):X=e[40];let de;e[41]!==l?(de=H=>{H.stopPropagation(),l()},e[41]=l,e[42]=de):de=e[42];let U;e[43]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(wt,{className:"h-4 w-4"}),e[43]=U):U=e[43];let re;e[44]!==de?(re=t.jsxs(Ye,{className:"text-destructive focus:text-destructive",onClick:de,children:[U,"Delete"]}),e[44]=de,e[45]=re):re=e[45];let ie;e[46]!==G||e[47]!==Y||e[48]!==F||e[49]!==X||e[50]!==re?(ie=t.jsxs(Qt,{children:[pe,t.jsxs(Zt,{align:"end",className:"w-44",children:[G,Y,F,X,re]})]}),e[46]=G,e[47]=Y,e[48]=F,e[49]=X,e[50]=re,e[51]=ie):ie=e[51];let he;return e[52]!==_||e[53]!==N||e[54]!==f||e[55]!==j||e[56]!==z||e[57]!==ue||e[58]!==K||e[59]!==ae||e[60]!==oe||e[61]!==ie||e[62]!==ne?(he=t.jsxs("div",{ref:j,style:z,..._,...N,role:$,tabIndex:le,onClick:f,onKeyDown:ne,className:ue,children:[K,ae,oe,ie]}),e[52]=_,e[53]=N,e[54]=f,e[55]=j,e[56]=z,e[57]=ue,e[58]=K,e[59]=ae,e[60]=oe,e[61]=ie,e[62]=ne,e[63]=he):he=e[63],he}function Vo(r){return r.stopPropagation()}function Mo(r){return r.stopPropagation()}function Eo(r){return r.stopPropagation()}function $o(r){return r.stopPropagation()}function Oo(){return!1}function Lo(r){const e=Oe.c(90),{listKey:n,rawSections:a,sections:i,meta:c,selectedIndex:h,onSelect:f,onReorder:l,onDelete:g,onDuplicate:v,onMakeReusable:b,onToggleHidden:S,onToggleLazy:k,onAddVariant:u,onDetach:y,onAddSection:m,canAddSection:A}=r,p=A===void 0?!0:A;let _;e[0]!==i.length?(_=()=>An(i.length),e[0]=i.length,e[1]=_):_=e[1];const[N,j]=D.useState(_),[C,w]=D.useState(null),[T,P]=D.useState(n),[V,z]=D.useState(i.length),B=D.useRef(!1);T!==n?(P(n),z(i.length),j(An(i.length))):V!==i.length&&(z(i.length),j(Z=>Ao(Z,i.length)));let M;e[2]===Symbol.for("react.memo_cache_sentinel")?(M={activationConstraint:{distance:8}},e[2]=M):M=e[2];let $;e[3]===Symbol.for("react.memo_cache_sentinel")?($={coordinateGetter:Xn},e[3]=$):$=e[3];const le=qn(_t(Jn,M),_t(Gn,$));let ne;e[4]!==N?(ne=N.map(Io),e[4]=N,e[5]=ne):ne=e[5];const L=ne;let ue;e[6]===Symbol.for("react.memo_cache_sentinel")?(ue=Z=>{w(String(Z.active.id))},e[6]=ue):ue=e[6];const K=ue;let ae;e[7]!==L||e[8]!==l?(ae=Z=>{w(null);const{active:W,over:Ne}=Z;if(!Ne||W.id===Ne.id)return;const Ke=L.indexOf(String(W.id)),Fe=L.indexOf(String(Ne.id));Ke===-1||Fe===-1||(j(Ze=>as(jt([...Ze],Ke,Fe))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),l?.(Ke,Fe))},e[7]=L,e[8]=l,e[9]=ae):ae=e[9];const oe=ae;let pe;e[10]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>{w(null)},e[10]=pe):pe=e[10];const se=pe;let Q,G,Y,F,X,de,U,re,ie,he,H,Ce,Te,Re,Ae;if(e[11]!==C||e[12]!==p||e[13]!==N||e[14]!==L||e[15]!==oe||e[16]!==c||e[17]!==m||e[18]!==u||e[19]!==g||e[20]!==y||e[21]!==v||e[22]!==b||e[23]!==f||e[24]!==S||e[25]!==k||e[26]!==a||e[27]!==i||e[28]!==h||e[29]!==le){Re=Symbol.for("react.early_return_sentinel");e:{const Z=W=>{B.current||f(W)};if(e[45]!==C||e[46]!==p||e[47]!==N||e[48]!==m||e[49]!==a||e[50]!==i){const W=C?N.find(Ne=>Ne.id===C):null;if(F=W!=null?i[W.index]:null,Y=W!=null?a[W.index]:void 0,N.length===0){let Ne;e[54]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Ne):Ne=e[54];const Ke=!p;let Fe;e[55]===Symbol.for("react.memo_cache_sentinel")?(Fe=t.jsx(yt,{size:14}),e[55]=Fe):Fe=e[55];let Ze;e[56]!==m||e[57]!==Ke?(Ze=t.jsxs("div",{className:"space-y-2",children:[Ne,t.jsxs($e,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ke,onClick:m,children:[Fe,"Add section"]})]}),e[56]=m,e[57]=Ke,e[58]=Ze):Ze=e[58],Re=Ze;break e}Te=xe(W&&"cursor-grabbing"),e[45]=C,e[46]=p,e[47]=N,e[48]=m,e[49]=a,e[50]=i,e[51]=Y,e[52]=F,e[53]=Te}else Y=e[51],F=e[52],Te=e[53];G=es,re=le,ie=ts,he=K,H=oe,Ce=se,Q=ns,de=L,U=Ya,Ae="space-y-1",X=N.map(W=>{const Ne=i[W.index];return Ne?t.jsx(Po,{sortableId:W.id,section:Ne,raw:a[W.index],meta:c,selected:h===W.index,onSelect:()=>Z(W.index),onDelete:()=>g(W.index),onDuplicate:()=>v(W.index),onMakeReusable:()=>b(W.index),onToggleHidden:()=>S(W.index),onToggleLazy:()=>k(W.index),onAddVariant:()=>u(W.index),onDetach:()=>y(W.index)},W.id):null})}e[11]=C,e[12]=p,e[13]=N,e[14]=L,e[15]=oe,e[16]=c,e[17]=m,e[18]=u,e[19]=g,e[20]=y,e[21]=v,e[22]=b,e[23]=f,e[24]=S,e[25]=k,e[26]=a,e[27]=i,e[28]=h,e[29]=le,e[30]=Q,e[31]=G,e[32]=Y,e[33]=F,e[34]=X,e[35]=de,e[36]=U,e[37]=re,e[38]=ie,e[39]=he,e[40]=H,e[41]=Ce,e[42]=Te,e[43]=Re,e[44]=Ae}else Q=e[30],G=e[31],Y=e[32],F=e[33],X=e[34],de=e[35],U=e[36],re=e[37],ie=e[38],he=e[39],H=e[40],Ce=e[41],Te=e[42],Re=e[43],Ae=e[44];if(Re!==Symbol.for("react.early_return_sentinel"))return Re;let be;e[59]!==X||e[60]!==Ae?(be=t.jsx("div",{className:Ae,children:X}),e[59]=X,e[60]=Ae,e[61]=be):be=e[61];let Le;e[62]!==Q||e[63]!==de||e[64]!==U||e[65]!==be?(Le=t.jsx(Q,{items:de,strategy:U,children:be}),e[62]=Q,e[63]=de,e[64]=U,e[65]=be,e[66]=Le):Le=e[66];let De;e[67]!==Y||e[68]!==F||e[69]!==c?(De=F?t.jsx("div",{className:xe("cursor-grabbing shadow-lg ring-1 ring-border/60",rs(F,!1)),children:t.jsx(os,{section:F,raw:Y,meta:c})}):null,e[67]=Y,e[68]=F,e[69]=c,e[70]=De):De=e[70];let Se;e[71]!==De?(Se=t.jsx(ss,{dropAnimation:null,children:De}),e[71]=De,e[72]=Se):Se=e[72];let me;e[73]!==G||e[74]!==re||e[75]!==ie||e[76]!==he||e[77]!==H||e[78]!==Ce||e[79]!==Le||e[80]!==Se?(me=t.jsxs(G,{sensors:re,collisionDetection:ie,onDragStart:he,onDragEnd:H,onDragCancel:Ce,children:[Le,Se]}),e[73]=G,e[74]=re,e[75]=ie,e[76]=he,e[77]=H,e[78]=Ce,e[79]=Le,e[80]=Se,e[81]=me):me=e[81];const Ie=!p;let ce;e[82]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx(yt,{size:14}),e[82]=ce):ce=e[82];let ye;e[83]!==m||e[84]!==Ie?(ye=t.jsxs($e,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ie,onClick:m,children:[ce,"Add section"]}),e[83]=m,e[84]=Ie,e[85]=ye):ye=e[85];let J;return e[86]!==Te||e[87]!==me||e[88]!==ye?(J=t.jsxs("div",{className:Te,children:[me,ye]}),e[86]=Te,e[87]=me,e[88]=ye,e[89]=J):J=e[89],J}function Io(r){return r.id}const zo=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],Bo={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Ut(r){return kt(r)!==void 0}function Xt(r,e){if(e){if(Ut(e))return e;const n=Bo[e];if(n&&Ut(n))return n}for(const[n,a]of zo)if(n.test(r)&&Ut(a))return a;return"FilterLines"}function Fo(r){return kt(r)??uo}function Pn(r){const e=Oe.c(11),{iconName:n,size:a,className:i}=r,c=a===void 0?"md":a;let h;e[0]!==n?(h=Fo(n),e[0]=n,e[1]=h):h=e[1];const f=h,l=c==="sm"?"size-7":"size-9",g=c==="sm"?16:18;let v;e[2]!==l||e[3]!==i?(v=xe("flex shrink-0 items-center justify-center rounded-full bg-muted",l,i),e[2]=l,e[3]=i,e[4]=v):v=e[4];let b;e[5]!==f||e[6]!==g?(b=t.jsx(f,{size:g,className:"text-muted-foreground"}),e[5]=f,e[6]=g,e[7]=b):b=e[7];let S;return e[8]!==v||e[9]!==b?(S=t.jsx("div",{className:v,children:b}),e[8]=v,e[9]=b,e[10]=S):S=e[10],S}const is="Users03";function Ko(r){const e=r.manifest?.blocks??{},n=[];for(const[a,i]of Object.entries(e))if(a.includes("matchers"))for(const c of Object.keys(i)){if(c.includes("always"))continue;const h=fa(c,r);n.push({resolveType:c,title:h.title??We(c),description:h.description,iconName:Xt(c,h.icon)})}return n}function Ho(r,e){if(!r)return is;const n=e.find(a=>a.resolveType===r);return n?n.iconName:Xt(r)}function Vn(r){const e=Oe.c(41),{currentRt:n,currentLabel:a,matchers:i,onSelect:c}=r,[h,f]=D.useState(!1);let l;if(e[0]!==n||e[1]!==i){const M=Ho(n,i);l=kt(M),e[0]=n,e[1]=i,e[2]=l}else l=e[2];const g=l;let v;e[3]!==c?(v=M=>{c(M),f(!1)},e[3]=c,e[4]=v):v=e[4];const b=v;let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=()=>f(!0),e[5]=S):S=e[5];let k;e[6]!==g?(k=g&&t.jsx(g,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=g,e[7]=k):k=e[7];let u;e[8]!==a?(u=t.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=u):u=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ln,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=y):y=e[10];let m;e[11]!==k||e[12]!==u?(m=t.jsxs("button",{type:"button",onClick:S,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[k,u,y]}),e[11]=k,e[12]=u,e[13]=m):m=e[13];let A;e[14]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(oo,{placeholder:"Search rules..."}),e[14]=A):A=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ro,{children:"No rules found."}),e[15]=p):p=e[15];let _;e[16]!==b?(_=()=>b(""),e[16]=b,e[17]=_):_=e[17];const N=!n&&"bg-accent/60";let j;e[18]!==N?(j=xe("gap-2.5",N),e[18]=N,e[19]=j):j=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Pn,{iconName:is,size:"sm"}),e[20]=C):C=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:"Always"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=w):w=e[21];let T;e[22]!==_||e[23]!==j?(T=t.jsxs(Tn,{value:"always Target all users",onSelect:_,className:j,children:[C,w]}),e[22]=_,e[23]=j,e[24]=T):T=e[24];let P;if(e[25]!==n||e[26]!==b||e[27]!==i){let M;e[29]!==n||e[30]!==b?(M=$=>t.jsxs(Tn,{value:`${$.title} ${$.resolveType} ${$.description??""}`,onSelect:()=>b($.resolveType),className:xe("gap-2.5",n===$.resolveType&&"bg-accent/60"),children:[t.jsx(Pn,{iconName:$.iconName,size:"sm"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:$.title}),$.description&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:$.description})]})]},$.resolveType),e[29]=n,e[30]=b,e[31]=M):M=e[31],P=i.map(M),e[25]=n,e[26]=b,e[27]=i,e[28]=P}else P=e[28];let V;e[32]!==T||e[33]!==P?(V=t.jsxs(io,{children:[p,t.jsxs(lo,{children:[T,P]})]}),e[32]=T,e[33]=P,e[34]=V):V=e[34];let z;e[35]!==h||e[36]!==V?(z=t.jsxs(co,{open:h,onOpenChange:f,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[A,V]}),e[35]=h,e[36]=V,e[37]=z):z=e[37];let B;return e[38]!==z||e[39]!==m?(B=t.jsxs(t.Fragment,{children:[m,z]}),e[38]=z,e[39]=m,e[40]=B):B=e[40],B}const Uo="oklch(0.65 0.15 160)",ls="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 en(r){const e=Oe.c(5),{rule:n,matchers:a}=r,i=n?.__resolveType??"";let c;if(e[0]!==a||e[1]!==i){const g=a.find(v=>v.resolveType===i)?.iconName??Xt(i);c=kt(g),e[0]=a,e[1]=i,e[2]=c}else c=e[2];const h=c;if(!h)return null;let f;return e[3]!==h?(f=t.jsx(h,{size:14,className:"shrink-0"}),e[3]=h,e[4]=f):f=e[4],f}function Mn(r){return r.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
1
+ import{e as Oe,r as D,j as t,B as $e,l as qt,c as xe,F as ea,n as fe,K as ta}from"./index-ChdATVAA.js";import{t as Ln}from"./ChevronDown-BIO7wba7.js";import{i as na}from"./ChevronRight-CwhL8zaw.js";import{n as sa}from"./ChevronUp-DdLEv_cl.js";import{E as xt,v as Gt,K as In,g as kt,F as aa,G as oa}from"./agent-icon-MPxc_53p.js";import{i as ra}from"./Globe01-DF9PUq9k.js";import{S as pt}from"./scroll-area-DKNnXldV.js";import{T as qe,a as Ge,b as Je}from"./tooltip-CVKtA6h7.js";import{c as zn,b as Bn,e as Fn,d as Kn,a as Hn,D as Un}from"./dialog-pxIgcxdx.js";import{I as Wn}from"./input-BZ-4l6sv.js";import{r as ia,i as bt,a as jn,P as la,S as ca,N as ua,l as We,c as da,G as ma,b as fa,d as St,u as pa,e as ha,f as ga,g as va,h as xa,j as ba,k as Sa,m as ya,n as ht,o as zt,p as ot,q as kn,s as wn,t as _a,v as Bt,w as ja,x as ka,y as wa,z as Na,A as Ca,B as Ta,C as Ra,D as Da,E as gt,F as Aa,H as Pa,I as Va,J as Ma,K as Ea,L as $a,M as Ft,O as Oa,Q as La,R as Ia,T as Kt,U as za,V as Ba,W as Nn}from"./index-C8saI2Kn.js";import{a as Yn,s as Fa}from"./Eye-Bi1ejTfS.js";import{d as Ka}from"./ZoomOut-m5WCE6Ow.js";import{a as Ha}from"./RefreshCcw01-0Z7TeT1O.js";import{s as yt}from"./Plus-D-k489Hw.js";import{s as wt}from"./Trash01-Br13J6pg.js";import{i as Ua}from"./Zap-Cp6OTaVi.js";import{a as Jt,c as Ye,b as Zt,D as Qt,g as Wa}from"./dropdown-menu-BS4mK__m.js";import{a as qn,b as _t,K as Gn,P as Jn,d as Zn,C as Qn,s as Xn,e as jt,D as es,c as ts,S as ns,v as Ya,f as ss,i as qa}from"./sortable.esm-B7SCN4Iq.js";import{r as Ga,s as Ja,u as rt,S as Yt}from"./schema-form-D3MP878L.js";import{r as Cn,u as Za,d as Qa,a as Xa,i as eo,f as to,P as no,b as so,S as ao}from"./page-seo-form-DJemjXau.js";import{c as oo,C as ro,e as Tn,d as io,a as lo,g as co}from"./command--rBvALtU.js";import{i as uo}from"./FilterLines-jWyOgIfr.js";import{i as mo}from"./Tool01-yFL5Dn59.js";import{AddSectionModal as fo}from"./add-section-modal-CRDse3LE.js";import{c as po}from"./save-referenced-block-VHJ6rXLi.js";import"./AlertCircle-BU9gj1Zb.js";import"./SwitchHorizontal01-BRvArA9H.js";import"./XCircle-e29W-Gcn.js";import"./ArrowUpRight-D2O4sQl3.js";import"./ZapSquare-CvMxvmoA.js";import"./Users03-CmfKEZdY.js";import"./CheckCircle-C4XwcfjN.js";import"./Check-BmF1hQRY.js";import"./ChevronLeft-CW2G6JyB.js";import"./DotsVertical-DQMFAww2.js";import"./Container-Dyf0TzBH.js";import"./Star01-Du_V1z61.js";import"./Palette-CvjTgNao.js";import"./HardDrive-BIzpSh2R.js";import"./Stars02-CpPe-VPg.js";import"./Key01-DJaxTkjl.js";import"./LayoutLeft-C3u21iqS.js";import"./LinkExternal01-D7mXn_q6.js";import"./Monitor01-B2V0QJVA.js";import"./Sun-C3Zhz8pG.js";import"./Play-6yxi-kVu.js";import"./SearchMd-BdcI0VcO.js";import"./Settings02-C6hr8Qy9.js";import"./Shield01-DOB3vgca.js";import"./Stars01-BAC8f8eM.js";import"./Upload01-D4q_2hTt.js";import"./User01-BtejVxVG.js";import"./Users01-Dy4pn4ki.js";import"./XClose-D4RzaaY5.js";import"./X-DcDNiBgo.js";import"./select-6yI1bUUl.js";import"./agent-capabilities--0Cd735F.js";import"./chat-context-CQJ83DKW.js";import"./tab-id-CGE8BPr3.js";import"./use-mcp-client-DjqC1nd8.js";import"./auth-Rhn0UUKX.js";import"./watch-sse-pool-C_YrQqjE.js";import"./decopilot-sse-pool-CKBDifRl.js";import"./use-virtual-mcp-BldCtSoA.js";import"./use-collections-DYulUuYs.js";import"./use-ai-providers-Bf7NstiT.js";import"./use-organization-settings-BWseGhxw.js";import"./pair-BriGg-MY.js";import"./use-clock-tick-CQKT35Lf.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BhHE-xFV.js";import"./file-type-icon-B3ZaCMP2.js";import"./content-blocks-o63cs2vh.js";import"./types-Bik0zSxz.js";import"./studio-tools-tx_ynP6E.js";import"./shell-layout-DSzgNlpN.js";import"./avatar-DgWkRz32.js";import"./required-auth-layout-DhqvkBI0.js";import"./useRouterState-BZKGSD2r.js";import"./use-org-sso-mx87uCVa.js";import"./integration-icon-LHjd4NGc.js";import"./use-navigate-to-agent-B7_UOyHZ.js";import"./use-connection-DpR6JQF5.js";import"./use-mcp-prompts-Drzzskll.js";import"./form-DsGRrH4I.js";import"./label-CGY9toLT.js";import"./spinner-DynhmXJb.js";import"./drawer-BrCENAAY.js";import"./collection-search-q3LrsDP0.js";import"./tabs-B9aEuz_5.js";import"./toggle-group-BCauVBxS.js";import"./connect-desktop-dialog-CkEEvZPz.js";import"./decopilot-DxHNnnUA.js";import"./checkbox-Eb0jgSAR.js";import"./skeleton-DsBtdATm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BDeKU196.js";import"./card-DV2a7ud0.js";import"./popover-hHdVOt7q.js";import"./useInfiniteQuery-aPUoKLwo.js";import"./use-infinite-scroll-BfpP7RsP.js";import"./index-BMSOEHke.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-D-NySFQN.js";import"./sidebar-ZxffB9i3.js";import"./sheet-l2LhhOCY.js";import"./toolbar-C9WpnxRP.js";import"./use-create-virtual-mcp-ZidK7zTv.js";import"./github-repo-picker-BciViNc8.js";import"./mcp-oauth-BeZ96noC.js";import"./use-mcp-tools-BUMls37h.js";import"./extract-connection-data-16MvAzOh.js";import"./generate-id-B0UU4AyI.js";import"./collections-DjlDVd1Q.js";import"./alert-dialog-DAZnJbEa.js";import"./index-xNHaP-xT.js";import"./use-org-auth-client-BrG8JDW1.js";import"./hover-card-DfhDOin0.js";import"./task-status-BgRp2OfZ.js";import"./use-status-sounds-D1fVHGXs.js";import"./empty-state-vCEwHb1v.js";import"./resizable-BRT-qUaD.js";import"./use-capability-BekxNShN.js";import"./header-tab-button-elaOU0d9.js";import"./index-DLRMbGKZ.js";import"./textarea-DbtEiAgf.js";import"./user-Coe1o0e6.js";import"./tools-list-C-j8gu56.js";import"./badge-Ckvq5EMT.js";import"./connection-slug-eyAPH6o3.js";import"./switch-DWpVVt2b.js";import"./use-debounced-autosave-2ixaaEOx.js";import"./index-Dupl0DR-.js";import"./search-input-BQKJCNNI.js";import"./collection-tabs-CvaARsvN.js";import"./use-secrets-C-XHa3-0.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-DyJkloNK.js";import"./view-mode-toggle-GEdPTd_M.js";import"./select-model-z3ovXylT.js";import"./use-automations-DQhoL7n_.js";import"./monaco-editor-C8DVCvK_.js";import"./automation-runs-CfLYge75.js";import"./table-1jrYsVvf.js";import"./use-members-BiyrTP5I.js";import"./useSuspenseInfiniteQuery-CuHxM8XU.js";import"./automation-list-row-BkqsYOIc.js";import"./connection-card-DqPMpeMB.js";import"./use-registry-connections-BFZcaU10.js";import"./connection-form-helpers-B6xP1FXS.js";import"./calendar-C4NMm-GW.js";import"./image-field-BIrSC9Gs.js";import"./use-file-configs-CvNjCdnD.js";import"./index-BKFf6V9A.js";function ho(r){const e=Oe.c(38),{open:n,initialName:a,autoLabel:i,isPending:c,onSubmit:h,onOpenChange:f}=r,l=c===void 0?!1:c,[g,v]=D.useState(a),[b,S]=D.useState(n);n!==b&&(S(n),n&&v(a));let k;e[0]!==l||e[1]!==f?(k=$=>{!$&&!l&&f(!1)},e[0]=l,e[1]=f,e[2]=k):k=e[2];const u=k;let y;e[3]!==l||e[4]!==g||e[5]!==h?(y=async $=>{$.preventDefault(),!l&&await h(g.trim())},e[3]=l,e[4]=g,e[5]=h,e[6]=y):y=e[6];const m=y;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(zn,{children:"Rename variant"}),e[7]=A):A=e[7];const p=i||"the rule";let _;e[8]!==p?(_=t.jsxs(Bn,{children:[A,t.jsxs(Fn,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:p}),"."]})]}),e[8]=p,e[9]=_):_=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=N):N=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=$=>v($.target.value),e[11]=j):j=e[11];let C;e[12]!==i||e[13]!==l||e[14]!==g?(C=t.jsxs("div",{className:"space-y-1.5 py-4",children:[N,t.jsx(Wn,{id:"variant-rename-name",value:g,onChange:j,placeholder:i,autoFocus:!0,disabled:l})]}),e[12]=i,e[13]=l,e[14]=g,e[15]=C):C=e[15];let w;e[16]!==f?(w=()=>f(!1),e[16]=f,e[17]=w):w=e[17];let T;e[18]!==l||e[19]!==w?(T=t.jsx($e,{type:"button",variant:"outline",onClick:w,disabled:l,children:"Cancel"}),e[18]=l,e[19]=w,e[20]=T):T=e[20];let P;e[21]!==l?(P=l?t.jsxs(t.Fragment,{children:[t.jsx(qt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=l,e[22]=P):P=e[22];let V;e[23]!==l||e[24]!==P?(V=t.jsx($e,{type:"submit",disabled:l,children:P}),e[23]=l,e[24]=P,e[25]=V):V=e[25];let z;e[26]!==T||e[27]!==V?(z=t.jsxs(Kn,{children:[T,V]}),e[26]=T,e[27]=V,e[28]=z):z=e[28];let B;e[29]!==m||e[30]!==z||e[31]!==_||e[32]!==C?(B=t.jsx(Hn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:m,children:[_,C,z]})}),e[29]=m,e[30]=z,e[31]=_,e[32]=C,e[33]=B):B=e[33];let M;return e[34]!==u||e[35]!==n||e[36]!==B?(M=t.jsx(Un,{open:n,onOpenChange:u,children:B}),e[34]=u,e[35]=n,e[36]=B,e[37]=M):M=e[37],M}function Ht(r,e,n,a,i){const c={...r[e]};if(i.length>1){const h=c.sections,f=[...h?.variants??[]];f[a]&&(f[a]={...f[a],value:n}),c.sections={...h,variants:f}}else c.sections=n;return c}function go(r){return structuredClone(r)}function vo(r){return!r.isSavedBlock&&!r.isMultivariate&&!r.isHidden}function Rn(r){const e=r.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function Dn(r,e){const n=r.trim();return n?n.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,n)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(n)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}const xo="oklch(0.65 0.15 160)",bo="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)]",So="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)]",yo="text-[oklch(0.45_0.15_160)] focus:bg-[oklch(0.65_0.15_160/0.12)] focus:text-[oklch(0.45_0.15_160)] dark:text-[oklch(0.78_0.15_160)] dark:focus:bg-[oklch(0.65_0.15_160/0.15)] dark:focus:text-[oklch(0.78_0.15_160)]";function _o(r){const e=Oe.c(33),{variant:n,selected:a,canDelete:i,onSelect:c,onDuplicate:h,onDelete:f}=r;let l;e[0]!==c?(l=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),c())},e[0]=c,e[1]=l):l=e[1];const g=a?So:bo;let v;e[2]!==g?(v=xe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors cursor-pointer",g),e[2]=g,e[3]=v):v=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(xt,{className:"h-4 w-4 shrink-0",style:{color:xo}}),e[4]=b):b=e[4];let S;e[5]!==n.label?(S=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n.label}),e[5]=n.label,e[6]=S):S=e[6];const k=`Open actions for ${n.label}`;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Gt,{size:14}),e[7]=u):u=e[7];let y;e[8]!==k?(y=t.jsx(Jt,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":k,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:ko,onPointerDown:jo,children:u})}),e[8]=k,e[9]=y):y=e[9];let m;e[10]!==h?(m=V=>{V.stopPropagation(),h()},e[10]=h,e[11]=m):m=e[11];let A;e[12]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Yn,{size:14}),e[12]=A):A=e[12];let p;e[13]!==m?(p=t.jsxs(Ye,{onClick:m,children:[A,"Duplicate"]}),e[13]=m,e[14]=p):p=e[14];const _=!i;let N;e[15]!==f?(N=V=>{V.stopPropagation(),f()},e[15]=f,e[16]=N):N=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(wt,{size:14}),e[17]=j):j=e[17];let C;e[18]!==_||e[19]!==N?(C=t.jsxs(Ye,{variant:"destructive",disabled:_,onClick:N,children:[j,"Delete"]}),e[18]=_,e[19]=N,e[20]=C):C=e[20];let w;e[21]!==p||e[22]!==C?(w=t.jsxs(Zt,{align:"end",children:[p,C]}),e[21]=p,e[22]=C,e[23]=w):w=e[23];let T;e[24]!==w||e[25]!==y?(T=t.jsxs(Qt,{children:[y,w]}),e[24]=w,e[25]=y,e[26]=T):T=e[26];let P;return e[27]!==c||e[28]!==l||e[29]!==T||e[30]!==v||e[31]!==S?(P=t.jsxs("div",{role:"button",tabIndex:0,onClick:c,onKeyDown:l,className:v,children:[b,S,T]}),e[27]=c,e[28]=l,e[29]=T,e[30]=v,e[31]=S,e[32]=P):P=e[32],P}function jo(r){return r.stopPropagation()}function ko(r){return r.stopPropagation()}function wo(r){const e=Oe.c(34),{variants:n,selectedIndex:a,onSelect:i,onDuplicate:c,onDelete:h,onRemoveAll:f,onAdd:l}=r,g=n.length>1;let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[0]=v):v=e[0];let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(yt,{size:14}),e[1]=b):b=e[1];let S;e[2]!==l?(S=t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:l,children:b})}),e[2]=l,e[3]=S):S=e[3];let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{children:"Add variant"}),e[4]=k):k=e[4];let u;e[5]!==S?(u=t.jsxs(Je,{children:[S,k]}),e[5]=S,e[6]=u):u=e[6];let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(wt,{size:14}),e[7]=y):y=e[7];let m;e[8]!==f?(m=t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove all variants",className:"size-6 text-muted-foreground hover:text-destructive",onClick:f,children:y})}),e[8]=f,e[9]=m):m=e[9];let A;e[10]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ge,{children:"Remove all variants"}),e[10]=A):A=e[10];let p;e[11]!==m?(p=t.jsxs(Je,{children:[m,A]}),e[11]=m,e[12]=p):p=e[12];let _;e[13]!==u||e[14]!==p?(_=t.jsxs("div",{className:"flex items-center justify-between",children:[v,t.jsxs("div",{className:"flex items-center gap-0.5",children:[u,p]})]}),e[13]=u,e[14]=p,e[15]=_):_=e[15];let N;if(e[16]!==g||e[17]!==h||e[18]!==c||e[19]!==i||e[20]!==a||e[21]!==n){let w;e[23]!==g||e[24]!==h||e[25]!==c||e[26]!==i||e[27]!==a?(w=T=>t.jsx(_o,{variant:T,selected:T.index===a,canDelete:g,onSelect:()=>i(T.index),onDuplicate:()=>c(T.index),onDelete:()=>h(T.index)},`${T.label}-${T.index}`),e[23]=g,e[24]=h,e[25]=c,e[26]=i,e[27]=a,e[28]=w):w=e[28],N=n.map(w),e[16]=g,e[17]=h,e[18]=c,e[19]=i,e[20]=a,e[21]=n,e[22]=N}else N=e[22];let j;e[29]!==N?(j=t.jsx("div",{className:"space-y-0.5",children:N}),e[29]=N,e[30]=j):j=e[30];let C;return e[31]!==_||e[32]!==j?(C=t.jsxs("div",{className:"space-y-1 border-b p-2",children:[_,j]}),e[31]=_,e[32]=j,e[33]=C):C=e[33],C}function No(r){return r.schema?.definitions??r.schema?.$defs??{}}function Co(r,e){const n=No(e),a=n[btoa(r)];if(!a)return;let i=typeof a.image=="string"?a.image:void 0;if(!i&&Array.isArray(a.allOf)){const c=a.allOf.find(h=>typeof h.$ref=="string")?.$ref;if(typeof c=="string"){const h=c.replace("#/definitions/",""),f=n[h];i=typeof f?.image=="string"?f.image:void 0}}if(i?.includes("{{{"))return i}function To(r,e){if(!e)return;const n=ia(r);if(!n)return;const a=Co(n.resolveType,e);if(!a)return;const i=Ga(a,n.data);if(i)return Ja(i)}function vt(r,e){return r.map((n,a)=>{const i=n.__resolveType??"",c=bt(i);if(!c&&i!==""&&jn(i)&&i in e){const g=e[i],v=typeof g?.name=="string"&&g.name||i.replace(/[-_]/g," ").replace(/\b\w/g,b=>b.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:i,label:v,isLazy:!1,isSavedBlock:!0}}const h=c?n.section:void 0,f=c?h?.__resolveType??"":i;if(f===la||f===ca){const g=c?h:n,v=Array.isArray(g?.variants)?g.variants:[];if(v.length===1&&(v[0]?.rule?.__resolveType??"")===ua){const k=v[0]?.value??{};let u=k.__resolveType??"";const y=bt(u);return y&&(u=k.section?.__resolveType??u),{index:a,resolveType:i,label:We(u)||`Section ${a+1}`,isHidden:!0,isLazy:y}}const b=v[0]?.value?.__resolveType,S=b?We(b):"Section";return{index:a,resolveType:i,label:`Variants of ${S}`,isMultivariate:!0,isLazy:c}}const l=c?n.section?.__resolveType??i:i;if(c&&l!==""&&jn(l)&&l in e){const g=e[l],v=typeof g?.name=="string"&&g.name||l.replace(/[-_]/g," ").replace(/\b\w/g,b=>b.toUpperCase())||`Section ${a+1}`;return{index:a,resolveType:i,label:v,isLazy:!0,isSavedBlock:!0}}return{index:a,resolveType:i,label:We(l)||`Section ${a+1}`,isLazy:c}})}const Ro="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Do="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 An(r){return Array.from({length:r},(e,n)=>({id:crypto.randomUUID(),index:n}))}function as(r){return r.map((e,n)=>({...e,index:n}))}function Ao(r,e){if(e===r.length)return r;if(e<r.length)return as(r.slice(0,e));const n=Array.from({length:e-r.length},(a,i)=>({id:crypto.randomUUID(),index:r.length+i}));return[...r,...n]}function os(r){const e=Oe.c(20),{section:n,raw:a,meta:i}=r,c=n.isSavedBlock===!0,h=n.isMultivariate===!0;let f;e[0]!==i||e[1]!==a?(f=a&&i?To(a,i):void 0,e[0]=i,e[1]=a,e[2]=f):f=e[2];const l=f;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ka,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let v;e[4]!==l?(v=l&&t.jsx("img",{src:l,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=l,e[5]=v):v=e[5];let b;e[6]!==h||e[7]!==c?(b=c?{color:ma}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=h,e[7]=c,e[8]=b):b=e[8];let S;e[9]!==b?(S=t.jsx(xt,{className:"h-4 w-4 shrink-0",style:b}),e[9]=b,e[10]=S):S=e[10];const k=n.isHidden&&"line-through opacity-50";let u;e[11]!==k?(u=xe("min-w-0 flex-1 truncate text-sm font-medium",k),e[11]=k,e[12]=u):u=e[12];let y;e[13]!==n.label||e[14]!==u?(y=t.jsx("span",{className:u,children:n.label}),e[13]=n.label,e[14]=u,e[15]=y):y=e[15];let m;return e[16]!==v||e[17]!==S||e[18]!==y?(m=t.jsxs(t.Fragment,{children:[g,v,S,y]}),e[16]=v,e[17]=S,e[18]=y,e[19]=m):m=e[19],m}function rs(r,e){const n=r.isSavedBlock===!0,a=r.isMultivariate===!0;return xe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":n?Ro:a?"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 Po(r){const e=Oe.c(64),{section:n,raw:a,meta:i,sortableId:c,selected:h,onSelect:f,onDelete:l,onDuplicate:g,onMakeReusable:v,onToggleHidden:b,onToggleLazy:S,onAddVariant:k,onDetach:u}=r,y=a?bt(a.__resolveType??""):!1;let m;e[0]!==n?(m=da(n),e[0]=n,e[1]=m):m=e[1];const A=m;let p;e[2]!==c?(p={id:c,animateLayoutChanges:Oo},e[2]=c,e[3]=p):p=e[3];const{attributes:_,listeners:N,setNodeRef:j,transform:C,isDragging:w}=Zn(p);let T;e[4]!==C?(T=Qn.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=T):T=e[5];const P=w?0:void 0;let V;e[6]!==T||e[7]!==P?(V={transform:T,opacity:P},e[6]=T,e[7]=P,e[8]=V):V=e[8];const z=V;let B;e[9]!==n?(B=vo(n),e[9]=n,e[10]=B):B=e[10];const M=B,$="button",le=0;let ne;e[11]!==f?(ne=H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),f())},e[11]=f,e[12]=ne):ne=e[12];const L=w?"cursor-grabbing":"cursor-pointer";let ue;e[13]!==n||e[14]!==h||e[15]!==L?(ue=xe("touch-none transition-colors",L,rs(n,h)),e[13]=n,e[14]=h,e[15]=L,e[16]=ue):ue=e[16];let K;e[17]!==i||e[18]!==a||e[19]!==n?(K=t.jsx(os,{section:n,raw:a,meta:i}),e[17]=i,e[18]=a,e[19]=n,e[20]=K):K=e[20];const ae=!n.isMultivariate&&t.jsxs(Je,{children:[t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":y?"Disable async render":"Enable async render",className:xe("h-7 w-7 shrink-0",y?"":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),S()},onPointerDown:$o,children:t.jsx(Ua,{className:xe("h-3.5 w-3.5",y&&"text-yellow-500")})})}),t.jsx(Ge,{side:"bottom",children:y?"Disable async render":"Enable async render"})]});let oe;e[21]!==b||e[22]!==n.isHidden||e[23]!==n.isMultivariate?(oe=!n.isMultivariate&&t.jsxs(Je,{children:[t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":n.isHidden?"Show section":"Hide section",className:xe("h-7 w-7 shrink-0",n.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),b()},onPointerDown:Eo,children:n.isHidden?t.jsx(Ha,{className:"h-3.5 w-3.5"}):t.jsx(Fa,{className:"h-3.5 w-3.5"})})}),t.jsx(Ge,{side:"bottom",children:n.isHidden?"Show section":"Hide section"})]}),e[21]=b,e[22]=n.isHidden,e[23]=n.isMultivariate,e[24]=oe):oe=e[24];let pe;e[25]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(Jt,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Mo,onPointerDown:Vo,children:t.jsx(Gt,{className:"h-3.5 w-3.5"})})}),e[25]=pe):pe=e[25];let se;e[26]!==g?(se=H=>{H.stopPropagation(),g()},e[26]=g,e[27]=se):se=e[27];let Q;e[28]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(Yn,{className:"h-4 w-4"}),e[28]=Q):Q=e[28];let G;e[29]!==se?(G=t.jsxs(Ye,{onClick:se,children:[Q,"Duplicate"]}),e[29]=se,e[30]=G):G=e[30];let Y;e[31]!==A||e[32]!==k?(Y=A&&t.jsxs(Ye,{className:yo,onClick:H=>{H.stopPropagation(),k()},children:[t.jsx(In,{className:"h-4 w-4"}),"Add variant"]}),e[31]=A,e[32]=k,e[33]=Y):Y=e[33];let F;e[34]!==M||e[35]!==v?(F=M&&t.jsxs(Ye,{className:Do,onClick:H=>{H.stopPropagation(),v()},children:[t.jsx(xt,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=M,e[35]=v,e[36]=F):F=e[36];let X;e[37]!==u||e[38]!==n.isMultivariate||e[39]!==n.isSavedBlock?(X=n.isSavedBlock===!0&&!n.isMultivariate&&t.jsxs(Ye,{onClick:H=>{H.stopPropagation(),u()},children:[t.jsx(xt,{className:"h-4 w-4"}),"Detach"]}),e[37]=u,e[38]=n.isMultivariate,e[39]=n.isSavedBlock,e[40]=X):X=e[40];let de;e[41]!==l?(de=H=>{H.stopPropagation(),l()},e[41]=l,e[42]=de):de=e[42];let U;e[43]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(wt,{className:"h-4 w-4"}),e[43]=U):U=e[43];let re;e[44]!==de?(re=t.jsxs(Ye,{className:"text-destructive focus:text-destructive",onClick:de,children:[U,"Delete"]}),e[44]=de,e[45]=re):re=e[45];let ie;e[46]!==G||e[47]!==Y||e[48]!==F||e[49]!==X||e[50]!==re?(ie=t.jsxs(Qt,{children:[pe,t.jsxs(Zt,{align:"end",className:"w-44",children:[G,Y,F,X,re]})]}),e[46]=G,e[47]=Y,e[48]=F,e[49]=X,e[50]=re,e[51]=ie):ie=e[51];let he;return e[52]!==_||e[53]!==N||e[54]!==f||e[55]!==j||e[56]!==z||e[57]!==ue||e[58]!==K||e[59]!==ae||e[60]!==oe||e[61]!==ie||e[62]!==ne?(he=t.jsxs("div",{ref:j,style:z,..._,...N,role:$,tabIndex:le,onClick:f,onKeyDown:ne,className:ue,children:[K,ae,oe,ie]}),e[52]=_,e[53]=N,e[54]=f,e[55]=j,e[56]=z,e[57]=ue,e[58]=K,e[59]=ae,e[60]=oe,e[61]=ie,e[62]=ne,e[63]=he):he=e[63],he}function Vo(r){return r.stopPropagation()}function Mo(r){return r.stopPropagation()}function Eo(r){return r.stopPropagation()}function $o(r){return r.stopPropagation()}function Oo(){return!1}function Lo(r){const e=Oe.c(90),{listKey:n,rawSections:a,sections:i,meta:c,selectedIndex:h,onSelect:f,onReorder:l,onDelete:g,onDuplicate:v,onMakeReusable:b,onToggleHidden:S,onToggleLazy:k,onAddVariant:u,onDetach:y,onAddSection:m,canAddSection:A}=r,p=A===void 0?!0:A;let _;e[0]!==i.length?(_=()=>An(i.length),e[0]=i.length,e[1]=_):_=e[1];const[N,j]=D.useState(_),[C,w]=D.useState(null),[T,P]=D.useState(n),[V,z]=D.useState(i.length),B=D.useRef(!1);T!==n?(P(n),z(i.length),j(An(i.length))):V!==i.length&&(z(i.length),j(Z=>Ao(Z,i.length)));let M;e[2]===Symbol.for("react.memo_cache_sentinel")?(M={activationConstraint:{distance:8}},e[2]=M):M=e[2];let $;e[3]===Symbol.for("react.memo_cache_sentinel")?($={coordinateGetter:Xn},e[3]=$):$=e[3];const le=qn(_t(Jn,M),_t(Gn,$));let ne;e[4]!==N?(ne=N.map(Io),e[4]=N,e[5]=ne):ne=e[5];const L=ne;let ue;e[6]===Symbol.for("react.memo_cache_sentinel")?(ue=Z=>{w(String(Z.active.id))},e[6]=ue):ue=e[6];const K=ue;let ae;e[7]!==L||e[8]!==l?(ae=Z=>{w(null);const{active:W,over:Ne}=Z;if(!Ne||W.id===Ne.id)return;const Ke=L.indexOf(String(W.id)),Fe=L.indexOf(String(Ne.id));Ke===-1||Fe===-1||(j(Ze=>as(jt([...Ze],Ke,Fe))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),l?.(Ke,Fe))},e[7]=L,e[8]=l,e[9]=ae):ae=e[9];const oe=ae;let pe;e[10]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>{w(null)},e[10]=pe):pe=e[10];const se=pe;let Q,G,Y,F,X,de,U,re,ie,he,H,Ce,Te,Re,Ae;if(e[11]!==C||e[12]!==p||e[13]!==N||e[14]!==L||e[15]!==oe||e[16]!==c||e[17]!==m||e[18]!==u||e[19]!==g||e[20]!==y||e[21]!==v||e[22]!==b||e[23]!==f||e[24]!==S||e[25]!==k||e[26]!==a||e[27]!==i||e[28]!==h||e[29]!==le){Re=Symbol.for("react.early_return_sentinel");e:{const Z=W=>{B.current||f(W)};if(e[45]!==C||e[46]!==p||e[47]!==N||e[48]!==m||e[49]!==a||e[50]!==i){const W=C?N.find(Ne=>Ne.id===C):null;if(F=W!=null?i[W.index]:null,Y=W!=null?a[W.index]:void 0,N.length===0){let Ne;e[54]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Ne):Ne=e[54];const Ke=!p;let Fe;e[55]===Symbol.for("react.memo_cache_sentinel")?(Fe=t.jsx(yt,{size:14}),e[55]=Fe):Fe=e[55];let Ze;e[56]!==m||e[57]!==Ke?(Ze=t.jsxs("div",{className:"space-y-2",children:[Ne,t.jsxs($e,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ke,onClick:m,children:[Fe,"Add section"]})]}),e[56]=m,e[57]=Ke,e[58]=Ze):Ze=e[58],Re=Ze;break e}Te=xe(W&&"cursor-grabbing"),e[45]=C,e[46]=p,e[47]=N,e[48]=m,e[49]=a,e[50]=i,e[51]=Y,e[52]=F,e[53]=Te}else Y=e[51],F=e[52],Te=e[53];G=es,re=le,ie=ts,he=K,H=oe,Ce=se,Q=ns,de=L,U=Ya,Ae="space-y-1",X=N.map(W=>{const Ne=i[W.index];return Ne?t.jsx(Po,{sortableId:W.id,section:Ne,raw:a[W.index],meta:c,selected:h===W.index,onSelect:()=>Z(W.index),onDelete:()=>g(W.index),onDuplicate:()=>v(W.index),onMakeReusable:()=>b(W.index),onToggleHidden:()=>S(W.index),onToggleLazy:()=>k(W.index),onAddVariant:()=>u(W.index),onDetach:()=>y(W.index)},W.id):null})}e[11]=C,e[12]=p,e[13]=N,e[14]=L,e[15]=oe,e[16]=c,e[17]=m,e[18]=u,e[19]=g,e[20]=y,e[21]=v,e[22]=b,e[23]=f,e[24]=S,e[25]=k,e[26]=a,e[27]=i,e[28]=h,e[29]=le,e[30]=Q,e[31]=G,e[32]=Y,e[33]=F,e[34]=X,e[35]=de,e[36]=U,e[37]=re,e[38]=ie,e[39]=he,e[40]=H,e[41]=Ce,e[42]=Te,e[43]=Re,e[44]=Ae}else Q=e[30],G=e[31],Y=e[32],F=e[33],X=e[34],de=e[35],U=e[36],re=e[37],ie=e[38],he=e[39],H=e[40],Ce=e[41],Te=e[42],Re=e[43],Ae=e[44];if(Re!==Symbol.for("react.early_return_sentinel"))return Re;let be;e[59]!==X||e[60]!==Ae?(be=t.jsx("div",{className:Ae,children:X}),e[59]=X,e[60]=Ae,e[61]=be):be=e[61];let Le;e[62]!==Q||e[63]!==de||e[64]!==U||e[65]!==be?(Le=t.jsx(Q,{items:de,strategy:U,children:be}),e[62]=Q,e[63]=de,e[64]=U,e[65]=be,e[66]=Le):Le=e[66];let De;e[67]!==Y||e[68]!==F||e[69]!==c?(De=F?t.jsx("div",{className:xe("cursor-grabbing shadow-lg ring-1 ring-border/60",rs(F,!1)),children:t.jsx(os,{section:F,raw:Y,meta:c})}):null,e[67]=Y,e[68]=F,e[69]=c,e[70]=De):De=e[70];let Se;e[71]!==De?(Se=t.jsx(ss,{dropAnimation:null,children:De}),e[71]=De,e[72]=Se):Se=e[72];let me;e[73]!==G||e[74]!==re||e[75]!==ie||e[76]!==he||e[77]!==H||e[78]!==Ce||e[79]!==Le||e[80]!==Se?(me=t.jsxs(G,{sensors:re,collisionDetection:ie,onDragStart:he,onDragEnd:H,onDragCancel:Ce,children:[Le,Se]}),e[73]=G,e[74]=re,e[75]=ie,e[76]=he,e[77]=H,e[78]=Ce,e[79]=Le,e[80]=Se,e[81]=me):me=e[81];const Ie=!p;let ce;e[82]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx(yt,{size:14}),e[82]=ce):ce=e[82];let ye;e[83]!==m||e[84]!==Ie?(ye=t.jsxs($e,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ie,onClick:m,children:[ce,"Add section"]}),e[83]=m,e[84]=Ie,e[85]=ye):ye=e[85];let J;return e[86]!==Te||e[87]!==me||e[88]!==ye?(J=t.jsxs("div",{className:Te,children:[me,ye]}),e[86]=Te,e[87]=me,e[88]=ye,e[89]=J):J=e[89],J}function Io(r){return r.id}const zo=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],Bo={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Ut(r){return kt(r)!==void 0}function Xt(r,e){if(e){if(Ut(e))return e;const n=Bo[e];if(n&&Ut(n))return n}for(const[n,a]of zo)if(n.test(r)&&Ut(a))return a;return"FilterLines"}function Fo(r){return kt(r)??uo}function Pn(r){const e=Oe.c(11),{iconName:n,size:a,className:i}=r,c=a===void 0?"md":a;let h;e[0]!==n?(h=Fo(n),e[0]=n,e[1]=h):h=e[1];const f=h,l=c==="sm"?"size-7":"size-9",g=c==="sm"?16:18;let v;e[2]!==l||e[3]!==i?(v=xe("flex shrink-0 items-center justify-center rounded-full bg-muted",l,i),e[2]=l,e[3]=i,e[4]=v):v=e[4];let b;e[5]!==f||e[6]!==g?(b=t.jsx(f,{size:g,className:"text-muted-foreground"}),e[5]=f,e[6]=g,e[7]=b):b=e[7];let S;return e[8]!==v||e[9]!==b?(S=t.jsx("div",{className:v,children:b}),e[8]=v,e[9]=b,e[10]=S):S=e[10],S}const is="Users03";function Ko(r){const e=r.manifest?.blocks??{},n=[];for(const[a,i]of Object.entries(e))if(a.includes("matchers"))for(const c of Object.keys(i)){if(c.includes("always"))continue;const h=fa(c,r);n.push({resolveType:c,title:h.title??We(c),description:h.description,iconName:Xt(c,h.icon)})}return n}function Ho(r,e){if(!r)return is;const n=e.find(a=>a.resolveType===r);return n?n.iconName:Xt(r)}function Vn(r){const e=Oe.c(41),{currentRt:n,currentLabel:a,matchers:i,onSelect:c}=r,[h,f]=D.useState(!1);let l;if(e[0]!==n||e[1]!==i){const M=Ho(n,i);l=kt(M),e[0]=n,e[1]=i,e[2]=l}else l=e[2];const g=l;let v;e[3]!==c?(v=M=>{c(M),f(!1)},e[3]=c,e[4]=v):v=e[4];const b=v;let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=()=>f(!0),e[5]=S):S=e[5];let k;e[6]!==g?(k=g&&t.jsx(g,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=g,e[7]=k):k=e[7];let u;e[8]!==a?(u=t.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=u):u=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ln,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=y):y=e[10];let m;e[11]!==k||e[12]!==u?(m=t.jsxs("button",{type:"button",onClick:S,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[k,u,y]}),e[11]=k,e[12]=u,e[13]=m):m=e[13];let A;e[14]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(oo,{placeholder:"Search rules..."}),e[14]=A):A=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ro,{children:"No rules found."}),e[15]=p):p=e[15];let _;e[16]!==b?(_=()=>b(""),e[16]=b,e[17]=_):_=e[17];const N=!n&&"bg-accent/60";let j;e[18]!==N?(j=xe("gap-2.5",N),e[18]=N,e[19]=j):j=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Pn,{iconName:is,size:"sm"}),e[20]=C):C=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:"Always"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=w):w=e[21];let T;e[22]!==_||e[23]!==j?(T=t.jsxs(Tn,{value:"always Target all users",onSelect:_,className:j,children:[C,w]}),e[22]=_,e[23]=j,e[24]=T):T=e[24];let P;if(e[25]!==n||e[26]!==b||e[27]!==i){let M;e[29]!==n||e[30]!==b?(M=$=>t.jsxs(Tn,{value:`${$.title} ${$.resolveType} ${$.description??""}`,onSelect:()=>b($.resolveType),className:xe("gap-2.5",n===$.resolveType&&"bg-accent/60"),children:[t.jsx(Pn,{iconName:$.iconName,size:"sm"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:$.title}),$.description&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:$.description})]})]},$.resolveType),e[29]=n,e[30]=b,e[31]=M):M=e[31],P=i.map(M),e[25]=n,e[26]=b,e[27]=i,e[28]=P}else P=e[28];let V;e[32]!==T||e[33]!==P?(V=t.jsxs(io,{children:[p,t.jsxs(lo,{children:[T,P]})]}),e[32]=T,e[33]=P,e[34]=V):V=e[34];let z;e[35]!==h||e[36]!==V?(z=t.jsxs(co,{open:h,onOpenChange:f,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[A,V]}),e[35]=h,e[36]=V,e[37]=z):z=e[37];let B;return e[38]!==z||e[39]!==m?(B=t.jsxs(t.Fragment,{children:[m,z]}),e[38]=z,e[39]=m,e[40]=B):B=e[40],B}const Uo="oklch(0.65 0.15 160)",ls="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 en(r){const e=Oe.c(5),{rule:n,matchers:a}=r,i=n?.__resolveType??"";let c;if(e[0]!==a||e[1]!==i){const g=a.find(v=>v.resolveType===i)?.iconName??Xt(i);c=kt(g),e[0]=a,e[1]=i,e[2]=c}else c=e[2];const h=c;if(!h)return null;let f;return e[3]!==h?(f=t.jsx(h,{size:14,className:"shrink-0"}),e[3]=h,e[4]=f):f=e[4],f}function Mn(r){return r.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
2
  `)}function Wt(r){return r.map((e,n)=>({id:crypto.randomUUID(),index:n,variant:e}))}function Wo(r){return r.map((e,n)=>({...e,index:n}))}function Yo(r){const e=Oe.c(51),{entry:n,sortableId:a,isActive:i,canDelete:c,decofile:h,meta:f,matchers:l,onSelect:g,onRename:v,onDelete:b}=r;let S;e[0]!==a?(S={id:a,animateLayoutChanges:Jo},e[0]=a,e[1]=S):S=e[1];const{attributes:k,listeners:u,setNodeRef:y,transform:m,isDragging:A}=Zn(S);let p;e[2]!==m?(p=Qn.Transform.toString(m?{...m,y:0}:null),e[2]=m,e[3]=p):p=e[3];const _=A?0:void 0;let N;e[4]!==p||e[5]!==_?(N={transform:p,opacity:_},e[4]=p,e[5]=_,e[6]=N):N=e[6];const j=N,C=f??void 0;let w;e[7]!==h||e[8]!==n.variant.rule||e[9]!==C?(w=St(n.variant.rule,h,C),e[7]=h,e[8]=n.variant.rule,e[9]=C,e[10]=w):w=e[10];const T=w,P=i?ls:"text-muted-foreground hover:bg-muted hover:text-foreground",V=A?"cursor-grabbing":"cursor-grab";let z;e[11]!==P||e[12]!==V?(z=xe("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",P,V),e[11]=P,e[12]=V,e[13]=z):z=e[13];let B;e[14]!==T||e[15]!==l?(B=t.jsx(en,{rule:T,matchers:l}),e[14]=T,e[15]=l,e[16]=B):B=e[16];let M;e[17]!==n.variant.label?(M=t.jsx("span",{className:"truncate",children:n.variant.label}),e[17]=n.variant.label,e[18]=M):M=e[18];let $;e[19]!==k||e[20]!==u||e[21]!==g||e[22]!==B||e[23]!==M?($=t.jsxs("button",{type:"button",...k,...u,onClick:g,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[B,M]}),e[19]=k,e[20]=u,e[21]=g,e[22]=B,e[23]=M,e[24]=$):$=e[24];const le=`Actions for ${n.variant.label}`,ne=i&&"opacity-100";let L;e[25]!==ne?(L=xe("inline-flex h-8 w-6 items-center justify-center pr-1 cursor-pointer transition-opacity","opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",ne),e[25]=ne,e[26]=L):L=e[26];let ue;e[27]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Gt,{size:12}),e[27]=ue):ue=e[27];let K;e[28]!==le||e[29]!==L?(K=t.jsx(Jt,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":le,onClick:Go,onPointerDown:qo,className:L,children:ue})}),e[28]=le,e[29]=L,e[30]=K):K=e[30];let ae;e[31]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(mo,{size:14}),e[31]=ae):ae=e[31];let oe;e[32]!==v?(oe=t.jsxs(Ye,{onClick:v,children:[ae,"Rename"]}),e[32]=v,e[33]=oe):oe=e[33];let pe;e[34]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(Wa,{}),e[34]=pe):pe=e[34];const se=!c;let Q;e[35]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(wt,{size:14}),e[35]=Q):Q=e[35];let G;e[36]!==b||e[37]!==se?(G=t.jsxs(Ye,{variant:"destructive",disabled:se,onClick:b,children:[Q,"Delete"]}),e[36]=b,e[37]=se,e[38]=G):G=e[38];let Y;e[39]!==oe||e[40]!==G?(Y=t.jsxs(Zt,{align:"start",className:"w-36",children:[oe,pe,G]}),e[39]=oe,e[40]=G,e[41]=Y):Y=e[41];let F;e[42]!==K||e[43]!==Y?(F=t.jsxs(Qt,{children:[K,Y]}),e[42]=K,e[43]=Y,e[44]=F):F=e[44];let X;return e[45]!==y||e[46]!==j||e[47]!==$||e[48]!==F||e[49]!==z?(X=t.jsxs("div",{ref:y,style:j,className:z,children:[$,F]}),e[45]=y,e[46]=j,e[47]=$,e[48]=F,e[49]=z,e[50]=X):X=e[50],X}function qo(r){return r.stopPropagation()}function Go(r){return r.stopPropagation()}function Jo(){return!1}function Zo(r){const e=Oe.c(13),{variant:n,decofile:a,meta:i,matchers:c}=r,h=i??void 0;let f;e[0]!==a||e[1]!==h||e[2]!==n.rule?(f=St(n.rule,a,h),e[0]=a,e[1]=h,e[2]=n.rule,e[3]=f):f=e[3];const l=f;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=xe("inline-flex items-center gap-1.5 h-8 pl-3 pr-3 text-sm font-medium rounded-md shadow-lg ring-1 ring-border/60 cursor-grabbing",ls),e[4]=g):g=e[4];let v;e[5]!==l||e[6]!==c?(v=t.jsx(en,{rule:l,matchers:c}),e[5]=l,e[6]=c,e[7]=v):v=e[7];let b;e[8]!==n.label?(b=t.jsx("span",{className:"truncate",children:n.label}),e[8]=n.label,e[9]=b):b=e[9];let S;return e[10]!==v||e[11]!==b?(S=t.jsxs("div",{className:g,children:[v,b]}),e[10]=v,e[11]=b,e[12]=S):S=e[12],S}function Qo(r){const e=Oe.c(77),{listKey:n,variants:a,activeIndex:i,decofile:c,meta:h,matchers:f,onSelect:l,onReorder:g,onRename:v,onDelete:b,onAdd:S}=r;let k;e[0]!==a?(k=()=>Wt(a),e[0]=a,e[1]=k):k=e[1];const[u,y]=D.useState(k),[m,A]=D.useState(null),[p,_]=D.useState(n),[N,j]=D.useState(a.length);let C;e[2]!==a?(C=()=>Mn(a),e[2]=a,e[3]=C):C=e[3];const[w,T]=D.useState(C),P=D.useRef(!1),V=Mn(a);p!==n?(_(n),j(a.length),T(V),y(Wt(a))):N!==a.length?(j(a.length),T(V),y(Wt(a))):w!==V&&(T(V),y(ye=>a.map((J,Z)=>({id:ye[Z]?.id??crypto.randomUUID(),index:Z,variant:J}))));let z;e[4]===Symbol.for("react.memo_cache_sentinel")?(z={activationConstraint:{distance:8}},e[4]=z):z=e[4];let B;e[5]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:Xn},e[5]=B):B=e[5];const M=qn(_t(Jn,z),_t(Gn,B));let $;e[6]!==u?($=u.map(Xo),e[6]=u,e[7]=$):$=e[7];const le=$,ne=a.length>1;let L;e[8]!==u?(L=ye=>{const J=String(ye.active.id);A(u.find(Z=>Z.id===J)??null)},e[8]=u,e[9]=L):L=e[9];const ue=L;let K;e[10]!==le||e[11]!==g?(K=ye=>{A(null);const{active:J,over:Z}=ye;if(!Z||J.id===Z.id)return;const W=le.indexOf(String(J.id)),Ne=le.indexOf(String(Z.id));W===-1||Ne===-1||(y(Ke=>Wo(jt([...Ke],W,Ne))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),g(W,Ne))},e[10]=le,e[11]=g,e[12]=K):K=e[12];const ae=K;let oe;e[13]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>{A(null)},e[13]=oe):oe=e[13];const pe=oe;let se,Q,G,Y,F,X,de,U,re,ie,he,H;if(e[14]!==m||e[15]!==i||e[16]!==ne||e[17]!==c||e[18]!==u||e[19]!==le||e[20]!==ae||e[21]!==ue||e[22]!==f||e[23]!==h||e[24]!==b||e[25]!==v||e[26]!==l||e[27]!==M){const ye=Z=>{P.current||l(Z)};he="flex items-center border-b shrink-0";const J=m&&"cursor-grabbing";e[40]!==J?(ie=xe("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",J),e[40]=J,e[41]=ie):ie=e[41],Q=es,F=M,X=ts,de=ue,U=ae,re=pe,se=ns,H=le,G=qa,Y=u.map(Z=>t.jsx(Yo,{sortableId:Z.id,entry:Z,isActive:Z.index===i,canDelete:ne,decofile:c,meta:h,matchers:f,onSelect:()=>ye(Z.index),onRename:()=>v(Z.index),onDelete:()=>b(Z.index)},Z.id)),e[14]=m,e[15]=i,e[16]=ne,e[17]=c,e[18]=u,e[19]=le,e[20]=ae,e[21]=ue,e[22]=f,e[23]=h,e[24]=b,e[25]=v,e[26]=l,e[27]=M,e[28]=se,e[29]=Q,e[30]=G,e[31]=Y,e[32]=F,e[33]=X,e[34]=de,e[35]=U,e[36]=re,e[37]=ie,e[38]=he,e[39]=H}else se=e[28],Q=e[29],G=e[30],Y=e[31],F=e[32],X=e[33],de=e[34],U=e[35],re=e[36],ie=e[37],he=e[38],H=e[39];let Ce;e[42]!==se||e[43]!==G||e[44]!==Y||e[45]!==H?(Ce=t.jsx(se,{items:H,strategy:G,children:Y}),e[42]=se,e[43]=G,e[44]=Y,e[45]=H,e[46]=Ce):Ce=e[46];let Te;e[47]!==m||e[48]!==c||e[49]!==f||e[50]!==h?(Te=m?t.jsx(Zo,{variant:m.variant,decofile:c,meta:h,matchers:f}):null,e[47]=m,e[48]=c,e[49]=f,e[50]=h,e[51]=Te):Te=e[51];let Re;e[52]!==Te?(Re=t.jsx(ss,{dropAnimation:null,children:Te}),e[52]=Te,e[53]=Re):Re=e[53];let Ae;e[54]!==Q||e[55]!==F||e[56]!==X||e[57]!==de||e[58]!==U||e[59]!==re||e[60]!==Ce||e[61]!==Re?(Ae=t.jsxs(Q,{sensors:F,collisionDetection:X,onDragStart:de,onDragEnd:U,onDragCancel:re,children:[Ce,Re]}),e[54]=Q,e[55]=F,e[56]=X,e[57]=de,e[58]=U,e[59]=re,e[60]=Ce,e[61]=Re,e[62]=Ae):Ae=e[62];let be;e[63]!==ie||e[64]!==Ae?(be=t.jsx("div",{className:ie,children:Ae}),e[63]=ie,e[64]=Ae,e[65]=be):be=e[65];let Le;e[66]===Symbol.for("react.memo_cache_sentinel")?(Le={color:Uo},e[66]=Le):Le=e[66];let De;e[67]===Symbol.for("react.memo_cache_sentinel")?(De=t.jsx(yt,{size:14}),e[67]=De):De=e[67];let Se;e[68]!==S?(Se=t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:Le,onClick:S,children:De})}),e[68]=S,e[69]=Se):Se=e[69];let me;e[70]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(Ge,{side:"bottom",children:"Add variant"}),e[70]=me):me=e[70];let Ie;e[71]!==Se?(Ie=t.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:t.jsxs(Je,{children:[Se,me]})}),e[71]=Se,e[72]=Ie):Ie=e[72];let ce;return e[73]!==he||e[74]!==be||e[75]!==Ie?(ce=t.jsxs("div",{className:he,children:[be,Ie]}),e[73]=he,e[74]=be,e[75]=Ie,e[76]=ce):ce=e[76],ce}function Xo(r){return r.id}function er(r){const e=Oe.c(37),{open:n,onOpenChange:a,defaultBlockId:i,isPending:c,onSubmit:h}=r,f=i===void 0?"":i,l=c===void 0?!1:c,[g,v]=D.useState(f),[b,S]=D.useState(n);n!==b&&(S(n),n&&v(f));let k;e[0]!==l||e[1]!==a?(k=M=>{!M&&!l&&a(!1)},e[0]=l,e[1]=a,e[2]=k):k=e[2];const u=k;let y;e[3]!==g||e[4]!==l||e[5]!==h?(y=async M=>{M.preventDefault();const $=g.trim();!$||l||await h($)},e[3]=g,e[4]=l,e[5]=h,e[6]=y):y=e[6];const m=y;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsxs(Bn,{children:[t.jsx(zn,{children:"Save as global"}),t.jsx(Fn,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=A):A=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=p):p=e[8];let _;e[9]===Symbol.for("react.memo_cache_sentinel")?(_=M=>v(M.target.value),e[9]=_):_=e[9];let N;e[10]!==g||e[11]!==l?(N=t.jsxs("div",{className:"py-4 space-y-2",children:[p,t.jsx(Wn,{id:"block-id",value:g,onChange:_,placeholder:"MyNewBlock",autoFocus:!0,disabled:l})]}),e[10]=g,e[11]=l,e[12]=N):N=e[12];let j;e[13]!==a?(j=()=>a(!1),e[13]=a,e[14]=j):j=e[14];let C;e[15]!==l||e[16]!==j?(C=t.jsx($e,{type:"button",variant:"outline",onClick:j,disabled:l,children:"Cancel"}),e[15]=l,e[16]=j,e[17]=C):C=e[17];let w;e[18]!==g||e[19]!==l?(w=!g.trim()||l,e[18]=g,e[19]=l,e[20]=w):w=e[20];let T;e[21]!==l?(T=l?t.jsxs(t.Fragment,{children:[t.jsx(qt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=l,e[22]=T):T=e[22];let P;e[23]!==w||e[24]!==T?(P=t.jsx($e,{type:"submit",disabled:w,children:T}),e[23]=w,e[24]=T,e[25]=P):P=e[25];let V;e[26]!==C||e[27]!==P?(V=t.jsxs(Kn,{children:[C,P]}),e[26]=C,e[27]=P,e[28]=V):V=e[28];let z;e[29]!==m||e[30]!==V||e[31]!==N?(z=t.jsx(Hn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:m,children:[A,N,V]})}),e[29]=m,e[30]=V,e[31]=N,e[32]=z):z=e[32];let B;return e[33]!==u||e[34]!==n||e[35]!==z?(B=t.jsx(Un,{open:n,onOpenChange:u,children:z}),e[33]=u,e[34]=n,e[35]=z,e[36]=B):B=e[36],B}function En(r){const e=Oe.c(20),{activeSchema:n,formValue:a,formResetKey:i,onFormChange:c,onBreadcrumbChange:h,breadcrumbPath:f,emptyMessage:l,beforeForm:g,seoResolveType:v,siteDefaultSeo:b,meta:S,decofile:k,onSaveReferencedBlock:u}=r;let y;e[0]!==f?(y=f===void 0?[]:f,e[0]=f,e[1]=y):y=e[1];const m=y;let A;e[2]!==n||e[3]!==m||e[4]!==k||e[5]!==i||e[6]!==a||e[7]!==S||e[8]!==h||e[9]!==c||e[10]!==u||e[11]!==v||e[12]!==b?(A=n&&a?v?t.jsx(ao,{schema:n,resolveType:v,value:a,formResetKey:i,onChange:c,onBreadcrumbChange:h,siteDefaultSeo:b}):t.jsx(Yt,{schema:n,value:a,onChange:c,basePath:"",breadcrumbPath:m,onBreadcrumbChange:h,meta:S,decofile:k,onSaveReferencedBlock:u},i):null,e[2]=n,e[3]=m,e[4]=k,e[5]=i,e[6]=a,e[7]=S,e[8]=h,e[9]=c,e[10]=u,e[11]=v,e[12]=b,e[13]=A):A=e[13];const p=A;let _;e[14]!==l||e[15]!==p?(_=p??t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[14]=l,e[15]=p,e[16]=_):_=e[16];let N;return e[17]!==g||e[18]!==_?(N=t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,_]})}),e[17]=g,e[18]=_,e[19]=N):N=e[19],N}const tr="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)]",nr=r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase();function $n(r){const{start:e,end:n}=r,a=typeof e=="string"?e:"",i=typeof n=="string"?n:"";if(!a&&!i)return null;const c=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"}),h=g=>{if(!g)return null;const v=new Date(g);return Number.isNaN(v.getTime())?null:c.format(v)},f=h(a),l=h(i);return f&&l?`${f} → ${l}`:f?`From ${f}`:l?`Until ${l}`:null}function tt(r){if(!r)return"Default";const e=r.__resolveType??"";if(["website/matchers/always.ts","$live/matchers/MatchAlways.ts"].includes(e)||e==="")return"Default";switch(e){case"website/matchers/never.ts":return"Hidden";case"website/matchers/device.ts":case"$live/matchers/MatchDevice.ts":{const{mobile:a,tablet:i,desktop:c,devices:h=[]}=r,f=[...h];return a&&f.push("Mobile"),i&&f.push("Tablet"),c&&f.push("Desktop"),f.length>0?f.map(nr).join(" & "):We(e)}case"website/matchers/date.ts":case"$live/matchers/MatchDate.ts":return $n(r)??We(e);case"website/matchers/random.ts":case"$live/matchers/MatchRandom.ts":{const{traffic:a}=r;return typeof a=="number"?`${Math.ceil(a*100)}% of sessions`:We(e)}case"website/matchers/host.ts":case"$live/matchers/MatchHost.ts":{const{includes:a,match:i}=r,c=[];return a&&c.push(a),i&&c.push(i),c.length>0?c.join(" - "):We(e)}case"website/matchers/pathname.ts":{const a=r.case,{type:i,pathname:c}=a??{};return i&&c?`Pathname ${i} ${c}`:We(e)}case"website/matchers/location.ts":case"$live/matchers/MatchLocation.ts":{const{includeLocations:a,excludeLocations:i}=r,c=l=>[l.city,l.regionCode,l.country].filter(Boolean).join(" - "),h=a?.[0];if(h){const l=(a?.length??0)-1;return`${c(h)}${l>0?` +${l}`:""}`}const f=i?.[0];if(f){const l=(i?.length??0)-1;return`Except ${c(f)}${l>0?` +${l}`:""}`}return"Any location"}case"website/matchers/multi.ts":case"$live/matchers/MatchMulti.ts":{const{matchers:a,op:i="AND"}=r;return a&&a.length>0?a.map(tt).join(` ${i} `):We(e)}default:{const a=$n(r);return a||We(e)||"Default"}}}function sr(r,e){return ja(r,e,tt)}function ar(r){const e=Oe.c(13),{pageKey:n,initialName:a,initialPath:i,onFieldChange:c}=r,[h,f]=D.useState(a),[l,g]=D.useState(i),[v,b]=D.useState(n);v!==n&&(b(n),f(a),g(i));let S;e[0]!==c?(S=A=>{f(A.target.value),c("name",A.target.value)},e[0]=c,e[1]=S):S=e[1];let k;e[2]!==h||e[3]!==S?(k=t.jsx("input",{type:"text",value:h,onChange:S,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=h,e[3]=S,e[4]=k):k=e[4];let u;e[5]!==c?(u=A=>{g(A.target.value),c("path",A.target.value)},e[5]=c,e[6]=u):u=e[6];let y;e[7]!==l||e[8]!==u?(y=t.jsx("input",{type:"text",value:l,onChange:u,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:"/path"}),e[7]=l,e[8]=u,e[9]=y):y=e[9];let m;return e[10]!==k||e[11]!==y?(m=t.jsxs("div",{className:"space-y-1",children:[k,y]}),e[10]=k,e[11]=y,e[12]=m):m=e[12],m}function On(r){const e=Oe.c(6),{onClick:n}=r;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(In,{size:14}),e[0]=a):a=e[0];let i;e[1]!==n?(i=t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:n,children:a})}),e[1]=n,e[2]=i):i=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ge,{side:"bottom",children:"Add variant"}),e[3]=c):c=e[3];let h;return e[4]!==i?(h=t.jsxs(Je,{children:[i,c]}),e[4]=i,e[5]=h):h=e[5],h}function Ql({orgSlug:r,virtualMcpId:e,branch:n,previewReady:a=!0,previewUrl:i,currentPath:c,activePageBlockKey:h=null,activeGlobalBlockKey:f=null,externalSelectedIndex:l,onSaved:g,initialEditSeo:v=!1,onExitSeo:b,onViewJsonFile:S}){const k=a?{orgSlug:r,virtualMcpId:e,branch:n}:null,{data:u,isLoading:y}=pa(k),{data:m,isLoading:A}=ha(k),[p,_]=D.useState(null),[N,j]=D.useState(null),[C,w]=D.useState(null),[T,P]=D.useState(0),[V,z]=D.useState(void 0),[B,M]=D.useState(null),[$,le]=D.useState(null),[ne,L]=D.useState([]),[ue,K]=D.useState(0),[ae,oe]=D.useState(null),[pe,se]=D.useState(null),[Q,G]=D.useState(!0),[Y,F]=D.useState(!1),[X,de]=D.useState(!1),[U,re]=D.useState(v),[ie,he]=D.useState(v);v&&!ie&&(he(!0),re(!0),_(null),j(null),w(null),L([])),!v&&ie&&he(!1);const[H,Ce]=D.useState(null),[Te,Re]=D.useState(void 0),[Ae,be]=D.useState([]),[Le,De]=D.useState(0),[Se,me]=D.useState(0),[Ie,ce]=D.useState(null),[ye,J]=D.useState(null),[Z,W]=D.useState(null),Ne=ea(),Ke=`${r}/${e}/${n}`,Fe=ga({orgSlug:r,virtualMcpId:e,branch:n}),[Ze,cs]=D.useState(c),[us,ds]=D.useState(h),[ms,fs]=D.useState(f);(Ze!==c||us!==h||ms!==f)&&(queueMicrotask(()=>Fe.flush()),cs(c),ds(h),fs(f),_(null),j(null),w(null),P(0),M(null),le(null),me(0),ce(null),J(null),L([]),K(s=>s+1),re(!1),Ce(null),Re(void 0),be([]),De(s=>s+1));const Pe=va({orgSlug:r,virtualMcpId:e,branch:n}),tn=po((s,o)=>{Pe.mutate({blockKey:s,data:o},{onSuccess:()=>g?.(),onError:d=>fe.error(`Save failed: ${d.message}`)})}),nn=xa({orgSlug:r,virtualMcpId:e,branch:n}),[Nt,sn]=D.useState(!1),Ct=D.useRef(null),it=D.useRef(null),lt=D.useRef(null),Tt=D.useRef({}),Qe=D.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!a||y||A)return t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(qt,{size:20,className:"animate-spin text-muted-foreground"})});if(!u||!m)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const ps=ba(u),_e=!!f,ze=_e?null:Sa(ps,c,h),O=_e?f:ze?.key??null,Rt=_e&&f?u[f]:void 0,an=_e&&f&&Rt?ya(f,Rt):_e&&f?f:"",Dt=!_e&&O&&u[O]?u[O]:null,At=U&&u&&m&&O&&ze?Cn(u,{kind:"page",pageKey:O,pageName:String(ze.name??""),path:String(ze.path??"")},m):null,hs=U?Dt?.seo:void 0,Pt=Te!==void 0?Te:hs,gs=U?Za(Pt):void 0,vs=At?.seoTypeOptions??[],xs=U&&m?Qa(m):"",on=H??gs??{},Vt=U&&At?Xa(on,At):null,bs=U&&Vt&&eo(Pt)?ht(Vt,m):null,Ss=U?to(u,m)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:f}]}]:sr(Dt?.sections,u??{}),dt=Be.length>1,Ve=Math.min(T,Be.length-1),nt=Be[Ve],q=nt?.sections??[],Me=vt(q,u);if(_e&&f&&Z!==f){W(f);const s=q[0],o=Me[0];if(s&&o){_(0),me(0),L([]);const d=rt(s,o,u);d&&(j(d.data),w(d.resolveType),J(null),ce(null))}}!_e&&Z!==null&&W(null),Qe.current={rawSections:q,parsedSections:Me,decofile:u??{},activePageKey:O,pageVariants:Be,variantIndex:Ve,sectionVariantIndex:Se,selectedSectionIndex:p};const st=(s,o,d)=>{const x=ot(s,o);if(!x){j(null),w(null),J(null),ce(null);return}const I=kn(x,tt)[d];if(!I){j(null),w(null),J(null),ce(null);return}const E=ka(I.value,u);j(E?.data??null),w(E?.resolveType??null);const{resolveType:ee,formValue:ge}=zt(I.rule,u,m??void 0);J(ee),ce(ge)};if(l!==void 0&&l!==V&&(z(l??null),typeof l=="number")){const s=q[l],o=Me[l];if(s&&o)if(_(l),me(0),L([]),K(d=>d+1),o.isMultivariate)st(s,o,0);else{const d=rt(s,o,u);d?(j(d.data),w(d.resolveType)):(j(null),w(null)),J(null),ce(null)}}const Mt=C&&m?ht(C,m):null,He=(s,o)=>{if(!O)return;const d=Ht(u,O,s,Ve,Be);Pe.mutate({blockKey:O,data:d},{onSuccess:()=>o?.onSuccess?.()??g?.(),onError:x=>fe.error(`Save failed: ${x.message}`)})},ct=()=>{_(null),j(null),w(null),me(0),ce(null),J(null),L([]),K(s=>s+1)},ys=(s,o)=>{Ct.current&&clearTimeout(Ct.current);const d=Qe.current.sectionVariantIndex;Ct.current=setTimeout(()=>{const{rawSections:x,parsedSections:R,decofile:I,activePageKey:E,pageVariants:ee,variantIndex:ge}=Qe.current,te=x[o];if(!te)return;const ve=R[o];if(!ve)return;if(ve.isSavedBlock){const ke=ve.isLazy?te.section?.__resolveType??te.__resolveType:te.__resolveType;Pe.mutate({blockKey:ke,data:s},{onSuccess:()=>g?.(),onError:we=>fe.error(`Save failed: ${we.message}`)});return}if(!E)return;const je={...I[E]},Ee=[...x];if(ve.isMultivariate){const ke=ot(te,ve);if(!ke||!E)return;const we=za(ke,d,s);Ee[o]=gt(te,ve,we)}else if(ve.isHidden){const ke=bt(te.__resolveType),we=ke?{...te.section}:{...te},Ue=Array.isArray(we.variants)?[...we.variants]:[];Ue[0]&&(Ue[0]={...Ue[0],value:s}),we.variants=Ue,ke?Ee[o]={...te,section:we}:Ee[o]=we}else ve.isLazy?Ee[o]={...te,section:s}:Ee[o]=s;if(ee.length>1){const ke=je.sections,we=[...ke?.variants??[]];we[ge]&&(we[ge]={...we[ge],value:Ee}),je.sections={...ke,variants:we}}else je.sections=Ee;Pe.mutate({blockKey:E,data:je},{onSuccess:()=>g?.(),onError:ke=>fe.error(`Save failed: ${ke.message}`)})},Kt)},_s=s=>{_(s),me(0),L([]),K(R=>R+1);const o=q[s],d=Me[s];if(!o||!d)return;if(d.isMultivariate){st(o,d,0);return}const x=rt(o,d,u);if(!x){j(null),w(null),J(null),ce(null);return}j(x.data),w(x.resolveType),J(null),ce(null)},rn=s=>{const o=s;j(o),p!==null&&ys(o,p)},Et=s=>{if(!O||!u||!m||!ze)return;const o={kind:"page",pageKey:O,pageName:String(ze.name??""),path:String(ze.path??"")},d=Cn(u,o,m);d&&Fe.save(O,()=>{const x=Ne.getQueryData(ta.decofile(Ke))?.[O];if(!x||typeof x!="object"||x===null||Array.isArray(x))return null;const R={...x,...Tt.current};return Tt.current={},s?.raw!==void 0?{...R,seo:s.raw}:s?.inner!==void 0?so(o,d,R,s.inner):R})},js=(s,o)=>{O&&(Tt.current[s]=o,Et())},ks=(s,o)=>{if(!O)return;const d=jt([...q],s,o);p!==null&&(p===s?_(o):s<p&&o>=p?_(p-1):s>p&&o<=p&&_(p+1)),He(d)},ws=s=>{if(!O)return;const o=q.filter((d,x)=>x!==s);p===s?ct():p!==null&&p>s&&_(p-1),He(o)},Ns=s=>{if(!O)return;const o=q[s];if(!o)return;const d=[...q];d.splice(s+1,0,go(o)),p!==null&&p>s&&_(p+1),He(d)},Cs=s=>{if(!O)return;const o=q[s],d=Me[s];if(!o||!d||d.isMultivariate)return;const x=d.isHidden?Va(o):Ma(o);if(!x)return;const R=[...q];R[s]=x,p===s&&ct(),He(R)},Ts=s=>{if(!O)return;const o=q[s],d=Me[s];if(!o||!d||d.isMultivariate)return;const x=Pa(o);if(!x)return;const R=[...q];R[s]=x,p===s&&ct(),He(R)},Rs=s=>{if(!O)return;const o=q[s],d=Me[s];if(!o||!d?.isSavedBlock)return;const x=rt(o,d,u);if(!x?.data)return;const{name:R,...I}=x.data,E=[...q];d.isLazy?E[s]={...o,section:I}:E[s]=I,p===s&&ct(),He(E)},Ds=s=>{if(!O)return;const o=[...q,{__resolveType:s.resolveType}],d=o.length-1;He(o,{onSuccess:()=>{F(!1),_(d),me(0),L([]),K(E=>E+1);const x=o[d],R=vt(o,u)[d];if(!x||!R)return;if(R.isMultivariate){st(x,R,0);return}const I=rt(x,R,u);if(!I){j(null),w(null),J(null),ce(null);return}j(I.data),w(I.resolveType),J(null),ce(null)}})},As=s=>{if(p===null)return;const o=q[p],d=Me[p];!o||!d?.isMultivariate||(me(s),L([]),K(x=>x+1),st(o,d,s))},Ps=s=>{if(p===null||!O)return;const o=q[p],d=Me[p];if(!o||!d?.isMultivariate)return;const x=ot(o,d);if(!x)return;const R=Da(x,s);if(!R){fe.error("Cannot delete the only variant.");return}const I=[...q];I[p]=gt(o,d,R);const E=R.variants;let ee=Se;s===Se?ee=Math.min(s,E.length-1):s<Se&&(ee=Se-1),me(ee),L([]),K(ge=>ge+1),st(I[p],d,ee),He(I)},Vs=s=>{if(p===null||!O)return;const o=q[p],d=Me[p];if(!o||!d?.isMultivariate)return;const x=ot(o,d);if(!x)return;const R=Aa(x,s),I=[...q];I[p]=gt(o,d,R);const E=s+1;me(E),L([]),K(ee=>ee+1),st(I[p],d,E),He(I)},$t=s=>{const o=s??p;if(o===null||!O)return;const d=q[o],x=Me[o];if(!d||!x)return;const R=wa(d,x);if(!R){fe.error("This section cannot have variants.");return}const I=[...q];I[o]=R.section;const E=vt(I,u)[o];if(!E?.isMultivariate){fe.error("Could not add variant.");return}_(o),me(R.newVariantIndex),L([]),K(ee=>ee+1),st(R.section,E,R.newVariantIndex),He(I)},Ms=()=>{if(p===null||!O)return;const s=q[p],o=Me[p];if(!s||!o?.isMultivariate)return;const d=ot(s,o);if(!d)return;const x=Ra(s,o,d);if(!x){fe.error("Could not remove variants.");return}const R=[...q];R[p]=x;const I=vt(R,u)[p];if(!I)return;me(0),J(null),ce(null),L([]),K(ee=>ee+1);const E=rt(x,I,u);E?(j(E.data),w(E.resolveType)):(j(null),w(null)),He(R)},Es=async s=>{if(ae===null||!O)return;const o=Dn(s,u);if(o){fe.error(o);return}const d=q[ae],x=Me[ae];if(!d||!x)return;const R=rt(d,x,u);if(!R){fe.error("This section cannot be saved as global.");return}const I={...R.data,name:s};try{await Pe.mutateAsync({blockKey:s,data:I});const E=[...q];E[ae]={__resolveType:s},await Pe.mutateAsync({blockKey:O,data:Ht(u,O,E,Ve,Be)}),p===ae&&ct(),oe(null),fe.success(`Saved global block "${s}"`),g?.()}catch(E){fe.error(E instanceof Error?E.message:"Failed to save global block")}},ln=nt?.rule;if(dt&&p===null&&$===null&&ln){const{resolveType:s,formValue:o}=zt(ln,u??{},m??void 0);le(s),M(o)}const mt=m?Ko(m):[],$s=!_e&&!!(i&&m&&u),cn=$&&m?ht($,m):null,Os=()=>{it.current&&(clearTimeout(it.current),it.current=null),lt.current&&(clearTimeout(lt.current),lt.current=null)},un=async(s,o)=>{if(!(Ba(o,s,m)>0))try{await nn.mutateAsync({blockKey:s})}catch(d){fe.error(d instanceof Error?d.message:"Could not delete matcher block")}},dn=s=>{it.current&&clearTimeout(it.current),it.current=setTimeout(()=>{const{activePageKey:o,decofile:d,variantIndex:x}=Qe.current;if(!o)return;const R={...d[o]},I={...R.sections},E=[...I.variants??[]],ee=E[x],ge=ee?.rule;if(Bt(ge,d,m)){const te=ge?.__resolveType??"",ve=d[te],je=typeof ve?.name=="string"?ve.name:te,{__resolveType:Ee,...ke}=s;Pe.mutate({blockKey:te,data:Ft(Ee??"",ke,je)},{onSuccess:()=>g?.(),onError:we=>fe.error(`Save failed: ${we.message}`)});return}ee&&(E[x]={...ee,rule:s}),R.sections={...I,variants:E},Pe.mutate({blockKey:o,data:R},{onSuccess:()=>g?.(),onError:te=>fe.error(`Save failed: ${te.message}`)})},Kt)},Ls=s=>{le(s);const o=s?{__resolveType:s}:{__resolveType:Nn};M({}),dn(o)},Is=s=>{const o=s;M(o);const d=$?{__resolveType:$,...o}:{...o};dn(d)},mn=s=>{lt.current&&clearTimeout(lt.current);const{selectedSectionIndex:o,sectionVariantIndex:d}=Qe.current;o!==null&&(lt.current=setTimeout(()=>{const{rawSections:x,parsedSections:R,decofile:I,activePageKey:E,pageVariants:ee,variantIndex:ge}=Qe.current;if(!E)return;const te=x[o],ve=R[o];if(!te||!ve?.isMultivariate)return;const je=ot(te,ve);if(!je)return;const Ee=Ia(je,d,s),ke=[...x];ke[o]=gt(te,ve,Ee);const we=Ht(I,E,ke,ge,ee);Pe.mutate({blockKey:E,data:we},{onSuccess:()=>g?.(),onError:Ue=>fe.error(`Save failed: ${Ue.message}`)})},Kt))},zs=s=>{J(s),ce({}),mn(s?{__resolveType:s}:{__resolveType:Nn})},Bs=s=>{const o=s;ce(o);const d=ye?{__resolveType:ye,...o}:{...o};mn(d)};if(!_e&&!ze)return t.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",c]});if(_e&&!Rt)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Xe=p!==null?Me[p]??null:null,fn=p!==null?q[p]:null,pn=fn&&Xe?.isMultivariate?ot(fn,Xe):null,ft=pn?kn(pn,tt):[],hn=Math.min(Se,Math.max(ft.length-1,0)),Ot=ft[hn]??null,at=Xe?.isMultivariate===!0,gn=p!==null&&Xe!==null,ut=gn&&(at||!!(Mt&&N)),Fs=ut&&!_e&&Xe?.isSavedBlock===!0,et=_e||Fs,Ks=_e?an:Xe?.label??"",vn=ye&&m?ht(ye,m):null,Lt=ut&&(!_e||ne.length>0)?_e?[an,...ne]:[ze.name,Xe.label,...at&&Ot?[Ot.label]:[],...ne]:[],Hs=U&&ze?[ze.name,"SEO",...Ae]:[],xn=U?Hs:et?Lt.length>0?Lt:[Ks]:Lt,bn=()=>{if(!O)return;const s=u[O],o=Na(s.sections,q);if(!o)return;const d=Ca(o);Pe.mutate({blockKey:O,data:{...s,sections:o}},{onSuccess:()=>{P(d),_(null),j(null),w(null),L([]),M(null),le(null)},onError:x=>fe.error(`Save failed: ${x.message}`)})},Sn=(s,o,d)=>{if(!O)return;const x=u[O],R=x.sections;if(!R||typeof R!="object"||Array.isArray(R))return;const I=R;if(!Array.isArray(I.variants))return;const E=s([...I.variants]);if(!E)return;const ee=La(I,E),ge={...u,[O]:{...x,sections:ee}};Pe.mutate({blockKey:O,data:ge[O]},{onSuccess:()=>{o?.(),d&&un(d,ge)},onError:te=>fe.error(`Save failed: ${te.message}`)})},Us=s=>{se(null),P(s),_(null),j(null),w(null),L([]);const o=Be[s]?.rule,{resolveType:d,formValue:x}=zt(o,u??{},m??void 0);le(d),M(x)},Ws=(s,o)=>{s!==o&&(Ve===s?P(o):s<Ve&&o>=Ve?P(Ve-1):s>Ve&&o<=Ve&&P(Ve+1),Sn(d=>jt(d,s,o)))},Ys=s=>{const o=Be[s]?.rule,d=Ta(o,u??{},m??void 0);Sn(x=>x.length<=1?null:(x.splice(s,1),x),()=>{Be.length-1===1?P(0):s<Ve?P(Ve-1):s===Ve&&P(Math.max(0,s-1)),_(null),j(null),w(null),L([]),M(null),le(null)},d)},qs=async(s,o)=>{Os();const d=Qe.current.activePageKey,x=Qe.current.decofile;if(!d)return;const R=x[d],I=R.sections;if(!I||typeof I!="object"||Array.isArray(I))return;const E=I;if(!Array.isArray(E.variants))return;const ee=[...E.variants],ge=ee[s];if(!ge?.rule||typeof ge.rule!="object"){fe.error("This variant has no matcher rule to rename.");return}const te=ge.rule,ve=o.trim();sn(!0);try{if(!ve){if(!Bt(te,x,m)){se(null);return}const It=te.__resolveType??"";ee[s]={...ge,rule:Ea(te,x,m)};const _n={...x,[d]:{...R,sections:{...E,variants:ee}}};await Pe.mutateAsync({blockKey:d,data:_n[d]}),await un(It,_n),se(null),g?.();return}const je=$a(te,x,m);if(!je){fe.error("Could not read this variant's matcher rule.");return}if(je.blockKey){await Pe.mutateAsync({blockKey:je.blockKey,data:Ft(je.resolveType,je.data,ve)}),se(null),g?.();return}const Ee=Rn(ve),ke=Dn(Ee,x);if(ke){fe.error(ke);return}const we=Ft(je.resolveType,je.data,ve);let Ue=null;try{await Pe.mutateAsync({blockKey:Ee,data:we}),Ue=Ee,ee[s]={...ge,rule:Oa(Ee)},await Pe.mutateAsync({blockKey:d,data:{...R,sections:{...E,variants:ee}}}),Ue=null}catch(It){throw Ue&&await nn.mutateAsync({blockKey:Ue}).catch(()=>{}),It}se(null),fe.success(`Saved matcher as global block "${ve}"`),g?.()}catch(je){fe.error(je instanceof Error?je.message:"Failed to rename variant")}finally{sn(!1)}},yn=()=>{ct()},Gs=s=>{Ce(s),Et({inner:s})},Js=s=>{Re(s),Et({raw:s})},Zs=()=>{Ce(null),be([])},Qs=()=>De(s=>s+1),Xs=s=>{if(U){if(s===0){Fe.flush(),re(!1),Ce(null),Re(void 0),be([]),De(d=>d+1),b?.();return}if(s===1){be([]),De(d=>d+1);return}be(Ae.slice(0,s-1)),De(d=>d+1);return}if(_e){L(ne.slice(0,s)),K(d=>d+1);return}if(s===0){yn();return}if(s===1){L([]),K(d=>d+1);return}if(at&&s===2){L([]),K(d=>d+1);return}const o=at?2:1;L(ne.slice(0,s-o))};return t.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[t.jsx("div",{className:"shrink-0",children:et||ut||U?t.jsxs("div",{className:xe("border-b px-3 py-2.5",et&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!_e&&dt&&nt&&t.jsxs("button",{type:"button",onClick:yn,title:`Editing in variant: ${nt.label}`,className:xe("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",tr),children:[t.jsx(en,{rule:St(nt.rule,u??{},m??void 0),matchers:mt}),t.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),t.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:xn.map((s,o)=>{const d=o===xn.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[o>0&&t.jsx(na,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>Xs(o),title:s,className:xe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?et?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":et?"text-foreground/80":"text-muted-foreground",et?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:s})]},`${s}-${o}`)})}),et&&t.jsxs(Je,{children:[t.jsx(qe,{asChild:!0,children:t.jsx("span",{className:"shrink-0 cursor-help",children:t.jsx(ra,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),t.jsx(Ge,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),gn&&!at&&!Xe?.isHidden&&O&&t.jsx(On,{onClick:()=>$t()})]}),et&&t.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):t.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(ar,{pageKey:O,initialName:ze.name,initialPath:ze.path,onFieldChange:js})}),t.jsxs(Je,{children:[t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>re(!0),children:t.jsx(aa,{size:14})})}),t.jsx(Ge,{side:"bottom",children:"Edit SEO"})]}),t.jsxs(Je,{children:[t.jsx(qe,{asChild:!0,children:t.jsx($e,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>S&&O?S(O):de(!0),children:t.jsx(oa,{size:14})})}),t.jsx(Ge,{side:"bottom",children:"View JSON"})]}),t.jsx(On,{onClick:bn})]})}),dt&&!ut&&!U&&O&&t.jsx(Qo,{listKey:O,variants:Be,activeIndex:Ve,decofile:u??{},meta:m,matchers:mt,onSelect:Us,onReorder:Ws,onRename:se,onDelete:Ys,onAdd:bn}),U?t.jsx(pt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsx("div",{className:"mx-auto max-w-2xl",children:Dt&&O?t.jsx(no,{rawSeo:Pt,innerSeo:on,defaultResolveType:xs,seoSchema:bs,activeResolveType:Vt,seoTypeOptions:vs,formResetKey:Le,siteDefaultSeo:Ss,onBreadcrumbChange:be,onPersistRaw:Js,onInnerChange:Gs,onClearForm:Zs,onBumpFormKey:Qs}):t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):ut?t.jsxs(pt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[at&&ft.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(wo,{variants:ft.map((s,o)=>({index:o,label:s.label})),selectedIndex:hn,onSelect:As,onDuplicate:Vs,onDelete:Ps,onRemoveAll:Ms,onAdd:()=>$t()}),at&&t.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),t.jsx(Vn,{currentRt:ye??"",currentLabel:tt(Ot?.rule),matchers:mt,onSelect:zs}),vn&&Ie&&t.jsx("div",{className:"pt-1",children:t.jsx(Yt,{schema:vn,value:Ie,onChange:Bs,basePath:""})})]})]}),t.jsx(En,{activeSchema:Mt,formValue:N,formResetKey:ue,onFormChange:rn,onBreadcrumbChange:L,breadcrumbPath:ne,emptyMessage:"No editable fields for this variant.",meta:m,decofile:u,onSaveReferencedBlock:tn})]}):_e?t.jsx(pt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx(En,{activeSchema:Mt,formValue:N,formResetKey:ue,onFormChange:rn,onBreadcrumbChange:L,breadcrumbPath:ne,emptyMessage:"No editable fields for this global block.",meta:m,decofile:u,onSaveReferencedBlock:tn})}):t.jsxs(pt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[dt&&$!==null&&t.jsxs("div",{className:xe("px-3 border-b",Q?"pt-3 pb-5 space-y-3":"py-2"),children:[t.jsxs("button",{type:"button",onClick:()=>G(s=>!s),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":Q,children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),Q?t.jsx(sa,{className:"size-3.5 shrink-0 text-muted-foreground"}):t.jsx(Ln,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Q&&t.jsxs("div",{className:xe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:[t.jsx(Vn,{currentRt:$,currentLabel:wn(nt?.rule,u??{},tt,m??void 0),matchers:mt,onSelect:Ls}),cn&&B&&t.jsx("div",{className:"space-y-3",children:t.jsx(Yt,{schema:cn,value:B,onChange:Is,basePath:""})})]})]}),t.jsx("div",{className:"p-2 pt-3",children:t.jsx(Lo,{listKey:`${O??""}-${Ve}`,rawSections:q,sections:Me,meta:m,selectedIndex:p,onSelect:_s,onReorder:ks,onDelete:ws,onDuplicate:Ns,onMakeReusable:oe,onToggleHidden:Cs,onToggleLazy:Ts,onAddVariant:$t,onDetach:Rs,onAddSection:()=>F(!0),canAddSection:$s})})]}),t.jsx(er,{open:ae!==null,onOpenChange:s=>{s||oe(null)},defaultBlockId:ae!==null?Rn(Me[ae]?.label??""):"",isPending:Pe.isPending,onSubmit:Es}),i&&t.jsx(fo,{open:Y,onOpenChange:F,meta:m,decofile:u,previewBaseUrl:i,onSelect:Ds}),X&&O&&u&&t.jsx(_a,{open:X,onOpenChange:de,pageKey:O,decofile:u}),pe!==null&&t.jsx(ho,{open:!0,initialName:Bt(Be[pe]?.rule,u??{},m??void 0)?wn(Be[pe]?.rule,u??{},tt,m??void 0):"",autoLabel:tt(St(Be[pe]?.rule,u??{},m??void 0)),isPending:Nt,onSubmit:async s=>{await qs(pe,s)},onOpenChange:s=>{!s&&!Nt&&se(null)}})]})}export{Ql as SectionsEditor};