@vc-shell/framework 1.1.46 → 1.1.48

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 (360) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/core/plugins/modularity/loader.ts +126 -97
  3. package/dist/assets/042c75b764bc78a7.svg +1 -0
  4. package/dist/assets/0ba156439a339f2a.svg +1 -0
  5. package/dist/assets/0be560bfb22d0e72.woff2 +0 -0
  6. package/dist/assets/0f590f8a94577092.svg +1 -0
  7. package/dist/assets/0fc5820f8be53a1b.svg +1 -0
  8. package/dist/assets/10768e2cc79fc60b.svg +1 -0
  9. package/dist/assets/11b3d25a56fd9a21.woff2 +0 -0
  10. package/dist/assets/157b8721e0600ea8.svg +1 -0
  11. package/dist/assets/15e91cdd649cde9a.svg +1 -0
  12. package/dist/assets/1a3e84b2457f709a.woff +0 -0
  13. package/dist/assets/1de63eb118636cce.svg +1 -0
  14. package/dist/assets/1ea01de36eb5491b.svg +1 -0
  15. package/dist/assets/204eaf512fde2023.svg +1 -0
  16. package/dist/assets/2088983edf42e153.svg +1 -0
  17. package/dist/assets/208f810a9321a327.svg +1 -0
  18. package/dist/assets/21220a9d10e6c558.svg +1 -0
  19. package/dist/assets/220db345a102045d.woff2 +0 -0
  20. package/dist/assets/225da11d23968333.svg +1 -0
  21. package/dist/assets/226f862dd81bdc13.woff2 +0 -0
  22. package/dist/assets/23a2d53395ddb14f.woff +0 -0
  23. package/dist/assets/259e6ad461a52ad7.svg +1 -0
  24. package/dist/assets/261e6dec4d53b9ac.woff +0 -0
  25. package/dist/assets/262f46a0b6d94bb6.svg +1 -0
  26. package/dist/assets/2857c513073467da.svg +1 -0
  27. package/dist/assets/2b3be7889467d98f.woff +0 -0
  28. package/dist/assets/2d4e6190eec72737.svg +1 -0
  29. package/dist/assets/2eba973185078bc8.woff +0 -0
  30. package/dist/assets/327511cd4a7ba7f9.woff +0 -0
  31. package/dist/assets/334d3f6bc766c516.woff +0 -0
  32. package/dist/assets/34ff7dd0c2285956.svg +1 -0
  33. package/dist/assets/3d26b7c1ab78bbe2.woff +0 -0
  34. package/dist/assets/3f8c4cc8099e34b6.woff2 +0 -0
  35. package/dist/assets/40a0e53b79ce63c6.woff2 +0 -0
  36. package/dist/assets/41275bcb979cb650.svg +1 -0
  37. package/dist/assets/42df4e2d6fa3fd2a.woff2 +0 -0
  38. package/dist/assets/434f7982590e462f.woff +0 -0
  39. package/dist/assets/4ae5f23e0ca888e7.woff2 +0 -0
  40. package/dist/assets/4d7a77b0e5373992.svg +1 -0
  41. package/dist/assets/4e43c74354534fb3.svg +1 -0
  42. package/dist/assets/4fe75f5117100705.svg +1 -0
  43. package/dist/assets/52610491f372cb0c.woff2 +0 -0
  44. package/dist/assets/52e261a005074e1b.woff +0 -0
  45. package/dist/assets/5304c3d05a5f9789.woff2 +0 -0
  46. package/dist/assets/572bb1bb4156a9c1.svg +1 -0
  47. package/dist/assets/5b3661be8be679d0.woff2 +0 -0
  48. package/dist/assets/5d96cfcc5bedd917.woff2 +0 -0
  49. package/dist/assets/6075995d7e74da46.woff2 +0 -0
  50. package/dist/assets/617c4736236e199e.woff +0 -0
  51. package/dist/assets/6619e9e10beea0e7.woff2 +0 -0
  52. package/dist/assets/67230f05dc94a265.svg +1 -0
  53. package/dist/assets/6798e4dd4add9b48.svg +1 -0
  54. package/dist/assets/698ec6c722d4cb05.woff2 +0 -0
  55. package/dist/assets/6a3e73faf406cf33.svg +1 -0
  56. package/dist/assets/72de3a63bc0b70dd.svg +1 -0
  57. package/dist/assets/74c6a6ab81bb6340.woff2 +0 -0
  58. package/dist/assets/74ed5f8a78e71106.svg +1 -0
  59. package/dist/assets/7ce0c166fd6a1204.woff +0 -0
  60. package/dist/assets/7d55399c2a7bc985.svg +1 -0
  61. package/dist/assets/7d970675c69fca1d.woff +0 -0
  62. package/dist/assets/7eda727273fd98d3.svg +1 -0
  63. package/dist/assets/7f6ebfd707b76ca2.woff +0 -0
  64. package/dist/assets/7fa898d213fcc7bc.woff2 +0 -0
  65. package/dist/assets/861e6b7192b3b6c7.woff +0 -0
  66. package/dist/assets/8bbcde81ba21ecb2.woff2 +0 -0
  67. package/dist/assets/8f6657e5e0b8d3e4.woff +0 -0
  68. package/dist/assets/910b0d99b9e26568.svg +1 -0
  69. package/dist/assets/91eee1aa81f72683.woff +0 -0
  70. package/dist/assets/92508f8707159b51.svg +1 -0
  71. package/dist/assets/9392bf1d591e1abb.svg +1 -0
  72. package/dist/assets/97e8d4984ba0713a.woff2 +0 -0
  73. package/dist/assets/9cb83236f6bb7ab1.svg +1 -0
  74. package/dist/assets/9d37314695c0b68d.woff +0 -0
  75. package/dist/assets/a18404194e3f9047.svg +1 -0
  76. package/dist/assets/a2017fe7f0a26510.svg +1 -0
  77. package/dist/assets/a47034e65dbcc3d7.woff +0 -0
  78. package/dist/assets/a617e11804bbacb7.woff +0 -0
  79. package/dist/assets/ab6e7190bb1492d5.woff2 +0 -0
  80. package/dist/assets/abf88f301a0730f4.svg +1 -0
  81. package/dist/assets/aed17cb6fdad2ada.woff2 +0 -0
  82. package/dist/assets/b1a596e31ad1185a.svg +1 -0
  83. package/dist/assets/b27767411c8427be.woff +0 -0
  84. package/dist/assets/b291dc35a17511f7.woff +0 -0
  85. package/dist/assets/b325adcae33bbe7a.svg +1 -0
  86. package/dist/assets/b372390551ca2fa1.svg +1 -0
  87. package/dist/assets/b5bb1e8fc975decd.svg +1 -0
  88. package/dist/assets/b645a4a2181b9dc1.svg +1 -0
  89. package/dist/assets/b6499ddce0a4ef7d.svg +1 -0
  90. package/dist/assets/b94421fadd23b0f2.svg +1 -0
  91. package/dist/assets/bb28fb0f27f1c11b.svg +1 -0
  92. package/dist/assets/bfbe205759295eca.woff2 +0 -0
  93. package/dist/assets/ca791c5ca5848a03.svg +1 -0
  94. package/dist/assets/cb32840ce330103f.woff +0 -0
  95. package/dist/assets/d084bda16abe8a56.svg +1 -0
  96. package/dist/assets/d32b129cae2fffd6.svg +1 -0
  97. package/dist/assets/d35a4c7113315758.woff2 +0 -0
  98. package/dist/assets/d3f792f54ae4c307.svg +1 -0
  99. package/dist/assets/d5a5b8630120073d.svg +1 -0
  100. package/dist/assets/d5f9664ebbfb104b.svg +1 -0
  101. package/dist/assets/d80b05788e407de7.woff2 +0 -0
  102. package/dist/assets/d84247b59449dd88.woff2 +0 -0
  103. package/dist/assets/dd05d43ff0df2fc7.svg +1 -0
  104. package/dist/assets/e38acaa1757232e0.svg +1 -0
  105. package/dist/assets/e4a8550f1c7ffe36.svg +1 -0
  106. package/dist/assets/e5adb5ae3a3698f6.svg +1 -0
  107. package/dist/assets/e61a1889bac955f4.woff2 +0 -0
  108. package/dist/assets/e72bb11356af94c7.svg +1 -0
  109. package/dist/assets/e98196a9f8dcb2f0.svg +1 -0
  110. package/dist/assets/ebec912a42ad49ff.woff +0 -0
  111. package/dist/assets/f09d89268e4c0317.svg +1 -0
  112. package/dist/assets/f276d55184e05a07.woff +0 -0
  113. package/dist/assets/f5722262b6e7214e.woff2 +0 -0
  114. package/dist/assets/f7fc8bf46089d8b2.svg +1 -0
  115. package/dist/assets/fcb1c1ffb5640194.woff +0 -0
  116. package/dist/assets/fe141d99763f5d2b.woff +0 -0
  117. package/dist/assets/fed13b0d59903483.svg +1 -0
  118. package/dist/assets/fed757d2c2344ead.woff2 +0 -0
  119. package/dist/assets/ffc438f20e79ce73.woff +0 -0
  120. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  121. package/dist/framework.js +16544 -25878
  122. package/dist/index.css +1 -1
  123. package/dist/index.d.ts +5 -8
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/tsconfig.tsbuildinfo +1 -1
  126. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  127. package/dist/vendor-boolbase-Bgn9I6iN.js +21 -0
  128. package/dist/vendor-cheerio-CleDsuQZ.js +1053 -0
  129. package/dist/vendor-cheerio-select-CVkYl3Z-.js +191 -0
  130. package/dist/vendor-css-select-CtIzVIiG.js +622 -0
  131. package/dist/vendor-css-what-CZZaquJM.js +267 -0
  132. package/dist/vendor-cypress-signalr-mock-CdKwIhWw.js +769 -0
  133. package/dist/vendor-date-fns-CdFbeoHV.js +2989 -0
  134. package/dist/vendor-dom-serializer-CugO0RdN.js +213 -0
  135. package/dist/vendor-dom7-wvIUV9pT.js +529 -0
  136. package/dist/vendor-domelementtype-B3sFIGaC.js +21 -0
  137. package/dist/vendor-domhandler-CL40eeX9.js +311 -0
  138. package/dist/vendor-dompurify-eYFoHPwR.js +528 -0
  139. package/dist/vendor-domutils-D3Y2YQFR.js +386 -0
  140. package/dist/vendor-entities-v26HW8wW.js +363 -0
  141. package/dist/vendor-floating-ui-core-C9uEvi1M.js +349 -0
  142. package/dist/vendor-floating-ui-dom-CZkYGmv4.js +393 -0
  143. package/dist/vendor-floating-ui-utils-Bx3BTd6_.js +259 -0
  144. package/dist/vendor-floating-ui-vue-CLOiVYP7.js +107 -0
  145. package/dist/vendor-headlessui-vue-Dg0Llidi.js +961 -0
  146. package/dist/vendor-htmlparser2-CXL_uhMI.js +735 -0
  147. package/dist/vendor-iconify-vue-D4fihzvl.js +1205 -0
  148. package/dist/vendor-intlify-core-base-Bvt2vJFV.js +1129 -0
  149. package/dist/vendor-intlify-message-compiler-1VxNzq21.js +945 -0
  150. package/dist/vendor-intlify-shared-D7kiPMOG.js +130 -0
  151. package/dist/vendor-iso-639-1-dVGfSUIM.js +781 -0
  152. package/dist/vendor-linkify-it-LzoUhj6C.js +199 -0
  153. package/dist/vendor-linkifyjs-DTu7SY_Y.js +705 -0
  154. package/dist/vendor-lodash-es-CrYlgAi8.js +4816 -0
  155. package/dist/vendor-markdown-it-4AJoRTAg.js +2263 -0
  156. package/dist/vendor-markdown-it-task-lists-Byg1-ms9.js +69 -0
  157. package/dist/vendor-mdurl-DZFDNdqC.js +192 -0
  158. package/dist/vendor-microsoft-applicationinsights-analytics-js-DA-ctcAL.js +1105 -0
  159. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-COfRj-2q.js +261 -0
  160. package/dist/vendor-microsoft-applicationinsights-channel-js-MTPYhH-I.js +1809 -0
  161. package/dist/vendor-microsoft-applicationinsights-common-CDVnJ6MR.js +1921 -0
  162. package/dist/vendor-microsoft-applicationinsights-core-js-D7Aicf8S.js +4127 -0
  163. package/dist/vendor-microsoft-applicationinsights-dependencies-js-CvQWWraU.js +1399 -0
  164. package/dist/vendor-microsoft-applicationinsights-properties-js-C0Iv1cZE.js +572 -0
  165. package/dist/vendor-microsoft-applicationinsights-shims-CxtPYiwp.js +43 -0
  166. package/dist/vendor-microsoft-applicationinsights-web-BRuQAzjU.js +487 -0
  167. package/dist/vendor-microsoft-dynamicproto-js-DSkQkH3T.js +147 -0
  168. package/dist/vendor-microsoft-signalr-qIrag5xx.js +1761 -0
  169. package/dist/vendor-moment-CwOqp704.js +2589 -0
  170. package/dist/vendor-nevware21-ts-async-FAyg3c9V.js +260 -0
  171. package/dist/vendor-nevware21-ts-utils-Dy41wRhA.js +853 -0
  172. package/dist/vendor-nth-check-BE7AeBMg.js +45 -0
  173. package/dist/vendor-orderedmap-B3SOk52B.js +103 -0
  174. package/dist/vendor-parse5-DqztJOGh.js +5747 -0
  175. package/dist/vendor-parse5-htmlparser2-tree-adapter-CNubfdOP.js +143 -0
  176. package/dist/vendor-popperjs-core-LGjf7Wza.js +905 -0
  177. package/dist/vendor-prettier-D8C9GG-0.js +4858 -0
  178. package/dist/vendor-prosemirror-commands-BqYcdumy.js +344 -0
  179. package/dist/vendor-prosemirror-dropcursor-zknUsW5x.js +86 -0
  180. package/dist/vendor-prosemirror-gapcursor-DjOZhP78.js +200 -0
  181. package/dist/vendor-prosemirror-history-l8l3CFac.js +248 -0
  182. package/dist/vendor-prosemirror-keymap-C17r08p-.js +62 -0
  183. package/dist/vendor-prosemirror-markdown-WJEDhc-w.js +650 -0
  184. package/dist/vendor-prosemirror-model-BN5TnJD_.js +2736 -0
  185. package/dist/vendor-prosemirror-schema-list-CR0gi7aY.js +87 -0
  186. package/dist/vendor-prosemirror-state-B0bFP8WI.js +821 -0
  187. package/dist/vendor-prosemirror-tables-B1txTKlC.js +1711 -0
  188. package/dist/vendor-prosemirror-transform-Bo7kNPme.js +1507 -0
  189. package/dist/vendor-prosemirror-view--C7TZvmQ.js +3746 -0
  190. package/dist/vendor-punycode-js-CNI-zL6U.js +133 -0
  191. package/dist/vendor-rope-sequence-sEGCUMi8.js +100 -0
  192. package/dist/vendor-semver-BoKYtkQw.js +1021 -0
  193. package/dist/vendor-ssr-window-D4k3p53c.js +133 -0
  194. package/dist/vendor-swiper-CMVLTGu0.js +2825 -0
  195. package/dist/vendor-tippy-js-BGdgwGX-.js +812 -0
  196. package/dist/vendor-tiptap-core-BRY37Sb2.js +2806 -0
  197. package/dist/vendor-tiptap-extension-blockquote-CPd5qv-9.js +43 -0
  198. package/dist/vendor-tiptap-extension-bold-B0GwBNks.js +71 -0
  199. package/dist/vendor-tiptap-extension-bubble-menu-B0sZZld7.js +128 -0
  200. package/dist/vendor-tiptap-extension-bullet-list-CQm4ReOu.js +53 -0
  201. package/dist/vendor-tiptap-extension-code-C8cy6bRj.js +51 -0
  202. package/dist/vendor-tiptap-extension-code-block-BqTchNEf.js +133 -0
  203. package/dist/vendor-tiptap-extension-document-Dka1Uu0g.js +9 -0
  204. package/dist/vendor-tiptap-extension-dropcursor-CFSh-BuE.js +20 -0
  205. package/dist/vendor-tiptap-extension-floating-menu-H8PB4zeI.js +99 -0
  206. package/dist/vendor-tiptap-extension-gapcursor-CzwfD_IT.js +24 -0
  207. package/dist/vendor-tiptap-extension-hard-break-Rm6aVcrK.js +55 -0
  208. package/dist/vendor-tiptap-extension-heading-CavI6u1v.js +54 -0
  209. package/dist/vendor-tiptap-extension-history-WEN1_74D.js +35 -0
  210. package/dist/vendor-tiptap-extension-horizontal-rule-DZkUEL6s.js +58 -0
  211. package/dist/vendor-tiptap-extension-image-B67_mxGM.js +64 -0
  212. package/dist/vendor-tiptap-extension-italic-BshxBFou.js +70 -0
  213. package/dist/vendor-tiptap-extension-link-CJAQIgui.js +262 -0
  214. package/dist/vendor-tiptap-extension-list-item-DF-iMpqO.js +33 -0
  215. package/dist/vendor-tiptap-extension-ordered-list-CN8MF-kN.js +71 -0
  216. package/dist/vendor-tiptap-extension-paragraph-DI577lM5.js +33 -0
  217. package/dist/vendor-tiptap-extension-placeholder-DwAtlfAF.js +52 -0
  218. package/dist/vendor-tiptap-extension-strike-CIty09KN.js +61 -0
  219. package/dist/vendor-tiptap-extension-table-C5nv-GUb.js +213 -0
  220. package/dist/vendor-tiptap-extension-table-cell-DXbBhJW3.js +40 -0
  221. package/dist/vendor-tiptap-extension-table-header-rtggsYXA.js +40 -0
  222. package/dist/vendor-tiptap-extension-table-row-67khjMDt.js +22 -0
  223. package/dist/vendor-tiptap-extension-text-D1OHb_a1.js +8 -0
  224. package/dist/vendor-tiptap-extension-underline-IqWixw3m.js +40 -0
  225. package/dist/vendor-tiptap-markdown-DVxB1hbO.js +825 -0
  226. package/dist/vendor-tiptap-starter-kit-CPH9gu2X.js +29 -0
  227. package/dist/vendor-tiptap-vue-3-CkBe4_xM.js +225 -0
  228. package/dist/vendor-truncate-html-Bx1HJzRq.js +145 -0
  229. package/dist/vendor-uc-micro-4lbSaZOs.js +17 -0
  230. package/dist/vendor-vee-validate-i18n-zT8NxX3R.js +93 -0
  231. package/dist/vendor-vee-validate-rules-DDeNM2Gc.js +314 -0
  232. package/dist/vendor-vue-currency-input-DxWnS-HB.js +315 -0
  233. package/dist/vendor-vue-devtools-api-aVYGocXp.js +93 -0
  234. package/dist/vendor-vue-i18n-DPtOLen3.js +1359 -0
  235. package/dist/vendor-vue3-application-insights-dAGGfA_M.js +69 -0
  236. package/dist/vendor-vue3-touch-events-8Pa3HHlV.js +169 -0
  237. package/dist/vendor-vuepic-vue-datepicker-DglsiNYa.js +4997 -0
  238. package/dist/vendor-vueuse-components-DtK_mxpP.js +219 -0
  239. package/dist/vendor-vueuse-core-cB-c7DzH.js +5129 -0
  240. package/dist/vendor-vueuse-shared-Dg7PMM0z.js +1169 -0
  241. package/dist/vendor-w3c-keyname-CLxH8j-f.js +92 -0
  242. package/dist/vendor-whatwg-fetch-l0sNRNKZ.js +1 -0
  243. package/package.json +5 -4
  244. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +2 -1
  245. package/dist/vendor-boolbase-Cp9L0GAZ.js +0 -25
  246. package/dist/vendor-cheerio-HN9zIPZn.js +0 -3135
  247. package/dist/vendor-cheerio-select-5Ry0HvBq.js +0 -306
  248. package/dist/vendor-css-select-DRIZ9kfZ.js +0 -966
  249. package/dist/vendor-css-what-DuPJ1HEF.js +0 -448
  250. package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +0 -778
  251. package/dist/vendor-date-fns-515YWkk-.js +0 -6724
  252. package/dist/vendor-dom-serializer-nQMsqjYW.js +0 -286
  253. package/dist/vendor-dom7-CJLPMwy5.js +0 -941
  254. package/dist/vendor-domelementtype-CjSzQey5.js +0 -53
  255. package/dist/vendor-domhandler-9z8cS16a.js +0 -484
  256. package/dist/vendor-dompurify-CRFzu7ib.js +0 -1336
  257. package/dist/vendor-domutils-Bc-Opz-v.js +0 -981
  258. package/dist/vendor-entities-Bfsx4xOQ.js +0 -636
  259. package/dist/vendor-floating-ui-core-wV8u8QP4.js +0 -511
  260. package/dist/vendor-floating-ui-dom-DDnRPs17.js +0 -706
  261. package/dist/vendor-floating-ui-utils-OMIFy1QU.js +0 -296
  262. package/dist/vendor-floating-ui-vue-D-tCDAMm.js +0 -167
  263. package/dist/vendor-fontsource-plus-jakarta-sans.css +0 -1
  264. package/dist/vendor-headlessui-vue-CY9FRgTb.js +0 -83
  265. package/dist/vendor-htmlparser2-B1dhFPOs.js +0 -1426
  266. package/dist/vendor-iconify-vue-DfRGgyNu.js +0 -1840
  267. package/dist/vendor-intlify-core-base-BuknsFQe.js +0 -1876
  268. package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +0 -1508
  269. package/dist/vendor-intlify-shared-Cz4YRMuC.js +0 -241
  270. package/dist/vendor-iso-639-1-BJCk9DvE.js +0 -819
  271. package/dist/vendor-linkify-it-CKUf4vsc.js +0 -830
  272. package/dist/vendor-linkifyjs-BfyGgbCh.js +0 -1756
  273. package/dist/vendor-lodash-es-BySUOlwf.js +0 -18333
  274. package/dist/vendor-markdown-it-D-apazHa.js +0 -6000
  275. package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +0 -131
  276. package/dist/vendor-mdurl-BNh2CCgT.js +0 -537
  277. package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +0 -1275
  278. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +0 -591
  279. package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +0 -2153
  280. package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +0 -2470
  281. package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +0 -6589
  282. package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +0 -1510
  283. package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +0 -761
  284. package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +0 -70
  285. package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +0 -667
  286. package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +0 -520
  287. package/dist/vendor-microsoft-signalr-dUnlRsGm.js +0 -3339
  288. package/dist/vendor-moment-Mki5YqAR.js +0 -5679
  289. package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +0 -395
  290. package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +0 -1160
  291. package/dist/vendor-nth-check-Bx8TxtJt.js +0 -157
  292. package/dist/vendor-orderedmap-dGG6uMFJ.js +0 -137
  293. package/dist/vendor-parse5-Bt2NhSzR.js +0 -8432
  294. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +0 -216
  295. package/dist/vendor-popperjs-core-Cr2byIky.js +0 -1790
  296. package/dist/vendor-prettier-B4PaeWRQ.js +0 -98
  297. package/dist/vendor-prosemirror-commands-BH9lWGpW.js +0 -561
  298. package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +0 -146
  299. package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +0 -236
  300. package/dist/vendor-prosemirror-history-BDaJkvNx.js +0 -414
  301. package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +0 -128
  302. package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +0 -866
  303. package/dist/vendor-prosemirror-model-BZu3WVcD.js +0 -3463
  304. package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +0 -158
  305. package/dist/vendor-prosemirror-state-BvL9Pxph.js +0 -1003
  306. package/dist/vendor-prosemirror-tables-17qAnviK.js +0 -2159
  307. package/dist/vendor-prosemirror-transform-CE9VV3qg.js +0 -2156
  308. package/dist/vendor-prosemirror-view-CU2WTHT7.js +0 -5811
  309. package/dist/vendor-punycode-js-iAs5RxMf.js +0 -441
  310. package/dist/vendor-rope-sequence-BdXDKoGt.js +0 -207
  311. package/dist/vendor-semver-CVLMK-S4.js +0 -2702
  312. package/dist/vendor-ssr-window-s6OpKa3O.js +0 -150
  313. package/dist/vendor-swiper-CdiyNHVt.js +0 -5679
  314. package/dist/vendor-tippy-js-DWFe2TfK.js +0 -1647
  315. package/dist/vendor-tiptap-core-NfwGfaQk.js +0 -4910
  316. package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +0 -57
  317. package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +0 -97
  318. package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +0 -218
  319. package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +0 -73
  320. package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +0 -221
  321. package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +0 -75
  322. package/dist/vendor-tiptap-extension-document-DssuotYs.js +0 -13
  323. package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +0 -26
  324. package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +0 -165
  325. package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +0 -30
  326. package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +0 -68
  327. package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +0 -77
  328. package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +0 -48
  329. package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +0 -92
  330. package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +0 -76
  331. package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +0 -96
  332. package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +0 -414
  333. package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +0 -37
  334. package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +0 -97
  335. package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +0 -39
  336. package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +0 -66
  337. package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +0 -79
  338. package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +0 -47
  339. package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +0 -47
  340. package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +0 -26
  341. package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +0 -354
  342. package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +0 -12
  343. package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +0 -50
  344. package/dist/vendor-tiptap-markdown-7-PCADTU.js +0 -1017
  345. package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +0 -88
  346. package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +0 -268
  347. package/dist/vendor-truncate-html-3qQY0Djo.js +0 -196
  348. package/dist/vendor-uc-micro-jjt6LQ65.js +0 -23
  349. package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +0 -154
  350. package/dist/vendor-vee-validate-rules-DzV3VY3N.js +0 -536
  351. package/dist/vendor-vue-currency-input-DGAkEFBO.js +0 -545
  352. package/dist/vendor-vue-devtools-api-DXYR8qBG.js +0 -169
  353. package/dist/vendor-vue-i18n-Co752uk3.js +0 -1897
  354. package/dist/vendor-vue3-application-insights-CYWFCr_J.js +0 -119
  355. package/dist/vendor-vue3-touch-events-BJEAiSa3.js +0 -416
  356. package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +0 -5019
  357. package/dist/vendor-vueuse-components-l1bL12mE.js +0 -339
  358. package/dist/vendor-vueuse-core-DGcJOmwG.js +0 -7743
  359. package/dist/vendor-vueuse-shared-_mOXsFuM.js +0 -1568
  360. package/dist/vendor-w3c-keyname-BOm2dtJm.js +0 -121
@@ -0,0 +1,2806 @@
1
+ import { a as j, N as G, P as $, S as D, E as qt, T as A, A as Gt } from "./vendor-prosemirror-state-B0bFP8WI.js";
2
+ import { f as Jt, a as lt, T as Yt, c as W, j as Et, l as Qt, R as Xt, b as Zt } from "./vendor-prosemirror-transform-Bo7kNPme.js";
3
+ import { E as te } from "./vendor-prosemirror-view--C7TZvmQ.js";
4
+ import { a as ee } from "./vendor-prosemirror-keymap-C17r08p-.js";
5
+ import { D as ne, F as I, S as re, a as xt, b as se, d as et } from "./vendor-prosemirror-model-BN5TnJD_.js";
6
+ import { w as oe, s as ie, l as ae } from "./vendor-prosemirror-schema-list-CR0gi7aY.js";
7
+ import { w as ce, s as gt, a as le, b as de, c as ue, d as fe, e as pe, n as he, l as me, f as ge, j as ye, g as be, h as ke, i as ve, k as we, m as Me, o as Se, p as Ee, q as xe } from "./vendor-prosemirror-commands-BqYcdumy.js";
8
+ function J(n) {
9
+ const { state: t, transaction: e } = n;
10
+ let { selection: r } = e, { doc: s } = e, { storedMarks: o } = e;
11
+ return {
12
+ ...t,
13
+ apply: t.apply.bind(t),
14
+ applyTransaction: t.applyTransaction.bind(t),
15
+ plugins: t.plugins,
16
+ schema: t.schema,
17
+ reconfigure: t.reconfigure.bind(t),
18
+ toJSON: t.toJSON.bind(t),
19
+ get storedMarks() {
20
+ return o;
21
+ },
22
+ get selection() {
23
+ return r;
24
+ },
25
+ get doc() {
26
+ return s;
27
+ },
28
+ get tr() {
29
+ return r = e.selection, s = e.doc, o = e.storedMarks, e;
30
+ }
31
+ };
32
+ }
33
+ class Y {
34
+ constructor(t) {
35
+ this.editor = t.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = t.state;
36
+ }
37
+ get hasCustomState() {
38
+ return !!this.customState;
39
+ }
40
+ get state() {
41
+ return this.customState || this.editor.state;
42
+ }
43
+ get commands() {
44
+ const { rawCommands: t, editor: e, state: r } = this, { view: s } = e, { tr: o } = r, i = this.buildProps(o);
45
+ return Object.fromEntries(Object.entries(t).map(([c, a]) => [c, (...u) => {
46
+ const d = a(...u)(i);
47
+ return !o.getMeta("preventDispatch") && !this.hasCustomState && s.dispatch(o), d;
48
+ }]));
49
+ }
50
+ get chain() {
51
+ return () => this.createChain();
52
+ }
53
+ get can() {
54
+ return () => this.createCan();
55
+ }
56
+ createChain(t, e = !0) {
57
+ const { rawCommands: r, editor: s, state: o } = this, { view: i } = s, c = [], a = !!t, l = t || o.tr, u = () => (!a && e && !l.getMeta("preventDispatch") && !this.hasCustomState && i.dispatch(l), c.every((f) => f === !0)), d = {
58
+ ...Object.fromEntries(Object.entries(r).map(([f, p]) => [f, (...h) => {
59
+ const g = this.buildProps(l, e), y = p(...h)(g);
60
+ return c.push(y), d;
61
+ }])),
62
+ run: u
63
+ };
64
+ return d;
65
+ }
66
+ createCan(t) {
67
+ const { rawCommands: e, state: r } = this, s = !1, o = t || r.tr, i = this.buildProps(o, s);
68
+ return {
69
+ ...Object.fromEntries(Object.entries(e).map(([a, l]) => [a, (...u) => l(...u)({ ...i, dispatch: void 0 })])),
70
+ chain: () => this.createChain(o, s)
71
+ };
72
+ }
73
+ buildProps(t, e = !0) {
74
+ const { rawCommands: r, editor: s, state: o } = this, { view: i } = s, c = {
75
+ tr: t,
76
+ editor: s,
77
+ view: i,
78
+ state: J({
79
+ state: o,
80
+ transaction: t
81
+ }),
82
+ dispatch: e ? () => {
83
+ } : void 0,
84
+ chain: () => this.createChain(t, e),
85
+ can: () => this.createCan(t),
86
+ get commands() {
87
+ return Object.fromEntries(Object.entries(r).map(([a, l]) => [a, (...u) => l(...u)(c)]));
88
+ }
89
+ };
90
+ return c;
91
+ }
92
+ }
93
+ class Ce {
94
+ constructor() {
95
+ this.callbacks = {};
96
+ }
97
+ on(t, e) {
98
+ return this.callbacks[t] || (this.callbacks[t] = []), this.callbacks[t].push(e), this;
99
+ }
100
+ emit(t, ...e) {
101
+ const r = this.callbacks[t];
102
+ return r && r.forEach((s) => s.apply(this, e)), this;
103
+ }
104
+ off(t, e) {
105
+ const r = this.callbacks[t];
106
+ return r && (e ? this.callbacks[t] = r.filter((s) => s !== e) : delete this.callbacks[t]), this;
107
+ }
108
+ once(t, e) {
109
+ const r = (...s) => {
110
+ this.off(t, r), e.apply(this, s);
111
+ };
112
+ return this.on(t, r);
113
+ }
114
+ removeAllListeners() {
115
+ this.callbacks = {};
116
+ }
117
+ }
118
+ function b(n, t, e) {
119
+ return n.config[t] === void 0 && n.parent ? b(n.parent, t, e) : typeof n.config[t] == "function" ? n.config[t].bind({
120
+ ...e,
121
+ parent: n.parent ? b(n.parent, t, e) : null
122
+ }) : n.config[t];
123
+ }
124
+ function Q(n) {
125
+ const t = n.filter((s) => s.type === "extension"), e = n.filter((s) => s.type === "node"), r = n.filter((s) => s.type === "mark");
126
+ return {
127
+ baseExtensions: t,
128
+ nodeExtensions: e,
129
+ markExtensions: r
130
+ };
131
+ }
132
+ function Ct(n) {
133
+ const t = [], { nodeExtensions: e, markExtensions: r } = Q(n), s = [...e, ...r], o = {
134
+ default: null,
135
+ rendered: !0,
136
+ renderHTML: null,
137
+ parseHTML: null,
138
+ keepOnSplit: !0,
139
+ isRequired: !1
140
+ };
141
+ return n.forEach((i) => {
142
+ const c = {
143
+ name: i.name,
144
+ options: i.options,
145
+ storage: i.storage,
146
+ extensions: s
147
+ }, a = b(i, "addGlobalAttributes", c);
148
+ if (!a)
149
+ return;
150
+ a().forEach((u) => {
151
+ u.types.forEach((d) => {
152
+ Object.entries(u.attributes).forEach(([f, p]) => {
153
+ t.push({
154
+ type: d,
155
+ name: f,
156
+ attribute: {
157
+ ...o,
158
+ ...p
159
+ }
160
+ });
161
+ });
162
+ });
163
+ });
164
+ }), s.forEach((i) => {
165
+ const c = {
166
+ name: i.name,
167
+ options: i.options,
168
+ storage: i.storage
169
+ }, a = b(i, "addAttributes", c);
170
+ if (!a)
171
+ return;
172
+ const l = a();
173
+ Object.entries(l).forEach(([u, d]) => {
174
+ const f = {
175
+ ...o,
176
+ ...d
177
+ };
178
+ typeof f?.default == "function" && (f.default = f.default()), f?.isRequired && f?.default === void 0 && delete f.default, t.push({
179
+ type: i.name,
180
+ name: u,
181
+ attribute: f
182
+ });
183
+ });
184
+ }), t;
185
+ }
186
+ function S(n, t) {
187
+ if (typeof n == "string") {
188
+ if (!t.nodes[n])
189
+ throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);
190
+ return t.nodes[n];
191
+ }
192
+ return n;
193
+ }
194
+ function Te(...n) {
195
+ return n.filter((t) => !!t).reduce((t, e) => {
196
+ const r = { ...t };
197
+ return Object.entries(e).forEach(([s, o]) => {
198
+ if (!r[s]) {
199
+ r[s] = o;
200
+ return;
201
+ }
202
+ if (s === "class") {
203
+ const c = o ? String(o).split(" ") : [], a = r[s] ? r[s].split(" ") : [], l = c.filter((u) => !a.includes(u));
204
+ r[s] = [...a, ...l].join(" ");
205
+ } else if (s === "style") {
206
+ const c = o ? o.split(";").map((u) => u.trim()).filter(Boolean) : [], a = r[s] ? r[s].split(";").map((u) => u.trim()).filter(Boolean) : [], l = /* @__PURE__ */ new Map();
207
+ a.forEach((u) => {
208
+ const [d, f] = u.split(":").map((p) => p.trim());
209
+ l.set(d, f);
210
+ }), c.forEach((u) => {
211
+ const [d, f] = u.split(":").map((p) => p.trim());
212
+ l.set(d, f);
213
+ }), r[s] = Array.from(l.entries()).map(([u, d]) => `${u}: ${d}`).join("; ");
214
+ } else
215
+ r[s] = o;
216
+ }), r;
217
+ }, {});
218
+ }
219
+ function ot(n, t) {
220
+ return t.filter((e) => e.type === n.type.name).filter((e) => e.attribute.rendered).map((e) => e.attribute.renderHTML ? e.attribute.renderHTML(n.attrs) || {} : {
221
+ [e.name]: n.attrs[e.name]
222
+ }).reduce((e, r) => Te(e, r), {});
223
+ }
224
+ function Tt(n) {
225
+ return typeof n == "function";
226
+ }
227
+ function k(n, t = void 0, ...e) {
228
+ return Tt(n) ? t ? n.bind(t)(...e) : n(...e) : n;
229
+ }
230
+ function Pe(n = {}) {
231
+ return Object.keys(n).length === 0 && n.constructor === Object;
232
+ }
233
+ function Ae(n) {
234
+ return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
235
+ }
236
+ function yt(n, t) {
237
+ return "style" in n ? n : {
238
+ ...n,
239
+ getAttrs: (e) => {
240
+ const r = n.getAttrs ? n.getAttrs(e) : n.attrs;
241
+ if (r === !1)
242
+ return !1;
243
+ const s = t.reduce((o, i) => {
244
+ const c = i.attribute.parseHTML ? i.attribute.parseHTML(e) : Ae(e.getAttribute(i.name));
245
+ return c == null ? o : {
246
+ ...o,
247
+ [i.name]: c
248
+ };
249
+ }, {});
250
+ return { ...r, ...s };
251
+ }
252
+ };
253
+ }
254
+ function bt(n) {
255
+ return Object.fromEntries(
256
+ // @ts-ignore
257
+ Object.entries(n).filter(([t, e]) => t === "attrs" && Pe(e) ? !1 : e != null)
258
+ );
259
+ }
260
+ function Oe(n, t) {
261
+ var e;
262
+ const r = Ct(n), { nodeExtensions: s, markExtensions: o } = Q(n), i = (e = s.find((l) => b(l, "topNode"))) === null || e === void 0 ? void 0 : e.name, c = Object.fromEntries(s.map((l) => {
263
+ const u = r.filter((y) => y.type === l.name), d = {
264
+ name: l.name,
265
+ options: l.options,
266
+ storage: l.storage,
267
+ editor: t
268
+ }, f = n.reduce((y, v) => {
269
+ const w = b(v, "extendNodeSchema", d);
270
+ return {
271
+ ...y,
272
+ ...w ? w(l) : {}
273
+ };
274
+ }, {}), p = bt({
275
+ ...f,
276
+ content: k(b(l, "content", d)),
277
+ marks: k(b(l, "marks", d)),
278
+ group: k(b(l, "group", d)),
279
+ inline: k(b(l, "inline", d)),
280
+ atom: k(b(l, "atom", d)),
281
+ selectable: k(b(l, "selectable", d)),
282
+ draggable: k(b(l, "draggable", d)),
283
+ code: k(b(l, "code", d)),
284
+ whitespace: k(b(l, "whitespace", d)),
285
+ linebreakReplacement: k(b(l, "linebreakReplacement", d)),
286
+ defining: k(b(l, "defining", d)),
287
+ isolating: k(b(l, "isolating", d)),
288
+ attrs: Object.fromEntries(u.map((y) => {
289
+ var v;
290
+ return [y.name, { default: (v = y?.attribute) === null || v === void 0 ? void 0 : v.default }];
291
+ }))
292
+ }), m = k(b(l, "parseHTML", d));
293
+ m && (p.parseDOM = m.map((y) => yt(y, u)));
294
+ const h = b(l, "renderHTML", d);
295
+ h && (p.toDOM = (y) => h({
296
+ node: y,
297
+ HTMLAttributes: ot(y, u)
298
+ }));
299
+ const g = b(l, "renderText", d);
300
+ return g && (p.toText = g), [l.name, p];
301
+ })), a = Object.fromEntries(o.map((l) => {
302
+ const u = r.filter((g) => g.type === l.name), d = {
303
+ name: l.name,
304
+ options: l.options,
305
+ storage: l.storage,
306
+ editor: t
307
+ }, f = n.reduce((g, y) => {
308
+ const v = b(y, "extendMarkSchema", d);
309
+ return {
310
+ ...g,
311
+ ...v ? v(l) : {}
312
+ };
313
+ }, {}), p = bt({
314
+ ...f,
315
+ inclusive: k(b(l, "inclusive", d)),
316
+ excludes: k(b(l, "excludes", d)),
317
+ group: k(b(l, "group", d)),
318
+ spanning: k(b(l, "spanning", d)),
319
+ code: k(b(l, "code", d)),
320
+ attrs: Object.fromEntries(u.map((g) => {
321
+ var y;
322
+ return [g.name, { default: (y = g?.attribute) === null || y === void 0 ? void 0 : y.default }];
323
+ }))
324
+ }), m = k(b(l, "parseHTML", d));
325
+ m && (p.parseDOM = m.map((g) => yt(g, u)));
326
+ const h = b(l, "renderHTML", d);
327
+ return h && (p.toDOM = (g) => h({
328
+ mark: g,
329
+ HTMLAttributes: ot(g, u)
330
+ })), [l.name, p];
331
+ }));
332
+ return new xt({
333
+ topNode: i,
334
+ nodes: c,
335
+ marks: a
336
+ });
337
+ }
338
+ function nt(n, t) {
339
+ return t.nodes[n] || t.marks[n] || null;
340
+ }
341
+ function kt(n, t) {
342
+ return Array.isArray(t) ? t.some((e) => (typeof e == "string" ? e : e.name) === n.name) : t;
343
+ }
344
+ function dt(n, t) {
345
+ const e = ne.fromSchema(t).serializeFragment(n), s = document.implementation.createHTMLDocument().createElement("div");
346
+ return s.appendChild(e), s.innerHTML;
347
+ }
348
+ const $e = (n, t = 500) => {
349
+ let e = "";
350
+ const r = n.parentOffset;
351
+ return n.parent.nodesBetween(Math.max(0, r - t), r, (s, o, i, c) => {
352
+ var a, l;
353
+ const u = ((l = (a = s.type.spec).toText) === null || l === void 0 ? void 0 : l.call(a, {
354
+ node: s,
355
+ pos: o,
356
+ parent: i,
357
+ index: c
358
+ })) || s.textContent || "%leaf%";
359
+ e += s.isAtom && !s.isText ? u : u.slice(0, Math.max(0, r - o));
360
+ }), e;
361
+ };
362
+ function ut(n) {
363
+ return Object.prototype.toString.call(n) === "[object RegExp]";
364
+ }
365
+ class X {
366
+ constructor(t) {
367
+ this.find = t.find, this.handler = t.handler;
368
+ }
369
+ }
370
+ const Ie = (n, t) => {
371
+ if (ut(t))
372
+ return t.exec(n);
373
+ const e = t(n);
374
+ if (!e)
375
+ return null;
376
+ const r = [e.text];
377
+ return r.index = e.index, r.input = n, r.data = e.data, e.replaceWith && (e.text.includes(e.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(e.replaceWith)), r;
378
+ };
379
+ function z(n) {
380
+ var t;
381
+ const { editor: e, from: r, to: s, text: o, rules: i, plugin: c } = n, { view: a } = e;
382
+ if (a.composing)
383
+ return !1;
384
+ const l = a.state.doc.resolve(r);
385
+ if (
386
+ // check for code node
387
+ l.parent.type.spec.code || !((t = l.nodeBefore || l.nodeAfter) === null || t === void 0) && t.marks.find((f) => f.type.spec.code)
388
+ )
389
+ return !1;
390
+ let u = !1;
391
+ const d = $e(l) + o;
392
+ return i.forEach((f) => {
393
+ if (u)
394
+ return;
395
+ const p = Ie(d, f.find);
396
+ if (!p)
397
+ return;
398
+ const m = a.state.tr, h = J({
399
+ state: a.state,
400
+ transaction: m
401
+ }), g = {
402
+ from: r - (p[0].length - o.length),
403
+ to: s
404
+ }, { commands: y, chain: v, can: w } = new Y({
405
+ editor: e,
406
+ state: h
407
+ });
408
+ f.handler({
409
+ state: h,
410
+ range: g,
411
+ match: p,
412
+ commands: y,
413
+ chain: v,
414
+ can: w
415
+ }) === null || !m.steps.length || (m.setMeta(c, {
416
+ transform: m,
417
+ from: r,
418
+ to: s,
419
+ text: o
420
+ }), a.dispatch(m), u = !0);
421
+ }), u;
422
+ }
423
+ function Ne(n) {
424
+ const { editor: t, rules: e } = n, r = new $({
425
+ state: {
426
+ init() {
427
+ return null;
428
+ },
429
+ apply(s, o, i) {
430
+ const c = s.getMeta(r);
431
+ if (c)
432
+ return c;
433
+ const a = s.getMeta("applyInputRules");
434
+ return !!a && setTimeout(() => {
435
+ let { text: u } = a;
436
+ typeof u == "string" ? u = u : u = dt(I.from(u), i.schema);
437
+ const { from: d } = a, f = d + u.length;
438
+ z({
439
+ editor: t,
440
+ from: d,
441
+ to: f,
442
+ text: u,
443
+ rules: e,
444
+ plugin: r
445
+ });
446
+ }), s.selectionSet || s.docChanged ? null : o;
447
+ }
448
+ },
449
+ props: {
450
+ handleTextInput(s, o, i, c) {
451
+ return z({
452
+ editor: t,
453
+ from: o,
454
+ to: i,
455
+ text: c,
456
+ rules: e,
457
+ plugin: r
458
+ });
459
+ },
460
+ handleDOMEvents: {
461
+ compositionend: (s) => (setTimeout(() => {
462
+ const { $cursor: o } = s.state.selection;
463
+ o && z({
464
+ editor: t,
465
+ from: o.pos,
466
+ to: o.pos,
467
+ text: "",
468
+ rules: e,
469
+ plugin: r
470
+ });
471
+ }), !1)
472
+ },
473
+ // add support for input rules to trigger on enter
474
+ // this is useful for example for code blocks
475
+ handleKeyDown(s, o) {
476
+ if (o.key !== "Enter")
477
+ return !1;
478
+ const { $cursor: i } = s.state.selection;
479
+ return i ? z({
480
+ editor: t,
481
+ from: i.pos,
482
+ to: i.pos,
483
+ text: `
484
+ `,
485
+ rules: e,
486
+ plugin: r
487
+ }) : !1;
488
+ }
489
+ },
490
+ // @ts-ignore
491
+ isInputRules: !0
492
+ });
493
+ return r;
494
+ }
495
+ function Be(n) {
496
+ return Object.prototype.toString.call(n).slice(8, -1);
497
+ }
498
+ function _(n) {
499
+ return Be(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
500
+ }
501
+ function Z(n, t) {
502
+ const e = { ...n };
503
+ return _(n) && _(t) && Object.keys(t).forEach((r) => {
504
+ _(t[r]) && _(n[r]) ? e[r] = Z(n[r], t[r]) : e[r] = t[r];
505
+ }), e;
506
+ }
507
+ class U {
508
+ constructor(t = {}) {
509
+ this.type = "mark", this.name = "mark", this.parent = null, this.child = null, this.config = {
510
+ name: this.name,
511
+ defaultOptions: {}
512
+ }, this.config = {
513
+ ...this.config,
514
+ ...t
515
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = k(b(this, "addOptions", {
516
+ name: this.name
517
+ }))), this.storage = k(b(this, "addStorage", {
518
+ name: this.name,
519
+ options: this.options
520
+ })) || {};
521
+ }
522
+ static create(t = {}) {
523
+ return new U(t);
524
+ }
525
+ configure(t = {}) {
526
+ const e = this.extend({
527
+ ...this.config,
528
+ addOptions: () => Z(this.options, t)
529
+ });
530
+ return e.name = this.name, e.parent = this.parent, e;
531
+ }
532
+ extend(t = {}) {
533
+ const e = new U(t);
534
+ return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = k(b(e, "addOptions", {
535
+ name: e.name
536
+ })), e.storage = k(b(e, "addStorage", {
537
+ name: e.name,
538
+ options: e.options
539
+ })), e;
540
+ }
541
+ static handleExit({ editor: t, mark: e }) {
542
+ const { tr: r } = t.state, s = t.state.selection.$from;
543
+ if (s.pos === s.end()) {
544
+ const i = s.marks();
545
+ if (!!!i.find((l) => l?.type.name === e.name))
546
+ return !1;
547
+ const a = i.find((l) => l?.type.name === e.name);
548
+ return a && r.removeStoredMark(a), r.insertText(" ", s.pos), t.view.dispatch(r), !0;
549
+ }
550
+ return !1;
551
+ }
552
+ }
553
+ function je(n) {
554
+ return typeof n == "number";
555
+ }
556
+ class Re {
557
+ constructor(t) {
558
+ this.find = t.find, this.handler = t.handler;
559
+ }
560
+ }
561
+ const De = (n, t, e) => {
562
+ if (ut(t))
563
+ return [...n.matchAll(t)];
564
+ const r = t(n, e);
565
+ return r ? r.map((s) => {
566
+ const o = [s.text];
567
+ return o.index = s.index, o.input = n, o.data = s.data, s.replaceWith && (s.text.includes(s.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), o.push(s.replaceWith)), o;
568
+ }) : [];
569
+ };
570
+ function Fe(n) {
571
+ const { editor: t, state: e, from: r, to: s, rule: o, pasteEvent: i, dropEvent: c } = n, { commands: a, chain: l, can: u } = new Y({
572
+ editor: t,
573
+ state: e
574
+ }), d = [];
575
+ return e.doc.nodesBetween(r, s, (p, m) => {
576
+ if (!p.isTextblock || p.type.spec.code)
577
+ return;
578
+ const h = Math.max(r, m), g = Math.min(s, m + p.content.size), y = p.textBetween(h - m, g - m, void 0, "");
579
+ De(y, o.find, i).forEach((w) => {
580
+ if (w.index === void 0)
581
+ return;
582
+ const E = h + w.index + 1, M = E + w[0].length, x = {
583
+ from: e.tr.mapping.map(E),
584
+ to: e.tr.mapping.map(M)
585
+ }, T = o.handler({
586
+ state: e,
587
+ range: x,
588
+ match: w,
589
+ commands: a,
590
+ chain: l,
591
+ can: u,
592
+ pasteEvent: i,
593
+ dropEvent: c
594
+ });
595
+ d.push(T);
596
+ });
597
+ }), d.every((p) => p !== null);
598
+ }
599
+ let H = null;
600
+ const Le = (n) => {
601
+ var t;
602
+ const e = new ClipboardEvent("paste", {
603
+ clipboardData: new DataTransfer()
604
+ });
605
+ return (t = e.clipboardData) === null || t === void 0 || t.setData("text/html", n), e;
606
+ };
607
+ function ze(n) {
608
+ const { editor: t, rules: e } = n;
609
+ let r = null, s = !1, o = !1, i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, c;
610
+ try {
611
+ c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
612
+ } catch {
613
+ c = null;
614
+ }
615
+ const a = ({ state: u, from: d, to: f, rule: p, pasteEvt: m }) => {
616
+ const h = u.tr, g = J({
617
+ state: u,
618
+ transaction: h
619
+ });
620
+ if (!(!Fe({
621
+ editor: t,
622
+ state: g,
623
+ from: Math.max(d - 1, 0),
624
+ to: f.b - 1,
625
+ rule: p,
626
+ pasteEvent: m,
627
+ dropEvent: c
628
+ }) || !h.steps.length)) {
629
+ try {
630
+ c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
631
+ } catch {
632
+ c = null;
633
+ }
634
+ return i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, h;
635
+ }
636
+ };
637
+ return e.map((u) => new $({
638
+ // we register a global drag handler to track the current drag source element
639
+ view(d) {
640
+ const f = (m) => {
641
+ var h;
642
+ r = !((h = d.dom.parentElement) === null || h === void 0) && h.contains(m.target) ? d.dom.parentElement : null, r && (H = t);
643
+ }, p = () => {
644
+ H && (H = null);
645
+ };
646
+ return window.addEventListener("dragstart", f), window.addEventListener("dragend", p), {
647
+ destroy() {
648
+ window.removeEventListener("dragstart", f), window.removeEventListener("dragend", p);
649
+ }
650
+ };
651
+ },
652
+ props: {
653
+ handleDOMEvents: {
654
+ drop: (d, f) => {
655
+ if (o = r === d.dom.parentElement, c = f, !o) {
656
+ const p = H;
657
+ p?.isEditable && setTimeout(() => {
658
+ const m = p.state.selection;
659
+ m && p.commands.deleteRange({ from: m.from, to: m.to });
660
+ }, 10);
661
+ }
662
+ return !1;
663
+ },
664
+ paste: (d, f) => {
665
+ var p;
666
+ const m = (p = f.clipboardData) === null || p === void 0 ? void 0 : p.getData("text/html");
667
+ return i = f, s = !!m?.includes("data-pm-slice"), !1;
668
+ }
669
+ }
670
+ },
671
+ appendTransaction: (d, f, p) => {
672
+ const m = d[0], h = m.getMeta("uiEvent") === "paste" && !s, g = m.getMeta("uiEvent") === "drop" && !o, y = m.getMeta("applyPasteRules"), v = !!y;
673
+ if (!h && !g && !v)
674
+ return;
675
+ if (v) {
676
+ let { text: M } = y;
677
+ typeof M == "string" ? M = M : M = dt(I.from(M), p.schema);
678
+ const { from: x } = y, T = x + M.length, P = Le(M);
679
+ return a({
680
+ rule: u,
681
+ state: p,
682
+ from: x,
683
+ to: { b: T },
684
+ pasteEvt: P
685
+ });
686
+ }
687
+ const w = f.doc.content.findDiffStart(p.doc.content), E = f.doc.content.findDiffEnd(p.doc.content);
688
+ if (!(!je(w) || !E || w === E.b))
689
+ return a({
690
+ rule: u,
691
+ state: p,
692
+ from: w,
693
+ to: E,
694
+ pasteEvt: i
695
+ });
696
+ }
697
+ }));
698
+ }
699
+ function _e(n) {
700
+ const t = n.filter((e, r) => n.indexOf(e) !== r);
701
+ return Array.from(new Set(t));
702
+ }
703
+ class R {
704
+ constructor(t, e) {
705
+ this.splittableMarks = [], this.editor = e, this.extensions = R.resolve(t), this.schema = Oe(this.extensions, e), this.setupExtensions();
706
+ }
707
+ /**
708
+ * Returns a flattened and sorted extension list while
709
+ * also checking for duplicated extensions and warns the user.
710
+ * @param extensions An array of Tiptap extensions
711
+ * @returns An flattened and sorted array of Tiptap extensions
712
+ */
713
+ static resolve(t) {
714
+ const e = R.sort(R.flatten(t)), r = _e(e.map((s) => s.name));
715
+ return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((s) => `'${s}'`).join(", ")}]. This can lead to issues.`), e;
716
+ }
717
+ /**
718
+ * Create a flattened array of extensions by traversing the `addExtensions` field.
719
+ * @param extensions An array of Tiptap extensions
720
+ * @returns A flattened array of Tiptap extensions
721
+ */
722
+ static flatten(t) {
723
+ return t.map((e) => {
724
+ const r = {
725
+ name: e.name,
726
+ options: e.options,
727
+ storage: e.storage
728
+ }, s = b(e, "addExtensions", r);
729
+ return s ? [e, ...this.flatten(s())] : e;
730
+ }).flat(10);
731
+ }
732
+ /**
733
+ * Sort extensions by priority.
734
+ * @param extensions An array of Tiptap extensions
735
+ * @returns A sorted array of Tiptap extensions by priority
736
+ */
737
+ static sort(t) {
738
+ return t.sort((r, s) => {
739
+ const o = b(r, "priority") || 100, i = b(s, "priority") || 100;
740
+ return o > i ? -1 : o < i ? 1 : 0;
741
+ });
742
+ }
743
+ /**
744
+ * Get all commands from the extensions.
745
+ * @returns An object with all commands where the key is the command name and the value is the command function
746
+ */
747
+ get commands() {
748
+ return this.extensions.reduce((t, e) => {
749
+ const r = {
750
+ name: e.name,
751
+ options: e.options,
752
+ storage: e.storage,
753
+ editor: this.editor,
754
+ type: nt(e.name, this.schema)
755
+ }, s = b(e, "addCommands", r);
756
+ return s ? {
757
+ ...t,
758
+ ...s()
759
+ } : t;
760
+ }, {});
761
+ }
762
+ /**
763
+ * Get all registered Prosemirror plugins from the extensions.
764
+ * @returns An array of Prosemirror plugins
765
+ */
766
+ get plugins() {
767
+ const { editor: t } = this, e = R.sort([...this.extensions].reverse()), r = [], s = [], o = e.map((i) => {
768
+ const c = {
769
+ name: i.name,
770
+ options: i.options,
771
+ storage: i.storage,
772
+ editor: t,
773
+ type: nt(i.name, this.schema)
774
+ }, a = [], l = b(i, "addKeyboardShortcuts", c);
775
+ let u = {};
776
+ if (i.type === "mark" && b(i, "exitable", c) && (u.ArrowRight = () => U.handleExit({ editor: t, mark: i })), l) {
777
+ const h = Object.fromEntries(Object.entries(l()).map(([g, y]) => [g, () => y({ editor: t })]));
778
+ u = { ...u, ...h };
779
+ }
780
+ const d = ee(u);
781
+ a.push(d);
782
+ const f = b(i, "addInputRules", c);
783
+ kt(i, t.options.enableInputRules) && f && r.push(...f());
784
+ const p = b(i, "addPasteRules", c);
785
+ kt(i, t.options.enablePasteRules) && p && s.push(...p());
786
+ const m = b(i, "addProseMirrorPlugins", c);
787
+ if (m) {
788
+ const h = m();
789
+ a.push(...h);
790
+ }
791
+ return a;
792
+ }).flat();
793
+ return [
794
+ Ne({
795
+ editor: t,
796
+ rules: r
797
+ }),
798
+ ...ze({
799
+ editor: t,
800
+ rules: s
801
+ }),
802
+ ...o
803
+ ];
804
+ }
805
+ /**
806
+ * Get all attributes from the extensions.
807
+ * @returns An array of attributes
808
+ */
809
+ get attributes() {
810
+ return Ct(this.extensions);
811
+ }
812
+ /**
813
+ * Get all node views from the extensions.
814
+ * @returns An object with all node views where the key is the node name and the value is the node view function
815
+ */
816
+ get nodeViews() {
817
+ const { editor: t } = this, { nodeExtensions: e } = Q(this.extensions);
818
+ return Object.fromEntries(e.filter((r) => !!b(r, "addNodeView")).map((r) => {
819
+ const s = this.attributes.filter((a) => a.type === r.name), o = {
820
+ name: r.name,
821
+ options: r.options,
822
+ storage: r.storage,
823
+ editor: t,
824
+ type: S(r.name, this.schema)
825
+ }, i = b(r, "addNodeView", o);
826
+ if (!i)
827
+ return [];
828
+ const c = (a, l, u, d, f) => {
829
+ const p = ot(a, s);
830
+ return i()({
831
+ // pass-through
832
+ node: a,
833
+ view: l,
834
+ getPos: u,
835
+ decorations: d,
836
+ innerDecorations: f,
837
+ // tiptap-specific
838
+ editor: t,
839
+ extension: r,
840
+ HTMLAttributes: p
841
+ });
842
+ };
843
+ return [r.name, c];
844
+ }));
845
+ }
846
+ /**
847
+ * Go through all extensions, create extension storages & setup marks
848
+ * & bind editor event listener.
849
+ */
850
+ setupExtensions() {
851
+ this.extensions.forEach((t) => {
852
+ var e;
853
+ this.editor.extensionStorage[t.name] = t.storage;
854
+ const r = {
855
+ name: t.name,
856
+ options: t.options,
857
+ storage: t.storage,
858
+ editor: this.editor,
859
+ type: nt(t.name, this.schema)
860
+ };
861
+ t.type === "mark" && (!((e = k(b(t, "keepOnSplit", r))) !== null && e !== void 0) || e) && this.splittableMarks.push(t.name);
862
+ const s = b(t, "onBeforeCreate", r), o = b(t, "onCreate", r), i = b(t, "onUpdate", r), c = b(t, "onSelectionUpdate", r), a = b(t, "onTransaction", r), l = b(t, "onFocus", r), u = b(t, "onBlur", r), d = b(t, "onDestroy", r);
863
+ s && this.editor.on("beforeCreate", s), o && this.editor.on("create", o), i && this.editor.on("update", i), c && this.editor.on("selectionUpdate", c), a && this.editor.on("transaction", a), l && this.editor.on("focus", l), u && this.editor.on("blur", u), d && this.editor.on("destroy", d);
864
+ });
865
+ }
866
+ }
867
+ class C {
868
+ constructor(t = {}) {
869
+ this.type = "extension", this.name = "extension", this.parent = null, this.child = null, this.config = {
870
+ name: this.name,
871
+ defaultOptions: {}
872
+ }, this.config = {
873
+ ...this.config,
874
+ ...t
875
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = k(b(this, "addOptions", {
876
+ name: this.name
877
+ }))), this.storage = k(b(this, "addStorage", {
878
+ name: this.name,
879
+ options: this.options
880
+ })) || {};
881
+ }
882
+ static create(t = {}) {
883
+ return new C(t);
884
+ }
885
+ configure(t = {}) {
886
+ const e = this.extend({
887
+ ...this.config,
888
+ addOptions: () => Z(this.options, t)
889
+ });
890
+ return e.name = this.name, e.parent = this.parent, e;
891
+ }
892
+ extend(t = {}) {
893
+ const e = new C({ ...this.config, ...t });
894
+ return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = k(b(e, "addOptions", {
895
+ name: e.name
896
+ })), e.storage = k(b(e, "addStorage", {
897
+ name: e.name,
898
+ options: e.options
899
+ })), e;
900
+ }
901
+ }
902
+ function Pt(n, t, e) {
903
+ const { from: r, to: s } = t, { blockSeparator: o = `
904
+
905
+ `, textSerializers: i = {} } = e || {};
906
+ let c = "";
907
+ return n.nodesBetween(r, s, (a, l, u, d) => {
908
+ var f;
909
+ a.isBlock && l > r && (c += o);
910
+ const p = i?.[a.type.name];
911
+ if (p)
912
+ return u && (c += p({
913
+ node: a,
914
+ pos: l,
915
+ parent: u,
916
+ index: d,
917
+ range: t
918
+ })), !1;
919
+ a.isText && (c += (f = a?.text) === null || f === void 0 ? void 0 : f.slice(Math.max(r, l) - l, s - l));
920
+ }), c;
921
+ }
922
+ function At(n) {
923
+ return Object.fromEntries(Object.entries(n.nodes).filter(([, t]) => t.spec.toText).map(([t, e]) => [t, e.spec.toText]));
924
+ }
925
+ const Ot = C.create({
926
+ name: "clipboardTextSerializer",
927
+ addOptions() {
928
+ return {
929
+ blockSeparator: void 0
930
+ };
931
+ },
932
+ addProseMirrorPlugins() {
933
+ return [
934
+ new $({
935
+ key: new j("clipboardTextSerializer"),
936
+ props: {
937
+ clipboardTextSerializer: () => {
938
+ const { editor: n } = this, { state: t, schema: e } = n, { doc: r, selection: s } = t, { ranges: o } = s, i = Math.min(...o.map((u) => u.$from.pos)), c = Math.max(...o.map((u) => u.$to.pos)), a = At(e);
939
+ return Pt(r, { from: i, to: c }, {
940
+ ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
941
+ textSerializers: a
942
+ });
943
+ }
944
+ }
945
+ })
946
+ ];
947
+ }
948
+ }), He = () => ({ editor: n, view: t }) => (requestAnimationFrame(() => {
949
+ var e;
950
+ n.isDestroyed || (t.dom.blur(), (e = window?.getSelection()) === null || e === void 0 || e.removeAllRanges());
951
+ }), !0), Ve = (n = !1) => ({ commands: t }) => t.setContent("", n), We = () => ({ state: n, tr: t, dispatch: e }) => {
952
+ const { selection: r } = t, { ranges: s } = r;
953
+ return e && s.forEach(({ $from: o, $to: i }) => {
954
+ n.doc.nodesBetween(o.pos, i.pos, (c, a) => {
955
+ if (c.type.isText)
956
+ return;
957
+ const { doc: l, mapping: u } = t, d = l.resolve(u.map(a)), f = l.resolve(u.map(a + c.nodeSize)), p = d.blockRange(f);
958
+ if (!p)
959
+ return;
960
+ const m = Qt(p);
961
+ if (c.type.isTextblock) {
962
+ const { defaultType: h } = d.parent.contentMatchAt(d.index());
963
+ t.setNodeMarkup(p.start, h);
964
+ }
965
+ (m || m === 0) && t.lift(p, m);
966
+ });
967
+ }), !0;
968
+ }, Ke = (n) => (t) => n(t), Ue = () => ({ state: n, dispatch: t }) => xe(n, t), qe = (n, t) => ({ editor: e, tr: r }) => {
969
+ const { state: s } = e, o = s.doc.slice(n.from, n.to);
970
+ r.deleteRange(n.from, n.to);
971
+ const i = r.mapping.map(t);
972
+ return r.insert(i, o.content), r.setSelection(new A(r.doc.resolve(i - 1))), !0;
973
+ }, Ge = () => ({ tr: n, dispatch: t }) => {
974
+ const { selection: e } = n, r = e.$anchor.node();
975
+ if (r.content.size > 0)
976
+ return !1;
977
+ const s = n.selection.$anchor;
978
+ for (let o = s.depth; o > 0; o -= 1)
979
+ if (s.node(o).type === r.type) {
980
+ if (t) {
981
+ const c = s.before(o), a = s.after(o);
982
+ n.delete(c, a).scrollIntoView();
983
+ }
984
+ return !0;
985
+ }
986
+ return !1;
987
+ }, Je = (n) => ({ tr: t, state: e, dispatch: r }) => {
988
+ const s = S(n, e.schema), o = t.selection.$anchor;
989
+ for (let i = o.depth; i > 0; i -= 1)
990
+ if (o.node(i).type === s) {
991
+ if (r) {
992
+ const a = o.before(i), l = o.after(i);
993
+ t.delete(a, l).scrollIntoView();
994
+ }
995
+ return !0;
996
+ }
997
+ return !1;
998
+ }, Ye = (n) => ({ tr: t, dispatch: e }) => {
999
+ const { from: r, to: s } = n;
1000
+ return e && t.delete(r, s), !0;
1001
+ }, Qe = () => ({ state: n, dispatch: t }) => Ee(n, t), Xe = () => ({ commands: n }) => n.keyboardShortcut("Enter"), Ze = () => ({ state: n, dispatch: t }) => Se(n, t);
1002
+ function q(n, t, e = { strict: !0 }) {
1003
+ const r = Object.keys(t);
1004
+ return r.length ? r.every((s) => e.strict ? t[s] === n[s] : ut(t[s]) ? t[s].test(n[s]) : t[s] === n[s]) : !0;
1005
+ }
1006
+ function $t(n, t, e = {}) {
1007
+ return n.find((r) => r.type === t && q(
1008
+ // Only check equality for the attributes that are provided
1009
+ Object.fromEntries(Object.keys(e).map((s) => [s, r.attrs[s]])),
1010
+ e
1011
+ ));
1012
+ }
1013
+ function vt(n, t, e = {}) {
1014
+ return !!$t(n, t, e);
1015
+ }
1016
+ function ft(n, t, e) {
1017
+ var r;
1018
+ if (!n || !t)
1019
+ return;
1020
+ let s = n.parent.childAfter(n.parentOffset);
1021
+ if ((!s.node || !s.node.marks.some((u) => u.type === t)) && (s = n.parent.childBefore(n.parentOffset)), !s.node || !s.node.marks.some((u) => u.type === t) || (e = e || ((r = s.node.marks[0]) === null || r === void 0 ? void 0 : r.attrs), !$t([...s.node.marks], t, e)))
1022
+ return;
1023
+ let i = s.index, c = n.start() + s.offset, a = i + 1, l = c + s.node.nodeSize;
1024
+ for (; i > 0 && vt([...n.parent.child(i - 1).marks], t, e); )
1025
+ i -= 1, c -= n.parent.child(i).nodeSize;
1026
+ for (; a < n.parent.childCount && vt([...n.parent.child(a).marks], t, e); )
1027
+ l += n.parent.child(a).nodeSize, a += 1;
1028
+ return {
1029
+ from: c,
1030
+ to: l
1031
+ };
1032
+ }
1033
+ function N(n, t) {
1034
+ if (typeof n == "string") {
1035
+ if (!t.marks[n])
1036
+ throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);
1037
+ return t.marks[n];
1038
+ }
1039
+ return n;
1040
+ }
1041
+ const tn = (n, t = {}) => ({ tr: e, state: r, dispatch: s }) => {
1042
+ const o = N(n, r.schema), { doc: i, selection: c } = e, { $from: a, from: l, to: u } = c;
1043
+ if (s) {
1044
+ const d = ft(a, o, t);
1045
+ if (d && d.from <= l && d.to >= u) {
1046
+ const f = A.create(i, d.from, d.to);
1047
+ e.setSelection(f);
1048
+ }
1049
+ }
1050
+ return !0;
1051
+ }, en = (n) => (t) => {
1052
+ const e = typeof n == "function" ? n(t) : n;
1053
+ for (let r = 0; r < e.length; r += 1)
1054
+ if (e[r](t))
1055
+ return !0;
1056
+ return !1;
1057
+ };
1058
+ function It(n) {
1059
+ return n instanceof A;
1060
+ }
1061
+ function O(n = 0, t = 0, e = 0) {
1062
+ return Math.min(Math.max(n, t), e);
1063
+ }
1064
+ function Nt(n, t = null) {
1065
+ if (!t)
1066
+ return null;
1067
+ const e = D.atStart(n), r = D.atEnd(n);
1068
+ if (t === "start" || t === !0)
1069
+ return e;
1070
+ if (t === "end")
1071
+ return r;
1072
+ const s = e.from, o = r.to;
1073
+ return t === "all" ? A.create(n, O(0, s, o), O(n.content.size, s, o)) : A.create(n, O(t, s, o), O(t, s, o));
1074
+ }
1075
+ function nn() {
1076
+ return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
1077
+ }
1078
+ function pt() {
1079
+ return [
1080
+ "iPad Simulator",
1081
+ "iPhone Simulator",
1082
+ "iPod Simulator",
1083
+ "iPad",
1084
+ "iPhone",
1085
+ "iPod"
1086
+ ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
1087
+ }
1088
+ const rn = (n = null, t = {}) => ({ editor: e, view: r, tr: s, dispatch: o }) => {
1089
+ t = {
1090
+ scrollIntoView: !0,
1091
+ ...t
1092
+ };
1093
+ const i = () => {
1094
+ (pt() || nn()) && r.dom.focus(), requestAnimationFrame(() => {
1095
+ e.isDestroyed || (r.focus(), t?.scrollIntoView && e.commands.scrollIntoView());
1096
+ });
1097
+ };
1098
+ if (r.hasFocus() && n === null || n === !1)
1099
+ return !0;
1100
+ if (o && n === null && !It(e.state.selection))
1101
+ return i(), !0;
1102
+ const c = Nt(s.doc, n) || e.state.selection, a = e.state.selection.eq(c);
1103
+ return o && (a || s.setSelection(c), a && s.storedMarks && s.setStoredMarks(s.storedMarks), i()), !0;
1104
+ }, sn = (n, t) => (e) => n.every((r, s) => t(r, { ...e, index: s })), on = (n, t) => ({ tr: e, commands: r }) => r.insertContentAt({ from: e.selection.from, to: e.selection.to }, n, t), Bt = (n) => {
1105
+ const t = n.childNodes;
1106
+ for (let e = t.length - 1; e >= 0; e -= 1) {
1107
+ const r = t[e];
1108
+ r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? n.removeChild(r) : r.nodeType === 1 && Bt(r);
1109
+ }
1110
+ return n;
1111
+ };
1112
+ function V(n) {
1113
+ const t = `<body>${n}</body>`, e = new window.DOMParser().parseFromString(t, "text/html").body;
1114
+ return Bt(e);
1115
+ }
1116
+ function F(n, t, e) {
1117
+ if (n instanceof se || n instanceof I)
1118
+ return n;
1119
+ e = {
1120
+ slice: !0,
1121
+ parseOptions: {},
1122
+ ...e
1123
+ };
1124
+ const r = typeof n == "object" && n !== null, s = typeof n == "string";
1125
+ if (r)
1126
+ try {
1127
+ if (Array.isArray(n) && n.length > 0)
1128
+ return I.fromArray(n.map((c) => t.nodeFromJSON(c)));
1129
+ const i = t.nodeFromJSON(n);
1130
+ return e.errorOnInvalidContent && i.check(), i;
1131
+ } catch (o) {
1132
+ if (e.errorOnInvalidContent)
1133
+ throw new Error("[tiptap error]: Invalid JSON content", { cause: o });
1134
+ return console.warn("[tiptap warn]: Invalid content.", "Passed value:", n, "Error:", o), F("", t, e);
1135
+ }
1136
+ if (s) {
1137
+ if (e.errorOnInvalidContent) {
1138
+ let i = !1, c = "";
1139
+ const a = new xt({
1140
+ topNode: t.spec.topNode,
1141
+ marks: t.spec.marks,
1142
+ // Prosemirror's schemas are executed such that: the last to execute, matches last
1143
+ // This means that we can add a catch-all node at the end of the schema to catch any content that we don't know how to handle
1144
+ nodes: t.spec.nodes.append({
1145
+ __tiptap__private__unknown__catch__all__node: {
1146
+ content: "inline*",
1147
+ group: "block",
1148
+ parseDOM: [
1149
+ {
1150
+ tag: "*",
1151
+ getAttrs: (l) => (i = !0, c = typeof l == "string" ? l : l.outerHTML, null)
1152
+ }
1153
+ ]
1154
+ }
1155
+ })
1156
+ });
1157
+ if (e.slice ? et.fromSchema(a).parseSlice(V(n), e.parseOptions) : et.fromSchema(a).parse(V(n), e.parseOptions), e.errorOnInvalidContent && i)
1158
+ throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${c}`) });
1159
+ }
1160
+ const o = et.fromSchema(t);
1161
+ return e.slice ? o.parseSlice(V(n), e.parseOptions).content : o.parse(V(n), e.parseOptions);
1162
+ }
1163
+ return F("", t, e);
1164
+ }
1165
+ function an(n, t, e) {
1166
+ const r = n.steps.length - 1;
1167
+ if (r < t)
1168
+ return;
1169
+ const s = n.steps[r];
1170
+ if (!(s instanceof Xt || s instanceof Zt))
1171
+ return;
1172
+ const o = n.mapping.maps[r];
1173
+ let i = 0;
1174
+ o.forEach((c, a, l, u) => {
1175
+ i === 0 && (i = u);
1176
+ }), n.setSelection(D.near(n.doc.resolve(i), e));
1177
+ }
1178
+ const cn = (n) => !("type" in n), ln = (n, t, e) => ({ tr: r, dispatch: s, editor: o }) => {
1179
+ var i;
1180
+ if (s) {
1181
+ e = {
1182
+ parseOptions: o.options.parseOptions,
1183
+ updateSelection: !0,
1184
+ applyInputRules: !1,
1185
+ applyPasteRules: !1,
1186
+ ...e
1187
+ };
1188
+ let c;
1189
+ const a = (g) => {
1190
+ o.emit("contentError", {
1191
+ editor: o,
1192
+ error: g,
1193
+ disableCollaboration: () => {
1194
+ o.storage.collaboration && (o.storage.collaboration.isDisabled = !0);
1195
+ }
1196
+ });
1197
+ }, l = {
1198
+ preserveWhitespace: "full",
1199
+ ...e.parseOptions
1200
+ };
1201
+ if (!e.errorOnInvalidContent && !o.options.enableContentCheck && o.options.emitContentError)
1202
+ try {
1203
+ F(t, o.schema, {
1204
+ parseOptions: l,
1205
+ errorOnInvalidContent: !0
1206
+ });
1207
+ } catch (g) {
1208
+ a(g);
1209
+ }
1210
+ try {
1211
+ c = F(t, o.schema, {
1212
+ parseOptions: l,
1213
+ errorOnInvalidContent: (i = e.errorOnInvalidContent) !== null && i !== void 0 ? i : o.options.enableContentCheck
1214
+ });
1215
+ } catch (g) {
1216
+ return a(g), !1;
1217
+ }
1218
+ let { from: u, to: d } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, f = !0, p = !0;
1219
+ if ((cn(c) ? c : [c]).forEach((g) => {
1220
+ g.check(), f = f ? g.isText && g.marks.length === 0 : !1, p = p ? g.isBlock : !1;
1221
+ }), u === d && p) {
1222
+ const { parent: g } = r.doc.resolve(u);
1223
+ g.isTextblock && !g.type.spec.code && !g.childCount && (u -= 1, d += 1);
1224
+ }
1225
+ let h;
1226
+ if (f) {
1227
+ if (Array.isArray(t))
1228
+ h = t.map((g) => g.text || "").join("");
1229
+ else if (t instanceof I) {
1230
+ let g = "";
1231
+ t.forEach((y) => {
1232
+ y.text && (g += y.text);
1233
+ }), h = g;
1234
+ } else typeof t == "object" && t && t.text ? h = t.text : h = t;
1235
+ r.insertText(h, u, d);
1236
+ } else
1237
+ h = c, r.replaceWith(u, d, h);
1238
+ e.updateSelection && an(r, r.steps.length - 1, -1), e.applyInputRules && r.setMeta("applyInputRules", { from: u, text: h }), e.applyPasteRules && r.setMeta("applyPasteRules", { from: u, text: h });
1239
+ }
1240
+ return !0;
1241
+ }, dn = () => ({ state: n, dispatch: t }) => ye(n, t), un = () => ({ state: n, dispatch: t }) => we(n, t), fn = () => ({ state: n, dispatch: t }) => Me(n, t), pn = () => ({ state: n, dispatch: t }) => ve(n, t), hn = () => ({ state: n, dispatch: t, tr: e }) => {
1242
+ try {
1243
+ const r = Et(n.doc, n.selection.$from.pos, -1);
1244
+ return r == null ? !1 : (e.join(r, 2), t && t(e), !0);
1245
+ } catch {
1246
+ return !1;
1247
+ }
1248
+ }, mn = () => ({ state: n, dispatch: t, tr: e }) => {
1249
+ try {
1250
+ const r = Et(n.doc, n.selection.$from.pos, 1);
1251
+ return r == null ? !1 : (e.join(r, 2), t && t(e), !0);
1252
+ } catch {
1253
+ return !1;
1254
+ }
1255
+ }, gn = () => ({ state: n, dispatch: t }) => ke(n, t), yn = () => ({ state: n, dispatch: t }) => be(n, t);
1256
+ function jt() {
1257
+ return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
1258
+ }
1259
+ function bn(n) {
1260
+ const t = n.split(/-(?!$)/);
1261
+ let e = t[t.length - 1];
1262
+ e === "Space" && (e = " ");
1263
+ let r, s, o, i;
1264
+ for (let c = 0; c < t.length - 1; c += 1) {
1265
+ const a = t[c];
1266
+ if (/^(cmd|meta|m)$/i.test(a))
1267
+ i = !0;
1268
+ else if (/^a(lt)?$/i.test(a))
1269
+ r = !0;
1270
+ else if (/^(c|ctrl|control)$/i.test(a))
1271
+ s = !0;
1272
+ else if (/^s(hift)?$/i.test(a))
1273
+ o = !0;
1274
+ else if (/^mod$/i.test(a))
1275
+ pt() || jt() ? i = !0 : s = !0;
1276
+ else
1277
+ throw new Error(`Unrecognized modifier name: ${a}`);
1278
+ }
1279
+ return r && (e = `Alt-${e}`), s && (e = `Ctrl-${e}`), i && (e = `Meta-${e}`), o && (e = `Shift-${e}`), e;
1280
+ }
1281
+ const kn = (n) => ({ editor: t, view: e, tr: r, dispatch: s }) => {
1282
+ const o = bn(n).split(/-(?!$)/), i = o.find((l) => !["Alt", "Ctrl", "Meta", "Shift"].includes(l)), c = new KeyboardEvent("keydown", {
1283
+ key: i === "Space" ? " " : i,
1284
+ altKey: o.includes("Alt"),
1285
+ ctrlKey: o.includes("Ctrl"),
1286
+ metaKey: o.includes("Meta"),
1287
+ shiftKey: o.includes("Shift"),
1288
+ bubbles: !0,
1289
+ cancelable: !0
1290
+ }), a = t.captureTransaction(() => {
1291
+ e.someProp("handleKeyDown", (l) => l(e, c));
1292
+ });
1293
+ return a?.steps.forEach((l) => {
1294
+ const u = l.map(r.mapping);
1295
+ u && s && r.maybeStep(u);
1296
+ }), !0;
1297
+ };
1298
+ function L(n, t, e = {}) {
1299
+ const { from: r, to: s, empty: o } = n.selection, i = t ? S(t, n.schema) : null, c = [];
1300
+ n.doc.nodesBetween(r, s, (d, f) => {
1301
+ if (d.isText)
1302
+ return;
1303
+ const p = Math.max(r, f), m = Math.min(s, f + d.nodeSize);
1304
+ c.push({
1305
+ node: d,
1306
+ from: p,
1307
+ to: m
1308
+ });
1309
+ });
1310
+ const a = s - r, l = c.filter((d) => i ? i.name === d.node.type.name : !0).filter((d) => q(d.node.attrs, e, { strict: !1 }));
1311
+ return o ? !!l.length : l.reduce((d, f) => d + f.to - f.from, 0) >= a;
1312
+ }
1313
+ const vn = (n, t = {}) => ({ state: e, dispatch: r }) => {
1314
+ const s = S(n, e.schema);
1315
+ return L(e, s, t) ? ge(e, r) : !1;
1316
+ }, wn = () => ({ state: n, dispatch: t }) => me(n, t), Mn = (n) => ({ state: t, dispatch: e }) => {
1317
+ const r = S(n, t.schema);
1318
+ return ae(r)(t, e);
1319
+ }, Sn = () => ({ state: n, dispatch: t }) => he(n, t);
1320
+ function tt(n, t) {
1321
+ return t.nodes[n] ? "node" : t.marks[n] ? "mark" : null;
1322
+ }
1323
+ function wt(n, t) {
1324
+ const e = typeof t == "string" ? [t] : t;
1325
+ return Object.keys(n).reduce((r, s) => (e.includes(s) || (r[s] = n[s]), r), {});
1326
+ }
1327
+ const En = (n, t) => ({ tr: e, state: r, dispatch: s }) => {
1328
+ let o = null, i = null;
1329
+ const c = tt(typeof n == "string" ? n : n.name, r.schema);
1330
+ return c ? (c === "node" && (o = S(n, r.schema)), c === "mark" && (i = N(n, r.schema)), s && e.selection.ranges.forEach((a) => {
1331
+ r.doc.nodesBetween(a.$from.pos, a.$to.pos, (l, u) => {
1332
+ o && o === l.type && e.setNodeMarkup(u, void 0, wt(l.attrs, t)), i && l.marks.length && l.marks.forEach((d) => {
1333
+ i === d.type && e.addMark(u, u + l.nodeSize, i.create(wt(d.attrs, t)));
1334
+ });
1335
+ });
1336
+ }), !0) : !1;
1337
+ }, xn = () => ({ tr: n, dispatch: t }) => (t && n.scrollIntoView(), !0), Cn = () => ({ tr: n, dispatch: t }) => {
1338
+ if (t) {
1339
+ const e = new Gt(n.doc);
1340
+ n.setSelection(e);
1341
+ }
1342
+ return !0;
1343
+ }, Tn = () => ({ state: n, dispatch: t }) => pe(n, t), Pn = () => ({ state: n, dispatch: t }) => fe(n, t), An = () => ({ state: n, dispatch: t }) => ue(n, t), On = () => ({ state: n, dispatch: t }) => de(n, t), $n = () => ({ state: n, dispatch: t }) => le(n, t);
1344
+ function it(n, t, e = {}, r = {}) {
1345
+ return F(n, t, {
1346
+ slice: !1,
1347
+ parseOptions: e,
1348
+ errorOnInvalidContent: r.errorOnInvalidContent
1349
+ });
1350
+ }
1351
+ const In = (n, t = !1, e = {}, r = {}) => ({ editor: s, tr: o, dispatch: i, commands: c }) => {
1352
+ var a, l;
1353
+ const { doc: u } = o;
1354
+ if (e.preserveWhitespace !== "full") {
1355
+ const d = it(n, s.schema, e, {
1356
+ errorOnInvalidContent: (a = r.errorOnInvalidContent) !== null && a !== void 0 ? a : s.options.enableContentCheck
1357
+ });
1358
+ return i && o.replaceWith(0, u.content.size, d).setMeta("preventUpdate", !t), !0;
1359
+ }
1360
+ return i && o.setMeta("preventUpdate", !t), c.insertContentAt({ from: 0, to: u.content.size }, n, {
1361
+ parseOptions: e,
1362
+ errorOnInvalidContent: (l = r.errorOnInvalidContent) !== null && l !== void 0 ? l : s.options.enableContentCheck
1363
+ });
1364
+ };
1365
+ function Rt(n, t) {
1366
+ const e = N(t, n.schema), { from: r, to: s, empty: o } = n.selection, i = [];
1367
+ o ? (n.storedMarks && i.push(...n.storedMarks), i.push(...n.selection.$head.marks())) : n.doc.nodesBetween(r, s, (a) => {
1368
+ i.push(...a.marks);
1369
+ });
1370
+ const c = i.find((a) => a.type.name === e.name);
1371
+ return c ? { ...c.attrs } : {};
1372
+ }
1373
+ function gr(n, t) {
1374
+ const e = new Yt(n);
1375
+ return t.forEach((r) => {
1376
+ r.steps.forEach((s) => {
1377
+ e.step(s);
1378
+ });
1379
+ }), e;
1380
+ }
1381
+ function Nn(n) {
1382
+ for (let t = 0; t < n.edgeCount; t += 1) {
1383
+ const { type: e } = n.edge(t);
1384
+ if (e.isTextblock && !e.hasRequiredAttrs())
1385
+ return e;
1386
+ }
1387
+ return null;
1388
+ }
1389
+ function yr(n, t, e) {
1390
+ const r = [];
1391
+ return n.nodesBetween(t.from, t.to, (s, o) => {
1392
+ e(s) && r.push({
1393
+ node: s,
1394
+ pos: o
1395
+ });
1396
+ }), r;
1397
+ }
1398
+ function Bn(n, t) {
1399
+ for (let e = n.depth; e > 0; e -= 1) {
1400
+ const r = n.node(e);
1401
+ if (t(r))
1402
+ return {
1403
+ pos: e > 0 ? n.before(e) : 0,
1404
+ start: n.start(e),
1405
+ depth: e,
1406
+ node: r
1407
+ };
1408
+ }
1409
+ }
1410
+ function ht(n) {
1411
+ return (t) => Bn(t.$from, n);
1412
+ }
1413
+ function jn(n, t) {
1414
+ const e = {
1415
+ from: 0,
1416
+ to: n.content.size
1417
+ };
1418
+ return Pt(n, e, t);
1419
+ }
1420
+ function Rn(n, t) {
1421
+ const e = S(t, n.schema), { from: r, to: s } = n.selection, o = [];
1422
+ n.doc.nodesBetween(r, s, (c) => {
1423
+ o.push(c);
1424
+ });
1425
+ const i = o.reverse().find((c) => c.type.name === e.name);
1426
+ return i ? { ...i.attrs } : {};
1427
+ }
1428
+ function Dn(n, t) {
1429
+ const e = tt(typeof t == "string" ? t : t.name, n.schema);
1430
+ return e === "node" ? Rn(n, t) : e === "mark" ? Rt(n, t) : {};
1431
+ }
1432
+ function Fn(n, t = JSON.stringify) {
1433
+ const e = {};
1434
+ return n.filter((r) => {
1435
+ const s = t(r);
1436
+ return Object.prototype.hasOwnProperty.call(e, s) ? !1 : e[s] = !0;
1437
+ });
1438
+ }
1439
+ function Ln(n) {
1440
+ const t = Fn(n);
1441
+ return t.length === 1 ? t : t.filter((e, r) => !t.filter((o, i) => i !== r).some((o) => e.oldRange.from >= o.oldRange.from && e.oldRange.to <= o.oldRange.to && e.newRange.from >= o.newRange.from && e.newRange.to <= o.newRange.to));
1442
+ }
1443
+ function br(n) {
1444
+ const { mapping: t, steps: e } = n, r = [];
1445
+ return t.maps.forEach((s, o) => {
1446
+ const i = [];
1447
+ if (s.ranges.length)
1448
+ s.forEach((c, a) => {
1449
+ i.push({ from: c, to: a });
1450
+ });
1451
+ else {
1452
+ const { from: c, to: a } = e[o];
1453
+ if (c === void 0 || a === void 0)
1454
+ return;
1455
+ i.push({ from: c, to: a });
1456
+ }
1457
+ i.forEach(({ from: c, to: a }) => {
1458
+ const l = t.slice(o).map(c, -1), u = t.slice(o).map(a), d = t.invert().map(l, -1), f = t.invert().map(u);
1459
+ r.push({
1460
+ oldRange: {
1461
+ from: d,
1462
+ to: f
1463
+ },
1464
+ newRange: {
1465
+ from: l,
1466
+ to: u
1467
+ }
1468
+ });
1469
+ });
1470
+ }), Ln(r);
1471
+ }
1472
+ function Dt(n, t, e) {
1473
+ const r = [];
1474
+ return n === t ? e.resolve(n).marks().forEach((s) => {
1475
+ const o = e.resolve(n), i = ft(o, s.type);
1476
+ i && r.push({
1477
+ mark: s,
1478
+ ...i
1479
+ });
1480
+ }) : e.nodesBetween(n, t, (s, o) => {
1481
+ !s || s?.nodeSize === void 0 || r.push(...s.marks.map((i) => ({
1482
+ from: o,
1483
+ to: o + s.nodeSize,
1484
+ mark: i
1485
+ })));
1486
+ }), r;
1487
+ }
1488
+ function K(n, t, e) {
1489
+ return Object.fromEntries(Object.entries(e).filter(([r]) => {
1490
+ const s = n.find((o) => o.type === t && o.name === r);
1491
+ return s ? s.attribute.keepOnSplit : !1;
1492
+ }));
1493
+ }
1494
+ function at(n, t, e = {}) {
1495
+ const { empty: r, ranges: s } = n.selection, o = t ? N(t, n.schema) : null;
1496
+ if (r)
1497
+ return !!(n.storedMarks || n.selection.$from.marks()).filter((d) => o ? o.name === d.type.name : !0).find((d) => q(d.attrs, e, { strict: !1 }));
1498
+ let i = 0;
1499
+ const c = [];
1500
+ if (s.forEach(({ $from: d, $to: f }) => {
1501
+ const p = d.pos, m = f.pos;
1502
+ n.doc.nodesBetween(p, m, (h, g) => {
1503
+ if (!h.isText && !h.marks.length)
1504
+ return;
1505
+ const y = Math.max(p, g), v = Math.min(m, g + h.nodeSize), w = v - y;
1506
+ i += w, c.push(...h.marks.map((E) => ({
1507
+ mark: E,
1508
+ from: y,
1509
+ to: v
1510
+ })));
1511
+ });
1512
+ }), i === 0)
1513
+ return !1;
1514
+ const a = c.filter((d) => o ? o.name === d.mark.type.name : !0).filter((d) => q(d.mark.attrs, e, { strict: !1 })).reduce((d, f) => d + f.to - f.from, 0), l = c.filter((d) => o ? d.mark.type !== o && d.mark.type.excludes(o) : !0).reduce((d, f) => d + f.to - f.from, 0);
1515
+ return (a > 0 ? a + l : a) >= i;
1516
+ }
1517
+ function zn(n, t, e = {}) {
1518
+ if (!t)
1519
+ return L(n, null, e) || at(n, null, e);
1520
+ const r = tt(t, n.schema);
1521
+ return r === "node" ? L(n, t, e) : r === "mark" ? at(n, t, e) : !1;
1522
+ }
1523
+ function Mt(n, t) {
1524
+ const { nodeExtensions: e } = Q(t), r = e.find((i) => i.name === n);
1525
+ if (!r)
1526
+ return !1;
1527
+ const s = {
1528
+ name: r.name,
1529
+ options: r.options,
1530
+ storage: r.storage
1531
+ }, o = k(b(r, "group", s));
1532
+ return typeof o != "string" ? !1 : o.split(" ").includes("list");
1533
+ }
1534
+ function mt(n, { checkChildren: t = !0, ignoreWhitespace: e = !1 } = {}) {
1535
+ var r;
1536
+ if (e) {
1537
+ if (n.type.name === "hardBreak")
1538
+ return !0;
1539
+ if (n.isText)
1540
+ return /^\s*$/m.test((r = n.text) !== null && r !== void 0 ? r : "");
1541
+ }
1542
+ if (n.isText)
1543
+ return !n.text;
1544
+ if (n.isAtom || n.isLeaf)
1545
+ return !1;
1546
+ if (n.content.childCount === 0)
1547
+ return !0;
1548
+ if (t) {
1549
+ let s = !0;
1550
+ return n.content.forEach((o) => {
1551
+ s !== !1 && (mt(o, { ignoreWhitespace: e, checkChildren: t }) || (s = !1));
1552
+ }), s;
1553
+ }
1554
+ return !1;
1555
+ }
1556
+ function kr(n) {
1557
+ return n instanceof G;
1558
+ }
1559
+ function vr(n, t, e) {
1560
+ const s = n.state.doc.content.size, o = O(t, 0, s), i = O(e, 0, s), c = n.coordsAtPos(o), a = n.coordsAtPos(i, -1), l = Math.min(c.top, a.top), u = Math.max(c.bottom, a.bottom), d = Math.min(c.left, a.left), f = Math.max(c.right, a.right), p = f - d, m = u - l, y = {
1561
+ top: l,
1562
+ bottom: u,
1563
+ left: d,
1564
+ right: f,
1565
+ width: p,
1566
+ height: m,
1567
+ x: d,
1568
+ y: l
1569
+ };
1570
+ return {
1571
+ ...y,
1572
+ toJSON: () => y
1573
+ };
1574
+ }
1575
+ function _n(n, t, e) {
1576
+ var r;
1577
+ const { selection: s } = t;
1578
+ let o = null;
1579
+ if (It(s) && (o = s.$cursor), o) {
1580
+ const c = (r = n.storedMarks) !== null && r !== void 0 ? r : o.marks();
1581
+ return !!e.isInSet(c) || !c.some((a) => a.type.excludes(e));
1582
+ }
1583
+ const { ranges: i } = s;
1584
+ return i.some(({ $from: c, $to: a }) => {
1585
+ let l = c.depth === 0 ? n.doc.inlineContent && n.doc.type.allowsMarkType(e) : !1;
1586
+ return n.doc.nodesBetween(c.pos, a.pos, (u, d, f) => {
1587
+ if (l)
1588
+ return !1;
1589
+ if (u.isInline) {
1590
+ const p = !f || f.type.allowsMarkType(e), m = !!e.isInSet(u.marks) || !u.marks.some((h) => h.type.excludes(e));
1591
+ l = p && m;
1592
+ }
1593
+ return !l;
1594
+ }), l;
1595
+ });
1596
+ }
1597
+ const Hn = (n, t = {}) => ({ tr: e, state: r, dispatch: s }) => {
1598
+ const { selection: o } = e, { empty: i, ranges: c } = o, a = N(n, r.schema);
1599
+ if (s)
1600
+ if (i) {
1601
+ const l = Rt(r, a);
1602
+ e.addStoredMark(a.create({
1603
+ ...l,
1604
+ ...t
1605
+ }));
1606
+ } else
1607
+ c.forEach((l) => {
1608
+ const u = l.$from.pos, d = l.$to.pos;
1609
+ r.doc.nodesBetween(u, d, (f, p) => {
1610
+ const m = Math.max(p, u), h = Math.min(p + f.nodeSize, d);
1611
+ f.marks.find((y) => y.type === a) ? f.marks.forEach((y) => {
1612
+ a === y.type && e.addMark(m, h, a.create({
1613
+ ...y.attrs,
1614
+ ...t
1615
+ }));
1616
+ }) : e.addMark(m, h, a.create(t));
1617
+ });
1618
+ });
1619
+ return _n(r, e, a);
1620
+ }, Vn = (n, t) => ({ tr: e }) => (e.setMeta(n, t), !0), Wn = (n, t = {}) => ({ state: e, dispatch: r, chain: s }) => {
1621
+ const o = S(n, e.schema);
1622
+ let i;
1623
+ return e.selection.$anchor.sameParent(e.selection.$head) && (i = e.selection.$anchor.parent.attrs), o.isTextblock ? s().command(({ commands: c }) => gt(o, { ...i, ...t })(e) ? !0 : c.clearNodes()).command(({ state: c }) => gt(o, { ...i, ...t })(c, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
1624
+ }, Kn = (n) => ({ tr: t, dispatch: e }) => {
1625
+ if (e) {
1626
+ const { doc: r } = t, s = O(n, 0, r.content.size), o = G.create(r, s);
1627
+ t.setSelection(o);
1628
+ }
1629
+ return !0;
1630
+ }, Un = (n) => ({ tr: t, dispatch: e }) => {
1631
+ if (e) {
1632
+ const { doc: r } = t, { from: s, to: o } = typeof n == "number" ? { from: n, to: n } : n, i = A.atStart(r).from, c = A.atEnd(r).to, a = O(s, i, c), l = O(o, i, c), u = A.create(r, a, l);
1633
+ t.setSelection(u);
1634
+ }
1635
+ return !0;
1636
+ }, qn = (n) => ({ state: t, dispatch: e }) => {
1637
+ const r = S(n, t.schema);
1638
+ return ie(r)(t, e);
1639
+ };
1640
+ function St(n, t) {
1641
+ const e = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
1642
+ if (e) {
1643
+ const r = e.filter((s) => t?.includes(s.type.name));
1644
+ n.tr.ensureMarks(r);
1645
+ }
1646
+ }
1647
+ const Gn = ({ keepMarks: n = !0 } = {}) => ({ tr: t, state: e, dispatch: r, editor: s }) => {
1648
+ const { selection: o, doc: i } = t, { $from: c, $to: a } = o, l = s.extensionManager.attributes, u = K(l, c.node().type.name, c.node().attrs);
1649
+ if (o instanceof G && o.node.isBlock)
1650
+ return !c.parentOffset || !W(i, c.pos) ? !1 : (r && (n && St(e, s.extensionManager.splittableMarks), t.split(c.pos).scrollIntoView()), !0);
1651
+ if (!c.parent.isBlock)
1652
+ return !1;
1653
+ const d = a.parentOffset === a.parent.content.size, f = c.depth === 0 ? void 0 : Nn(c.node(-1).contentMatchAt(c.indexAfter(-1)));
1654
+ let p = d && f ? [
1655
+ {
1656
+ type: f,
1657
+ attrs: u
1658
+ }
1659
+ ] : void 0, m = W(t.doc, t.mapping.map(c.pos), 1, p);
1660
+ if (!p && !m && W(t.doc, t.mapping.map(c.pos), 1, f ? [{ type: f }] : void 0) && (m = !0, p = f ? [
1661
+ {
1662
+ type: f,
1663
+ attrs: u
1664
+ }
1665
+ ] : void 0), r) {
1666
+ if (m && (o instanceof A && t.deleteSelection(), t.split(t.mapping.map(c.pos), 1, p), f && !d && !c.parentOffset && c.parent.type !== f)) {
1667
+ const h = t.mapping.map(c.before()), g = t.doc.resolve(h);
1668
+ c.node(-1).canReplaceWith(g.index(), g.index() + 1, f) && t.setNodeMarkup(t.mapping.map(c.before()), f);
1669
+ }
1670
+ n && St(e, s.extensionManager.splittableMarks), t.scrollIntoView();
1671
+ }
1672
+ return m;
1673
+ }, Jn = (n, t = {}) => ({ tr: e, state: r, dispatch: s, editor: o }) => {
1674
+ var i;
1675
+ const c = S(n, r.schema), { $from: a, $to: l } = r.selection, u = r.selection.node;
1676
+ if (u && u.isBlock || a.depth < 2 || !a.sameParent(l))
1677
+ return !1;
1678
+ const d = a.node(-1);
1679
+ if (d.type !== c)
1680
+ return !1;
1681
+ const f = o.extensionManager.attributes;
1682
+ if (a.parent.content.size === 0 && a.node(-1).childCount === a.indexAfter(-1)) {
1683
+ if (a.depth === 2 || a.node(-3).type !== c || a.index(-2) !== a.node(-2).childCount - 1)
1684
+ return !1;
1685
+ if (s) {
1686
+ let y = I.empty;
1687
+ const v = a.index(-1) ? 1 : a.index(-2) ? 2 : 3;
1688
+ for (let P = a.depth - v; P >= a.depth - 3; P -= 1)
1689
+ y = I.from(a.node(P).copy(y));
1690
+ const w = a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3, E = {
1691
+ ...K(f, a.node().type.name, a.node().attrs),
1692
+ ...t
1693
+ }, M = ((i = c.contentMatch.defaultType) === null || i === void 0 ? void 0 : i.createAndFill(E)) || void 0;
1694
+ y = y.append(I.from(c.createAndFill(null, M) || void 0));
1695
+ const x = a.before(a.depth - (v - 1));
1696
+ e.replace(x, a.after(-w), new re(y, 4 - v, 0));
1697
+ let T = -1;
1698
+ e.doc.nodesBetween(x, e.doc.content.size, (P, Ut) => {
1699
+ if (T > -1)
1700
+ return !1;
1701
+ P.isTextblock && P.content.size === 0 && (T = Ut + 1);
1702
+ }), T > -1 && e.setSelection(A.near(e.doc.resolve(T))), e.scrollIntoView();
1703
+ }
1704
+ return !0;
1705
+ }
1706
+ const p = l.pos === a.end() ? d.contentMatchAt(0).defaultType : null, m = {
1707
+ ...K(f, d.type.name, d.attrs),
1708
+ ...t
1709
+ }, h = {
1710
+ ...K(f, a.node().type.name, a.node().attrs),
1711
+ ...t
1712
+ };
1713
+ e.delete(a.pos, l.pos);
1714
+ const g = p ? [
1715
+ { type: c, attrs: m },
1716
+ { type: p, attrs: h }
1717
+ ] : [{ type: c, attrs: m }];
1718
+ if (!W(e.doc, a.pos, 2))
1719
+ return !1;
1720
+ if (s) {
1721
+ const { selection: y, storedMarks: v } = r, { splittableMarks: w } = o.extensionManager, E = v || y.$to.parentOffset && y.$from.marks();
1722
+ if (e.split(a.pos, 2, g).scrollIntoView(), !E || !s)
1723
+ return !0;
1724
+ const M = E.filter((x) => w.includes(x.type.name));
1725
+ e.ensureMarks(M);
1726
+ }
1727
+ return !0;
1728
+ }, rt = (n, t) => {
1729
+ const e = ht((i) => i.type === t)(n.selection);
1730
+ if (!e)
1731
+ return !0;
1732
+ const r = n.doc.resolve(Math.max(0, e.pos - 1)).before(e.depth);
1733
+ if (r === void 0)
1734
+ return !0;
1735
+ const s = n.doc.nodeAt(r);
1736
+ return e.node.type === s?.type && lt(n.doc, e.pos) && n.join(e.pos), !0;
1737
+ }, st = (n, t) => {
1738
+ const e = ht((i) => i.type === t)(n.selection);
1739
+ if (!e)
1740
+ return !0;
1741
+ const r = n.doc.resolve(e.start).after(e.depth);
1742
+ if (r === void 0)
1743
+ return !0;
1744
+ const s = n.doc.nodeAt(r);
1745
+ return e.node.type === s?.type && lt(n.doc, r) && n.join(r), !0;
1746
+ }, Yn = (n, t, e, r = {}) => ({ editor: s, tr: o, state: i, dispatch: c, chain: a, commands: l, can: u }) => {
1747
+ const { extensions: d, splittableMarks: f } = s.extensionManager, p = S(n, i.schema), m = S(t, i.schema), { selection: h, storedMarks: g } = i, { $from: y, $to: v } = h, w = y.blockRange(v), E = g || h.$to.parentOffset && h.$from.marks();
1748
+ if (!w)
1749
+ return !1;
1750
+ const M = ht((x) => Mt(x.type.name, d))(h);
1751
+ if (w.depth >= 1 && M && w.depth - M.depth <= 1) {
1752
+ if (M.node.type === p)
1753
+ return l.liftListItem(m);
1754
+ if (Mt(M.node.type.name, d) && p.validContent(M.node.content) && c)
1755
+ return a().command(() => (o.setNodeMarkup(M.pos, p), !0)).command(() => rt(o, p)).command(() => st(o, p)).run();
1756
+ }
1757
+ return !e || !E || !c ? a().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => rt(o, p)).command(() => st(o, p)).run() : a().command(() => {
1758
+ const x = u().wrapInList(p, r), T = E.filter((P) => f.includes(P.type.name));
1759
+ return o.ensureMarks(T), x ? !0 : l.clearNodes();
1760
+ }).wrapInList(p, r).command(() => rt(o, p)).command(() => st(o, p)).run();
1761
+ }, Qn = (n, t = {}, e = {}) => ({ state: r, commands: s }) => {
1762
+ const { extendEmptyMarkRange: o = !1 } = e, i = N(n, r.schema);
1763
+ return at(r, i, t) ? s.unsetMark(i, { extendEmptyMarkRange: o }) : s.setMark(i, t);
1764
+ }, Xn = (n, t, e = {}) => ({ state: r, commands: s }) => {
1765
+ const o = S(n, r.schema), i = S(t, r.schema), c = L(r, o, e);
1766
+ let a;
1767
+ return r.selection.$anchor.sameParent(r.selection.$head) && (a = r.selection.$anchor.parent.attrs), c ? s.setNode(i, a) : s.setNode(o, { ...a, ...e });
1768
+ }, Zn = (n, t = {}) => ({ state: e, commands: r }) => {
1769
+ const s = S(n, e.schema);
1770
+ return L(e, s, t) ? r.lift(s) : r.wrapIn(s, t);
1771
+ }, tr = () => ({ state: n, dispatch: t }) => {
1772
+ const e = n.plugins;
1773
+ for (let r = 0; r < e.length; r += 1) {
1774
+ const s = e[r];
1775
+ let o;
1776
+ if (s.spec.isInputRules && (o = s.getState(n))) {
1777
+ if (t) {
1778
+ const i = n.tr, c = o.transform;
1779
+ for (let a = c.steps.length - 1; a >= 0; a -= 1)
1780
+ i.step(c.steps[a].invert(c.docs[a]));
1781
+ if (o.text) {
1782
+ const a = i.doc.resolve(o.from).marks();
1783
+ i.replaceWith(o.from, o.to, n.schema.text(o.text, a));
1784
+ } else
1785
+ i.delete(o.from, o.to);
1786
+ }
1787
+ return !0;
1788
+ }
1789
+ }
1790
+ return !1;
1791
+ }, er = () => ({ tr: n, dispatch: t }) => {
1792
+ const { selection: e } = n, { empty: r, ranges: s } = e;
1793
+ return r || t && s.forEach((o) => {
1794
+ n.removeMark(o.$from.pos, o.$to.pos);
1795
+ }), !0;
1796
+ }, nr = (n, t = {}) => ({ tr: e, state: r, dispatch: s }) => {
1797
+ var o;
1798
+ const { extendEmptyMarkRange: i = !1 } = t, { selection: c } = e, a = N(n, r.schema), { $from: l, empty: u, ranges: d } = c;
1799
+ if (!s)
1800
+ return !0;
1801
+ if (u && i) {
1802
+ let { from: f, to: p } = c;
1803
+ const m = (o = l.marks().find((g) => g.type === a)) === null || o === void 0 ? void 0 : o.attrs, h = ft(l, a, m);
1804
+ h && (f = h.from, p = h.to), e.removeMark(f, p, a);
1805
+ } else
1806
+ d.forEach((f) => {
1807
+ e.removeMark(f.$from.pos, f.$to.pos, a);
1808
+ });
1809
+ return e.removeStoredMark(a), !0;
1810
+ }, rr = (n, t = {}) => ({ tr: e, state: r, dispatch: s }) => {
1811
+ let o = null, i = null;
1812
+ const c = tt(typeof n == "string" ? n : n.name, r.schema);
1813
+ return c ? (c === "node" && (o = S(n, r.schema)), c === "mark" && (i = N(n, r.schema)), s && e.selection.ranges.forEach((a) => {
1814
+ const l = a.$from.pos, u = a.$to.pos;
1815
+ let d, f, p, m;
1816
+ e.selection.empty ? r.doc.nodesBetween(l, u, (h, g) => {
1817
+ o && o === h.type && (p = Math.max(g, l), m = Math.min(g + h.nodeSize, u), d = g, f = h);
1818
+ }) : r.doc.nodesBetween(l, u, (h, g) => {
1819
+ g < l && o && o === h.type && (p = Math.max(g, l), m = Math.min(g + h.nodeSize, u), d = g, f = h), g >= l && g <= u && (o && o === h.type && e.setNodeMarkup(g, void 0, {
1820
+ ...h.attrs,
1821
+ ...t
1822
+ }), i && h.marks.length && h.marks.forEach((y) => {
1823
+ if (i === y.type) {
1824
+ const v = Math.max(g, l), w = Math.min(g + h.nodeSize, u);
1825
+ e.addMark(v, w, i.create({
1826
+ ...y.attrs,
1827
+ ...t
1828
+ }));
1829
+ }
1830
+ }));
1831
+ }), f && (d !== void 0 && e.setNodeMarkup(d, void 0, {
1832
+ ...f.attrs,
1833
+ ...t
1834
+ }), i && f.marks.length && f.marks.forEach((h) => {
1835
+ i === h.type && e.addMark(p, m, i.create({
1836
+ ...h.attrs,
1837
+ ...t
1838
+ }));
1839
+ }));
1840
+ }), !0) : !1;
1841
+ }, sr = (n, t = {}) => ({ state: e, dispatch: r }) => {
1842
+ const s = S(n, e.schema);
1843
+ return ce(s, t)(e, r);
1844
+ }, or = (n, t = {}) => ({ state: e, dispatch: r }) => {
1845
+ const s = S(n, e.schema);
1846
+ return oe(s, t)(e, r);
1847
+ };
1848
+ var ir = /* @__PURE__ */ Object.freeze({
1849
+ __proto__: null,
1850
+ blur: He,
1851
+ clearContent: Ve,
1852
+ clearNodes: We,
1853
+ command: Ke,
1854
+ createParagraphNear: Ue,
1855
+ cut: qe,
1856
+ deleteCurrentNode: Ge,
1857
+ deleteNode: Je,
1858
+ deleteRange: Ye,
1859
+ deleteSelection: Qe,
1860
+ enter: Xe,
1861
+ exitCode: Ze,
1862
+ extendMarkRange: tn,
1863
+ first: en,
1864
+ focus: rn,
1865
+ forEach: sn,
1866
+ insertContent: on,
1867
+ insertContentAt: ln,
1868
+ joinBackward: fn,
1869
+ joinDown: un,
1870
+ joinForward: pn,
1871
+ joinItemBackward: hn,
1872
+ joinItemForward: mn,
1873
+ joinTextblockBackward: gn,
1874
+ joinTextblockForward: yn,
1875
+ joinUp: dn,
1876
+ keyboardShortcut: kn,
1877
+ lift: vn,
1878
+ liftEmptyBlock: wn,
1879
+ liftListItem: Mn,
1880
+ newlineInCode: Sn,
1881
+ resetAttributes: En,
1882
+ scrollIntoView: xn,
1883
+ selectAll: Cn,
1884
+ selectNodeBackward: Tn,
1885
+ selectNodeForward: Pn,
1886
+ selectParentNode: An,
1887
+ selectTextblockEnd: On,
1888
+ selectTextblockStart: $n,
1889
+ setContent: In,
1890
+ setMark: Hn,
1891
+ setMeta: Vn,
1892
+ setNode: Wn,
1893
+ setNodeSelection: Kn,
1894
+ setTextSelection: Un,
1895
+ sinkListItem: qn,
1896
+ splitBlock: Gn,
1897
+ splitListItem: Jn,
1898
+ toggleList: Yn,
1899
+ toggleMark: Qn,
1900
+ toggleNode: Xn,
1901
+ toggleWrap: Zn,
1902
+ undoInputRule: tr,
1903
+ unsetAllMarks: er,
1904
+ unsetMark: nr,
1905
+ updateAttributes: rr,
1906
+ wrapIn: sr,
1907
+ wrapInList: or
1908
+ });
1909
+ const Ft = C.create({
1910
+ name: "commands",
1911
+ addCommands() {
1912
+ return {
1913
+ ...ir
1914
+ };
1915
+ }
1916
+ }), Lt = C.create({
1917
+ name: "drop",
1918
+ addProseMirrorPlugins() {
1919
+ return [
1920
+ new $({
1921
+ key: new j("tiptapDrop"),
1922
+ props: {
1923
+ handleDrop: (n, t, e, r) => {
1924
+ this.editor.emit("drop", {
1925
+ editor: this.editor,
1926
+ event: t,
1927
+ slice: e,
1928
+ moved: r
1929
+ });
1930
+ }
1931
+ }
1932
+ })
1933
+ ];
1934
+ }
1935
+ }), zt = C.create({
1936
+ name: "editable",
1937
+ addProseMirrorPlugins() {
1938
+ return [
1939
+ new $({
1940
+ key: new j("editable"),
1941
+ props: {
1942
+ editable: () => this.editor.options.editable
1943
+ }
1944
+ })
1945
+ ];
1946
+ }
1947
+ }), _t = new j("focusEvents"), Ht = C.create({
1948
+ name: "focusEvents",
1949
+ addProseMirrorPlugins() {
1950
+ const { editor: n } = this;
1951
+ return [
1952
+ new $({
1953
+ key: _t,
1954
+ props: {
1955
+ handleDOMEvents: {
1956
+ focus: (t, e) => {
1957
+ n.isFocused = !0;
1958
+ const r = n.state.tr.setMeta("focus", { event: e }).setMeta("addToHistory", !1);
1959
+ return t.dispatch(r), !1;
1960
+ },
1961
+ blur: (t, e) => {
1962
+ n.isFocused = !1;
1963
+ const r = n.state.tr.setMeta("blur", { event: e }).setMeta("addToHistory", !1);
1964
+ return t.dispatch(r), !1;
1965
+ }
1966
+ }
1967
+ }
1968
+ })
1969
+ ];
1970
+ }
1971
+ }), Vt = C.create({
1972
+ name: "keymap",
1973
+ addKeyboardShortcuts() {
1974
+ const n = () => this.editor.commands.first(({ commands: i }) => [
1975
+ () => i.undoInputRule(),
1976
+ // maybe convert first text block node to default node
1977
+ () => i.command(({ tr: c }) => {
1978
+ const { selection: a, doc: l } = c, { empty: u, $anchor: d } = a, { pos: f, parent: p } = d, m = d.parent.isTextblock && f > 0 ? c.doc.resolve(f - 1) : d, h = m.parent.type.spec.isolating, g = d.pos - d.parentOffset, y = h && m.parent.childCount === 1 ? g === d.pos : D.atStart(l).from === f;
1979
+ return !u || !p.type.isTextblock || p.textContent.length || !y || y && d.parent.type.name === "paragraph" ? !1 : i.clearNodes();
1980
+ }),
1981
+ () => i.deleteSelection(),
1982
+ () => i.joinBackward(),
1983
+ () => i.selectNodeBackward()
1984
+ ]), t = () => this.editor.commands.first(({ commands: i }) => [
1985
+ () => i.deleteSelection(),
1986
+ () => i.deleteCurrentNode(),
1987
+ () => i.joinForward(),
1988
+ () => i.selectNodeForward()
1989
+ ]), r = {
1990
+ Enter: () => this.editor.commands.first(({ commands: i }) => [
1991
+ () => i.newlineInCode(),
1992
+ () => i.createParagraphNear(),
1993
+ () => i.liftEmptyBlock(),
1994
+ () => i.splitBlock()
1995
+ ]),
1996
+ "Mod-Enter": () => this.editor.commands.exitCode(),
1997
+ Backspace: n,
1998
+ "Mod-Backspace": n,
1999
+ "Shift-Backspace": n,
2000
+ Delete: t,
2001
+ "Mod-Delete": t,
2002
+ "Mod-a": () => this.editor.commands.selectAll()
2003
+ }, s = {
2004
+ ...r
2005
+ }, o = {
2006
+ ...r,
2007
+ "Ctrl-h": n,
2008
+ "Alt-Backspace": n,
2009
+ "Ctrl-d": t,
2010
+ "Ctrl-Alt-Backspace": t,
2011
+ "Alt-Delete": t,
2012
+ "Alt-d": t,
2013
+ "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
2014
+ "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
2015
+ };
2016
+ return pt() || jt() ? o : s;
2017
+ },
2018
+ addProseMirrorPlugins() {
2019
+ return [
2020
+ // With this plugin we check if the whole document was selected and deleted.
2021
+ // In this case we will additionally call `clearNodes()` to convert e.g. a heading
2022
+ // to a paragraph if necessary.
2023
+ // This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
2024
+ // with many other commands.
2025
+ new $({
2026
+ key: new j("clearDocument"),
2027
+ appendTransaction: (n, t, e) => {
2028
+ if (n.some((h) => h.getMeta("composition")))
2029
+ return;
2030
+ const r = n.some((h) => h.docChanged) && !t.doc.eq(e.doc), s = n.some((h) => h.getMeta("preventClearDocument"));
2031
+ if (!r || s)
2032
+ return;
2033
+ const { empty: o, from: i, to: c } = t.selection, a = D.atStart(t.doc).from, l = D.atEnd(t.doc).to;
2034
+ if (o || !(i === a && c === l) || !mt(e.doc))
2035
+ return;
2036
+ const f = e.tr, p = J({
2037
+ state: e,
2038
+ transaction: f
2039
+ }), { commands: m } = new Y({
2040
+ editor: this.editor,
2041
+ state: p
2042
+ });
2043
+ if (m.clearNodes(), !!f.steps.length)
2044
+ return f;
2045
+ }
2046
+ })
2047
+ ];
2048
+ }
2049
+ }), Wt = C.create({
2050
+ name: "paste",
2051
+ addProseMirrorPlugins() {
2052
+ return [
2053
+ new $({
2054
+ key: new j("tiptapPaste"),
2055
+ props: {
2056
+ handlePaste: (n, t, e) => {
2057
+ this.editor.emit("paste", {
2058
+ editor: this.editor,
2059
+ event: t,
2060
+ slice: e
2061
+ });
2062
+ }
2063
+ }
2064
+ })
2065
+ ];
2066
+ }
2067
+ }), Kt = C.create({
2068
+ name: "tabindex",
2069
+ addProseMirrorPlugins() {
2070
+ return [
2071
+ new $({
2072
+ key: new j("tabindex"),
2073
+ props: {
2074
+ attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
2075
+ }
2076
+ })
2077
+ ];
2078
+ }
2079
+ });
2080
+ var wr = /* @__PURE__ */ Object.freeze({
2081
+ __proto__: null,
2082
+ ClipboardTextSerializer: Ot,
2083
+ Commands: Ft,
2084
+ Drop: Lt,
2085
+ Editable: zt,
2086
+ FocusEvents: Ht,
2087
+ Keymap: Vt,
2088
+ Paste: Wt,
2089
+ Tabindex: Kt,
2090
+ focusEventsPluginKey: _t
2091
+ });
2092
+ class B {
2093
+ get name() {
2094
+ return this.node.type.name;
2095
+ }
2096
+ constructor(t, e, r = !1, s = null) {
2097
+ this.currentNode = null, this.actualDepth = null, this.isBlock = r, this.resolvedPos = t, this.editor = e, this.currentNode = s;
2098
+ }
2099
+ get node() {
2100
+ return this.currentNode || this.resolvedPos.node();
2101
+ }
2102
+ get element() {
2103
+ return this.editor.view.domAtPos(this.pos).node;
2104
+ }
2105
+ get depth() {
2106
+ var t;
2107
+ return (t = this.actualDepth) !== null && t !== void 0 ? t : this.resolvedPos.depth;
2108
+ }
2109
+ get pos() {
2110
+ return this.resolvedPos.pos;
2111
+ }
2112
+ get content() {
2113
+ return this.node.content;
2114
+ }
2115
+ set content(t) {
2116
+ let e = this.from, r = this.to;
2117
+ if (this.isBlock) {
2118
+ if (this.content.size === 0) {
2119
+ console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
2120
+ return;
2121
+ }
2122
+ e = this.from + 1, r = this.to - 1;
2123
+ }
2124
+ this.editor.commands.insertContentAt({ from: e, to: r }, t);
2125
+ }
2126
+ get attributes() {
2127
+ return this.node.attrs;
2128
+ }
2129
+ get textContent() {
2130
+ return this.node.textContent;
2131
+ }
2132
+ get size() {
2133
+ return this.node.nodeSize;
2134
+ }
2135
+ get from() {
2136
+ return this.isBlock ? this.pos : this.resolvedPos.start(this.resolvedPos.depth);
2137
+ }
2138
+ get range() {
2139
+ return {
2140
+ from: this.from,
2141
+ to: this.to
2142
+ };
2143
+ }
2144
+ get to() {
2145
+ return this.isBlock ? this.pos + this.size : this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
2146
+ }
2147
+ get parent() {
2148
+ if (this.depth === 0)
2149
+ return null;
2150
+ const t = this.resolvedPos.start(this.resolvedPos.depth - 1), e = this.resolvedPos.doc.resolve(t);
2151
+ return new B(e, this.editor);
2152
+ }
2153
+ get before() {
2154
+ let t = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
2155
+ return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.from - 3)), new B(t, this.editor);
2156
+ }
2157
+ get after() {
2158
+ let t = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
2159
+ return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.to + 3)), new B(t, this.editor);
2160
+ }
2161
+ get children() {
2162
+ const t = [];
2163
+ return this.node.content.forEach((e, r) => {
2164
+ const s = e.isBlock && !e.isTextblock, o = e.isAtom && !e.isText, i = this.pos + r + (o ? 0 : 1);
2165
+ if (i < 0 || i > this.resolvedPos.doc.nodeSize - 2)
2166
+ return;
2167
+ const c = this.resolvedPos.doc.resolve(i);
2168
+ if (!s && c.depth <= this.depth)
2169
+ return;
2170
+ const a = new B(c, this.editor, s, s ? e : null);
2171
+ s && (a.actualDepth = this.depth + 1), t.push(new B(c, this.editor, s, s ? e : null));
2172
+ }), t;
2173
+ }
2174
+ get firstChild() {
2175
+ return this.children[0] || null;
2176
+ }
2177
+ get lastChild() {
2178
+ const t = this.children;
2179
+ return t[t.length - 1] || null;
2180
+ }
2181
+ closest(t, e = {}) {
2182
+ let r = null, s = this.parent;
2183
+ for (; s && !r; )
2184
+ s.node.type.name === t && (Object.keys(e).length > 0 || (r = s)), s = s.parent;
2185
+ return r;
2186
+ }
2187
+ querySelector(t, e = {}) {
2188
+ return this.querySelectorAll(t, e, !0)[0] || null;
2189
+ }
2190
+ querySelectorAll(t, e = {}, r = !1) {
2191
+ let s = [];
2192
+ if (!this.children || this.children.length === 0)
2193
+ return s;
2194
+ const o = Object.keys(e);
2195
+ return this.children.forEach((i) => {
2196
+ r && s.length > 0 || (i.node.type.name === t && o.every((a) => e[a] === i.node.attrs[a]) && s.push(i), !(r && s.length > 0) && (s = s.concat(i.querySelectorAll(t, e, r))));
2197
+ }), s;
2198
+ }
2199
+ setAttribute(t) {
2200
+ const { tr: e } = this.editor.state;
2201
+ e.setNodeMarkup(this.from, void 0, {
2202
+ ...this.node.attrs,
2203
+ ...t
2204
+ }), this.editor.view.dispatch(e);
2205
+ }
2206
+ }
2207
+ const ar = `.ProseMirror {
2208
+ position: relative;
2209
+ }
2210
+
2211
+ .ProseMirror {
2212
+ word-wrap: break-word;
2213
+ white-space: pre-wrap;
2214
+ white-space: break-spaces;
2215
+ -webkit-font-variant-ligatures: none;
2216
+ font-variant-ligatures: none;
2217
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
2218
+ }
2219
+
2220
+ .ProseMirror [contenteditable="false"] {
2221
+ white-space: normal;
2222
+ }
2223
+
2224
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
2225
+ white-space: pre-wrap;
2226
+ }
2227
+
2228
+ .ProseMirror pre {
2229
+ white-space: pre-wrap;
2230
+ }
2231
+
2232
+ img.ProseMirror-separator {
2233
+ display: inline !important;
2234
+ border: none !important;
2235
+ margin: 0 !important;
2236
+ width: 0 !important;
2237
+ height: 0 !important;
2238
+ }
2239
+
2240
+ .ProseMirror-gapcursor {
2241
+ display: none;
2242
+ pointer-events: none;
2243
+ position: absolute;
2244
+ margin: 0;
2245
+ }
2246
+
2247
+ .ProseMirror-gapcursor:after {
2248
+ content: "";
2249
+ display: block;
2250
+ position: absolute;
2251
+ top: -2px;
2252
+ width: 20px;
2253
+ border-top: 1px solid black;
2254
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
2255
+ }
2256
+
2257
+ @keyframes ProseMirror-cursor-blink {
2258
+ to {
2259
+ visibility: hidden;
2260
+ }
2261
+ }
2262
+
2263
+ .ProseMirror-hideselection *::selection {
2264
+ background: transparent;
2265
+ }
2266
+
2267
+ .ProseMirror-hideselection *::-moz-selection {
2268
+ background: transparent;
2269
+ }
2270
+
2271
+ .ProseMirror-hideselection * {
2272
+ caret-color: transparent;
2273
+ }
2274
+
2275
+ .ProseMirror-focused .ProseMirror-gapcursor {
2276
+ display: block;
2277
+ }
2278
+
2279
+ .tippy-box[data-animation=fade][data-state=hidden] {
2280
+ opacity: 0
2281
+ }`;
2282
+ function cr(n, t, e) {
2283
+ const r = document.querySelector("style[data-tiptap-style]");
2284
+ if (r !== null)
2285
+ return r;
2286
+ const s = document.createElement("style");
2287
+ return t && s.setAttribute("nonce", t), s.setAttribute("data-tiptap-style", ""), s.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(s), s;
2288
+ }
2289
+ let Mr = class extends Ce {
2290
+ constructor(t = {}) {
2291
+ super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
2292
+ element: document.createElement("div"),
2293
+ content: "",
2294
+ injectCSS: !0,
2295
+ injectNonce: void 0,
2296
+ extensions: [],
2297
+ autofocus: !1,
2298
+ editable: !0,
2299
+ editorProps: {},
2300
+ parseOptions: {},
2301
+ coreExtensionOptions: {},
2302
+ enableInputRules: !0,
2303
+ enablePasteRules: !0,
2304
+ enableCoreExtensions: !0,
2305
+ enableContentCheck: !1,
2306
+ emitContentError: !1,
2307
+ onBeforeCreate: () => null,
2308
+ onCreate: () => null,
2309
+ onUpdate: () => null,
2310
+ onSelectionUpdate: () => null,
2311
+ onTransaction: () => null,
2312
+ onFocus: () => null,
2313
+ onBlur: () => null,
2314
+ onDestroy: () => null,
2315
+ onContentError: ({ error: e }) => {
2316
+ throw e;
2317
+ },
2318
+ onPaste: () => null,
2319
+ onDrop: () => null
2320
+ }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(t), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("contentError", this.options.onContentError), this.createView(), this.injectCSS(), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: e, slice: r, moved: s }) => this.options.onDrop(e, r, s)), this.on("paste", ({ event: e, slice: r }) => this.options.onPaste(e, r)), window.setTimeout(() => {
2321
+ this.isDestroyed || (this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
2322
+ }, 0);
2323
+ }
2324
+ /**
2325
+ * Returns the editor storage.
2326
+ */
2327
+ get storage() {
2328
+ return this.extensionStorage;
2329
+ }
2330
+ /**
2331
+ * An object of all registered commands.
2332
+ */
2333
+ get commands() {
2334
+ return this.commandManager.commands;
2335
+ }
2336
+ /**
2337
+ * Create a command chain to call multiple commands at once.
2338
+ */
2339
+ chain() {
2340
+ return this.commandManager.chain();
2341
+ }
2342
+ /**
2343
+ * Check if a command or a command chain can be executed. Without executing it.
2344
+ */
2345
+ can() {
2346
+ return this.commandManager.can();
2347
+ }
2348
+ /**
2349
+ * Inject CSS styles.
2350
+ */
2351
+ injectCSS() {
2352
+ this.options.injectCSS && document && (this.css = cr(ar, this.options.injectNonce));
2353
+ }
2354
+ /**
2355
+ * Update editor options.
2356
+ *
2357
+ * @param options A list of options
2358
+ */
2359
+ setOptions(t = {}) {
2360
+ this.options = {
2361
+ ...this.options,
2362
+ ...t
2363
+ }, !(!this.view || !this.state || this.isDestroyed) && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));
2364
+ }
2365
+ /**
2366
+ * Update editable state of the editor.
2367
+ */
2368
+ setEditable(t, e = !0) {
2369
+ this.setOptions({ editable: t }), e && this.emit("update", { editor: this, transaction: this.state.tr });
2370
+ }
2371
+ /**
2372
+ * Returns whether the editor is editable.
2373
+ */
2374
+ get isEditable() {
2375
+ return this.options.editable && this.view && this.view.editable;
2376
+ }
2377
+ /**
2378
+ * Returns the editor state.
2379
+ */
2380
+ get state() {
2381
+ return this.view.state;
2382
+ }
2383
+ /**
2384
+ * Register a ProseMirror plugin.
2385
+ *
2386
+ * @param plugin A ProseMirror plugin
2387
+ * @param handlePlugins Control how to merge the plugin into the existing plugins.
2388
+ * @returns The new editor state
2389
+ */
2390
+ registerPlugin(t, e) {
2391
+ const r = Tt(e) ? e(t, [...this.state.plugins]) : [...this.state.plugins, t], s = this.state.reconfigure({ plugins: r });
2392
+ return this.view.updateState(s), s;
2393
+ }
2394
+ /**
2395
+ * Unregister a ProseMirror plugin.
2396
+ *
2397
+ * @param nameOrPluginKeyToRemove The plugins name
2398
+ * @returns The new editor state or undefined if the editor is destroyed
2399
+ */
2400
+ unregisterPlugin(t) {
2401
+ if (this.isDestroyed)
2402
+ return;
2403
+ const e = this.state.plugins;
2404
+ let r = e;
2405
+ if ([].concat(t).forEach((o) => {
2406
+ const i = typeof o == "string" ? `${o}$` : o.key;
2407
+ r = r.filter((c) => !c.key.startsWith(i));
2408
+ }), e.length === r.length)
2409
+ return;
2410
+ const s = this.state.reconfigure({
2411
+ plugins: r
2412
+ });
2413
+ return this.view.updateState(s), s;
2414
+ }
2415
+ /**
2416
+ * Creates an extension manager.
2417
+ */
2418
+ createExtensionManager() {
2419
+ var t, e;
2420
+ const s = [...this.options.enableCoreExtensions ? [
2421
+ zt,
2422
+ Ot.configure({
2423
+ blockSeparator: (e = (t = this.options.coreExtensionOptions) === null || t === void 0 ? void 0 : t.clipboardTextSerializer) === null || e === void 0 ? void 0 : e.blockSeparator
2424
+ }),
2425
+ Ft,
2426
+ Ht,
2427
+ Vt,
2428
+ Kt,
2429
+ Lt,
2430
+ Wt
2431
+ ].filter((o) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[o.name] !== !1 : !0) : [], ...this.options.extensions].filter((o) => ["extension", "node", "mark"].includes(o?.type));
2432
+ this.extensionManager = new R(s, this);
2433
+ }
2434
+ /**
2435
+ * Creates an command manager.
2436
+ */
2437
+ createCommandManager() {
2438
+ this.commandManager = new Y({
2439
+ editor: this
2440
+ });
2441
+ }
2442
+ /**
2443
+ * Creates a ProseMirror schema.
2444
+ */
2445
+ createSchema() {
2446
+ this.schema = this.extensionManager.schema;
2447
+ }
2448
+ /**
2449
+ * Creates a ProseMirror view.
2450
+ */
2451
+ createView() {
2452
+ var t;
2453
+ let e;
2454
+ try {
2455
+ e = it(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
2456
+ } catch (i) {
2457
+ if (!(i instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(i.message))
2458
+ throw i;
2459
+ this.emit("contentError", {
2460
+ editor: this,
2461
+ error: i,
2462
+ disableCollaboration: () => {
2463
+ this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((c) => c.name !== "collaboration"), this.createExtensionManager();
2464
+ }
2465
+ }), e = it(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
2466
+ }
2467
+ const r = Nt(e, this.options.autofocus);
2468
+ this.view = new te(this.options.element, {
2469
+ ...this.options.editorProps,
2470
+ attributes: {
2471
+ // add `role="textbox"` to the editor element
2472
+ role: "textbox",
2473
+ ...(t = this.options.editorProps) === null || t === void 0 ? void 0 : t.attributes
2474
+ },
2475
+ dispatchTransaction: this.dispatchTransaction.bind(this),
2476
+ state: qt.create({
2477
+ doc: e,
2478
+ selection: r || void 0
2479
+ })
2480
+ });
2481
+ const s = this.state.reconfigure({
2482
+ plugins: this.extensionManager.plugins
2483
+ });
2484
+ this.view.updateState(s), this.createNodeViews(), this.prependClass();
2485
+ const o = this.view.dom;
2486
+ o.editor = this;
2487
+ }
2488
+ /**
2489
+ * Creates all node views.
2490
+ */
2491
+ createNodeViews() {
2492
+ this.view.isDestroyed || this.view.setProps({
2493
+ nodeViews: this.extensionManager.nodeViews
2494
+ });
2495
+ }
2496
+ /**
2497
+ * Prepend class name to element.
2498
+ */
2499
+ prependClass() {
2500
+ this.view.dom.className = `tiptap ${this.view.dom.className}`;
2501
+ }
2502
+ captureTransaction(t) {
2503
+ this.isCapturingTransaction = !0, t(), this.isCapturingTransaction = !1;
2504
+ const e = this.capturedTransaction;
2505
+ return this.capturedTransaction = null, e;
2506
+ }
2507
+ /**
2508
+ * The callback over which to send transactions (state updates) produced by the view.
2509
+ *
2510
+ * @param transaction An editor state transaction
2511
+ */
2512
+ dispatchTransaction(t) {
2513
+ if (this.view.isDestroyed)
2514
+ return;
2515
+ if (this.isCapturingTransaction) {
2516
+ if (!this.capturedTransaction) {
2517
+ this.capturedTransaction = t;
2518
+ return;
2519
+ }
2520
+ t.steps.forEach((i) => {
2521
+ var c;
2522
+ return (c = this.capturedTransaction) === null || c === void 0 ? void 0 : c.step(i);
2523
+ });
2524
+ return;
2525
+ }
2526
+ const e = this.state.apply(t), r = !this.state.selection.eq(e.selection);
2527
+ this.emit("beforeTransaction", {
2528
+ editor: this,
2529
+ transaction: t,
2530
+ nextState: e
2531
+ }), this.view.updateState(e), this.emit("transaction", {
2532
+ editor: this,
2533
+ transaction: t
2534
+ }), r && this.emit("selectionUpdate", {
2535
+ editor: this,
2536
+ transaction: t
2537
+ });
2538
+ const s = t.getMeta("focus"), o = t.getMeta("blur");
2539
+ s && this.emit("focus", {
2540
+ editor: this,
2541
+ event: s.event,
2542
+ transaction: t
2543
+ }), o && this.emit("blur", {
2544
+ editor: this,
2545
+ event: o.event,
2546
+ transaction: t
2547
+ }), !(!t.docChanged || t.getMeta("preventUpdate")) && this.emit("update", {
2548
+ editor: this,
2549
+ transaction: t
2550
+ });
2551
+ }
2552
+ /**
2553
+ * Get attributes of the currently selected node or mark.
2554
+ */
2555
+ getAttributes(t) {
2556
+ return Dn(this.state, t);
2557
+ }
2558
+ isActive(t, e) {
2559
+ const r = typeof t == "string" ? t : null, s = typeof t == "string" ? e : t;
2560
+ return zn(this.state, r, s);
2561
+ }
2562
+ /**
2563
+ * Get the document as JSON.
2564
+ */
2565
+ getJSON() {
2566
+ return this.state.doc.toJSON();
2567
+ }
2568
+ /**
2569
+ * Get the document as HTML.
2570
+ */
2571
+ getHTML() {
2572
+ return dt(this.state.doc.content, this.schema);
2573
+ }
2574
+ /**
2575
+ * Get the document as text.
2576
+ */
2577
+ getText(t) {
2578
+ const { blockSeparator: e = `
2579
+
2580
+ `, textSerializers: r = {} } = t || {};
2581
+ return jn(this.state.doc, {
2582
+ blockSeparator: e,
2583
+ textSerializers: {
2584
+ ...At(this.schema),
2585
+ ...r
2586
+ }
2587
+ });
2588
+ }
2589
+ /**
2590
+ * Check if there is no content.
2591
+ */
2592
+ get isEmpty() {
2593
+ return mt(this.state.doc);
2594
+ }
2595
+ /**
2596
+ * Get the number of characters for the current document.
2597
+ *
2598
+ * @deprecated
2599
+ */
2600
+ getCharacterCount() {
2601
+ return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'), this.state.doc.content.size - 2;
2602
+ }
2603
+ /**
2604
+ * Destroy the editor.
2605
+ */
2606
+ destroy() {
2607
+ if (this.emit("destroy"), this.view) {
2608
+ const t = this.view.dom;
2609
+ t && t.editor && delete t.editor, this.view.destroy();
2610
+ }
2611
+ this.removeAllListeners();
2612
+ }
2613
+ /**
2614
+ * Check if the editor is already destroyed.
2615
+ */
2616
+ get isDestroyed() {
2617
+ var t;
2618
+ return !(!((t = this.view) === null || t === void 0) && t.docView);
2619
+ }
2620
+ $node(t, e) {
2621
+ var r;
2622
+ return ((r = this.$doc) === null || r === void 0 ? void 0 : r.querySelector(t, e)) || null;
2623
+ }
2624
+ $nodes(t, e) {
2625
+ var r;
2626
+ return ((r = this.$doc) === null || r === void 0 ? void 0 : r.querySelectorAll(t, e)) || null;
2627
+ }
2628
+ $pos(t) {
2629
+ const e = this.state.doc.resolve(t);
2630
+ return new B(e, this);
2631
+ }
2632
+ get $doc() {
2633
+ return this.$pos(0);
2634
+ }
2635
+ };
2636
+ function Er(n) {
2637
+ return new X({
2638
+ find: n.find,
2639
+ handler: ({ state: t, range: e, match: r }) => {
2640
+ const s = k(n.getAttributes, void 0, r);
2641
+ if (s === !1 || s === null)
2642
+ return null;
2643
+ const { tr: o } = t, i = r[r.length - 1], c = r[0];
2644
+ if (i) {
2645
+ const a = c.search(/\S/), l = e.from + c.indexOf(i), u = l + i.length;
2646
+ if (Dt(e.from, e.to, t.doc).filter((p) => p.mark.type.excluded.find((h) => h === n.type && h !== p.mark.type)).filter((p) => p.to > l).length)
2647
+ return null;
2648
+ u < e.to && o.delete(u, e.to), l > e.from && o.delete(e.from + a, l);
2649
+ const f = e.from + a + i.length;
2650
+ o.addMark(e.from + a, f, n.type.create(s || {})), o.removeStoredMark(n.type);
2651
+ }
2652
+ }
2653
+ });
2654
+ }
2655
+ function xr(n) {
2656
+ return new X({
2657
+ find: n.find,
2658
+ handler: ({ state: t, range: e, match: r }) => {
2659
+ const s = k(n.getAttributes, void 0, r) || {}, { tr: o } = t, i = e.from;
2660
+ let c = e.to;
2661
+ const a = n.type.create(s);
2662
+ if (r[1]) {
2663
+ const l = r[0].lastIndexOf(r[1]);
2664
+ let u = i + l;
2665
+ u > c ? u = c : c = u + r[1].length;
2666
+ const d = r[0][r[0].length - 1];
2667
+ o.insertText(d, i + r[0].length - 1), o.replaceWith(u, c, a);
2668
+ } else if (r[0]) {
2669
+ const l = n.type.isInline ? i : i - 1;
2670
+ o.insert(l, n.type.create(s)).delete(o.mapping.map(i), o.mapping.map(c));
2671
+ }
2672
+ o.scrollIntoView();
2673
+ }
2674
+ });
2675
+ }
2676
+ function Cr(n) {
2677
+ return new X({
2678
+ find: n.find,
2679
+ handler: ({ state: t, range: e, match: r }) => {
2680
+ const s = t.doc.resolve(e.from), o = k(n.getAttributes, void 0, r) || {};
2681
+ if (!s.node(-1).canReplaceWith(s.index(-1), s.indexAfter(-1), n.type))
2682
+ return null;
2683
+ t.tr.delete(e.from, e.to).setBlockType(e.from, e.from, n.type, o);
2684
+ }
2685
+ });
2686
+ }
2687
+ function Tr(n) {
2688
+ return new X({
2689
+ find: n.find,
2690
+ handler: ({ state: t, range: e, match: r, chain: s }) => {
2691
+ const o = k(n.getAttributes, void 0, r) || {}, i = t.tr.delete(e.from, e.to), a = i.doc.resolve(e.from).blockRange(), l = a && Jt(a, n.type, o);
2692
+ if (!l)
2693
+ return null;
2694
+ if (i.wrap(a, l), n.keepMarks && n.editor) {
2695
+ const { selection: d, storedMarks: f } = t, { splittableMarks: p } = n.editor.extensionManager, m = f || d.$to.parentOffset && d.$from.marks();
2696
+ if (m) {
2697
+ const h = m.filter((g) => p.includes(g.type.name));
2698
+ i.ensureMarks(h);
2699
+ }
2700
+ }
2701
+ if (n.keepAttributes) {
2702
+ const d = n.type.name === "bulletList" || n.type.name === "orderedList" ? "listItem" : "taskList";
2703
+ s().updateAttributes(d, o).run();
2704
+ }
2705
+ const u = i.doc.resolve(e.from - 1).nodeBefore;
2706
+ u && u.type === n.type && lt(i.doc, e.from - 1) && (!n.joinPredicate || n.joinPredicate(r, u)) && i.join(e.from - 1);
2707
+ }
2708
+ });
2709
+ }
2710
+ class ct {
2711
+ constructor(t = {}) {
2712
+ this.type = "node", this.name = "node", this.parent = null, this.child = null, this.config = {
2713
+ name: this.name,
2714
+ defaultOptions: {}
2715
+ }, this.config = {
2716
+ ...this.config,
2717
+ ...t
2718
+ }, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = k(b(this, "addOptions", {
2719
+ name: this.name
2720
+ }))), this.storage = k(b(this, "addStorage", {
2721
+ name: this.name,
2722
+ options: this.options
2723
+ })) || {};
2724
+ }
2725
+ static create(t = {}) {
2726
+ return new ct(t);
2727
+ }
2728
+ configure(t = {}) {
2729
+ const e = this.extend({
2730
+ ...this.config,
2731
+ addOptions: () => Z(this.options, t)
2732
+ });
2733
+ return e.name = this.name, e.parent = this.parent, e;
2734
+ }
2735
+ extend(t = {}) {
2736
+ const e = new ct(t);
2737
+ return e.parent = this, this.child = e, e.name = t.name ? t.name : e.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`), e.options = k(b(e, "addOptions", {
2738
+ name: e.name
2739
+ })), e.storage = k(b(e, "addStorage", {
2740
+ name: e.name,
2741
+ options: e.options
2742
+ })), e;
2743
+ }
2744
+ }
2745
+ function Pr(n) {
2746
+ return new Re({
2747
+ find: n.find,
2748
+ handler: ({ state: t, range: e, match: r, pasteEvent: s }) => {
2749
+ const o = k(n.getAttributes, void 0, r, s);
2750
+ if (o === !1 || o === null)
2751
+ return null;
2752
+ const { tr: i } = t, c = r[r.length - 1], a = r[0];
2753
+ let l = e.to;
2754
+ if (c) {
2755
+ const u = a.search(/\S/), d = e.from + a.indexOf(c), f = d + c.length;
2756
+ if (Dt(e.from, e.to, t.doc).filter((m) => m.mark.type.excluded.find((g) => g === n.type && g !== m.mark.type)).filter((m) => m.to > d).length)
2757
+ return null;
2758
+ f < e.to && i.delete(f, e.to), d > e.from && i.delete(e.from + u, d), l = e.from + u + c.length, i.addMark(e.from + u, l, n.type.create(o || {})), i.removeStoredMark(n.type);
2759
+ }
2760
+ }
2761
+ });
2762
+ }
2763
+ function Ar(n, t) {
2764
+ const { selection: e } = n, { $from: r } = e;
2765
+ if (e instanceof G) {
2766
+ const o = r.index();
2767
+ return r.parent.canReplaceWith(o, o + 1, t);
2768
+ }
2769
+ let s = r.depth;
2770
+ for (; s >= 0; ) {
2771
+ const o = r.index(s);
2772
+ if (r.node(s).contentMatchAt(o).matchType(t))
2773
+ return !0;
2774
+ s -= 1;
2775
+ }
2776
+ return !1;
2777
+ }
2778
+ export {
2779
+ C as E,
2780
+ U as M,
2781
+ ct as N,
2782
+ Pr as a,
2783
+ Er as b,
2784
+ kr as c,
2785
+ At as d,
2786
+ k as e,
2787
+ b as f,
2788
+ jn as g,
2789
+ Ar as h,
2790
+ It as i,
2791
+ gr as j,
2792
+ br as k,
2793
+ yr as l,
2794
+ Te as m,
2795
+ xr as n,
2796
+ Dt as o,
2797
+ vr as p,
2798
+ Dn as q,
2799
+ mt as r,
2800
+ Bn as s,
2801
+ Cr as t,
2802
+ wr as u,
2803
+ dt as v,
2804
+ Tr as w,
2805
+ Mr as x
2806
+ };