decocms 3.36.3 → 3.36.4

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 (235) hide show
  1. package/dist/client/assets/{AlertCircle-BU9gj1Zb.js → AlertCircle-DU4Czymb.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-D2O4sQl3.js → ArrowUpRight-jvt9_jPs.js} +1 -1
  3. package/dist/client/assets/{Check-BmF1hQRY.js → Check-CFZ7jofS.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-C4XwcfjN.js → CheckCircle-B7_GaGqy.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BIO7wba7.js → ChevronDown-CMnvnfNH.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-CW2G6JyB.js → ChevronLeft-BLmY09V7.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CwhL8zaw.js → ChevronRight-DtVYtVbK.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-DdLEv_cl.js → ChevronUp-BYxSfj4f.js} +1 -1
  9. package/dist/client/assets/{Container-Dyf0TzBH.js → Container-CQcCiGBy.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DQMFAww2.js → DotsVertical-7ebFkKLD.js} +1 -1
  11. package/dist/client/assets/{Eye-Bi1ejTfS.js → Eye-CYtfD-C-.js} +1 -1
  12. package/dist/client/assets/{FilterLines-jWyOgIfr.js → FilterLines-BtiGzXwl.js} +1 -1
  13. package/dist/client/assets/{Globe01-DF9PUq9k.js → Globe01-bYDzICLJ.js} +1 -1
  14. package/dist/client/assets/{HardDrive-BIzpSh2R.js → HardDrive-gxQ66xi3.js} +1 -1
  15. package/dist/client/assets/{Key01-DJaxTkjl.js → Key01-CDcV65YU.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-C3u21iqS.js → LayoutLeft-Cy-bGbAH.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-D7mXn_q6.js → LinkExternal01-BDXPmxri.js} +1 -1
  18. package/dist/client/assets/{Monitor01-B2V0QJVA.js → Monitor01-6PVrucyX.js} +1 -1
  19. package/dist/client/assets/{Palette-CvjTgNao.js → Palette-8PqtgYqw.js} +1 -1
  20. package/dist/client/assets/{Play-6yxi-kVu.js → Play-B0CTz7-g.js} +1 -1
  21. package/dist/client/assets/{Plus-D-k489Hw.js → Plus-DW_pro4F.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-0Z7TeT1O.js → RefreshCcw01-B9XxpyTk.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BdcI0VcO.js → SearchMd-BnZZ5mEU.js} +1 -1
  24. package/dist/client/assets/{Settings02-C6hr8Qy9.js → Settings02-BzBPnOVl.js} +1 -1
  25. package/dist/client/assets/{Shield01-DOB3vgca.js → Shield01-CUegYioy.js} +1 -1
  26. package/dist/client/assets/{Star01-Du_V1z61.js → Star01-CjQzvxTy.js} +1 -1
  27. package/dist/client/assets/{Stars01-BAC8f8eM.js → Stars01-BBldOY4r.js} +1 -1
  28. package/dist/client/assets/{Stars02-CpPe-VPg.js → Stars02-COgJsT25.js} +1 -1
  29. package/dist/client/assets/{Sun-C3Zhz8pG.js → Sun-BFeAvEQf.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BRvArA9H.js → SwitchHorizontal01-BQBOH6Au.js} +1 -1
  31. package/dist/client/assets/{Tool01-yFL5Dn59.js → Tool01-BKl-GVq3.js} +1 -1
  32. package/dist/client/assets/{Trash01-Br13J6pg.js → Trash01-BfygLm6s.js} +1 -1
  33. package/dist/client/assets/{Upload01-D4q_2hTt.js → Upload01-ClElEXYw.js} +1 -1
  34. package/dist/client/assets/{User01-BtejVxVG.js → User01-Bi6i4zOy.js} +1 -1
  35. package/dist/client/assets/{Users01-Dy4pn4ki.js → Users01-BXIkeJej.js} +1 -1
  36. package/dist/client/assets/{Users03-CmfKEZdY.js → Users03-DH-6SNzV.js} +1 -1
  37. package/dist/client/assets/{X-DcDNiBgo.js → X-BUzk9ZuQ.js} +1 -1
  38. package/dist/client/assets/{XCircle-e29W-Gcn.js → XCircle-8_cOsjUY.js} +1 -1
  39. package/dist/client/assets/{XClose-D4RzaaY5.js → XClose-CCKAliKU.js} +1 -1
  40. package/dist/client/assets/{Zap-Cp6OTaVi.js → Zap-DMSK7ZyR.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-CvMxvmoA.js → ZapSquare-Dj9sWt3u.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-m5WCE6Ow.js → ZoomOut-DfX9NmNO.js} +1 -1
  43. package/dist/client/assets/{access-gate-B7iLwSTn.js → access-gate-DuwCoW9u.js} +1 -1
  44. package/dist/client/assets/{accordion-DyJkloNK.js → accordion-x86xWE4B.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-CRDse3LE.js → add-section-modal-CtMZ_X5l.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities--0Cd735F.js → agent-capabilities-C3MTl0Im.js} +1 -1
  47. package/dist/client/assets/{agent-icon-MPxc_53p.js → agent-icon-CV7VKepg.js} +1 -1
  48. package/dist/client/assets/{agents-list-DvMDGpVE.js → agents-list-BT8i9CxI.js} +1 -1
  49. package/dist/client/assets/{ai-providers-BZpaXRIt.js → ai-providers-CAzPDdFJ.js} +1 -1
  50. package/dist/client/assets/{alert--QwThtUs.js → alert-Bi903p4n.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-DAZnJbEa.js → alert-dialog-CjyXYSQZ.js} +1 -1
  52. package/dist/client/assets/app-editor-CCjHHUIp.js +1 -0
  53. package/dist/client/assets/{auth-Rhn0UUKX.js → auth-StjmYjna.js} +1 -1
  54. package/dist/client/assets/{auth-catchall-COEk5Dgt.js → auth-catchall-D86Q5OiL.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-BU5p8xYF.js → auth-split-layout-BqxtOd31.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BkqsYOIc.js → automation-list-row-ZsMhYjFo.js} +1 -1
  57. package/dist/client/assets/{automation-runs-CfLYge75.js → automation-runs-CAE5s4jH.js} +1 -1
  58. package/dist/client/assets/{automations-E9ZspVSN.js → automations-DzhdRc4f.js} +1 -1
  59. package/dist/client/assets/{avatar-DgWkRz32.js → avatar-ItW7yKah.js} +1 -1
  60. package/dist/client/assets/{badge-Ckvq5EMT.js → badge-Bw9vN6fg.js} +1 -1
  61. package/dist/client/assets/{brand-context-Cm9JdTeG.js → brand-context-BCx3pSLc.js} +1 -1
  62. package/dist/client/assets/{buckets-Dja8qKdg.js → buckets-C-Dq8Vrb.js} +1 -1
  63. package/dist/client/assets/{calendar-C4NMm-GW.js → calendar-D0RqU72a.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DGtjMdu6.js → capability-load-error-B4z1cdIN.js} +1 -1
  65. package/dist/client/assets/{card-DV2a7ud0.js → card-B0-N4bpb.js} +1 -1
  66. package/dist/client/assets/{chat-context-CQJ83DKW.js → chat-context-BG_brbim.js} +1 -1
  67. package/dist/client/assets/{checkbox-Eb0jgSAR.js → checkbox-BjUgAWJu.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-C5I6pdNq.js → cli-auth-success-Cb5-OjdP.js} +1 -1
  69. package/dist/client/assets/{collection-detail-QmVn7T6P.js → collection-detail-DONQnGGW.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-k6e_w5_8.js → collection-display-button-BpdgmXkn.js} +1 -1
  71. package/dist/client/assets/{collection-search-q3LrsDP0.js → collection-search-BEvxyUp1.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-Wg4_kRAB.js → collection-table-wrapper-CeQ3Kj1L.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CvaARsvN.js → collection-tabs-DM_bzUmO.js} +1 -1
  74. package/dist/client/assets/{collections-DjlDVd1Q.js → collections-DGui_rw4.js} +1 -1
  75. package/dist/client/assets/{command--rBvALtU.js → command-CSF0stL5.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-CkEEvZPz.js → connect-desktop-dialog-BHttcPxA.js} +1 -1
  77. package/dist/client/assets/{connection-card-DqPMpeMB.js → connection-card-DNd6JwtE.js} +1 -1
  78. package/dist/client/assets/{connection-detail-Ceck3IrK.js → connection-detail-DBBp6dEO.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-B6xP1FXS.js → connection-form-helpers-C-CDw2oQ.js} +1 -1
  80. package/dist/client/assets/{connections-BvYO4I8Q.js → connections-BUntGfpQ.js} +1 -1
  81. package/dist/client/assets/{decopilot-DxHNnnUA.js → decopilot-kQEGsQqO.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-yovdq4PK.js +1 -0
  83. package/dist/client/assets/{dialog-pxIgcxdx.js → dialog-FBdtBd0W.js} +1 -1
  84. package/dist/client/assets/{domain-settings-CGcPdYTM.js → domain-settings-DmSveh8r.js} +1 -1
  85. package/dist/client/assets/{drawer-BrCENAAY.js → drawer-CSp117Rg.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-BS4mK__m.js → dropdown-menu-BUlN28jb.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-Cn1BTjpz.js → dynamic-plugin-layout-BxmZPwUZ.js} +1 -1
  88. package/dist/client/assets/{empty-state-Cp1JLYcR.js → empty-state-ByuwXjRC.js} +1 -1
  89. package/dist/client/assets/{empty-state-vCEwHb1v.js → empty-state-DZZ4TCiB.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-16MvAzOh.js → extract-connection-data-D9Xe4stq.js} +1 -1
  91. package/dist/client/assets/{features-Dc3bQW1I.js → features-DV5J5-hq.js} +1 -1
  92. package/dist/client/assets/{file-explorer-CelbZiCq.js → file-explorer-CkhSBrMW.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-B3ZaCMP2.js → file-type-icon-BAmjNPBc.js} +1 -1
  94. package/dist/client/assets/{files-B5orgVDs.js → files-6d_tX66b.js} +1 -1
  95. package/dist/client/assets/{form-DsGRrH4I.js → form-BKRU3_f0.js} +1 -1
  96. package/dist/client/assets/{general-DvWuRP0a.js → general-Co2ymhtz.js} +1 -1
  97. package/dist/client/assets/{generate-id-B0UU4AyI.js → generate-id-CKNg3Kb_.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-BciViNc8.js → github-repo-picker-BXMy0hpf.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-elaOU0d9.js → header-tab-button-CRRaGYWH.js} +1 -1
  100. package/dist/client/assets/{hover-card-DfhDOin0.js → hover-card-dEUH7y9z.js} +1 -1
  101. package/dist/client/assets/{image-field-BIrSC9Gs.js → image-field-CgZHn_on.js} +1 -1
  102. package/dist/client/assets/{index-BMSOEHke.js → index-B6pSigm3.js} +1 -1
  103. package/dist/client/assets/{index-D4tq1hPm.js → index-C8c4nZI1.js} +1 -1
  104. package/dist/client/assets/{index-C8saI2Kn.js → index-CEk0yA7A.js} +21 -21
  105. package/dist/client/assets/{index-DNM2q8BY.js → index-CTVMK9LC.js} +1 -1
  106. package/dist/client/assets/{index-BLEyVrBm.js → index-C_iXtMNn.js} +1 -1
  107. package/dist/client/assets/{index-Dupl0DR-.js → index-CiklrCzm.js} +1 -1
  108. package/dist/client/assets/{index-L_0VXlrp.js → index-Ckn2ukzq.js} +1 -1
  109. package/dist/client/assets/{index-m-rxA9SC.js → index-CsGon0kW.js} +1 -1
  110. package/dist/client/assets/{index-DLRMbGKZ.js → index-CwjMi0Lt.js} +1 -1
  111. package/dist/client/assets/{index-3WWLSqtl.js → index-D5VHt2uj.js} +1 -1
  112. package/dist/client/assets/{index-ChdATVAA.js → index-DEUVODq9.js} +3 -3
  113. package/dist/client/assets/{index-xNHaP-xT.js → index-DGguhABr.js} +1 -1
  114. package/dist/client/assets/{index-DgyLJoal.js → index-DpgH-puy.js} +1 -1
  115. package/dist/client/assets/{index-CkV2wRTX.js → index-DwVG2P9Q.js} +1 -1
  116. package/dist/client/assets/{index-redirect-Cl16_UY5.js → index-redirect-FjuWd7yb.js} +1 -1
  117. package/dist/client/assets/{index-BKFf6V9A.js → index-wos7zFLb.js} +1 -1
  118. package/dist/client/assets/{input-BZ-4l6sv.js → input-CkGEzOB_.js} +1 -1
  119. package/dist/client/assets/{integration-icon-LHjd4NGc.js → integration-icon-D3LrOIav.js} +1 -1
  120. package/dist/client/assets/{label-CGY9toLT.js → label-CxhkSBar.js} +1 -1
  121. package/dist/client/assets/{layout-C8nv7dxR.js → layout-Bt0QDLtr.js} +1 -1
  122. package/dist/client/assets/{login-D5x6WUee.js → login-IwWNwbY4.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-BeZ96noC.js → mcp-oauth-ClRecFEf.js} +1 -1
  124. package/dist/client/assets/{members-0_y-hP8y.js → members-s0QyCnyJ.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-C8DVCvK_.js → monaco-editor-CiwloXdm.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-Dy60nPc4.js → monitoring-stats-row-TXNzfIxp.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-rU6P6YYM.js → oauth-callback-DlXFbr-f.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-CQlojnmt.js → oauth-callback-ai-provider-p8gLjM7e.js} +1 -1
  129. package/dist/client/assets/{onboarding-BsFG_79R.js → onboarding-8moQC7Cm.js} +1 -1
  130. package/dist/client/assets/{org-install-CGnSzU4n.js → org-install-C_oKg9PC.js} +1 -1
  131. package/dist/client/assets/{org-layout-ayqAcIyF.js → org-layout-B8BfjaU4.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-KLX9VenO.js → org-plugin-layout-DdUf_5AW.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-DJemjXau.js → page-seo-form-B-I81VJI.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-BTkQDLYa.js +1 -0
  135. package/dist/client/assets/{pair-BriGg-MY.js → pair-BGqqCdXk.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-CKqj8hWW.js → plugin-empty-state-DoGTEgJq.js} +1 -1
  137. package/dist/client/assets/{plugin-header-Dg_-PVfV.js → plugin-header-DkXNWjlz.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-CFCRHuug.js → plugin-layout-Dp7j6oj5.js} +1 -1
  139. package/dist/client/assets/{popover-hHdVOt7q.js → popover-D6gDvvex.js} +1 -1
  140. package/dist/client/assets/{post-editor-DZXsYKGZ.js → post-editor-HrWJufNf.js} +1 -1
  141. package/dist/client/assets/{primitives-CNx5bddX.js → primitives-BSpEXmPv.js} +1 -1
  142. package/dist/client/assets/{profile-B3k1aQmn.js → profile-DOJoyq1_.js} +1 -1
  143. package/dist/client/assets/project-app-view-DfsCN7aU.js +1 -0
  144. package/dist/client/assets/record-editor-5_5cQlbY.js +1 -0
  145. package/dist/client/assets/registry-BjxgsC2E.js +2 -0
  146. package/dist/client/assets/{registry-layout-C9QKLcDQ.js → registry-layout-_dcZP0XL.js} +1 -1
  147. package/dist/client/assets/{require-capability-D5XZoZnS.js → require-capability-CqCUzyTW.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DhqvkBI0.js → required-auth-layout-9YYeY0t9.js} +1 -1
  149. package/dist/client/assets/{reset-password-D7s0P0GF.js → reset-password-BECGeSUl.js} +1 -1
  150. package/dist/client/assets/{resizable-BRT-qUaD.js → resizable-DV0pCXfQ.js} +1 -1
  151. package/dist/client/assets/{roles-CPQyhIdH.js → roles-D14mg7KI.js} +1 -1
  152. package/dist/client/assets/save-referenced-block-0RMjuyn4.js +1 -0
  153. package/dist/client/assets/{save-status-D1jAW4JE.js → save-status-DfBuYJH7.js} +1 -1
  154. package/dist/client/assets/{schema-form-D3MP878L.js → schema-form-CKIpZkBj.js} +1 -1
  155. package/dist/client/assets/{scroll-area-DKNnXldV.js → scroll-area-CHs0jTz4.js} +1 -1
  156. package/dist/client/assets/{search-input-BQKJCNNI.js → search-input-DLDVTOcp.js} +1 -1
  157. package/dist/client/assets/{secrets-J5Pwn3p4.js → secrets-B1ZULRnd.js} +1 -1
  158. package/dist/client/assets/{sections-editor-rePIiHP9.js → sections-editor-0pqboVrH.js} +1 -1
  159. package/dist/client/assets/{select-6yI1bUUl.js → select-Dyn5eJ76.js} +1 -1
  160. package/dist/client/assets/{select-model-z3ovXylT.js → select-model-BNZKyxON.js} +1 -1
  161. package/dist/client/assets/{seo-editor--9JZnrI6.js → seo-editor-7yhk21tn.js} +1 -1
  162. package/dist/client/assets/{settings-layout-BKOOm0iL.js → settings-layout-CCjX3a3N.js} +1 -1
  163. package/dist/client/assets/{settings-section-BDeKU196.js → settings-section-BsU7NnTR.js} +1 -1
  164. package/dist/client/assets/{sheet-l2LhhOCY.js → sheet-C2l8o7Li.js} +1 -1
  165. package/dist/client/assets/{shell-controls-BxC6c_cJ.js → shell-controls-Da9F6Uwi.js} +1 -1
  166. package/dist/client/assets/{shell-layout-DSzgNlpN.js → shell-layout-D-knukkt.js} +1 -1
  167. package/dist/client/assets/{shell-route-loading-D-NySFQN.js → shell-route-loading-BQnWeFBU.js} +1 -1
  168. package/dist/client/assets/{sidebar-ZxffB9i3.js → sidebar-DMarnfZA.js} +1 -1
  169. package/dist/client/assets/{skeleton-DsBtdATm.js → skeleton-CBG5UooE.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-B7SCN4Iq.js → sortable.esm-B6mcz4jC.js} +1 -1
  171. package/dist/client/assets/{spinner-DynhmXJb.js → spinner-CZkJwfre.js} +1 -1
  172. package/dist/client/assets/{sso-Bya3BiB0.js → sso-DlGhVe9T.js} +1 -1
  173. package/dist/client/assets/{store-C4ZU4zXI.js → store-3PV6elmz.js} +1 -1
  174. package/dist/client/assets/store-registry-JGeWcmph.js +2 -0
  175. package/dist/client/assets/{studio-tools-tx_ynP6E.js → studio-tools-DnIG9YV2.js} +1 -1
  176. package/dist/client/assets/{switch-DWpVVt2b.js → switch-DZavAgGZ.js} +1 -1
  177. package/dist/client/assets/{tab-id-CGE8BPr3.js → tab-id-BxH9ETDC.js} +1 -1
  178. package/dist/client/assets/{table-1jrYsVvf.js → table-C6yf7crt.js} +1 -1
  179. package/dist/client/assets/{tabs-B9aEuz_5.js → tabs-Kstg5esT.js} +1 -1
  180. package/dist/client/assets/{task-status-BgRp2OfZ.js → task-status-Z_8flBXc.js} +1 -1
  181. package/dist/client/assets/{textarea-DbtEiAgf.js → textarea-D_FY-WF9.js} +1 -1
  182. package/dist/client/assets/{toggle-group-BCauVBxS.js → toggle-group-TV66K5Bs.js} +1 -1
  183. package/dist/client/assets/{toolbar-C9WpnxRP.js → toolbar-CCbum7s0.js} +1 -1
  184. package/dist/client/assets/{tools-list-C-j8gu56.js → tools-list-De2JTKaU.js} +1 -1
  185. package/dist/client/assets/{tooltip-CVKtA6h7.js → tooltip-CnO8IxhJ.js} +1 -1
  186. package/dist/client/assets/{types-Bik0zSxz.js → types-yqsHoQS8.js} +1 -1
  187. package/dist/client/assets/{use-ai-providers-Bf7NstiT.js → use-ai-providers-D41Ncdap.js} +1 -1
  188. package/dist/client/assets/{use-automations-DQhoL7n_.js → use-automations-Cjo8cUaV.js} +1 -1
  189. package/dist/client/assets/{use-capability-BekxNShN.js → use-capability-km64e2ng.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-CQKT35Lf.js → use-clock-tick-C5MmRZ_O.js} +1 -1
  191. package/dist/client/assets/{use-collections-DYulUuYs.js → use-collections-Boao6GlT.js} +1 -1
  192. package/dist/client/assets/{use-connection-DpR6JQF5.js → use-connection-D0BF0adZ.js} +1 -1
  193. package/dist/client/assets/{use-copy-BhHE-xFV.js → use-copy-94yZW0qP.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-ZidK7zTv.js → use-create-virtual-mcp-qtUnoDxA.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-2ixaaEOx.js → use-debounced-autosave-Dj71wv9y.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-b1BC9mo1.js → use-delete-connection-C5suM6o1.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-CvNjCdnD.js → use-file-configs-CwuLM8jQ.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-BfpP7RsP.js → use-infinite-scroll-WoD-e-vZ.js} +1 -1
  199. package/dist/client/assets/{use-list-state-BvQ5j7vs.js → use-list-state-D--hQu1j.js} +1 -1
  200. package/dist/client/assets/{use-mcp-client-DjqC1nd8.js → use-mcp-client-DnHVNKKy.js} +1 -1
  201. package/dist/client/assets/{use-mcp-prompts-Drzzskll.js → use-mcp-prompts-B7lJiQ-b.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-BUMls37h.js → use-mcp-tools-Dduxk9LO.js} +1 -1
  203. package/dist/client/assets/{use-members-BiyrTP5I.js → use-members-YdskzoCL.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-B7_UOyHZ.js → use-navigate-to-agent-VVlSVZf7.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-BrG8JDW1.js → use-org-auth-client-5GIyjJUc.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-mx87uCVa.js → use-org-sso-DQRRc4kX.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-_Z-_Ox1y.js → use-organization-roles-BJhlkkyb.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-BWseGhxw.js → use-organization-settings-BRHmZDz1.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-BFZcaU10.js → use-registry-connections-bQBnbYjF.js} +1 -1
  210. package/dist/client/assets/{use-secrets-C-XHa3-0.js → use-secrets-BYUtrbRD.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-D1fVHGXs.js → use-status-sounds-Biot_m4f.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-DjLpAg7F.js → use-view-mode-B-vBbI_P.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-BldCtSoA.js → use-virtual-mcp-kNQ4Vk7l.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-DG9NlZam.js +1 -0
  215. package/dist/client/assets/{useRouterState-BZKGSD2r.js → useRouterState-Clwac4xr.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-D1V_0Wrc.js +1 -0
  217. package/dist/client/assets/{user-Coe1o0e6.js → user-D2dH1j5H.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-GEdPTd_M.js → view-mode-toggle-BVJSd33i.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-C_YrQqjE.js → watch-sse-pool-D12zGFzz.js} +1 -1
  220. package/dist/client/assets/{workflow-ZbQ4bKoz.js → workflow-B3YzgEYC.js} +1 -1
  221. package/dist/client/assets/workflow-detail-CXTSi8aj.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-DOKG-0MP.js +0 -1
  226. package/dist/client/assets/decopilot-sse-pool-CKBDifRl.js +0 -1
  227. package/dist/client/assets/page-seo-sheet-CnqIZbrb.js +0 -1
  228. package/dist/client/assets/project-app-view-B-NllsZl.js +0 -1
  229. package/dist/client/assets/record-editor-DxhzZA73.js +0 -1
  230. package/dist/client/assets/registry-D_rElF24.js +0 -2
  231. package/dist/client/assets/save-referenced-block-VHJ6rXLi.js +0 -1
  232. package/dist/client/assets/store-registry-WPLrtDu9.js +0 -2
  233. package/dist/client/assets/useInfiniteQuery-aPUoKLwo.js +0 -1
  234. package/dist/client/assets/useSuspenseInfiniteQuery-CuHxM8XU.js +0 -1
  235. package/dist/client/assets/workflow-detail-DEuNJrY-.js +0 -1
@@ -1 +1 @@
1
- import{e as U,j as o,r as Q,B as Ce,c as De,n as be}from"./index-ChdATVAA.js";import{ab as Ct,v as It,ar as qe,H as Xe}from"./agent-icon-MPxc_53p.js";import{C as Rt}from"./calendar-C4NMm-GW.js";import{I as ue}from"./input-BZ-4l6sv.js";import{L as le}from"./label-CGY9toLT.js";import{a as Ot,b as Ft,P as Dt}from"./popover-hHdVOt7q.js";import{T as $t}from"./textarea-DbtEiAgf.js";import{S as Bt}from"./switch-DWpVVt2b.js";import{c as ut,S as ft,a as dt,b as pt,d as mt}from"./select-6yI1bUUl.js";import{a as Et,b as Ze,K as Lt,P as Pt,D as zt,c as Mt,S as Vt,v as Ut,f as Kt,e as Qe,d as Ht,C as Wt,s as Yt}from"./sortable.esm-B7SCN4Iq.js";import{d as yt}from"./ZoomOut-m5WCE6Ow.js";import{s as Gt}from"./Plus-D-k489Hw.js";import{s as ht}from"./Trash01-Br13J6pg.js";import{a as qt,b as Xt,c as Zt,D as Qt}from"./dropdown-menu-BS4mK__m.js";import{e as gt,u as Jt,L as en,F as tn,I as Je}from"./image-field-BIrSC9Gs.js";import{l as xt,i as Ie,a as $e,S as vt,P as nn,X as Be,n as Ue,Y as Re,Z as et,_ as rn,$ as sn,a0 as on,a1 as ln}from"./index-C8saI2Kn.js";import{t as bt}from"./ChevronDown-BIO7wba7.js";import{i as jt}from"./ChevronRight-CwhL8zaw.js";import{i as an}from"./Globe01-DF9PUq9k.js";import{T as cn,b as un,a as fn}from"./tooltip-CVKtA6h7.js";import{i as dn}from"./Upload01-D4q_2hTt.js";import{c as pn}from"./use-file-configs-CvNjCdnD.js";function mn(t){if(t?.trim())try{const e=new URL(t);return e.protocol!=="https:"?void 0:e.href}catch{return}}function yn(t){if(Array.isArray(t.variants)){const e=t.variants,n=e.find(i=>i.rule?.__resolveType?.includes("always"));if(typeof n?.value=="string")return n.value;const r=e.find(i=>typeof i.value=="string");if(r)return r.value}if(typeof t.src=="string")return t.src;if(typeof t.url=="string")return t.url;if(typeof t.value=="string")return t.value}function Tt(t){if(typeof t=="string"||t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(Tt);const e=t;return e.__resolveType?yn(e)??t:Nt(e)}function Nt(t){const e={};for(const[n,r]of Object.entries(t))e[n]=Tt(r);return e}function hn(t,e){return e.split(".").reduce((n,r)=>{if(!(n==null||typeof n!="object"))return n[r]},t)}function St(t){return t==null?"":Array.isArray(t)?t.map(St).filter(Boolean).join(","):typeof t=="object"?"":String(t)}function Ke(t,e){if(!t.includes("{"))return;const n=Nt(e);return t.replace(/\{\{\{([^}]+)\}\}\}|\{\{([^}]+)\}\}/g,(i,s,l)=>{const c=(s??l??"").trim();return St(hn(n,c))}).trim()||void 0}function gn(t,e){if(e.includes("{"))return Ke(e,t);const n=t[e];if(typeof n=="string"&&n)return n;if(Array.isArray(n)){const r=n.map(i=>i==null?"":String(i)).filter(Boolean).join(",");if(r)return r}}function ge(t,e,n){if(typeof t=="string")return t||`Item ${e+1}`;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t;if(n?.titleBy){const s=gn(r,n.titleBy);if(s)return s}for(const s of["name","label","title","alt","text","href","id"]){const l=r[s];if(typeof l=="string"&&l)return l;if(Array.isArray(l)){const c=l.map(a=>a==null?"":String(a)).filter(Boolean).join(",");if(c)return c}}const i=r.__resolveType;if(typeof i=="string"&&i)return xt(i);if(n?.title){const s=Ke(n.title,r);if(s)return s;if(!n.title.includes("{"))return n.title}}return`Item ${e+1}`}function xn(t){if(!t)return;if(typeof t.image=="string"&&t.image.includes("{"))return t.image;const e=t.properties?.image;if(!e)return;if(e.format==="image-uri")return"{{{image}}}";const n=e.properties;return n?.mobile?"{{{image.mobile}}}":n?.desktop?"{{{image.desktop}}}":"{{{image}}}"}function tt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return;const n=xn(e);if(!n)return;const r=Ke(n,t);if(!r)return;const i=gt(r)||r;return mn(i)}function _t(t){return t===vt||t===nn}function Ee(t,e){if(!Object.hasOwn(e,t))return null;const n=e[t]??{},r=n.__resolveType??t;return{data:{...n},resolveType:r}}function Oe(t,e){const n=t.__resolveType??"";if(!n)return null;if(Ie(n)){const r=t.section??{};return kt(r,e)}if(_t(n)){const r=t.variants?.[0]?.value;return r?Oe(r,e):null}return!$e(n)||!Object.hasOwn(e,n)?{data:{...t},resolveType:n}:Ee(n,e)}function kt(t,e){const n=t.__resolveType??"";if(!n)return null;if(_t(n)){const r=t.variants?.[0]?.value;return r?Oe(r,e):null}return!$e(n)||!Object.hasOwn(e,n)?{data:{...t},resolveType:n}:Ee(n,e)}function vn(t,e){if(!t||typeof t!="object"||Array.isArray(t))return null;const r=t.__resolveType;if(typeof r!="string"||!$e(r)||!Object.hasOwn(e,r))return null;const i=Ee(r,e);return i?{blockKey:r,...i}:null}function Hr(t,e,n){if(e.isMultivariate)return null;if(e.isSavedBlock){const r=e.isLazy?t.section?.__resolveType??t.__resolveType:t.__resolveType;return Ee(r,n)}if(e.isHidden){const s=(Ie(t.__resolveType)?t.section:t)?.variants?.[0]?.value??t;return Oe(s,n)}if(e.isLazy||Ie(t.__resolveType)){const r=t.section??{};return kt(r,n)}return Oe(t,n)}const he=t=>String(t).padStart(2,"0"),bn="1900-01-01",jn="2099-12-31",Tn="1900-01-01T00:00",Nn="2099-12-31T23:59";function Sn(t){if(!t)return"";const e=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const n=new Date(t);return Number.isNaN(n.getTime())?"":`${n.getUTCFullYear()}-${he(n.getUTCMonth()+1)}-${he(n.getUTCDate())}`}function _n(t){return!t||!/^\d{4}-\d{2}-\d{2}$/.test(t)?"":`${t}T00:00:00.000Z`}function kn(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${he(e.getMonth()+1)}-${he(e.getDate())}T${he(e.getHours())}:${he(e.getMinutes())}`}function An(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toISOString()}function wn(t){const e=U.c(29),{id:n,withTime:r,value:i,onChange:s}=t,[l,c]=Q.useState(!1);let a;e[0]!==i||e[1]!==r?(a=r?kn(i):Sn(i),e[0]=i,e[1]=r,e[2]=a):a=e[2];const d=a;let p;e[3]!==s||e[4]!==r?(p=j=>{s(r?An(j.target.value):_n(j.target.value))},e[3]=s,e[4]=r,e[5]=p):p=e[5];const m=p;let g;if(e[6]!==i){const j=i?new Date(i):null;g=j&&!Number.isNaN(j.getTime())?j:null,e[6]=i,e[7]=g}else g=e[7];const y=g;let v;e[8]!==s||e[9]!==y||e[10]!==r?(v=j=>{j&&(r&&y?j.setHours(y.getHours(),y.getMinutes(),0,0):j.setHours(0,0,0,0),s(j.toISOString()),c(!1))},e[8]=s,e[9]=y,e[10]=r,e[11]=v):v=e[11];const f=v,h=r?"datetime-local":"date",u=r?Tn:bn,x=r?Nn:jn;let b;e[12]!==m||e[13]!==n||e[14]!==d||e[15]!==h||e[16]!==u||e[17]!==x?(b=o.jsx(ue,{id:n,type:h,min:u,max:x,value:d,onChange:m,className:"h-10 flex-1 [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:opacity-0"}),e[12]=m,e[13]=n,e[14]=d,e[15]=h,e[16]=u,e[17]=x,e[18]=b):b=e[18];let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Ot,{asChild:!0,children:o.jsx(Ce,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0","aria-label":"Open calendar",children:o.jsx(Ct,{className:"h-4 w-4"})})}),e[19]=_):_=e[19];const k=y??void 0;let T;e[20]!==f||e[21]!==k?(T=o.jsx(Ft,{className:"w-auto p-0",align:"end",children:o.jsx(Rt,{mode:"single",selected:k,onSelect:f,initialFocus:!0})}),e[20]=f,e[21]=k,e[22]=T):T=e[22];let N;e[23]!==l||e[24]!==T?(N=o.jsxs(Dt,{open:l,onOpenChange:c,children:[_,T]}),e[23]=l,e[24]=T,e[25]=N):N=e[25];let I;return e[26]!==N||e[27]!==b?(I=o.jsxs("div",{className:"flex gap-1",children:[b,N]}),e[26]=N,e[27]=b,e[28]=I):I=e[28],I}function ke(t){const e=U.c(8),{htmlFor:n,label:r,description:i}=t;let s;e[0]!==n||e[1]!==r?(s=o.jsx(le,{htmlFor:n,children:r}),e[0]=n,e[1]=r,e[2]=s):s=e[2];let l;e[3]!==i?(l=i&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:i}),e[3]=i,e[4]=l):l=e[4];let c;return e[5]!==s||e[6]!==l?(c=o.jsxs("div",{className:"space-y-0.5",children:[s,l]}),e[5]=s,e[6]=l,e[7]=c):c=e[7],c}function Ae(t){const e=U.c(61),{schema:n,value:r,onChange:i,path:s,label:l}=t,c=typeof r=="string"?r:"",a=n.format;if(a==="textarea"||a==="rich-text"||a==="rich-text-inline"||a==="markdown"){let f;e[0]!==l||e[1]!==s||e[2]!==n.description?(f=o.jsx(ke,{htmlFor:s,label:l,description:n.description}),e[0]=l,e[1]=s,e[2]=n.description,e[3]=f):f=e[3];let h;e[4]!==i?(h=b=>i(b.target.value),e[4]=i,e[5]=h):h=e[5];let u;e[6]!==s||e[7]!==c||e[8]!==h?(u=o.jsx($t,{id:s,value:c,onChange:h,rows:4}),e[6]=s,e[7]=c,e[8]=h,e[9]=u):u=e[9];let x;return e[10]!==f||e[11]!==u?(x=o.jsxs("div",{className:"space-y-2",children:[f,u]}),e[10]=f,e[11]=u,e[12]=x):x=e[12],x}if(a==="date"||a==="date-time"){let f;e[13]!==l||e[14]!==s||e[15]!==n.description?(f=o.jsx(ke,{htmlFor:s,label:l,description:n.description}),e[13]=l,e[14]=s,e[15]=n.description,e[16]=f):f=e[16];const h=a==="date-time";let u;e[17]!==i||e[18]!==s||e[19]!==c||e[20]!==h?(u=o.jsx(wn,{id:s,withTime:h,value:c,onChange:i}),e[17]=i,e[18]=s,e[19]=c,e[20]=h,e[21]=u):u=e[21];let x;return e[22]!==f||e[23]!==u?(x=o.jsxs("div",{className:"space-y-2",children:[f,u]}),e[22]=f,e[23]=u,e[24]=x):x=e[24],x}if(a==="color-input"){let f;e[25]!==l||e[26]!==s||e[27]!==n.description?(f=o.jsx(ke,{htmlFor:s,label:l,description:n.description}),e[25]=l,e[26]=s,e[27]=n.description,e[28]=f):f=e[28];const h=c||"#000000";let u;e[29]!==i?(u=N=>i(N.target.value),e[29]=i,e[30]=u):u=e[30];let x;e[31]!==h||e[32]!==u?(x=o.jsx("input",{type:"color",value:h,onChange:u,className:"h-10 w-10 cursor-pointer rounded-lg border border-border bg-background p-1"}),e[31]=h,e[32]=u,e[33]=x):x=e[33];let b;e[34]!==i?(b=N=>i(N.target.value),e[34]=i,e[35]=b):b=e[35];let _;e[36]!==s||e[37]!==c||e[38]!==b?(_=o.jsx(ue,{id:s,value:c,onChange:b,placeholder:"#000000",className:"h-10 flex-1"}),e[36]=s,e[37]=c,e[38]=b,e[39]=_):_=e[39];let k;e[40]!==x||e[41]!==_?(k=o.jsxs("div",{className:"flex items-center gap-2",children:[x,_]}),e[40]=x,e[41]=_,e[42]=k):k=e[42];let T;return e[43]!==f||e[44]!==k?(T=o.jsxs("div",{className:"space-y-2",children:[f,k]}),e[43]=f,e[44]=k,e[45]=T):T=e[45],T}let d;e[46]!==l||e[47]!==s||e[48]!==n.description?(d=o.jsx(ke,{htmlFor:s,label:l,description:n.description}),e[46]=l,e[47]=s,e[48]=n.description,e[49]=d):d=e[49];const p=a==="url"?"url":"text";let m;e[50]!==i?(m=f=>i(f.target.value),e[50]=i,e[51]=m):m=e[51];const g=n.default!=null?String(n.default):void 0;let y;e[52]!==s||e[53]!==c||e[54]!==p||e[55]!==m||e[56]!==g?(y=o.jsx(ue,{id:s,type:p,value:c,onChange:m,placeholder:g,className:"h-10"}),e[52]=s,e[53]=c,e[54]=p,e[55]=m,e[56]=g,e[57]=y):y=e[57];let v;return e[58]!==d||e[59]!==y?(v=o.jsxs("div",{className:"space-y-2",children:[d,y]}),e[58]=d,e[59]=y,e[60]=v):v=e[60],v}function Cn(t){const e=U.c(17),{schema:n,value:r,onChange:i,path:s,label:l}=t,c=typeof r=="number"?r:"";let a;e[0]!==l||e[1]!==s?(a=o.jsx(le,{htmlFor:s,children:l}),e[0]=l,e[1]=s,e[2]=a):a=e[2];let d;e[3]!==n.description?(d=n.description&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[3]=n.description,e[4]=d):d=e[4];let p;e[5]!==a||e[6]!==d?(p=o.jsxs("div",{className:"space-y-0.5",children:[a,d]}),e[5]=a,e[6]=d,e[7]=p):p=e[7];let m;e[8]!==i?(m=v=>{const f=v.target.value;i(f===""?void 0:Number(f))},e[8]=i,e[9]=m):m=e[9];let g;e[10]!==c||e[11]!==s||e[12]!==m?(g=o.jsx(ue,{id:s,type:"number",value:c,onChange:m,className:"h-10"}),e[10]=c,e[11]=s,e[12]=m,e[13]=g):g=e[13];let y;return e[14]!==p||e[15]!==g?(y=o.jsxs("div",{className:"space-y-2",children:[p,g]}),e[14]=p,e[15]=g,e[16]=y):y=e[16],y}function In(t){const e=U.c(17),{value:n,onChange:r,path:i,label:s,schema:l}=t,c=typeof n=="boolean"?n:!1;let a;e[0]!==s||e[1]!==i?(a=o.jsx(le,{htmlFor:i,children:s}),e[0]=s,e[1]=i,e[2]=a):a=e[2];let d;e[3]!==l.description?(d=l.description&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:l.description}),e[3]=l.description,e[4]=d):d=e[4];let p;e[5]!==a||e[6]!==d?(p=o.jsxs("div",{className:"space-y-0.5",children:[a,d]}),e[5]=a,e[6]=d,e[7]=p):p=e[7];let m;e[8]!==r?(m=v=>r(v),e[8]=r,e[9]=m):m=e[9];let g;e[10]!==c||e[11]!==i||e[12]!==m?(g=o.jsx(Bt,{id:i,checked:c,onCheckedChange:m}),e[10]=c,e[11]=i,e[12]=m,e[13]=g):g=e[13];let y;return e[14]!==p||e[15]!==g?(y=o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p,g]}),e[14]=p,e[15]=g,e[16]=y):y=e[16],y}const He="__enum_empty__";function We(t){return t===""?He:String(t)}function Rn(t,e){if(t===He)return"";const n=e.find(r=>We(r)===t);return n!==void 0?n:t}function On(t,e){return t==null?e.some(n=>n==="")?He:void 0:We(t)}function Fn(t){return t===""?"":String(t)}function Dn(t){const e=U.c(28),{schema:n,value:r,onChange:i,path:s,label:l}=t;let c;e[0]!==n.enum?(c=n.enum??[],e[0]=n.enum,e[1]=c):c=e[1];const a=c;let d;e[2]!==a||e[3]!==r?(d=On(r,a),e[2]=a,e[3]=r,e[4]=d):d=e[4];const p=d;let m;e[5]!==l||e[6]!==s?(m=o.jsx(le,{htmlFor:s,children:l}),e[5]=l,e[6]=s,e[7]=m):m=e[7];let g;e[8]!==n.description?(g=n.description&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[8]=n.description,e[9]=g):g=e[9];let y;e[10]!==m||e[11]!==g?(y=o.jsxs("div",{className:"space-y-0.5",children:[m,g]}),e[10]=m,e[11]=g,e[12]=y):y=e[12];let v;e[13]!==i||e[14]!==a?(v=_=>i(Rn(_,a)),e[13]=i,e[14]=a,e[15]=v):v=e[15];let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(ft,{className:"h-10",children:o.jsx(dt,{placeholder:"Select..."})}),e[16]=f):f=e[16];let h;e[17]!==a?(h=a.map($n),e[17]=a,e[18]=h):h=e[18];let u;e[19]!==h?(u=o.jsx(pt,{children:h}),e[19]=h,e[20]=u):u=e[20];let x;e[21]!==p||e[22]!==v||e[23]!==u?(x=o.jsxs(mt,{value:p,onValueChange:v,children:[f,u]}),e[21]=p,e[22]=v,e[23]=u,e[24]=x):x=e[24];let b;return e[25]!==x||e[26]!==y?(b=o.jsxs("div",{className:"space-y-2",children:[y,x]}),e[25]=x,e[26]=y,e[27]=b):b=e[27],b}function $n(t){const e=We(t);return o.jsx(ut,{value:e,children:Fn(t)},e)}function Bn(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/^\w/,e=>e.toUpperCase())}function Te(t){return t.normalize("NFC").trim()}function V(t,e){return Te(t)===Te(e)}function we(t,e,n){const r=Te(n);if(t.some(l=>V(l,r)||V(l,n)))return t;const i=[...t];return i.some(l=>V(l,e))||i.push(e),i.push(n),i}function En(t,e,n){if(n.length===0)return n;const r=Fe(t,e),i=n[0];return V(i,r)||V(i,t)?n.slice(1):n}function Fe(t,e){return e.title??Bn(t)}function Wr(t,e){return e<=0?[]:t.slice(0,e)}function nt(t,e){const n=Te(e);return t.findIndex(r=>Te(r)===n)}function rt(t,e){return t.type==="array"&&t.items||Be(t)?!0:Array.isArray(e)}function Ln(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Ne(t,e,n,r){if(r.length===0)return null;const i=r[0];for(const s of t){const l=e[s];if(!l||!rt(l,n[s]))continue;const c=Fe(s,l);if(V(i,c)||V(i,s)||r.some(a=>V(a,c)||V(a,s)))return s}for(const s of t){const l=e[s];if(!l||!rt(l,n[s]))continue;const c=n[s];if(!Array.isArray(c))continue;const a=l.items;for(let d=0;d<c.length;d++){const p=ge(c[d],d,a);if(V(p,i))return s}}for(const s of t){const l=e[s];if(l?.type!=="object"||!l.properties)continue;const c=Object.keys(l.properties),a=Ln(n[s]),d=Fe(s,l);if(Ne(c,l.properties,a,r)||(V(i,d)||V(i,s))&&Ne(c,l.properties,a,r.slice(1)))return s}return null}function Pn(t,e,n,r){return Ne(t,e,n,r)}function zn(t,e,n,r,i){if(i.length===0||!n.properties)return!1;const s=Object.keys(n.properties);if(Ne(s,n.properties,r,i))return!0;const l=i[0];return!V(l,e)&&!V(l,t)?!1:i.length>1||Ne(s,n.properties,r,i.slice(1))!==null}function Mn(t,e,n,r){if(e.length===0)return null;for(let s=0;s<e.length;s++){const l=e[s],c=n.findIndex((a,d)=>V(ge(a,d,r),l));if(c>=0)return{index:c,innerPath:e.slice(s+1)}}const i=e.findIndex(s=>V(s,t));if(i>=0&&e.length>i+1){const s=e[i+1],l=n.findIndex((c,a)=>V(ge(c,a,r),s));if(l>=0)return{index:l,innerPath:e.slice(i+2)}}return null}function ze(t){return t.includes("/sections/")||t.includes("multivariate/section")||t===vt}function Vn(t){if(t.type==="block-ref"&&t.anyOfRefs?.length)return t.anyOfRefs.some(n=>ze(n.resolveType));if(t.anyOfRefs?.length)return t.anyOfRefs.some(n=>ze(n.resolveType));const e=t.properties?.__resolveType;return e?.type==="block-ref"&&e.anyOfRefs?.length?e.anyOfRefs.some(n=>ze(n.resolveType)):!1}function Un(t,e){if(e==="global"||e==="sections"||Be(t))return!0;const n=t.type==="array"?t.items:void 0;return n?Vn(n):!1}function st(t){return Array.from({length:t},(e,n)=>({id:crypto.randomUUID(),index:n}))}function Kn(t,e,n,r,i){if(e?.type==="object"&&e.properties&&Object.keys(e.properties).length>0||e?.type==="block-ref"&&e.anyOfRefs?.length)return e;if(t!=null&&typeof t=="object"&&!Array.isArray(t)){const s=t.__resolveType;if(typeof s=="string"&&n){const l=Ue(s,n);if(l?.properties&&Object.keys(l.properties).length>0)return l}}if(n&&r&&i){const l=Ue(r,n)?.properties?.[i]?.items;if(l?.properties&&Object.keys(l.properties).length>0)return{...l,titleBy:l.titleBy??e?.titleBy}}return e}function Hn(t){const e=t.split(".").filter(n=>!/^\d+$/.test(n));return e[e.length-1]??t}function At(t){return t.map((e,n)=>({...e,index:n}))}function Wn(t,e){if(e===t.length)return t;if(e<t.length)return At(t.slice(0,e));const n=Array.from({length:e-t.length},(r,i)=>({id:crypto.randomUUID(),index:t.length+i}));return[...t,...n]}function Yn(t){const e=U.c(8),{labelText:n,imageSrc:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(yt,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),e[0]=i):i=e[0];let s;e[1]!==r?(s=r&&o.jsx("img",{src:r,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[1]=r,e[2]=s):s=e[2];let l;e[3]!==n?(l=o.jsx("span",{className:"min-w-0 truncate",children:n}),e[3]=n,e[4]=l):l=e[4];let c;return e[5]!==s||e[6]!==l?(c=o.jsxs(o.Fragment,{children:[i,o.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5 text-sm",children:[s,l]})]}),e[5]=s,e[6]=l,e[7]=c):c=e[7],c}function Gn(t){const e=U.c(37),{sortableId:n,labelText:r,imageSrc:i,onOpen:s,onRemove:l}=t;let c;e[0]!==n?(c={id:n,animateLayoutChanges:Zn},e[0]=n,e[1]=c):c=e[1];const{attributes:a,listeners:d,setNodeRef:p,transform:m,isDragging:g}=Ht(c);let y;e[2]!==m?(y=Wt.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=y):y=e[3];const v=g?0:void 0;let f;e[4]!==y||e[5]!==v?(f={transform:y,opacity:v},e[4]=y,e[5]=v,e[6]=f):f=e[6];const h=f;let u;e[7]!==s?(u=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),s())},e[7]=s,e[8]=u):u=e[8];const x=g?"cursor-grabbing":"cursor-pointer";let b;e[9]!==x?(b=De("group flex min-w-0 items-center gap-2.5 rounded-lg px-2 py-2.5 hover:bg-accent hover:text-accent-foreground touch-none",x),e[9]=x,e[10]=b):b=e[10];let _;e[11]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(yt,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),e[11]=_):_=e[11];let k;e[12]!==i?(k=i&&o.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[12]=i,e[13]=k):k=e[13];let T;e[14]!==r?(T=o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:r}),e[14]=r,e[15]=T):T=e[15];const N=`Open actions for ${r}`;let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(It,{size:14}),e[16]=I):I=e[16];let j;e[17]!==N?(j=o.jsx(qt,{asChild:!0,children:o.jsx(Ce,{type:"button",variant:"ghost",size:"icon","aria-label":N,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:Xn,onPointerDown:qn,children:I})}),e[17]=N,e[18]=j):j=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(ht,{size:14}),e[19]=S):S=e[19];let w;e[20]!==l?(w=o.jsx(Xt,{align:"end",children:o.jsxs(Zt,{className:"text-destructive focus:text-destructive",onClick:l,children:[S,"Delete"]})}),e[20]=l,e[21]=w):w=e[21];let C;e[22]!==j||e[23]!==w?(C=o.jsxs(Qt,{children:[j,w]}),e[22]=j,e[23]=w,e[24]=C):C=e[24];let O;return e[25]!==a||e[26]!==r||e[27]!==d||e[28]!==s||e[29]!==p||e[30]!==h||e[31]!==T||e[32]!==C||e[33]!==u||e[34]!==b||e[35]!==k?(O=o.jsxs("div",{ref:p,style:h,...a,...d,role:"button",tabIndex:0,onClick:s,onKeyDown:u,className:b,title:r,children:[_,k,T,C]}),e[25]=a,e[26]=r,e[27]=d,e[28]=s,e[29]=p,e[30]=h,e[31]=T,e[32]=C,e[33]=u,e[34]=b,e[35]=k,e[36]=O):O=e[36],O}function qn(t){return t.stopPropagation()}function Xn(t){return t.stopPropagation()}function Zn(){return!1}function Me(t){const e=U.c(24),{schema:n,value:r,onChange:i,path:s,label:l,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m,containerResolveType:g,previewBaseUrl:y,onAddSectionItem:v,onRequestAddSection:f}=t,h=c===void 0?[]:c,u=Array.isArray(r)?r:[],x=n.items,b=Hn(s),_=Un(n,b),k=Mn(l,h,u,x),T=k?.index??null,[N,I]=Q.useState(()=>st(u.length)),[j,S]=Q.useState(null),[w,C]=Q.useState(s),[O,F]=Q.useState(u.length),z=Q.useRef(!1);w!==s?(C(s),F(u.length),I(st(u.length))):O!==u.length&&(F(u.length),I(A=>Wn(A,u.length)));let B;e[0]!==x?(B=(A,D)=>ge(A,D,x),e[0]=x,e[1]=B):B=e[1];const M=B,J=A=>{if(z.current)return;const D=M(u[A],A);a?.(we(h,l,D))},W=A=>{const D=[...u,A];i(D);const E=D.length-1,P=ge(A,E,x);a?.(we(h,l,P))},re=()=>{const A=x?.type,D=x?.default!==void 0?x.default:A==="object"?{}:A==="block-ref"?(()=>{const ce=x?.anyOfRefs?.[0]?.resolveType;return typeof ce!="string"||Re(ce)?{}:{__resolveType:ce}})():A==="number"||A==="integer"?0:A==="boolean"?!1:A==="array"?[]:"",E=[...u,D];i(E);const P=E.length-1,oe=ge(D,P,x);a?.(we(h,l,oe))},H=()=>{if(_){if(!y){be.error("Start the preview dev server to add sections.");return}if(f){f({append:W});return}be.error("Section picker is not available in this editor.");return}re()},se=A=>{if(i(u.filter((D,E)=>E!==A)),T===A){const D=M(u[A],A),E=nt(h,D);a?.(E>=0?h.slice(0,E):[])}},ee=(A,D)=>{const E=[...u];E[A]=D,i(E)};let ie;e[2]===Symbol.for("react.memo_cache_sentinel")?(ie={activationConstraint:{distance:8}},e[2]=ie):ie=e[2];let Y;e[3]===Symbol.for("react.memo_cache_sentinel")?(Y={coordinateGetter:Yt},e[3]=Y):Y=e[3];const G=Et(Ze(Pt,ie),Ze(Lt,Y)),q=N.map(Qn);let K;e[4]===Symbol.for("react.memo_cache_sentinel")?(K=A=>{S(String(A.active.id))},e[4]=K):K=e[4];const X=K,te=A=>{S(null);const{active:D,over:E}=A;if(!E||D.id===E.id)return;const P=q.indexOf(String(D.id)),oe=q.indexOf(String(E.id));P===-1||oe===-1||(I(ce=>At(Qe([...ce],P,oe))),i(Qe([...u],P,oe)),z.current=!0,requestAnimationFrame(()=>{z.current=!1}))};let R;e[5]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{S(null)},e[5]=R):R=e[5];const $=R,L=j?N.find(A=>A.id===j):null,ne=L!=null?u[L.index]:void 0,ae=L!=null&&ne!==void 0?M(ne,L.index):null,fe=L!=null&&ne!==void 0?tt(ne,x):void 0;if(T!==null&&T<u.length){const A=u[T],D=Kn(A,x,d,g,b),E=()=>{const P=M(A,T),oe=we(h,l,P),ce=nt(oe,P);return ce>=0?oe.slice(0,ce+1):oe};return o.jsx("div",{className:"min-w-0",children:D?.type==="object"&&D.properties?o.jsx(Ge,{schema:D,value:A,onChange:P=>ee(T,P),basePath:`${s}.${T}`,breadcrumbPath:k?.innerPath??[],onBreadcrumbChange:P=>{a?.([...E(),...P])},meta:d,decofile:p,onSaveReferencedBlock:m,previewBaseUrl:y,onAddSectionItem:v,onRequestAddSection:f}):D?wt({schema:D,value:A,onChange:P=>ee(T,P),path:`${s}.${T}`,label:D.title??`Item ${T+1}`,breadcrumbPath:k?.innerPath??[],onBreadcrumbChange:P=>{a?.([...E(),...P])},meta:d,decofile:p,onSaveReferencedBlock:m,previewBaseUrl:y,onAddSectionItem:v,onRequestAddSection:f}):null})}const xe="space-y-2";let Z;e[6]!==l?(Z=o.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:l}),e[6]=l,e[7]=Z):Z=e[7];const ve=u.length>0&&o.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:u.length});let de;e[8]!==Z||e[9]!==ve?(de=o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[Z,ve]}),e[8]=Z,e[9]=ve,e[10]=de):de=e[10];let pe;e[11]!==n.description?(pe=n.description&&o.jsx("p",{className:"break-words text-xs leading-normal text-muted-foreground",children:n.description}),e[11]=n.description,e[12]=pe):pe=e[12];let me;e[13]!==de||e[14]!==pe?(me=o.jsxs("div",{className:"min-w-0 space-y-0.5",children:[de,pe]}),e[13]=de,e[14]=pe,e[15]=me):me=e[15];const Le=u.length>0&&o.jsx("div",{className:De(j&&"cursor-grabbing"),children:o.jsxs(zt,{sensors:G,collisionDetection:Mt,onDragStart:X,onDragEnd:te,onDragCancel:$,children:[o.jsx(Vt,{items:q,strategy:Ut,children:o.jsx("div",{className:"min-w-0 overflow-hidden rounded-xl border border-border/50 p-1.5",children:N.map(A=>{const D=u[A.index];if(D===void 0)return null;const E=M(D,A.index),P=tt(D,x);return o.jsx(Gn,{sortableId:A.id,labelText:E,imageSrc:P,onOpen:()=>J(A.index),onRemove:()=>se(A.index)},A.id)})})}),o.jsx(Kt,{dropAnimation:null,children:ae?o.jsx("div",{className:"flex min-w-0 items-center gap-2.5 rounded-lg border border-border/60 bg-background px-2 py-2.5 shadow-lg ring-1 ring-border/60",children:o.jsx(Yn,{labelText:ae,imageSrc:fe})}):null})]})});let Se;e[16]===Symbol.for("react.memo_cache_sentinel")?(Se=o.jsx(Gt,{size:14}),e[16]=Se):Se=e[16];const Pe=_?"Add section":"Add item";let ye;e[17]!==H||e[18]!==Pe?(ye=o.jsxs("button",{type:"button",onClick:H,className:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-border/60 py-2.5 text-sm text-muted-foreground transition-colors hover:border-border hover:bg-muted/30",children:[Se,Pe]}),e[17]=H,e[18]=Pe,e[19]=ye):ye=e[19];let _e;return e[20]!==me||e[21]!==Le||e[22]!==ye?(_e=o.jsxs("div",{className:xe,children:[me,Le,ye]}),e[20]=me,e[21]=Le,e[22]=ye,e[23]=_e):_e=e[23],_e}function Qn(t){return t.id}function Jn(t){const e=U.c(43),{schema:n,value:r,onChange:i,path:s,label:l,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m,previewBaseUrl:g,onAddSectionItem:y,onRequestAddSection:v}=t;let f;e[0]!==c?(f=c===void 0?[]:c,e[0]=c,e[1]=f):f=e[1];const h=f,[u,x]=Q.useState(!1);let b;e[2]!==r?(b=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},e[2]=r,e[3]=b):b=e[3];const _=b;if(!n.properties)return null;let k;e[4]!==s?(k=s.split(".").pop()??s,e[4]=s,e[5]=k):k=e[5];const T=k;let N;e[6]!==h||e[7]!==T||e[8]!==l||e[9]!==_||e[10]!==n?(N=zn(T,l,n,_,h),e[6]=h,e[7]=T,e[8]=l,e[9]=_,e[10]=n,e[11]=N):N=e[11];const j=u||N,S=`${s}-fields`;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=()=>x(er),e[12]=w):w=e[12];let C;e[13]!==j?(C=o.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors group-hover:text-accent-foreground",children:j?o.jsx(bt,{size:16}):o.jsx(jt,{size:16})}),e[13]=j,e[14]=C):C=e[14];let O;e[15]!==l?(O=o.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:l}),e[15]=l,e[16]=O):O=e[16];let F;e[17]!==S||e[18]!==j||e[19]!==C||e[20]!==O?(F=o.jsxs("button",{type:"button","aria-expanded":j,"aria-controls":S,onClick:w,className:"group flex w-full min-w-0 items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:bg-accent hover:text-accent-foreground",children:[C,O]}),e[17]=S,e[18]=j,e[19]=C,e[20]=O,e[21]=F):F=e[21];let z;e[22]!==n.description?(z=n.description&&o.jsx("p",{className:"break-words pl-9 text-xs leading-normal text-muted-foreground",children:n.description}),e[22]=n.description,e[23]=z):z=e[23];let B;e[24]!==h||e[25]!==S||e[26]!==p||e[27]!==j||e[28]!==d||e[29]!==_||e[30]!==y||e[31]!==a||e[32]!==i||e[33]!==v||e[34]!==m||e[35]!==s||e[36]!==g||e[37]!==n?(B=j&&o.jsx("div",{id:S,className:"ml-3 min-w-0 max-w-full overflow-hidden border-l border-border/80 pl-5",children:o.jsx(Ge,{schema:n,value:_,onChange:i,basePath:s,breadcrumbPath:h,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m,previewBaseUrl:g,onAddSectionItem:y,onRequestAddSection:v})}),e[24]=h,e[25]=S,e[26]=p,e[27]=j,e[28]=d,e[29]=_,e[30]=y,e[31]=a,e[32]=i,e[33]=v,e[34]=m,e[35]=s,e[36]=g,e[37]=n,e[38]=B):B=e[38];let M;return e[39]!==z||e[40]!==B||e[41]!==F?(M=o.jsxs("div",{className:"min-w-0 space-y-2",children:[F,z,B]}),e[39]=z,e[40]=B,e[41]=F,e[42]=M):M=e[42],M}function er(t){return!t}function Ye(t){const e=t.__resolveType;if(typeof e!="string")return null;if(Ie(e)){const r=t.section?.__resolveType;return typeof r=="string"?r:e}return e}function tr(t){return t.includes("flags/multivariate")}function nr(t){return xt(t)}function rr(t,e){const n=[...t],r=new Set(n.map(s=>s.resolveType)),i=(s,l)=>{!s||r.has(s)||(r.add(s),n.push({resolveType:s,title:l??nr(s)}))};if(e.savedBlockKey&&i(e.savedBlockKey,e.savedBlockKey),e.editorValue&&typeof e.editorValue=="object"&&!Array.isArray(e.editorValue)){const s=Ye(e.editorValue);s?.includes("/")&&i(s)}return n}function sr(t,e,n){const r=e[0]?.resolveType??"";if(n)return n;if(!t||typeof t!="object"||Array.isArray(t))return r;const i=t,s=i.__resolveType;if(typeof s=="string"){if($e(s)){const m=e.find(g=>g.resolveType===s);return m?m.resolveType:s}const d=e.find(m=>et(m.resolveType,s));if(d)return d.resolveType;const p=e.find(m=>m.resolveType===s);if(p)return p.resolveType;if(s.includes("/"))return s}const l=typeof i.type=="string"?i.type:void 0;if(l){const d=e.find(p=>p.discriminatorValue===l||p.resolveType===l||et(p.resolveType,l));if(d)return d.resolveType}let c=r,a=-1;for(const d of e){if(!d.schema?.properties)continue;const m=Object.keys(d.schema.properties).filter(g=>!g.startsWith("__")&&g!=="@type"&&g!=="action"&&g!=="alt").filter(g=>i[g]!==void 0).length;m>0&&m>a&&(a=m,c=d.resolveType)}return a>0,c}function it(t,e,n){if(!t||typeof t!="object"||Array.isArray(t))return n??null;const r=Ye(t);if(!r)return n??null;if(!e)return r.includes("/")?null:n??null;const i=Ue(r,e);return i||(r.includes("/")?null:n??null)}function ir(t,e){if(!t?.properties||!e)return t??null;if(!(e in t.properties))return t;const n={...t.properties};return delete n[e],{...t,properties:n}}function or(t,e){if(e)return!0;if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t,r=Ye(n);return r&&tr(r)?Array.isArray(n.variants)&&n.variants.length>0:Object.keys(n).some(i=>!i.startsWith("__")&&i!=="@type")}function lr(t){if(!t?.properties)return{};const e={};for(const[n,r]of Object.entries(t.properties))n.startsWith("__")||n==="@type"||(r.default!==void 0?e[n]=r.default:r.type==="boolean"?e[n]=!1:r.type==="string"?e[n]="":r.type==="number"||r.type==="integer"?e[n]=0:r.type==="object"&&(e[n]={}));return e}function ar(t){const e=U.c(3),{blockKey:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(cn,{asChild:!0,children:o.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[o.jsx(an,{size:11}),"Global"]})}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=o.jsxs(un,{children:[r,o.jsxs(fn,{side:"top",className:"max-w-[260px]",children:["Edits the saved block “",n,"”. Changes apply everywhere this loader is referenced on your site."]})]}),e[1]=n,e[2]=i):i=e[2],i}function cr(t){const e=U.c(28),{path:n,open:r,onOpenChange:i,title:s,nested:l,nestedBlockRef:c,globalBlockKey:a}=t,d=`${n}-loader-config`,p=c&&"ml-1";let m;e[0]!==p?(m=De("rounded-lg border border-border/80 bg-muted/30",p),e[0]=p,e[1]=m):m=e[1];let g;e[2]!==i||e[3]!==r?(g=()=>i(!r),e[2]=i,e[3]=r,e[4]=g):g=e[4];let y;e[5]!==r?(y=o.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center text-muted-foreground transition-colors group-hover:text-foreground",children:r?o.jsx(bt,{size:16}):o.jsx(jt,{size:16})}),e[5]=r,e[6]=y):y=e[6];let v;e[7]!==s?(v=o.jsx("span",{className:"truncate text-xs font-medium tracking-wide text-muted-foreground uppercase",children:s}),e[7]=s,e[8]=v):v=e[8];let f;e[9]!==a?(f=a&&o.jsx(ar,{blockKey:a}),e[9]=a,e[10]=f):f=e[10];let h;e[11]!==v||e[12]!==f?(h=o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[v,f]}),e[11]=v,e[12]=f,e[13]=h):h=e[13];let u;e[14]!==d||e[15]!==r||e[16]!==g||e[17]!==y||e[18]!==h?(u=o.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":d,onClick:g,className:"group flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[y,h]}),e[14]=d,e[15]=r,e[16]=g,e[17]=y,e[18]=h,e[19]=u):u=e[19];let x;e[20]!==d||e[21]!==l||e[22]!==r?(x=r&&o.jsx("div",{id:d,className:"border-t border-border/60 px-4 pb-4 pt-3",children:o.jsx("div",{className:"border-l border-border/80 pl-4",children:l})}),e[20]=d,e[21]=l,e[22]=r,e[23]=x):x=e[23];let b;return e[24]!==m||e[25]!==u||e[26]!==x?(b=o.jsxs("div",{className:m,children:[u,x]}),e[24]=m,e[25]=u,e[26]=x,e[27]=b):b=e[27],b}function ot(t){const e=U.c(30),{schema:n,value:r,onChange:i,path:s,label:l,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m}=t,g=(n.anyOfRefs??[]).filter(dr),y=p&&r?vn(r,p):null,v=y?.data??r,f=rr(g,{savedBlockKey:y?.blockKey,editorValue:v}),h=f.length>0?sr(v,f,y?.blockKey):f[0]?.resolveType??"",[u,x]=Q.useState(h),[b,_]=Q.useState(h);b!==h&&(_(h),x(h));const[k,T]=Q.useState(()=>or(v,y?.blockKey));if(f.length>0){const F=u||h;let z;e[0]!==F?(z=R=>R.resolveType===F,e[0]=F,e[1]=z):z=e[1];const B=f.find(z),M=it(v,d,B?.schema),J=ir(M??B?.schema??null,n.discriminatorKey),W=n.discriminatorKey,re=R=>{x(R);const $=f.find(Z=>Z.resolveType===R),L=it(v,d,$?.schema),ne=new Set(Object.keys((L??$?.schema)?.properties??{})),ae=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:{},fe=Object.fromEntries(Object.entries(ae).filter(Z=>{const[ve]=Z;return ne.has(ve)})),xe={...lr($?.schema),...fe};if(W){const Z=$?.discriminatorValue??R;i({...xe,[W]:Z});return}if(Re(R)){i(xe);return}i({...xe,__resolveType:R})};let H;e[2]!==F||e[3]!==W||e[4]!==i?(H=R=>{if(W||!Re(F)||R===null||typeof R!="object"||Array.isArray(R)){i(R);return}const{__resolveType:$,...L}=R;i(L)},e[2]=F,e[3]=W,e[4]=i,e[5]=H):H=e[5];const se=H,ee=J?.properties?o.jsx(Ge,{schema:J,value:v,onChange:R=>{if(y&&m){m(y.blockKey,R);return}se(R)},basePath:s,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m}):null,Y=n.type==="block-ref"&&f.some(fr);let G;e[6]!==s?(G=s.includes("."),e[6]=s,e[7]=G):G=e[7];const q=G;let K;e[8]!==l||e[9]!==s?(K=o.jsx(le,{htmlFor:s,children:l}),e[8]=l,e[9]=s,e[10]=K):K=e[10];let X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=o.jsx(ft,{children:o.jsx(dt,{placeholder:"Select..."})}),e[11]=X):X=e[11];let te;return e[12]!==n.description?(te=n.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[12]=n.description,e[13]=te):te=e[13],o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[K,o.jsxs(mt,{value:F||void 0,onValueChange:re,children:[X,o.jsx(pt,{children:f.map(ur)})]}),te]}),ee&&(Y?o.jsx(cr,{path:s,open:k,onOpenChange:T,title:q?"Configuration":"Loader configuration",nested:ee,nestedBlockRef:q,globalBlockKey:y?.blockKey}):ee)]})}if(n.anyOfRefs&&n.anyOfRefs.length>0)return null;let N;e[14]!==l||e[15]!==s?(N=o.jsx(le,{htmlFor:s,children:l}),e[14]=l,e[15]=s,e[16]=N):N=e[16];const I=r!=null?String(r):"";let j;e[17]!==i?(j=F=>i(F.target.value),e[17]=i,e[18]=j):j=e[18];const S=n.description??"";let w;e[19]!==s||e[20]!==I||e[21]!==j||e[22]!==S?(w=o.jsx("input",{id:s,type:"text",value:I,onChange:j,className:"w-full rounded-md border bg-background px-3 py-1.5 text-sm",placeholder:S}),e[19]=s,e[20]=I,e[21]=j,e[22]=S,e[23]=w):w=e[23];let C;e[24]!==n.description?(C=n.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=C):C=e[25];let O;return e[26]!==N||e[27]!==w||e[28]!==C?(O=o.jsxs("div",{className:"space-y-1.5",children:[N,w,C]}),e[26]=N,e[27]=w,e[28]=C,e[29]=O):O=e[29],O}function ur(t){return o.jsx(ut,{value:t.resolveType,children:t.title??rn(t.resolveType)??t.resolveType},t.resolveType)}function fr(t){return t.resolveType.includes("/")&&!Re(t.resolveType)}function dr(t){return t.resolveType!==""}function lt(t){const e=U.c(2),{ext:n}=t;if(!n)return null;let r;return e[0]!==n?(r=o.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function pr(t){try{const e=new URL(t).pathname;return decodeURIComponent(e.split("/").pop()??t)}catch{return t.split("/").pop()??t}}function mr(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"":t.slice(e+1).toLowerCase()}function at(t){const e=U.c(72),{schema:n,value:r,onChange:i,path:s,label:l}=t,c=n.format==="video-uri",a=gt(r),[d,p]=Q.useState(!1),[m,g]=Q.useState(!1),y=a?pr(a):"",v=y?mr(y):"",f=pn(),h=Jt();let u;e[0]!==f.data?.configs?(u=function(){const $=f.data?.configs??[];if($.length===1)return $[0].id;if($.length===0)return null;const L=typeof window<"u"?window.localStorage.getItem(en):null;return $.some(ne=>ne.id===L)?L:null},e[0]=f.data?.configs,e[1]=u):u=e[1];const x=u;let b;e[2]!==c||e[3]!==i||e[4]!==x||e[5]!==p||e[6]!==h?(b=async function($){if(!$)return;let L=Array.from($);if(L.length===0)return;if(c&&(L=L.filter(yr),L.length===0)){be.error("Please drop a video file (mp4, webm, …).");return}const ne=x();if(!ne){p(!0);return}try{const ae=await h.mutateAsync({configId:ne,file:L[0]});i(ae.publicUrl),L.length>1&&be.info(`Uploaded ${L[0].name}; extra files were ignored (single-select field).`)}catch(ae){const fe=ae;be.error(fe instanceof Error?fe.message:"Upload failed")}},e[2]=c,e[3]=i,e[4]=x,e[5]=p,e[6]=h,e[7]=b):b=e[7];const _=b;let k;e[8]!==g?(k=function($){$.preventDefault(),$.dataTransfer.types.includes("Files")&&g(!0)},e[8]=g,e[9]=k):k=e[9];const T=k;let N;e[10]!==g?(N=function($){$.currentTarget===$.target&&g(!1)},e[10]=g,e[11]=N):N=e[11];const I=N;let j;e[12]!==_||e[13]!==g?(j=function($){$.preventDefault(),g(!1),_($.dataTransfer.files)},e[12]=_,e[13]=g,e[14]=j):j=e[14];const S=j;let w;e[15]!==l||e[16]!==s?(w=o.jsx(le,{htmlFor:s,className:"text-muted-foreground",children:l}),e[15]=l,e[16]=s,e[17]=w):w=e[17];let C;e[18]!==n.description?(C=n.description&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=C):C=e[19];let O;e[20]!==w||e[21]!==C?(O=o.jsxs("div",{className:"min-w-0 space-y-0.5",children:[w,C]}),e[20]=w,e[21]=C,e[22]=O):O=e[22];const F=m&&"border-primary ring-2 ring-primary/30",z=h.isPending&&"pointer-events-none opacity-60";let B;e[23]!==z||e[24]!==F?(B=De("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",F,z),e[23]=z,e[24]=F,e[25]=B):B=e[25];let M;e[26]!==v||e[27]!==y||e[28]!==c||e[29]!==p||e[30]!==a||e[31]!==h.isPending?(M=a?c?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"relative h-40 w-full overflow-hidden bg-black",children:o.jsx("video",{src:a,preload:"metadata",className:"h-full w-full object-contain"},a)}),o.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[o.jsx(qe,{size:14,className:"shrink-0 text-muted-foreground"}),o.jsx("p",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:y}),o.jsx(lt,{ext:v})]})]}):o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[o.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-md bg-background",children:o.jsx(Xe,{size:18,className:"text-muted-foreground"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:y}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a})]}),o.jsx(lt,{ext:v})]}):o.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex w-full flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[c?o.jsx(qe,{size:20}):o.jsx(Xe,{size:20}),o.jsx("span",{className:"text-sm font-medium",children:h.isPending?"Uploading…":c?"Drop a video here or click to browse":"Drop a file or click to browse"}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"Up to 100 MB"})]}),e[26]=v,e[27]=y,e[28]=c,e[29]=p,e[30]=a,e[31]=h.isPending,e[32]=M):M=e[32];let J;e[33]!==m?(J=m&&o.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:o.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[33]=m,e[34]=J):J=e[34];let W;e[35]!==I||e[36]!==T||e[37]!==S||e[38]!==B||e[39]!==M||e[40]!==J?(W=o.jsxs("div",{onDragOver:T,onDragLeave:I,onDrop:S,className:B,children:[M,J]}),e[35]=I,e[36]=T,e[37]=S,e[38]=B,e[39]=M,e[40]=J,e[41]=W):W=e[41];let re;e[42]!==i?(re=R=>i(R.target.value),e[42]=i,e[43]=re):re=e[43];let H;e[44]!==s||e[45]!==a||e[46]!==re?(H=o.jsx(ue,{id:s,type:"url",value:a,onChange:re,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[44]=s,e[45]=a,e[46]=re,e[47]=H):H=e[47];let se;e[48]!==p?(se=()=>p(!0),e[48]=p,e[49]=se):se=e[49];let ee;e[50]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(dn,{size:14}),e[50]=ee):ee=e[50];const ie=a?"Replace":"Browse";let Y;e[51]!==se||e[52]!==ie?(Y=o.jsxs(Ce,{type:"button",variant:"outline",size:"sm",onClick:se,className:"h-9 shrink-0",children:[ee,ie]}),e[51]=se,e[52]=ie,e[53]=Y):Y=e[53];let G;e[54]!==i||e[55]!==a?(G=a&&o.jsx(Ce,{type:"button",variant:"ghost",size:"sm",onClick:()=>i(""),className:"h-9 shrink-0","aria-label":"Remove file",children:o.jsx(ht,{size:14})}),e[54]=i,e[55]=a,e[56]=G):G=e[56];let q;e[57]!==H||e[58]!==Y||e[59]!==G?(q=o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[H,Y,G]}),e[57]=H,e[58]=Y,e[59]=G,e[60]=q):q=e[60];let K;e[61]!==i?(K=R=>i(R),e[61]=i,e[62]=K):K=e[62];let X;e[63]!==d||e[64]!==p||e[65]!==K?(X=o.jsx(tn,{open:d,onOpenChange:p,mode:"any",onSelect:K}),e[63]=d,e[64]=p,e[65]=K,e[66]=X):X=e[66];let te;return e[67]!==W||e[68]!==q||e[69]!==X||e[70]!==O?(te=o.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[O,W,q,X]}),e[67]=W,e[68]=q,e[69]=X,e[70]=O,e[71]=te):te=e[71],te}function yr(t){return t.type.startsWith("video/")}const hr="website/loaders/secret.ts";function je(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t.__resolveType;return typeof e=="string"&&(e.endsWith("/secret.ts")||e.includes("loaders/secret"))}function gr(){return{__resolveType:hr,name:"",encrypted:""}}function xr(t){const{value:e,...n}=t;return n}function Ve(t){const e=U.c(45),{schema:n,value:r,onChange:i,label:s,path:l}=t;if(typeof r=="string"||r==null&&!je(r)){const N=typeof r=="string"?r:"";let I;e[0]!==s||e[1]!==l?(I=o.jsx(le,{htmlFor:l,className:"text-sm font-medium",children:s}),e[0]=s,e[1]=l,e[2]=I):I=e[2];let j;e[3]!==n.description?(j=n.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[3]=n.description,e[4]=j):j=e[4];let S;e[5]!==i?(S=O=>i(O.target.value),e[5]=i,e[6]=S):S=e[6];let w;e[7]!==l||e[8]!==N||e[9]!==S?(w=o.jsx(ue,{id:l,type:"password",value:N,autoComplete:"new-password",autoCorrect:"off",spellCheck:!1,placeholder:"Secret value",onChange:S,className:"h-10"}),e[7]=l,e[8]=N,e[9]=S,e[10]=w):w=e[10];let C;return e[11]!==I||e[12]!==j||e[13]!==w?(C=o.jsxs("div",{className:"space-y-2",children:[I,j,w]}),e[11]=I,e[12]=j,e[13]=w,e[14]=C):C=e[14],C}let c;e[15]!==r?(c=je(r)?r:gr(),e[15]=r,e[16]=c):c=e[16];const a=c,d=typeof a.name=="string"?a.name:"",p=typeof a.encrypted=="string"&&a.encrypted,m=`${l}-name`;let g;e[17]!==s||e[18]!==m?(g=o.jsx(le,{htmlFor:m,className:"text-sm font-medium",children:s}),e[17]=s,e[18]=m,e[19]=g):g=e[19];let y;e[20]!==n.description?(y=n.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[20]=n.description,e[21]=y):y=e[21];const v=`${l}-name`;let f;e[22]!==a||e[23]!==i?(f=N=>i({...a,name:N.target.value}),e[22]=a,e[23]=i,e[24]=f):f=e[24];let h;e[25]!==d||e[26]!==v||e[27]!==f?(h=o.jsx(ue,{id:v,value:d,placeholder:"Secret name",onChange:f,className:"h-10"}),e[25]=d,e[26]=v,e[27]=f,e[28]=h):h=e[28];const u=`${l}-value`,x=p?"Leave blank to keep current value":"Secret value";let b;e[29]!==a||e[30]!==p||e[31]!==i?(b=N=>{const I=N.target.value;if(!I){i(p?xr(a):a);return}i({...a,value:I})},e[29]=a,e[30]=p,e[31]=i,e[32]=b):b=e[32];let _;e[33]!==b||e[34]!==u||e[35]!==x?(_=o.jsx(ue,{id:u,type:"password",autoComplete:"new-password",autoCorrect:"off",spellCheck:!1,placeholder:x,onChange:b,className:"h-10"}),e[33]=b,e[34]=u,e[35]=x,e[36]=_):_=e[36];let k;e[37]!==p?(k=p&&o.jsx("p",{className:"text-xs text-muted-foreground",children:"A secret value is stored."}),e[37]=p,e[38]=k):k=e[38];let T;return e[39]!==_||e[40]!==k||e[41]!==g||e[42]!==y||e[43]!==h?(T=o.jsxs("div",{className:"space-y-2",children:[g,y,h,_,k]}),e[39]=_,e[40]=k,e[41]=g,e[42]=y,e[43]=h,e[44]=T):T=e[44],T}const vr=new Set(["__resolveType","@type"]);function br(t){if(t.type!=="block-ref"||!t.anyOfRefs?.length||t.anyOfRefs.length!==1)return null;const e=t.anyOfRefs[0].resolveType;return e.endsWith("/multivariate/image.ts")?"image":e.endsWith("/multivariate/video.ts")||e.endsWith("/multivariate/file.ts")?"file":null}function jr(t){if(Be(t))for(const e of t.anyOfRefs??[]){const i=e.schema?.properties?.variants?.items?.properties?.value;if(i?.type==="array"&&i.items)return i.items}}function ct(t){if(t.type==="array"&&t.items)return t;const e=t.items??jr(t);return e?{...t,type:"array",items:e}:null}function Tr(t,e){if(e!==void 0)return e;switch(t){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}}function wt(t){const{schema:e,value:n}=t;if(sn(n)){const l=on(n),c=ct(e);if(l!==null&&c)return o.jsx(Me,{...t,schema:c,value:l,onChange:a=>t.onChange(ln(n,a))},t.path)}if(Array.isArray(n)&&e.type==="block-ref"&&Be(e)){const l=ct(e);if(l)return o.jsx(Me,{...t,schema:l,value:n,onChange:t.onChange},t.path)}if(e.type==="block-ref"||n!==null&&typeof n=="object"&&!Array.isArray(n)&&typeof n.__resolveType=="string"&&e.anyOfRefs){const l=br(e);return l==="image"?o.jsx(Je,{...t},t.path):l==="file"?o.jsx(at,{...t},t.path):e.anyOfRefs?o.jsx(ot,{...t},t.path):null}if(e.format==="image-uri")return o.jsx(Je,{...t},t.path);if(e.format==="file-uri"||e.format==="video-uri")return o.jsx(at,{...t},t.path);if(e.enum&&e.enum.length>0)return o.jsx(Dn,{...t},t.path);if(e.type==="anyOf")return o.jsx(ot,{...t},t.path);if(je(n)||e.format==="password"||n==null&&e.format==="password")return o.jsx(Ve,{...t},t.path);const r=n??Tr(e.type,e.default);if(r==null)return je(n)?o.jsx(Ve,{...t},t.path):null;if(je(r))return o.jsx(Ve,{...t,value:r},t.path);const i={...t,value:r},s=n==null?e.type??typeof r:Array.isArray(r)?"array":typeof r;if(s==="array"||Array.isArray(r))return o.jsx(Me,{...i},t.path);switch(s){case"boolean":return o.jsx(In,{...i},t.path);case"number":case"integer":return o.jsx(Cn,{...i},t.path);case"string":{const l=e.format;return l==="color-input"?o.jsx(Ae,{...i},t.path):l==="textarea"||l==="rich-text"||l==="html"?o.jsx(Ae,{...i},t.path):o.jsx(Ae,{...i},t.path)}case"object":return r!==null&&typeof r=="object"&&!Array.isArray(r)?o.jsx(Jn,{...i},t.path):null;default:return o.jsx(Ae,{...i},t.path)}}function Ge(t){const e=U.c(15),{schema:n,value:r,onChange:i,basePath:s,breadcrumbPath:l,onBreadcrumbChange:c,meta:a,decofile:d,onSaveReferencedBlock:p,previewBaseUrl:m,onAddSectionItem:g,onRequestAddSection:y}=t;let v,f;if(e[0]!==s||e[1]!==d||e[2]!==a||e[3]!==g||e[4]!==c||e[5]!==i||e[6]!==y||e[7]!==p||e[8]!==m||e[9]!==n.properties||e[10]!==l||e[11]!==r){f=Symbol.for("react.early_return_sentinel");e:{const h=l===void 0?[]:l,u=n.properties;if(!u){f=null;break e}const x=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},b=Object.keys(u).filter(S=>!vr.has(S)&&u[S]?.hidden!==!0);if(b.length===0){let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields on this section."}),e[14]=S):S=e[14],f=S;break e}const _=(S,w)=>{i({...x,[S]:w})},k=typeof x.__resolveType=="string"?x.__resolveType:void 0,T=h.length>0?Pn(b,u,x,h):null,N=T?u[T]:null,I=T&&N?[T]:b,j=T&&N?En(T,N,h):h;v=o.jsx("div",{className:"min-w-0 space-y-6",children:I.map(S=>{const w=u[S];if(!w)return null;const C=s?`${s}.${S}`:S,O=Fe(S,w);return wt({schema:w,value:x[S],onChange:F=>_(S,F),path:C,label:O,breadcrumbPath:j,onBreadcrumbChange:c,meta:a,decofile:d,onSaveReferencedBlock:p,containerResolveType:k,previewBaseUrl:m,onAddSectionItem:g,onRequestAddSection:y})})})}e[0]=s,e[1]=d,e[2]=a,e[3]=g,e[4]=c,e[5]=i,e[6]=y,e[7]=p,e[8]=m,e[9]=n.properties,e[10]=l,e[11]=r,e[12]=v,e[13]=f}else v=e[12],f=e[13];return f!==Symbol.for("react.early_return_sentinel")?f:v}export{Ge as S,wt as a,Wr as b,Ae as c,Ke as r,mn as s,Hr as u};
1
+ import{e as U,j as o,r as Q,B as Ce,c as De,n as be}from"./index-DEUVODq9.js";import{ab as Ct,v as It,ar as qe,H as Xe}from"./agent-icon-CV7VKepg.js";import{C as Rt}from"./calendar-D0RqU72a.js";import{I as ue}from"./input-CkGEzOB_.js";import{L as le}from"./label-CxhkSBar.js";import{a as Ot,b as Ft,P as Dt}from"./popover-D6gDvvex.js";import{T as $t}from"./textarea-D_FY-WF9.js";import{S as Bt}from"./switch-DZavAgGZ.js";import{c as ut,S as ft,a as dt,b as pt,d as mt}from"./select-Dyn5eJ76.js";import{a as Et,b as Ze,K as Lt,P as Pt,D as zt,c as Mt,S as Vt,v as Ut,f as Kt,e as Qe,d as Ht,C as Wt,s as Yt}from"./sortable.esm-B6mcz4jC.js";import{d as yt}from"./ZoomOut-DfX9NmNO.js";import{s as Gt}from"./Plus-DW_pro4F.js";import{s as ht}from"./Trash01-BfygLm6s.js";import{a as qt,b as Xt,c as Zt,D as Qt}from"./dropdown-menu-BUlN28jb.js";import{e as gt,u as Jt,L as en,F as tn,I as Je}from"./image-field-CgZHn_on.js";import{l as xt,i as Ie,a as $e,S as vt,P as nn,X as Be,n as Ue,Y as Re,Z as et,_ as rn,$ as sn,a0 as on,a1 as ln}from"./index-CEk0yA7A.js";import{t as bt}from"./ChevronDown-CMnvnfNH.js";import{i as jt}from"./ChevronRight-DtVYtVbK.js";import{i as an}from"./Globe01-bYDzICLJ.js";import{T as cn,b as un,a as fn}from"./tooltip-CnO8IxhJ.js";import{i as dn}from"./Upload01-ClElEXYw.js";import{c as pn}from"./use-file-configs-CwuLM8jQ.js";function mn(t){if(t?.trim())try{const e=new URL(t);return e.protocol!=="https:"?void 0:e.href}catch{return}}function yn(t){if(Array.isArray(t.variants)){const e=t.variants,n=e.find(i=>i.rule?.__resolveType?.includes("always"));if(typeof n?.value=="string")return n.value;const r=e.find(i=>typeof i.value=="string");if(r)return r.value}if(typeof t.src=="string")return t.src;if(typeof t.url=="string")return t.url;if(typeof t.value=="string")return t.value}function Tt(t){if(typeof t=="string"||t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(Tt);const e=t;return e.__resolveType?yn(e)??t:Nt(e)}function Nt(t){const e={};for(const[n,r]of Object.entries(t))e[n]=Tt(r);return e}function hn(t,e){return e.split(".").reduce((n,r)=>{if(!(n==null||typeof n!="object"))return n[r]},t)}function St(t){return t==null?"":Array.isArray(t)?t.map(St).filter(Boolean).join(","):typeof t=="object"?"":String(t)}function Ke(t,e){if(!t.includes("{"))return;const n=Nt(e);return t.replace(/\{\{\{([^}]+)\}\}\}|\{\{([^}]+)\}\}/g,(i,s,l)=>{const c=(s??l??"").trim();return St(hn(n,c))}).trim()||void 0}function gn(t,e){if(e.includes("{"))return Ke(e,t);const n=t[e];if(typeof n=="string"&&n)return n;if(Array.isArray(n)){const r=n.map(i=>i==null?"":String(i)).filter(Boolean).join(",");if(r)return r}}function ge(t,e,n){if(typeof t=="string")return t||`Item ${e+1}`;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t;if(n?.titleBy){const s=gn(r,n.titleBy);if(s)return s}for(const s of["name","label","title","alt","text","href","id"]){const l=r[s];if(typeof l=="string"&&l)return l;if(Array.isArray(l)){const c=l.map(a=>a==null?"":String(a)).filter(Boolean).join(",");if(c)return c}}const i=r.__resolveType;if(typeof i=="string"&&i)return xt(i);if(n?.title){const s=Ke(n.title,r);if(s)return s;if(!n.title.includes("{"))return n.title}}return`Item ${e+1}`}function xn(t){if(!t)return;if(typeof t.image=="string"&&t.image.includes("{"))return t.image;const e=t.properties?.image;if(!e)return;if(e.format==="image-uri")return"{{{image}}}";const n=e.properties;return n?.mobile?"{{{image.mobile}}}":n?.desktop?"{{{image.desktop}}}":"{{{image}}}"}function tt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return;const n=xn(e);if(!n)return;const r=Ke(n,t);if(!r)return;const i=gt(r)||r;return mn(i)}function _t(t){return t===vt||t===nn}function Ee(t,e){if(!Object.hasOwn(e,t))return null;const n=e[t]??{},r=n.__resolveType??t;return{data:{...n},resolveType:r}}function Oe(t,e){const n=t.__resolveType??"";if(!n)return null;if(Ie(n)){const r=t.section??{};return kt(r,e)}if(_t(n)){const r=t.variants?.[0]?.value;return r?Oe(r,e):null}return!$e(n)||!Object.hasOwn(e,n)?{data:{...t},resolveType:n}:Ee(n,e)}function kt(t,e){const n=t.__resolveType??"";if(!n)return null;if(_t(n)){const r=t.variants?.[0]?.value;return r?Oe(r,e):null}return!$e(n)||!Object.hasOwn(e,n)?{data:{...t},resolveType:n}:Ee(n,e)}function vn(t,e){if(!t||typeof t!="object"||Array.isArray(t))return null;const r=t.__resolveType;if(typeof r!="string"||!$e(r)||!Object.hasOwn(e,r))return null;const i=Ee(r,e);return i?{blockKey:r,...i}:null}function Hr(t,e,n){if(e.isMultivariate)return null;if(e.isSavedBlock){const r=e.isLazy?t.section?.__resolveType??t.__resolveType:t.__resolveType;return Ee(r,n)}if(e.isHidden){const s=(Ie(t.__resolveType)?t.section:t)?.variants?.[0]?.value??t;return Oe(s,n)}if(e.isLazy||Ie(t.__resolveType)){const r=t.section??{};return kt(r,n)}return Oe(t,n)}const he=t=>String(t).padStart(2,"0"),bn="1900-01-01",jn="2099-12-31",Tn="1900-01-01T00:00",Nn="2099-12-31T23:59";function Sn(t){if(!t)return"";const e=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const n=new Date(t);return Number.isNaN(n.getTime())?"":`${n.getUTCFullYear()}-${he(n.getUTCMonth()+1)}-${he(n.getUTCDate())}`}function _n(t){return!t||!/^\d{4}-\d{2}-\d{2}$/.test(t)?"":`${t}T00:00:00.000Z`}function kn(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${he(e.getMonth()+1)}-${he(e.getDate())}T${he(e.getHours())}:${he(e.getMinutes())}`}function An(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toISOString()}function wn(t){const e=U.c(29),{id:n,withTime:r,value:i,onChange:s}=t,[l,c]=Q.useState(!1);let a;e[0]!==i||e[1]!==r?(a=r?kn(i):Sn(i),e[0]=i,e[1]=r,e[2]=a):a=e[2];const d=a;let p;e[3]!==s||e[4]!==r?(p=j=>{s(r?An(j.target.value):_n(j.target.value))},e[3]=s,e[4]=r,e[5]=p):p=e[5];const m=p;let g;if(e[6]!==i){const j=i?new Date(i):null;g=j&&!Number.isNaN(j.getTime())?j:null,e[6]=i,e[7]=g}else g=e[7];const y=g;let v;e[8]!==s||e[9]!==y||e[10]!==r?(v=j=>{j&&(r&&y?j.setHours(y.getHours(),y.getMinutes(),0,0):j.setHours(0,0,0,0),s(j.toISOString()),c(!1))},e[8]=s,e[9]=y,e[10]=r,e[11]=v):v=e[11];const f=v,h=r?"datetime-local":"date",u=r?Tn:bn,x=r?Nn:jn;let b;e[12]!==m||e[13]!==n||e[14]!==d||e[15]!==h||e[16]!==u||e[17]!==x?(b=o.jsx(ue,{id:n,type:h,min:u,max:x,value:d,onChange:m,className:"h-10 flex-1 [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:opacity-0"}),e[12]=m,e[13]=n,e[14]=d,e[15]=h,e[16]=u,e[17]=x,e[18]=b):b=e[18];let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Ot,{asChild:!0,children:o.jsx(Ce,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0","aria-label":"Open calendar",children:o.jsx(Ct,{className:"h-4 w-4"})})}),e[19]=_):_=e[19];const k=y??void 0;let T;e[20]!==f||e[21]!==k?(T=o.jsx(Ft,{className:"w-auto p-0",align:"end",children:o.jsx(Rt,{mode:"single",selected:k,onSelect:f,initialFocus:!0})}),e[20]=f,e[21]=k,e[22]=T):T=e[22];let N;e[23]!==l||e[24]!==T?(N=o.jsxs(Dt,{open:l,onOpenChange:c,children:[_,T]}),e[23]=l,e[24]=T,e[25]=N):N=e[25];let I;return e[26]!==N||e[27]!==b?(I=o.jsxs("div",{className:"flex gap-1",children:[b,N]}),e[26]=N,e[27]=b,e[28]=I):I=e[28],I}function ke(t){const e=U.c(8),{htmlFor:n,label:r,description:i}=t;let s;e[0]!==n||e[1]!==r?(s=o.jsx(le,{htmlFor:n,children:r}),e[0]=n,e[1]=r,e[2]=s):s=e[2];let l;e[3]!==i?(l=i&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:i}),e[3]=i,e[4]=l):l=e[4];let c;return e[5]!==s||e[6]!==l?(c=o.jsxs("div",{className:"space-y-0.5",children:[s,l]}),e[5]=s,e[6]=l,e[7]=c):c=e[7],c}function Ae(t){const e=U.c(61),{schema:n,value:r,onChange:i,path:s,label:l}=t,c=typeof r=="string"?r:"",a=n.format;if(a==="textarea"||a==="rich-text"||a==="rich-text-inline"||a==="markdown"){let f;e[0]!==l||e[1]!==s||e[2]!==n.description?(f=o.jsx(ke,{htmlFor:s,label:l,description:n.description}),e[0]=l,e[1]=s,e[2]=n.description,e[3]=f):f=e[3];let h;e[4]!==i?(h=b=>i(b.target.value),e[4]=i,e[5]=h):h=e[5];let u;e[6]!==s||e[7]!==c||e[8]!==h?(u=o.jsx($t,{id:s,value:c,onChange:h,rows:4}),e[6]=s,e[7]=c,e[8]=h,e[9]=u):u=e[9];let x;return e[10]!==f||e[11]!==u?(x=o.jsxs("div",{className:"space-y-2",children:[f,u]}),e[10]=f,e[11]=u,e[12]=x):x=e[12],x}if(a==="date"||a==="date-time"){let f;e[13]!==l||e[14]!==s||e[15]!==n.description?(f=o.jsx(ke,{htmlFor:s,label:l,description:n.description}),e[13]=l,e[14]=s,e[15]=n.description,e[16]=f):f=e[16];const h=a==="date-time";let u;e[17]!==i||e[18]!==s||e[19]!==c||e[20]!==h?(u=o.jsx(wn,{id:s,withTime:h,value:c,onChange:i}),e[17]=i,e[18]=s,e[19]=c,e[20]=h,e[21]=u):u=e[21];let x;return e[22]!==f||e[23]!==u?(x=o.jsxs("div",{className:"space-y-2",children:[f,u]}),e[22]=f,e[23]=u,e[24]=x):x=e[24],x}if(a==="color-input"){let f;e[25]!==l||e[26]!==s||e[27]!==n.description?(f=o.jsx(ke,{htmlFor:s,label:l,description:n.description}),e[25]=l,e[26]=s,e[27]=n.description,e[28]=f):f=e[28];const h=c||"#000000";let u;e[29]!==i?(u=N=>i(N.target.value),e[29]=i,e[30]=u):u=e[30];let x;e[31]!==h||e[32]!==u?(x=o.jsx("input",{type:"color",value:h,onChange:u,className:"h-10 w-10 cursor-pointer rounded-lg border border-border bg-background p-1"}),e[31]=h,e[32]=u,e[33]=x):x=e[33];let b;e[34]!==i?(b=N=>i(N.target.value),e[34]=i,e[35]=b):b=e[35];let _;e[36]!==s||e[37]!==c||e[38]!==b?(_=o.jsx(ue,{id:s,value:c,onChange:b,placeholder:"#000000",className:"h-10 flex-1"}),e[36]=s,e[37]=c,e[38]=b,e[39]=_):_=e[39];let k;e[40]!==x||e[41]!==_?(k=o.jsxs("div",{className:"flex items-center gap-2",children:[x,_]}),e[40]=x,e[41]=_,e[42]=k):k=e[42];let T;return e[43]!==f||e[44]!==k?(T=o.jsxs("div",{className:"space-y-2",children:[f,k]}),e[43]=f,e[44]=k,e[45]=T):T=e[45],T}let d;e[46]!==l||e[47]!==s||e[48]!==n.description?(d=o.jsx(ke,{htmlFor:s,label:l,description:n.description}),e[46]=l,e[47]=s,e[48]=n.description,e[49]=d):d=e[49];const p=a==="url"?"url":"text";let m;e[50]!==i?(m=f=>i(f.target.value),e[50]=i,e[51]=m):m=e[51];const g=n.default!=null?String(n.default):void 0;let y;e[52]!==s||e[53]!==c||e[54]!==p||e[55]!==m||e[56]!==g?(y=o.jsx(ue,{id:s,type:p,value:c,onChange:m,placeholder:g,className:"h-10"}),e[52]=s,e[53]=c,e[54]=p,e[55]=m,e[56]=g,e[57]=y):y=e[57];let v;return e[58]!==d||e[59]!==y?(v=o.jsxs("div",{className:"space-y-2",children:[d,y]}),e[58]=d,e[59]=y,e[60]=v):v=e[60],v}function Cn(t){const e=U.c(17),{schema:n,value:r,onChange:i,path:s,label:l}=t,c=typeof r=="number"?r:"";let a;e[0]!==l||e[1]!==s?(a=o.jsx(le,{htmlFor:s,children:l}),e[0]=l,e[1]=s,e[2]=a):a=e[2];let d;e[3]!==n.description?(d=n.description&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[3]=n.description,e[4]=d):d=e[4];let p;e[5]!==a||e[6]!==d?(p=o.jsxs("div",{className:"space-y-0.5",children:[a,d]}),e[5]=a,e[6]=d,e[7]=p):p=e[7];let m;e[8]!==i?(m=v=>{const f=v.target.value;i(f===""?void 0:Number(f))},e[8]=i,e[9]=m):m=e[9];let g;e[10]!==c||e[11]!==s||e[12]!==m?(g=o.jsx(ue,{id:s,type:"number",value:c,onChange:m,className:"h-10"}),e[10]=c,e[11]=s,e[12]=m,e[13]=g):g=e[13];let y;return e[14]!==p||e[15]!==g?(y=o.jsxs("div",{className:"space-y-2",children:[p,g]}),e[14]=p,e[15]=g,e[16]=y):y=e[16],y}function In(t){const e=U.c(17),{value:n,onChange:r,path:i,label:s,schema:l}=t,c=typeof n=="boolean"?n:!1;let a;e[0]!==s||e[1]!==i?(a=o.jsx(le,{htmlFor:i,children:s}),e[0]=s,e[1]=i,e[2]=a):a=e[2];let d;e[3]!==l.description?(d=l.description&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:l.description}),e[3]=l.description,e[4]=d):d=e[4];let p;e[5]!==a||e[6]!==d?(p=o.jsxs("div",{className:"space-y-0.5",children:[a,d]}),e[5]=a,e[6]=d,e[7]=p):p=e[7];let m;e[8]!==r?(m=v=>r(v),e[8]=r,e[9]=m):m=e[9];let g;e[10]!==c||e[11]!==i||e[12]!==m?(g=o.jsx(Bt,{id:i,checked:c,onCheckedChange:m}),e[10]=c,e[11]=i,e[12]=m,e[13]=g):g=e[13];let y;return e[14]!==p||e[15]!==g?(y=o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[p,g]}),e[14]=p,e[15]=g,e[16]=y):y=e[16],y}const He="__enum_empty__";function We(t){return t===""?He:String(t)}function Rn(t,e){if(t===He)return"";const n=e.find(r=>We(r)===t);return n!==void 0?n:t}function On(t,e){return t==null?e.some(n=>n==="")?He:void 0:We(t)}function Fn(t){return t===""?"":String(t)}function Dn(t){const e=U.c(28),{schema:n,value:r,onChange:i,path:s,label:l}=t;let c;e[0]!==n.enum?(c=n.enum??[],e[0]=n.enum,e[1]=c):c=e[1];const a=c;let d;e[2]!==a||e[3]!==r?(d=On(r,a),e[2]=a,e[3]=r,e[4]=d):d=e[4];const p=d;let m;e[5]!==l||e[6]!==s?(m=o.jsx(le,{htmlFor:s,children:l}),e[5]=l,e[6]=s,e[7]=m):m=e[7];let g;e[8]!==n.description?(g=n.description&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[8]=n.description,e[9]=g):g=e[9];let y;e[10]!==m||e[11]!==g?(y=o.jsxs("div",{className:"space-y-0.5",children:[m,g]}),e[10]=m,e[11]=g,e[12]=y):y=e[12];let v;e[13]!==i||e[14]!==a?(v=_=>i(Rn(_,a)),e[13]=i,e[14]=a,e[15]=v):v=e[15];let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(ft,{className:"h-10",children:o.jsx(dt,{placeholder:"Select..."})}),e[16]=f):f=e[16];let h;e[17]!==a?(h=a.map($n),e[17]=a,e[18]=h):h=e[18];let u;e[19]!==h?(u=o.jsx(pt,{children:h}),e[19]=h,e[20]=u):u=e[20];let x;e[21]!==p||e[22]!==v||e[23]!==u?(x=o.jsxs(mt,{value:p,onValueChange:v,children:[f,u]}),e[21]=p,e[22]=v,e[23]=u,e[24]=x):x=e[24];let b;return e[25]!==x||e[26]!==y?(b=o.jsxs("div",{className:"space-y-2",children:[y,x]}),e[25]=x,e[26]=y,e[27]=b):b=e[27],b}function $n(t){const e=We(t);return o.jsx(ut,{value:e,children:Fn(t)},e)}function Bn(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/^\w/,e=>e.toUpperCase())}function Te(t){return t.normalize("NFC").trim()}function V(t,e){return Te(t)===Te(e)}function we(t,e,n){const r=Te(n);if(t.some(l=>V(l,r)||V(l,n)))return t;const i=[...t];return i.some(l=>V(l,e))||i.push(e),i.push(n),i}function En(t,e,n){if(n.length===0)return n;const r=Fe(t,e),i=n[0];return V(i,r)||V(i,t)?n.slice(1):n}function Fe(t,e){return e.title??Bn(t)}function Wr(t,e){return e<=0?[]:t.slice(0,e)}function nt(t,e){const n=Te(e);return t.findIndex(r=>Te(r)===n)}function rt(t,e){return t.type==="array"&&t.items||Be(t)?!0:Array.isArray(e)}function Ln(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Ne(t,e,n,r){if(r.length===0)return null;const i=r[0];for(const s of t){const l=e[s];if(!l||!rt(l,n[s]))continue;const c=Fe(s,l);if(V(i,c)||V(i,s)||r.some(a=>V(a,c)||V(a,s)))return s}for(const s of t){const l=e[s];if(!l||!rt(l,n[s]))continue;const c=n[s];if(!Array.isArray(c))continue;const a=l.items;for(let d=0;d<c.length;d++){const p=ge(c[d],d,a);if(V(p,i))return s}}for(const s of t){const l=e[s];if(l?.type!=="object"||!l.properties)continue;const c=Object.keys(l.properties),a=Ln(n[s]),d=Fe(s,l);if(Ne(c,l.properties,a,r)||(V(i,d)||V(i,s))&&Ne(c,l.properties,a,r.slice(1)))return s}return null}function Pn(t,e,n,r){return Ne(t,e,n,r)}function zn(t,e,n,r,i){if(i.length===0||!n.properties)return!1;const s=Object.keys(n.properties);if(Ne(s,n.properties,r,i))return!0;const l=i[0];return!V(l,e)&&!V(l,t)?!1:i.length>1||Ne(s,n.properties,r,i.slice(1))!==null}function Mn(t,e,n,r){if(e.length===0)return null;for(let s=0;s<e.length;s++){const l=e[s],c=n.findIndex((a,d)=>V(ge(a,d,r),l));if(c>=0)return{index:c,innerPath:e.slice(s+1)}}const i=e.findIndex(s=>V(s,t));if(i>=0&&e.length>i+1){const s=e[i+1],l=n.findIndex((c,a)=>V(ge(c,a,r),s));if(l>=0)return{index:l,innerPath:e.slice(i+2)}}return null}function ze(t){return t.includes("/sections/")||t.includes("multivariate/section")||t===vt}function Vn(t){if(t.type==="block-ref"&&t.anyOfRefs?.length)return t.anyOfRefs.some(n=>ze(n.resolveType));if(t.anyOfRefs?.length)return t.anyOfRefs.some(n=>ze(n.resolveType));const e=t.properties?.__resolveType;return e?.type==="block-ref"&&e.anyOfRefs?.length?e.anyOfRefs.some(n=>ze(n.resolveType)):!1}function Un(t,e){if(e==="global"||e==="sections"||Be(t))return!0;const n=t.type==="array"?t.items:void 0;return n?Vn(n):!1}function st(t){return Array.from({length:t},(e,n)=>({id:crypto.randomUUID(),index:n}))}function Kn(t,e,n,r,i){if(e?.type==="object"&&e.properties&&Object.keys(e.properties).length>0||e?.type==="block-ref"&&e.anyOfRefs?.length)return e;if(t!=null&&typeof t=="object"&&!Array.isArray(t)){const s=t.__resolveType;if(typeof s=="string"&&n){const l=Ue(s,n);if(l?.properties&&Object.keys(l.properties).length>0)return l}}if(n&&r&&i){const l=Ue(r,n)?.properties?.[i]?.items;if(l?.properties&&Object.keys(l.properties).length>0)return{...l,titleBy:l.titleBy??e?.titleBy}}return e}function Hn(t){const e=t.split(".").filter(n=>!/^\d+$/.test(n));return e[e.length-1]??t}function At(t){return t.map((e,n)=>({...e,index:n}))}function Wn(t,e){if(e===t.length)return t;if(e<t.length)return At(t.slice(0,e));const n=Array.from({length:e-t.length},(r,i)=>({id:crypto.randomUUID(),index:t.length+i}));return[...t,...n]}function Yn(t){const e=U.c(8),{labelText:n,imageSrc:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(yt,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),e[0]=i):i=e[0];let s;e[1]!==r?(s=r&&o.jsx("img",{src:r,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[1]=r,e[2]=s):s=e[2];let l;e[3]!==n?(l=o.jsx("span",{className:"min-w-0 truncate",children:n}),e[3]=n,e[4]=l):l=e[4];let c;return e[5]!==s||e[6]!==l?(c=o.jsxs(o.Fragment,{children:[i,o.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5 text-sm",children:[s,l]})]}),e[5]=s,e[6]=l,e[7]=c):c=e[7],c}function Gn(t){const e=U.c(37),{sortableId:n,labelText:r,imageSrc:i,onOpen:s,onRemove:l}=t;let c;e[0]!==n?(c={id:n,animateLayoutChanges:Zn},e[0]=n,e[1]=c):c=e[1];const{attributes:a,listeners:d,setNodeRef:p,transform:m,isDragging:g}=Ht(c);let y;e[2]!==m?(y=Wt.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=y):y=e[3];const v=g?0:void 0;let f;e[4]!==y||e[5]!==v?(f={transform:y,opacity:v},e[4]=y,e[5]=v,e[6]=f):f=e[6];const h=f;let u;e[7]!==s?(u=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),s())},e[7]=s,e[8]=u):u=e[8];const x=g?"cursor-grabbing":"cursor-pointer";let b;e[9]!==x?(b=De("group flex min-w-0 items-center gap-2.5 rounded-lg px-2 py-2.5 hover:bg-accent hover:text-accent-foreground touch-none",x),e[9]=x,e[10]=b):b=e[10];let _;e[11]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(yt,{className:"size-3.5 shrink-0 text-muted-foreground/40"}),e[11]=_):_=e[11];let k;e[12]!==i?(k=i&&o.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[12]=i,e[13]=k):k=e[13];let T;e[14]!==r?(T=o.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:r}),e[14]=r,e[15]=T):T=e[15];const N=`Open actions for ${r}`;let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(It,{size:14}),e[16]=I):I=e[16];let j;e[17]!==N?(j=o.jsx(qt,{asChild:!0,children:o.jsx(Ce,{type:"button",variant:"ghost",size:"icon","aria-label":N,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:Xn,onPointerDown:qn,children:I})}),e[17]=N,e[18]=j):j=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(ht,{size:14}),e[19]=S):S=e[19];let w;e[20]!==l?(w=o.jsx(Xt,{align:"end",children:o.jsxs(Zt,{className:"text-destructive focus:text-destructive",onClick:l,children:[S,"Delete"]})}),e[20]=l,e[21]=w):w=e[21];let C;e[22]!==j||e[23]!==w?(C=o.jsxs(Qt,{children:[j,w]}),e[22]=j,e[23]=w,e[24]=C):C=e[24];let O;return e[25]!==a||e[26]!==r||e[27]!==d||e[28]!==s||e[29]!==p||e[30]!==h||e[31]!==T||e[32]!==C||e[33]!==u||e[34]!==b||e[35]!==k?(O=o.jsxs("div",{ref:p,style:h,...a,...d,role:"button",tabIndex:0,onClick:s,onKeyDown:u,className:b,title:r,children:[_,k,T,C]}),e[25]=a,e[26]=r,e[27]=d,e[28]=s,e[29]=p,e[30]=h,e[31]=T,e[32]=C,e[33]=u,e[34]=b,e[35]=k,e[36]=O):O=e[36],O}function qn(t){return t.stopPropagation()}function Xn(t){return t.stopPropagation()}function Zn(){return!1}function Me(t){const e=U.c(24),{schema:n,value:r,onChange:i,path:s,label:l,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m,containerResolveType:g,previewBaseUrl:y,onAddSectionItem:v,onRequestAddSection:f}=t,h=c===void 0?[]:c,u=Array.isArray(r)?r:[],x=n.items,b=Hn(s),_=Un(n,b),k=Mn(l,h,u,x),T=k?.index??null,[N,I]=Q.useState(()=>st(u.length)),[j,S]=Q.useState(null),[w,C]=Q.useState(s),[O,F]=Q.useState(u.length),z=Q.useRef(!1);w!==s?(C(s),F(u.length),I(st(u.length))):O!==u.length&&(F(u.length),I(A=>Wn(A,u.length)));let B;e[0]!==x?(B=(A,D)=>ge(A,D,x),e[0]=x,e[1]=B):B=e[1];const M=B,J=A=>{if(z.current)return;const D=M(u[A],A);a?.(we(h,l,D))},W=A=>{const D=[...u,A];i(D);const E=D.length-1,P=ge(A,E,x);a?.(we(h,l,P))},re=()=>{const A=x?.type,D=x?.default!==void 0?x.default:A==="object"?{}:A==="block-ref"?(()=>{const ce=x?.anyOfRefs?.[0]?.resolveType;return typeof ce!="string"||Re(ce)?{}:{__resolveType:ce}})():A==="number"||A==="integer"?0:A==="boolean"?!1:A==="array"?[]:"",E=[...u,D];i(E);const P=E.length-1,oe=ge(D,P,x);a?.(we(h,l,oe))},H=()=>{if(_){if(!y){be.error("Start the preview dev server to add sections.");return}if(f){f({append:W});return}be.error("Section picker is not available in this editor.");return}re()},se=A=>{if(i(u.filter((D,E)=>E!==A)),T===A){const D=M(u[A],A),E=nt(h,D);a?.(E>=0?h.slice(0,E):[])}},ee=(A,D)=>{const E=[...u];E[A]=D,i(E)};let ie;e[2]===Symbol.for("react.memo_cache_sentinel")?(ie={activationConstraint:{distance:8}},e[2]=ie):ie=e[2];let Y;e[3]===Symbol.for("react.memo_cache_sentinel")?(Y={coordinateGetter:Yt},e[3]=Y):Y=e[3];const G=Et(Ze(Pt,ie),Ze(Lt,Y)),q=N.map(Qn);let K;e[4]===Symbol.for("react.memo_cache_sentinel")?(K=A=>{S(String(A.active.id))},e[4]=K):K=e[4];const X=K,te=A=>{S(null);const{active:D,over:E}=A;if(!E||D.id===E.id)return;const P=q.indexOf(String(D.id)),oe=q.indexOf(String(E.id));P===-1||oe===-1||(I(ce=>At(Qe([...ce],P,oe))),i(Qe([...u],P,oe)),z.current=!0,requestAnimationFrame(()=>{z.current=!1}))};let R;e[5]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{S(null)},e[5]=R):R=e[5];const $=R,L=j?N.find(A=>A.id===j):null,ne=L!=null?u[L.index]:void 0,ae=L!=null&&ne!==void 0?M(ne,L.index):null,fe=L!=null&&ne!==void 0?tt(ne,x):void 0;if(T!==null&&T<u.length){const A=u[T],D=Kn(A,x,d,g,b),E=()=>{const P=M(A,T),oe=we(h,l,P),ce=nt(oe,P);return ce>=0?oe.slice(0,ce+1):oe};return o.jsx("div",{className:"min-w-0",children:D?.type==="object"&&D.properties?o.jsx(Ge,{schema:D,value:A,onChange:P=>ee(T,P),basePath:`${s}.${T}`,breadcrumbPath:k?.innerPath??[],onBreadcrumbChange:P=>{a?.([...E(),...P])},meta:d,decofile:p,onSaveReferencedBlock:m,previewBaseUrl:y,onAddSectionItem:v,onRequestAddSection:f}):D?wt({schema:D,value:A,onChange:P=>ee(T,P),path:`${s}.${T}`,label:D.title??`Item ${T+1}`,breadcrumbPath:k?.innerPath??[],onBreadcrumbChange:P=>{a?.([...E(),...P])},meta:d,decofile:p,onSaveReferencedBlock:m,previewBaseUrl:y,onAddSectionItem:v,onRequestAddSection:f}):null})}const xe="space-y-2";let Z;e[6]!==l?(Z=o.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:l}),e[6]=l,e[7]=Z):Z=e[7];const ve=u.length>0&&o.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:u.length});let de;e[8]!==Z||e[9]!==ve?(de=o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[Z,ve]}),e[8]=Z,e[9]=ve,e[10]=de):de=e[10];let pe;e[11]!==n.description?(pe=n.description&&o.jsx("p",{className:"break-words text-xs leading-normal text-muted-foreground",children:n.description}),e[11]=n.description,e[12]=pe):pe=e[12];let me;e[13]!==de||e[14]!==pe?(me=o.jsxs("div",{className:"min-w-0 space-y-0.5",children:[de,pe]}),e[13]=de,e[14]=pe,e[15]=me):me=e[15];const Le=u.length>0&&o.jsx("div",{className:De(j&&"cursor-grabbing"),children:o.jsxs(zt,{sensors:G,collisionDetection:Mt,onDragStart:X,onDragEnd:te,onDragCancel:$,children:[o.jsx(Vt,{items:q,strategy:Ut,children:o.jsx("div",{className:"min-w-0 overflow-hidden rounded-xl border border-border/50 p-1.5",children:N.map(A=>{const D=u[A.index];if(D===void 0)return null;const E=M(D,A.index),P=tt(D,x);return o.jsx(Gn,{sortableId:A.id,labelText:E,imageSrc:P,onOpen:()=>J(A.index),onRemove:()=>se(A.index)},A.id)})})}),o.jsx(Kt,{dropAnimation:null,children:ae?o.jsx("div",{className:"flex min-w-0 items-center gap-2.5 rounded-lg border border-border/60 bg-background px-2 py-2.5 shadow-lg ring-1 ring-border/60",children:o.jsx(Yn,{labelText:ae,imageSrc:fe})}):null})]})});let Se;e[16]===Symbol.for("react.memo_cache_sentinel")?(Se=o.jsx(Gt,{size:14}),e[16]=Se):Se=e[16];const Pe=_?"Add section":"Add item";let ye;e[17]!==H||e[18]!==Pe?(ye=o.jsxs("button",{type:"button",onClick:H,className:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-border/60 py-2.5 text-sm text-muted-foreground transition-colors hover:border-border hover:bg-muted/30",children:[Se,Pe]}),e[17]=H,e[18]=Pe,e[19]=ye):ye=e[19];let _e;return e[20]!==me||e[21]!==Le||e[22]!==ye?(_e=o.jsxs("div",{className:xe,children:[me,Le,ye]}),e[20]=me,e[21]=Le,e[22]=ye,e[23]=_e):_e=e[23],_e}function Qn(t){return t.id}function Jn(t){const e=U.c(43),{schema:n,value:r,onChange:i,path:s,label:l,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m,previewBaseUrl:g,onAddSectionItem:y,onRequestAddSection:v}=t;let f;e[0]!==c?(f=c===void 0?[]:c,e[0]=c,e[1]=f):f=e[1];const h=f,[u,x]=Q.useState(!1);let b;e[2]!==r?(b=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},e[2]=r,e[3]=b):b=e[3];const _=b;if(!n.properties)return null;let k;e[4]!==s?(k=s.split(".").pop()??s,e[4]=s,e[5]=k):k=e[5];const T=k;let N;e[6]!==h||e[7]!==T||e[8]!==l||e[9]!==_||e[10]!==n?(N=zn(T,l,n,_,h),e[6]=h,e[7]=T,e[8]=l,e[9]=_,e[10]=n,e[11]=N):N=e[11];const j=u||N,S=`${s}-fields`;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=()=>x(er),e[12]=w):w=e[12];let C;e[13]!==j?(C=o.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors group-hover:text-accent-foreground",children:j?o.jsx(bt,{size:16}):o.jsx(jt,{size:16})}),e[13]=j,e[14]=C):C=e[14];let O;e[15]!==l?(O=o.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:l}),e[15]=l,e[16]=O):O=e[16];let F;e[17]!==S||e[18]!==j||e[19]!==C||e[20]!==O?(F=o.jsxs("button",{type:"button","aria-expanded":j,"aria-controls":S,onClick:w,className:"group flex w-full min-w-0 items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:bg-accent hover:text-accent-foreground",children:[C,O]}),e[17]=S,e[18]=j,e[19]=C,e[20]=O,e[21]=F):F=e[21];let z;e[22]!==n.description?(z=n.description&&o.jsx("p",{className:"break-words pl-9 text-xs leading-normal text-muted-foreground",children:n.description}),e[22]=n.description,e[23]=z):z=e[23];let B;e[24]!==h||e[25]!==S||e[26]!==p||e[27]!==j||e[28]!==d||e[29]!==_||e[30]!==y||e[31]!==a||e[32]!==i||e[33]!==v||e[34]!==m||e[35]!==s||e[36]!==g||e[37]!==n?(B=j&&o.jsx("div",{id:S,className:"ml-3 min-w-0 max-w-full overflow-hidden border-l border-border/80 pl-5",children:o.jsx(Ge,{schema:n,value:_,onChange:i,basePath:s,breadcrumbPath:h,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m,previewBaseUrl:g,onAddSectionItem:y,onRequestAddSection:v})}),e[24]=h,e[25]=S,e[26]=p,e[27]=j,e[28]=d,e[29]=_,e[30]=y,e[31]=a,e[32]=i,e[33]=v,e[34]=m,e[35]=s,e[36]=g,e[37]=n,e[38]=B):B=e[38];let M;return e[39]!==z||e[40]!==B||e[41]!==F?(M=o.jsxs("div",{className:"min-w-0 space-y-2",children:[F,z,B]}),e[39]=z,e[40]=B,e[41]=F,e[42]=M):M=e[42],M}function er(t){return!t}function Ye(t){const e=t.__resolveType;if(typeof e!="string")return null;if(Ie(e)){const r=t.section?.__resolveType;return typeof r=="string"?r:e}return e}function tr(t){return t.includes("flags/multivariate")}function nr(t){return xt(t)}function rr(t,e){const n=[...t],r=new Set(n.map(s=>s.resolveType)),i=(s,l)=>{!s||r.has(s)||(r.add(s),n.push({resolveType:s,title:l??nr(s)}))};if(e.savedBlockKey&&i(e.savedBlockKey,e.savedBlockKey),e.editorValue&&typeof e.editorValue=="object"&&!Array.isArray(e.editorValue)){const s=Ye(e.editorValue);s?.includes("/")&&i(s)}return n}function sr(t,e,n){const r=e[0]?.resolveType??"";if(n)return n;if(!t||typeof t!="object"||Array.isArray(t))return r;const i=t,s=i.__resolveType;if(typeof s=="string"){if($e(s)){const m=e.find(g=>g.resolveType===s);return m?m.resolveType:s}const d=e.find(m=>et(m.resolveType,s));if(d)return d.resolveType;const p=e.find(m=>m.resolveType===s);if(p)return p.resolveType;if(s.includes("/"))return s}const l=typeof i.type=="string"?i.type:void 0;if(l){const d=e.find(p=>p.discriminatorValue===l||p.resolveType===l||et(p.resolveType,l));if(d)return d.resolveType}let c=r,a=-1;for(const d of e){if(!d.schema?.properties)continue;const m=Object.keys(d.schema.properties).filter(g=>!g.startsWith("__")&&g!=="@type"&&g!=="action"&&g!=="alt").filter(g=>i[g]!==void 0).length;m>0&&m>a&&(a=m,c=d.resolveType)}return a>0,c}function it(t,e,n){if(!t||typeof t!="object"||Array.isArray(t))return n??null;const r=Ye(t);if(!r)return n??null;if(!e)return r.includes("/")?null:n??null;const i=Ue(r,e);return i||(r.includes("/")?null:n??null)}function ir(t,e){if(!t?.properties||!e)return t??null;if(!(e in t.properties))return t;const n={...t.properties};return delete n[e],{...t,properties:n}}function or(t,e){if(e)return!0;if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t,r=Ye(n);return r&&tr(r)?Array.isArray(n.variants)&&n.variants.length>0:Object.keys(n).some(i=>!i.startsWith("__")&&i!=="@type")}function lr(t){if(!t?.properties)return{};const e={};for(const[n,r]of Object.entries(t.properties))n.startsWith("__")||n==="@type"||(r.default!==void 0?e[n]=r.default:r.type==="boolean"?e[n]=!1:r.type==="string"?e[n]="":r.type==="number"||r.type==="integer"?e[n]=0:r.type==="object"&&(e[n]={}));return e}function ar(t){const e=U.c(3),{blockKey:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(cn,{asChild:!0,children:o.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[o.jsx(an,{size:11}),"Global"]})}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=o.jsxs(un,{children:[r,o.jsxs(fn,{side:"top",className:"max-w-[260px]",children:["Edits the saved block “",n,"”. Changes apply everywhere this loader is referenced on your site."]})]}),e[1]=n,e[2]=i):i=e[2],i}function cr(t){const e=U.c(28),{path:n,open:r,onOpenChange:i,title:s,nested:l,nestedBlockRef:c,globalBlockKey:a}=t,d=`${n}-loader-config`,p=c&&"ml-1";let m;e[0]!==p?(m=De("rounded-lg border border-border/80 bg-muted/30",p),e[0]=p,e[1]=m):m=e[1];let g;e[2]!==i||e[3]!==r?(g=()=>i(!r),e[2]=i,e[3]=r,e[4]=g):g=e[4];let y;e[5]!==r?(y=o.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center text-muted-foreground transition-colors group-hover:text-foreground",children:r?o.jsx(bt,{size:16}):o.jsx(jt,{size:16})}),e[5]=r,e[6]=y):y=e[6];let v;e[7]!==s?(v=o.jsx("span",{className:"truncate text-xs font-medium tracking-wide text-muted-foreground uppercase",children:s}),e[7]=s,e[8]=v):v=e[8];let f;e[9]!==a?(f=a&&o.jsx(ar,{blockKey:a}),e[9]=a,e[10]=f):f=e[10];let h;e[11]!==v||e[12]!==f?(h=o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[v,f]}),e[11]=v,e[12]=f,e[13]=h):h=e[13];let u;e[14]!==d||e[15]!==r||e[16]!==g||e[17]!==y||e[18]!==h?(u=o.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":d,onClick:g,className:"group flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[y,h]}),e[14]=d,e[15]=r,e[16]=g,e[17]=y,e[18]=h,e[19]=u):u=e[19];let x;e[20]!==d||e[21]!==l||e[22]!==r?(x=r&&o.jsx("div",{id:d,className:"border-t border-border/60 px-4 pb-4 pt-3",children:o.jsx("div",{className:"border-l border-border/80 pl-4",children:l})}),e[20]=d,e[21]=l,e[22]=r,e[23]=x):x=e[23];let b;return e[24]!==m||e[25]!==u||e[26]!==x?(b=o.jsxs("div",{className:m,children:[u,x]}),e[24]=m,e[25]=u,e[26]=x,e[27]=b):b=e[27],b}function ot(t){const e=U.c(30),{schema:n,value:r,onChange:i,path:s,label:l,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m}=t,g=(n.anyOfRefs??[]).filter(dr),y=p&&r?vn(r,p):null,v=y?.data??r,f=rr(g,{savedBlockKey:y?.blockKey,editorValue:v}),h=f.length>0?sr(v,f,y?.blockKey):f[0]?.resolveType??"",[u,x]=Q.useState(h),[b,_]=Q.useState(h);b!==h&&(_(h),x(h));const[k,T]=Q.useState(()=>or(v,y?.blockKey));if(f.length>0){const F=u||h;let z;e[0]!==F?(z=R=>R.resolveType===F,e[0]=F,e[1]=z):z=e[1];const B=f.find(z),M=it(v,d,B?.schema),J=ir(M??B?.schema??null,n.discriminatorKey),W=n.discriminatorKey,re=R=>{x(R);const $=f.find(Z=>Z.resolveType===R),L=it(v,d,$?.schema),ne=new Set(Object.keys((L??$?.schema)?.properties??{})),ae=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:{},fe=Object.fromEntries(Object.entries(ae).filter(Z=>{const[ve]=Z;return ne.has(ve)})),xe={...lr($?.schema),...fe};if(W){const Z=$?.discriminatorValue??R;i({...xe,[W]:Z});return}if(Re(R)){i(xe);return}i({...xe,__resolveType:R})};let H;e[2]!==F||e[3]!==W||e[4]!==i?(H=R=>{if(W||!Re(F)||R===null||typeof R!="object"||Array.isArray(R)){i(R);return}const{__resolveType:$,...L}=R;i(L)},e[2]=F,e[3]=W,e[4]=i,e[5]=H):H=e[5];const se=H,ee=J?.properties?o.jsx(Ge,{schema:J,value:v,onChange:R=>{if(y&&m){m(y.blockKey,R);return}se(R)},basePath:s,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:p,onSaveReferencedBlock:m}):null,Y=n.type==="block-ref"&&f.some(fr);let G;e[6]!==s?(G=s.includes("."),e[6]=s,e[7]=G):G=e[7];const q=G;let K;e[8]!==l||e[9]!==s?(K=o.jsx(le,{htmlFor:s,children:l}),e[8]=l,e[9]=s,e[10]=K):K=e[10];let X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=o.jsx(ft,{children:o.jsx(dt,{placeholder:"Select..."})}),e[11]=X):X=e[11];let te;return e[12]!==n.description?(te=n.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[12]=n.description,e[13]=te):te=e[13],o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[K,o.jsxs(mt,{value:F||void 0,onValueChange:re,children:[X,o.jsx(pt,{children:f.map(ur)})]}),te]}),ee&&(Y?o.jsx(cr,{path:s,open:k,onOpenChange:T,title:q?"Configuration":"Loader configuration",nested:ee,nestedBlockRef:q,globalBlockKey:y?.blockKey}):ee)]})}if(n.anyOfRefs&&n.anyOfRefs.length>0)return null;let N;e[14]!==l||e[15]!==s?(N=o.jsx(le,{htmlFor:s,children:l}),e[14]=l,e[15]=s,e[16]=N):N=e[16];const I=r!=null?String(r):"";let j;e[17]!==i?(j=F=>i(F.target.value),e[17]=i,e[18]=j):j=e[18];const S=n.description??"";let w;e[19]!==s||e[20]!==I||e[21]!==j||e[22]!==S?(w=o.jsx("input",{id:s,type:"text",value:I,onChange:j,className:"w-full rounded-md border bg-background px-3 py-1.5 text-sm",placeholder:S}),e[19]=s,e[20]=I,e[21]=j,e[22]=S,e[23]=w):w=e[23];let C;e[24]!==n.description?(C=n.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=C):C=e[25];let O;return e[26]!==N||e[27]!==w||e[28]!==C?(O=o.jsxs("div",{className:"space-y-1.5",children:[N,w,C]}),e[26]=N,e[27]=w,e[28]=C,e[29]=O):O=e[29],O}function ur(t){return o.jsx(ut,{value:t.resolveType,children:t.title??rn(t.resolveType)??t.resolveType},t.resolveType)}function fr(t){return t.resolveType.includes("/")&&!Re(t.resolveType)}function dr(t){return t.resolveType!==""}function lt(t){const e=U.c(2),{ext:n}=t;if(!n)return null;let r;return e[0]!==n?(r=o.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function pr(t){try{const e=new URL(t).pathname;return decodeURIComponent(e.split("/").pop()??t)}catch{return t.split("/").pop()??t}}function mr(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"":t.slice(e+1).toLowerCase()}function at(t){const e=U.c(72),{schema:n,value:r,onChange:i,path:s,label:l}=t,c=n.format==="video-uri",a=gt(r),[d,p]=Q.useState(!1),[m,g]=Q.useState(!1),y=a?pr(a):"",v=y?mr(y):"",f=pn(),h=Jt();let u;e[0]!==f.data?.configs?(u=function(){const $=f.data?.configs??[];if($.length===1)return $[0].id;if($.length===0)return null;const L=typeof window<"u"?window.localStorage.getItem(en):null;return $.some(ne=>ne.id===L)?L:null},e[0]=f.data?.configs,e[1]=u):u=e[1];const x=u;let b;e[2]!==c||e[3]!==i||e[4]!==x||e[5]!==p||e[6]!==h?(b=async function($){if(!$)return;let L=Array.from($);if(L.length===0)return;if(c&&(L=L.filter(yr),L.length===0)){be.error("Please drop a video file (mp4, webm, …).");return}const ne=x();if(!ne){p(!0);return}try{const ae=await h.mutateAsync({configId:ne,file:L[0]});i(ae.publicUrl),L.length>1&&be.info(`Uploaded ${L[0].name}; extra files were ignored (single-select field).`)}catch(ae){const fe=ae;be.error(fe instanceof Error?fe.message:"Upload failed")}},e[2]=c,e[3]=i,e[4]=x,e[5]=p,e[6]=h,e[7]=b):b=e[7];const _=b;let k;e[8]!==g?(k=function($){$.preventDefault(),$.dataTransfer.types.includes("Files")&&g(!0)},e[8]=g,e[9]=k):k=e[9];const T=k;let N;e[10]!==g?(N=function($){$.currentTarget===$.target&&g(!1)},e[10]=g,e[11]=N):N=e[11];const I=N;let j;e[12]!==_||e[13]!==g?(j=function($){$.preventDefault(),g(!1),_($.dataTransfer.files)},e[12]=_,e[13]=g,e[14]=j):j=e[14];const S=j;let w;e[15]!==l||e[16]!==s?(w=o.jsx(le,{htmlFor:s,className:"text-muted-foreground",children:l}),e[15]=l,e[16]=s,e[17]=w):w=e[17];let C;e[18]!==n.description?(C=n.description&&o.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=C):C=e[19];let O;e[20]!==w||e[21]!==C?(O=o.jsxs("div",{className:"min-w-0 space-y-0.5",children:[w,C]}),e[20]=w,e[21]=C,e[22]=O):O=e[22];const F=m&&"border-primary ring-2 ring-primary/30",z=h.isPending&&"pointer-events-none opacity-60";let B;e[23]!==z||e[24]!==F?(B=De("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",F,z),e[23]=z,e[24]=F,e[25]=B):B=e[25];let M;e[26]!==v||e[27]!==y||e[28]!==c||e[29]!==p||e[30]!==a||e[31]!==h.isPending?(M=a?c?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"relative h-40 w-full overflow-hidden bg-black",children:o.jsx("video",{src:a,preload:"metadata",className:"h-full w-full object-contain"},a)}),o.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[o.jsx(qe,{size:14,className:"shrink-0 text-muted-foreground"}),o.jsx("p",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:y}),o.jsx(lt,{ext:v})]})]}):o.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[o.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-md bg-background",children:o.jsx(Xe,{size:18,className:"text-muted-foreground"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:y}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a})]}),o.jsx(lt,{ext:v})]}):o.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex w-full flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[c?o.jsx(qe,{size:20}):o.jsx(Xe,{size:20}),o.jsx("span",{className:"text-sm font-medium",children:h.isPending?"Uploading…":c?"Drop a video here or click to browse":"Drop a file or click to browse"}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"Up to 100 MB"})]}),e[26]=v,e[27]=y,e[28]=c,e[29]=p,e[30]=a,e[31]=h.isPending,e[32]=M):M=e[32];let J;e[33]!==m?(J=m&&o.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:o.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[33]=m,e[34]=J):J=e[34];let W;e[35]!==I||e[36]!==T||e[37]!==S||e[38]!==B||e[39]!==M||e[40]!==J?(W=o.jsxs("div",{onDragOver:T,onDragLeave:I,onDrop:S,className:B,children:[M,J]}),e[35]=I,e[36]=T,e[37]=S,e[38]=B,e[39]=M,e[40]=J,e[41]=W):W=e[41];let re;e[42]!==i?(re=R=>i(R.target.value),e[42]=i,e[43]=re):re=e[43];let H;e[44]!==s||e[45]!==a||e[46]!==re?(H=o.jsx(ue,{id:s,type:"url",value:a,onChange:re,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[44]=s,e[45]=a,e[46]=re,e[47]=H):H=e[47];let se;e[48]!==p?(se=()=>p(!0),e[48]=p,e[49]=se):se=e[49];let ee;e[50]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(dn,{size:14}),e[50]=ee):ee=e[50];const ie=a?"Replace":"Browse";let Y;e[51]!==se||e[52]!==ie?(Y=o.jsxs(Ce,{type:"button",variant:"outline",size:"sm",onClick:se,className:"h-9 shrink-0",children:[ee,ie]}),e[51]=se,e[52]=ie,e[53]=Y):Y=e[53];let G;e[54]!==i||e[55]!==a?(G=a&&o.jsx(Ce,{type:"button",variant:"ghost",size:"sm",onClick:()=>i(""),className:"h-9 shrink-0","aria-label":"Remove file",children:o.jsx(ht,{size:14})}),e[54]=i,e[55]=a,e[56]=G):G=e[56];let q;e[57]!==H||e[58]!==Y||e[59]!==G?(q=o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[H,Y,G]}),e[57]=H,e[58]=Y,e[59]=G,e[60]=q):q=e[60];let K;e[61]!==i?(K=R=>i(R),e[61]=i,e[62]=K):K=e[62];let X;e[63]!==d||e[64]!==p||e[65]!==K?(X=o.jsx(tn,{open:d,onOpenChange:p,mode:"any",onSelect:K}),e[63]=d,e[64]=p,e[65]=K,e[66]=X):X=e[66];let te;return e[67]!==W||e[68]!==q||e[69]!==X||e[70]!==O?(te=o.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[O,W,q,X]}),e[67]=W,e[68]=q,e[69]=X,e[70]=O,e[71]=te):te=e[71],te}function yr(t){return t.type.startsWith("video/")}const hr="website/loaders/secret.ts";function je(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t.__resolveType;return typeof e=="string"&&(e.endsWith("/secret.ts")||e.includes("loaders/secret"))}function gr(){return{__resolveType:hr,name:"",encrypted:""}}function xr(t){const{value:e,...n}=t;return n}function Ve(t){const e=U.c(45),{schema:n,value:r,onChange:i,label:s,path:l}=t;if(typeof r=="string"||r==null&&!je(r)){const N=typeof r=="string"?r:"";let I;e[0]!==s||e[1]!==l?(I=o.jsx(le,{htmlFor:l,className:"text-sm font-medium",children:s}),e[0]=s,e[1]=l,e[2]=I):I=e[2];let j;e[3]!==n.description?(j=n.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[3]=n.description,e[4]=j):j=e[4];let S;e[5]!==i?(S=O=>i(O.target.value),e[5]=i,e[6]=S):S=e[6];let w;e[7]!==l||e[8]!==N||e[9]!==S?(w=o.jsx(ue,{id:l,type:"password",value:N,autoComplete:"new-password",autoCorrect:"off",spellCheck:!1,placeholder:"Secret value",onChange:S,className:"h-10"}),e[7]=l,e[8]=N,e[9]=S,e[10]=w):w=e[10];let C;return e[11]!==I||e[12]!==j||e[13]!==w?(C=o.jsxs("div",{className:"space-y-2",children:[I,j,w]}),e[11]=I,e[12]=j,e[13]=w,e[14]=C):C=e[14],C}let c;e[15]!==r?(c=je(r)?r:gr(),e[15]=r,e[16]=c):c=e[16];const a=c,d=typeof a.name=="string"?a.name:"",p=typeof a.encrypted=="string"&&a.encrypted,m=`${l}-name`;let g;e[17]!==s||e[18]!==m?(g=o.jsx(le,{htmlFor:m,className:"text-sm font-medium",children:s}),e[17]=s,e[18]=m,e[19]=g):g=e[19];let y;e[20]!==n.description?(y=n.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[20]=n.description,e[21]=y):y=e[21];const v=`${l}-name`;let f;e[22]!==a||e[23]!==i?(f=N=>i({...a,name:N.target.value}),e[22]=a,e[23]=i,e[24]=f):f=e[24];let h;e[25]!==d||e[26]!==v||e[27]!==f?(h=o.jsx(ue,{id:v,value:d,placeholder:"Secret name",onChange:f,className:"h-10"}),e[25]=d,e[26]=v,e[27]=f,e[28]=h):h=e[28];const u=`${l}-value`,x=p?"Leave blank to keep current value":"Secret value";let b;e[29]!==a||e[30]!==p||e[31]!==i?(b=N=>{const I=N.target.value;if(!I){i(p?xr(a):a);return}i({...a,value:I})},e[29]=a,e[30]=p,e[31]=i,e[32]=b):b=e[32];let _;e[33]!==b||e[34]!==u||e[35]!==x?(_=o.jsx(ue,{id:u,type:"password",autoComplete:"new-password",autoCorrect:"off",spellCheck:!1,placeholder:x,onChange:b,className:"h-10"}),e[33]=b,e[34]=u,e[35]=x,e[36]=_):_=e[36];let k;e[37]!==p?(k=p&&o.jsx("p",{className:"text-xs text-muted-foreground",children:"A secret value is stored."}),e[37]=p,e[38]=k):k=e[38];let T;return e[39]!==_||e[40]!==k||e[41]!==g||e[42]!==y||e[43]!==h?(T=o.jsxs("div",{className:"space-y-2",children:[g,y,h,_,k]}),e[39]=_,e[40]=k,e[41]=g,e[42]=y,e[43]=h,e[44]=T):T=e[44],T}const vr=new Set(["__resolveType","@type"]);function br(t){if(t.type!=="block-ref"||!t.anyOfRefs?.length||t.anyOfRefs.length!==1)return null;const e=t.anyOfRefs[0].resolveType;return e.endsWith("/multivariate/image.ts")?"image":e.endsWith("/multivariate/video.ts")||e.endsWith("/multivariate/file.ts")?"file":null}function jr(t){if(Be(t))for(const e of t.anyOfRefs??[]){const i=e.schema?.properties?.variants?.items?.properties?.value;if(i?.type==="array"&&i.items)return i.items}}function ct(t){if(t.type==="array"&&t.items)return t;const e=t.items??jr(t);return e?{...t,type:"array",items:e}:null}function Tr(t,e){if(e!==void 0)return e;switch(t){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}}function wt(t){const{schema:e,value:n}=t;if(sn(n)){const l=on(n),c=ct(e);if(l!==null&&c)return o.jsx(Me,{...t,schema:c,value:l,onChange:a=>t.onChange(ln(n,a))},t.path)}if(Array.isArray(n)&&e.type==="block-ref"&&Be(e)){const l=ct(e);if(l)return o.jsx(Me,{...t,schema:l,value:n,onChange:t.onChange},t.path)}if(e.type==="block-ref"||n!==null&&typeof n=="object"&&!Array.isArray(n)&&typeof n.__resolveType=="string"&&e.anyOfRefs){const l=br(e);return l==="image"?o.jsx(Je,{...t},t.path):l==="file"?o.jsx(at,{...t},t.path):e.anyOfRefs?o.jsx(ot,{...t},t.path):null}if(e.format==="image-uri")return o.jsx(Je,{...t},t.path);if(e.format==="file-uri"||e.format==="video-uri")return o.jsx(at,{...t},t.path);if(e.enum&&e.enum.length>0)return o.jsx(Dn,{...t},t.path);if(e.type==="anyOf")return o.jsx(ot,{...t},t.path);if(je(n)||e.format==="password"||n==null&&e.format==="password")return o.jsx(Ve,{...t},t.path);const r=n??Tr(e.type,e.default);if(r==null)return je(n)?o.jsx(Ve,{...t},t.path):null;if(je(r))return o.jsx(Ve,{...t,value:r},t.path);const i={...t,value:r},s=n==null?e.type??typeof r:Array.isArray(r)?"array":typeof r;if(s==="array"||Array.isArray(r))return o.jsx(Me,{...i},t.path);switch(s){case"boolean":return o.jsx(In,{...i},t.path);case"number":case"integer":return o.jsx(Cn,{...i},t.path);case"string":{const l=e.format;return l==="color-input"?o.jsx(Ae,{...i},t.path):l==="textarea"||l==="rich-text"||l==="html"?o.jsx(Ae,{...i},t.path):o.jsx(Ae,{...i},t.path)}case"object":return r!==null&&typeof r=="object"&&!Array.isArray(r)?o.jsx(Jn,{...i},t.path):null;default:return o.jsx(Ae,{...i},t.path)}}function Ge(t){const e=U.c(15),{schema:n,value:r,onChange:i,basePath:s,breadcrumbPath:l,onBreadcrumbChange:c,meta:a,decofile:d,onSaveReferencedBlock:p,previewBaseUrl:m,onAddSectionItem:g,onRequestAddSection:y}=t;let v,f;if(e[0]!==s||e[1]!==d||e[2]!==a||e[3]!==g||e[4]!==c||e[5]!==i||e[6]!==y||e[7]!==p||e[8]!==m||e[9]!==n.properties||e[10]!==l||e[11]!==r){f=Symbol.for("react.early_return_sentinel");e:{const h=l===void 0?[]:l,u=n.properties;if(!u){f=null;break e}const x=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},b=Object.keys(u).filter(S=>!vr.has(S)&&u[S]?.hidden!==!0);if(b.length===0){let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields on this section."}),e[14]=S):S=e[14],f=S;break e}const _=(S,w)=>{i({...x,[S]:w})},k=typeof x.__resolveType=="string"?x.__resolveType:void 0,T=h.length>0?Pn(b,u,x,h):null,N=T?u[T]:null,I=T&&N?[T]:b,j=T&&N?En(T,N,h):h;v=o.jsx("div",{className:"min-w-0 space-y-6",children:I.map(S=>{const w=u[S];if(!w)return null;const C=s?`${s}.${S}`:S,O=Fe(S,w);return wt({schema:w,value:x[S],onChange:F=>_(S,F),path:C,label:O,breadcrumbPath:j,onBreadcrumbChange:c,meta:a,decofile:d,onSaveReferencedBlock:p,containerResolveType:k,previewBaseUrl:m,onAddSectionItem:g,onRequestAddSection:y})})})}e[0]=s,e[1]=d,e[2]=a,e[3]=g,e[4]=c,e[5]=i,e[6]=y,e[7]=p,e[8]=m,e[9]=n.properties,e[10]=l,e[11]=r,e[12]=v,e[13]=f}else v=e[12],f=e[13];return f!==Symbol.for("react.early_return_sentinel")?f:v}export{Ge as S,wt as a,Wr as b,Ae as c,Ke as r,mn as s,Hr as u};
@@ -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-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(`
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-DEUVODq9.js";import{e as Ju}from"./select-Dyn5eJ76.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-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
+ import{e as b,c as w,j as a,l as j}from"./index-DEUVODq9.js";import{i as N}from"./SearchMd-BnZZ5mEU.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-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
+ import{e as p,j as t,E as P,r as j,D as w,B as S,n as y}from"./index-DEUVODq9.js";import{i as k}from"./AlertCircle-DU4Czymb.js";import{s as z}from"./Plus-DW_pro4F.js";import{s as E}from"./User01-Bi6i4zOy.js";import{t as F}from"./Users01-BXIkeJej.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-FBdtBd0W.js";import{I as N}from"./input-CkGEzOB_.js";import{L as g}from"./label-CxhkSBar.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-Dyn5eJ76.js";import{S as H}from"./skeleton-CBG5UooE.js";import{T as K}from"./textarea-D_FY-WF9.js";import{P as b}from"./index-CiklrCzm.js";import{c as W}from"./settings-section-BsU7NnTR.js";import{u as Y,a as G}from"./use-secrets-BYUtrbRD.js";import{R as J}from"./require-capability-CqCUzyTW.js";import"./X-BUzk9ZuQ.js";import"./tooltip-CnO8IxhJ.js";import"./Check-CFZ7jofS.js";import"./ChevronDown-CMnvnfNH.js";import"./ChevronUp-BYxSfj4f.js";import"./sidebar-DMarnfZA.js";import"./LayoutLeft-Cy-bGbAH.js";import"./sheet-C2l8o7Li.js";import"./card-B0-N4bpb.js";import"./ArrowUpRight-jvt9_jPs.js";import"./studio-tools-DnIG9YV2.js";import"./use-capability-km64e2ng.js";import"./access-gate-DuwCoW9u.js";import"./capability-load-error-B4z1cdIN.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};