@oliasoft-open-source/react-ui-library 5.6.0-beta-20 → 5.6.0-beta-21

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 (222) hide show
  1. package/dist/{index-B1D5hqWS.js → index-CMB0aE4o.js} +1 -1
  2. package/dist/index.html +1 -1
  3. package/dist/index.js +16 -11
  4. package/dist/storybook/assets/{Color-AVL7NMMY-BuAf7Fbp.js → Color-AVL7NMMY-Czg_fs6_.js} +1 -1
  5. package/dist/storybook/assets/{DocsRenderer-PQXLIZUC-DLMby0wD.js → DocsRenderer-PQXLIZUC-B2Zun_PK.js} +2 -2
  6. package/dist/storybook/assets/{accordion-DU90ITZn.js → accordion-RHDLdSvI.js} +1 -1
  7. package/dist/storybook/assets/{accordion.stories-CQBN7DP5.js → accordion.stories-u3D9KmXg.js} +1 -1
  8. package/dist/storybook/assets/{actions-C75Yhysc.js → actions-Ct9IeQri.js} +2 -2
  9. package/dist/storybook/assets/{actions.stories-BUHQ2nS5.js → actions.stories-JRO1NCkI.js} +1 -1
  10. package/dist/storybook/assets/{afe.stories-tjB42xAu.js → afe.stories-DZEb77dW.js} +1 -1
  11. package/dist/storybook/assets/{badge-DoQogrt7.js → badge-CSqHSgHc.js} +1 -1
  12. package/dist/storybook/assets/{badge.stories-LNlLlLqv.js → badge.stories-Bc7Okxm1.js} +1 -1
  13. package/dist/storybook/assets/{blocks-npsRjG9U.js → blocks-BRiP-lQk.js} +4 -4
  14. package/dist/storybook/assets/{blowout.stories-DjF4nrAH.js → blowout.stories-BXnq1D_i.js} +1 -1
  15. package/dist/storybook/assets/{breadcrumb.stories-BW0-hz0O.js → breadcrumb.stories-DiGI8A9V.js} +1 -1
  16. package/dist/storybook/assets/{button-COZYpTMg.js → button-DXVRmU6A.js} +1 -1
  17. package/dist/storybook/assets/{button-group-BjdP3aGQ.js → button-group-CxEZ408g.js} +1 -1
  18. package/dist/storybook/assets/{button-group.stories-CTYaftZw.js → button-group.stories-Bjij8pPO.js} +1 -1
  19. package/dist/storybook/assets/button.stories-6rnL2ggd.js +1 -0
  20. package/dist/storybook/assets/{button.stories-XZ2oxsKX.js → button.stories-CuLcB-tY.js} +1 -1
  21. package/dist/storybook/assets/{buttons-and-links-YZlUwrwh.js → buttons-and-links-ifU6a0mN.js} +1 -1
  22. package/dist/storybook/assets/{card-BNQ_Ty0W.js → card-WLrmR7W6.js} +1 -1
  23. package/dist/storybook/assets/{card.stories-163_Jh8D.js → card.stories-DQNDv34o.js} +1 -1
  24. package/dist/storybook/assets/{casing-loads.stories-CxCWrjf7.js → casing-loads.stories-D2n6yGkb.js} +1 -1
  25. package/dist/storybook/assets/cell.stories-D8Hi1-cW.js +1 -0
  26. package/dist/storybook/assets/{cell.stories-DVXralAI.js → cell.stories-krClSC58.js} +1 -1
  27. package/dist/storybook/assets/{check-box-BrYAm1gp.js → check-box--YUuQA9P.js} +1 -1
  28. package/dist/storybook/assets/check-box.stories-BJI_Ra--.js +1 -0
  29. package/dist/storybook/assets/{check-box.stories-hN_JaUBB.js → check-box.stories-D74c3Akh.js} +1 -1
  30. package/dist/storybook/assets/{check-box.test-case.stories-UoUkXfQ5.js → check-box.test-case.stories-BKBF_BX6.js} +1 -1
  31. package/dist/storybook/assets/{chunk-HA7DTUK3-D8QnUgcG.js → chunk-HA7DTUK3-Raoqpbvt.js} +1 -1
  32. package/dist/storybook/assets/client-CdAX5swh.js +1 -0
  33. package/dist/storybook/assets/{color-CuvQy1_s.js → color-c3A6zcnY.js} +1 -1
  34. package/dist/storybook/assets/column.stories-88DJqdEb.js +1 -0
  35. package/dist/storybook/assets/{column.stories-07ukXOnl.js → column.stories-B2iCf1oq.js} +1 -1
  36. package/dist/storybook/assets/{components-D22_Y--P.js → components-I7ZzC7pj.js} +1 -1
  37. package/dist/storybook/assets/{components-CXJQI0dy.js → components-hQQePxwc.js} +1 -1
  38. package/dist/storybook/assets/{data-import-export.stories-DnRO83xv.js → data-import-export.stories-CIZLvg4D.js} +4 -4
  39. package/dist/storybook/assets/{date-input.stories-DnF34iNJ.js → date-input.stories-BTDWCJeJ.js} +1 -1
  40. package/dist/storybook/assets/date-input.stories-BcbGtR2-.js +1 -0
  41. package/dist/storybook/assets/{dates-DGEdy1Iu.js → dates-CFjcRHXO.js} +1 -1
  42. package/dist/storybook/assets/{datetime.stories-ZsjGT_Ba.js → datetime.stories-DD0ccy0-.js} +1 -1
  43. package/dist/storybook/assets/{datetime.stories-Byw9Ly3Y.js → datetime.stories-DnNtHJjs.js} +1 -1
  44. package/dist/storybook/assets/{diff-viewer.stories-CtJPHKI9.js → diff-viewer.stories-X9oC-Oks.js} +1 -1
  45. package/dist/storybook/assets/{dist-DhxQWz_J.js → dist-QKqugWZ1.js} +1 -1
  46. package/dist/storybook/assets/{divider-BPAxNR_g.js → divider-B4em5zcI.js} +1 -1
  47. package/dist/storybook/assets/{divider.stories-Bg6ucFIb.js → divider.stories-BK7-ZNI9.js} +1 -1
  48. package/dist/storybook/assets/{drawer-BNaPmfVS.js → drawer-DwnwAjKu.js} +1 -1
  49. package/dist/storybook/assets/{drawer.stories-D3rlc0B_.js → drawer.stories-JYUXlvNF.js} +1 -1
  50. package/dist/storybook/assets/{drawer.test-case.stories-BnL35nnk.js → drawer.test-case.stories-Bki6RY0m.js} +1 -1
  51. package/dist/storybook/assets/{emotion-is-prop-valid.esm-BTIsZlY_.js → emotion-is-prop-valid.esm-BUoVdhe_.js} +1 -1
  52. package/dist/storybook/assets/{empty-D8GvG9W1.js → empty-AFmslMHq.js} +1 -1
  53. package/dist/storybook/assets/{empty.stories-Cg8BM5j7.js → empty.stories-CUtAMhAD.js} +1 -1
  54. package/dist/storybook/assets/{esm-L3AFfpT1.js → esm-Cd-AO6qk.js} +1 -1
  55. package/dist/storybook/assets/{fast-deep-equal-BQOhduti.js → fast-deep-equal-DA2RLqM2.js} +1 -1
  56. package/dist/storybook/assets/{field-jj7svWmp.js → field-CMcGBkdh.js} +1 -1
  57. package/dist/storybook/assets/{field.stories-CscEOSF7.js → field.stories-1stOxabi.js} +1 -1
  58. package/dist/storybook/assets/field.stories-uUND_mpv.js +1 -0
  59. package/dist/storybook/assets/{file-button.stories-7tfp4knW.js → file-button.stories-B4Gql_bD.js} +1 -1
  60. package/dist/storybook/assets/{file-input-qOSwxw4H.js → file-input-COas7Hi6.js} +1 -1
  61. package/dist/storybook/assets/file-input.stories-BOVJ3DmM.js +1 -0
  62. package/dist/storybook/assets/{file-input.stories-BFQYuUt9.js → file-input.stories-BWbYblYx.js} +1 -1
  63. package/dist/storybook/assets/{flex-BX_Kuh88.js → flex-D7WQTo6g.js} +1 -1
  64. package/dist/storybook/assets/flex.stories-D6jauiOe.js +1 -0
  65. package/dist/storybook/assets/{flex.stories-CtOrEbia.js → flex.stories-D9-ounPI.js} +1 -1
  66. package/dist/storybook/assets/footer.stories-Cmvu9IzH.js +3 -0
  67. package/dist/storybook/assets/{form-row-mrg4_CM6.js → form-row-BvszlQL1.js} +1 -1
  68. package/dist/storybook/assets/{form.stories-CGRd_h9l.js → form.stories-BOnXDCQp.js} +1 -1
  69. package/dist/storybook/assets/form.stories-DzytY2o2.js +1 -0
  70. package/dist/storybook/assets/{formation.stories-BGZztmZW.js → formation.stories-_ceE98-7.js} +1 -1
  71. package/dist/storybook/assets/{grid-tfYbM62b.js → grid-BFBK01ob.js} +1 -1
  72. package/dist/storybook/assets/grid.stories-CFP01cxB.js +1 -0
  73. package/dist/storybook/assets/{grid.stories-D0UOs3BA.js → grid.stories-DbHzSPWt.js} +1 -1
  74. package/dist/storybook/assets/{heading-B4XmPyQx.js → heading-DC2eTr4r.js} +1 -1
  75. package/dist/storybook/assets/{heading.stories-CaMQ2ywV.js → heading.stories-Bju_DTHl.js} +1 -1
  76. package/dist/storybook/assets/{help-icon-7rahs3sO.js → help-icon-DzkFHroz.js} +1 -1
  77. package/dist/storybook/assets/{help-icon.stories-B-dMxxVe.js → help-icon.stories-cxUKs3lA.js} +1 -1
  78. package/dist/storybook/assets/{icon.stories-D3GOzxVG.js → icon.stories-D6tjLPpV.js} +1 -1
  79. package/dist/storybook/assets/{iframe-D4Zg62hF.js → iframe-EU22ddzP.js} +3 -3
  80. package/dist/storybook/assets/{initialize-context-B9jrQ6AF.js → initialize-context-DFfe1jE3.js} +1 -1
  81. package/dist/storybook/assets/{input-BQQrNKmr.js → input-BdYHHPue.js} +1 -1
  82. package/dist/storybook/assets/{input-group-VNNfEwqC.js → input-group-D24O4Bxc.js} +1 -1
  83. package/dist/storybook/assets/{input-group-addon-DhpBpIxI.js → input-group-addon-DZoIwpw9.js} +1 -1
  84. package/dist/storybook/assets/{input-group.stories-Cta4sPNf.js → input-group.stories-DZW-vCuS.js} +1 -1
  85. package/dist/storybook/assets/{input-validation-CxAQ39hf.js → input-validation-7uhW8FiV.js} +1 -1
  86. package/dist/storybook/assets/{input.stories-BcWKa2Cr.js → input.stories-BOGHYktw.js} +1 -1
  87. package/dist/storybook/assets/input.stories-DrdUyzE1.js +1 -0
  88. package/dist/storybook/assets/{inputs-C70G499e.js → inputs-fAQnBxvD.js} +1 -1
  89. package/dist/storybook/assets/{label-CT4MqTF7.js → label-BkXPoL3G.js} +1 -1
  90. package/dist/storybook/assets/{label.stories-BqJhMJc5.js → label.stories-B2YvjXB4.js} +1 -1
  91. package/dist/storybook/assets/{layout-forms-CoG6W9RH.js → layout-forms-CjQbNopc.js} +1 -1
  92. package/dist/storybook/assets/{layout-general-B16VrftS.js → layout-general-fq4B5Zut.js} +1 -1
  93. package/dist/storybook/assets/{lib-BOe7MuKK.js → lib-XOSeRsDk.js} +1 -1
  94. package/dist/storybook/assets/{list-vHinx-zI.js → list-Zyul4Mlh.js} +1 -1
  95. package/dist/storybook/assets/{list.stories-BPv37d5w.js → list.stories-CSdiq9gU.js} +1 -1
  96. package/dist/storybook/assets/{list.stories-data-Bqe7gOfa.js → list.stories-data-Cx_fKS4q.js} +1 -1
  97. package/dist/storybook/assets/{loader-BghLkIpx.js → loader-DIB8hTmj.js} +1 -1
  98. package/dist/storybook/assets/{loader.stories-COvsf0Ta.js → loader.stories-Dc88ogP9.js} +1 -1
  99. package/dist/storybook/assets/{lodash-DCsx9Ntr.js → lodash-CiSVjb27.js} +1 -1
  100. package/dist/storybook/assets/{menu.stories-DvLzmKlP.js → menu.stories-RIy8mFoz.js} +1 -1
  101. package/dist/storybook/assets/{menu.stories-data-BYyBO-PM.js → menu.stories-data-CBZr1Taj.js} +1 -1
  102. package/dist/storybook/assets/{menu.test-case.stories-DtIecsat.js → menu.test-case.stories-Bfs_CAnP.js} +1 -1
  103. package/dist/storybook/assets/{message.stories-DEKDDAU3.js → message.stories-BhqqzEWy.js} +1 -1
  104. package/dist/storybook/assets/{meta-content-DItgLKPe.js → meta-content-DejAmkIh.js} +1 -1
  105. package/dist/storybook/assets/{modal-Cq527L7E.js → modal-W5JR3-fd.js} +1 -1
  106. package/dist/storybook/assets/{modal.stories-LXok3kLl.js → modal.stories-DiMKniQu.js} +1 -1
  107. package/dist/storybook/assets/{modal.test-case.stories-BbjTMhbe.js → modal.test-case.stories-nqS1gANF.js} +1 -1
  108. package/dist/storybook/assets/{number-input-CYtGXTJS.js → number-input-CO11SW2l.js} +1 -1
  109. package/dist/storybook/assets/number-input.stories-BbUt2m34.js +1 -0
  110. package/dist/storybook/assets/{number-input.stories-BGjpbuGx.js → number-input.stories-Re1KujgJ.js} +1 -1
  111. package/dist/storybook/assets/{number-input.test-case.stories-DGrN8gGX.js → number-input.test-case.stories-Iqn-282h.js} +1 -1
  112. package/dist/storybook/assets/option-dropdown.stories-CRCHjTo8.js +1 -0
  113. package/dist/storybook/assets/{option-dropdown.stories-Vl5HS9hq.js → option-dropdown.stories-vKETLQUY.js} +1 -1
  114. package/dist/storybook/assets/{padding-and-spacing-BZ4ZiTSH.js → padding-and-spacing-mKqkaVZM.js} +1 -1
  115. package/dist/storybook/assets/{page-g05z4ELc.js → page-DUJsIRkI.js} +1 -1
  116. package/dist/storybook/assets/{page.stories-Bs5iRsJd.js → page.stories-BgvLtK3e.js} +1 -1
  117. package/dist/storybook/assets/{pagination-Bz_ydB2y.js → pagination-_RRF0iW0.js} +1 -1
  118. package/dist/storybook/assets/{pagination.stories-uS_7UoYp.js → pagination.stories-DHwcIyb9.js} +1 -1
  119. package/dist/storybook/assets/{pop-confirm.stories-BnuzhK-p.js → pop-confirm.stories-DG8BPBmI.js} +1 -1
  120. package/dist/storybook/assets/{popover-CyuIVmBY.js → popover-DPG74BOL.js} +1 -1
  121. package/dist/storybook/assets/{popover.stories-jwK98mVS.js → popover.stories-Y4STcRfO.js} +1 -1
  122. package/dist/storybook/assets/portal-DOH-1YPk.js +1 -0
  123. package/dist/storybook/assets/{portal.stories-9aIYnykm.js → portal.stories-DAtgj2uT.js} +1 -1
  124. package/dist/storybook/assets/{progress-bar-DMVGz10l.js → progress-bar-Bx3_0EWF.js} +1 -1
  125. package/dist/storybook/assets/{progress-bar.stories-Ci3ZFHEz.js → progress-bar.stories-CyN7y1Y-.js} +1 -1
  126. package/dist/storybook/assets/{projects.stories-CF77nVZT.js → projects.stories-CE20zs8O.js} +1 -1
  127. package/dist/storybook/assets/{radio-button-C7AH6epP.js → radio-button-D0fuZMak.js} +1 -1
  128. package/dist/storybook/assets/{radio-button.stories-am7W_JWQ.js → radio-button.stories-DHE16T1a.js} +1 -1
  129. package/dist/storybook/assets/radio-button.stories-DbFVHhwO.js +1 -0
  130. package/dist/storybook/assets/{radio-button.test-case.stories-Dn-20nRc.js → radio-button.test-case.stories-Ds0nZGCE.js} +1 -1
  131. package/dist/storybook/assets/{react-18-DVHmheBO.js → react-18-CK9Naa2M.js} +1 -1
  132. package/dist/storybook/assets/react-Dh4BE5Co.js +1 -0
  133. package/dist/storybook/assets/{react-dom-DrHyh6_j.js → react-dom-rzgPE705.js} +1 -1
  134. package/dist/storybook/assets/{react-fast-compare-50RPpPoD.js → react-fast-compare-DmR1Q96O.js} +1 -1
  135. package/dist/storybook/assets/{remirror-core-helpers-BLaIuZF5.js → remirror-core-helpers-BxdBMqPL.js} +2 -2
  136. package/dist/storybook/assets/{reservoirs.stories-DTSghh4m.js → reservoirs.stories-BLoj9OLz.js} +1 -1
  137. package/dist/storybook/assets/{rich-text-input.stories-ZaFfTUD4.js → rich-text-input.stories-C-6lWEu1.js} +3 -3
  138. package/dist/storybook/assets/{row-CBGyVSEs.js → row-ccWcLrf1.js} +1 -1
  139. package/dist/storybook/assets/{row.stories-Bli-TfEf.js → row.stories-CKMQWhy5.js} +1 -1
  140. package/dist/storybook/assets/{select-dDHTUZaq.js → select-C3UalMKs.js} +1 -1
  141. package/dist/storybook/assets/{select.stories-BnA8X0fz.js → select.stories-B-P8LmMf.js} +1 -1
  142. package/dist/storybook/assets/{select.stories-CKKEMw_0.js → select.stories-DtjQjgVV.js} +1 -1
  143. package/dist/storybook/assets/{select.stories-data-C_eXQEl2.js → select.stories-data-CT2OcjDR.js} +1 -1
  144. package/dist/storybook/assets/{select.test-case.stories-CbBpz7I2.js → select.test-case.stories-DqKVyEU4.js} +1 -1
  145. package/dist/storybook/assets/{setting-field.stories-BTgQt5yY.js → setting-field.stories-CYyr31Eg.js} +1 -1
  146. package/dist/storybook/assets/{side-bar-B14uvrxk.js → side-bar-9Bbmkf0C.js} +1 -1
  147. package/dist/storybook/assets/{side-bar.stories-BWw1HKJx.js → side-bar.stories-Cia7tzIc.js} +1 -1
  148. package/dist/storybook/assets/{site.stories-COhD59HV.js → site.stories-B_1ikMCB.js} +1 -1
  149. package/dist/storybook/assets/{slider-rFDKD7LU.js → slider-MhFdkngd.js} +1 -1
  150. package/dist/storybook/assets/{slider.stories-Cjn0-WIc.js → slider.stories-CckNlLkd.js} +1 -1
  151. package/dist/storybook/assets/{slider.stories-Bm-9rKCm.js → slider.stories-D0pLwM5a.js} +1 -1
  152. package/dist/storybook/assets/{smart-upload-modal-BoOADECF.js → smart-upload-modal-zQZpAVQt.js} +1 -1
  153. package/dist/storybook/assets/{smart-upload-modal.stories-BaQkh068.js → smart-upload-modal.stories-BToPeW5h.js} +1 -1
  154. package/dist/storybook/assets/{spacer-CXxVsxF9.js → spacer-vcWIopH5.js} +1 -1
  155. package/dist/storybook/assets/{spacer.stories-CDSmJl2X.js → spacer.stories-DPSi11Bp.js} +1 -1
  156. package/dist/storybook/assets/{spinner-FbE2mbiy.js → spinner-gc9uGw0J.js} +1 -1
  157. package/dist/storybook/assets/{spinner.stories-DpQopigF.js → spinner.stories-CK0O8hEf.js} +1 -1
  158. package/dist/storybook/assets/{styled-components.browser.esm-DG0FhB-e.js → styled-components.browser.esm-DWmnuEYo.js} +1 -1
  159. package/dist/storybook/assets/{table-3zH873Md.js → table-B6Rh_KBA.js} +1 -1
  160. package/dist/storybook/assets/{table.stories-DNlQuLIO.js → table.stories-C8hHPkmK.js} +1 -1
  161. package/dist/storybook/assets/{table.stories-data-BdLpIlj_.js → table.stories-data-hBHpYw6Z.js} +1 -1
  162. package/dist/storybook/assets/{table.test-case.stories-DS9rit7R.js → table.test-case.stories-QOzGQnXy.js} +1 -1
  163. package/dist/storybook/assets/{tabs-C5z5XNIW.js → tabs-C5ycdABr.js} +1 -1
  164. package/dist/storybook/assets/{tabs.stories-Dmoe01JY.js → tabs.stories-D-MyZQNY.js} +1 -1
  165. package/dist/storybook/assets/{text-DVka0T2p.js → text-CkkjKEEc.js} +1 -1
  166. package/dist/storybook/assets/text-link.stories-7gBWHaHv.js +1 -0
  167. package/dist/storybook/assets/{text-link.stories-D2THsIkU.js → text-link.stories-C3RkXLt5.js} +1 -1
  168. package/dist/storybook/assets/{text.stories-BMTTyNKf.js → text.stories-DsybubcI.js} +1 -1
  169. package/dist/storybook/assets/{textarea-DfCgNX0N.js → textarea-D8zMidSh.js} +1 -1
  170. package/dist/storybook/assets/textarea.stories-BgTCHUTZ.js +1 -0
  171. package/dist/storybook/assets/{textarea.stories-Dht4nNH6.js → textarea.stories-EisiK949.js} +1 -1
  172. package/dist/storybook/assets/{title.stories-BMHBmrwL.js → title.stories-RgotXQt8.js} +1 -1
  173. package/dist/storybook/assets/{toaster.stories-gpBKa_lY.js → toaster.stories-DVXlLZO3.js} +1 -1
  174. package/dist/storybook/assets/{toaster.test-case.stories-D3AOmsLX.js → toaster.test-case.stories-CMsBLl5F.js} +1 -1
  175. package/dist/storybook/assets/{toggle-C_si2Zbr.js → toggle-BAmO7wKa.js} +1 -1
  176. package/dist/storybook/assets/{toggle.stories-Dig8_WhE.js → toggle.stories-CkXmUHKb.js} +1 -1
  177. package/dist/storybook/assets/toggle.stories-FV7V8hG-.js +1 -0
  178. package/dist/storybook/assets/{toggle.test-case.stories-UjPM421h.js → toggle.test-case.stories-SUkQcTKA.js} +1 -1
  179. package/dist/storybook/assets/{tooltip-BDJkAs31.js → tooltip-N1V1x_Kn.js} +1 -1
  180. package/dist/storybook/assets/{tooltip.stories-6XnQWcyy.js → tooltip.stories-DsInBp-i.js} +1 -1
  181. package/dist/storybook/assets/{tooltip.test-case.stories-Co1Lt0GK.js → tooltip.test-case.stories-BfxEEiJX.js} +1 -1
  182. package/dist/storybook/assets/{top-bar-Xyvy9J2W.js → top-bar-DCQ-Vcgr.js} +1 -1
  183. package/dist/storybook/assets/{top-bar.stories-BsQwRLt0.js → top-bar.stories-Cr1GNVIf.js} +1 -1
  184. package/dist/storybook/assets/{top-bar.testcase.stories-CsZMicVc.js → top-bar.testcase.stories-DLaCduEo.js} +1 -1
  185. package/dist/storybook/assets/{tree.stories-DfinTPtQ.js → tree.stories-BDH2ZKAF.js} +1 -1
  186. package/dist/storybook/assets/types-BjAzD82u.js +1 -0
  187. package/dist/storybook/assets/{unit-input-D3ug0XIr.js → unit-input-C-88gl7h.js} +1 -1
  188. package/dist/storybook/assets/{unit-input.stories-Cw3IxHlW.js → unit-input.stories-JosB76bO.js} +24 -8
  189. package/dist/storybook/assets/{unit-input.test-case.stories-B1Fm7RYH.js → unit-input.test-case.stories-pQmvLvTu.js} +1 -1
  190. package/dist/storybook/assets/unit-table.stories-M2tcFYq6.js +1 -0
  191. package/dist/storybook/assets/{unit-table.stories-DRfidPr_.js → unit-table.stories-kjnrEnHm.js} +1 -1
  192. package/dist/storybook/assets/{unit-table.test-case.stories-4m2yh8rO.js → unit-table.test-case.stories-CYjQekHK.js} +1 -1
  193. package/dist/storybook/assets/{use-keyboard-event-CPHW-LTR.js → use-keyboard-event-DJxq2Iwi.js} +1 -1
  194. package/dist/storybook/iframe.html +1 -1
  195. package/dist/storybook/{index-B1D5hqWS.js → index-CMB0aE4o.js} +1 -1
  196. package/dist/storybook/index.html +1 -1
  197. package/dist/storybook/index.json +1 -1
  198. package/dist/storybook/project.json +1 -1
  199. package/package.json +1 -1
  200. package/dist/storybook/assets/button.stories-BRTM9RNN.js +0 -1
  201. package/dist/storybook/assets/cell.stories-C17vOhuH.js +0 -1
  202. package/dist/storybook/assets/check-box.stories-BrKolC-R.js +0 -1
  203. package/dist/storybook/assets/client-Brc_VZqR.js +0 -1
  204. package/dist/storybook/assets/column.stories-DTTMe-SC.js +0 -1
  205. package/dist/storybook/assets/date-input.stories-BhznaFeN.js +0 -1
  206. package/dist/storybook/assets/field.stories-DVAUG5cS.js +0 -1
  207. package/dist/storybook/assets/file-input.stories-yfrmCD6p.js +0 -1
  208. package/dist/storybook/assets/flex.stories-efwSspGB.js +0 -1
  209. package/dist/storybook/assets/footer.stories-CMxnQA07.js +0 -3
  210. package/dist/storybook/assets/form.stories-BEQSYOYi.js +0 -1
  211. package/dist/storybook/assets/grid.stories-Bx0R3C-c.js +0 -1
  212. package/dist/storybook/assets/input.stories-BjLz5uNQ.js +0 -1
  213. package/dist/storybook/assets/number-input.stories-D-Lv00Zw.js +0 -1
  214. package/dist/storybook/assets/option-dropdown.stories-BCRdCUmi.js +0 -1
  215. package/dist/storybook/assets/portal-pXFQWKb2.js +0 -1
  216. package/dist/storybook/assets/radio-button.stories-BlvB1C5u.js +0 -1
  217. package/dist/storybook/assets/react-B6lwR1uU.js +0 -1
  218. package/dist/storybook/assets/text-link.stories-DLTUbZkl.js +0 -1
  219. package/dist/storybook/assets/textarea.stories-Dp6QjyZK.js +0 -1
  220. package/dist/storybook/assets/toggle.stories-DQ4MZUIi.js +0 -1
  221. package/dist/storybook/assets/types-Q8bq0gPd.js +0 -1
  222. package/dist/storybook/assets/unit-table.stories-z70YLi9Y.js +0 -1
@@ -1,4 +1,4 @@
1
- import{E as e,H as t,J as n,M as r,h as i,l as a,u as o}from"./iframe-D4Zg62hF.js";import{b as s}from"./react-dom-DrHyh6_j.js";import{g as c}from"./tooltip-BDJkAs31.js";import"./text-DVka0T2p.js";import"./lodash-DCsx9Ntr.js";import{b as l}from"./button-COZYpTMg.js";import"./spinner-FbE2mbiy.js";import"./actions-C75Yhysc.js";import"./types-D9-IVcXX.js";import"./types-Q8bq0gPd.js";import"./badge-DoQogrt7.js";import{b as u}from"./select-dDHTUZaq.js";import"./use-keyboard-event-CPHW-LTR.js";import"./memoize-one.esm-Dbu59KLW.js";import"./enum-_bzRAybU.js";import"./helpers-CNN6kPjR.js";import"./select.input-BtWEEHPQ.js";import{$ as d,A as f,B as p,C as m,D as h,E as g,F as _,G as ee,H as te,I as v,J as ne,K as y,L as re,M as ie,N as ae,O as oe,P as se,Q as ce,R as le,S as ue,T as b,U as x,V as S,W as de,X as fe,Y as pe,Z as C,_ as me,a1 as he,a2 as ge,b as _e,c as ve,d as w,e as ye,f as be,g as xe,h as T,i as Se,j as Ce,k as we,l as Te,m as Ee,n as De,o as E,p as Oe,q as ke,r as Ae,s as je,t as D,u as Me,v as Ne,w as Pe,x as Fe,y as Ie,z as Le}from"./remirror-core-helpers-BLaIuZF5.js";import"./fast-deep-equal-BQOhduti.js";function Re(e){this.content=e}Re.prototype={constructor:Re,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Re(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Re(n)},addToStart:function(e,t){return new Re([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Re(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Re(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Re.from(e),e.size?new Re(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Re.from(e),e.size?new Re(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Re.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Re.from=function(e){if(e instanceof Re)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Re(t)};var ze=Re;function Be(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Be(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Ve(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Ve(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var O=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.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 RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Be(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ve(this,e,t,n)}findIndex(e,t=-1){if(e==0)return Ue(0,e);if(e==this.size)return Ue(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),a=r+i.nodeSize;if(a>=e)return a==e||t>0?Ue(n+1,a):Ue(n,r);r=a}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};O.empty=new O([],0);const He={index:0,offset:0};function Ue(e,t){return He.index=e,He.offset=t,He}function We(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!We(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!We(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var k=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||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&&We(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 RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};k.none=[];var Ge=class extends Error{},A=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=qe(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Ke(this.content,t+this.openStart,n+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(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(O.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};A.empty=new A(O.empty,0,0);function Ke(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Ke(a.content,t-i-1,n-i-1)))}function qe(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=qe(o.content,t-a-1,n);return s&&e.replaceChild(i,o.copy(s))}function Je(e,t,n){if(n.openStart>e.depth)throw new Ge(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ge(`Inconsistent open depths`);return Ye(e,t,n,0)}function Ye(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Ye(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return et(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=rt(n,e);return et(a,tt(e,i,o,t,r))}else return et(a,nt(e,t,r))}function Xe(e,t){if(!t.type.compatibleContent(e.type))throw new Ge(`Cannot join `+t.type.name+` onto `+e.type.name)}function Ze(e,t,n){let r=e.node(n);return Xe(r,t.node(n)),r}function Qe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function $e(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Qe(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Qe(i.child(e),r);t&&t.depth==n&&t.textOffset&&Qe(t.nodeBefore,r)}function et(e,t){return e.type.checkContent(t),e.copy(t)}function tt(e,t,n,r,i){let a=e.depth>i&&Ze(e,t,i+1),o=r.depth>i&&Ze(n,r,i+1),s=[];return $e(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Xe(a,o),Qe(et(a,tt(e,t,n,r,i+1)),s)):(a&&Qe(et(a,nt(e,t,i+1)),s),$e(t,n,i,s),o&&Qe(et(o,nt(n,r,i+1)),s)),$e(r,null,i,s),new O(s)}function nt(e,t,n){let r=[];if($e(null,e,n,r),e.depth>n){let i=Ze(e,t,n+1);Qe(et(i,nt(e,t,n+1)),r)}return $e(t,null,n,r),new O(r)}function rt(e,t){let n=t.depth-e.openStart,r=t.node(n),i=r.copy(e.content);for(let e=n-1;e>=0;e--)i=t.node(e).copy(O.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}var it=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,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 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 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 n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}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 n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return k.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}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 n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ct(this,e,n);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(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=st.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else st.set(t,r=new at);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ot,i}},at=class{constructor(){this.elts=[],this.i=0}};const ot=12,st=new WeakMap;var ct=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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 lt=Object.create(null);var ut=class e{constructor(e,t,n,r=k.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||O.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,n,r=0){this.content.nodesBetween(e,t,n,r,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,n,r){return this.content.textBetween(e,t,n,r)}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,n){return this.type==e&&We(this.attrs,t||e.defaultAttrs||lt)&&k.sameSet(this.marks,n||k.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}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,n=!1){if(e==t)return A.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a),s=r.node(a),c=s.content.cut(r.pos-o,i.pos-o);return new A(c,r.depth-a,i.depth-a)}replace(e,t,n){return Je(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return it.resolveCached(this,e)}resolveNoCache(e){return it.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),ft(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=O.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.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=k.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!k.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=O.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};ut.prototype.text=void 0;var dt=class e extends ut{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ft(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(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,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 ft(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var pt=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new mt(t,n);if(r.next==null)return e.empty;let i=ht(r);r.next&&r.err(`Unexpected trailing text`);let a=Tt(St(i));return Et(a,r),a}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,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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 n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return O.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1
+ import{E as e,H as t,J as n,M as r,h as i,l as a,u as o}from"./iframe-EU22ddzP.js";import{b as s}from"./react-dom-rzgPE705.js";import{g as c}from"./tooltip-N1V1x_Kn.js";import"./text-CkkjKEEc.js";import"./lodash-CiSVjb27.js";import{b as l}from"./button-DXVRmU6A.js";import"./spinner-gc9uGw0J.js";import"./actions-Ct9IeQri.js";import"./types-D9-IVcXX.js";import"./types-BjAzD82u.js";import"./badge-CSqHSgHc.js";import{b as u}from"./select-C3UalMKs.js";import"./use-keyboard-event-DJxq2Iwi.js";import"./memoize-one.esm-Dbu59KLW.js";import"./enum-_bzRAybU.js";import"./helpers-CNN6kPjR.js";import"./select.input-BtWEEHPQ.js";import{$ as d,A as f,B as p,C as m,D as h,E as g,F as _,G as ee,H as te,I as v,J as ne,K as y,L as re,M as ie,N as ae,O as oe,P as se,Q as ce,R as le,S as ue,T as b,U as x,V as S,W as de,X as fe,Y as pe,Z as C,_ as me,a1 as he,a2 as ge,b as _e,c as ve,d as w,e as ye,f as be,g as xe,h as T,i as Se,j as Ce,k as we,l as Te,m as Ee,n as De,o as E,p as Oe,q as ke,r as Ae,s as je,t as D,u as Me,v as Ne,w as Pe,x as Fe,y as Ie,z as Le}from"./remirror-core-helpers-BxdBMqPL.js";import"./fast-deep-equal-DA2RLqM2.js";function Re(e){this.content=e}Re.prototype={constructor:Re,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Re(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Re(n)},addToStart:function(e,t){return new Re([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Re(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Re(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Re.from(e),e.size?new Re(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Re.from(e),e.size?new Re(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Re.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Re.from=function(e){if(e instanceof Re)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Re(t)};var ze=Re;function Be(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Be(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Ve(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Ve(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var O=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.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 RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Be(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ve(this,e,t,n)}findIndex(e,t=-1){if(e==0)return Ue(0,e);if(e==this.size)return Ue(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),a=r+i.nodeSize;if(a>=e)return a==e||t>0?Ue(n+1,a):Ue(n,r);r=a}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};O.empty=new O([],0);const He={index:0,offset:0};function Ue(e,t){return He.index=e,He.offset=t,He}function We(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!We(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!We(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var k=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||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&&We(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 RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};k.none=[];var Ge=class extends Error{},A=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=qe(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Ke(this.content,t+this.openStart,n+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(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(O.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};A.empty=new A(O.empty,0,0);function Ke(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Ke(a.content,t-i-1,n-i-1)))}function qe(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=qe(o.content,t-a-1,n);return s&&e.replaceChild(i,o.copy(s))}function Je(e,t,n){if(n.openStart>e.depth)throw new Ge(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ge(`Inconsistent open depths`);return Ye(e,t,n,0)}function Ye(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Ye(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return et(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=rt(n,e);return et(a,tt(e,i,o,t,r))}else return et(a,nt(e,t,r))}function Xe(e,t){if(!t.type.compatibleContent(e.type))throw new Ge(`Cannot join `+t.type.name+` onto `+e.type.name)}function Ze(e,t,n){let r=e.node(n);return Xe(r,t.node(n)),r}function Qe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function $e(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Qe(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Qe(i.child(e),r);t&&t.depth==n&&t.textOffset&&Qe(t.nodeBefore,r)}function et(e,t){return e.type.checkContent(t),e.copy(t)}function tt(e,t,n,r,i){let a=e.depth>i&&Ze(e,t,i+1),o=r.depth>i&&Ze(n,r,i+1),s=[];return $e(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Xe(a,o),Qe(et(a,tt(e,t,n,r,i+1)),s)):(a&&Qe(et(a,nt(e,t,i+1)),s),$e(t,n,i,s),o&&Qe(et(o,nt(n,r,i+1)),s)),$e(r,null,i,s),new O(s)}function nt(e,t,n){let r=[];if($e(null,e,n,r),e.depth>n){let i=Ze(e,t,n+1);Qe(et(i,nt(e,t,n+1)),r)}return $e(t,null,n,r),new O(r)}function rt(e,t){let n=t.depth-e.openStart,r=t.node(n),i=r.copy(e.content);for(let e=n-1;e>=0;e--)i=t.node(e).copy(O.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}var it=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,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 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 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 n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}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 n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return k.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}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 n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ct(this,e,n);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(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=st.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else st.set(t,r=new at);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ot,i}},at=class{constructor(){this.elts=[],this.i=0}};const ot=12,st=new WeakMap;var ct=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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 lt=Object.create(null);var ut=class e{constructor(e,t,n,r=k.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||O.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,n,r=0){this.content.nodesBetween(e,t,n,r,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,n,r){return this.content.textBetween(e,t,n,r)}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,n){return this.type==e&&We(this.attrs,t||e.defaultAttrs||lt)&&k.sameSet(this.marks,n||k.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}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,n=!1){if(e==t)return A.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a),s=r.node(a),c=s.content.cut(r.pos-o,i.pos-o);return new A(c,r.depth-a,i.depth-a)}replace(e,t,n){return Je(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return it.resolveCached(this,e)}resolveNoCache(e){return it.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),ft(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=O.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.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=k.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!k.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=O.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};ut.prototype.text=void 0;var dt=class e extends ut{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ft(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(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,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 ft(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var pt=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new mt(t,n);if(r.next==null)return e.empty;let i=ht(r);r.next&&r.err(`Unexpected trailing text`);let a=Tt(St(i));return Et(a,r),a}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,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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 n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return O.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
2
  `)}};pt.empty=new pt(!0);var mt=class{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 SyntaxError(e+` (in content expression '`+this.string+`')`)}};function ht(e){let t=[];do t.push(gt(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function gt(e){let t=[];do t.push(_t(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function _t(e){let t=xt(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=yt(e,t);else break;return t}function vt(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function yt(e,t){let n=vt(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:vt(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function bt(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function xt(e){if(e.eat(`(`)){let t=ht(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=bt(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function St(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Ct(e,t){return t-e}function wt(e,t){let n=[];return r(t),n.sort(Ct);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Tt(e){let t=Object.create(null);return n(wt(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);wt(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new pt(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Ct);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Et(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Dt(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Ot(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function kt(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function At(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Nt(e,r,t[r]);return n}var jt=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=At(e,n.attrs),this.defaultAttrs=Dt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==pt.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:Ot(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new ut(this,this.computeAttrs(e),O.from(t),k.setFrom(n))}createChecked(e=null,t,n){return t=O.from(t),this.checkContent(t),new ut(this,this.computeAttrs(e),t,k.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=O.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(O.empty,!0);return i?new ut(this,e,t.append(i),k.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){kt(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 n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:k.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Mt(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Nt=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Mt(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Pt=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=At(e,r.attrs),this.excluded=null;let i=Dt(this.attrs);this.instance=i?new k(this,i):null}create(e=null){return!e&&this.instance?this.instance:new k(this,Ot(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),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){kt(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Ft=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=ze.from(e.nodes),t.marks=ze.from(e.marks||{}),this.nodes=jt.compile(this.spec.nodes,this),this.marks=Pt.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=pt.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?It(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:It(this,n.split(` `))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(e instanceof jt){if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`)}else throw RangeError(`Invalid node type: `+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new dt(n,n.defaultAttrs,e,k.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return ut.fromJSON(this,e)}markFromJSON(e){return k.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function It(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Lt(e){return e.tag!=null}function Rt(e){return e.style!=null}var zt=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Lt(e))this.tags.push(e);else if(Rt(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Gt(this,t,!1);return n.addAll(e,k.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Gt(this,t,!0);return n.addAll(e,k.none,t.from,t.to),A.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(qt(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r],i=e.priority==null?50:e.priority;if(i<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Jt(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Jt(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}};const Bt={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},Vt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ht={ol:!0,ul:!0};function Ut(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?1:0)|(t===`full`?2:0)}var Wt=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=k.none,this.match=i||(a&4?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(O.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&1)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=O.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(O.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&&!Bt.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Gt=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Ut(null,t.preserveWhitespace,0)|(n?4:0);i=r?new Wt(r.type,r.attrs,k.none,!0,t.topMatch||r.type.contentMatch,a):n?new Wt(null,null,k.none,!0,null,a):new Wt(e.schema.topNodeType,null,k.none,!0,null,a),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 n=e.nodeValue,r=this.top,i=r.options&2?`full`:this.localPreserveWS||(r.options&1)>0;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)n=i===`full`?n.replace(/\r\n?/g,`
3
3
  `):n.replace(/\r?\n|\r/g,` `);else if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Ht.hasOwnProperty(a)&&this.parser.normalizeLists&&Kt(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Vt.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Bt.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}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)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t){let n,r;for(let t=this.open;t>=0;t--){let i=this.nodes[t],a=i.findWrapping(e);if(a&&(!n||n.length>a.length)&&(n=a,r=i,!a.length)||i.solid)break}if(!n)return null;this.sync(r);for(let e=0;e<n.length;e++)t=this.enterInner(n[e],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let n=this.findPlace(e,t);if(n){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let r=k.none;for(let i of n.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Yt(i.type,e.type))&&(r=i.addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Ut(e,i,a.options);a.options&4&&a.content.length==0&&(o|=4);let s=k.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):Yt(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new Wt(e,t,s,r,null,o)),this.open++,n}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;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].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,n){if(e!=t&&this.find){for(let r=0;r<this.find.length;r++)if(this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)){let e=t.compareDocumentPosition(this.find[r].node);e&(n?2:4)&&(this.find[r].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(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Kt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Ht.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function qt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Jt(e){let t={};for(let n in e)t[n]=e[n];return t}function Yt(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Xt=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Qt(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=nn(Qt(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&nn(Qt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return nn(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Zt(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Zt(e.marks)}};function Zt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Qt(e){return e.document||window.document}const $t=new WeakMap;function en(e){let t=$t.get(e);return t===void 0&&$t.set(e,t=tn(e)),t}function tn(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function nn(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=en(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){for(let e in u=2,l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=nn(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}const rn=65535,an=2**16;function on(e,t){return e+t*an}function sn(e){return e&rn}function cn(e){return(e-(e&rn))/an}var ln=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&8)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&4)>0}},un=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=sn(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+cn(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:on(o/3,e-s),f=e==s?2:e==u?1:4;return(t<0?e!=s:e!=u)&&(f|=8),new ln(a,f,d)}r+=l-c}return n?e+r:new ln(e+r,0,null)}touches(e,t){let n=0,r=sn(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i],c=o+s;if(e<=c&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};un.empty=new un([]);var dn=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}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,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r: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.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n],a=i.mapResult(e,t);if(a.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(a.recover);continue}}r|=a.delInfo,e=a.pos}return n?e:new ln(e,r,null)}};const fn=Object.create(null);var pn=class{getMap(){return un.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=fn[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in fn)throw RangeError(`Duplicate use of step JSON ID `+e);return fn[e]=t,t.prototype.jsonID=e,t}},mn=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Ge)return e.fail(t.message);throw t}}};function hn(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(hn(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return O.fromArray(r)}var gn=class e extends pn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new A(hn(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return mn.fromReplace(e,this.from,this.to,i)}invert(){return new _n(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};pn.jsonID(`addMark`,gn);var _n=class e extends pn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new A(hn(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return mn.fromReplace(e,this.from,this.to,n)}invert(){return new gn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};pn.jsonID(`removeMark`,_n);var vn=class e extends pn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mn.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return mn.fromReplace(e,this.pos,this.pos+1,new A(O.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new yn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};pn.jsonID(`addNodeMark`,vn);var yn=class e extends pn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mn.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return mn.fromReplace(e,this.pos,this.pos+1,new A(O.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new vn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};pn.jsonID(`removeNodeMark`,yn);var bn=class e extends pn{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Sn(e,this.from,this.to)?mn.fail(`Structure replace would overwrite content`):mn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new un([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?A.empty:new A(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?A.empty:new A(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,A.fromJSON(t,n.slice),!!n.structure)}};pn.jsonID(`replace`,bn);var xn=class e extends pn{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Sn(e,this.from,this.gapFrom)||Sn(e,this.gapTo,this.to)))return mn.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return mn.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?mn.fromReplace(e,this.from,this.to,n):mn.fail(`Content does not fit in gap`)}getMap(){return new un([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,A.fromJSON(t,n.slice),n.insert,!!n.structure)}};pn.jsonID(`replaceAround`,xn);function Sn(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Cn(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new _n(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new gn(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function wn(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof Pt){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new _n(t.from,t.to,t.style)))}function Tn(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new bn(s,l,A.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new _n(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new A(O.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new bn(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(O.empty,!0);e.replace(s,s,new A(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function En(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Dn(e){let t=e.parent,n=t.content.cutByIndex(e.startIndex,e.endIndex);for(let t=e.depth;;--t){let r=e.$from.node(t),i=e.$from.index(t),a=e.$to.indexAfter(t);if(t<e.depth&&r.canReplace(i,a,n))return t;if(t==0||r.type.spec.isolating||!En(r,i,a))break}return null}function On(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=O.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=O.from(r.node(e).copy(u)),d++):c--;let f=O.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=O.from(i.node(e).copy(f)),p++):l++;e.step(new xn(c,l,o,s,new A(u.append(f),d,p),u.size-d,!0))}function kn(e,t,n=null,r=e){let i=jn(e,t),a=i&&Mn(r,t);return a?i.map(An).concat({type:t,attrs:n}).concat(a.map(An)):null}function An(e){return{type:e,attrs:null}}function jn(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Mn(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=o.length?o[o.length-1]:t,c=s.contentMatch;for(let e=r;c&&e<i;e++)c=c.matchType(n.child(e).type);return!c||!c.validEnd?null:o}function Nn(e,t,n){let r=O.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=O.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new xn(i,a,i,a,new A(r,0,0),n.length,!0))}function Pn(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Ln(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&In(e,t,n,a),Tn(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new xn(c,l,c+1,l-1,new A(O.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Fn(e,t,n,a),!1}})}function Fn(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function In(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
@@ -15,12 +15,12 @@ It seems that you are running Remirror in a non-browser environment. Remirror ne
15
15
  If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string).
16
16
  If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr).
17
17
  If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function Su(e){var t;return e?.defaultView??(typeof window<`u`?window:void 0)??(t=Nr())?.defaultView}function Cu(e){return Su(e?.ownerDocument)}function wu(e){let t=Su(e)??xu().defaultView;if(t)return t;throw Error(`Unable to retrieve the window from the global scope`)}function Tu(e,t=xu()){let n=gu(e,e.type.schema)?e.content:O.from(e);return Xt.fromSchema(e.type.schema).serializeFragment(n,{document:t})}function Eu(e,t){let n=new(wu(t)).DOMParser;return n.parseFromString(`<body>${e}</body>`,`text/html`).body}function Du(e,t=xu()){let n=t.createElement(`div`);return n.append(Tu(e,t)),n.innerHTML}function Ou(e){let{content:t,schema:n,document:r,fragment:i=!1,...a}=e,o=Eu(t,r),s=zt.fromSchema(n);return i?s.parseSlice(o,{...ku,...a}).content:s.parse(o,{...ku,...a})}var ku={preserveWhitespace:!1},Au={remove(e,t){let n=e;for(let e of t){if(e.invalidParentNode)continue;n=ae(e.path,n)}return n}};function ju({json:e,schema:t,...n}){let r=new Set(h(t.marks)),i=new Set(h(t.nodes)),a=Mu({json:e,path:[],validNodes:i,validMarks:r});return{json:e,invalidContent:a,transformers:Au,...n}}function Mu(e){let{json:t,validMarks:n,validNodes:r,path:i=[]}=e,a={validMarks:n,validNodes:r},o=[],{type:s,marks:c,content:l}=t,{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(c){let e=[];for(let[t,r]of c.entries()){let a=p(r)?r:r.type;if(n.has(a))continue;e.unshift({name:a,path:[...i,`marks`,`${t}`],type:`mark`,invalidParentMark:u,invalidParentNode:d}),u=!0}o.push(...e)}if(r.has(s)||(o.push({name:s,type:`node`,path:i,invalidParentMark:u,invalidParentNode:d}),d=!0),l){let e=[];for(let[t,n]of l.entries())e.unshift(...Mu({...a,json:n,path:[...i,`content`,`${t}`],invalidParentMark:u,invalidParentNode:d}));o.unshift(...e)}return o}function Nu(e){return!!(Ql(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function Pu(e){return!!(Ql(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function Fu(e){let t=j.atStart(e.$anchor.doc);return!!(Pu(e)&&t.anchor===e.anchor)}function Iu({tr:e,dispatch:t}){let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Dn(i);return!Fe(a)||!i?!1:(t?.(e.lift(i,a).scrollIntoView()),!0)}function Lu(e,t={},n){return function(r){let{tr:i,dispatch:a,state:o}=r,s=p(e)?w(o.schema.nodes,e):e,{from:c,to:l}=vu(n??i.selection,i.doc),u=i.doc.resolve(c),d=i.doc.resolve(l),f=u.blockRange(d),m=f&&kn(f,s,t);return!m||!f?!1:(a?.(i.wrap(f,m).scrollIntoView()),!0)}}function Ru(e,t={},n){return r=>{let{tr:i,state:a}=r,o=p(e)?w(a.schema.nodes,e):e,s=Ll({state:i,type:o,attrs:t});return s?Iu(r):Lu(e,t,n)(r)}}function zu(e,t,n,r=!0){return function(i){let{tr:a,dispatch:o,state:s}=i,c=p(e)?w(s.schema.nodes,e):e,{from:l,to:u}=vu(n??a.selection,a.doc),d=!1,f;return a.doc.nodesBetween(l,u,(e,n)=>{if(d)return!1;if(!e.isTextblock||e.hasMarkup(c,t))return;if(e.type===c){d=!0,f=e.attrs;return}let r=a.doc.resolve(n),i=r.index();d=r.parent.canReplaceWith(i,i+1,c),d&&(f=r.parent.attrs)}),d?(o?.(a.setBlockType(l,u,c,{...r?f:{},...t}).scrollIntoView()),!0):!1}}function Bu(e){return t=>{let{tr:n,state:r}=t,{type:i,attrs:a,preserveAttrs:o=!0}=e,s=Ll({state:n,type:i,attrs:a}),c=e.toggleType??su(r.schema);if(s)return zu(c,{...o?s.node.attrs:{},...a})(t);let l=Ll({state:n,type:c,attrs:a});return zu(i,{...o?l?.node.attrs:{},...a})(t)}}function Vu(e=0){let t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(w(t,2),10)>=e:!1}function Hu(e,t){let{head:n,empty:r,anchor:i}=e;for(let e of t.steps){let t=e.getMap();n=t.map(n)}r?t.setSelection(M.near(t.doc.resolve(n))):t.setSelection(M.between(t.doc.resolve(i),t.doc.resolve(n)))}function Uu(e){let{attrs:t={},appendText:n=``,content:r=``,keepSelection:i=!1,range:a}=e;return({state:o,tr:s,dispatch:c})=>{var l;let u=o.schema,d=vu(e.selection??a??s.selection,s.doc),f=d.$from.index(),{from:m,to:h,$from:g}=d,_=p(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(E(p(e.type)?_:!0,{code:b.SCHEMA,message:`Schema contains no marks or nodes with name ${_}`}),Wl(_)){if(!g.parent.canReplaceWith(f,f,_))return!1;s.replaceWith(m,h,_.create(t,r?u.text(r):void 0))}else E(r,{message:"`replaceText` cannot be called without content when using a mark type"}),s.replaceWith(m,h,u.text(r,Kl(_)?[_.create(t)]:void 0));return n&&s.insertText(n),i&&Hu(o.selection,s),c&&(Vu(60)&&((l=document.getSelection())==null||l.empty()),c(s)),!0}}function Wu(e,t){let n=e.parent.childAfter(e.parentOffset);if(!n.node)return;let{marks:r,nodeSize:i}=n.node;if(r[0])return r[0].type;let a=e.start()+n.offset,o=a+i;return Wu(e.doc.resolve(o+1),t)}function Gu(e){return({dispatch:t,tr:n,state:r})=>{let{type:i,expand:a=!0,range:o}=e,s=vu(e.selection??o??n.selection,n.doc),{from:c,to:l,$from:u,$to:d}=s,f=p(i)?r.schema.marks[i]:i;f!==null&&E(f,{code:b.SCHEMA,message:`Mark type: ${i} does not exist on the current schema.`});let m=f??Wu(u);if(!m)return!1;let h=uu(u,m,d);return a&&h&&(c=Math.max(0,Math.min(c,h.from)),l=Math.min(Math.max(l,h.to),n.doc.nodeSize-2)),t?.(n.removeMark(c,Fe(l)?l:c,Kl(f)?f:void 0)),!0}}function Ku(e){let{node:t,predicate:n,descend:r=!0,action:i}=e;E(Jl(t),{code:b.INTERNAL,message:`Invalid "node" parameter passed to "findChildren".`}),E(D(n),{code:b.INTERNAL,message:`Invalid "predicate" parameter passed to "findChildren".`});let a=[];return t.descendants((e,t)=>{let o={node:e,pos:t},s=n(o);return s?(a.push(o),i?.(o),r):r}),a}function qu({predicate:e}){return t=>Ku({...t,predicate:e})}qu({predicate:e=>e.node.isText}),qu({predicate:e=>e.node.isInline}),qu({predicate:e=>e.node.isBlock});function Ju(e){let{regexp:t,type:n,getAttributes:r,ignoreWhitespace:i=!1,beforeDispatch:a,updateCaptured:o,shouldSkip:s,invalidMarks:c}=e,l,u=new pi(t,(e,t,d,f)=>{let{tr:m,schema:h}=e;l||(l=p(n)?h.marks[n]:n,E(l,{code:b.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}));let g=t[1],_=t[0],ee=Yu({captureGroup:g,fullMatch:_,end:f,start:d,rule:u,state:e,ignoreWhitespace:i,invalidMarks:c,shouldSkip:s,updateCaptured:o});if(!ee)return null;({start:d,end:f,captureGroup:g,fullMatch:_}=ee);let te=D(r)?r(t):r,v=f,ne=[];if(g){let e=_.search(/\S/),t=d+_.indexOf(g),n=t+g.length;ne=m.storedMarks??[],n<f&&m.delete(n,f),t>d&&m.delete(d+e,t),v=d+e+g.length}return m.addMark(d,v,l.create(te)),m.setStoredMarks(ne),a?.({tr:m,match:t,start:d,end:f}),m});return u}function Yu({captureGroup:e,fullMatch:t,end:n,start:r,rule:i,ignoreWhitespace:a,shouldSkip:o,updateCaptured:s,state:c,invalidMarks:l}){var u;if(t==null)return null;let d=s?.({captureGroup:e,fullMatch:t,start:r,end:n})??{};e=d.captureGroup??e,t=d.fullMatch??t,r=d.start??r,n=d.end??n;let f=c.doc.resolve(r),p=c.doc.resolve(n);return l&&nl({$from:f,$to:p},l)||i.invalidMarks&&nl({$from:f,$to:p},i.invalidMarks)||a&&e?.trim()===``||o?.({state:c,captureGroup:e,fullMatch:t,start:r,end:n,ruleType:`mark`})||(u=i.shouldSkip)?.call(i,{state:c,captureGroup:e,fullMatch:t,start:r,end:n,ruleType:`mark`})?null:{captureGroup:e,end:n,fullMatch:t,start:r}}var Xu=function(){let e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(e=>{let r=e?e.split(` `):[];r.forEach(e=>{if(e.startsWith(`atm_`)){let[,n]=e.split(`_`);t[n]=e}else n.push(e)})});let r=[];for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(t[e]);return r.push(...n),r.join(` `)},Zu=Xu;const Qu=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function $u(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}const ed=(e,t,n)=>{let r=$u(e,n);if(!r)return!1;let i=rd(r);if(!i){let n=r.blockRange(),i=n&&Dn(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(vd(e,i,t,-1))return!0;if(r.parent.content.size==0&&(td(a,`end`)||N.isSelectable(a)))for(let n=r.depth;;n--){let o=qn(e.doc,r.before(n),r.after(n),A.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(td(a,`end`)?j.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):N.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1};function td(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const nd=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=rd(r)}let o=a&&a.nodeBefore;return!o||!N.isSelectable(o)?!1:(t&&t(e.tr.setSelection(N.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function rd(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function id(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}const ad=(e,t,n)=>{let r=id(e,n);if(!r)return!1;let i=sd(r);if(!i)return!1;let a=i.nodeAfter;if(vd(e,i,t,1))return!0;if(r.parent.content.size==0&&(td(a,`start`)||N.isSelectable(a))){let n=qn(e.doc,r.before(),r.after(),A.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(td(a,`start`)?j.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):N.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},od=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=sd(r)}let o=a&&a.nodeAfter;return!o||!N.isSelectable(o)?!1:(t&&t(e.tr.setSelection(N.create(e.doc,a.pos)).scrollIntoView()),!0)};function sd(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const cd=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
18
- `).scrollIntoView()),!0)};function ld(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const ud=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=ld(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(j.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},dd=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof vr||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=ld(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(M.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},fd=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(zn(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Dn(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function pd(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof N&&t.selection.node.isBlock)return!r.parentOffset||!zn(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--){let n=r.node(t);if(n.isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=ld(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}}let u=t.tr;(t.selection instanceof M||t.selection instanceof vr)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=zn(u.doc,d,a.length,a);if(f||(a[0]=s?{type:s}:null,f=zn(u.doc,d,a.length,a)),u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}const md=pd(),hd=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(N.create(e.doc,i))),!0)},gd=(e,t)=>(t&&t(e.tr.setSelection(new vr(e.doc))),!0);function _d(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Vn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function vd(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&_d(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=O.empty;for(let e=o.length-1;e>=0;e--)s=O.from(o[e].create(null,s));s=O.from(i.copy(s));let c=e.tr.step(new xn(t.pos-1,r,t.pos,r,new A(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Vn(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:j.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Dn(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&td(a,`start`,!0)&&td(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=O.empty;for(let e=o.length-1;e>=0;e--)r=O.from(o[e].copy(r));let i=e.tr.step(new xn(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new A(r,o.length,0),0,!0));n(i.scrollIntoView())}return!0}}return!1}function yd(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(M.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}const bd=yd(-1),xd=yd(1);function Sd(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:a,$to:o}=t[i],s=a.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(a.pos,o.pos,(e,t)=>{if(s||!r&&e.isAtom&&e.isInline&&t>=a.pos&&t+e.nodeSize<=o.pos)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return!0}return!1}function Cd(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:i}=e[n];r.doc.nodesBetween(r.pos,i.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new pr(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1}),r.pos<i.pos&&t.push(new pr(r,i))}return t}function wd(e,t=null,n){let r=(n&&n.removeWhenPresent)!==!1,i=(n&&n.enterInlineAtoms)!==!1,a=!(n&&n.includeWhitespace);return function(n,o){let{empty:s,$cursor:c,ranges:l}=n.selection;if(s&&!c||!Sd(n.doc,l,e,i))return!1;if(o)if(c)e.isInSet(n.storedMarks||c.marks())?o(n.tr.removeStoredMark(e)):o(n.tr.addStoredMark(e.create(t)));else{let s,c=n.tr;i||(l=Cd(l)),s=r?!l.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!l.every(t=>{let n=!1;return c.doc.nodesBetween(t.$from.pos,t.$to.pos,(r,i,a)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!a&&a.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))))}),!n});for(let n=0;n<l.length;n++){let{$from:r,$to:i}=l[n];if(!s)c.removeMark(r.pos,i.pos,e);else{let n=r.pos,o=i.pos,s=r.nodeAfter,l=i.nodeBefore,u=a&&s&&s.isText?/^\s*/.exec(s.text)[0].length:0,d=a&&l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+u<o&&(n+=u,o-=d),c.addMark(n,o,e.create(t))}}o(c.scrollIntoView())}return!0}}function Td(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let Ed=Td(Qu,ed,nd),Dd=Td(Qu,ad,od);const Od={Enter:Td(cd,dd,fd,md),"Mod-Enter":ud,Backspace:Ed,"Mod-Backspace":Ed,"Shift-Backspace":Ed,Delete:Dd,"Mod-Delete":Dd,"Mod-a":gd},kd={"Ctrl-h":Od.Backspace,"Alt-Backspace":Od[`Mod-Backspace`],"Ctrl-d":Od.Delete,"Ctrl-Alt-Backspace":Od[`Mod-Delete`],"Alt-Delete":Od[`Mod-Delete`],"Alt-d":Od[`Mod-Delete`],"Ctrl-a":bd,"Ctrl-e":xd};for(let e in Od)kd[e]=Od[e];const Ad=typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform?os.platform()==`darwin`:!1,jd=Ad?kd:Od;for(var Md={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Nd={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Pd=typeof navigator<`u`&&/Mac/.test(navigator.platform),Fd=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Id=0;Id<10;Id++)Md[48+Id]=Md[96+Id]=String(Id);for(var Id=1;Id<=24;Id++)Md[Id+111]=`F`+Id;for(var Id=65;Id<=90;Id++)Md[Id]=String.fromCharCode(Id+32),Nd[Id]=String.fromCharCode(Id);for(var Ld in Md)Nd.hasOwnProperty(Ld)||(Nd[Ld]=Md[Ld]);function Rd(e){var t=Pd&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Fd&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`,n=!t&&e.key||(e.shiftKey?Nd:Md)[e.keyCode]||e.key||`Unidentified`;return n==`Esc`&&(n=`Escape`),n==`Del`&&(n=`Delete`),n==`Left`&&(n=`ArrowLeft`),n==`Up`&&(n=`ArrowUp`),n==`Right`&&(n=`ArrowRight`),n==`Down`&&(n=`ArrowDown`),n}const zd=typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Bd(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))zd?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Vd(e){let t=Object.create(null);for(let n in e)t[Bd(n)]=e[n];return t}function Hd(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Ud(e){let t=Vd(e);return function(e,n){let r=Rd(n),i,a=t[Hd(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Hd(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||r.charCodeAt(0)>127)&&(i=Md[n.keyCode])&&i!=r){let r=t[Hd(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}function Wd(e){let t=v(e,(e,t)=>(t.priority??x.Low)-(e.priority??x.Low)),n=[],r=[];for(let e of t)Qd(e)?n.push(e):r.push(e);let i;return new kr({key:Gd,view:e=>(i=e,{}),props:{transformPasted:e=>{let t=i.state.selection.$from,r=t.node().type.name,a=new Set(t.marks().map(e=>e.type.name));for(let t of n){if(t.ignoredNodes?.includes(r)||t.ignoredMarks?.some(e=>a.has(e)))continue;let n=e.content.firstChild?.textContent??``,o=!i.state.selection.empty&&e.content.childCount===1&&n,s=Se(n,t.regexp)[0];if(o&&s&&t.type===`mark`&&t.replaceSelection){let{from:e,to:n}=i.state.selection,r=i.state.doc.slice(e,n),a=r.content.textBetween(0,r.content.size);if(typeof t.replaceSelection==`boolean`?t.replaceSelection:t.replaceSelection(a)){let e=[],{getAttributes:n,markType:i}=t,a=D(n)?n(s,!0):n,o=i.create(a);return r.content.forEach(t=>{if(t.isText){let n=o.addToSet(t.marks);e.push(t.mark(n))}}),A.maxOpen(O.fromArray(e))}}let{nodes:c,transformed:l}=Xd(e.content,t,i.state.schema);l&&(e=t.type===`node`&&t.nodeType.isBlock?new A(O.fromArray(c),0,0):new A(O.fromArray(c),e.openStart,e.openEnd))}return nf(e)},handleDOMEvents:{paste:(e,t)=>{let n=t;if(!e.props.editable?.(e.state))return!1;let{clipboardData:i}=n;if(!i)return!1;let a=[...i.items].map(e=>e.getAsFile()).filter(e=>!!e);if(a.length===0)return!1;let{selection:o}=e.state;for(let{fileHandler:t,regexp:i}of r){let r=i?a.filter(e=>i.test(e.type)):a;if(r.length===0)continue;if(t({event:n,files:r,selection:o,view:e,type:`paste`}))return n.preventDefault(),!0}return!1},drop:(e,t)=>{let n=t;if(!e.props.editable?.(e.state))return!1;let{dataTransfer:i,clientX:a,clientY:o}=n;if(!i)return!1;let s=tf(n);if(s.length===0)return!1;let c=e.posAtCoords({left:a,top:o})?.pos??e.state.selection.anchor;for(let{fileHandler:t,regexp:i}of r){let r=i?s.filter(e=>i.test(e.type)):s;if(r.length===0)continue;if(t({event:n,files:r,pos:c,view:e,type:`drop`}))return n.preventDefault(),!0}return!1}}}})}var Gd=new Mr(`pasteRule`);function Kd(e,t){return function n(r){let{fragment:i,rule:a,nodes:o}=r,{regexp:s,ignoreWhitespace:c,ignoredMarks:l,ignoredNodes:u}=a,d=!1;return i.forEach(r=>{if(u?.includes(r.type.name)||$d(r)){o.push(r);return}if(!r.isText){let e=n({fragment:r.content,rule:a,nodes:[]});d||=e.transformed;let t=O.fromArray(e.nodes);r.type.validContent(t)?o.push(r.copy(t)):o.push(...e.nodes);return}if(r.marks.some(e=>ef(e)||l?.includes(e.type.name))){o.push(r);return}let i=r.text??``,f=0;for(let n of Se(i,s)){let i=n[1],s=n[0];if(c&&i?.trim()===``||!s)return;let l=n.index,u=l+s.length;l>f&&o.push(r.cut(f,l));let p=r.cut(l,u);if(s&&i){let e=s.search(/\S/),t=l+s.indexOf(i),n=t+i.length;e&&o.push(r.cut(l,l+e)),p=r.cut(t,n)}e({nodes:o,rule:a,textNode:p,match:n,schema:t}),d=!0,f=u}i&&f<i.length&&o.push(r.cut(f))}),{nodes:o,transformed:d}}}function qd(e){let{nodes:t,rule:n,textNode:r,match:i,schema:a}=e,{transformMatch:o,getAttributes:s,markType:c}=n,l=D(s)?s(i,!1):s,u=r.text??``,d=c.create(l),f=o?.(i);if(f===``)return;if(f===!1){t.push(a.text(u,r.marks));return}let p=d.addToSet(r.marks);t.push(a.text(f??u,p))}function Jd(e){let{nodes:t,rule:n,textNode:r,match:i,schema:a}=e,{transformMatch:o}=n,s=o?.(i);if(s===``||s===!1)return;let c=s??r.text??``;t.push(a.text(c,r.marks))}function Yd(e){let{nodes:t,rule:n,textNode:r,match:i}=e,{getAttributes:a,nodeType:o,getContent:s}=n,c=D(a)?a(i,!1):a,l=(s?s(i):r)||void 0;t.push(o.createChecked(c,l))}function Xd(e,t,n){let r=[];switch(t.type){case`mark`:return Kd(qd,n)({fragment:e,nodes:r,rule:t});case`node`:return Kd(Yd,n)({fragment:e,nodes:r,rule:t});default:return Kd(Jd,n)({fragment:e,nodes:r,rule:t})}}var Zd=[`mark`,`node`,`text`];function Qd(e){return De(Zd,e.type)}function $d(e){return e.type.spec.code||e.type.spec.group?.split(` `).includes(`code`)}function ef(e){return e.type.name===`code`||e.type.spec.group?.split(` `).includes(`code`)}function tf(e){let{dataTransfer:t}=e;return t?t.files?.length>0?[...t.files]:t.items?.length?[...t.items].map(e=>e.getAsFile()).filter(e=>!!e):[]:[]}function nf(e){let t=A.maxOpen(e.content);return t.openStart<e.openStart||t.openEnd<e.openEnd?t:e}let rf=()=>({events:{},emit(e,...t){(this.events[e]||[]).forEach(e=>e(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(e=>e!==t)}});var af=Object.defineProperty,sf=Object.getOwnPropertyDescriptor,I=(e,t,n,r)=>{for(var i=r>1?void 0:r?sf(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&af(t,n,i),i},cf=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},L=(e,t,n)=>(cf(e,t,`read from private field`),n?n.call(e):t.get(e)),R=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},lf=(e,t,n,r)=>(cf(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function uf(e,t){return e===t}function df(e){let{previousOptions:t,update:n,equals:r=uf}=e,i=Ce({...t,...n}),a=_(),o=h(t);for(let e of o){let n=t[e],o=i[e];if(r(n,o)){a[e]={changed:!1};continue}a[e]={changed:!0,previousValue:n,value:o}}let s=e=>{let t=_();for(let n of e){let e=a[n];e?.changed&&(t[n]=e.value)}return t};return{changes:Ce(a),options:i,pickChanged:s}}var ff={[b.DUPLICATE_HELPER_NAMES]:`helper method`,[b.DUPLICATE_COMMAND_NAMES]:`command method`};function pf(e){let{name:t,set:n,code:r}=e,i=ff[r];E(!n.has(t),{code:r,message:`There is a naming conflict for the name: ${t} used in this '${i}'. Please rename or remove from the editor to avoid runtime errors.`}),n.add(t)}function mf(...e){return y(Zu(...e).split(` `)).join(` `)}var hf=`__IGNORE__`,gf=`__ALL__`,_f=class{constructor(e,...[t]){this[`~O`]={},this._mappedHandlers=_(),this.populateMappedHandlers(),this._options=this._initialOptions=be(e,this.constructor.defaultOptions,t??_(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){let e=[],{customHandlerKeys:t,handlerKeys:n,staticKeys:r}=this.constructor;for(let i of h(this._options)){if(r.includes(i)||n.includes(i)||t.includes(i))continue;e.push(i)}return e}ensureAllKeysAreDynamic(e){if(Tl.isProduction)return;let t=[];for(let n of h(e)){if(this._dynamicKeys.includes(n))continue;t.push(n)}E(Ae(t),{code:b.INVALID_SET_EXTENSION_OPTIONS,message:`Invalid properties passed into the 'setOptions()' method: ${JSON.stringify(t)}.`})}setOptions(e){var t;let n=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);let{changes:r,options:i,pickChanged:a}=df({previousOptions:n,update:e});this.updateDynamicOptions(i),(t=this.onSetOptions)==null||t.call(this,{reason:`set`,changes:r,options:i,pickChanged:a,initialOptions:this._initialOptions})}resetOptions(){var e;let t=this.getDynamicOptions(),{changes:n,options:r,pickChanged:i}=df({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(r),(e=this.onSetOptions)==null||e.call(this,{reason:`reset`,options:r,changes:n,pickChanged:i,initialOptions:this._initialOptions})}getDynamicOptions(){return(0,Te.default)(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(let e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){let e=_();for(let t of this.constructor.handlerKeys)e[t]=(...e)=>{var n;let{handlerKeyOptions:r}=this.constructor,i=(n=r[t])?.reducer,a=i?.getDefault(...e);for(let[,n]of this._mappedHandlers[t]){let o=n(...e);if(a=i?i.accumulator(a,o,...e):o,vf(r,a,t))return a}return a};return e}addHandler(e,t,n=x.Default){return this._mappedHandlers[e].push([n,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,e])=>e!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=v(this._mappedHandlers[e],([e],[t])=>t-e)}addCustomHandler(e,t){var n;return(n=this.onAddCustomHandler)?.call(this,{[e]:t})??g}};_f.defaultOptions={},_f.staticKeys=[],_f.handlerKeys=[],_f.handlerKeyOptions={},_f.customHandlerKeys=[];function vf(e,t,n){let{[gf]:r}=e,i=e[n];return!r&&!i?!1:!!(i&&i.earlyReturnValue!==hf&&(D(i.earlyReturnValue)?i.earlyReturnValue(t)===!0:t===i.earlyReturnValue)||r&&r.earlyReturnValue!==hf&&(D(r.earlyReturnValue)?r.earlyReturnValue(t)===!0:t===r.earlyReturnValue))}var yf=class extends _f{constructor(...e){super(Sf,...e),this[`~E`]={},this._extensions=re(this.createExtensions(),e=>e.constructor),this.extensionMap=new Map;for(let e of this._extensions)this.extensionMap.set(e.constructor,e)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${ue(this.name)}Extension`}get store(){return E(this._store,{code:b.MANAGER_PHASE_ERROR,message:`An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods.`}),Ce(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(n=>t.constructor===e?t:n))}createExtensions(){return[]}getExtension(e){let t=this.extensionMap.get(e);return E(t,{code:b.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||=e}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};yf.defaultPriority=x.Default;var z=class extends yf{static get[ge](){return me.PlainExtensionConstructor}get[ge](){return me.PlainExtension}},bf=class extends yf{static get[ge](){return me.MarkExtensionConstructor}get[ge](){return me.MarkExtension}get type(){return w(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};bf.disableExtraAttributes=!1;var xf=class extends yf{static get[ge](){return me.NodeExtensionConstructor}get[ge](){return me.NodeExtension}get type(){return w(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};xf.disableExtraAttributes=!1;var Sf={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function Cf(e){return Hl(e)&&Ul(e,[me.PlainExtension,me.MarkExtension,me.NodeExtension])}function wf(e){return Hl(e)&&Ul(e,[me.PlainExtensionConstructor,me.MarkExtensionConstructor,me.NodeExtensionConstructor])}function Tf(e){return Hl(e)&&Ul(e,me.PlainExtension)}function Ef(e){return Hl(e)&&Ul(e,me.NodeExtension)}function Df(e){return Hl(e)&&Ul(e,me.MarkExtension)}function B(e){return t=>{let{defaultOptions:n,customHandlerKeys:r,handlerKeys:i,staticKeys:a,defaultPriority:o,handlerKeyOptions:s,...c}=e,l=_e(t);n&&(l.defaultOptions=n),o&&(l.defaultPriority=o),s&&(l.handlerKeyOptions=s),l.staticKeys=a??[],l.handlerKeys=i??[],l.customHandlerKeys=r??[];for(let[e,t]of Object.entries(c)){if(l[e])continue;l[e]=t}return _e(l)}}var Of=class extends z{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=_(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate(`attributes`)}}get name(){return`attributes`}onCreate(){this.transformAttributes(),this.store.setExtensionStore(`updateAttributes`,this.updateAttributes)}transformAttributes(){var e,t,n;if(this.attributeObject=_(),(e=this.store.managerSettings.exclude)?.attributes){this.store.setStoreKey(`attributes`,this.attributeObject);return}this.attributeList=[];for(let e of this.store.extensions){if((t=e.options.exclude)?.attributes)continue;let r=(n=e.createAttributes)?.call(e),i={...r,class:mf(...e.classNames??[],r?.class)};this.attributeList.unshift(i)}for(let e of this.attributeList)this.attributeObject={...this.attributeObject,...e,class:mf(this.attributeObject.class,e.class)};this.store.setStoreKey(`attributes`,this.attributeObject)}};function V(e={}){return(t,n,r)=>{(t.decoratedHelpers??={})[n]=e}}function H(e={}){return(t,n,r)=>{(t.decoratedCommands??={})[n]=e}}function kf(e){return(t,n,r)=>{(t.decoratedKeybindings??={})[n]=e}}var Af=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>e=>{let t=!0,{view:n,tr:r,dispatch:i}=e;if(!n)return!1;for(let n of this.validateHandlers)if(!n({...e,dispatch:()=>{}})){t=!1;break}if(!i||!t)return t;let a=this.promiseCreator(e);return a.then(e=>{this.runHandlers(this.successHandlers,{value:e,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(e=>{this.runHandlers(this.failureHandlers,{error:e,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(r),!0}}validate(e,t=`push`){return this.validateHandlers[t](e),this}success(e,t=`push`){return this.successHandlers[t](e),this}failure(e,t=`push`){return this.failureHandlers[t](e),this}runHandlers(e,t){var n;for(let n of e)if(!n({...t,dispatch:()=>{}}))break;(n=t.dispatch)==null||n.call(t,t.tr)}};function jf(e){let{type:t,attrs:n,range:r,selection:i}=e;return e=>{let{dispatch:a,tr:o,state:s}=e,c=p(t)?s.schema.marks[t]:t;if(E(c,{code:b.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),r||i){let{from:e,to:s}=vu(i??r??o.selection,o.doc);return ru({trState:o,type:t,...r})?a?.(o.removeMark(e,s,c)):a?.(o.addMark(e,s,c.create(n))),!0}return Cl(wd(c,n))(e)}}function Mf(e,t,n){for(let{$from:r,$to:i}of n){let n=r.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(r.pos,i.pos,t=>{if(n)return!1;n=t.inlineContent&&t.type.allowsMarkType(e)}),n)return!0}return!1}function Nf(e,t,n){return({tr:r,dispatch:i,state:a})=>{let o=vu(n??r.selection,r.doc),s=hu(o),c=p(e)?a.schema.marks[e]:e;if(E(c,{code:b.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),o.empty&&!s||!Mf(c,r.doc,o.ranges))return!1;if(!i)return!0;if(s)return r.removeStoredMark(c),t&&r.addStoredMark(c.create(t)),i(r),!0;let l=!1;for(let{$from:e,$to:t}of o.ranges){if(l)break;l=r.doc.rangeHasMark(e.pos,t.pos,c)}for(let{$from:e,$to:n}of o.ranges)l&&r.removeMark(e.pos,n.pos,c),t&&r.addMark(e.pos,n.pos,c.create(t));return i(r),!0}}function Pf(e,t={}){return({tr:n,dispatch:r,state:i})=>{let a=i.schema,o=n.selection,{from:s=o.from,to:c=s??o.to,marks:l={}}=t;if(!r)return!0;n.insertText(e,s,c);let u=w(n.steps,n.steps.length-1).getMap().map(c);for(let[e,t]of T(l))n.addMark(s,u,w(a.marks,e).create(t));return r(n),!0}}var U=class extends z{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{let{forcedUpdates:n}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:y([...n,...t])}),e}}get name(){return`commands`}get transaction(){let e=this.store.getState();this._transaction||=e.tr;let t=this._transaction.before.eq(e.doc),n=!Ae(this._transaction.steps);if(!t){let t=e.tr;if(n)for(let e of this._transaction.steps)t.step(e);this._transaction=t}return this._transaction}onCreate(){this.store.setStoreKey(`getForcedUpdates`,this.getForcedUpdates.bind(this))}onView(e){var t;let{extensions:n,helpers:r}=this.store,i=_(),a=new Set,o=_(),s=t=>{var n;let r=_(),a=()=>t??this.transaction,c=[],l=()=>c;for(let[e,t]of Object.entries(i)){if((n=o[e])?.disableChaining)continue;r[e]=this.chainedFactory({chain:r,command:t.original,getTr:a,getChain:l})}let u=e=>{E(e===a(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return r.run=(t={})=>{let n=c;c=[];for(let e of n)if(!e(u)&&t.exitEarly)return;e.dispatch(a())},r.tr=()=>{let e=c;c=[];for(let t of e)t(u);return a()},r.enabled=()=>{for(let e of c)if(!e())return!1;return!0},r.new=e=>s(e),r};for(let e of n){let n=(t=e.createCommands)?.call(e)??{},s=e.decoratedCommands??{},c={};o={...o,decoratedCommands:s};for(let[t,i]of Object.entries(s)){let a=p(i.shortcut)&&i.shortcut.startsWith(`_|`)?{shortcut:r.getNamedShortcut(i.shortcut,e.options)}:void 0;this.updateDecorated(t,{...i,name:e.name,...a}),n[t]=e[t].bind(e),i.active&&(c[t]=()=>{var t;return(t=i.active)?.call(i,e.options,this.store)??!1})}if(je(n))continue;this.addCommands({active:c,names:a,commands:i,extensionCommands:n})}let c=s();for(let[e,t]of Object.entries(c))s[e]=t;this.store.setStoreKey(`commands`,i),this.store.setStoreKey(`chain`,s),this.store.setExtensionStore(`commands`,i),this.store.setExtensionStore(`chain`,s)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return p(e)?Pf(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:`inline`},onSuccess:(e,n,r)=>this.insertText(e,{...t,...n})(r)}).generateCommand()}selectText(e,t={}){return({tr:n,dispatch:r})=>{let i=vu(e,n.doc),a=n.selection.anchor===i.anchor&&n.selection.head===i.head;return a&&!t.forceUpdate?!1:(r?.(n.setSelection(i)),!0)}}selectMark(e){return t=>{let{tr:n}=t,r=uu(n.selection.$from,e);return r?this.store.commands.selectText.original({from:r.from,to:r.to})(t):!1}}delete(e){return({tr:t,dispatch:n})=>{let{from:r,to:i}=e??t.selection;return n?.(t.delete(r,i)),!0}}emptyUpdate(e){return({tr:t,dispatch:n})=>(n&&(e?.(),n(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:n})=>(n?.(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:n,dispatch:r})=>(r?.(n.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return n=>{let{tr:r,dispatch:i}=n,a=this.store.manager.createState({content:e,selection:t});return a?(i?.(r.replaceRangeWith(0,r.doc.nodeSize-2,a.doc)),!0):!1}}resetContent(){return e=>{let{tr:t,dispatch:n}=e,r=this.store.manager.createEmptyDoc();return r?this.setContent(r)(e):(n?.(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t?.(e.setSelection(M.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>Ql(t.selection)?(e?.(t.insertText(`
18
+ `).scrollIntoView()),!0)};function ld(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const ud=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=ld(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(j.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},dd=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof vr||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=ld(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(M.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},fd=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(zn(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Dn(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function pd(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof N&&t.selection.node.isBlock)return!r.parentOffset||!zn(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--){let n=r.node(t);if(n.isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=ld(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}}let u=t.tr;(t.selection instanceof M||t.selection instanceof vr)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=zn(u.doc,d,a.length,a);if(f||(a[0]=s?{type:s}:null,f=zn(u.doc,d,a.length,a)),u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}const md=pd(),hd=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(N.create(e.doc,i))),!0)},gd=(e,t)=>(t&&t(e.tr.setSelection(new vr(e.doc))),!0);function _d(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Vn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function vd(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&_d(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=O.empty;for(let e=o.length-1;e>=0;e--)s=O.from(o[e].create(null,s));s=O.from(i.copy(s));let c=e.tr.step(new xn(t.pos-1,r,t.pos,r,new A(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Vn(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:j.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Dn(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&td(a,`start`,!0)&&td(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=O.empty;for(let e=o.length-1;e>=0;e--)r=O.from(o[e].copy(r));let i=e.tr.step(new xn(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new A(r,o.length,0),0,!0));n(i.scrollIntoView())}return!0}}return!1}function yd(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(M.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}const bd=yd(-1),xd=yd(1);function Sd(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:a,$to:o}=t[i],s=a.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(a.pos,o.pos,(e,t)=>{if(s||!r&&e.isAtom&&e.isInline&&t>=a.pos&&t+e.nodeSize<=o.pos)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return!0}return!1}function Cd(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:i}=e[n];r.doc.nodesBetween(r.pos,i.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new pr(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1}),r.pos<i.pos&&t.push(new pr(r,i))}return t}function wd(e,t=null,n){let r=(n&&n.removeWhenPresent)!==!1,i=(n&&n.enterInlineAtoms)!==!1,a=!(n&&n.includeWhitespace);return function(n,o){let{empty:s,$cursor:c,ranges:l}=n.selection;if(s&&!c||!Sd(n.doc,l,e,i))return!1;if(o)if(c)e.isInSet(n.storedMarks||c.marks())?o(n.tr.removeStoredMark(e)):o(n.tr.addStoredMark(e.create(t)));else{let s,c=n.tr;i||(l=Cd(l)),s=r?!l.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!l.every(t=>{let n=!1;return c.doc.nodesBetween(t.$from.pos,t.$to.pos,(r,i,a)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!a&&a.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))))}),!n});for(let n=0;n<l.length;n++){let{$from:r,$to:i}=l[n];if(!s)c.removeMark(r.pos,i.pos,e);else{let n=r.pos,o=i.pos,s=r.nodeAfter,l=i.nodeBefore,u=a&&s&&s.isText?/^\s*/.exec(s.text)[0].length:0,d=a&&l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+u<o&&(n+=u,o-=d),c.addMark(n,o,e.create(t))}}o(c.scrollIntoView())}return!0}}function Td(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let Ed=Td(Qu,ed,nd),Dd=Td(Qu,ad,od);const Od={Enter:Td(cd,dd,fd,md),"Mod-Enter":ud,Backspace:Ed,"Mod-Backspace":Ed,"Shift-Backspace":Ed,Delete:Dd,"Mod-Delete":Dd,"Mod-a":gd},kd={"Ctrl-h":Od.Backspace,"Alt-Backspace":Od[`Mod-Backspace`],"Ctrl-d":Od.Delete,"Ctrl-Alt-Backspace":Od[`Mod-Delete`],"Alt-Delete":Od[`Mod-Delete`],"Alt-d":Od[`Mod-Delete`],"Ctrl-a":bd,"Ctrl-e":xd};for(let e in Od)kd[e]=Od[e];const Ad=typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform?os.platform()==`darwin`:!1,jd=Ad?kd:Od;for(var Md={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Nd={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Pd=typeof navigator<`u`&&/Mac/.test(navigator.platform),Fd=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Id=0;Id<10;Id++)Md[48+Id]=Md[96+Id]=String(Id);for(var Id=1;Id<=24;Id++)Md[Id+111]=`F`+Id;for(var Id=65;Id<=90;Id++)Md[Id]=String.fromCharCode(Id+32),Nd[Id]=String.fromCharCode(Id);for(var Ld in Md)Nd.hasOwnProperty(Ld)||(Nd[Ld]=Md[Ld]);function Rd(e){var t=Pd&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Fd&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`,n=!t&&e.key||(e.shiftKey?Nd:Md)[e.keyCode]||e.key||`Unidentified`;return n==`Esc`&&(n=`Escape`),n==`Del`&&(n=`Delete`),n==`Left`&&(n=`ArrowLeft`),n==`Up`&&(n=`ArrowUp`),n==`Right`&&(n=`ArrowRight`),n==`Down`&&(n=`ArrowDown`),n}const zd=typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Bd(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))zd?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Vd(e){let t=Object.create(null);for(let n in e)t[Bd(n)]=e[n];return t}function Hd(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Ud(e){let t=Vd(e);return function(e,n){let r=Rd(n),i,a=t[Hd(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Hd(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||r.charCodeAt(0)>127)&&(i=Md[n.keyCode])&&i!=r){let r=t[Hd(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}function Wd(e){let t=v(e,(e,t)=>(t.priority??x.Low)-(e.priority??x.Low)),n=[],r=[];for(let e of t)Qd(e)?n.push(e):r.push(e);let i;return new kr({key:Gd,view:e=>(i=e,{}),props:{transformPasted:e=>{let t=i.state.selection.$from,r=t.node().type.name,a=new Set(t.marks().map(e=>e.type.name));for(let t of n){if(t.ignoredNodes?.includes(r)||t.ignoredMarks?.some(e=>a.has(e)))continue;let n=e.content.firstChild?.textContent??``,o=!i.state.selection.empty&&e.content.childCount===1&&n,s=Se(n,t.regexp)[0];if(o&&s&&t.type===`mark`&&t.replaceSelection){let{from:e,to:n}=i.state.selection,r=i.state.doc.slice(e,n),a=r.content.textBetween(0,r.content.size);if(typeof t.replaceSelection==`boolean`?t.replaceSelection:t.replaceSelection(a)){let e=[],{getAttributes:n,markType:i}=t,a=D(n)?n(s,!0):n,o=i.create(a);return r.content.forEach(t=>{if(t.isText){let n=o.addToSet(t.marks);e.push(t.mark(n))}}),A.maxOpen(O.fromArray(e))}}let{nodes:c,transformed:l}=Xd(e.content,t,i.state.schema);l&&(e=t.type===`node`&&t.nodeType.isBlock?new A(O.fromArray(c),0,0):new A(O.fromArray(c),e.openStart,e.openEnd))}return nf(e)},handleDOMEvents:{paste:(e,t)=>{let n=t;if(!e.props.editable?.(e.state))return!1;let{clipboardData:i}=n;if(!i)return!1;let a=[...i.items].map(e=>e.getAsFile()).filter(e=>!!e);if(a.length===0)return!1;let{selection:o}=e.state;for(let{fileHandler:t,regexp:i}of r){let r=i?a.filter(e=>i.test(e.type)):a;if(r.length===0)continue;if(t({event:n,files:r,selection:o,view:e,type:`paste`}))return n.preventDefault(),!0}return!1},drop:(e,t)=>{let n=t;if(!e.props.editable?.(e.state))return!1;let{dataTransfer:i,clientX:a,clientY:o}=n;if(!i)return!1;let s=tf(n);if(s.length===0)return!1;let c=e.posAtCoords({left:a,top:o})?.pos??e.state.selection.anchor;for(let{fileHandler:t,regexp:i}of r){let r=i?s.filter(e=>i.test(e.type)):s;if(r.length===0)continue;if(t({event:n,files:r,pos:c,view:e,type:`drop`}))return n.preventDefault(),!0}return!1}}}})}var Gd=new Mr(`pasteRule`);function Kd(e,t){return function n(r){let{fragment:i,rule:a,nodes:o}=r,{regexp:s,ignoreWhitespace:c,ignoredMarks:l,ignoredNodes:u}=a,d=!1;return i.forEach(r=>{if(u?.includes(r.type.name)||$d(r)){o.push(r);return}if(!r.isText){let e=n({fragment:r.content,rule:a,nodes:[]});d||=e.transformed;let t=O.fromArray(e.nodes);r.type.validContent(t)?o.push(r.copy(t)):o.push(...e.nodes);return}if(r.marks.some(e=>ef(e)||l?.includes(e.type.name))){o.push(r);return}let i=r.text??``,f=0;for(let n of Se(i,s)){let i=n[1],s=n[0];if(c&&i?.trim()===``||!s)return;let l=n.index,u=l+s.length;l>f&&o.push(r.cut(f,l));let p=r.cut(l,u);if(s&&i){let e=s.search(/\S/),t=l+s.indexOf(i),n=t+i.length;e&&o.push(r.cut(l,l+e)),p=r.cut(t,n)}e({nodes:o,rule:a,textNode:p,match:n,schema:t}),d=!0,f=u}i&&f<i.length&&o.push(r.cut(f))}),{nodes:o,transformed:d}}}function qd(e){let{nodes:t,rule:n,textNode:r,match:i,schema:a}=e,{transformMatch:o,getAttributes:s,markType:c}=n,l=D(s)?s(i,!1):s,u=r.text??``,d=c.create(l),f=o?.(i);if(f===``)return;if(f===!1){t.push(a.text(u,r.marks));return}let p=d.addToSet(r.marks);t.push(a.text(f??u,p))}function Jd(e){let{nodes:t,rule:n,textNode:r,match:i,schema:a}=e,{transformMatch:o}=n,s=o?.(i);if(s===``||s===!1)return;let c=s??r.text??``;t.push(a.text(c,r.marks))}function Yd(e){let{nodes:t,rule:n,textNode:r,match:i}=e,{getAttributes:a,nodeType:o,getContent:s}=n,c=D(a)?a(i,!1):a,l=(s?s(i):r)||void 0;t.push(o.createChecked(c,l))}function Xd(e,t,n){let r=[];switch(t.type){case`mark`:return Kd(qd,n)({fragment:e,nodes:r,rule:t});case`node`:return Kd(Yd,n)({fragment:e,nodes:r,rule:t});default:return Kd(Jd,n)({fragment:e,nodes:r,rule:t})}}var Zd=[`mark`,`node`,`text`];function Qd(e){return De(Zd,e.type)}function $d(e){return e.type.spec.code||e.type.spec.group?.split(` `).includes(`code`)}function ef(e){return e.type.name===`code`||e.type.spec.group?.split(` `).includes(`code`)}function tf(e){let{dataTransfer:t}=e;return t?t.files?.length>0?[...t.files]:t.items?.length?[...t.items].map(e=>e.getAsFile()).filter(e=>!!e):[]:[]}function nf(e){let t=A.maxOpen(e.content);return t.openStart<e.openStart||t.openEnd<e.openEnd?t:e}let rf=()=>({events:{},emit(e,...t){(this.events[e]||[]).forEach(e=>e(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(e=>e!==t)}});var af=Object.defineProperty,sf=Object.getOwnPropertyDescriptor,I=(e,t,n,r)=>{for(var i=r>1?void 0:r?sf(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&af(t,n,i),i},cf=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},L=(e,t,n)=>(cf(e,t,`read from private field`),n?n.call(e):t.get(e)),R=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},lf=(e,t,n,r)=>(cf(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function uf(e,t){return e===t}function df(e){let{previousOptions:t,update:n,equals:r=uf}=e,i=Ce({...t,...n}),a=_(),o=h(t);for(let e of o){let n=t[e],o=i[e];if(r(n,o)){a[e]={changed:!1};continue}a[e]={changed:!0,previousValue:n,value:o}}let s=e=>{let t=_();for(let n of e){let e=a[n];e?.changed&&(t[n]=e.value)}return t};return{changes:Ce(a),options:i,pickChanged:s}}var ff={[b.DUPLICATE_HELPER_NAMES]:`helper method`,[b.DUPLICATE_COMMAND_NAMES]:`command method`};function pf(e){let{name:t,set:n,code:r}=e,i=ff[r];E(!n.has(t),{code:r,message:`There is a naming conflict for the name: ${t} used in this '${i}'. Please rename or remove from the editor to avoid runtime errors.`}),n.add(t)}function mf(...e){return y(Zu(...e).split(` `)).join(` `)}var hf=`__IGNORE__`,gf=`__ALL__`,_f=class{constructor(e,...[t]){this[`~O`]={},this._mappedHandlers=_(),this.populateMappedHandlers(),this._options=this._initialOptions=be(e,this.constructor.defaultOptions,t??_(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){let e=[],{customHandlerKeys:t,handlerKeys:n,staticKeys:r}=this.constructor;for(let i of h(this._options)){if(r.includes(i)||n.includes(i)||t.includes(i))continue;e.push(i)}return e}ensureAllKeysAreDynamic(e){if(Tl.isProduction)return;let t=[];for(let n of h(e)){if(this._dynamicKeys.includes(n))continue;t.push(n)}E(Ae(t),{code:b.INVALID_SET_EXTENSION_OPTIONS,message:`Invalid properties passed into the 'setOptions()' method: ${JSON.stringify(t)}.`})}setOptions(e){var t;let n=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);let{changes:r,options:i,pickChanged:a}=df({previousOptions:n,update:e});this.updateDynamicOptions(i),(t=this.onSetOptions)==null||t.call(this,{reason:`set`,changes:r,options:i,pickChanged:a,initialOptions:this._initialOptions})}resetOptions(){var e;let t=this.getDynamicOptions(),{changes:n,options:r,pickChanged:i}=df({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(r),(e=this.onSetOptions)==null||e.call(this,{reason:`reset`,options:r,changes:n,pickChanged:i,initialOptions:this._initialOptions})}getDynamicOptions(){return(0,Ee.default)(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(let e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){let e=_();for(let t of this.constructor.handlerKeys)e[t]=(...e)=>{var n;let{handlerKeyOptions:r}=this.constructor,i=(n=r[t])?.reducer,a=i?.getDefault(...e);for(let[,n]of this._mappedHandlers[t]){let o=n(...e);if(a=i?i.accumulator(a,o,...e):o,vf(r,a,t))return a}return a};return e}addHandler(e,t,n=x.Default){return this._mappedHandlers[e].push([n,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,e])=>e!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=v(this._mappedHandlers[e],([e],[t])=>t-e)}addCustomHandler(e,t){var n;return(n=this.onAddCustomHandler)?.call(this,{[e]:t})??g}};_f.defaultOptions={},_f.staticKeys=[],_f.handlerKeys=[],_f.handlerKeyOptions={},_f.customHandlerKeys=[];function vf(e,t,n){let{[gf]:r}=e,i=e[n];return!r&&!i?!1:!!(i&&i.earlyReturnValue!==hf&&(D(i.earlyReturnValue)?i.earlyReturnValue(t)===!0:t===i.earlyReturnValue)||r&&r.earlyReturnValue!==hf&&(D(r.earlyReturnValue)?r.earlyReturnValue(t)===!0:t===r.earlyReturnValue))}var yf=class extends _f{constructor(...e){super(Sf,...e),this[`~E`]={},this._extensions=re(this.createExtensions(),e=>e.constructor),this.extensionMap=new Map;for(let e of this._extensions)this.extensionMap.set(e.constructor,e)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${ue(this.name)}Extension`}get store(){return E(this._store,{code:b.MANAGER_PHASE_ERROR,message:`An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods.`}),Ce(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(n=>t.constructor===e?t:n))}createExtensions(){return[]}getExtension(e){let t=this.extensionMap.get(e);return E(t,{code:b.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||=e}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};yf.defaultPriority=x.Default;var z=class extends yf{static get[ge](){return me.PlainExtensionConstructor}get[ge](){return me.PlainExtension}},bf=class extends yf{static get[ge](){return me.MarkExtensionConstructor}get[ge](){return me.MarkExtension}get type(){return w(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};bf.disableExtraAttributes=!1;var xf=class extends yf{static get[ge](){return me.NodeExtensionConstructor}get[ge](){return me.NodeExtension}get type(){return w(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};xf.disableExtraAttributes=!1;var Sf={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function Cf(e){return Hl(e)&&Ul(e,[me.PlainExtension,me.MarkExtension,me.NodeExtension])}function wf(e){return Hl(e)&&Ul(e,[me.PlainExtensionConstructor,me.MarkExtensionConstructor,me.NodeExtensionConstructor])}function Tf(e){return Hl(e)&&Ul(e,me.PlainExtension)}function Ef(e){return Hl(e)&&Ul(e,me.NodeExtension)}function Df(e){return Hl(e)&&Ul(e,me.MarkExtension)}function B(e){return t=>{let{defaultOptions:n,customHandlerKeys:r,handlerKeys:i,staticKeys:a,defaultPriority:o,handlerKeyOptions:s,...c}=e,l=_e(t);n&&(l.defaultOptions=n),o&&(l.defaultPriority=o),s&&(l.handlerKeyOptions=s),l.staticKeys=a??[],l.handlerKeys=i??[],l.customHandlerKeys=r??[];for(let[e,t]of Object.entries(c)){if(l[e])continue;l[e]=t}return _e(l)}}var Of=class extends z{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=_(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate(`attributes`)}}get name(){return`attributes`}onCreate(){this.transformAttributes(),this.store.setExtensionStore(`updateAttributes`,this.updateAttributes)}transformAttributes(){var e,t,n;if(this.attributeObject=_(),(e=this.store.managerSettings.exclude)?.attributes){this.store.setStoreKey(`attributes`,this.attributeObject);return}this.attributeList=[];for(let e of this.store.extensions){if((t=e.options.exclude)?.attributes)continue;let r=(n=e.createAttributes)?.call(e),i={...r,class:mf(...e.classNames??[],r?.class)};this.attributeList.unshift(i)}for(let e of this.attributeList)this.attributeObject={...this.attributeObject,...e,class:mf(this.attributeObject.class,e.class)};this.store.setStoreKey(`attributes`,this.attributeObject)}};function V(e={}){return(t,n,r)=>{(t.decoratedHelpers??={})[n]=e}}function H(e={}){return(t,n,r)=>{(t.decoratedCommands??={})[n]=e}}function kf(e){return(t,n,r)=>{(t.decoratedKeybindings??={})[n]=e}}var Af=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>e=>{let t=!0,{view:n,tr:r,dispatch:i}=e;if(!n)return!1;for(let n of this.validateHandlers)if(!n({...e,dispatch:()=>{}})){t=!1;break}if(!i||!t)return t;let a=this.promiseCreator(e);return a.then(e=>{this.runHandlers(this.successHandlers,{value:e,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(e=>{this.runHandlers(this.failureHandlers,{error:e,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(r),!0}}validate(e,t=`push`){return this.validateHandlers[t](e),this}success(e,t=`push`){return this.successHandlers[t](e),this}failure(e,t=`push`){return this.failureHandlers[t](e),this}runHandlers(e,t){var n;for(let n of e)if(!n({...t,dispatch:()=>{}}))break;(n=t.dispatch)==null||n.call(t,t.tr)}};function jf(e){let{type:t,attrs:n,range:r,selection:i}=e;return e=>{let{dispatch:a,tr:o,state:s}=e,c=p(t)?s.schema.marks[t]:t;if(E(c,{code:b.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),r||i){let{from:e,to:s}=vu(i??r??o.selection,o.doc);return ru({trState:o,type:t,...r})?a?.(o.removeMark(e,s,c)):a?.(o.addMark(e,s,c.create(n))),!0}return Cl(wd(c,n))(e)}}function Mf(e,t,n){for(let{$from:r,$to:i}of n){let n=r.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(r.pos,i.pos,t=>{if(n)return!1;n=t.inlineContent&&t.type.allowsMarkType(e)}),n)return!0}return!1}function Nf(e,t,n){return({tr:r,dispatch:i,state:a})=>{let o=vu(n??r.selection,r.doc),s=hu(o),c=p(e)?a.schema.marks[e]:e;if(E(c,{code:b.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),o.empty&&!s||!Mf(c,r.doc,o.ranges))return!1;if(!i)return!0;if(s)return r.removeStoredMark(c),t&&r.addStoredMark(c.create(t)),i(r),!0;let l=!1;for(let{$from:e,$to:t}of o.ranges){if(l)break;l=r.doc.rangeHasMark(e.pos,t.pos,c)}for(let{$from:e,$to:n}of o.ranges)l&&r.removeMark(e.pos,n.pos,c),t&&r.addMark(e.pos,n.pos,c.create(t));return i(r),!0}}function Pf(e,t={}){return({tr:n,dispatch:r,state:i})=>{let a=i.schema,o=n.selection,{from:s=o.from,to:c=s??o.to,marks:l={}}=t;if(!r)return!0;n.insertText(e,s,c);let u=w(n.steps,n.steps.length-1).getMap().map(c);for(let[e,t]of T(l))n.addMark(s,u,w(a.marks,e).create(t));return r(n),!0}}var U=class extends z{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{let{forcedUpdates:n}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:y([...n,...t])}),e}}get name(){return`commands`}get transaction(){let e=this.store.getState();this._transaction||=e.tr;let t=this._transaction.before.eq(e.doc),n=!Ae(this._transaction.steps);if(!t){let t=e.tr;if(n)for(let e of this._transaction.steps)t.step(e);this._transaction=t}return this._transaction}onCreate(){this.store.setStoreKey(`getForcedUpdates`,this.getForcedUpdates.bind(this))}onView(e){var t;let{extensions:n,helpers:r}=this.store,i=_(),a=new Set,o=_(),s=t=>{var n;let r=_(),a=()=>t??this.transaction,c=[],l=()=>c;for(let[e,t]of Object.entries(i)){if((n=o[e])?.disableChaining)continue;r[e]=this.chainedFactory({chain:r,command:t.original,getTr:a,getChain:l})}let u=e=>{E(e===a(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return r.run=(t={})=>{let n=c;c=[];for(let e of n)if(!e(u)&&t.exitEarly)return;e.dispatch(a())},r.tr=()=>{let e=c;c=[];for(let t of e)t(u);return a()},r.enabled=()=>{for(let e of c)if(!e())return!1;return!0},r.new=e=>s(e),r};for(let e of n){let n=(t=e.createCommands)?.call(e)??{},s=e.decoratedCommands??{},c={};o={...o,decoratedCommands:s};for(let[t,i]of Object.entries(s)){let a=p(i.shortcut)&&i.shortcut.startsWith(`_|`)?{shortcut:r.getNamedShortcut(i.shortcut,e.options)}:void 0;this.updateDecorated(t,{...i,name:e.name,...a}),n[t]=e[t].bind(e),i.active&&(c[t]=()=>{var t;return(t=i.active)?.call(i,e.options,this.store)??!1})}if(je(n))continue;this.addCommands({active:c,names:a,commands:i,extensionCommands:n})}let c=s();for(let[e,t]of Object.entries(c))s[e]=t;this.store.setStoreKey(`commands`,i),this.store.setStoreKey(`chain`,s),this.store.setExtensionStore(`commands`,i),this.store.setExtensionStore(`chain`,s)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return p(e)?Pf(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:`inline`},onSuccess:(e,n,r)=>this.insertText(e,{...t,...n})(r)}).generateCommand()}selectText(e,t={}){return({tr:n,dispatch:r})=>{let i=vu(e,n.doc),a=n.selection.anchor===i.anchor&&n.selection.head===i.head;return a&&!t.forceUpdate?!1:(r?.(n.setSelection(i)),!0)}}selectMark(e){return t=>{let{tr:n}=t,r=uu(n.selection.$from,e);return r?this.store.commands.selectText.original({from:r.from,to:r.to})(t):!1}}delete(e){return({tr:t,dispatch:n})=>{let{from:r,to:i}=e??t.selection;return n?.(t.delete(r,i)),!0}}emptyUpdate(e){return({tr:t,dispatch:n})=>(n&&(e?.(),n(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:n})=>(n?.(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:n,dispatch:r})=>(r?.(n.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return n=>{let{tr:r,dispatch:i}=n,a=this.store.manager.createState({content:e,selection:t});return a?(i?.(r.replaceRangeWith(0,r.doc.nodeSize-2,a.doc)),!0):!1}}resetContent(){return e=>{let{tr:t,dispatch:n}=e,r=this.store.manager.createEmptyDoc();return r?this.setContent(r)(e):(n?.(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t?.(e.setSelection(M.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>Ql(t.selection)?(e?.(t.insertText(`
19
19
  `)),!0):!1}insertNode(e,t={}){return({dispatch:n,tr:r,state:i})=>{var a;let{attrs:o,range:s,selection:c,replaceEmptyParentBlock:l=!1}=t,{from:u,to:d,$from:f}=vu(c??s??r.selection,r.doc);if(Jl(e)||Yl(e)){let t=f.before(f.depth);return n?.(l&&u===d&&lu(f.parent)?r.replaceWith(t,t+f.parent.nodeSize,e):r.replaceWith(u,d,e)),!0}let m=p(e)?i.schema.nodes[e]:e;E(m,{code:b.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});let h=(a=t.marks)?.map(e=>{if(e instanceof k)return e;let t=p(e)?i.schema.marks[e]:e;return E(t,{code:b.SCHEMA,message:`The requested mark type ${e} does not exist in the schema.`}),t.create()}),g=m.createAndFill(o,p(t.content)?i.schema.text(t.content):t.content,h);if(!g)return!1;let _=u!==d;return n?.(_?r.replaceRangeWith(u,d,g):r.insert(u,g)),!0}}focus(e){return t=>{let{dispatch:n,tr:r}=t,{view:i}=this.store;if(e===!1||i.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){let{from:t=0,to:n=t}=r.selection;e={from:t,to:n}}return n&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{let{view:n}=this.store;return n.hasFocus()?(requestAnimationFrame(()=>{n.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,n,r=!0){return zu(e,t,n,r)}toggleWrappingNode(e,t,n){return Ru(e,t,n)}toggleBlockNodeItem(e){return Bu(e)}wrapInNode(e,t,n){return Lu(e,t,n)}applyMark(e,t,n){return Nf(e,t,n)}toggleMark(e){return jf(e)}removeMark(e){return Gu(e)}setMeta(e,t){return({tr:n})=>(n.setMeta(e,t),!0)}selectAll(){return this.selectText(`all`)}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand(`copy`),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)?.readText?await navigator.clipboard.readText():``},placeholder:{type:`inline`},onSuccess:(e,t,n)=>this.insertNode(Ou({content:e,schema:n.state.schema}),{selection:t})(n)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand(`cut`),!0)}replaceText(e){return Uu(e)}getAllCommandOptions(){let e={};for(let[t,n]of this.decorated){if(je(n))continue;e[t]=n}return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}let n=this.decorated.get(e)??{name:``};this.decorated.set(e,{...n,...t})}handleIosFocus(){Tl.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){let t=e.getMeta(this.pluginKey)??{};return{...Ff,...t}}setCommandMeta(e,t){let n=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...n,...t})}addCommands(e){let{extensionCommands:t,commands:n,names:r,active:i}=e;for(let[e,a]of T(t))pf({name:e,set:r,code:b.DUPLICATE_COMMAND_NAMES}),E(!If.has(e),{code:b.DUPLICATE_COMMAND_NAMES,message:`The command name you chose is forbidden.`}),n[e]=this.createUnchainedCommand(a,i[e])}unchainedFactory(e){return(...t)=>{let{shouldDispatch:n=!0,command:r}=e,{view:i}=this.store,{state:a}=i,o;return n&&(o=i.dispatch),r(...t)({state:a,dispatch:o,view:i,tr:a.tr})}}createUnchainedCommand(e,t){let n=this.unchainedFactory({command:e});return n.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),n.isEnabled=n.enabled,n.original=e,n.active=t,n}chainedFactory(e){return(...t)=>{let{chain:n,command:r,getTr:i,getChain:a}=e,o=a(),{view:s}=this.store,{state:c}=s;return o.push(e=>r(...t)({state:c,dispatch:e,view:s,tr:i()})),n}}};I([H()],U.prototype,`customDispatch`,1),I([H()],U.prototype,`insertText`,1),I([H()],U.prototype,`selectText`,1),I([H()],U.prototype,`selectMark`,1),I([H()],U.prototype,`delete`,1),I([H()],U.prototype,`emptyUpdate`,1),I([H()],U.prototype,`forceUpdate`,1),I([H()],U.prototype,`updateNodeAttributes`,1),I([H()],U.prototype,`setContent`,1),I([H()],U.prototype,`resetContent`,1),I([H()],U.prototype,`emptySelection`,1),I([H()],U.prototype,`insertNewLine`,1),I([H()],U.prototype,`insertNode`,1),I([H()],U.prototype,`focus`,1),I([H()],U.prototype,`blur`,1),I([H()],U.prototype,`setBlockNodeType`,1),I([H()],U.prototype,`toggleWrappingNode`,1),I([H()],U.prototype,`toggleBlockNodeItem`,1),I([H()],U.prototype,`wrapInNode`,1),I([H()],U.prototype,`applyMark`,1),I([H()],U.prototype,`toggleMark`,1),I([H()],U.prototype,`removeMark`,1),I([H()],U.prototype,`setMeta`,1),I([H({description:({t:e})=>e(Ur.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(Ur.SELECT_ALL_LABEL),shortcut:C.SelectAll})],U.prototype,`selectAll`,1),I([H({description:({t:e})=>e(Ur.COPY_DESCRIPTION),label:({t:e})=>e(Ur.COPY_LABEL),shortcut:C.Copy,icon:`fileCopyLine`})],U.prototype,`copy`,1),I([H({description:({t:e})=>e(Ur.PASTE_DESCRIPTION),label:({t:e})=>e(Ur.PASTE_LABEL),shortcut:C.Paste,icon:`clipboardLine`})],U.prototype,`paste`,1),I([H({description:({t:e})=>e(Ur.CUT_DESCRIPTION),label:({t:e})=>e(Ur.CUT_LABEL),shortcut:C.Cut,icon:`scissorsFill`})],U.prototype,`cut`,1),I([H()],U.prototype,`replaceText`,1),I([V()],U.prototype,`getAllCommandOptions`,1),I([V()],U.prototype,`getCommandOptions`,1),I([V()],U.prototype,`getCommandProp`,1),U=I([B({defaultPriority:x.Highest,defaultOptions:{trackerClassName:`remirror-tracker-position`,trackerNodeName:`span`},staticKeys:[`trackerClassName`,`trackerNodeName`]})],U);var Ff={forcedUpdates:[]},If=new Set([`run`,`chain`,`original`,`raw`,`enabled`,`tr`,`new`]),Lf=class extends z{constructor(){super(...arguments),this.placeholders=F.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{let t=ie(),{promise:n,placeholder:r,onFailure:i,onSuccess:a}=e;return new Af(n).validate(e=>this.addPlaceholder(t,r)(e)).success(e=>{let{state:n,tr:r,dispatch:o,view:s,value:c}=e,l=this.store.helpers.findPlaceholder(t);if(!l){let e=Error(`The placeholder has been removed`);return i?.({error:e,state:n,tr:r,dispatch:o,view:s})??!1}return this.removePlaceholder(t)({state:n,tr:r,view:s,dispatch:()=>{}}),a(c,l,{state:n,tr:r,dispatch:o,view:s})}).failure(e=>(this.removePlaceholder(t)({...e,dispatch:()=>{}}),i?.(e)??!1))}}get name(){return`decorations`}onCreate(){this.store.setExtensionStore(`createPlaceholderCommand`,this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,n,r,i,a,o;let{added:s,clearTrackers:c,removed:l,updated:u}=this.getMeta(e);if(c){this.placeholders=F.empty;for(let[,e]of this.placeholderWidgets)(n=(t=e.spec).onDestroy)==null||n.call(t,this.store.view,e.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:e=>{var t,n;let r=this.placeholderWidgets.get(e.id);r&&((n=(t=r.spec).onDestroy)==null||n.call(t,this.store.view,r.spec.element))}});for(let[,e]of this.placeholderWidgets)(i=(r=e.spec).onUpdate)==null||i.call(r,this.store.view,e.from,e.spec.element,e.spec.data);for(let t of s){if(t.type===`inline`){this.addInlinePlaceholder(t,e);continue}if(t.type===`node`){this.addNodePlaceholder(t,e);continue}if(t.type===`widget`){this.addWidgetPlaceholder(t,e);continue}}for(let{id:t,data:n}of u){let r=this.placeholderWidgets.get(t);if(!r)continue;let i=P.widget(r.from,r.spec.element,{...r.spec,data:n});this.placeholders=this.placeholders.remove([r]).add(e.doc,[i]),this.placeholderWidgets.set(t,i)}for(let e of l){let t=this.placeholders.find(void 0,void 0,t=>t.id===e&&t.__type===zf),n=this.placeholderWidgets.get(e);n&&((o=(a=n.spec).onDestroy)==null||o.call(a,this.store.view,n.spec.element)),this.placeholders=this.placeholders.remove(t),this.placeholderWidgets.delete(e)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(let n of this.store.extensions){if(!n.createDecorations)continue;let r=n.createDecorations(e).find();t=t.add(e.doc,r)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(Bf,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(Bf,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t?.(e),!0)}addPlaceholder(e,t,n){return({dispatch:r,tr:i})=>this.addPlaceholderTransaction(e,t,i,!r)?(r?.(n?i.deleteSelection():i),!0):!1}updatePlaceholder(e,t){return({dispatch:n,tr:r})=>this.updatePlaceholderTransaction({id:e,data:t,tr:r,checkOnly:!n})?(n?.(r),!0):!1}removePlaceholder(e){return({dispatch:t,tr:n})=>this.removePlaceholderTransaction({id:e,tr:n,checkOnly:!t})?(t?.(n),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t?.(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){let e=new Map,t=this.placeholders.find(void 0,void 0,e=>e.__type===zf);for(let n of t)e.set(n.spec.id,{from:n.from,to:n.to});return e}createDecorations(e){var t,n,r;let{persistentSelectionClass:i}=this.options;return!i||(t=this.store.view)?.hasFocus()||(r=(n=this.store.helpers).isInteracting)?.call(n)?F.empty:Vf(e,F.empty,{class:p(i)?i:`selection`})}onApplyState(){}addWidgetPlaceholder(e,t){let{pos:n,createElement:r,onDestroy:i,onUpdate:a,className:o,nodeName:s,id:c,type:l}=e,u=r?.(this.store.view,n)??document.createElement(s);u.classList.add(o);let d=P.widget(n,u,{id:c,__type:zf,type:l,element:u,onDestroy:i,onUpdate:a});this.placeholderWidgets.set(c,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){let{from:n=t.selection.from,to:r=t.selection.to,className:i,nodeName:a,id:o,type:s}=e,c;if(n===r){let e=document.createElement(a);e.classList.add(i),c=P.widget(n,e,{id:o,type:s,__type:zf,widget:e})}else c=P.inline(n,r,{nodeName:a,class:i},{id:o,__type:zf});this.placeholders=this.placeholders.add(t.doc,[c])}addNodePlaceholder(e,t){let{pos:n,className:r,nodeName:i,id:a}=e,o=Fe(n)?t.doc.resolve(n):t.selection.$from,s=Fe(n)?o.nodeAfter?{pos:n,end:o.nodeAfter.nodeSize}:void 0:jl(o);if(!s)return;let c=P.node(s.pos,s.end,{nodeName:i,class:r},{id:a,__type:zf});this.placeholders=this.placeholders.add(t.doc,[c])}withRequiredBase(e,t){let{placeholderNodeName:n,placeholderClassName:r}=this.options,{nodeName:i=n,className:a,...o}=t,s=(a?[r,a]:[r]).join(` `);return{nodeName:i,className:s,...o,id:e}}getMeta(e){let t=e.getMeta(this.pluginKey)??{};return{...Rf,...t}}setMeta(e,t){let n=this.getMeta(e);e.setMeta(this.pluginKey,{...n,...t})}addPlaceholderTransaction(e,t,n,r=!1){let i=this.findPlaceholder(e);if(i)return!1;if(r)return!0;let{added:a}=this.getMeta(n);return this.setMeta(n,{added:[...a,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){let{id:t,tr:n,checkOnly:r=!1,data:i}=e,a=this.findPlaceholder(t);if(!a)return!1;if(r)return!0;let{updated:o}=this.getMeta(n);return this.setMeta(n,{updated:y([...o,{id:t,data:i}])}),!0}removePlaceholderTransaction(e){let{id:t,tr:n,checkOnly:r=!1}=e,i=this.findPlaceholder(t);if(!i)return!1;if(r)return!0;let{removed:a}=this.getMeta(n);return this.setMeta(n,{removed:y([...a,t])}),!0}clearPlaceholdersTransaction(e){let{tr:t,checkOnly:n=!1}=e,r=this.getPluginState();return r===F.empty?!1:(n||this.setMeta(t,{clearTrackers:!0}),!0)}};I([H()],Lf.prototype,`updateDecorations`,1),I([H()],Lf.prototype,`addPlaceholder`,1),I([H()],Lf.prototype,`updatePlaceholder`,1),I([H()],Lf.prototype,`removePlaceholder`,1),I([H()],Lf.prototype,`clearPlaceholders`,1),I([V()],Lf.prototype,`findPlaceholder`,1),I([V()],Lf.prototype,`findAllPlaceholders`,1),Lf=I([B({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:`placeholder`,placeholderNodeName:`span`},staticKeys:[`placeholderClassName`,`placeholderNodeName`],handlerKeys:[`decorations`],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,n)=>e.add(n.doc,t.find()),getDefault:()=>F.empty}}},defaultPriority:x.Low})],Lf);var Rf={added:[],updated:[],clearTrackers:!1,removed:[]},zf=`placeholderDecoration`,Bf=`persistentSelectionFocus`;function Vf(e,t,n){let{selection:r,doc:i}=e;if(r.empty)return t;let{from:a,to:o}=r,s=nu(r)?P.node(a,o,n):P.inline(a,o,n);return t.add(i,[s])}var Hf=class extends z{get name(){return`docChanged`}onStateUpdate(e){let{firstUpdate:t,transactions:n,tr:r}=e;t||(n??[r]).some(e=>e?.docChanged)&&this.options.docChanged(e)}};Hf=I([B({handlerKeys:[`docChanged`],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:x.Lowest})],Hf);var Uf=class extends z{get name(){return`helpers`}onCreate(){var e;this.store.setStringHandler(`text`,this.textToProsemirrorNode.bind(this)),this.store.setStringHandler(`html`,Ou);let t=_(),n=_(),r=_(),i=new Set;for(let a of this.store.extensions){Ef(a)&&(n[a.name]=e=>Il({state:this.store.getState(),type:a.type,attrs:e}),r[a.name]=e=>{var t;return(t=Ll({state:this.store.getState(),type:a.type,attrs:e}))?.node.attrs}),Df(a)&&(n[a.name]=e=>ru({trState:this.store.getState(),type:a.type,attrs:e}),r[a.name]=e=>{let t=uu(this.store.getState().selection.$from,a.type);if(!t||!e)return t?.mark.attrs;if(Vl(t.mark,e))return t.mark.attrs});let o=(e=a.createHelpers)?.call(a)??{};for(let e of Object.keys(a.decoratedHelpers??{}))o[e]=a[e].bind(a);if(je(o))continue;for(let[e,n]of T(o))pf({name:e,set:i,code:b.DUPLICATE_HELPER_NAMES}),t[e]=n}this.store.setStoreKey(`attrs`,r),this.store.setStoreKey(`active`,n),this.store.setStoreKey(`helpers`,t),this.store.setExtensionStore(`attrs`,r),this.store.setExtensionStore(`active`,n),this.store.setExtensionStore(`helpers`,t)}isSelectionEmpty(e=this.store.getState()){return Pl(e)}isViewEditable(e=this.store.getState()){var t,n;return(n=(t=this.store.view.props).editable)?.call(t,e)??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return n=>{let{state:r}=n,i=Ou({content:e,schema:r.schema,fragment:!0});return this.store.commands.insertNode.original(i,t)(n)}}getText({lineBreakDivider:e=`
20
20
 
21
21
  `,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,pe)}getTextBetween(e,t,n=this.store.getState().doc){return n.textBetween(e,t,`
22
22
 
23
- `,pe)}getHTML(e=this.store.getState()){return Du(e.doc,this.store.document)}textToProsemirrorNode(e){let t=`<pre>${e.content}</pre>`;return this.store.stringHandlers.html({...e,content:t})}};I([V()],Uf.prototype,`isSelectionEmpty`,1),I([V()],Uf.prototype,`isViewEditable`,1),I([V()],Uf.prototype,`getStateJSON`,1),I([V()],Uf.prototype,`getJSON`,1),I([V()],Uf.prototype,`getRemirrorJSON`,1),I([H()],Uf.prototype,`insertHtml`,1),I([V()],Uf.prototype,`getText`,1),I([V()],Uf.prototype,`getTextBetween`,1),I([V()],Uf.prototype,`getHTML`,1),Uf=I([B({})],Uf);var Wf=class extends z{get name(){return`inputRules`}onCreate(){this.store.setExtensionStore(`rebuildInputRules`,this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;let n=[],r=this.store.markTags[S.ExcludeInputRules];for(let i of this.store.extensions){if((e=this.store.managerSettings.exclude)?.inputRules||!i.createInputRules||(t=i.options.exclude)?.inputRules)continue;for(let e of i.createInputRules())e.shouldSkip=this.options.shouldSkipInputRule,e.invalidMarks=r,n.push(e)}return hi({rules:n})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};Wf=I([B({defaultPriority:x.Default,handlerKeys:[`shouldSkipInputRule`],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],Wf);var Gf=class extends z{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,n;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(n=(t=this.store).rebuildKeymap)==null||n.call(t),()=>{var t,n;this.extraKeyBindings=this.extraKeyBindings.filter(t=>t!==e),(n=(t=this.store).rebuildKeymap)==null||n.call(t)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return`keymap`}get shortcutMap(){let{shortcuts:e}=this.options;return p(e)?Qf[e]:e}onCreate(){this.store.setExtensionStore(`rebuildKeymap`,this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)?.keymap?[]:(this.setupKeydownHandler(),[new kr({props:{handleKeyDown:(e,t)=>{var n;return(n=this.keydownHandler)?.call(this,e,t)}}})])}setupKeydownHandler(){let e=this.generateKeymapBindings();this.keydownHandler=Ud(e)}generateKeymapBindings(){var e;let t=[],n=this.shortcutMap,r=this.store.getExtension(U),i=e=>t=>qf({shortcut:t,map:n,store:this.store,options:e.options});for(let a of this.store.extensions){let o=a.decoratedKeybindings??{};if((e=a.options.exclude)?.keymap)continue;a.createKeymap&&t.push(Yf(a.createKeymap(i(a)),n));for(let[e,i]of T(o)){if(i.isActive&&!i.isActive(a.options,this.store))continue;let o=a[e].bind(a),s=qf({shortcut:i.shortcut,map:n,options:a.options,store:this.store}),c=D(i.priority)?i.priority(a.options,this.store):i.priority??x.Low,l=_();for(let e of s)l[e]=o;t.push([c,l]),i.command&&r.updateDecorated(i.command,{shortcut:s})}}let a=this.sortKeymaps([...this.extraKeyBindings,...t]),o=Bl(a);return o}arrowRightShortcut(e){let t=this.store.markTags[S.PreventExits],n=this.store.nodeTags[S.PreventExits];return this.exitMarkForwards(t,n)(e)}arrowLeftShortcut(e){let t=this.store.markTags[S.PreventExits],n=this.store.nodeTags[S.PreventExits];return Rl(this.exitNodeBackwards(n),this.exitMarkBackwards(t,n))(e)}backspace(e){let t=this.store.markTags[S.PreventExits],n=this.store.nodeTags[S.PreventExits];return Rl(this.exitNodeBackwards(n,!0),this.exitMarkBackwards(t,n,!0))(e)}createKeymap(){let{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:n}=this.options,r=_();if(!n)for(let[e,t]of T(jd))r[e]=Cl(t);return t&&jd.Backspace&&(r.Backspace=Cl(Td(_i,jd.Backspace))),e&&(r.Escape=Cl(hd)),[x.Low,r]}getNamedShortcut(e,t={}){return e.startsWith(`_|`)?qf({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,n;let{changes:r}=e;(r.excludeBaseKeymap.changed||r.selectParentNodeOnEscape.changed||r.undoInputRuleOnBackspace.changed)&&((n=(t=this.store).rebuildKeymap)==null||n.call(t))}sortKeymaps(e){return v(e.map(e=>Oe(e)?e:[x.Default,e]),(e,t)=>t[0]-e[0]).map(e=>e[1])}exitMarkForwards(e,t){return n=>{let{tr:r,dispatch:i}=n;if(!Nu(r.selection))return!1;let a=Ml({selection:r.selection,types:t});if(a)return!1;let o=r.selection.$from,s=o.marks().filter(t=>!e.includes(t.type.name));if(Ae(s))return!1;if(!i)return!0;for(let e of s)r.removeStoredMark(e);return i(r.insertText(` `,r.selection.from)),!0}}exitNodeBackwards(e,t=!1){return n=>{let{tr:r}=n,i=t?Fu:Pu;if(!i(r.selection))return!1;let a=r.selection.$anchor.node();return!lu(a)||cu(a)||e.includes(a.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:a.type})(n)}}exitMarkBackwards(e,t,n=!1){return r=>{let{tr:i,dispatch:a}=r,o=n?Fu:Pu;if(!o(i.selection)||this.backwardMarkExitTracker.has(i.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;let s=Ml({selection:i.selection,types:t});if(s)return!1;let c=[...i.storedMarks??[],...i.selection.$from.marks()].filter(t=>!e.includes(t.type.name));if(Ae(c))return!1;if(!a)return!0;for(let e of c)i.removeStoredMark(e);return this.backwardMarkExitTracker.set(i.selection.anchor,!0),a(i),!0}}};I([kf({shortcut:`ArrowRight`,isActive:e=>e.exitMarksOnArrowPress})],Gf.prototype,`arrowRightShortcut`,1),I([kf({shortcut:`ArrowLeft`,isActive:e=>e.exitMarksOnArrowPress})],Gf.prototype,`arrowLeftShortcut`,1),I([kf({shortcut:`Backspace`,isActive:e=>e.exitMarksOnArrowPress})],Gf.prototype,`backspace`,1),I([V()],Gf.prototype,`getNamedShortcut`,1),Gf=I([B({defaultPriority:x.Low,defaultOptions:{shortcuts:`default`,undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:[`keymap`]})],Gf);function Kf(e){return De(oe(C),e)}function qf({shortcut:e,map:t,options:n,store:r}){return p(e)?[Jf(e,t)]:Oe(e)?e.map(e=>Jf(e,t)):(e=e(n,r),qf({shortcut:e,map:t,options:n,store:r}))}function Jf(e,t){return Kf(e)?t[e]:e}function Yf(e,t){let n={},r,i;Oe(e)?[i,r]=e:r=e;for(let[e,i]of T(r))n[Jf(e,t)]=i;return m(i)?n:[i,n]}var Xf={[C.Copy]:`Mod-c`,[C.Cut]:`Mod-x`,[C.Paste]:`Mod-v`,[C.PastePlain]:`Mod-Shift-v`,[C.SelectAll]:`Mod-a`,[C.Undo]:`Mod-z`,[C.Redo]:Tl.isMac?`Shift-Mod-z`:`Mod-y`,[C.Bold]:`Mod-b`,[C.Italic]:`Mod-i`,[C.Underline]:`Mod-u`,[C.Strike]:`Mod-d`,[C.Code]:"Mod-`",[C.Paragraph]:`Mod-Shift-0`,[C.H1]:`Mod-Shift-1`,[C.H2]:`Mod-Shift-2`,[C.H3]:`Mod-Shift-3`,[C.H4]:`Mod-Shift-4`,[C.H5]:`Mod-Shift-5`,[C.H6]:`Mod-Shift-6`,[C.TaskList]:`Mod-Shift-7`,[C.BulletList]:`Mod-Shift-8`,[C.OrderedList]:`Mod-Shift-9`,[C.Quote]:`Mod->`,[C.Divider]:`Mod-Shift-|`,[C.Codeblock]:`Mod-Shift-~`,[C.ClearFormatting]:`Mod-Shift-C`,[C.Superscript]:`Mod-.`,[C.Subscript]:`Mod-,`,[C.LeftAlignment]:`Mod-Shift-L`,[C.CenterAlignment]:`Mod-Shift-E`,[C.RightAlignment]:`Mod-Shift-R`,[C.JustifyAlignment]:`Mod-Shift-J`,[C.InsertLink]:`Mod-k`,[C.Find]:`Mod-f`,[C.FindBackwards]:`Mod-Shift-f`,[C.FindReplace]:`Mod-Shift-H`,[C.AddFootnote]:`Mod-Alt-f`,[C.AddComment]:`Mod-Alt-m`,[C.ContextMenu]:`Mod-Shift-\\`,[C.IncreaseFontSize]:`Mod-Shift-.`,[C.DecreaseFontSize]:`Mod-Shift-,`,[C.IncreaseIndent]:`Tab`,[C.DecreaseIndent]:`Shift-Tab`,[C.Shortcuts]:`Mod-/`,[C.Format]:Tl.isMac?`Alt-Shift-f`:`Shift-Ctrl-f`},Zf={...Xf,[C.Strike]:`Mod-Shift-S`,[C.Code]:`Mod-Shift-M`,[C.Paragraph]:`Mod-Alt-0`,[C.H1]:`Mod-Alt-1`,[C.H2]:`Mod-Alt-2`,[C.H3]:`Mod-Alt-3`,[C.H4]:`Mod-Alt-4`,[C.H5]:`Mod-Alt-5`,[C.H6]:`Mod-Alt-6`,[C.OrderedList]:`Mod-Alt-7`,[C.BulletList]:`Mod-Alt-8`,[C.Quote]:`Mod-Alt-9`,[C.ClearFormatting]:`Mod-\\`,[C.IncreaseIndent]:`Mod-[`,[C.DecreaseIndent]:`Mod-]`},Qf={default:Xf,googleDoc:Zf},$f=class extends z{get name(){return`nodeViews`}createPlugin(){let e=[],t=_();for(let t of this.store.extensions){if(!t.createNodeViews)continue;let n=t.createNodeViews();e.unshift(D(n)?{[t.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(let n of e)Object.assign(t,n);return{props:{nodeViews:t}}}},ep=class extends z{get name(){return`pasteRules`}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;let n=[];for(let r of this.store.extensions){if((e=this.store.managerSettings.exclude)?.pasteRules||!r.createPasteRules||(t=r.options.exclude)?.pasteRules)continue;let i=r.createPasteRules(),a=Oe(i)?i:[i];n.push(...a)}return Wd(n)}},tp=class extends z{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=_(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{let t=this.stateGetters.get(e);return E(t,{message:`No plugin exists for the requested extension name.`}),t()}}get name(){return`plugins`}onCreate(){let{setStoreKey:e,setExtensionStore:t,managerSettings:n,extensions:r}=this.store;this.updateExtensionStore();let{plugins:i=[]}=n;this.updatePlugins(i,this.managerPlugins);for(let e of r)e.onApplyState&&this.applyStateHandlers.push(e.onApplyState.bind(e)),e.onInitState&&this.initStateHandlers.push(e.onInitState.bind(e)),e.onAppendTransaction&&this.appendTransactionHandlers.push(e.onAppendTransaction.bind(e)),this.extractExtensionPlugins(e);this.managerPlugins=i,this.store.setStoreKey(`plugins`,this.plugins),e(`pluginKeys`,this.pluginKeys),e(`getPluginState`,this.getStateByName),t(`getPluginState`,this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,n)=>{let r=n.tr,i={previousState:t,tr:r,transactions:e,state:n};for(let e of this.appendTransactionHandlers)e(i);return this.options.appendTransaction(i),r.docChanged||r.steps.length>0||r.selectionSet||r.storedMarksSet?r:void 0},state:{init:(e,t)=>{for(let e of this.initStateHandlers)e(t)},apply:(e,t,n,r)=>{let i={previousState:n,state:r,tr:e};for(let e of this.applyStateHandlers)e(i);this.options.applyState(i)}}}}extractExtensionPlugins(e){var t,n;let r=!e.createPlugin&&!e.createExternalPlugins;if(!(r||(t=this.store.managerSettings.exclude)?.plugins||(n=e.options.exclude)?.plugins)){if(e.createPlugin){let t=new Mr(e.name);this.pluginKeys[e.name]=t;let n=this.getPluginStateCreator(t);e.pluginKey=t,e.getPluginState=n,this.stateGetters.set(e.name,n),this.stateGetters.set(e.constructor,n);let r={...e.createPlugin(),key:t},i=new kr(r);this.updatePlugins([i],e.plugin?[e.plugin]:void 0),e.plugin=i}if(e.createExternalPlugins){let t=e.createExternalPlugins();this.updatePlugins(t,e.externalPlugins),e.externalPlugins=t}}}updatePlugins(e,t){if(!t||Ae(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(e=>!t.includes(e)),...e];return}let n=new Map;for(let[r,i]of e.entries())n.set(w(t,r),i);this.plugins=this.plugins.map(e=>t.includes(e)?n.get(e):e)}updateExtensionStore(){let{setExtensionStore:e}=this.store;e(`updatePlugins`,this.updatePlugins.bind(this)),e(`dispatchPluginUpdate`,this.dispatchPluginUpdate.bind(this)),e(`updateExtensionPlugins`,this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){let t=Cf(e)?e:wf(e)?this.store.manager.getExtension(e):this.store.extensions.find(t=>t.name===e);E(t,{code:b.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey(`plugins`,this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){E(this.store.phase>=fe.EditorView,{code:b.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});let{view:e,updateState:t}=this.store,n=e.state.reconfigure({plugins:this.plugins});t(n)}};tp=I([B({defaultPriority:x.Highest,handlerKeys:[`applyState`,`appendTransaction`]})],tp);var np=class extends z{constructor(){super(...arguments),this.dynamicAttributes={marks:_(),nodes:_()}}get name(){return`schema`}onCreate(){let{managerSettings:e,tags:t,markNames:n,nodeNames:r,extensions:i}=this.store,{defaultBlockNode:a,disableExtraAttributes:o,nodeOverride:s,markOverride:c}=e,l=e=>!!(e&&t[S.Block].includes(e));if(e.schema){let{nodes:t,marks:n}=fp(e.schema);this.addSchema(e.schema,t,n);return}let u=l(a)?{doc:_(),[a]:_()}:_(),d=_(),f=rp({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(i),nodeNames:r,markNames:n,tags:t});for(let e of i){f[e.name]={...f[e.name],...e.options.extraAttributes};let t=o===!0||e.options.disableExtraAttributes===!0||e.constructor.disableExtraAttributes===!0;if(Ef(e)){let{spec:n,dynamic:r}=op({createExtensionSpec:(t,n)=>e.createNodeSpec(t,n),extraAttributes:w(f,e.name),override:{...s,...e.options.nodeOverride},ignoreExtraAttributes:t,name:e.constructorName,tags:e.tags});e.spec=n,u[e.name]=n,Object.keys(r).length>0&&(this.dynamicAttributes.nodes[e.name]=r)}if(Df(e)){let{spec:n,dynamic:r}=op({createExtensionSpec:(t,n)=>e.createMarkSpec(t,n),extraAttributes:w(f,e.name),override:{...c,...e.options.markOverride},ignoreExtraAttributes:t,name:e.constructorName,tags:e.tags??[]});e.spec=n,d[e.name]=n,Object.keys(r).length>0&&(this.dynamicAttributes.marks[e.name]=r)}}let p=new Ft({nodes:u,marks:d,topNode:`doc`});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,n)=>{let{tr:r}=n,i=e.some(e=>e.docChanged);return!i||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(r.doc.descendants((e,t)=>(this.checkAndUpdateDynamicNodes(e,t,r),this.checkAndUpdateDynamicMarks(e,t,r),!0)),r.steps.length>0?r:null)}}}addSchema(e,t,n){this.store.setStoreKey(`nodes`,t),this.store.setStoreKey(`marks`,n),this.store.setStoreKey(`schema`,e),this.store.setExtensionStore(`schema`,e),this.store.setStoreKey(`defaultBlockNode`,su(e).name);for(let t of Object.values(e.nodes)){if(t.name===`doc`)continue;if(t.isBlock||t.isTextblock)break}}checkAndUpdateDynamicNodes(e,t,n){for(let[r,i]of T(this.dynamicAttributes.nodes)){if(e.type.name!==r)continue;for(let[r,a]of T(i)){if(!Pe(e.attrs[r]))continue;let i={...e.attrs,[r]:a(e)};n.setNodeMarkup(t,void 0,i),yl(n)}}}checkAndUpdateDynamicMarks(e,t,n){for(let[r,i]of T(this.dynamicAttributes.marks)){let a=w(this.store.schema.marks,r),o=e.marks.find(e=>e.type.name===r);if(!o)continue;for(let[e,r]of T(i)){if(!Pe(o.attrs[e]))continue;let i=uu(n.doc.resolve(t),a);if(!i)continue;let{from:s,to:c}=i,l=a.create({...o.attrs,[e]:r(o)});n.removeMark(s,c,a).addMark(s,c,l),yl(n)}}}gatherExtraAttributes(e){let t=[];for(let n of e){if(!n.createSchemaAttributes)continue;t.push(...n.createSchemaAttributes())}return t}};np=I([B({defaultPriority:x.Highest})],np);function rp(e){let{settings:t,gatheredSchemaAttributes:n,nodeNames:r,markNames:i,tags:a}=e,o=_();if(t.disableExtraAttributes)return o;let s=[...n,...t.extraAttributes??[]];for(let e of s??[]){let t=ap({identifiers:e.identifiers,nodeNames:r,markNames:i,tags:a});for(let n of t){let t=o[n]??{};o[n]={...t,...e.attributes}}}return o}function ip(e){return Le(e)&&Oe(e.tags)}function ap(e){let{identifiers:t,nodeNames:n,markNames:r,tags:i}=e;if(t===`nodes`)return n;if(t===`marks`)return r;if(t===`all`)return[...n,...r];if(Oe(t))return t;E(ip(t),{code:b.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});let{tags:a=[],names:o=[],behavior:s=`any`,excludeNames:c,excludeTags:l,type:u}=t,d=new Set,f=u===`mark`?r:u===`node`?n:[...r,...n],p=e=>f.includes(e)&&!c?.includes(e);for(let e of o)p(e)&&d.add(e);let m=new Map;for(let e of a){if(l?.includes(e))continue;for(let t of i[e]){if(!p(t))continue;if(s===`any`){d.add(t);continue}let n=m.get(t)??new Set;n.add(e),m.set(t,n)}}for(let[e,t]of m)t.size===a.length&&d.add(e);return[...d]}function op(e){var t;let{createExtensionSpec:n,extraAttributes:r,ignoreExtraAttributes:i,name:a,tags:o,override:s}=e,c=_();function l(e,t){c[e]=t}let u=!1;function d(){u=!0}let f=cp(r,i,d,l),p=lp(r,i),m=up(r,i),h=n({defaults:f,parse:p,dom:m},s);return E(i||u,{code:b.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${a}' to 'true'.`}),h.group=[...(t=h.group)?.split(` `)??[],...o].join(` `)||void 0,{spec:h,dynamic:c}}function sp(e){return p(e)||D(e)?{default:e}:(E(e,{message:`${ne(e)} is not supported`,code:b.EXTENSION_EXTRA_ATTRIBUTES}),e)}function cp(e,t,n,r){return()=>{n();let i=_();if(t)return i;for(let[t,n]of T(e)){let e=sp(n),a=e.default;D(a)&&(r(t,a),a=null),i[t]=a===void 0?{}:{default:a}}return i}}function lp(e,t){return n=>{let r=_();if(t)return r;for(let[t,i]of T(e)){let{parseDOM:e,...a}=sp(i);if(!Ol(n))continue;if(Pe(e)){r[t]=n.getAttribute(t)??a.default;continue}if(D(e)){r[t]=e(n)??a.default;continue}r[t]=n.getAttribute(e)??a.default}return r}}function up(e,t){return n=>{let r=_();if(t)return r;function i(e,t){if(e){if(p(e)){r[t]=e;return}if(Oe(e)){let[i,a]=e;r[i]=a??n.attrs[t];return}for(let[t,n]of T(e))r[t]=n}}for(let[t,a]of T(e)){let{toDOM:e,parseDOM:o}=sp(a);if(Pe(e)){let e=p(o)?o:t;r[e]=n.attrs[t];continue}if(D(e)){i(e(n.attrs,dp(n)),t);continue}i(e,t)}return r}}function dp(e){return Jl(e)?{node:e}:Xl(e)?{mark:e}:{}}function fp(e){let t=_(),n=_();for(let[n,r]of Object.entries(e.nodes))t[n]=r.spec;for(let[t,r]of Object.entries(e.marks))n[t]=r.spec;return{nodes:t,marks:n}}var pp=class extends z{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)?.suggesters))return vl(this.store.getState(),e)}}get name(){return`suggest`}onCreate(){this.store.setExtensionStore(`addSuggester`,e=>vl(this.store.getState(),e)),this.store.setExtensionStore(`removeSuggester`,e=>bl(this.store.getState(),e))}createExternalPlugins(){var e,t;let n=[];for(let r of this.store.extensions){if((e=this.store.managerSettings.exclude)?.suggesters)break;if(!r.createSuggesters||(t=r.options.exclude)?.suggesters)continue;let i=r.createSuggesters(),a=Oe(i)?i:[i];n.push(...a)}return[xl(...n)]}getSuggestState(e){return _l(e??this.store.getState())}getSuggestMethods(){let{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:i,findMatchAtPosition:a,findNextTextSelection:o,setLastChangeFromAppend:s}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:i,findMatchAtPosition:a,findNextTextSelection:o,setLastChangeFromAppend:s}}isSuggesterActive(e){var t;return De(Oe(e)?e:[e],(t=this.getSuggestState().match)?.suggester.name)}};I([V()],pp.prototype,`getSuggestState`,1),I([V()],pp.prototype,`getSuggestMethods`,1),I([V()],pp.prototype,`isSuggesterActive`,1),pp=I([B({customHandlerKeys:[`suggester`]})],pp);var mp=class extends z{constructor(){super(...arguments),this.allTags=_(),this.plainTags=_(),this.markTags=_(),this.nodeTags=_()}get name(){return`tags`}onCreate(){this.resetTags();for(let e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey(`tags`,this.allTags),this.store.setExtensionStore(`tags`,this.allTags),this.store.setStoreKey(`plainTags`,this.plainTags),this.store.setExtensionStore(`plainTags`,this.plainTags),this.store.setStoreKey(`markTags`,this.markTags),this.store.setExtensionStore(`markTags`,this.markTags),this.store.setStoreKey(`nodeTags`,this.nodeTags),this.store.setExtensionStore(`nodeTags`,this.nodeTags)}resetTags(){let e=_(),t=_(),n=_(),r=_();for(let i of oe(S))e[i]=[],t[i]=[],n[i]=[],r[i]=[];this.allTags=e,this.plainTags=t,this.markTags=n,this.nodeTags=r}updateTagForExtension(e){var t,n;let r=new Set([...e.tags??[],...(t=e.createTags)?.call(e)??[],...e.options.extraTags??[],...(n=this.store.managerSettings.extraTags)?.[e.name]??[]]);for(let t of r)E(hp(t),{code:b.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[t].push(e.name),Tf(e)&&this.plainTags[t].push(e.name),Df(e)&&this.markTags[t].push(e.name),Ef(e)&&this.nodeTags[t].push(e.name);e.tags=[...r]}};mp=I([B({defaultPriority:x.Highest})],mp);function hp(e){return De(oe(S),e)}var gp=new Mr(`remirrorFilePlaceholderPlugin`);function _p(){let e=new kr({key:gp,state:{init(){return{set:F.empty,payloads:new Map}},apply(t,{set:n,payloads:r}){n=n.map(t.mapping,t.doc);let i=t.getMeta(e);if(i)if(i.type===0){let e=document.createElement(`placeholder`),a=P.widget(i.pos,e,{id:i.id});n=n.add(t.doc,[a]),r.set(i.id,i.payload)}else i.type===1&&(n=n.remove(n.find(void 0,void 0,e=>e.id===i.id)),r.delete(i.id));return{set:n,payloads:r}}},props:{decorations(t){var n;return(n=e.getState(t))?.set??null}}});return e}var vp=class extends z{get name(){return`upload`}createExternalPlugins(){return[_p()]}};function yp(e={}){let t={exitMarksOnArrowPress:Gf.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Gf.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Gf.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Gf.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:Lf.defaultOptions.persistentSelectionClass};e={...t,...e};let n=(0,Ee.default)(e,[`excludeBaseKeymap`,`selectParentNodeOnEscape`,`undoInputRuleOnBackspace`]),r=(0,Ee.default)(e,[`persistentSelectionClass`]);return[new mp,new np,new Of,new tp,new Wf,new ep,new $f,new pp,new U,new Uf,new Gf(n),new Hf,new vp,new Lf(r)]}var bp=class extends z{get name(){return`meta`}onCreate(){if(this.store.setStoreKey(`getCommandMeta`,this.getCommandMeta.bind(this)),this.options.capture)for(let e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){let t=e.decoratedCommands??{},n=e.createCommands;for(let n of Object.keys(t)){let t=e[n];e[n]=(...r)=>i=>{var a;let o=t(...r)(i);return i.dispatch&&o&&this.setCommandMeta(i.tr,{type:`command`,chain:i.dispatch!==(a=i.view)?.dispatch,name:n,extension:e.name,decorated:!0}),o}}n&&(e.createCommands=()=>{let t=n();for(let[n,r]of Object.entries(t))t[n]=(...t)=>i=>{var a;let o=r(...t)(i);return i.dispatch&&o&&this.setCommandMeta(i.tr,{type:`command`,chain:i.dispatch!==(a=i.view)?.dispatch,name:n,extension:e.name,decorated:!1}),o};return t})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){let n=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...n,t])}};bp=I([B({defaultOptions:{capture:Tl.isDevelopment},staticKeys:[`capture`],defaultPriority:x.Highest})],bp);var xp,Sp,Cp,wp,Tp,Ep,Dp,Op=class{constructor(e){R(this,xp,ie()),R(this,Sp,void 0),R(this,Cp,void 0),R(this,wp,!0),R(this,Tp,rf()),R(this,Ep,void 0),R(this,Dp,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=e=>{var t,n;E(!this.manager.destroyed,{code:b.MANAGER_PHASE_ERROR,message:`A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue.`}),e=(n=(t=this.props).onDispatchTransaction)?.call(t,e,this.getState())??e;let r=this.getState(),{state:i,transactions:a}=r.applyTransaction(e);lf(this,Cp,r),this.updateState({state:i,tr:e,transactions:a});let o=this.manager.store.getForcedUpdates(e);Ae(o)||this.updateViewProps(...o)},this.onChange=(e=_())=>{var t,n;let r=this.eventListenerProps(e);L(this,wp)&&lf(this,wp,!1),(n=(t=this.props).onChange)==null||n.call(t,r)},this.onBlur=e=>{var t,n;let r=this.eventListenerProps();(n=(t=this.props).onBlur)==null||n.call(t,r,e),L(this,Tp).emit(`blur`,r,e)},this.onFocus=e=>{var t,n;let r=this.eventListenerProps();(n=(t=this.props).onFocus)==null||n.call(t,r,e),L(this,Tp).emit(`focus`,r,e)},this.setContent=(e,{triggerChange:t=!1}={})=>{let{doc:n}=this.manager.createState({content:e}),r=this.getState(),{state:i}=this.getState().applyTransaction(r.tr.replaceRangeWith(0,r.doc.nodeSize-2,n));if(t)return this.updateState({state:i,triggerChange:t});this.view.updateState(i)},this.clearContent=({triggerChange:e=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:e})},this.createStateFromContent=(e,t)=>this.manager.createState({content:e,selection:t}),this.focus=e=>{this.manager.store.commands.focus(e)},this.blur=e=>{this.manager.store.commands.blur(e)};let{getProps:t,initialEditorState:n,element:r}=e;if(lf(this,Sp,t),lf(this,Dp,n),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;let i=this.createView(n,r);this.manager.addView(i)}get addHandler(){return L(this,Ep)??lf(this,Ep,L(this,Tp).on.bind(L(this,Tp)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return L(this,wp)}get props(){return L(this,Sp).call(this)}get previousState(){return this.previousStateOverride??L(this,Cp)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return L(this,xp)}get initialEditorState(){return L(this,Dp)}updateListener(e){let{state:t,tr:n}=e;return L(this,Tp).emit(`updated`,this.eventListenerProps({state:t,tr:n}))}update(e){let{getProps:t}=e;return lf(this,Sp,t),this}updateViewProps(...e){let t=(0,Ee.default)(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;let{attributes:n,autoFocus:r,classNames:i=[],label:a,editable:o}=this.props,s=(t=this.manager.store)?.attributes,c=D(n)?n(this.eventListenerProps()):n,l={};(r||Fe(r))&&(l=e?{autoFocus:!0}:{autofocus:`true`});let u=y(mf(e&&`Prosemirror`,`remirror-editor`,s?.class,...i).split(` `)).join(` `),d={role:`textbox`,...l,"aria-multiline":`true`,...o??!0?{}:{"aria-readonly":`true`},"aria-label":a??``,...s,class:u};return ee({...d,...c})}addFocusListeners(){this.view.dom.addEventListener(`blur`,this.onBlur),this.view.dom.addEventListener(`focus`,this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener(`blur`,this.onBlur),this.view.dom.removeEventListener(`focus`,this.onFocus)}destroy(){L(this,Tp).emit(`destroy`),this.view&&this.removeFocusListeners()}eventListenerProps(e=_()){let{state:t,tr:n,transactions:r}=e;return{tr:n,transactions:r,internalUpdate:!n,view:this.view,firstRender:L(this,wp),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:L(this,xp),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};xp=new WeakMap,Sp=new WeakMap,Cp=new WeakMap,wp=new WeakMap,Tp=new WeakMap,Ep=new WeakMap,Dp=new WeakMap;function kp(e,t){let n=[],r=new WeakMap,i=[],a=new WeakMap,o=[],s={duplicateMap:a,parentExtensions:i,gatheredExtensions:o,settings:t};for(let t of e)Ap(s,{extension:t});o=v(o,(e,t)=>t.priority-e.priority);let c=new WeakSet,l=new Set;for(let e of o){let t=e.constructor,i=e.name,o=a.get(t);if(E(o,{message:`No entries were found for the ExtensionConstructor ${e.name}`,code:b.INTERNAL}),c.has(t)||l.has(i))continue;c.add(t),l.add(i),n.push(e),r.set(t,e),o.forEach(n=>n?.replaceChildExtension(t,e))}let u=[];for(let e of n)jp({extension:e,found:c,missing:u});return E(Ae(u),{code:b.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:e,extension:t})=>`The extension '${t.name}' requires '${e.name} in order to run correctly.`).join(`
23
+ `,pe)}getHTML(e=this.store.getState()){return Du(e.doc,this.store.document)}textToProsemirrorNode(e){let t=`<pre>${e.content}</pre>`;return this.store.stringHandlers.html({...e,content:t})}};I([V()],Uf.prototype,`isSelectionEmpty`,1),I([V()],Uf.prototype,`isViewEditable`,1),I([V()],Uf.prototype,`getStateJSON`,1),I([V()],Uf.prototype,`getJSON`,1),I([V()],Uf.prototype,`getRemirrorJSON`,1),I([H()],Uf.prototype,`insertHtml`,1),I([V()],Uf.prototype,`getText`,1),I([V()],Uf.prototype,`getTextBetween`,1),I([V()],Uf.prototype,`getHTML`,1),Uf=I([B({})],Uf);var Wf=class extends z{get name(){return`inputRules`}onCreate(){this.store.setExtensionStore(`rebuildInputRules`,this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;let n=[],r=this.store.markTags[S.ExcludeInputRules];for(let i of this.store.extensions){if((e=this.store.managerSettings.exclude)?.inputRules||!i.createInputRules||(t=i.options.exclude)?.inputRules)continue;for(let e of i.createInputRules())e.shouldSkip=this.options.shouldSkipInputRule,e.invalidMarks=r,n.push(e)}return hi({rules:n})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};Wf=I([B({defaultPriority:x.Default,handlerKeys:[`shouldSkipInputRule`],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],Wf);var Gf=class extends z{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,n;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(n=(t=this.store).rebuildKeymap)==null||n.call(t),()=>{var t,n;this.extraKeyBindings=this.extraKeyBindings.filter(t=>t!==e),(n=(t=this.store).rebuildKeymap)==null||n.call(t)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return`keymap`}get shortcutMap(){let{shortcuts:e}=this.options;return p(e)?Qf[e]:e}onCreate(){this.store.setExtensionStore(`rebuildKeymap`,this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)?.keymap?[]:(this.setupKeydownHandler(),[new kr({props:{handleKeyDown:(e,t)=>{var n;return(n=this.keydownHandler)?.call(this,e,t)}}})])}setupKeydownHandler(){let e=this.generateKeymapBindings();this.keydownHandler=Ud(e)}generateKeymapBindings(){var e;let t=[],n=this.shortcutMap,r=this.store.getExtension(U),i=e=>t=>qf({shortcut:t,map:n,store:this.store,options:e.options});for(let a of this.store.extensions){let o=a.decoratedKeybindings??{};if((e=a.options.exclude)?.keymap)continue;a.createKeymap&&t.push(Yf(a.createKeymap(i(a)),n));for(let[e,i]of T(o)){if(i.isActive&&!i.isActive(a.options,this.store))continue;let o=a[e].bind(a),s=qf({shortcut:i.shortcut,map:n,options:a.options,store:this.store}),c=D(i.priority)?i.priority(a.options,this.store):i.priority??x.Low,l=_();for(let e of s)l[e]=o;t.push([c,l]),i.command&&r.updateDecorated(i.command,{shortcut:s})}}let a=this.sortKeymaps([...this.extraKeyBindings,...t]),o=Bl(a);return o}arrowRightShortcut(e){let t=this.store.markTags[S.PreventExits],n=this.store.nodeTags[S.PreventExits];return this.exitMarkForwards(t,n)(e)}arrowLeftShortcut(e){let t=this.store.markTags[S.PreventExits],n=this.store.nodeTags[S.PreventExits];return Rl(this.exitNodeBackwards(n),this.exitMarkBackwards(t,n))(e)}backspace(e){let t=this.store.markTags[S.PreventExits],n=this.store.nodeTags[S.PreventExits];return Rl(this.exitNodeBackwards(n,!0),this.exitMarkBackwards(t,n,!0))(e)}createKeymap(){let{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:n}=this.options,r=_();if(!n)for(let[e,t]of T(jd))r[e]=Cl(t);return t&&jd.Backspace&&(r.Backspace=Cl(Td(_i,jd.Backspace))),e&&(r.Escape=Cl(hd)),[x.Low,r]}getNamedShortcut(e,t={}){return e.startsWith(`_|`)?qf({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,n;let{changes:r}=e;(r.excludeBaseKeymap.changed||r.selectParentNodeOnEscape.changed||r.undoInputRuleOnBackspace.changed)&&((n=(t=this.store).rebuildKeymap)==null||n.call(t))}sortKeymaps(e){return v(e.map(e=>Oe(e)?e:[x.Default,e]),(e,t)=>t[0]-e[0]).map(e=>e[1])}exitMarkForwards(e,t){return n=>{let{tr:r,dispatch:i}=n;if(!Nu(r.selection))return!1;let a=Ml({selection:r.selection,types:t});if(a)return!1;let o=r.selection.$from,s=o.marks().filter(t=>!e.includes(t.type.name));if(Ae(s))return!1;if(!i)return!0;for(let e of s)r.removeStoredMark(e);return i(r.insertText(` `,r.selection.from)),!0}}exitNodeBackwards(e,t=!1){return n=>{let{tr:r}=n,i=t?Fu:Pu;if(!i(r.selection))return!1;let a=r.selection.$anchor.node();return!lu(a)||cu(a)||e.includes(a.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:a.type})(n)}}exitMarkBackwards(e,t,n=!1){return r=>{let{tr:i,dispatch:a}=r,o=n?Fu:Pu;if(!o(i.selection)||this.backwardMarkExitTracker.has(i.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;let s=Ml({selection:i.selection,types:t});if(s)return!1;let c=[...i.storedMarks??[],...i.selection.$from.marks()].filter(t=>!e.includes(t.type.name));if(Ae(c))return!1;if(!a)return!0;for(let e of c)i.removeStoredMark(e);return this.backwardMarkExitTracker.set(i.selection.anchor,!0),a(i),!0}}};I([kf({shortcut:`ArrowRight`,isActive:e=>e.exitMarksOnArrowPress})],Gf.prototype,`arrowRightShortcut`,1),I([kf({shortcut:`ArrowLeft`,isActive:e=>e.exitMarksOnArrowPress})],Gf.prototype,`arrowLeftShortcut`,1),I([kf({shortcut:`Backspace`,isActive:e=>e.exitMarksOnArrowPress})],Gf.prototype,`backspace`,1),I([V()],Gf.prototype,`getNamedShortcut`,1),Gf=I([B({defaultPriority:x.Low,defaultOptions:{shortcuts:`default`,undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:[`keymap`]})],Gf);function Kf(e){return De(oe(C),e)}function qf({shortcut:e,map:t,options:n,store:r}){return p(e)?[Jf(e,t)]:Oe(e)?e.map(e=>Jf(e,t)):(e=e(n,r),qf({shortcut:e,map:t,options:n,store:r}))}function Jf(e,t){return Kf(e)?t[e]:e}function Yf(e,t){let n={},r,i;Oe(e)?[i,r]=e:r=e;for(let[e,i]of T(r))n[Jf(e,t)]=i;return m(i)?n:[i,n]}var Xf={[C.Copy]:`Mod-c`,[C.Cut]:`Mod-x`,[C.Paste]:`Mod-v`,[C.PastePlain]:`Mod-Shift-v`,[C.SelectAll]:`Mod-a`,[C.Undo]:`Mod-z`,[C.Redo]:Tl.isMac?`Shift-Mod-z`:`Mod-y`,[C.Bold]:`Mod-b`,[C.Italic]:`Mod-i`,[C.Underline]:`Mod-u`,[C.Strike]:`Mod-d`,[C.Code]:"Mod-`",[C.Paragraph]:`Mod-Shift-0`,[C.H1]:`Mod-Shift-1`,[C.H2]:`Mod-Shift-2`,[C.H3]:`Mod-Shift-3`,[C.H4]:`Mod-Shift-4`,[C.H5]:`Mod-Shift-5`,[C.H6]:`Mod-Shift-6`,[C.TaskList]:`Mod-Shift-7`,[C.BulletList]:`Mod-Shift-8`,[C.OrderedList]:`Mod-Shift-9`,[C.Quote]:`Mod->`,[C.Divider]:`Mod-Shift-|`,[C.Codeblock]:`Mod-Shift-~`,[C.ClearFormatting]:`Mod-Shift-C`,[C.Superscript]:`Mod-.`,[C.Subscript]:`Mod-,`,[C.LeftAlignment]:`Mod-Shift-L`,[C.CenterAlignment]:`Mod-Shift-E`,[C.RightAlignment]:`Mod-Shift-R`,[C.JustifyAlignment]:`Mod-Shift-J`,[C.InsertLink]:`Mod-k`,[C.Find]:`Mod-f`,[C.FindBackwards]:`Mod-Shift-f`,[C.FindReplace]:`Mod-Shift-H`,[C.AddFootnote]:`Mod-Alt-f`,[C.AddComment]:`Mod-Alt-m`,[C.ContextMenu]:`Mod-Shift-\\`,[C.IncreaseFontSize]:`Mod-Shift-.`,[C.DecreaseFontSize]:`Mod-Shift-,`,[C.IncreaseIndent]:`Tab`,[C.DecreaseIndent]:`Shift-Tab`,[C.Shortcuts]:`Mod-/`,[C.Format]:Tl.isMac?`Alt-Shift-f`:`Shift-Ctrl-f`},Zf={...Xf,[C.Strike]:`Mod-Shift-S`,[C.Code]:`Mod-Shift-M`,[C.Paragraph]:`Mod-Alt-0`,[C.H1]:`Mod-Alt-1`,[C.H2]:`Mod-Alt-2`,[C.H3]:`Mod-Alt-3`,[C.H4]:`Mod-Alt-4`,[C.H5]:`Mod-Alt-5`,[C.H6]:`Mod-Alt-6`,[C.OrderedList]:`Mod-Alt-7`,[C.BulletList]:`Mod-Alt-8`,[C.Quote]:`Mod-Alt-9`,[C.ClearFormatting]:`Mod-\\`,[C.IncreaseIndent]:`Mod-[`,[C.DecreaseIndent]:`Mod-]`},Qf={default:Xf,googleDoc:Zf},$f=class extends z{get name(){return`nodeViews`}createPlugin(){let e=[],t=_();for(let t of this.store.extensions){if(!t.createNodeViews)continue;let n=t.createNodeViews();e.unshift(D(n)?{[t.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(let n of e)Object.assign(t,n);return{props:{nodeViews:t}}}},ep=class extends z{get name(){return`pasteRules`}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;let n=[];for(let r of this.store.extensions){if((e=this.store.managerSettings.exclude)?.pasteRules||!r.createPasteRules||(t=r.options.exclude)?.pasteRules)continue;let i=r.createPasteRules(),a=Oe(i)?i:[i];n.push(...a)}return Wd(n)}},tp=class extends z{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=_(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{let t=this.stateGetters.get(e);return E(t,{message:`No plugin exists for the requested extension name.`}),t()}}get name(){return`plugins`}onCreate(){let{setStoreKey:e,setExtensionStore:t,managerSettings:n,extensions:r}=this.store;this.updateExtensionStore();let{plugins:i=[]}=n;this.updatePlugins(i,this.managerPlugins);for(let e of r)e.onApplyState&&this.applyStateHandlers.push(e.onApplyState.bind(e)),e.onInitState&&this.initStateHandlers.push(e.onInitState.bind(e)),e.onAppendTransaction&&this.appendTransactionHandlers.push(e.onAppendTransaction.bind(e)),this.extractExtensionPlugins(e);this.managerPlugins=i,this.store.setStoreKey(`plugins`,this.plugins),e(`pluginKeys`,this.pluginKeys),e(`getPluginState`,this.getStateByName),t(`getPluginState`,this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,n)=>{let r=n.tr,i={previousState:t,tr:r,transactions:e,state:n};for(let e of this.appendTransactionHandlers)e(i);return this.options.appendTransaction(i),r.docChanged||r.steps.length>0||r.selectionSet||r.storedMarksSet?r:void 0},state:{init:(e,t)=>{for(let e of this.initStateHandlers)e(t)},apply:(e,t,n,r)=>{let i={previousState:n,state:r,tr:e};for(let e of this.applyStateHandlers)e(i);this.options.applyState(i)}}}}extractExtensionPlugins(e){var t,n;let r=!e.createPlugin&&!e.createExternalPlugins;if(!(r||(t=this.store.managerSettings.exclude)?.plugins||(n=e.options.exclude)?.plugins)){if(e.createPlugin){let t=new Mr(e.name);this.pluginKeys[e.name]=t;let n=this.getPluginStateCreator(t);e.pluginKey=t,e.getPluginState=n,this.stateGetters.set(e.name,n),this.stateGetters.set(e.constructor,n);let r={...e.createPlugin(),key:t},i=new kr(r);this.updatePlugins([i],e.plugin?[e.plugin]:void 0),e.plugin=i}if(e.createExternalPlugins){let t=e.createExternalPlugins();this.updatePlugins(t,e.externalPlugins),e.externalPlugins=t}}}updatePlugins(e,t){if(!t||Ae(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(e=>!t.includes(e)),...e];return}let n=new Map;for(let[r,i]of e.entries())n.set(w(t,r),i);this.plugins=this.plugins.map(e=>t.includes(e)?n.get(e):e)}updateExtensionStore(){let{setExtensionStore:e}=this.store;e(`updatePlugins`,this.updatePlugins.bind(this)),e(`dispatchPluginUpdate`,this.dispatchPluginUpdate.bind(this)),e(`updateExtensionPlugins`,this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){let t=Cf(e)?e:wf(e)?this.store.manager.getExtension(e):this.store.extensions.find(t=>t.name===e);E(t,{code:b.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey(`plugins`,this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){E(this.store.phase>=fe.EditorView,{code:b.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});let{view:e,updateState:t}=this.store,n=e.state.reconfigure({plugins:this.plugins});t(n)}};tp=I([B({defaultPriority:x.Highest,handlerKeys:[`applyState`,`appendTransaction`]})],tp);var np=class extends z{constructor(){super(...arguments),this.dynamicAttributes={marks:_(),nodes:_()}}get name(){return`schema`}onCreate(){let{managerSettings:e,tags:t,markNames:n,nodeNames:r,extensions:i}=this.store,{defaultBlockNode:a,disableExtraAttributes:o,nodeOverride:s,markOverride:c}=e,l=e=>!!(e&&t[S.Block].includes(e));if(e.schema){let{nodes:t,marks:n}=fp(e.schema);this.addSchema(e.schema,t,n);return}let u=l(a)?{doc:_(),[a]:_()}:_(),d=_(),f=rp({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(i),nodeNames:r,markNames:n,tags:t});for(let e of i){f[e.name]={...f[e.name],...e.options.extraAttributes};let t=o===!0||e.options.disableExtraAttributes===!0||e.constructor.disableExtraAttributes===!0;if(Ef(e)){let{spec:n,dynamic:r}=op({createExtensionSpec:(t,n)=>e.createNodeSpec(t,n),extraAttributes:w(f,e.name),override:{...s,...e.options.nodeOverride},ignoreExtraAttributes:t,name:e.constructorName,tags:e.tags});e.spec=n,u[e.name]=n,Object.keys(r).length>0&&(this.dynamicAttributes.nodes[e.name]=r)}if(Df(e)){let{spec:n,dynamic:r}=op({createExtensionSpec:(t,n)=>e.createMarkSpec(t,n),extraAttributes:w(f,e.name),override:{...c,...e.options.markOverride},ignoreExtraAttributes:t,name:e.constructorName,tags:e.tags??[]});e.spec=n,d[e.name]=n,Object.keys(r).length>0&&(this.dynamicAttributes.marks[e.name]=r)}}let p=new Ft({nodes:u,marks:d,topNode:`doc`});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,n)=>{let{tr:r}=n,i=e.some(e=>e.docChanged);return!i||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(r.doc.descendants((e,t)=>(this.checkAndUpdateDynamicNodes(e,t,r),this.checkAndUpdateDynamicMarks(e,t,r),!0)),r.steps.length>0?r:null)}}}addSchema(e,t,n){this.store.setStoreKey(`nodes`,t),this.store.setStoreKey(`marks`,n),this.store.setStoreKey(`schema`,e),this.store.setExtensionStore(`schema`,e),this.store.setStoreKey(`defaultBlockNode`,su(e).name);for(let t of Object.values(e.nodes)){if(t.name===`doc`)continue;if(t.isBlock||t.isTextblock)break}}checkAndUpdateDynamicNodes(e,t,n){for(let[r,i]of T(this.dynamicAttributes.nodes)){if(e.type.name!==r)continue;for(let[r,a]of T(i)){if(!Pe(e.attrs[r]))continue;let i={...e.attrs,[r]:a(e)};n.setNodeMarkup(t,void 0,i),yl(n)}}}checkAndUpdateDynamicMarks(e,t,n){for(let[r,i]of T(this.dynamicAttributes.marks)){let a=w(this.store.schema.marks,r),o=e.marks.find(e=>e.type.name===r);if(!o)continue;for(let[e,r]of T(i)){if(!Pe(o.attrs[e]))continue;let i=uu(n.doc.resolve(t),a);if(!i)continue;let{from:s,to:c}=i,l=a.create({...o.attrs,[e]:r(o)});n.removeMark(s,c,a).addMark(s,c,l),yl(n)}}}gatherExtraAttributes(e){let t=[];for(let n of e){if(!n.createSchemaAttributes)continue;t.push(...n.createSchemaAttributes())}return t}};np=I([B({defaultPriority:x.Highest})],np);function rp(e){let{settings:t,gatheredSchemaAttributes:n,nodeNames:r,markNames:i,tags:a}=e,o=_();if(t.disableExtraAttributes)return o;let s=[...n,...t.extraAttributes??[]];for(let e of s??[]){let t=ap({identifiers:e.identifiers,nodeNames:r,markNames:i,tags:a});for(let n of t){let t=o[n]??{};o[n]={...t,...e.attributes}}}return o}function ip(e){return Le(e)&&Oe(e.tags)}function ap(e){let{identifiers:t,nodeNames:n,markNames:r,tags:i}=e;if(t===`nodes`)return n;if(t===`marks`)return r;if(t===`all`)return[...n,...r];if(Oe(t))return t;E(ip(t),{code:b.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});let{tags:a=[],names:o=[],behavior:s=`any`,excludeNames:c,excludeTags:l,type:u}=t,d=new Set,f=u===`mark`?r:u===`node`?n:[...r,...n],p=e=>f.includes(e)&&!c?.includes(e);for(let e of o)p(e)&&d.add(e);let m=new Map;for(let e of a){if(l?.includes(e))continue;for(let t of i[e]){if(!p(t))continue;if(s===`any`){d.add(t);continue}let n=m.get(t)??new Set;n.add(e),m.set(t,n)}}for(let[e,t]of m)t.size===a.length&&d.add(e);return[...d]}function op(e){var t;let{createExtensionSpec:n,extraAttributes:r,ignoreExtraAttributes:i,name:a,tags:o,override:s}=e,c=_();function l(e,t){c[e]=t}let u=!1;function d(){u=!0}let f=cp(r,i,d,l),p=lp(r,i),m=up(r,i),h=n({defaults:f,parse:p,dom:m},s);return E(i||u,{code:b.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${a}' to 'true'.`}),h.group=[...(t=h.group)?.split(` `)??[],...o].join(` `)||void 0,{spec:h,dynamic:c}}function sp(e){return p(e)||D(e)?{default:e}:(E(e,{message:`${ne(e)} is not supported`,code:b.EXTENSION_EXTRA_ATTRIBUTES}),e)}function cp(e,t,n,r){return()=>{n();let i=_();if(t)return i;for(let[t,n]of T(e)){let e=sp(n),a=e.default;D(a)&&(r(t,a),a=null),i[t]=a===void 0?{}:{default:a}}return i}}function lp(e,t){return n=>{let r=_();if(t)return r;for(let[t,i]of T(e)){let{parseDOM:e,...a}=sp(i);if(!Ol(n))continue;if(Pe(e)){r[t]=n.getAttribute(t)??a.default;continue}if(D(e)){r[t]=e(n)??a.default;continue}r[t]=n.getAttribute(e)??a.default}return r}}function up(e,t){return n=>{let r=_();if(t)return r;function i(e,t){if(e){if(p(e)){r[t]=e;return}if(Oe(e)){let[i,a]=e;r[i]=a??n.attrs[t];return}for(let[t,n]of T(e))r[t]=n}}for(let[t,a]of T(e)){let{toDOM:e,parseDOM:o}=sp(a);if(Pe(e)){let e=p(o)?o:t;r[e]=n.attrs[t];continue}if(D(e)){i(e(n.attrs,dp(n)),t);continue}i(e,t)}return r}}function dp(e){return Jl(e)?{node:e}:Xl(e)?{mark:e}:{}}function fp(e){let t=_(),n=_();for(let[n,r]of Object.entries(e.nodes))t[n]=r.spec;for(let[t,r]of Object.entries(e.marks))n[t]=r.spec;return{nodes:t,marks:n}}var pp=class extends z{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)?.suggesters))return vl(this.store.getState(),e)}}get name(){return`suggest`}onCreate(){this.store.setExtensionStore(`addSuggester`,e=>vl(this.store.getState(),e)),this.store.setExtensionStore(`removeSuggester`,e=>bl(this.store.getState(),e))}createExternalPlugins(){var e,t;let n=[];for(let r of this.store.extensions){if((e=this.store.managerSettings.exclude)?.suggesters)break;if(!r.createSuggesters||(t=r.options.exclude)?.suggesters)continue;let i=r.createSuggesters(),a=Oe(i)?i:[i];n.push(...a)}return[xl(...n)]}getSuggestState(e){return _l(e??this.store.getState())}getSuggestMethods(){let{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:i,findMatchAtPosition:a,findNextTextSelection:o,setLastChangeFromAppend:s}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:i,findMatchAtPosition:a,findNextTextSelection:o,setLastChangeFromAppend:s}}isSuggesterActive(e){var t;return De(Oe(e)?e:[e],(t=this.getSuggestState().match)?.suggester.name)}};I([V()],pp.prototype,`getSuggestState`,1),I([V()],pp.prototype,`getSuggestMethods`,1),I([V()],pp.prototype,`isSuggesterActive`,1),pp=I([B({customHandlerKeys:[`suggester`]})],pp);var mp=class extends z{constructor(){super(...arguments),this.allTags=_(),this.plainTags=_(),this.markTags=_(),this.nodeTags=_()}get name(){return`tags`}onCreate(){this.resetTags();for(let e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey(`tags`,this.allTags),this.store.setExtensionStore(`tags`,this.allTags),this.store.setStoreKey(`plainTags`,this.plainTags),this.store.setExtensionStore(`plainTags`,this.plainTags),this.store.setStoreKey(`markTags`,this.markTags),this.store.setExtensionStore(`markTags`,this.markTags),this.store.setStoreKey(`nodeTags`,this.nodeTags),this.store.setExtensionStore(`nodeTags`,this.nodeTags)}resetTags(){let e=_(),t=_(),n=_(),r=_();for(let i of oe(S))e[i]=[],t[i]=[],n[i]=[],r[i]=[];this.allTags=e,this.plainTags=t,this.markTags=n,this.nodeTags=r}updateTagForExtension(e){var t,n;let r=new Set([...e.tags??[],...(t=e.createTags)?.call(e)??[],...e.options.extraTags??[],...(n=this.store.managerSettings.extraTags)?.[e.name]??[]]);for(let t of r)E(hp(t),{code:b.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[t].push(e.name),Tf(e)&&this.plainTags[t].push(e.name),Df(e)&&this.markTags[t].push(e.name),Ef(e)&&this.nodeTags[t].push(e.name);e.tags=[...r]}};mp=I([B({defaultPriority:x.Highest})],mp);function hp(e){return De(oe(S),e)}var gp=new Mr(`remirrorFilePlaceholderPlugin`);function _p(){let e=new kr({key:gp,state:{init(){return{set:F.empty,payloads:new Map}},apply(t,{set:n,payloads:r}){n=n.map(t.mapping,t.doc);let i=t.getMeta(e);if(i)if(i.type===0){let e=document.createElement(`placeholder`),a=P.widget(i.pos,e,{id:i.id});n=n.add(t.doc,[a]),r.set(i.id,i.payload)}else i.type===1&&(n=n.remove(n.find(void 0,void 0,e=>e.id===i.id)),r.delete(i.id));return{set:n,payloads:r}}},props:{decorations(t){var n;return(n=e.getState(t))?.set??null}}});return e}var vp=class extends z{get name(){return`upload`}createExternalPlugins(){return[_p()]}};function yp(e={}){let t={exitMarksOnArrowPress:Gf.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Gf.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Gf.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Gf.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:Lf.defaultOptions.persistentSelectionClass};e={...t,...e};let n=(0,Te.default)(e,[`excludeBaseKeymap`,`selectParentNodeOnEscape`,`undoInputRuleOnBackspace`]),r=(0,Te.default)(e,[`persistentSelectionClass`]);return[new mp,new np,new Of,new tp,new Wf,new ep,new $f,new pp,new U,new Uf,new Gf(n),new Hf,new vp,new Lf(r)]}var bp=class extends z{get name(){return`meta`}onCreate(){if(this.store.setStoreKey(`getCommandMeta`,this.getCommandMeta.bind(this)),this.options.capture)for(let e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){let t=e.decoratedCommands??{},n=e.createCommands;for(let n of Object.keys(t)){let t=e[n];e[n]=(...r)=>i=>{var a;let o=t(...r)(i);return i.dispatch&&o&&this.setCommandMeta(i.tr,{type:`command`,chain:i.dispatch!==(a=i.view)?.dispatch,name:n,extension:e.name,decorated:!0}),o}}n&&(e.createCommands=()=>{let t=n();for(let[n,r]of Object.entries(t))t[n]=(...t)=>i=>{var a;let o=r(...t)(i);return i.dispatch&&o&&this.setCommandMeta(i.tr,{type:`command`,chain:i.dispatch!==(a=i.view)?.dispatch,name:n,extension:e.name,decorated:!1}),o};return t})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){let n=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...n,t])}};bp=I([B({defaultOptions:{capture:Tl.isDevelopment},staticKeys:[`capture`],defaultPriority:x.Highest})],bp);var xp,Sp,Cp,wp,Tp,Ep,Dp,Op=class{constructor(e){R(this,xp,ie()),R(this,Sp,void 0),R(this,Cp,void 0),R(this,wp,!0),R(this,Tp,rf()),R(this,Ep,void 0),R(this,Dp,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=e=>{var t,n;E(!this.manager.destroyed,{code:b.MANAGER_PHASE_ERROR,message:`A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue.`}),e=(n=(t=this.props).onDispatchTransaction)?.call(t,e,this.getState())??e;let r=this.getState(),{state:i,transactions:a}=r.applyTransaction(e);lf(this,Cp,r),this.updateState({state:i,tr:e,transactions:a});let o=this.manager.store.getForcedUpdates(e);Ae(o)||this.updateViewProps(...o)},this.onChange=(e=_())=>{var t,n;let r=this.eventListenerProps(e);L(this,wp)&&lf(this,wp,!1),(n=(t=this.props).onChange)==null||n.call(t,r)},this.onBlur=e=>{var t,n;let r=this.eventListenerProps();(n=(t=this.props).onBlur)==null||n.call(t,r,e),L(this,Tp).emit(`blur`,r,e)},this.onFocus=e=>{var t,n;let r=this.eventListenerProps();(n=(t=this.props).onFocus)==null||n.call(t,r,e),L(this,Tp).emit(`focus`,r,e)},this.setContent=(e,{triggerChange:t=!1}={})=>{let{doc:n}=this.manager.createState({content:e}),r=this.getState(),{state:i}=this.getState().applyTransaction(r.tr.replaceRangeWith(0,r.doc.nodeSize-2,n));if(t)return this.updateState({state:i,triggerChange:t});this.view.updateState(i)},this.clearContent=({triggerChange:e=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:e})},this.createStateFromContent=(e,t)=>this.manager.createState({content:e,selection:t}),this.focus=e=>{this.manager.store.commands.focus(e)},this.blur=e=>{this.manager.store.commands.blur(e)};let{getProps:t,initialEditorState:n,element:r}=e;if(lf(this,Sp,t),lf(this,Dp,n),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;let i=this.createView(n,r);this.manager.addView(i)}get addHandler(){return L(this,Ep)??lf(this,Ep,L(this,Tp).on.bind(L(this,Tp)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return L(this,wp)}get props(){return L(this,Sp).call(this)}get previousState(){return this.previousStateOverride??L(this,Cp)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return L(this,xp)}get initialEditorState(){return L(this,Dp)}updateListener(e){let{state:t,tr:n}=e;return L(this,Tp).emit(`updated`,this.eventListenerProps({state:t,tr:n}))}update(e){let{getProps:t}=e;return lf(this,Sp,t),this}updateViewProps(...e){let t=(0,Te.default)(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;let{attributes:n,autoFocus:r,classNames:i=[],label:a,editable:o}=this.props,s=(t=this.manager.store)?.attributes,c=D(n)?n(this.eventListenerProps()):n,l={};(r||Fe(r))&&(l=e?{autoFocus:!0}:{autofocus:`true`});let u=y(mf(e&&`Prosemirror`,`remirror-editor`,s?.class,...i).split(` `)).join(` `),d={role:`textbox`,...l,"aria-multiline":`true`,...o??!0?{}:{"aria-readonly":`true`},"aria-label":a??``,...s,class:u};return ee({...d,...c})}addFocusListeners(){this.view.dom.addEventListener(`blur`,this.onBlur),this.view.dom.addEventListener(`focus`,this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener(`blur`,this.onBlur),this.view.dom.removeEventListener(`focus`,this.onFocus)}destroy(){L(this,Tp).emit(`destroy`),this.view&&this.removeFocusListeners()}eventListenerProps(e=_()){let{state:t,tr:n,transactions:r}=e;return{tr:n,transactions:r,internalUpdate:!n,view:this.view,firstRender:L(this,wp),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:L(this,xp),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};xp=new WeakMap,Sp=new WeakMap,Cp=new WeakMap,wp=new WeakMap,Tp=new WeakMap,Ep=new WeakMap,Dp=new WeakMap;function kp(e,t){let n=[],r=new WeakMap,i=[],a=new WeakMap,o=[],s={duplicateMap:a,parentExtensions:i,gatheredExtensions:o,settings:t};for(let t of e)Ap(s,{extension:t});o=v(o,(e,t)=>t.priority-e.priority);let c=new WeakSet,l=new Set;for(let e of o){let t=e.constructor,i=e.name,o=a.get(t);if(E(o,{message:`No entries were found for the ExtensionConstructor ${e.name}`,code:b.INTERNAL}),c.has(t)||l.has(i))continue;c.add(t),l.add(i),n.push(e),r.set(t,e),o.forEach(n=>n?.replaceChildExtension(t,e))}let u=[];for(let e of n)jp({extension:e,found:c,missing:u});return E(Ae(u),{code:b.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:e,extension:t})=>`The extension '${t.name}' requires '${e.name} in order to run correctly.`).join(`
24
24
  `)}),{extensions:n,extensionMap:r}}function Ap(e,t){var n;let{gatheredExtensions:r,duplicateMap:i,parentExtensions:a,settings:o}=e,{extension:s,parentExtension:l}=t,{names:u=[]}=t;E(Cf(s),{code:b.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${s} was provided to the [[\`RemirrorManager\`]].`});let d=s.extensions;if(s.setPriority((n=o.priority)?.[s.name]),r.push(s),Mp({duplicateMap:i,extension:s,parentExtension:l}),d.length!==0){if(u.includes(s.name)){c(!1,`Circular dependency encountered when loading extensions: ${u.join(` > `)} > ${s.name}`);return}u=[...u,s.name],a.push(s);for(let t of d)Ap(e,{names:u,extension:t,parentExtension:s})}}function jp(e){let{extension:t,found:n,missing:r}=e;if(t.requiredExtensions)for(let e of t.requiredExtensions??[]){if(n.has(e))continue;r.push({Constructor:e,extension:t})}}function Mp(e){let{duplicateMap:t,extension:n,parentExtension:r}=e,i=n.constructor,a=t.get(i),o=r?[r]:[];t.set(i,a?[...a,...o]:o)}function Np(e){var t,n,r,i;let{extension:a,nodeNames:o,markNames:s,plainNames:c,store:l,handlers:u}=e;a.setStore(l);let d=(t=a.onCreate)?.bind(a),f=(n=a.onView)?.bind(a),p=(r=a.onStateUpdate)?.bind(a),m=(i=a.onDestroy)?.bind(a);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),m&&u.destroy.push(m),Df(a)&&s.push(a.name),Ef(a)&&a.name!==`doc`&&o.push(a.name),Tf(a)&&c.push(a.name)}var Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp=class{constructor(e,t={}){R(this,Pp,void 0),R(this,Fp,_()),R(this,Ip,_()),R(this,Lp,void 0),R(this,Rp,void 0),R(this,zp,fe.None),R(this,Bp,void 0),R(this,Vp,!0),R(this,Hp,{create:[],view:[],update:[],destroy:[]}),R(this,Up,[]),R(this,Wp,rf()),R(this,Gp,void 0),R(this,Kp,void 0),this.getState=()=>{var e;return L(this,zp)>=fe.EditorView?this.view.state:(E(L(this,Gp),{code:b.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(e=L(this,Gp))?.initialEditorState)},this.updateState=e=>{let t=this.getState();this.view.updateState(e),this.onStateUpdate({previousState:t,state:e})};let{extensions:n,extensionMap:r}=kp(e,t);lf(this,Bp,t),lf(this,Lp,Ce(n)),lf(this,Rp,r),lf(this,Pp,this.createExtensionStore()),lf(this,zp,fe.Create),this.setupLifecycleHandlers();for(let e of L(this,Hp).create){let t=e();t&&L(this,Up).push(t)}}static create(e,t={}){return new qp([...we(e),...yp(t.builtin)],t)}get[ge](){return me.Manager}get destroyed(){return L(this,zp)===fe.Destroy}get mounted(){return L(this,zp)>=fe.EditorView&&L(this,zp)<fe.Destroy}get output(){var e;return(e=L(this,Gp))?.frameworkOutput}get frameworkAttached(){return!!L(this,Gp)}get extensions(){return L(this,Lp)}get stringHandlers(){return L(this,Fp)}get store(){return Ce(L(this,Ip))}get extensionStore(){return Ce(L(this,Pp))}get tr(){return this.getExtension(U).transaction}get nodes(){return L(this,Ip).nodes}get marks(){return L(this,Ip).marks}get schema(){return L(this,Ip).schema}get extensionTags(){return L(this,Ip).tags}get view(){return L(this,Ip).view}get settings(){return L(this,Bp)}get document(){return L(this,Bp).document??xu()}setupLifecycleHandlers(){let e=L(this,Pp),t=L(this,Hp),n=[],r=[],i=[];e.nodeNames=n,e.markNames=r,e.plainNames=i;for(let a of L(this,Lp))Np({extension:a,nodeNames:n,markNames:r,plainNames:i,handlers:t,store:e})}setStringHandler(e,t){L(this,Fp)[e]=t}setStoreKey(e,t){L(this,Ip)[e]=t}getStoreKey(e){let t=L(this,Ip)[e];return E(!Pe(t),{code:b.MANAGER_PHASE_ERROR,message:"`getStoreKey` should not be called before the values are available."}),t}setExtensionStore(e,t){E(L(this,zp)<=fe.EditorView,{code:b.MANAGER_PHASE_ERROR,message:"`setExtensionStore` should only be called during the `onCreate` lifecycle hook. Make sure to only call it within the returned methods."}),L(this,Pp)[e]=t}createExtensionStore(){let e=_(),t;return Object.defineProperties(e,{extensions:{get:()=>L(this,Lp),enumerable:!0},phase:{get:()=>L(this,zp),enumerable:!0},view:{get:()=>this.view,enumerable:!0},managerSettings:{get:()=>Ce(L(this,Bp)),enumerable:!0},getState:{value:this.getState,enumerable:!0},updateState:{value:this.updateState,enumerable:!0},isMounted:{value:()=>this.mounted,enumerable:!0},getExtension:{value:this.getExtension.bind(this),enumerable:!0},manager:{get:()=>this,enumerable:!0},document:{get:()=>this.document,enumerable:!0},stringHandlers:{get:()=>L(this,Fp),enumerable:!0},currentState:{get:()=>this.getState(),set:e=>{},enumerable:!0},previousState:{get:()=>t,set:e=>{t=e},enumerable:!0}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(L(this,zp)>=fe.EditorView)return this;lf(this,Vp,!0),lf(this,zp,fe.EditorView),L(this,Ip).view=e;for(let t of L(this,Hp).view){let n=t(e);n&&L(this,Up).push(n)}return this}attachFramework(e,t){var n;L(this,Gp)!==e&&(L(this,Gp)&&(L(this,Gp).destroy(),(n=L(this,Kp))==null||n.call(this)),lf(this,Gp,e),lf(this,Kp,this.addHandler(`stateUpdate`,t)))}createEmptyDoc(){var e;let t=(e=this.schema.nodes.doc)?.createAndFill();return E(t,{code:b.INVALID_CONTENT,message:`An empty node could not be created due to an invalid schema.`}),t}createState(e={}){let{onError:t,defaultSelection:n=`end`}=this.settings,{content:r=this.createEmptyDoc(),selection:i=n,stringHandler:a=this.settings.stringHandler}=e,{schema:o,plugins:s}=this.store,c=bu({stringHandler:p(a)?this.stringHandlers[a]:a,document:this.document,content:r,onError:t,schema:o,selection:i});return Dr.create({schema:o,doc:c,plugins:s,selection:vu(i,c)})}addHandler(e,t){return L(this,Wp).on(e,t)}onStateUpdate(e){let t=L(this,Vp);L(this,Pp).currentState=e.state,L(this,Pp).previousState=e.previousState,t&&(lf(this,zp,fe.Runtime),lf(this,Vp,!1));let n={...e,firstUpdate:t};for(let e of L(this,Hp).update)e(n);L(this,Wp).emit(`stateUpdate`,n)}getExtension(e){let t=L(this,Rp).get(e);return E(t,{code:b.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){let t=L(this,Rp).get(e);return!!t}clone(){let e=L(this,Lp).map(e=>e.clone(e.options)),t=qp.create(()=>e,L(this,Bp));return L(this,Wp).emit(`clone`,t),t}recreate(e=[],t={}){let n=L(this,Lp).map(e=>e.clone(e.initialOptions)),r=qp.create(()=>[...n,...e],t);return L(this,Wp).emit(`recreate`,r),r}destroy(){var e,t,n,r,i,a;lf(this,zp,fe.Destroy);for(let r of(e=this.view)?.state.plugins??[])(n=(t=r.getState(this.view.state))?.destroy)==null||n.call(t);(r=L(this,Gp))==null||r.destroy(),(i=L(this,Kp))==null||i.call(this);for(let e of L(this,Up))e();for(let e of L(this,Hp).destroy)e();(a=this.view)==null||a.destroy(),L(this,Wp).emit(`destroy`)}includes(e){let t=[],n=[];for(let e of L(this,Lp))t.push(e.name,e.constructorName),n.push(e.constructor);return e.every(e=>p(e)?De(t,e):De(n,e))}},Jp=qp;Pp=new WeakMap,Fp=new WeakMap,Ip=new WeakMap,Lp=new WeakMap,Rp=new WeakMap,zp=new WeakMap,Bp=new WeakMap,Vp=new WeakMap,Hp=new WeakMap,Up=new WeakMap,Wp=new WeakMap,Gp=new WeakMap,Kp=new WeakMap;function Yp(e,t){return!Hl(e)||!Ul(e,me.Manager)?!1:t?e.includes(t):!0}function Xp(e,t,n){return Math.min(Math.max(e,n),t)}var Zp=class extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}},Qp=Zp;function $p(e){if(typeof e!=`string`)throw new Qp(e);if(e.trim().toLowerCase()===`transparent`)return[0,0,0,0];let t=e.trim();t=lm.test(e)?rm(e):e;let n=am.exec(t);if(n){let e=Array.from(n).slice(1);return[...e.slice(0,3).map(e=>parseInt(im(e,2),16)),parseInt(im(e[3]||`f`,2),16)/255]}let r=om.exec(t);if(r){let e=Array.from(r).slice(1);return[...e.slice(0,3).map(e=>parseInt(e,16)),parseInt(e[3]||`ff`,16)/255]}let i=sm.exec(t);if(i){let e=Array.from(i).slice(1);return[...e.slice(0,3).map(e=>parseInt(e,10)),parseFloat(e[3]||`1`)]}let a=cm.exec(t);if(a){let[t,n,r,i]=Array.from(a).slice(1).map(parseFloat);if(Xp(0,100,n)!==n||Xp(0,100,r)!==r)throw new Qp(e);return[...dm(t,n,r),Number.isNaN(i)?1:i]}throw new Qp(e)}function em(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const tm=e=>parseInt(e.replace(/_/g,``),36),nm=`1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm`.split(` `).reduce((e,t)=>{let n=tm(t.substring(0,3)),r=tm(t.substring(3)).toString(16),i=``;for(let e=0;e<6-r.length;e++)i+=`0`;return e[n]=`${i}${r}`,e},{});function rm(e){let t=e.toLowerCase().trim(),n=nm[em(t)];if(!n)throw new Qp(e);return`#${n}`}const im=(e,t)=>Array.from(Array(t)).map(()=>e).join(``),am=RegExp(`^#${im(`([a-f0-9])`,3)}([a-f0-9])?$`,`i`),om=RegExp(`^#${im(`([a-f0-9]{2})`,3)}([a-f0-9]{2})?$`,`i`),sm=RegExp(`^rgba?\\(\\s*(\\d+)\\s*${im(`,\\s*(\\d+)\\s*`,2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,`i`),cm=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,lm=/^[a-z]+$/i,um=e=>Math.round(e*255),dm=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(um);let i=(e%360+360)%360/60,a=(1-Math.abs(2*r-1))*(t/100),o=a*(1-Math.abs(i%2-1)),s=0,c=0,l=0;i>=0&&i<1?(s=a,c=o):i>=1&&i<2?(s=o,c=a):i>=2&&i<3?(c=a,l=o):i>=3&&i<4?(c=o,l=a):i>=4&&i<5?(s=o,l=a):i>=5&&i<6&&(s=a,l=o);let u=r-a/2,d=s+u,f=c+u,p=l+u;return[d,f,p].map(um)};function fm(e){let[t,n,r,i]=$p(e).map((e,t)=>t===3?e:e/255),a=Math.max(t,n,r),o=Math.min(t,n,r),s=(a+o)/2;if(a===o)return[0,0,s,i];let c=a-o,l=s>.5?c/(2-a-o):c/(a+o),u=60*(t===a?(n-r)/c+(n<r?6:0):n===a?(r-t)/c+2:(t-n)/c+4);return[u,l,s,i]}function pm(e,t,n,r){return`hsla(${(e%360).toFixed()}, ${Xp(0,100,t*100).toFixed()}%, ${Xp(0,100,n*100).toFixed()}%, ${parseFloat(Xp(0,1,r).toFixed(3))})`}function mm(e,t){let[n,r,i,a]=fm(e);return pm(n,r,i-t,a)}function hm(e,t,n,r){return`rgba(${Xp(0,255,e).toFixed()}, ${Xp(0,255,t).toFixed()}, ${Xp(0,255,n).toFixed()}, ${parseFloat(Xp(0,1,r).toFixed(3))})`}function gm(e,t){return mm(e,-t)}function _m(e,t){let[n,r,i,a]=$p(e);return hm(n,r,i,a-t)}var vm=Object.freeze({__proto__:null,ANIMATED_POPOVER:`remirror-animated-popover`,BUTTON:`remirror-button`,BUTTON_ACTIVE:`remirror-button-active`,COLOR_PICKER:`remirror-color-picker`,COLOR_PICKER_CELL:`remirror-color-picker-cell`,COLOR_PICKER_CELL_SELECTED:`remirror-color-picker-cell-selected`,COMPOSITE:`remirror-composite`,DIALOG:`remirror-dialog`,DIALOG_BACKDROP:`remirror-dialog-backdrop`,EDITOR_WRAPPER:`remirror-editor-wrapper`,FLEX_COLUMN:`remirror-flex-column`,FLEX_ROW:`remirror-flex-row`,FLOATING_POPOVER:`remirror-floating-popover`,FORM:`remirror-form`,FORM_GROUP:`remirror-form-group`,FORM_LABEL:`remirror-form-label`,FORM_MESSAGE:`remirror-form-message`,GROUP:`remirror-group`,INPUT:`remirror-input`,MENU:`remirror-menu`,MENU_BAR:`remirror-menu-bar`,MENU_BUTTON:`remirror-menu-button`,MENU_BUTTON_LEFT:`remirror-menu-button-left`,MENU_BUTTON_NESTED_LEFT:`remirror-menu-button-nested-left`,MENU_BUTTON_NESTED_RIGHT:`remirror-menu-button-nested-right`,MENU_BUTTON_RIGHT:`remirror-menu-button-right`,MENU_DROPDOWN_LABEL:`remirror-menu-dropdown-label`,MENU_GROUP:`remirror-menu-group`,MENU_ITEM:`remirror-menu-item`,MENU_ITEM_CHECKBOX:`remirror-menu-item-checkbox`,MENU_ITEM_COLUMN:`remirror-menu-item-column`,MENU_ITEM_RADIO:`remirror-menu-item-radio`,MENU_ITEM_ROW:`remirror-menu-item-row`,MENU_PANE:`remirror-menu-pane`,MENU_PANE_ACTIVE:`remirror-menu-pane-active`,MENU_PANE_ICON:`remirror-menu-pane-icon`,MENU_PANE_LABEL:`remirror-menu-pane-label`,MENU_PANE_SHORTCUT:`remirror-menu-pane-shortcut`,POPOVER:`remirror-popover`,ROLE:`remirror-role`,SEPARATOR:`remirror-separator`,TAB:`remirror-tab`,TABBABLE:`remirror-tabbable`,TABLE_SIZE_EDITOR:`remirror-table-size-editor`,TABLE_SIZE_EDITOR_BODY:`remirror-table-size-editor-body`,TABLE_SIZE_EDITOR_CELL:`remirror-table-size-editor-cell`,TABLE_SIZE_EDITOR_CELL_SELECTED:`remirror-table-size-editor-cell-selected`,TABLE_SIZE_EDITOR_FOOTER:`remirror-table-size-editor-footer`,TAB_LIST:`remirror-tab-list`,TOOLBAR:`remirror-toolbar`,TOOLTIP:`remirror-tooltip`}),ym=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:`remirror-collapsible-list-item-button`,COLLAPSIBLE_LIST_ITEM_CLOSED:`remirror-collapsible-list-item-closed`,EDITOR:`remirror-editor`,LIST_ITEM_CHECKBOX:`remirror-list-item-checkbox`,LIST_ITEM_MARKER_CONTAINER:`remirror-list-item-marker-container`,LIST_ITEM_WITH_CUSTOM_MARKER:`remirror-list-item-with-custom-mark`,LIST_SPINE:`remirror-list-spine`,UL_LIST_CONTENT:`remirror-ul-list-content`}),bm=Object.freeze({__proto__:null,IS_EMPTY:`remirror-is-empty`}),xm=Object.freeze({__proto__:null,EDITOR:`remirror-editor`,POSITIONER:`remirror-positioner`,POSITIONER_WIDGET:`remirror-positioner-widget`});const Sm={gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]},Cm=`#000000`,wm=`#ffffff`,Tm=_m(Cm,.75),Em=`#7963d2`,Dm=`#bcd263`,Om=Sm.gray[1],km=gm(_m(Cm,.1),.13),Am={background:wm,border:Tm,foreground:Cm,muted:Om,primary:Em,secondary:Dm,primaryText:`#fff`,secondaryText:`#fff`,text:`#252103`,faded:km};({...Am}),mm(wm,.15),mm(Tm,.15),mm(Cm,.15),mm(Om,.15),mm(Em,.15),mm(Dm,.15),{...Am},mm(wm,.075),mm(Tm,.075),mm(Cm,.075),mm(Om,.075),mm(Em,.075),mm(Dm,.075),{...Am},_m(Cm,.1),_m(Em,.6),gm(Cm,.8),gm(Cm,.4),Sm.gray[3],Sm.blue[7],Sm.blue[1],Sm.blue[5],Sm.blue[7],gm(Cm,.4),Sm.blue[5],Sm.red[7],Sm.red[1],Sm.red[5];var jm=Object.defineProperty,Mm=Object.getOwnPropertyDescriptor,Nm=(e,t,n,r)=>{for(var i=r>1?void 0:r?Mm(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&jm(t,n,i),i},Pm=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Fm=(e,t,n)=>(Pm(e,t,`read from private field`),n?n.call(e):t.get(e)),Im=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Lm=(e,t,n,r)=>(Pm(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm=class{constructor(e){Im(this,Rm,rf()),Im(this,zm,[]),Im(this,Bm,new Map),Im(this,Vm,[]),Im(this,Hm,!1),Im(this,Um,void 0),Im(this,Wm,void 0),Im(this,Gm,void 0),Im(this,Km,void 0),this.addListener=(e,t)=>Fm(this,Rm).on(e,t),Lm(this,Um,e),Lm(this,Wm,e.getActive),Lm(this,Km,e.getPosition),Lm(this,Gm,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??[`state`,`scroll`]}static create(e){return new qm(e)}static fromPositioner(e,t){return qm.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Fm(this,Wm),getPosition:Fm(this,Km),hasChanged:this.hasChanged,events:this.events,getID:Fm(this,Gm)}}onActiveChanged(e){this.recentUpdate=e;let t=Fm(this,Wm).call(this,e);Lm(this,zm,t),Lm(this,Bm,new Map),Lm(this,Hm,!1),Lm(this,Vm,[]);let n=[];for(let[r,i]of t.entries()){let t=this.getID(i,r);Fm(this,Vm).push(t),n.push({setElement:t=>this.addProps({...e,data:i,element:t},r),id:t,data:i})}Fm(this,Rm).emit(`update`,n)}getID(e,t){var n;return(n=Fm(this,Gm))?.call(this,e,t)??t.toString()}addProps(e,t){if(Fm(this,Hm)||(Fm(this,Bm).set(t,e),Fm(this,Bm).size<Fm(this,zm).length))return;let n=[];for(let e of Fm(this,zm).keys()){let t=Fm(this,Bm).get(e);E(t,{code:b.INTERNAL,message:`Something went wrong when retrieving the parameters`});let r=Fm(this,Vm)[e];if(!r)return;n.push({position:Fm(this,Km).call(this,t),element:t.element,id:r})}Fm(this,Rm).emit(`done`,n)}clone(e){return qm.create({...Fm(this,Um),...D(e)?e(Fm(this,Um)):e})}active(e){let t=D(e)?e:()=>e;return this.clone(e=>({getActive:n=>e.getActive(n).filter(t)}))}},Jm=qm;Rm=new WeakMap,zm=new WeakMap,Bm=new WeakMap,Vm=new WeakMap,Hm=new WeakMap,Um=new WeakMap,Wm=new WeakMap,Gm=new WeakMap,Km=new WeakMap,Jm.EMPTY=[];function Ym(e,t=eh){let{key:n}=e?.getMeta($m)??{};return n===t}function Xm(e){let{tr:t,state:n,previousState:r}=e;return!r||t&&Ym(t)?!0:t?Fl(t):!n.doc.eq(r.doc)||!n.selection.eq(r.selection)}function Zm(e,t,n={}){let r=t.getBoundingClientRect(),{accountForPadding:i=!1}=n,a=0,o=0,s=0,c=0;if(Ol(t)&&i){let e=Number.parseFloat(El(t,`padding-left`).replace(`px`,``)),n=Number.parseFloat(El(t,`padding-right`).replace(`px`,``)),r=Number.parseFloat(El(t,`padding-top`).replace(`px`,``)),i=Number.parseFloat(El(t,`padding-bottom`).replace(`px`,``)),l=Number.parseFloat(El(t,`border-left`).replace(`px`,``)),u=Number.parseFloat(El(t,`border-right`).replace(`px`,``)),d=Number.parseFloat(El(t,`border-top`).replace(`px`,``)),f=Number.parseFloat(El(t,`border-bottom`).replace(`px`,``)),p=t.offsetWidth-t.clientWidth,m=t.offsetHeight-t.clientHeight;a+=e+l+(t.dir===`rtl`?p:0),o+=n+u+(t.dir===`rtl`?0:p),s+=r+d,c+=i+f+m}let l=new DOMRect(r.left+a,r.top+s,r.width-o,r.height-c);for(let[t,n]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(se(t,l.top,l.bottom)&&se(n,l.left,l.right))return!0;return!1}var Qm=`remirror-positioner-widget`,$m=`positionerUpdate`,eh=`__all_positioners__`,th={y:-999999,x:-999999,width:0,height:0},nh={...th,left:-999999,top:-999999,bottom:-999999,right:-999999},rh={...th,rect:{...nh,toJSON:()=>nh},visible:!1},ih=Jm.create({hasChanged:Xm,getActive(e){let{state:t}=e;if(!Pl(t)||t.selection.$anchor.depth>2)return Jm.EMPTY;let n=Al({predicate:e=>e.type.isBlock,selection:t});return n?[n]:Jm.EMPTY},getPosition(e){let{view:t,data:n}=e,r=t.nodeDOM(n.pos);if(!Ol(r))return rh;let i=r.getBoundingClientRect(),a=t.dom.getBoundingClientRect(),o=i.height,s=i.width,c=t.dom.scrollLeft+i.left-a.left,l=t.dom.scrollTop+i.top-a.top,u=Zm(i,t.dom);return{y:l,x:c,height:o,width:s,rect:i,visible:u}}}),ah=ih.clone(({getActive:e})=>({getActive:t=>{let[n]=e(t);return n&&lu(n.node)&&n.node.type===su(t.state.schema)?[n]:Jm.EMPTY}}));ah.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),ah.clone(({getPosition:e})=>({getPosition:t=>{let{width:n,x:r,y:i,height:a}=e(t);return{...e(t),width:1,x:n+r,rect:new DOMRect(n+r,i,1,a)}}}));function oh(e){return Jm.create({hasChanged:Xm,getActive:t=>{let{state:n,view:r}=t;if(!e(n)||!Ql(n.selection))return Jm.EMPTY;try{let{head:e,anchor:t}=n.selection;return[{from:r.coordsAtPos(t),to:r.coordsAtPos(e)}]}catch{return Jm.EMPTY}},getPosition(e){let{element:t,data:n,view:r}=e,{from:i,to:a}=n,o=t.offsetParent??r.dom,s=o.getBoundingClientRect(),c=Math.abs(a.bottom-i.top),l=c>i.bottom-i.top,u=Math.min(i.left,a.left),d=Math.min(i.top,a.top),f=o.scrollLeft+(l?a.left-s.left:u-s.left),p=o.scrollTop+d-s.top,m=l?1:Math.abs(i.left-a.right),h=new DOMRect(l?a.left:u,d,m,c),g=Zm(h,r.dom);return{rect:h,y:p,x:f,height:c,width:m,visible:g}}})}var sh=oh(e=>!e.selection.empty);oh(e=>e.selection.empty),oh(()=>!0),sh.clone(()=>({getActive:e=>{let{state:t,view:n}=e;if(!t.selection.empty)return Jm.EMPTY;let r=pu(t);if(!r)return Jm.EMPTY;try{return[{from:n.coordsAtPos(r.from),to:n.coordsAtPos(r.to)}]}catch{return Jm.EMPTY}}}));var ch=class extends z{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return`positioner`}createAttributes(){return{class:xm.EDITOR}}init(){this.onScroll=ce(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps(`hover`,{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps(`contextmenu`,{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:`state`,helpers:this.store.helpers})}createDecorations(e){if(this.element??=this.createElement(),!this.element.hasChildNodes())return F.empty;let t=P.widget(0,this.element,{key:`positioner-widget`,side:-1,stopEvent:()=>!0});return F.create(e.doc,[t])}forceUpdatePositioners(e=eh){return({tr:t,dispatch:n})=>(n?.(t.setMeta($m,{key:e})),!0)}getPositionerWidget(){return this.element??=this.createElement()}createElement(){let e=document.createElement(`span`);return e.dataset.id=Qm,e.setAttribute(`role`,`presentation`),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(let t of this.positioners){let n=!t.events.includes(e.event);if(n)continue;this.triggerPositioner(t,e)}}getBaseProps(e,t){let n=this.store.getState(),r=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:r,state:n,...t}}onScroll(){this.positioner(this.getBaseProps(`scroll`,{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};Nm([H()],ch.prototype,`forceUpdatePositioners`,1),Nm([V()],ch.prototype,`getPositionerWidget`,1),ch=Nm([B({defaultOptions:{scrollDebounce:100},customHandlerKeys:[`positioner`],staticKeys:[`scrollDebounce`]})],ch);var lh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,dh=(e,t,n,r)=>{for(var i=r>1?void 0:r?uh(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&lh(t,n,i),i},fh={icon:`bold`,label:({t:e})=>e(Kr.LABEL),description:({t:e})=>e(Kr.DESCRIPTION)},ph=class extends bf{get name(){return`bold`}createTags(){return[S.FormattingMark,S.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:`strong`,getAttrs:e.parse},{tag:`b`,getAttrs:t=>Ol(t)&&t.style.fontWeight!==`normal`?e.parse(t):!1},{style:`font-weight`,getAttrs:e=>p(e)&&/^(bold(er)?|[5-9]\d{2,})$/.test(e)?null:!1},...t.parseDOM??[]],toDOM:t=>{let{weight:n}=this.options;return n?[`strong`,{"font-weight":n.toString()},0]:[`strong`,e.dom(t),0]}}}createInputRules(){return[Ju({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return jf({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:n})=>{let{from:r,to:i}=vu(e??t.selection,t.doc);return n?.(t.addMark(r,i,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:n})=>{let{from:r,to:i}=vu(e??t.selection,t.doc);return t.doc.rangeHasMark(r,i,this.type)?(n?.(t.removeMark(r,i,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};dh([H(fh)],ph.prototype,`toggleBold`,1),dh([H()],ph.prototype,`setBold`,1),dh([H()],ph.prototype,`removeBold`,1),dh([kf({shortcut:C.Bold,command:`toggleBold`})],ph.prototype,`shortcut`,1),ph=dh([B({defaultOptions:{weight:void 0},staticKeys:[`weight`]})],ph);var mh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,gh=(e,t,n,r)=>{for(var i=r>1?void 0:r?hh(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&mh(t,n,i),i},{DESCRIPTION:_h,LABEL:vh}=Yr,yh={icon:`codeLine`,description:({t:e})=>e(_h),label:({t:e})=>e(vh)},bh=class extends bf{get name(){return`code`}createTags(){return[S.Code,S.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:`_`,...t,attrs:e.defaults(),parseDOM:[{tag:`code`,getAttrs:e.parse},...t.parseDOM??[]],toDOM:t=>[`code`,{spellcheck:`false`,...e.dom(t)},0]}}createKeymap(){return{"Mod-`":jf({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return jf({type:this.type})}createInputRules(){return[Ju({regexp:RegExp(`(?:\`)([^\`${de}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:`mark`,regexp:/`([^`]+)`/g,markType:this.type}]}};gh([kf({shortcut:C.Code,command:`toggleCode`})],bh.prototype,`keyboardShortcut`,1),gh([H(yh)],bh.prototype,`toggleCode`,1),bh=gh([B({})],bh);var xh=200,Sh=function(){};Sh.prototype.append=function(e){return e.length?(e=Sh.from(e),!this.length&&e||e.length<xh&&this.leafAppend(e)||this.length<xh&&e.leafPrepend(this)||this.appendInner(e)):this},Sh.prototype.prepend=function(e){return e.length?Sh.from(e).append(this):this},Sh.prototype.appendInner=function(e){return new wh(this,e)},Sh.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Sh.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Sh.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Sh.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Sh.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},Sh.from=function(e){return e instanceof Sh?e:e&&e.length?new Ch(e):Sh.empty};var Ch=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=xh)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=xh)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Sh);Sh.empty=new Ch([]);var wh=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Sh),Th=Sh,Eh=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--){let e=this.items.get(r-1);if(e.selection){--r;break}}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new Oh(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new Oh(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new Oh(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&(o++,n=void 0),i||(c=l)}let l=o-r.depth;return l>Ah&&(s=Dh(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new dn;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new Oh(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new Oh(i,o,l))}else r.push(new Oh(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new Oh(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new Oh(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(Th.from(i.reverse()),a)}};Eh.empty=new Eh(Th.empty,0);function Dh(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var Oh=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},kh=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}};const Ah=20;function jh(e,t,n,r){let i=n.getMeta(zh),a;if(i)return i.historyState;n.getMeta(Bh)&&(e=new kh(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(zh))return o.getMeta(zh).redo?new kh(e.done.addTransform(n,void 0,r,Rh(t)),e.undone,Nh(n.mapping.maps),e.prevTime,e.prevComposition):new kh(e.done,e.undone.addTransform(n,void 0,r,Rh(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Mh(n,e.prevRanges)),s=o?Ph(e.prevRanges,n.mapping):Nh(n.mapping.maps);return new kh(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Rh(t)),Eh.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new kh(e.done.rebased(n,a),e.undone.rebased(n,a),Ph(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new kh(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Ph(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Mh(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function Nh(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function Ph(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Fh(e,t,n){let r=Rh(t),i=zh.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new kh(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(zh,{redo:n,historyState:c})}let Ih=!1,Lh=null;function Rh(e){let t=e.plugins;if(Lh!=t){Ih=!1,Lh=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Ih=!0;break}}return Ih}const zh=new Mr(`history`),Bh=new Mr(`closeHistory`);function Vh(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new kr({key:zh,state:{init(){return new kh(Eh.empty,Eh.empty,null,0,-1)},apply(t,n,r){return jh(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Uh:n==`historyRedo`?Wh:null;return r?(t.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function Hh(e,t){return(n,r)=>{let i=zh.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Fh(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}const Uh=Hh(!1,!0),Wh=Hh(!0,!0);Hh(!1,!1),Hh(!0,!1);function Gh(e){let t=zh.getState(e);return t?t.done.eventCount:0}function Kh(e){let t=zh.getState(e);return t?t.undone.eventCount:0}var qh=Object.defineProperty,Jh=Object.getOwnPropertyDescriptor,Yh=(e,t,n,r)=>{for(var i=r>1?void 0:r?Jh(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&qh(t,n,i),i},Xh=class extends xf{get name(){return`doc`}createNodeSpec(e,t){let{docAttributes:n,content:r}=this.options,i=_();if(Le(n))for(let[e,t]of T(n))i[e]={default:t};else for(let e of n)i[e]={default:null};return{attrs:i,content:r,...t}}setDocAttributes(e){return({tr:t,dispatch:n})=>{if(n){for(let[n,r]of Object.entries(e))t.step(new $h(n,r));n(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return iu(e.doc,t)}};Yh([H()],Xh.prototype,`setDocAttributes`,1),Yh([V()],Xh.prototype,`isDefaultDocNode`,1),Xh=Yh([B({defaultOptions:{content:`block+`,docAttributes:[]},defaultPriority:x.Medium,staticKeys:[`content`,`docAttributes`],disableExtraAttributes:!0})],Xh);var Zh=`SetDocAttribute`,Qh=`RevertSetDocAttribute`,$h=class e extends pn{static fromJSON(t,n){return new e(n.key,n.value,n.stepType)}key;stepType;value;previous;constructor(e,t,n=Zh){super(),this.stepType=n,this.key=e,this.value=t}apply(e){this.previous=e.attrs[this.key];let t={...e.attrs,[this.key]:this.value};return mn.ok(e.type.create(t,e.content,e.marks))}invert(){return new e(this.key,this.previous,Qh)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{pn.jsonID(Zh,$h),pn.jsonID(Qh,$h)}catch(e){if(!e.message.startsWith(`Duplicate use of step JSON ID`))throw e}var eg=Object.defineProperty,tg=Object.getOwnPropertyDescriptor,ng=(e,t,n,r)=>{for(var i=r>1?void 0:r?tg(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&eg(t,n,i),i};function rg(e,t,n,r){let i=e.docView.posFromDOM(t,n,r);return i===null||i<0?null:i}function ig(e,t){let n=t.target;if(n){let t=rg(e,n,0);if(t!==null){let n=e.state.doc.resolve(t),r=n.node().isLeaf?0:1,i=n.start()-r;return{pos:t,inside:i}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var ag=class extends z{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,n)=>{let r=n,i=ig(t,r);if(!i)return!1;let a=[],o=[],{inside:s,pos:c}=i;if(s===-1)return!1;let l=t.state.doc.resolve(c),u=l.depth+1;for(let e of te(u,1))a.push({node:e>l.depth&&l.nodeAfter?l.nodeAfter:l.node(e),pos:l.before(e)});for(let{type:e}of l.marksAcross(l)??[]){let t=uu(l,e);t&&o.push(t)}return e(r,{view:t,nodes:a,marks:o,getMark:e=>{let n=p(e)?t.state.schema.marks[e]:e;return E(n,{code:b.EXTENSION,message:`The mark ${e} being checked does not exist within the editor schema.`}),o.find(e=>e.mark.type===n)},getNode:e=>{var n;let r=p(e)?t.state.schema.nodes[e]:e;E(r,{code:b.EXTENSION,message:`The node being checked does not exist`});let i=a.find(({node:e})=>e.type===r);if(i)return{...i,isRoot:!!(n=a[0])?.node.eq(i.node)}}})}}get name(){return`events`}onView(){var e,t;if(!(e=this.store.managerSettings.exclude)?.clickHandler)for(let e of this.store.extensions){if(!e.createEventHandlers||(t=e.options.exclude)?.clickHandler)continue;let n=e.createEventHandlers();for(let[e,t]of T(n))this.addHandler(e,t)}}createPlugin(){let e=new WeakMap,t=(t,n,r,i,a,o,s,c)=>{let l=this.store.currentState,{schema:u,doc:d}=l,f=d.resolve(i),m=e.has(s),h=og({$pos:f,handled:m,view:r,state:l}),g=!1;m||(g=t(s,h)||g);let _={...h,pos:i,direct:c,nodeWithPosition:{node:a,pos:o},getNode:e=>{let t=p(e)?u.nodes[e]:e;return E(t,{code:b.EXTENSION,message:`The node being checked does not exist`}),t===a.type?{node:a,pos:o}:void 0}};return e.set(s,!0),n(s,_)||g};return{props:{handleKeyPress:(e,t)=>this.options.keypress(t)||!1,handleKeyDown:(e,t)=>this.options.keydown(t)||!1,handleTextInput:(e,t,n,r)=>this.options.textInput({from:t,to:n,text:r})||!1,handleClickOn:(e,n,r,i,a,o)=>t(this.options.clickMark,this.options.click,e,n,r,i,a,o),handleDoubleClickOn:(e,n,r,i,a,o)=>t(this.options.doubleClickMark,this.options.doubleClick,e,n,r,i,a,o),handleTripleClickOn:(e,n,r,i,a,o)=>t(this.options.tripleClickMark,this.options.tripleClick,e,n,r,i,a,o),handleDOMEvents:{focus:(e,t)=>this.options.focus(t)||!1,blur:(e,t)=>this.options.blur(t)||!1,mousedown:(e,t)=>(this.startMouseover(),this.options.mousedown(t)||!1),mouseup:(e,t)=>(this.endMouseover(),this.options.mouseup(t)||!1),mouseleave:(e,t)=>(this.mouseover=!1,this.options.mouseleave(t)||!1),mouseenter:(e,t)=>(this.mouseover=!0,this.options.mouseenter(t)||!1),keyup:(e,t)=>this.options.keyup(t)||!1,mouseout:this.createMouseEventHandler((e,t)=>{let n={...t,hovering:!1};return this.options.hover(e,n)||!1}),mouseover:this.createMouseEventHandler((e,t)=>{let n={...t,hovering:!0};return this.options.hover(e,n)||!1}),contextmenu:this.createMouseEventHandler((e,t)=>this.options.contextmenu(e,t)||!1),scroll:(e,t)=>this.options.scroll(t)||!1,copy:(e,t)=>this.options.copy(t)||!1,cut:(e,t)=>this.options.cut(t)||!1,paste:(e,t)=>this.options.paste(t)||!1}},view:e=>{let t=e.editable,n=this.options;return{update(e){let r=e.editable;r!==t&&(n.editable(r),t=r)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener(`mouseup`,()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};ng([V()],ag.prototype,`isInteracting`,1),ag=ng([B({handlerKeys:[`blur`,`focus`,`mousedown`,`mouseup`,`mouseenter`,`mouseleave`,`textInput`,`keypress`,`keyup`,`keydown`,`click`,`clickMark`,`doubleClick`,`doubleClickMark`,`tripleClick`,`tripleClickMark`,`contextmenu`,`hover`,`scroll`,`copy`,`cut`,`paste`,`editable`],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:x.High})],ag);function og(e){let{handled:t,view:n,$pos:r,state:i}=e,a={getMark:g,markRanges:[],view:n,state:i};if(t)return a;for(let{type:e}of r.marksAcross(r)??[]){let t=uu(r,e);t&&a.markRanges.push(t)}return a.getMark=e=>{let t=p(e)?i.schema.marks[e]:e;return E(t,{code:b.EXTENSION,message:`The mark ${e} being checked does not exist within the editor schema.`}),a.markRanges.find(e=>e.mark.type===t)},a}var sg=class e extends j{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):j.near(r)}content(){return A.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new cg(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!lg(e)||!ug(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!N.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};sg.prototype.visible=!1,sg.findFrom=sg.findGapCursorFrom,j.jsonID(`gapcursor`,sg);var cg=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return sg.valid(t)?new sg(t):j.near(t)}};function lg(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}}return!0}function ug(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}}return!0}function dg(){return new kr({props:{decorations:gg,createSelectionBetween(e,t,n){return t.pos==n.pos&&sg.valid(n)?new sg(n):null},handleClick:mg,handleKeyDown:fg,handleDOMEvents:{beforeinput:hg}}})}const fg=Ud({ArrowLeft:pg(`horiz`,-1),ArrowRight:pg(`horiz`,1),ArrowUp:pg(`vert`,-1),ArrowDown:pg(`vert`,1)});function pg(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof M){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=sg.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new sg(c))),!0):!1}}function mg(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!sg.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&N.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new sg(r))),!0)}function hg(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof sg))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=O.empty;for(let e=r.length-1;e>=0;e--)i=O.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new A(i,0,0));return a.setSelection(M.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function gg(e){if(!(e.selection instanceof sg))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,F.create(e.doc,[P.widget(e.selection.head,t,{key:`gapcursor`})])}var _g=Object.defineProperty,vg=Object.getOwnPropertyDescriptor,yg=(e,t,n,r)=>{for(var i=r>1?void 0:r?vg(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&_g(t,n,i),i},bg=class extends z{get name(){return`gapCursor`}createExternalPlugins(){return[dg()]}};bg=yg([B({})],bg),Me(sg);var xg=Object.defineProperty,Sg=Object.getOwnPropertyDescriptor,Cg=(e,t,n,r)=>{for(var i=r>1?void 0:r?Sg(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&xg(t,n,i),i},wg=class extends z{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:n,dispatch:r,view:i})=>{let{getState:a,getDispatch:o}=this.options,s=D(a)?a():n,c=D(o)&&r?o():r,l=e(s,c,i);return t?.(l),l}}get name(){return`history`}createKeymap(){return{"Mod-y":Tl.isMac?()=>!1:this.wrapMethod(Wh,this.options.onRedo),"Mod-z":this.wrapMethod(Uh,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Wh,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(Uh,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Wh,this.options.onRedo)(e)}createExternalPlugins(){let{depth:e,newGroupDelay:t}=this.options;return[Vh({depth:e,newGroupDelay:t})]}undo(){return wl(this.wrapMethod(Uh,this.options.onUndo))}redo(){return wl(this.wrapMethod(Wh,this.options.onRedo))}undoDepth(e=this.store.getState()){return Gh(e)}redoDepth(e=this.store.getState()){return Kh(e)}};Cg([kf({shortcut:C.Undo,command:`undo`})],wg.prototype,`undoShortcut`,1),Cg([kf({shortcut:C.Redo,command:`redo`})],wg.prototype,`redoShortcut`,1),Cg([H({disableChaining:!0,description:({t:e})=>e(ei.UNDO_DESCRIPTION),label:({t:e})=>e(ei.UNDO_LABEL),icon:`arrowGoBackFill`})],wg.prototype,`undo`,1),Cg([H({disableChaining:!0,description:({t:e})=>e(ei.REDO_DESCRIPTION),label:({t:e})=>e(ei.REDO_LABEL),icon:`arrowGoForwardFill`})],wg.prototype,`redo`,1),Cg([V()],wg.prototype,`undoDepth`,1),Cg([V()],wg.prototype,`redoDepth`,1),wg=Cg([B({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:[`depth`,`newGroupDelay`],handlerKeys:[`onUndo`,`onRedo`]})],wg);var Tg=Object.defineProperty,Eg=Object.getOwnPropertyDescriptor,Dg=(e,t,n,r)=>{for(var i=r>1?void 0:r?Eg(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Tg(t,n,i),i},Og={icon:`italic`,label:({t:e})=>e(ri.LABEL),description:({t:e})=>e(ri.DESCRIPTION)},kg=class extends bf{get name(){return`italic`}createTags(){return[S.FontStyle,S.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:`i`,getAttrs:e.parse},{tag:`em`,getAttrs:e.parse},{style:`font-style=italic`},...t.parseDOM??[]],toDOM:t=>[`em`,e.dom(t),0]}}createKeymap(){return{"Mod-i":jf({type:this.type})}}createInputRules(){return[Ju({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith(`*`)?{}:{fullMatch:e.slice(1),start:t+1}}),Ju({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith(`_`)?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:`mark`,markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:`mark`,markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return jf({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};Dg([H(Og)],kg.prototype,`toggleItalic`,1),Dg([kf({shortcut:C.Italic,command:`toggleItalic`})],kg.prototype,`shortcut`,1),kg=Dg([B({})],kg);function Ag(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return jg(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function jg(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new ct(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new ct(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=kn(a,n,r,t);return s?(e&&Mg(e,t,s,i,n),!0):!1}function Mg(e,t,n,r,i){let a=O.empty;for(let e=n.length-1;e>=0;e--)a=O.from(n[e].type.create(n[e].attrs,a));e.step(new xn(t.start-(r?2:0),t.end,t.start,t.end,new A(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&zn(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Ng(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Pg(t,n,e,a):Fg(t,n,a):!0:!1}}function Pg(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new xn(a-1,o,a,o,new A(O.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ct(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Dn(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Vn(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Fg(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+(s?0:1),u+1,o.content.append(c?O.empty:O.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new xn(d-(s?1:0),f+(c?1:0),d+1,f-1,new A((s?O.empty:O.from(i.copy(O.empty))).append(c?O.empty:O.from(i.copy(O.empty))),s?0:1,c?0:1),s?0:1)),t(r.scrollIntoView()),!0}var Ig=Object.defineProperty,Lg=Object.getOwnPropertyDescriptor,Rg=(e,t,n,r)=>{for(var i=r>1?void 0:r?Lg(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Ig(t,n,i),i};function zg(e){return!!e.spec.group?.includes(S.ListContainerNode)}function Bg(e){return!!e.spec.group?.includes(S.ListItemNode)}function Vg(e){return zg(e.type)}function Hg(e){return Bg(e.type)}function Ug(e,t){return n=>{let{dispatch:r,tr:i}=n,a=Sl(i,n.state),{$from:o,$to:s}=i.selection,c=o.blockRange(s);if(!c)return!1;let l=Al({predicate:e=>zg(e.type),selection:i.selection});if(l&&c.depth-l.depth<=1&&c.startIndex===0){if(l.node.type===e)return Xg(t)(n);if(zg(l.node.type))return e.validContent(l.node.content)?(r?.(i.setNodeMarkup(l.pos,e)),!0):Gg(i,l,e,t)?(r?.(i.scrollIntoView()),!0):!1}return Ag(e)(a,r)}}function Wg(e,t=[`checked`]){return function({tr:n,dispatch:r,state:i}){let a=Gl(e,i.schema),{$from:o,$to:s}=n.selection;if(nu(n.selection)&&n.selection.node.isBlock||o.depth<2||!o.sameParent(s))return!1;let c=o.node(-1);if(c.type!==a)return!1;if(o.parent.content.size===0&&o.node(-1).childCount===o.indexAfter(-1)){if(o.depth===2||o.node(-3).type!==a||o.index(-2)!==o.node(-2).childCount-1)return!1;if(r){let e=o.index(-1)>0,t=O.empty;for(let n=o.depth-(e?1:2);n>=o.depth-3;n--)t=O.from(o.node(n).copy(t));let i=a.contentMatch.defaultType?.createAndFill()||void 0;t=t.append(O.from(a.createAndFill(null,i)||void 0));let s=o.indexAfter(-1)<o.node(-2).childCount?1:o.indexAfter(-2)<o.node(-3).childCount?2:3;n.replace(o.before(e?void 0:-1),o.after(-s),new A(t,e?3:2,2)),n.setSelection(n.selection.constructor.near(n.doc.resolve(o.pos+(e?3:2)))),r(n.scrollIntoView())}return!0}if(c.attrs.closed&&o.sameParent(s)&&s.pos===s.end()){if(r){let e=o.after(-1),t=a.contentMatch.defaultType?.createAndFill()||void 0,i=a.createAndFill(null,t);i&&(n.insert(e,i),n.setSelection(M.near(n.doc.resolve(e+1)))),n.delete(o.pos,s.pos),r(n.scrollIntoView())}return!0}let l=Object.fromEntries(Object.entries(c.attrs).filter(([e])=>!t.includes(e))),u=s.pos===o.end()?c.contentMatchAt(0).defaultType:null,d={...o.node().attrs};n.delete(o.pos,s.pos);let f=u?[{type:a,attrs:l},{type:u,attrs:d}]:[{type:a,attrs:l}];return zn(n.doc,o.pos,2)?(r&&r(n.split(o.pos,2,f).scrollIntoView()),!0):!1}}function Gg(e,t,n,r){let i=t.node,a=e.doc.resolve(t.start),o=a.node(-1),s=a.index(-1);if(!o||!o.canReplace(s,s+1,O.from(n.create())))return!1;let c=[];for(let e=0;e<i.childCount;e++){let t=i.child(e);if(!r.validContent(t.content))return!1;let n=r.createChecked(null,t.content);c.push(n)}let l=n.createChecked(null,c),u=t.pos,d=u+i.nodeSize,f=e.selection.from;return e.replaceRangeWith(u,d,l),e.setSelection(e.selection.constructor.near(e.doc.resolve(f))),!0}function Kg({listType:e,itemType:t,tr:n,range:r}){let i=r.parent,a=n.doc.slice(r.start,r.end);if(i.type===e&&a.content.firstChild?.type===t)return!1;let o=[];for(let e=0;e<a.content.childCount;e++){let n=a.content.child(e);if(!t.validContent(n.content))return!1;let r=t.createChecked(null,n.content);o.push(r)}let s=e.createChecked(null,o);return n.replaceRange(r.start,r.end,new A(O.from(s),0,0)),!0}function qg({listType:e,itemType:t,tr:n}){let r=Qg(n.selection);if(!r)return!1;let i=r.startIndex===0,{from:a,to:o}=n.selection;return Kg({listType:e,itemType:t,tr:n,range:r})?(n.setSelection(M.between(n.doc.resolve(i?a:a+2),n.doc.resolve(i?o:o+2))),n.scrollIntoView(),!0):!1}function Jg(e,t,n){let r=e.tr,i=n.parent,a=r.mapping.maps.length;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(!s||r.mapping.slice(a).map(n.end)!==n.start+s.nodeSize)return!1;let c=n.startIndex===0,l=n.endIndex===i.childCount,u=o.node(-1),d=o.index(-1);if(!u.canReplace(d+(c?0:1),d+1,s.content.append(l?O.empty:O.from(i))))return!1;let f=o.pos,p=f+s.nodeSize;return r.step(new xn(f-(c?1:0),p+(l?1:0),f+1,p-1,new A((c?O.empty:O.from(i.copy(O.empty))).append(l?O.empty:O.from(i.copy(O.empty))),c?0:1,l?0:1),c?0:1)),t(r.scrollIntoView()),!0}function Yg(e,t){let n=t||e.selection.$from,r=[],i,a,o,s;for(let e=n.depth;e>=0;e--){if(a=n.node(e),i=n.index(e),o=a.maybeChild(i-1),s=a.maybeChild(i),o&&s&&o.type.name===s.type.name&&Vg(o)){let t=n.before(e+1);r.push(t)}if(i=n.indexAfter(e),o=a.maybeChild(i-1),s=a.maybeChild(i),o&&s&&o.type.name===s.type.name&&Vg(o)){let t=n.after(e+1);r.push(t)}}r=[...new Set(r)].sort((e,t)=>t-e);let c=!1;for(let t of r)Vn(e.doc,t)&&(e.join(t),c=!0);return c}function Xg(e){return t=>{let{dispatch:n,tr:r}=t,i=Sl(r,t.state),a=Zg(e,r.selection);return a?(n&&Jg(i,n,a),!0):!1}}function Zg(e,t){let{$from:n,$to:r}=t,i=n.blockRange(r,t=>t.firstChild?.type===e);return i}function Qg(e){let{$from:t,$to:n}=e;return t.blockRange(n,Vg)}function $g(e){let t=e.selection.$from,n=t.blockRange();if(!n||!Hg(n.parent)||n.startIndex!==0)return!1;let r=t.node(n.depth-2),i=t.index(n.depth),a=t.index(n.depth-1),o=t.index(n.depth-2),s=r.maybeChild(o-1),c=s?.lastChild;if(i!==0||a!==0)return!1;if(s&&Vg(s)&&c&&Hg(c))return qg({listType:s.type,itemType:c.type,tr:e});if(Hg(r)){let i=r,a=t.node(n.depth-3);if(Vg(a))return qg({listType:a.type,itemType:i.type,tr:e})}return!1}function e_({view:e}){if(!e)return!1;{let t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;let n=t.blockRange();if(!n||!Hg(n.parent)||n.startIndex!==0)return!1}{let t=e.state.tr;$g(t)&&e.dispatch(t)}{let t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;let n=t.blockRange();if(!n||!Hg(n.parent)||n.startIndex!==0)return!1;let r=t.index(n.depth),i=t.index(n.depth-1),a=t.index(n.depth-2),o=n.depth-2>=1&&Hg(t.node(n.depth-2));r===0&&i===0&&a<=1&&o&&Ng(n.parent.type)(e.state,e.dispatch)}return ed(e.state,e.dispatch,e),!0}function t_({node:e,mark:t,updateDOM:n,updateMark:r}){let i=document.createElement(`label`);i.contentEditable=`false`,i.classList.add(ym.LIST_ITEM_MARKER_CONTAINER),i.append(t);let a=document.createElement(`div`),o=document.createElement(`li`);o.classList.add(ym.LIST_ITEM_WITH_CUSTOM_MARKER),o.append(i),o.append(a);let s=i=>i.type===e.type?(e=i,n(e,o),r(e,t),!0):!1;return s(e),{dom:o,contentDOM:a,update:s}}function n_(e,t){let n=e.node(t.depth-1),r=e.node(t.depth-2);return!Hg(n)||!Vg(r)?!1:{parentItem:n,parentList:r}}function r_(e,t){let n=t.parent,r=t.parent.child(t.endIndex-1),i=t.end,a=t.$to.end(t.depth);return i<a?(e.step(new xn(i-1,a,i,a,new A(O.from(r.type.create(null,n.copy())),1,0),1,!0)),new ct(e.doc.resolve(t.$from.pos),e.doc.resolve(a),t.depth)):t}function i_(e,t){let n=t.parent,r=t.parent.child(t.endIndex-1),i=t.end,a=t.$to.end(t.depth-1);return i+1<a?(e.step(new xn(i-1,a,i+1,a,new A(O.from(n.type.create(null,r.type.create(null))),2,0),0,!0)),new ct(e.selection.$from,e.selection.$to,t.depth)):t}function a_(e,t,n,r){let i=qg({listType:n.type,itemType:r.type,tr:e});return i?new ct(e.selection.$from,e.selection.$to,t.depth):t}function o_(e){let t=Qg(e.selection);if(!t)return!1;let n=n_(e.selection.$from,t);if(!n)return!1;let{parentItem:r,parentList:i}=n;t=r_(e,t),t=i_(e,t),t=a_(e,t,i,r);let a=Dn(t);return typeof a==`number`?(e.lift(t,a),t=Qg(e.selection),t&&Yg(e,e.doc.resolve(t.end-2)),!0):!0}var s_=({tr:e,dispatch:t})=>o_(e)?(t?.(e.scrollIntoView()),!0):!1;function c_(e,t,n){let r,i,a,o,s=t.doc;if(n.startIndex>=1){r=e.child(n.startIndex-1),i=e,o=s.resolve(n.start).start(n.depth),a=o+1;for(let e=0;e<n.startIndex-1;e++)a+=i.child(e).nodeSize}else{let e=t.index(n.depth-1);if(e>=1){let s=t.node(n.depth-1),c=t.start(n.depth-1);if(i=s.child(e-1),!Vg(i))return!1;o=c+1;for(let t=0;t<e-1;t++)o+=s.child(t).nodeSize;if(r=i.child(i.childCount-1),a=o+i.nodeSize-r.nodeSize-1,!Hg(r))return!1}else return!1}return{previousItem:r,previousList:i,previousItemStart:a,previousListStart:o}}function l_(e,t,n){let r,i,a=n.start,o=t.depth>=n.depth+2?t.end(n.depth+2):n.end-1,s=n.end;return o+1>=s?(r=e.slice(a,s),i=null):(r=e.slice(a,o),i=e.slice(o+1,s-1)),{selectedSlice:r,unselectedSlice:i}}function u_(e){let{$from:t,$to:n}=e.selection,r=Qg(e.selection);if(!r)return!1;let i=e.doc.resolve(r.start).node();if(!Vg(i))return!1;let a=c_(i,t,r);if(!a)return!1;let{previousItem:o,previousList:s,previousItemStart:c}=a,{selectedSlice:l,unselectedSlice:u}=l_(e.doc,n,r),d=o.content.append(O.fromArray([i.copy(l.content)])).append(u?u.content:O.empty);e.deleteRange(r.start,r.end);let f=c+o.nodeSize-2,p=o.copy(d);return p.check(),e.replaceRangeWith(c-1,f+1,p),e.setSelection(s===i?M.between(e.doc.resolve(t.pos),e.doc.resolve(n.pos)):M.between(e.doc.resolve(t.pos-2),e.doc.resolve(n.pos-2))),!0}var d_=({tr:e,dispatch:t})=>u_(e)?(t?.(e.scrollIntoView()),!0):!1,f_=class extends z{get name(){return`listItemShared`}createKeymap(){let e={Tab:d_,"Shift-Tab":s_,Backspace:e_,"Mod-Backspace":e_};if(Tl.isMac){let t={"Ctrl-h":e.Backspace,"Alt-Backspace":e[`Mod-Backspace`]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,n)=>{let r=n.tr,i=Yg(r);return i?r:null}}}},p_=class extends xf{get name(){return`listItem`}createTags(){return[S.ListItemNode]}createNodeSpec(e,t){return{content:`paragraph block*`,defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:`li`,getAttrs:e.parse,priority:x.Lowest},...t.parseDOM??[]],toDOM:t=>{let n=e.dom(t);return[`li`,n,0]}}}createNodeViews(){return this.options.enableCollapsible?(e,t,n)=>{let r=document.createElement(`div`);return r.classList.add(ym.COLLAPSIBLE_LIST_ITEM_BUTTON),r.contentEditable=`false`,r.addEventListener(`click`,()=>{if(r.classList.contains(`disabled`))return;let e=n(),i=N.create(t.state.doc,e);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),t_({mark:r,node:e,updateDOM:m_,updateMark:h_})}:{}}createKeymap(){return{Enter:Wg(this.type)}}createExtensions(){return[new f_]}toggleListItemClosed(e){return({state:{tr:t,selection:n},dispatch:r})=>{if(!nu(n)||n.node.type.name!==this.name)return!1;let{node:i,from:a}=n;return e=ke(e)?e:!i.attrs.closed,r?.(t.setNodeMarkup(a,void 0,{...i.attrs,closed:e})),!0}}liftListItemOutOfList(e){return Xg(e??this.type)}};Rg([H()],p_.prototype,`toggleListItemClosed`,1),Rg([H()],p_.prototype,`liftListItemOutOfList`,1),p_=Rg([B({defaultOptions:{enableCollapsible:!1},staticKeys:[`enableCollapsible`]})],p_);function m_(e,t){e.attrs.closed?t.classList.add(ym.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(ym.COLLAPSIBLE_LIST_ITEM_CLOSED)}function h_(e,t){e.childCount<=1?t.classList.add(`disabled`):t.classList.remove(`disabled`)}var g_=class extends xf{get name(){return`bulletList`}createTags(){return[S.Block,S.ListContainerNode]}createNodeSpec(e,t){return{content:`listItem+`,...t,attrs:e.defaults(),parseDOM:[{tag:`ul`,getAttrs:e.parse},...t.parseDOM??[]],toDOM:t=>[`ul`,e.dom(t),0]}}createNodeViews(){return this.options.enableSpine?(e,t,n)=>{let r=document.createElement(`div`);r.style.position=`relative`;let i=n(),a=t.state.doc.resolve(i+1),o=a.node(a.depth-1),s=o?.type?.name!==`listItem`;if(!s){let e=document.createElement(`div`);e.contentEditable=`false`,e.classList.add(ym.LIST_SPINE),e.addEventListener(`click`,e=>{let r=n(),i=t.state.doc.resolve(r+1),a=i.start(i.depth-1),o=N.create(t.state.doc,a-1);t.dispatch(t.state.tr.setSelection(o)),this.store.commands.toggleListItemClosed(),e.preventDefault(),e.stopPropagation()}),r.append(e)}let c=document.createElement(`ul`);return c.classList.add(ym.UL_LIST_CONTENT),r.append(c),{dom:r,contentDOM:c}}:{}}createExtensions(){return[new p_({priority:x.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Ug(this.type,w(this.store.schema.nodes,`listItem`))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){let e=/^\s*([*+-])\s$/;return[vi(e,this.type),new pi(e,(e,t,n,r)=>{let i=e.tr;i.deleteRange(n,r);let a=qg({listType:this.type,itemType:w(this.store.schema.nodes,`listItem`),tr:i});return a?i:null})]}};Rg([H({icon:`listUnordered`,label:({t:e})=>e(si.BULLET_LIST_LABEL)})],g_.prototype,`toggleBulletList`,1),Rg([kf({shortcut:C.BulletList,command:`toggleBulletList`})],g_.prototype,`listShortcut`,1),g_=Rg([B({defaultOptions:{enableSpine:!1},staticKeys:[`enableSpine`]})],g_);var __=class extends xf{get name(){return`orderedList`}createTags(){return[S.Block,S.ListContainerNode]}createNodeSpec(e,t){return{content:`listItem+`,...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:`ol`,getAttrs:t=>Ol(t)?{...e.parse(t),order:+(t.getAttribute(`start`)??1)}:{}},...t.parseDOM??[]],toDOM:t=>{let n=e.dom(t);return t.attrs.order===1?[`ol`,n,0]:[`ol`,{...n,start:t.attrs.order},0]}}}createExtensions(){return[new p_({priority:x.Low})]}toggleOrderedList(){return Ug(this.type,w(this.store.schema.nodes,`listItem`))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){let e=/^(\d+)\.\s$/;return[vi(e,this.type,e=>({order:+w(e,1)}),(e,t)=>t.childCount+t.attrs.order===+w(e,1)),new pi(e,(e,t,n,r)=>{let i=e.tr;i.deleteRange(n,r);let a=qg({listType:this.type,itemType:w(this.store.schema.nodes,`listItem`),tr:i});if(!a)return null;let o=+w(t,1);if(o!==1){let e=Ml({selection:i.selection,types:this.type});e&&i.setNodeMarkup(e.pos,void 0,{order:o})}return i})]}};Rg([H({icon:`listOrdered`,label:({t:e})=>e(si.ORDERED_LIST_LABEL)})],__.prototype,`toggleOrderedList`,1),Rg([kf({shortcut:C.OrderedList,command:`toggleOrderedList`})],__.prototype,`listShortcut`,1),__=Rg([B({})],__);var v_=class extends xf{get name(){return`taskListItem`}createTags(){return[S.ListItemNode]}createNodeSpec(e,t){return{content:`paragraph block*`,defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:`li[data-task-list-item]`,getAttrs:t=>{let n=!1;return Ol(t)&&t.getAttribute(`data-checked`)!==null&&(n=!0),{checked:n,...e.parse(t)}},priority:x.Medium},...t.parseDOM??[]],toDOM:t=>[`li`,{...e.dom(t),"data-task-list-item":``,"data-checked":t.attrs.checked?``:void 0},0]}}createNodeViews(){return(e,t,n)=>{let r=document.createElement(`input`);return r.type=`checkbox`,r.classList.add(ym.LIST_ITEM_CHECKBOX),r.contentEditable=`false`,r.addEventListener(`click`,e=>{t.editable||e.preventDefault()}),r.addEventListener(`change`,()=>{let e=n(),r=t.state.doc.resolve(e+1);this.store.commands.toggleCheckboxChecked({$pos:r})}),r.checked=e.attrs.checked,t_({node:e,mark:r,updateDOM:y_,updateMark:b_})}}createKeymap(){return{Enter:Wg(this.type)}}createExtensions(){return[new f_]}toggleCheckboxChecked(e){let t,n;return typeof e==`boolean`?t=e:e&&(t=e.checked,n=e.$pos),({tr:e,dispatch:r})=>{let i=Ml({selection:n??e.selection.$from,types:this.type});if(!i)return!1;let{node:a,pos:o}=i,s={...a.attrs,checked:t??!a.attrs.checked};return r?.(e.setNodeMarkup(o,void 0,s)),!0}}createInputRules(){let e=/^\s*(\[( ?|x|X)]\s)$/;return[vi(e,this.type,e=>({checked:[`x`,`X`].includes(mu(e,2))})),new pi(e,(e,t,n,r)=>{let i=e.tr;i.deleteRange(n,r);let a=qg({listType:w(this.store.schema.nodes,`taskList`),itemType:this.type,tr:i});if(!a)return null;let o=[`x`,`X`].includes(mu(t,2));if(o){let e=Ml({selection:i.selection,types:this.type});e&&i.setNodeMarkup(e.pos,void 0,{checked:o})}return i})]}};Rg([H()],v_.prototype,`toggleCheckboxChecked`,1);function y_(e,t){e.attrs.checked?t.setAttribute(`data-checked`,``):t.removeAttribute(`data-checked`),t.setAttribute(`data-task-list-item`,``)}function b_(e,t){t.checked=!!e.attrs.checked}var x_=class extends xf{get name(){return`taskList`}createTags(){return[S.Block,S.ListContainerNode]}createNodeSpec(e,t){return{content:`taskListItem+`,...t,attrs:e.defaults(),parseDOM:[{tag:`ul[data-task-list]`,getAttrs:e.parse,priority:x.Medium},...t.parseDOM??[]],toDOM:t=>[`ul`,{...e.dom(t),"data-task-list":``},0]}}createExtensions(){return[new v_({})]}toggleTaskList(){return Ug(this.type,w(this.store.schema.nodes,`taskListItem`))}listShortcut(e){return this.toggleTaskList()(e)}};Rg([H({icon:`checkboxMultipleLine`,label:({t:e})=>e(si.TASK_LIST_LABEL)})],x_.prototype,`toggleTaskList`,1),Rg([kf({shortcut:C.TaskList,command:`toggleTaskList`})],x_.prototype,`listShortcut`,1);function S_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}function C_(e,t){return Array(t+1).join(e)}function w_(e){return e.replace(/^\n*/,``)}function T_(e){for(var t=e.length;t>0&&e[t-1]===`
25
25
  `;)t--;return e.substring(0,t)}var E_=`ADDRESS.ARTICLE.ASIDE.AUDIO.BLOCKQUOTE.BODY.CANVAS.CENTER.DD.DIR.DIV.DL.DT.FIELDSET.FIGCAPTION.FIGURE.FOOTER.FORM.FRAMESET.H1.H2.H3.H4.H5.H6.HEADER.HGROUP.HR.HTML.ISINDEX.LI.MAIN.MENU.NAV.NOFRAMES.NOSCRIPT.OL.OUTPUT.P.PRE.SECTION.TABLE.TBODY.TD.TFOOT.TH.THEAD.TR.UL`.split(`.`);function D_(e){return P_(e,E_)}var O_=[`AREA`,`BASE`,`BR`,`COL`,`COMMAND`,`EMBED`,`HR`,`IMG`,`INPUT`,`KEYGEN`,`LINK`,`META`,`PARAM`,`SOURCE`,`TRACK`,`WBR`];function k_(e){return P_(e,O_)}function A_(e){return F_(e,O_)}var j_=[`A`,`TABLE`,`THEAD`,`TBODY`,`TFOOT`,`TH`,`TD`,`IFRAME`,`SCRIPT`,`AUDIO`,`VIDEO`];function M_(e){return P_(e,j_)}function N_(e){return F_(e,j_)}function P_(e,t){return t.indexOf(e.nodeName)>=0}function F_(e,t){return e.getElementsByTagName&&t.some(function(t){return e.getElementsByTagName(t).length})}var I_={};I_.paragraph={filter:`p`,replacement:function(e){return`
26
26