@gsc-basic/components 1.1.6 → 1.1.8

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 (1097) hide show
  1. package/README.md +8 -8
  2. package/dist/es/Button/index.js +9 -4
  3. package/dist/es/Button/src/Button.css +3 -3
  4. package/dist/es/Button/src/Button.vue.js +44 -4
  5. package/dist/es/Button/src/Button2.css +3 -3
  6. package/dist/es/CodeEditor/index.js +9 -4
  7. package/dist/es/CodeEditor/src/index.css +4 -4
  8. package/dist/es/CodeEditor/src/index.vue.js +148 -4
  9. package/dist/es/CodeEditor/src/index2.css +3 -3
  10. package/dist/es/CodeEditor/src/index3.css +4 -4
  11. package/dist/es/ConfigProvider/index.js +9 -4
  12. package/dist/es/ConfigProvider/src/configProvider.js +17 -4
  13. package/dist/es/ConfigProvider/src/configProviderProps.js +25 -4
  14. package/dist/es/ConfigProvider/src/constants.js +12 -4
  15. package/dist/es/ConfigProvider/src/useGlobalConfig.js +48 -4
  16. package/dist/es/CountTo/index.js +9 -4
  17. package/dist/es/CountTo/src/index.css +3 -3
  18. package/dist/es/CountTo/src/index.vue.js +126 -4
  19. package/dist/es/Ellipsis/index.js +9 -4
  20. package/dist/es/Ellipsis/src/components/JsEllipsis.css +3 -3
  21. package/dist/es/Ellipsis/src/components/JsEllipsis.vue.js +181 -4
  22. package/dist/es/Ellipsis/src/components/NativeEllipsis.css +3 -3
  23. package/dist/es/Ellipsis/src/components/NativeEllipsis.vue.js +44 -4
  24. package/dist/es/Ellipsis/src/components/NativeEllipsis2.css +3 -3
  25. package/dist/es/Ellipsis/src/index.css +3 -3
  26. package/dist/es/Ellipsis/src/index.vue.js +96 -4
  27. package/dist/es/Ellipsis/src/utils/utils.js +59 -4
  28. package/dist/es/Form/index.js +9 -4
  29. package/dist/es/Form/src/Form.css +3 -3
  30. package/dist/es/Form/src/Form.vue.js +377 -4
  31. package/dist/es/Form/src/Form2.css +3 -3
  32. package/dist/es/Form/src/styles/form.css +3 -3
  33. package/dist/es/Marquee/index.js +9 -4
  34. package/dist/es/Marquee/src/index.css +3 -3
  35. package/dist/es/Marquee/src/index.vue.js +191 -4
  36. package/dist/es/Marquee/src/index2.css +3 -3
  37. package/dist/es/Overlay/index.js +64 -4
  38. package/dist/es/Overlay/src/Message.css +3 -3
  39. package/dist/es/Overlay/src/Message.vue.js +39 -4
  40. package/dist/es/Overlay/src/Message2.css +3 -3
  41. package/dist/es/Overlay/src/Modal.css +3 -3
  42. package/dist/es/Overlay/src/Modal.vue.js +70 -4
  43. package/dist/es/Overlay/src/Modal2.css +3 -3
  44. package/dist/es/Overlay/src/Notice.css +3 -3
  45. package/dist/es/Overlay/src/Notice.vue.js +40 -4
  46. package/dist/es/Overlay/src/Notice2.css +3 -3
  47. package/dist/es/Overlay/src/Tooltip.css +3 -3
  48. package/dist/es/Overlay/src/Tooltip.vue.js +87 -4
  49. package/dist/es/Overlay/src/Tooltip2.css +3 -3
  50. package/dist/es/RichTextEditor/index.js +9 -4
  51. package/dist/es/RichTextEditor/src/ToolbarPanel.css +3 -3
  52. package/dist/es/RichTextEditor/src/ToolbarPanel.vue.js +162 -4
  53. package/dist/es/RichTextEditor/src/ToolbarPanel2.css +3 -3
  54. package/dist/es/RichTextEditor/src/components/BlockquoteButton.css +4 -4
  55. package/dist/es/RichTextEditor/src/components/BlockquoteButton.vue.js +40 -4
  56. package/dist/es/RichTextEditor/src/components/CodeBlockButton.css +4 -4
  57. package/dist/es/RichTextEditor/src/components/CodeBlockButton.vue.js +40 -4
  58. package/dist/es/RichTextEditor/src/components/ColorHighlightPopover.css +3 -3
  59. package/dist/es/RichTextEditor/src/components/ColorHighlightPopover.vue.js +40 -4
  60. package/dist/es/RichTextEditor/src/components/FontSizeDropdownMenu.css +3 -3
  61. package/dist/es/RichTextEditor/src/components/FontSizeDropdownMenu.vue.js +58 -4
  62. package/dist/es/RichTextEditor/src/components/HeadingDropdownMenu.css +3 -3
  63. package/dist/es/RichTextEditor/src/components/HeadingDropdownMenu.vue.js +69 -4
  64. package/dist/es/RichTextEditor/src/components/ImageUploadButton.css +4 -4
  65. package/dist/es/RichTextEditor/src/components/ImageUploadButton.vue.js +74 -4
  66. package/dist/es/RichTextEditor/src/components/LinkPopover.css +4 -4
  67. package/dist/es/RichTextEditor/src/components/LinkPopover.vue.js +92 -4
  68. package/dist/es/RichTextEditor/src/components/LinkPopover2.css +4 -4
  69. package/dist/es/RichTextEditor/src/components/ListDropdownMenu.css +3 -3
  70. package/dist/es/RichTextEditor/src/components/ListDropdownMenu.vue.js +76 -4
  71. package/dist/es/RichTextEditor/src/components/MarkButton.css +4 -4
  72. package/dist/es/RichTextEditor/src/components/MarkButton.vue.js +89 -4
  73. package/dist/es/RichTextEditor/src/components/TableButton.css +3 -3
  74. package/dist/es/RichTextEditor/src/components/TableButton.vue.js +165 -4
  75. package/dist/es/RichTextEditor/src/components/TextAlignDropdownMenu.css +3 -3
  76. package/dist/es/RichTextEditor/src/components/TextAlignDropdownMenu.vue.js +85 -4
  77. package/dist/es/RichTextEditor/src/components/TextColorPopover.css +3 -3
  78. package/dist/es/RichTextEditor/src/components/TextColorPopover.vue.js +40 -4
  79. package/dist/es/RichTextEditor/src/components/ToolbarGroup.css +3 -3
  80. package/dist/es/RichTextEditor/src/components/ToolbarGroup.vue.js +19 -4
  81. package/dist/es/RichTextEditor/src/components/ToolbarSeparator.css +3 -3
  82. package/dist/es/RichTextEditor/src/components/ToolbarSeparator.vue.js +17 -4
  83. package/dist/es/RichTextEditor/src/components/UndoRedoButton.css +4 -4
  84. package/dist/es/RichTextEditor/src/components/UndoRedoButton.vue.js +54 -4
  85. package/dist/es/RichTextEditor/src/components/VideoUploadButton.css +4 -4
  86. package/dist/es/RichTextEditor/src/components/VideoUploadButton.vue.js +74 -4
  87. package/dist/es/RichTextEditor/src/components/basic/ColorPicker.css +4 -4
  88. package/dist/es/RichTextEditor/src/components/basic/ColorPicker.vue.js +101 -4
  89. package/dist/es/RichTextEditor/src/components/basic/MediaUploadModal.css +3 -3
  90. package/dist/es/RichTextEditor/src/components/basic/MediaUploadModal.vue.js +364 -4
  91. package/dist/es/RichTextEditor/src/components/basic/MediaUploadModal2.css +3 -3
  92. package/dist/es/RichTextEditor/src/components/basic/SelectMenu.css +4 -4
  93. package/dist/es/RichTextEditor/src/components/basic/SelectMenu.vue.js +137 -4
  94. package/dist/es/RichTextEditor/src/components/basic/SelectMenu2.css +4 -4
  95. package/dist/es/RichTextEditor/src/constant/index.js +53 -4
  96. package/dist/es/RichTextEditor/src/extensions/video.js +68 -4
  97. package/dist/es/RichTextEditor/src/index.css +4 -4
  98. package/dist/es/RichTextEditor/src/index.vue.js +158 -4
  99. package/dist/es/RichTextEditor/src/index2.css +4 -4
  100. package/dist/es/RichTextEditor/src/props.js +24 -4
  101. package/dist/es/ScaleScreen/index.js +9 -4
  102. package/dist/es/ScaleScreen/src/index.css +3 -3
  103. package/dist/es/ScaleScreen/src/index.vue.js +118 -4
  104. package/dist/es/ScaleScreen/src/index2.css +3 -3
  105. package/dist/es/Transition/index.js +30 -4
  106. package/dist/es/Transition/src/CollapseTransition.css +3 -3
  107. package/dist/es/Transition/src/CollapseTransition.vue.js +44 -4
  108. package/dist/es/Transition/src/CollapseTransition2.css +3 -3
  109. package/dist/es/Transition/src/CreateTransition.js +75 -6
  110. package/dist/es/Transition/src/ExpandTransition.js +42 -4
  111. package/dist/es/Transition/src/style/index.css +3 -3
  112. package/dist/es/Transition/style.js +4 -4
  113. package/dist/es/VideoBackground/index.js +9 -4
  114. package/dist/es/VideoBackground/src/helper.js +32 -4
  115. package/dist/es/VideoBackground/src/index.css +3 -3
  116. package/dist/es/VideoBackground/src/index.vue.js +111 -4
  117. package/dist/es/VideoBackground/src/index2.css +3 -3
  118. package/dist/es/VideoBackground/src/index3.css +3 -3
  119. package/dist/es/VideoBackground/src/videoBackground.js +34 -4
  120. package/dist/es/VideoPlayer/index.js +9 -4
  121. package/dist/es/VideoPlayer/src/index.css +3 -3
  122. package/dist/es/VideoPlayer/src/index.vue.js +63 -4
  123. package/dist/es/VirtualScroll/index.js +9 -4
  124. package/dist/es/VirtualScroll/src/index.css +3 -3
  125. package/dist/es/VirtualScroll/src/index.vue.js +11 -4
  126. package/dist/es/VirtualScroll/src/index.vue2.js +107 -4
  127. package/dist/es/VirtualScroll/src/index2.css +3 -3
  128. package/dist/es/_virtual/_commonjsHelpers.js +9 -4
  129. package/dist/es/_virtual/_plugin-vue_export-helper.js +12 -4
  130. package/dist/es/_virtual/delegate.js +10 -4
  131. package/dist/es/_virtual/download.js +10 -4
  132. package/dist/es/_virtual/download2.js +7 -4
  133. package/dist/es/_virtual/index.js +5 -4
  134. package/dist/es/_virtual/index2.js +7 -4
  135. package/dist/es/_virtual/index3.js +21 -0
  136. package/dist/es/{Grid/src/components/CellEditor.css → _virtual/index4.js} +7 -4
  137. package/dist/es/hooks/useLocale.js +28 -4
  138. package/dist/es/hooks/useNamespace.js +11 -4
  139. package/dist/es/index.js +79 -4
  140. package/dist/es/locale/lang/en-US.js +167 -4
  141. package/dist/es/locale/lang/ja-JP.js +167 -4
  142. package/dist/es/locale/lang/zh-CN.js +167 -4
  143. package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +1379 -4
  144. package/dist/es/node_modules/@codemirror/commands/dist/index.js +847 -4
  145. package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +41 -6
  146. package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +315 -20
  147. package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +51 -6
  148. package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +402 -15
  149. package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +500 -7
  150. package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +219 -7
  151. package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +54 -6
  152. package/dist/es/node_modules/@codemirror/language/dist/index.js +1304 -4
  153. package/dist/es/node_modules/@codemirror/lint/dist/index.js +660 -6
  154. package/dist/es/node_modules/@codemirror/search/dist/index.js +842 -5
  155. package/dist/es/node_modules/@codemirror/state/dist/index.js +2646 -4
  156. package/dist/es/node_modules/@codemirror/theme-one-dark/dist/index.js +135 -4
  157. package/dist/es/node_modules/@codemirror/view/dist/index.js +7492 -4
  158. package/dist/es/node_modules/@lezer/common/dist/index.js +1433 -5
  159. package/dist/es/node_modules/@lezer/highlight/dist/index.js +640 -4
  160. package/dist/es/node_modules/@lezer/java/dist/index.js +65 -4
  161. package/dist/es/node_modules/@lezer/javascript/dist/index.js +164 -4
  162. package/dist/es/node_modules/@lezer/json/dist/index.js +37 -4
  163. package/dist/es/node_modules/@lezer/lr/dist/index.js +1312 -4
  164. package/dist/es/node_modules/@lezer/python/dist/index.js +224 -4
  165. package/dist/es/node_modules/@lezer/xml/dist/index.js +103 -4
  166. package/dist/es/node_modules/@lezer/yaml/dist/index.js +277 -4
  167. package/dist/es/node_modules/@marijn/find-cluster-break/src/index.js +72 -4
  168. package/dist/es/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +181 -4
  169. package/dist/es/node_modules/@tanstack/form-core/dist/esm/EventClient.js +16 -4
  170. package/dist/es/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +409 -4
  171. package/dist/es/node_modules/@tanstack/form-core/dist/esm/FormApi.js +792 -4
  172. package/dist/es/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +58 -4
  173. package/dist/es/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +112 -5
  174. package/dist/es/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +48 -4
  175. package/dist/es/node_modules/@tanstack/form-core/dist/esm/utils.js +216 -4
  176. package/dist/es/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +32 -4
  177. package/dist/es/node_modules/@tanstack/store/dist/esm/alien.js +221 -0
  178. package/dist/es/node_modules/@tanstack/store/dist/esm/atom.js +136 -0
  179. package/dist/es/node_modules/@tanstack/store/dist/esm/batch.js +25 -0
  180. package/dist/es/node_modules/@tanstack/store/dist/esm/store.js +47 -4
  181. package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useField.js +41 -4
  182. package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useForm.js +36 -4
  183. package/dist/es/node_modules/@tanstack/vue-store/dist/esm/index.js +51 -4
  184. package/dist/es/node_modules/@tiptap/core/dist/index.js +3984 -4
  185. package/dist/es/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +20 -4
  186. package/dist/es/node_modules/@tiptap/extension-blockquote/dist/index.js +60 -5
  187. package/dist/es/node_modules/@tiptap/extension-bold/dist/index.js +82 -5
  188. package/dist/es/node_modules/@tiptap/extension-character-count/dist/index.js +9 -4
  189. package/dist/es/node_modules/@tiptap/extension-code/dist/index.js +57 -4
  190. package/dist/es/node_modules/@tiptap/extension-code-block/dist/index.js +220 -4
  191. package/dist/es/node_modules/@tiptap/extension-document/dist/index.js +15 -4
  192. package/dist/es/node_modules/@tiptap/extension-hard-break/dist/index.js +62 -4
  193. package/dist/es/node_modules/@tiptap/extension-heading/dist/index.js +66 -4
  194. package/dist/es/node_modules/@tiptap/extension-highlight/dist/index.js +88 -4
  195. package/dist/es/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +59 -4
  196. package/dist/es/node_modules/@tiptap/extension-image/dist/index.js +133 -4
  197. package/dist/es/node_modules/@tiptap/extension-italic/dist/index.js +80 -4
  198. package/dist/es/node_modules/@tiptap/extension-link/dist/index.js +316 -4
  199. package/dist/es/node_modules/@tiptap/extension-list/dist/index.js +731 -4
  200. package/dist/es/node_modules/@tiptap/extension-paragraph/dist/index.js +47 -4
  201. package/dist/es/node_modules/@tiptap/extension-strike/dist/index.js +69 -4
  202. package/dist/es/node_modules/@tiptap/extension-subscript/dist/index.js +44 -4
  203. package/dist/es/node_modules/@tiptap/extension-superscript/dist/index.js +44 -4
  204. package/dist/es/node_modules/@tiptap/extension-table/dist/index.js +383 -4
  205. package/dist/es/node_modules/@tiptap/extension-task-item/dist/index.js +9 -4
  206. package/dist/es/node_modules/@tiptap/extension-task-list/dist/index.js +9 -4
  207. package/dist/es/node_modules/@tiptap/extension-text/dist/index.js +16 -4
  208. package/dist/es/node_modules/@tiptap/extension-text-align/dist/index.js +50 -4
  209. package/dist/es/node_modules/@tiptap/extension-text-style/dist/index.js +243 -4
  210. package/dist/es/node_modules/@tiptap/extension-underline/dist/index.js +68 -4
  211. package/dist/es/node_modules/@tiptap/extensions/dist/index.js +299 -4
  212. package/dist/es/node_modules/@tiptap/html/dist/index.js +28 -0
  213. package/dist/es/node_modules/@tiptap/starter-kit/dist/index.js +32 -4
  214. package/dist/es/node_modules/@tiptap/vue-3/dist/index.js +260 -4
  215. package/dist/es/node_modules/@vueuse/core/dist/index.js +354 -4
  216. package/dist/es/node_modules/@vueuse/shared/dist/index.js +139 -4
  217. package/dist/es/node_modules/codemirror/dist/index.js +43 -4
  218. package/dist/es/node_modules/crelt/index.js +30 -4
  219. package/dist/es/node_modules/delegate/src/closest.js +24 -4
  220. package/dist/es/node_modules/delegate/src/delegate.js +32 -4
  221. package/dist/es/node_modules/downloadjs/download.js +80 -4
  222. package/dist/es/node_modules/eventemitter3/index.js +114 -4
  223. package/dist/es/node_modules/linkifyjs/dist/linkify.js +710 -4
  224. package/dist/es/node_modules/lodash-es/_DataView.js +9 -4
  225. package/dist/es/node_modules/lodash-es/_Hash.js +23 -4
  226. package/dist/es/node_modules/lodash-es/_ListCache.js +23 -4
  227. package/dist/es/node_modules/lodash-es/_Map.js +9 -4
  228. package/dist/es/node_modules/lodash-es/_MapCache.js +23 -4
  229. package/dist/es/node_modules/lodash-es/_Promise.js +9 -4
  230. package/dist/es/node_modules/lodash-es/_Set.js +9 -4
  231. package/dist/es/node_modules/lodash-es/_SetCache.js +26 -0
  232. package/dist/es/node_modules/lodash-es/_Stack.js +21 -4
  233. package/dist/es/node_modules/lodash-es/_Symbol.js +8 -4
  234. package/dist/es/node_modules/lodash-es/_Uint8Array.js +8 -4
  235. package/dist/es/node_modules/lodash-es/_WeakMap.js +9 -4
  236. package/dist/es/node_modules/lodash-es/_apply.js +19 -4
  237. package/dist/es/node_modules/lodash-es/_arrayEach.js +11 -4
  238. package/dist/es/node_modules/lodash-es/_arrayFilter.js +13 -4
  239. package/dist/es/node_modules/lodash-es/_arrayIncludes.js +21 -0
  240. package/dist/es/node_modules/lodash-es/_arrayIncludesWith.js +22 -0
  241. package/dist/es/node_modules/lodash-es/_arrayLikeKeys.js +23 -4
  242. package/dist/es/node_modules/lodash-es/_arrayMap.js +11 -4
  243. package/dist/es/node_modules/lodash-es/_arrayPush.js +11 -4
  244. package/dist/es/node_modules/lodash-es/_arraySome.js +22 -0
  245. package/dist/es/node_modules/lodash-es/_asciiToArray.js +9 -4
  246. package/dist/es/node_modules/lodash-es/_assignMergeValue.js +21 -0
  247. package/dist/es/node_modules/lodash-es/_assignValue.js +13 -4
  248. package/dist/es/node_modules/lodash-es/_assocIndexOf.js +13 -4
  249. package/dist/es/node_modules/lodash-es/_baseAssignValue.js +15 -4
  250. package/dist/es/node_modules/lodash-es/_baseClone.js +57 -4
  251. package/dist/es/node_modules/lodash-es/_baseCreate.js +30 -0
  252. package/dist/es/node_modules/lodash-es/_baseFindIndex.js +22 -0
  253. package/dist/es/node_modules/lodash-es/_baseFlatten.js +16 -4
  254. package/dist/es/node_modules/lodash-es/_baseFor.js +18 -0
  255. package/dist/es/node_modules/lodash-es/_baseGet.js +14 -4
  256. package/dist/es/node_modules/lodash-es/_baseGetAllKeys.js +12 -4
  257. package/dist/es/node_modules/lodash-es/_baseGetTag.js +13 -4
  258. package/dist/es/node_modules/lodash-es/_baseIndexOf.js +22 -0
  259. package/dist/es/node_modules/lodash-es/_baseIntersection.js +42 -0
  260. package/dist/es/node_modules/lodash-es/_baseIsArguments.js +12 -4
  261. package/dist/es/node_modules/lodash-es/_baseIsEqual.js +21 -0
  262. package/dist/es/node_modules/lodash-es/_baseIsEqualDeep.js +45 -0
  263. package/dist/es/node_modules/lodash-es/_baseIsMap.js +12 -4
  264. package/dist/{lib/Grid/src/components/CellEditor.css → es/node_modules/lodash-es/_baseIsNaN.js} +9 -4
  265. package/dist/es/node_modules/lodash-es/_baseIsNative.js +19 -4
  266. package/dist/es/node_modules/lodash-es/_baseIsRegExp.js +12 -4
  267. package/dist/es/node_modules/lodash-es/_baseIsSet.js +12 -4
  268. package/dist/es/node_modules/lodash-es/_baseIsTypedArray.js +15 -4
  269. package/dist/es/node_modules/lodash-es/_baseKeys.js +27 -0
  270. package/dist/es/node_modules/lodash-es/_baseKeysIn.js +18 -4
  271. package/dist/es/node_modules/lodash-es/_baseMerge.js +33 -0
  272. package/dist/es/node_modules/lodash-es/_baseMergeDeep.js +44 -0
  273. package/dist/es/node_modules/lodash-es/_baseRest.js +22 -0
  274. package/dist/es/node_modules/lodash-es/_baseSetToString.js +17 -4
  275. package/dist/es/node_modules/lodash-es/_baseSlice.js +13 -4
  276. package/dist/es/node_modules/lodash-es/_baseTimes.js +11 -4
  277. package/dist/es/node_modules/lodash-es/_baseToString.js +21 -4
  278. package/dist/es/node_modules/lodash-es/_baseUnary.js +11 -4
  279. package/dist/es/node_modules/lodash-es/_baseUniq.js +46 -0
  280. package/dist/es/node_modules/lodash-es/_baseUnset.js +31 -4
  281. package/dist/es/node_modules/{@tanstack/store/dist/esm/types.js → lodash-es/_cacheHas.js} +9 -4
  282. package/dist/es/node_modules/lodash-es/_castArrayLikeObject.js +20 -0
  283. package/dist/es/node_modules/lodash-es/_castPath.js +13 -4
  284. package/dist/es/node_modules/lodash-es/_castSlice.js +11 -4
  285. package/dist/es/node_modules/lodash-es/_cloneArrayBuffer.js +11 -4
  286. package/dist/es/node_modules/lodash-es/_cloneBuffer.js +14 -4
  287. package/dist/es/node_modules/lodash-es/_cloneDataView.js +11 -4
  288. package/dist/es/node_modules/lodash-es/_cloneRegExp.js +11 -4
  289. package/dist/es/node_modules/lodash-es/_cloneSymbol.js +11 -4
  290. package/dist/es/node_modules/lodash-es/_cloneTypedArray.js +11 -4
  291. package/dist/es/node_modules/lodash-es/_copyArray.js +22 -0
  292. package/dist/es/node_modules/lodash-es/_copyObject.js +17 -4
  293. package/dist/es/node_modules/lodash-es/_coreJsData.js +8 -4
  294. package/dist/es/node_modules/lodash-es/_createAssigner.js +28 -0
  295. package/dist/es/node_modules/lodash-es/_createBaseFor.js +26 -0
  296. package/dist/es/node_modules/lodash-es/_createCaseFirst.js +17 -4
  297. package/dist/es/node_modules/lodash-es/_createSet.js +22 -0
  298. package/dist/es/node_modules/lodash-es/_customOmitClone.js +10 -4
  299. package/dist/es/node_modules/lodash-es/_defineProperty.js +14 -4
  300. package/dist/es/node_modules/lodash-es/_equalArrays.js +53 -0
  301. package/dist/es/node_modules/lodash-es/_equalByTag.js +58 -0
  302. package/dist/es/node_modules/lodash-es/_equalObjects.js +49 -0
  303. package/dist/es/node_modules/lodash-es/_flatRest.js +12 -4
  304. package/dist/es/node_modules/lodash-es/_freeGlobal.js +7 -4
  305. package/dist/es/node_modules/lodash-es/_getAllKeys.js +22 -0
  306. package/dist/es/node_modules/lodash-es/_getAllKeysIn.js +12 -4
  307. package/dist/es/node_modules/lodash-es/_getMapData.js +11 -4
  308. package/dist/es/node_modules/lodash-es/_getNative.js +12 -4
  309. package/dist/es/node_modules/lodash-es/_getPrototype.js +8 -4
  310. package/dist/es/node_modules/lodash-es/_getRawTag.js +18 -4
  311. package/dist/es/node_modules/lodash-es/_getSymbols.js +13 -4
  312. package/dist/es/node_modules/lodash-es/_getSymbolsIn.js +15 -4
  313. package/dist/es/node_modules/lodash-es/_getTag.js +31 -4
  314. package/dist/es/node_modules/lodash-es/_getValue.js +9 -4
  315. package/dist/es/node_modules/lodash-es/_hasUnicode.js +10 -4
  316. package/dist/es/node_modules/lodash-es/_hashClear.js +10 -4
  317. package/dist/es/node_modules/lodash-es/_hashDelete.js +10 -4
  318. package/dist/es/node_modules/lodash-es/_hashGet.js +16 -4
  319. package/dist/es/node_modules/lodash-es/_hashHas.js +12 -4
  320. package/dist/es/node_modules/lodash-es/_hashSet.js +12 -4
  321. package/dist/es/node_modules/lodash-es/_initCloneArray.js +11 -4
  322. package/dist/es/node_modules/lodash-es/_initCloneByTag.js +45 -4
  323. package/dist/es/node_modules/lodash-es/_initCloneObject.js +22 -0
  324. package/dist/es/node_modules/lodash-es/_isFlattenable.js +13 -4
  325. package/dist/es/node_modules/lodash-es/_isIndex.js +11 -4
  326. package/dist/es/node_modules/lodash-es/_isIterateeCall.js +26 -0
  327. package/dist/es/node_modules/lodash-es/_isKey.js +15 -4
  328. package/dist/es/node_modules/lodash-es/_isKeyable.js +10 -4
  329. package/dist/es/node_modules/lodash-es/_isMasked.js +14 -4
  330. package/dist/es/node_modules/lodash-es/_isPrototype.js +11 -4
  331. package/dist/es/node_modules/lodash-es/_listCacheClear.js +9 -4
  332. package/dist/es/node_modules/lodash-es/_listCacheDelete.js +15 -4
  333. package/dist/es/node_modules/lodash-es/_listCacheGet.js +11 -4
  334. package/dist/es/node_modules/lodash-es/_listCacheHas.js +10 -4
  335. package/dist/es/node_modules/lodash-es/_listCacheSet.js +11 -4
  336. package/dist/es/node_modules/lodash-es/_mapCacheClear.js +16 -4
  337. package/dist/es/node_modules/lodash-es/_mapCacheDelete.js +11 -4
  338. package/dist/es/node_modules/lodash-es/_mapCacheGet.js +10 -4
  339. package/dist/es/node_modules/lodash-es/_mapCacheHas.js +10 -4
  340. package/dist/es/node_modules/lodash-es/_mapCacheSet.js +11 -4
  341. package/dist/es/node_modules/lodash-es/_mapToArray.js +22 -0
  342. package/dist/es/node_modules/lodash-es/_memoizeCapped.js +14 -4
  343. package/dist/es/node_modules/lodash-es/_nativeCreate.js +8 -4
  344. package/dist/es/node_modules/lodash-es/_nativeKeys.js +18 -0
  345. package/dist/es/node_modules/lodash-es/_nativeKeysIn.js +13 -4
  346. package/dist/es/node_modules/lodash-es/_nodeUtil.js +14 -4
  347. package/dist/es/node_modules/lodash-es/_objectToString.js +10 -4
  348. package/dist/es/node_modules/lodash-es/_overArg.js +11 -4
  349. package/dist/es/node_modules/lodash-es/_overRest.js +18 -4
  350. package/dist/es/node_modules/lodash-es/_parent.js +11 -4
  351. package/dist/es/node_modules/lodash-es/_root.js +8 -4
  352. package/dist/es/node_modules/lodash-es/_safeGet.js +20 -0
  353. package/dist/es/node_modules/lodash-es/_setCacheAdd.js +20 -0
  354. package/dist/es/node_modules/lodash-es/_setCacheHas.js +19 -0
  355. package/dist/es/node_modules/lodash-es/_setToArray.js +22 -0
  356. package/dist/es/node_modules/lodash-es/_setToString.js +9 -4
  357. package/dist/es/node_modules/lodash-es/_shortOut.js +19 -4
  358. package/dist/es/node_modules/lodash-es/_stackClear.js +10 -4
  359. package/dist/es/node_modules/lodash-es/_stackDelete.js +10 -4
  360. package/dist/es/node_modules/lodash-es/_stackGet.js +9 -4
  361. package/dist/es/node_modules/lodash-es/_stackHas.js +9 -4
  362. package/dist/es/node_modules/lodash-es/_stackSet.js +20 -4
  363. package/dist/es/node_modules/lodash-es/_strictIndexOf.js +22 -0
  364. package/dist/es/node_modules/lodash-es/_stringToArray.js +12 -4
  365. package/dist/es/node_modules/lodash-es/_stringToPath.js +13 -4
  366. package/dist/es/node_modules/lodash-es/_toKey.js +13 -4
  367. package/dist/es/node_modules/lodash-es/_toSource.js +20 -4
  368. package/dist/es/node_modules/lodash-es/_unicodeToArray.js +10 -4
  369. package/dist/es/node_modules/lodash-es/constant.js +11 -4
  370. package/dist/es/node_modules/lodash-es/eq.js +9 -4
  371. package/dist/es/node_modules/lodash-es/flatten.js +11 -4
  372. package/dist/es/node_modules/lodash-es/get.js +11 -4
  373. package/dist/es/node_modules/lodash-es/identity.js +9 -4
  374. package/dist/es/node_modules/lodash-es/intersectionWith.js +25 -0
  375. package/dist/es/node_modules/lodash-es/isArguments.js +13 -4
  376. package/dist/es/node_modules/lodash-es/isArray.js +7 -4
  377. package/dist/es/node_modules/lodash-es/isArrayLike.js +11 -4
  378. package/dist/es/node_modules/lodash-es/isArrayLikeObject.js +21 -0
  379. package/dist/es/node_modules/lodash-es/isBuffer.js +9 -4
  380. package/dist/es/node_modules/lodash-es/isEqual.js +20 -0
  381. package/dist/es/node_modules/lodash-es/isFinite.js +11 -4
  382. package/dist/es/node_modules/lodash-es/isFunction.js +15 -4
  383. package/dist/es/node_modules/lodash-es/isLength.js +10 -4
  384. package/dist/es/node_modules/lodash-es/isMap.js +10 -4
  385. package/dist/es/node_modules/lodash-es/isNaN.js +10 -4
  386. package/dist/es/node_modules/lodash-es/isNil.js +9 -4
  387. package/dist/es/node_modules/lodash-es/isNumber.js +12 -4
  388. package/dist/es/node_modules/lodash-es/isObject.js +10 -4
  389. package/dist/es/node_modules/lodash-es/isObjectLike.js +9 -4
  390. package/dist/es/node_modules/lodash-es/isPlainObject.js +19 -4
  391. package/dist/es/node_modules/lodash-es/isRegExp.js +10 -4
  392. package/dist/es/node_modules/lodash-es/isSet.js +10 -4
  393. package/dist/es/node_modules/lodash-es/isString.js +13 -4
  394. package/dist/es/node_modules/lodash-es/isSymbol.js +12 -4
  395. package/dist/es/node_modules/lodash-es/isTypedArray.js +10 -4
  396. package/dist/es/node_modules/lodash-es/keys.js +22 -0
  397. package/dist/es/node_modules/lodash-es/keysIn.js +12 -4
  398. package/dist/es/node_modules/lodash-es/last.js +10 -4
  399. package/dist/es/node_modules/lodash-es/memoize.js +21 -4
  400. package/dist/es/node_modules/lodash-es/mergeWith.js +21 -0
  401. package/dist/es/node_modules/lodash-es/noop.js +18 -0
  402. package/dist/es/node_modules/lodash-es/omit.js +26 -4
  403. package/dist/es/node_modules/lodash-es/stubArray.js +9 -4
  404. package/dist/es/node_modules/lodash-es/stubFalse.js +9 -4
  405. package/dist/es/node_modules/lodash-es/toPlainObject.js +21 -0
  406. package/dist/es/node_modules/lodash-es/toString.js +10 -4
  407. package/dist/es/node_modules/lodash-es/unionWith.js +25 -0
  408. package/dist/es/node_modules/lodash-es/upperFirst.js +8 -4
  409. package/dist/es/node_modules/orderedmap/dist/index.js +106 -4
  410. package/dist/es/node_modules/path-to-regexp/dist/index.js +275 -0
  411. package/dist/es/node_modules/prosemirror-commands/dist/index.js +391 -4
  412. package/dist/es/node_modules/prosemirror-dropcursor/dist/index.js +89 -4
  413. package/dist/es/node_modules/prosemirror-gapcursor/dist/index.js +207 -4
  414. package/dist/es/node_modules/prosemirror-history/dist/index.js +251 -4
  415. package/dist/es/node_modules/prosemirror-keymap/dist/index.js +65 -4
  416. package/dist/es/node_modules/prosemirror-model/dist/index.js +2736 -4
  417. package/dist/es/node_modules/prosemirror-schema-list/dist/index.js +91 -4
  418. package/dist/es/node_modules/prosemirror-state/dist/index.js +825 -4
  419. package/dist/es/node_modules/prosemirror-tables/dist/index.js +1449 -4
  420. package/dist/es/node_modules/prosemirror-transform/dist/index.js +1539 -4
  421. package/dist/es/node_modules/prosemirror-view/dist/index.js +3797 -4
  422. package/dist/es/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +300 -0
  423. package/dist/es/node_modules/rope-sequence/dist/index.js +103 -4
  424. package/dist/es/node_modules/sortablejs/modular/sortable.esm.js +1283 -0
  425. package/dist/es/node_modules/style-mod/src/style-mod.js +112 -4
  426. package/dist/es/{Grid → node_modules/title-case/dist}/index.js +10 -4
  427. package/dist/es/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +135 -4
  428. package/dist/es/node_modules/w3c-keyname/index.js +96 -4
  429. package/dist/es/node_modules/xgplayer/dist/index.min.css +3 -3
  430. package/dist/es/node_modules/xgplayer/es/_virtual/_rollupPluginBabelHelpers.js +200 -4
  431. package/dist/es/node_modules/xgplayer/es/constant.js +10 -4
  432. package/dist/es/node_modules/xgplayer/es/defaultConfig.js +90 -4
  433. package/dist/es/node_modules/xgplayer/es/error.js +67 -4
  434. package/dist/es/node_modules/xgplayer/es/events.js +70 -4
  435. package/dist/es/node_modules/xgplayer/es/index.umd.js +48 -4
  436. package/dist/es/node_modules/xgplayer/es/instManager.js +104 -4
  437. package/dist/es/node_modules/xgplayer/es/lang/en.js +82 -4
  438. package/dist/es/node_modules/xgplayer/es/lang/i18n.js +78 -4
  439. package/dist/es/node_modules/xgplayer/es/lang/jp.js +82 -4
  440. package/dist/es/node_modules/xgplayer/es/lang/zh-cn.js +82 -4
  441. package/dist/es/node_modules/xgplayer/es/mediaProxy.js +469 -4
  442. package/dist/es/node_modules/xgplayer/es/player.js +1243 -4
  443. package/dist/es/node_modules/xgplayer/es/plugin/basePlugin.js +210 -4
  444. package/dist/es/node_modules/xgplayer/es/plugin/hooksDescriptor.js +133 -4
  445. package/dist/es/node_modules/xgplayer/es/plugin/plugin.js +369 -4
  446. package/dist/es/node_modules/xgplayer/es/plugin/pluginsManager.js +207 -4
  447. package/dist/es/node_modules/xgplayer/es/plugin/preset.js +17 -4
  448. package/dist/es/node_modules/xgplayer/es/plugin/resizeObserver.js +84 -4
  449. package/dist/es/node_modules/xgplayer/es/plugins/assets/back.js +13 -4
  450. package/dist/es/node_modules/xgplayer/es/plugins/assets/download.js +23 -4
  451. package/dist/es/node_modules/xgplayer/es/plugins/assets/exitCssFull.js +12 -4
  452. package/dist/es/node_modules/xgplayer/es/plugins/assets/exitFull.js +12 -4
  453. package/dist/es/node_modules/xgplayer/es/plugins/assets/loading.js +12 -4
  454. package/dist/es/node_modules/xgplayer/es/plugins/assets/pause.js +12 -4
  455. package/dist/es/node_modules/xgplayer/es/plugins/assets/pipIcon.js +13 -4
  456. package/dist/es/node_modules/xgplayer/es/plugins/assets/pipIconExit.js +16 -4
  457. package/dist/es/node_modules/xgplayer/es/plugins/assets/play.js +12 -4
  458. package/dist/es/node_modules/xgplayer/es/plugins/assets/playNext.js +12 -4
  459. package/dist/es/node_modules/xgplayer/es/plugins/assets/replay.js +12 -4
  460. package/dist/es/node_modules/xgplayer/es/plugins/assets/requestCssFull.js +12 -4
  461. package/dist/es/node_modules/xgplayer/es/plugins/assets/requestFull.js +12 -4
  462. package/dist/es/node_modules/xgplayer/es/plugins/assets/rotate.js +20 -4
  463. package/dist/es/node_modules/xgplayer/es/plugins/assets/seekicon.js +15 -4
  464. package/dist/es/node_modules/xgplayer/es/plugins/assets/volumeLarge.js +13 -4
  465. package/dist/es/node_modules/xgplayer/es/plugins/assets/volumeMuted.js +13 -4
  466. package/dist/es/node_modules/xgplayer/es/plugins/assets/volumeSmall.js +13 -4
  467. package/dist/es/node_modules/xgplayer/es/plugins/common/iconPlugin.js +38 -4
  468. package/dist/es/node_modules/xgplayer/es/plugins/common/iconTools.js +15 -4
  469. package/dist/es/node_modules/xgplayer/es/plugins/common/optionList.js +82 -4
  470. package/dist/es/node_modules/xgplayer/es/plugins/common/optionsIcon.js +196 -4
  471. package/dist/es/node_modules/xgplayer/es/plugins/common/thumbnail.js +144 -4
  472. package/dist/es/node_modules/xgplayer/es/plugins/controls/index.js +174 -4
  473. package/dist/es/node_modules/xgplayer/es/plugins/cssFullScreen/index.js +108 -4
  474. package/dist/es/node_modules/xgplayer/es/plugins/definition/index.js +113 -4
  475. package/dist/es/node_modules/xgplayer/es/plugins/download/index.js +86 -4
  476. package/dist/es/node_modules/xgplayer/es/plugins/dynamicBg/index.js +235 -5
  477. package/dist/es/node_modules/xgplayer/es/plugins/enter/index.js +45 -4
  478. package/dist/es/node_modules/xgplayer/es/plugins/error/index.js +71 -4
  479. package/dist/es/node_modules/xgplayer/es/plugins/fpsDetect/index.js +119 -4
  480. package/dist/es/node_modules/xgplayer/es/plugins/fullscreen/backicon.js +71 -4
  481. package/dist/es/node_modules/xgplayer/es/plugins/fullscreen/index.js +153 -4
  482. package/dist/es/node_modules/xgplayer/es/plugins/gapJump/index.js +99 -4
  483. package/dist/es/node_modules/xgplayer/es/plugins/keyboard/index.js +302 -4
  484. package/dist/es/node_modules/xgplayer/es/plugins/loading/index.js +49 -4
  485. package/dist/es/node_modules/xgplayer/es/plugins/logger/index.js +174 -5
  486. package/dist/es/node_modules/xgplayer/es/plugins/miniScreen/index.js +172 -4
  487. package/dist/es/node_modules/xgplayer/es/plugins/miniScreen/miniScreenIcon.js +58 -4
  488. package/dist/es/node_modules/xgplayer/es/plugins/mobile/index.js +446 -4
  489. package/dist/es/node_modules/xgplayer/es/plugins/mobile/touch.js +141 -4
  490. package/dist/es/node_modules/xgplayer/es/plugins/pc/index.js +125 -4
  491. package/dist/es/node_modules/xgplayer/es/plugins/pip/index.js +219 -4
  492. package/dist/es/node_modules/xgplayer/es/plugins/play/index.js +105 -4
  493. package/dist/es/node_modules/xgplayer/es/plugins/playNext/index.js +81 -4
  494. package/dist/es/node_modules/xgplayer/es/plugins/playbackRate/index.js +103 -4
  495. package/dist/es/node_modules/xgplayer/es/plugins/poster/index.js +122 -4
  496. package/dist/es/node_modules/xgplayer/es/plugins/progress/index.js +434 -4
  497. package/dist/es/node_modules/xgplayer/es/plugins/progress/innerList.js +218 -4
  498. package/dist/es/node_modules/xgplayer/es/plugins/progress/miniProgress.js +96 -4
  499. package/dist/es/node_modules/xgplayer/es/plugins/progressPreview/dotsApi.js +178 -4
  500. package/dist/es/node_modules/xgplayer/es/plugins/progressPreview/index.js +295 -4
  501. package/dist/es/node_modules/xgplayer/es/plugins/prompt/index.js +89 -4
  502. package/dist/es/node_modules/xgplayer/es/plugins/replay/index.js +95 -4
  503. package/dist/es/node_modules/xgplayer/es/plugins/rotate/index.js +109 -4
  504. package/dist/es/node_modules/xgplayer/es/plugins/screenShot/index.js +137 -4
  505. package/dist/es/node_modules/xgplayer/es/plugins/start/index.js +225 -4
  506. package/dist/es/node_modules/xgplayer/es/plugins/stats/index.js +155 -4
  507. package/dist/es/node_modules/xgplayer/es/plugins/testspeed/index.js +137 -4
  508. package/dist/es/node_modules/xgplayer/es/plugins/time/index.js +167 -4
  509. package/dist/es/node_modules/xgplayer/es/plugins/time/timesegments.js +149 -4
  510. package/dist/es/node_modules/xgplayer/es/plugins/volume/index.js +209 -4
  511. package/dist/es/node_modules/xgplayer/es/plugins/waitingTimeoutJump/index.js +56 -4
  512. package/dist/es/node_modules/xgplayer/es/presets/default.js +64 -4
  513. package/dist/es/node_modules/xgplayer/es/state.js +16 -4
  514. package/dist/es/node_modules/xgplayer/es/stateClassMap.js +37 -4
  515. package/dist/es/node_modules/xgplayer/es/utils/database.js +86 -4
  516. package/dist/es/node_modules/xgplayer/es/utils/debug.js +37 -4
  517. package/dist/es/node_modules/xgplayer/es/utils/draggabilly.js +274 -4
  518. package/dist/es/node_modules/xgplayer/es/utils/sniffer.js +114 -4
  519. package/dist/es/node_modules/xgplayer/es/utils/util.js +520 -4
  520. package/dist/es/node_modules/xgplayer/es/utils/xgplayerTimeRange.js +28 -4
  521. package/dist/es/node_modules/xgplayer/es/version.js +7 -4
  522. package/dist/es/packages/components/index.js +88 -4
  523. package/dist/es/packages/hooks/dist/index.js +81 -0
  524. package/dist/es/packages/utils/dist/index.js +599 -0
  525. package/dist/es/styles/tokens.css +3 -3
  526. package/dist/lib/Button/index.js +4 -4
  527. package/dist/lib/Button/src/Button.css +3 -3
  528. package/dist/lib/Button/src/Button.vue.js +4 -4
  529. package/dist/lib/Button/src/Button2.css +3 -3
  530. package/dist/lib/CodeEditor/index.js +4 -4
  531. package/dist/lib/CodeEditor/src/index.css +4 -4
  532. package/dist/lib/CodeEditor/src/index.vue.js +4 -4
  533. package/dist/lib/CodeEditor/src/index2.css +3 -3
  534. package/dist/lib/CodeEditor/src/index3.css +4 -4
  535. package/dist/lib/ConfigProvider/index.js +4 -4
  536. package/dist/lib/ConfigProvider/src/configProvider.js +4 -4
  537. package/dist/lib/ConfigProvider/src/configProviderProps.js +4 -4
  538. package/dist/lib/ConfigProvider/src/constants.js +4 -4
  539. package/dist/lib/ConfigProvider/src/useGlobalConfig.js +4 -4
  540. package/dist/lib/CountTo/index.js +4 -4
  541. package/dist/lib/CountTo/src/index.css +3 -3
  542. package/dist/lib/CountTo/src/index.vue.js +4 -4
  543. package/dist/lib/Ellipsis/index.js +4 -4
  544. package/dist/lib/Ellipsis/src/components/JsEllipsis.css +3 -3
  545. package/dist/lib/Ellipsis/src/components/JsEllipsis.vue.js +4 -4
  546. package/dist/lib/Ellipsis/src/components/NativeEllipsis.css +3 -3
  547. package/dist/lib/Ellipsis/src/components/NativeEllipsis.vue.js +4 -4
  548. package/dist/lib/Ellipsis/src/components/NativeEllipsis2.css +3 -3
  549. package/dist/lib/Ellipsis/src/index.css +3 -3
  550. package/dist/lib/Ellipsis/src/index.vue.js +4 -4
  551. package/dist/lib/Ellipsis/src/utils/utils.js +4 -4
  552. package/dist/lib/Form/index.js +4 -4
  553. package/dist/lib/Form/src/Form.css +3 -3
  554. package/dist/lib/Form/src/Form.vue.js +4 -4
  555. package/dist/lib/Form/src/Form2.css +3 -3
  556. package/dist/lib/Form/src/styles/form.css +3 -3
  557. package/dist/lib/Marquee/index.js +4 -4
  558. package/dist/lib/Marquee/src/index.css +3 -3
  559. package/dist/lib/Marquee/src/index.vue.js +4 -4
  560. package/dist/lib/Marquee/src/index2.css +3 -3
  561. package/dist/lib/Overlay/index.js +4 -4
  562. package/dist/lib/Overlay/src/Message.css +3 -3
  563. package/dist/lib/Overlay/src/Message.vue.js +4 -4
  564. package/dist/lib/Overlay/src/Message2.css +3 -3
  565. package/dist/lib/Overlay/src/Modal.css +3 -3
  566. package/dist/lib/Overlay/src/Modal.vue.js +4 -4
  567. package/dist/lib/Overlay/src/Modal2.css +3 -3
  568. package/dist/lib/Overlay/src/Notice.css +3 -3
  569. package/dist/lib/Overlay/src/Notice.vue.js +4 -4
  570. package/dist/lib/Overlay/src/Notice2.css +3 -3
  571. package/dist/lib/Overlay/src/Tooltip.css +3 -3
  572. package/dist/lib/Overlay/src/Tooltip.vue.js +4 -4
  573. package/dist/lib/Overlay/src/Tooltip2.css +3 -3
  574. package/dist/lib/RichTextEditor/index.js +4 -4
  575. package/dist/lib/RichTextEditor/src/ToolbarPanel.css +3 -3
  576. package/dist/lib/RichTextEditor/src/ToolbarPanel.vue.js +4 -4
  577. package/dist/lib/RichTextEditor/src/ToolbarPanel2.css +3 -3
  578. package/dist/lib/RichTextEditor/src/components/BlockquoteButton.css +4 -4
  579. package/dist/lib/RichTextEditor/src/components/BlockquoteButton.vue.js +4 -4
  580. package/dist/lib/RichTextEditor/src/components/CodeBlockButton.css +4 -4
  581. package/dist/lib/RichTextEditor/src/components/CodeBlockButton.vue.js +4 -4
  582. package/dist/lib/RichTextEditor/src/components/ColorHighlightPopover.css +3 -3
  583. package/dist/lib/RichTextEditor/src/components/ColorHighlightPopover.vue.js +4 -4
  584. package/dist/lib/RichTextEditor/src/components/FontSizeDropdownMenu.css +3 -3
  585. package/dist/lib/RichTextEditor/src/components/FontSizeDropdownMenu.vue.js +4 -4
  586. package/dist/lib/RichTextEditor/src/components/HeadingDropdownMenu.css +3 -3
  587. package/dist/lib/RichTextEditor/src/components/HeadingDropdownMenu.vue.js +4 -4
  588. package/dist/lib/RichTextEditor/src/components/ImageUploadButton.css +4 -4
  589. package/dist/lib/RichTextEditor/src/components/ImageUploadButton.vue.js +4 -4
  590. package/dist/lib/RichTextEditor/src/components/LinkPopover.css +4 -4
  591. package/dist/lib/RichTextEditor/src/components/LinkPopover.vue.js +4 -4
  592. package/dist/lib/RichTextEditor/src/components/LinkPopover2.css +4 -4
  593. package/dist/lib/RichTextEditor/src/components/ListDropdownMenu.css +3 -3
  594. package/dist/lib/RichTextEditor/src/components/ListDropdownMenu.vue.js +4 -4
  595. package/dist/lib/RichTextEditor/src/components/MarkButton.css +4 -4
  596. package/dist/lib/RichTextEditor/src/components/MarkButton.vue.js +4 -4
  597. package/dist/lib/RichTextEditor/src/components/TableButton.css +3 -3
  598. package/dist/lib/RichTextEditor/src/components/TableButton.vue.js +4 -4
  599. package/dist/lib/RichTextEditor/src/components/TextAlignDropdownMenu.css +3 -3
  600. package/dist/lib/RichTextEditor/src/components/TextAlignDropdownMenu.vue.js +4 -4
  601. package/dist/lib/RichTextEditor/src/components/TextColorPopover.css +3 -3
  602. package/dist/lib/RichTextEditor/src/components/TextColorPopover.vue.js +4 -4
  603. package/dist/lib/RichTextEditor/src/components/ToolbarGroup.css +3 -3
  604. package/dist/lib/RichTextEditor/src/components/ToolbarGroup.vue.js +4 -4
  605. package/dist/lib/RichTextEditor/src/components/ToolbarSeparator.css +3 -3
  606. package/dist/lib/RichTextEditor/src/components/ToolbarSeparator.vue.js +4 -4
  607. package/dist/lib/RichTextEditor/src/components/UndoRedoButton.css +4 -4
  608. package/dist/lib/RichTextEditor/src/components/UndoRedoButton.vue.js +4 -4
  609. package/dist/lib/RichTextEditor/src/components/VideoUploadButton.css +4 -4
  610. package/dist/lib/RichTextEditor/src/components/VideoUploadButton.vue.js +4 -4
  611. package/dist/lib/RichTextEditor/src/components/basic/ColorPicker.css +4 -4
  612. package/dist/lib/RichTextEditor/src/components/basic/ColorPicker.vue.js +4 -4
  613. package/dist/lib/RichTextEditor/src/components/basic/MediaUploadModal.css +3 -3
  614. package/dist/lib/RichTextEditor/src/components/basic/MediaUploadModal.vue.js +4 -4
  615. package/dist/lib/RichTextEditor/src/components/basic/MediaUploadModal2.css +3 -3
  616. package/dist/lib/RichTextEditor/src/components/basic/SelectMenu.css +4 -4
  617. package/dist/lib/RichTextEditor/src/components/basic/SelectMenu.vue.js +4 -4
  618. package/dist/lib/RichTextEditor/src/components/basic/SelectMenu2.css +4 -4
  619. package/dist/lib/RichTextEditor/src/constant/index.js +4 -4
  620. package/dist/lib/RichTextEditor/src/extensions/video.js +4 -4
  621. package/dist/lib/RichTextEditor/src/index.css +4 -4
  622. package/dist/lib/RichTextEditor/src/index.vue.js +4 -4
  623. package/dist/lib/RichTextEditor/src/index2.css +4 -4
  624. package/dist/lib/RichTextEditor/src/props.js +4 -4
  625. package/dist/lib/ScaleScreen/index.js +4 -4
  626. package/dist/lib/ScaleScreen/src/index.css +3 -3
  627. package/dist/lib/ScaleScreen/src/index.vue.js +4 -4
  628. package/dist/lib/ScaleScreen/src/index2.css +3 -3
  629. package/dist/lib/Transition/index.js +4 -4
  630. package/dist/lib/Transition/src/CollapseTransition.css +3 -3
  631. package/dist/lib/Transition/src/CollapseTransition.vue.js +4 -4
  632. package/dist/lib/Transition/src/CollapseTransition2.css +3 -3
  633. package/dist/lib/Transition/src/CreateTransition.js +4 -4
  634. package/dist/lib/Transition/src/ExpandTransition.js +4 -4
  635. package/dist/lib/Transition/src/style/index.css +3 -3
  636. package/dist/lib/Transition/style.js +4 -4
  637. package/dist/lib/VideoBackground/index.js +4 -4
  638. package/dist/lib/VideoBackground/src/helper.js +4 -4
  639. package/dist/lib/VideoBackground/src/index.css +3 -3
  640. package/dist/lib/VideoBackground/src/index.vue.js +4 -4
  641. package/dist/lib/VideoBackground/src/index2.css +3 -3
  642. package/dist/lib/VideoBackground/src/index3.css +3 -3
  643. package/dist/lib/VideoBackground/src/videoBackground.js +4 -4
  644. package/dist/lib/VideoPlayer/index.js +4 -4
  645. package/dist/lib/VideoPlayer/src/index.css +3 -3
  646. package/dist/lib/VideoPlayer/src/index.vue.js +4 -4
  647. package/dist/lib/VirtualScroll/index.js +4 -4
  648. package/dist/lib/VirtualScroll/src/index.css +3 -3
  649. package/dist/lib/VirtualScroll/src/index.vue.js +4 -4
  650. package/dist/lib/VirtualScroll/src/index.vue2.js +4 -4
  651. package/dist/lib/VirtualScroll/src/index2.css +3 -3
  652. package/dist/lib/_virtual/_commonjsHelpers.js +4 -4
  653. package/dist/lib/_virtual/_plugin-vue_export-helper.js +4 -4
  654. package/dist/lib/_virtual/delegate.js +4 -4
  655. package/dist/lib/_virtual/download.js +4 -4
  656. package/dist/lib/_virtual/download2.js +4 -4
  657. package/dist/lib/_virtual/index.js +4 -4
  658. package/dist/lib/_virtual/index2.js +4 -4
  659. package/dist/lib/_virtual/index3.js +14 -0
  660. package/dist/lib/{node_modules/@tanstack/store/dist/esm/types.js → _virtual/index4.js} +4 -4
  661. package/dist/lib/hooks/useLocale.js +4 -4
  662. package/dist/lib/hooks/useNamespace.js +4 -4
  663. package/dist/lib/index.js +4 -4
  664. package/dist/lib/locale/lang/en-US.js +4 -4
  665. package/dist/lib/locale/lang/ja-JP.js +4 -4
  666. package/dist/lib/locale/lang/zh-CN.js +4 -4
  667. package/dist/lib/node_modules/@codemirror/autocomplete/dist/index.js +4 -4
  668. package/dist/lib/node_modules/@codemirror/commands/dist/index.js +4 -4
  669. package/dist/lib/node_modules/@codemirror/lang-java/dist/index.js +4 -4
  670. package/dist/lib/node_modules/@codemirror/lang-javascript/dist/index.js +16 -4
  671. package/dist/lib/node_modules/@codemirror/lang-json/dist/index.js +4 -4
  672. package/dist/lib/node_modules/@codemirror/lang-python/dist/index.js +6 -4
  673. package/dist/lib/node_modules/@codemirror/lang-sql/dist/index.js +5 -4
  674. package/dist/lib/node_modules/@codemirror/lang-xml/dist/index.js +4 -4
  675. package/dist/lib/node_modules/@codemirror/lang-yaml/dist/index.js +4 -4
  676. package/dist/lib/node_modules/@codemirror/language/dist/index.js +4 -4
  677. package/dist/lib/node_modules/@codemirror/lint/dist/index.js +4 -4
  678. package/dist/lib/node_modules/@codemirror/search/dist/index.js +5 -4
  679. package/dist/lib/node_modules/@codemirror/state/dist/index.js +8 -4
  680. package/dist/lib/node_modules/@codemirror/theme-one-dark/dist/index.js +4 -4
  681. package/dist/lib/node_modules/@codemirror/view/dist/index.js +8 -4
  682. package/dist/lib/node_modules/@lezer/common/dist/index.js +4 -4
  683. package/dist/lib/node_modules/@lezer/highlight/dist/index.js +4 -4
  684. package/dist/lib/node_modules/@lezer/java/dist/index.js +4 -4
  685. package/dist/lib/node_modules/@lezer/javascript/dist/index.js +4 -4
  686. package/dist/lib/node_modules/@lezer/json/dist/index.js +4 -4
  687. package/dist/lib/node_modules/@lezer/lr/dist/index.js +4 -4
  688. package/dist/lib/node_modules/@lezer/python/dist/index.js +4 -4
  689. package/dist/lib/node_modules/@lezer/xml/dist/index.js +4 -4
  690. package/dist/lib/node_modules/@lezer/yaml/dist/index.js +4 -4
  691. package/dist/lib/node_modules/@marijn/find-cluster-break/src/index.js +4 -4
  692. package/dist/lib/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +4 -4
  693. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/EventClient.js +4 -4
  694. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +4 -4
  695. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FormApi.js +4 -4
  696. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +4 -4
  697. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +4 -4
  698. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +4 -4
  699. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/utils.js +4 -4
  700. package/dist/lib/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +4 -4
  701. package/dist/lib/node_modules/@tanstack/store/dist/esm/alien.js +14 -0
  702. package/dist/lib/node_modules/@tanstack/store/dist/esm/atom.js +14 -0
  703. package/dist/lib/node_modules/@tanstack/store/dist/esm/batch.js +14 -0
  704. package/dist/lib/node_modules/@tanstack/store/dist/esm/store.js +4 -4
  705. package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useField.js +4 -4
  706. package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useForm.js +4 -4
  707. package/dist/lib/node_modules/@tanstack/vue-store/dist/esm/index.js +4 -4
  708. package/dist/lib/node_modules/@tiptap/core/dist/index.js +94 -4
  709. package/dist/lib/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +4 -4
  710. package/dist/lib/node_modules/@tiptap/extension-blockquote/dist/index.js +8 -4
  711. package/dist/lib/node_modules/@tiptap/extension-bold/dist/index.js +4 -4
  712. package/dist/lib/node_modules/@tiptap/extension-character-count/dist/index.js +4 -4
  713. package/dist/lib/node_modules/@tiptap/extension-code/dist/index.js +4 -4
  714. package/dist/lib/node_modules/@tiptap/extension-code-block/dist/index.js +21 -4
  715. package/dist/lib/node_modules/@tiptap/extension-document/dist/index.js +6 -4
  716. package/dist/lib/node_modules/@tiptap/extension-hard-break/dist/index.js +6 -4
  717. package/dist/lib/node_modules/@tiptap/extension-heading/dist/index.js +4 -4
  718. package/dist/lib/node_modules/@tiptap/extension-highlight/dist/index.js +4 -4
  719. package/dist/lib/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +4 -4
  720. package/dist/lib/node_modules/@tiptap/extension-image/dist/index.js +4 -4
  721. package/dist/lib/node_modules/@tiptap/extension-italic/dist/index.js +4 -4
  722. package/dist/lib/node_modules/@tiptap/extension-link/dist/index.js +4 -4
  723. package/dist/lib/node_modules/@tiptap/extension-list/dist/index.js +15 -4
  724. package/dist/lib/node_modules/@tiptap/extension-paragraph/dist/index.js +4 -4
  725. package/dist/lib/node_modules/@tiptap/extension-strike/dist/index.js +4 -4
  726. package/dist/lib/node_modules/@tiptap/extension-subscript/dist/index.js +4 -4
  727. package/dist/lib/node_modules/@tiptap/extension-superscript/dist/index.js +4 -4
  728. package/dist/lib/node_modules/@tiptap/extension-table/dist/index.js +8 -4
  729. package/dist/lib/node_modules/@tiptap/extension-task-item/dist/index.js +4 -4
  730. package/dist/lib/node_modules/@tiptap/extension-task-list/dist/index.js +4 -4
  731. package/dist/lib/node_modules/@tiptap/extension-text/dist/index.js +4 -4
  732. package/dist/lib/node_modules/@tiptap/extension-text-align/dist/index.js +4 -4
  733. package/dist/lib/node_modules/@tiptap/extension-text-style/dist/index.js +4 -4
  734. package/dist/lib/node_modules/@tiptap/extension-underline/dist/index.js +4 -4
  735. package/dist/lib/node_modules/@tiptap/extensions/dist/index.js +4 -4
  736. package/dist/lib/node_modules/@tiptap/html/dist/index.js +14 -0
  737. package/dist/lib/node_modules/@tiptap/starter-kit/dist/index.js +4 -4
  738. package/dist/lib/node_modules/@tiptap/vue-3/dist/index.js +4 -4
  739. package/dist/lib/node_modules/@vueuse/core/dist/index.js +4 -4
  740. package/dist/lib/node_modules/@vueuse/shared/dist/index.js +4 -4
  741. package/dist/lib/node_modules/codemirror/dist/index.js +4 -4
  742. package/dist/lib/node_modules/crelt/index.js +4 -4
  743. package/dist/lib/node_modules/delegate/src/closest.js +4 -4
  744. package/dist/lib/node_modules/delegate/src/delegate.js +4 -4
  745. package/dist/lib/node_modules/downloadjs/download.js +6 -4
  746. package/dist/lib/node_modules/eventemitter3/index.js +4 -4
  747. package/dist/lib/node_modules/linkifyjs/dist/linkify.js +8 -4
  748. package/dist/lib/node_modules/lodash-es/_DataView.js +4 -4
  749. package/dist/lib/node_modules/lodash-es/_Hash.js +4 -4
  750. package/dist/lib/node_modules/lodash-es/_ListCache.js +4 -4
  751. package/dist/lib/node_modules/lodash-es/_Map.js +4 -4
  752. package/dist/lib/node_modules/lodash-es/_MapCache.js +4 -4
  753. package/dist/lib/node_modules/lodash-es/_Promise.js +4 -4
  754. package/dist/lib/node_modules/lodash-es/_Set.js +4 -4
  755. package/dist/lib/node_modules/lodash-es/_SetCache.js +14 -0
  756. package/dist/lib/node_modules/lodash-es/_Stack.js +4 -4
  757. package/dist/lib/node_modules/lodash-es/_Symbol.js +4 -4
  758. package/dist/lib/node_modules/lodash-es/_Uint8Array.js +4 -4
  759. package/dist/lib/node_modules/lodash-es/_WeakMap.js +4 -4
  760. package/dist/lib/node_modules/lodash-es/_apply.js +4 -4
  761. package/dist/lib/node_modules/lodash-es/_arrayEach.js +4 -4
  762. package/dist/lib/node_modules/lodash-es/_arrayFilter.js +4 -4
  763. package/dist/lib/node_modules/lodash-es/_arrayIncludes.js +14 -0
  764. package/dist/lib/node_modules/lodash-es/_arrayIncludesWith.js +14 -0
  765. package/dist/lib/node_modules/lodash-es/_arrayLikeKeys.js +4 -4
  766. package/dist/lib/node_modules/lodash-es/_arrayMap.js +4 -4
  767. package/dist/lib/node_modules/lodash-es/_arrayPush.js +4 -4
  768. package/dist/lib/node_modules/lodash-es/_arraySome.js +14 -0
  769. package/dist/lib/node_modules/lodash-es/_asciiToArray.js +4 -4
  770. package/dist/lib/node_modules/lodash-es/_assignMergeValue.js +14 -0
  771. package/dist/lib/node_modules/lodash-es/_assignValue.js +4 -4
  772. package/dist/lib/node_modules/lodash-es/_assocIndexOf.js +4 -4
  773. package/dist/lib/node_modules/lodash-es/_baseAssignValue.js +4 -4
  774. package/dist/lib/node_modules/lodash-es/_baseClone.js +4 -4
  775. package/dist/lib/node_modules/lodash-es/_baseCreate.js +14 -0
  776. package/dist/lib/node_modules/lodash-es/_baseFindIndex.js +14 -0
  777. package/dist/lib/node_modules/lodash-es/_baseFlatten.js +4 -4
  778. package/dist/lib/node_modules/lodash-es/_baseFor.js +14 -0
  779. package/dist/lib/node_modules/lodash-es/_baseGet.js +4 -4
  780. package/dist/lib/node_modules/lodash-es/_baseGetAllKeys.js +4 -4
  781. package/dist/lib/node_modules/lodash-es/_baseGetTag.js +4 -4
  782. package/dist/lib/node_modules/lodash-es/_baseIndexOf.js +14 -0
  783. package/dist/lib/node_modules/lodash-es/_baseIntersection.js +14 -0
  784. package/dist/lib/node_modules/lodash-es/_baseIsArguments.js +4 -4
  785. package/dist/lib/node_modules/lodash-es/_baseIsEqual.js +14 -0
  786. package/dist/lib/node_modules/lodash-es/_baseIsEqualDeep.js +14 -0
  787. package/dist/lib/node_modules/lodash-es/_baseIsMap.js +4 -4
  788. package/dist/lib/node_modules/lodash-es/_baseIsNaN.js +14 -0
  789. package/dist/lib/node_modules/lodash-es/_baseIsNative.js +4 -4
  790. package/dist/lib/node_modules/lodash-es/_baseIsRegExp.js +4 -4
  791. package/dist/lib/node_modules/lodash-es/_baseIsSet.js +4 -4
  792. package/dist/lib/node_modules/lodash-es/_baseIsTypedArray.js +4 -4
  793. package/dist/lib/node_modules/lodash-es/_baseKeys.js +14 -0
  794. package/dist/lib/node_modules/lodash-es/_baseKeysIn.js +4 -4
  795. package/dist/lib/node_modules/lodash-es/_baseMerge.js +14 -0
  796. package/dist/lib/node_modules/lodash-es/_baseMergeDeep.js +14 -0
  797. package/dist/lib/node_modules/lodash-es/_baseRest.js +14 -0
  798. package/dist/lib/node_modules/lodash-es/_baseSetToString.js +4 -4
  799. package/dist/lib/node_modules/lodash-es/_baseSlice.js +4 -4
  800. package/dist/lib/node_modules/lodash-es/_baseTimes.js +4 -4
  801. package/dist/lib/node_modules/lodash-es/_baseToString.js +4 -4
  802. package/dist/lib/node_modules/lodash-es/_baseUnary.js +4 -4
  803. package/dist/lib/node_modules/lodash-es/_baseUniq.js +14 -0
  804. package/dist/lib/node_modules/lodash-es/_baseUnset.js +4 -4
  805. package/dist/lib/node_modules/lodash-es/_cacheHas.js +14 -0
  806. package/dist/lib/node_modules/lodash-es/_castArrayLikeObject.js +14 -0
  807. package/dist/lib/node_modules/lodash-es/_castPath.js +4 -4
  808. package/dist/lib/node_modules/lodash-es/_castSlice.js +4 -4
  809. package/dist/lib/node_modules/lodash-es/_cloneArrayBuffer.js +4 -4
  810. package/dist/lib/node_modules/lodash-es/_cloneBuffer.js +4 -4
  811. package/dist/lib/node_modules/lodash-es/_cloneDataView.js +4 -4
  812. package/dist/lib/node_modules/lodash-es/_cloneRegExp.js +4 -4
  813. package/dist/lib/node_modules/lodash-es/_cloneSymbol.js +4 -4
  814. package/dist/lib/node_modules/lodash-es/_cloneTypedArray.js +4 -4
  815. package/dist/lib/node_modules/lodash-es/_copyArray.js +14 -0
  816. package/dist/lib/node_modules/lodash-es/_copyObject.js +4 -4
  817. package/dist/lib/node_modules/lodash-es/_coreJsData.js +4 -4
  818. package/dist/lib/node_modules/lodash-es/_createAssigner.js +14 -0
  819. package/dist/lib/node_modules/lodash-es/_createBaseFor.js +14 -0
  820. package/dist/lib/node_modules/lodash-es/_createCaseFirst.js +4 -4
  821. package/dist/lib/node_modules/lodash-es/_createSet.js +14 -0
  822. package/dist/lib/node_modules/lodash-es/_customOmitClone.js +4 -4
  823. package/dist/lib/node_modules/lodash-es/_defineProperty.js +4 -4
  824. package/dist/lib/node_modules/lodash-es/_equalArrays.js +14 -0
  825. package/dist/lib/node_modules/lodash-es/_equalByTag.js +14 -0
  826. package/dist/lib/node_modules/lodash-es/_equalObjects.js +14 -0
  827. package/dist/lib/node_modules/lodash-es/_flatRest.js +4 -4
  828. package/dist/lib/node_modules/lodash-es/_freeGlobal.js +4 -4
  829. package/dist/lib/node_modules/lodash-es/_getAllKeys.js +14 -0
  830. package/dist/lib/node_modules/lodash-es/_getAllKeysIn.js +4 -4
  831. package/dist/lib/node_modules/lodash-es/_getMapData.js +4 -4
  832. package/dist/lib/node_modules/lodash-es/_getNative.js +4 -4
  833. package/dist/lib/node_modules/lodash-es/_getPrototype.js +4 -4
  834. package/dist/lib/node_modules/lodash-es/_getRawTag.js +4 -4
  835. package/dist/lib/node_modules/lodash-es/_getSymbols.js +4 -4
  836. package/dist/lib/node_modules/lodash-es/_getSymbolsIn.js +4 -4
  837. package/dist/lib/node_modules/lodash-es/_getTag.js +4 -4
  838. package/dist/lib/node_modules/lodash-es/_getValue.js +4 -4
  839. package/dist/lib/node_modules/lodash-es/_hasUnicode.js +4 -4
  840. package/dist/lib/node_modules/lodash-es/_hashClear.js +4 -4
  841. package/dist/lib/node_modules/lodash-es/_hashDelete.js +4 -4
  842. package/dist/lib/node_modules/lodash-es/_hashGet.js +4 -4
  843. package/dist/lib/node_modules/lodash-es/_hashHas.js +4 -4
  844. package/dist/lib/node_modules/lodash-es/_hashSet.js +4 -4
  845. package/dist/lib/node_modules/lodash-es/_initCloneArray.js +4 -4
  846. package/dist/lib/node_modules/lodash-es/_initCloneByTag.js +4 -4
  847. package/dist/lib/node_modules/lodash-es/_initCloneObject.js +14 -0
  848. package/dist/lib/node_modules/lodash-es/_isFlattenable.js +4 -4
  849. package/dist/lib/node_modules/lodash-es/_isIndex.js +4 -4
  850. package/dist/lib/node_modules/lodash-es/_isIterateeCall.js +14 -0
  851. package/dist/lib/node_modules/lodash-es/_isKey.js +4 -4
  852. package/dist/lib/node_modules/lodash-es/_isKeyable.js +4 -4
  853. package/dist/lib/node_modules/lodash-es/_isMasked.js +4 -4
  854. package/dist/lib/node_modules/lodash-es/_isPrototype.js +4 -4
  855. package/dist/lib/node_modules/lodash-es/_listCacheClear.js +4 -4
  856. package/dist/lib/node_modules/lodash-es/_listCacheDelete.js +4 -4
  857. package/dist/lib/node_modules/lodash-es/_listCacheGet.js +4 -4
  858. package/dist/lib/node_modules/lodash-es/_listCacheHas.js +4 -4
  859. package/dist/lib/node_modules/lodash-es/_listCacheSet.js +4 -4
  860. package/dist/lib/node_modules/lodash-es/_mapCacheClear.js +4 -4
  861. package/dist/lib/node_modules/lodash-es/_mapCacheDelete.js +4 -4
  862. package/dist/lib/node_modules/lodash-es/_mapCacheGet.js +4 -4
  863. package/dist/lib/node_modules/lodash-es/_mapCacheHas.js +4 -4
  864. package/dist/lib/node_modules/lodash-es/_mapCacheSet.js +4 -4
  865. package/dist/lib/node_modules/lodash-es/_mapToArray.js +14 -0
  866. package/dist/lib/node_modules/lodash-es/_memoizeCapped.js +4 -4
  867. package/dist/lib/node_modules/lodash-es/_nativeCreate.js +4 -4
  868. package/dist/lib/node_modules/lodash-es/_nativeKeys.js +14 -0
  869. package/dist/lib/node_modules/lodash-es/_nativeKeysIn.js +4 -4
  870. package/dist/lib/node_modules/lodash-es/_nodeUtil.js +4 -4
  871. package/dist/lib/node_modules/lodash-es/_objectToString.js +4 -4
  872. package/dist/lib/node_modules/lodash-es/_overArg.js +4 -4
  873. package/dist/lib/node_modules/lodash-es/_overRest.js +4 -4
  874. package/dist/lib/node_modules/lodash-es/_parent.js +4 -4
  875. package/dist/lib/node_modules/lodash-es/_root.js +4 -4
  876. package/dist/lib/node_modules/lodash-es/_safeGet.js +14 -0
  877. package/dist/lib/node_modules/lodash-es/_setCacheAdd.js +14 -0
  878. package/dist/lib/node_modules/lodash-es/_setCacheHas.js +14 -0
  879. package/dist/lib/node_modules/lodash-es/_setToArray.js +14 -0
  880. package/dist/lib/node_modules/lodash-es/_setToString.js +4 -4
  881. package/dist/lib/node_modules/lodash-es/_shortOut.js +4 -4
  882. package/dist/lib/node_modules/lodash-es/_stackClear.js +4 -4
  883. package/dist/lib/node_modules/lodash-es/_stackDelete.js +4 -4
  884. package/dist/lib/node_modules/lodash-es/_stackGet.js +4 -4
  885. package/dist/lib/node_modules/lodash-es/_stackHas.js +4 -4
  886. package/dist/lib/node_modules/lodash-es/_stackSet.js +4 -4
  887. package/dist/lib/node_modules/lodash-es/_strictIndexOf.js +14 -0
  888. package/dist/lib/node_modules/lodash-es/_stringToArray.js +4 -4
  889. package/dist/lib/node_modules/lodash-es/_stringToPath.js +4 -4
  890. package/dist/lib/node_modules/lodash-es/_toKey.js +4 -4
  891. package/dist/lib/node_modules/lodash-es/_toSource.js +4 -4
  892. package/dist/lib/node_modules/lodash-es/_unicodeToArray.js +4 -4
  893. package/dist/lib/node_modules/lodash-es/constant.js +4 -4
  894. package/dist/lib/node_modules/lodash-es/eq.js +4 -4
  895. package/dist/lib/node_modules/lodash-es/flatten.js +4 -4
  896. package/dist/lib/node_modules/lodash-es/get.js +4 -4
  897. package/dist/lib/node_modules/lodash-es/identity.js +4 -4
  898. package/dist/lib/node_modules/lodash-es/intersectionWith.js +14 -0
  899. package/dist/lib/node_modules/lodash-es/isArguments.js +4 -4
  900. package/dist/lib/node_modules/lodash-es/isArray.js +4 -4
  901. package/dist/lib/node_modules/lodash-es/isArrayLike.js +4 -4
  902. package/dist/lib/node_modules/lodash-es/isArrayLikeObject.js +14 -0
  903. package/dist/lib/node_modules/lodash-es/isBuffer.js +4 -4
  904. package/dist/lib/node_modules/lodash-es/isEqual.js +14 -0
  905. package/dist/lib/node_modules/lodash-es/isFinite.js +4 -4
  906. package/dist/lib/node_modules/lodash-es/isFunction.js +4 -4
  907. package/dist/lib/node_modules/lodash-es/isLength.js +4 -4
  908. package/dist/lib/node_modules/lodash-es/isMap.js +4 -4
  909. package/dist/lib/node_modules/lodash-es/isNaN.js +4 -4
  910. package/dist/lib/node_modules/lodash-es/isNil.js +4 -4
  911. package/dist/lib/node_modules/lodash-es/isNumber.js +4 -4
  912. package/dist/lib/node_modules/lodash-es/isObject.js +4 -4
  913. package/dist/lib/node_modules/lodash-es/isObjectLike.js +4 -4
  914. package/dist/lib/node_modules/lodash-es/isPlainObject.js +4 -4
  915. package/dist/lib/node_modules/lodash-es/isRegExp.js +4 -4
  916. package/dist/lib/node_modules/lodash-es/isSet.js +4 -4
  917. package/dist/lib/node_modules/lodash-es/isString.js +4 -4
  918. package/dist/lib/node_modules/lodash-es/isSymbol.js +4 -4
  919. package/dist/lib/node_modules/lodash-es/isTypedArray.js +4 -4
  920. package/dist/lib/node_modules/lodash-es/keys.js +14 -0
  921. package/dist/lib/node_modules/lodash-es/keysIn.js +4 -4
  922. package/dist/lib/node_modules/lodash-es/last.js +4 -4
  923. package/dist/lib/node_modules/lodash-es/memoize.js +4 -4
  924. package/dist/lib/node_modules/lodash-es/mergeWith.js +14 -0
  925. package/dist/lib/node_modules/lodash-es/noop.js +14 -0
  926. package/dist/lib/node_modules/lodash-es/omit.js +4 -4
  927. package/dist/lib/node_modules/lodash-es/stubArray.js +4 -4
  928. package/dist/lib/node_modules/lodash-es/stubFalse.js +4 -4
  929. package/dist/lib/node_modules/lodash-es/toPlainObject.js +14 -0
  930. package/dist/lib/node_modules/lodash-es/toString.js +4 -4
  931. package/dist/lib/node_modules/lodash-es/unionWith.js +14 -0
  932. package/dist/lib/node_modules/lodash-es/upperFirst.js +4 -4
  933. package/dist/lib/node_modules/orderedmap/dist/index.js +4 -4
  934. package/dist/lib/node_modules/path-to-regexp/dist/index.js +14 -0
  935. package/dist/lib/node_modules/prosemirror-commands/dist/index.js +5 -4
  936. package/dist/lib/node_modules/prosemirror-dropcursor/dist/index.js +4 -4
  937. package/dist/lib/node_modules/prosemirror-gapcursor/dist/index.js +4 -4
  938. package/dist/lib/node_modules/prosemirror-history/dist/index.js +4 -4
  939. package/dist/lib/node_modules/prosemirror-keymap/dist/index.js +4 -4
  940. package/dist/lib/node_modules/prosemirror-model/dist/index.js +7 -4
  941. package/dist/lib/node_modules/prosemirror-schema-list/dist/index.js +4 -4
  942. package/dist/lib/node_modules/prosemirror-state/dist/index.js +4 -4
  943. package/dist/lib/node_modules/prosemirror-tables/dist/index.js +4 -4
  944. package/dist/lib/node_modules/prosemirror-transform/dist/index.js +5 -4
  945. package/dist/lib/node_modules/prosemirror-view/dist/index.js +8 -4
  946. package/dist/lib/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +14 -0
  947. package/dist/lib/node_modules/rope-sequence/dist/index.js +4 -4
  948. package/dist/lib/node_modules/sortablejs/modular/sortable.esm.js +14 -0
  949. package/dist/lib/node_modules/style-mod/src/style-mod.js +6 -4
  950. package/dist/lib/{Grid → node_modules/title-case/dist}/index.js +4 -4
  951. package/dist/lib/node_modules/vue-codemirror/dist/vue-codemirror.esm.js +4 -4
  952. package/dist/lib/node_modules/w3c-keyname/index.js +4 -4
  953. package/dist/lib/node_modules/xgplayer/dist/index.min.css +3 -3
  954. package/dist/lib/node_modules/xgplayer/es/_virtual/_rollupPluginBabelHelpers.js +5 -4
  955. package/dist/lib/node_modules/xgplayer/es/constant.js +4 -4
  956. package/dist/lib/node_modules/xgplayer/es/defaultConfig.js +4 -4
  957. package/dist/lib/node_modules/xgplayer/es/error.js +4 -4
  958. package/dist/lib/node_modules/xgplayer/es/events.js +4 -4
  959. package/dist/lib/node_modules/xgplayer/es/index.umd.js +4 -4
  960. package/dist/lib/node_modules/xgplayer/es/instManager.js +4 -4
  961. package/dist/lib/node_modules/xgplayer/es/lang/en.js +4 -4
  962. package/dist/lib/node_modules/xgplayer/es/lang/i18n.js +4 -4
  963. package/dist/lib/node_modules/xgplayer/es/lang/jp.js +4 -4
  964. package/dist/lib/node_modules/xgplayer/es/lang/zh-cn.js +4 -4
  965. package/dist/lib/node_modules/xgplayer/es/mediaProxy.js +4 -4
  966. package/dist/lib/node_modules/xgplayer/es/player.js +4 -4
  967. package/dist/lib/node_modules/xgplayer/es/plugin/basePlugin.js +4 -4
  968. package/dist/lib/node_modules/xgplayer/es/plugin/hooksDescriptor.js +4 -4
  969. package/dist/lib/node_modules/xgplayer/es/plugin/plugin.js +4 -4
  970. package/dist/lib/node_modules/xgplayer/es/plugin/pluginsManager.js +4 -4
  971. package/dist/lib/node_modules/xgplayer/es/plugin/preset.js +4 -4
  972. package/dist/lib/node_modules/xgplayer/es/plugin/resizeObserver.js +4 -4
  973. package/dist/lib/node_modules/xgplayer/es/plugins/assets/back.js +8 -4
  974. package/dist/lib/node_modules/xgplayer/es/plugins/assets/download.js +18 -4
  975. package/dist/lib/node_modules/xgplayer/es/plugins/assets/exitCssFull.js +7 -4
  976. package/dist/lib/node_modules/xgplayer/es/plugins/assets/exitFull.js +7 -4
  977. package/dist/lib/node_modules/xgplayer/es/plugins/assets/loading.js +7 -4
  978. package/dist/lib/node_modules/xgplayer/es/plugins/assets/pause.js +7 -4
  979. package/dist/lib/node_modules/xgplayer/es/plugins/assets/pipIcon.js +8 -4
  980. package/dist/lib/node_modules/xgplayer/es/plugins/assets/pipIconExit.js +11 -4
  981. package/dist/lib/node_modules/xgplayer/es/plugins/assets/play.js +7 -4
  982. package/dist/lib/node_modules/xgplayer/es/plugins/assets/playNext.js +7 -4
  983. package/dist/lib/node_modules/xgplayer/es/plugins/assets/replay.js +7 -4
  984. package/dist/lib/node_modules/xgplayer/es/plugins/assets/requestCssFull.js +7 -4
  985. package/dist/lib/node_modules/xgplayer/es/plugins/assets/requestFull.js +7 -4
  986. package/dist/lib/node_modules/xgplayer/es/plugins/assets/rotate.js +15 -4
  987. package/dist/lib/node_modules/xgplayer/es/plugins/assets/seekicon.js +10 -4
  988. package/dist/lib/node_modules/xgplayer/es/plugins/assets/volumeLarge.js +8 -4
  989. package/dist/lib/node_modules/xgplayer/es/plugins/assets/volumeMuted.js +8 -4
  990. package/dist/lib/node_modules/xgplayer/es/plugins/assets/volumeSmall.js +8 -4
  991. package/dist/lib/node_modules/xgplayer/es/plugins/common/iconPlugin.js +4 -4
  992. package/dist/lib/node_modules/xgplayer/es/plugins/common/iconTools.js +6 -4
  993. package/dist/lib/node_modules/xgplayer/es/plugins/common/optionList.js +4 -4
  994. package/dist/lib/node_modules/xgplayer/es/plugins/common/optionsIcon.js +7 -4
  995. package/dist/lib/node_modules/xgplayer/es/plugins/common/thumbnail.js +4 -4
  996. package/dist/lib/node_modules/xgplayer/es/plugins/controls/index.js +12 -4
  997. package/dist/lib/node_modules/xgplayer/es/plugins/cssFullScreen/index.js +8 -4
  998. package/dist/lib/node_modules/xgplayer/es/plugins/definition/index.js +4 -4
  999. package/dist/lib/node_modules/xgplayer/es/plugins/download/index.js +8 -4
  1000. package/dist/lib/node_modules/xgplayer/es/plugins/dynamicBg/index.js +5 -4
  1001. package/dist/lib/node_modules/xgplayer/es/plugins/enter/index.js +4 -4
  1002. package/dist/lib/node_modules/xgplayer/es/plugins/error/index.js +9 -4
  1003. package/dist/lib/node_modules/xgplayer/es/plugins/fpsDetect/index.js +4 -4
  1004. package/dist/lib/node_modules/xgplayer/es/plugins/fullscreen/backicon.js +5 -4
  1005. package/dist/lib/node_modules/xgplayer/es/plugins/fullscreen/index.js +8 -4
  1006. package/dist/lib/node_modules/xgplayer/es/plugins/gapJump/index.js +4 -4
  1007. package/dist/lib/node_modules/xgplayer/es/plugins/keyboard/index.js +4 -4
  1008. package/dist/lib/node_modules/xgplayer/es/plugins/loading/index.js +7 -4
  1009. package/dist/lib/node_modules/xgplayer/es/plugins/logger/index.js +4 -4
  1010. package/dist/lib/node_modules/xgplayer/es/plugins/miniScreen/index.js +16 -4
  1011. package/dist/lib/node_modules/xgplayer/es/plugins/miniScreen/miniScreenIcon.js +7 -4
  1012. package/dist/lib/node_modules/xgplayer/es/plugins/mobile/index.js +22 -4
  1013. package/dist/lib/node_modules/xgplayer/es/plugins/mobile/touch.js +4 -4
  1014. package/dist/lib/node_modules/xgplayer/es/plugins/pc/index.js +4 -4
  1015. package/dist/lib/node_modules/xgplayer/es/plugins/pip/index.js +11 -4
  1016. package/dist/lib/node_modules/xgplayer/es/plugins/play/index.js +8 -4
  1017. package/dist/lib/node_modules/xgplayer/es/plugins/playNext/index.js +10 -4
  1018. package/dist/lib/node_modules/xgplayer/es/plugins/playbackRate/index.js +4 -4
  1019. package/dist/lib/node_modules/xgplayer/es/plugins/poster/index.js +5 -4
  1020. package/dist/lib/node_modules/xgplayer/es/plugins/progress/index.js +10 -4
  1021. package/dist/lib/node_modules/xgplayer/es/plugins/progress/innerList.js +4 -4
  1022. package/dist/lib/node_modules/xgplayer/es/plugins/progress/miniProgress.js +7 -4
  1023. package/dist/lib/node_modules/xgplayer/es/plugins/progressPreview/dotsApi.js +4 -4
  1024. package/dist/lib/node_modules/xgplayer/es/plugins/progressPreview/index.js +14 -4
  1025. package/dist/lib/node_modules/xgplayer/es/plugins/prompt/index.js +6 -4
  1026. package/dist/lib/node_modules/xgplayer/es/plugins/replay/index.js +6 -4
  1027. package/dist/lib/node_modules/xgplayer/es/plugins/rotate/index.js +9 -4
  1028. package/dist/lib/node_modules/xgplayer/es/plugins/screenShot/index.js +9 -4
  1029. package/dist/lib/node_modules/xgplayer/es/plugins/start/index.js +7 -4
  1030. package/dist/lib/node_modules/xgplayer/es/plugins/stats/index.js +4 -4
  1031. package/dist/lib/node_modules/xgplayer/es/plugins/testspeed/index.js +4 -4
  1032. package/dist/lib/node_modules/xgplayer/es/plugins/time/index.js +9 -4
  1033. package/dist/lib/node_modules/xgplayer/es/plugins/time/timesegments.js +4 -4
  1034. package/dist/lib/node_modules/xgplayer/es/plugins/volume/index.js +14 -4
  1035. package/dist/lib/node_modules/xgplayer/es/plugins/waitingTimeoutJump/index.js +4 -4
  1036. package/dist/lib/node_modules/xgplayer/es/presets/default.js +4 -4
  1037. package/dist/lib/node_modules/xgplayer/es/state.js +4 -4
  1038. package/dist/lib/node_modules/xgplayer/es/stateClassMap.js +4 -4
  1039. package/dist/lib/node_modules/xgplayer/es/utils/database.js +4 -4
  1040. package/dist/lib/node_modules/xgplayer/es/utils/debug.js +4 -4
  1041. package/dist/lib/node_modules/xgplayer/es/utils/draggabilly.js +4 -4
  1042. package/dist/lib/node_modules/xgplayer/es/utils/sniffer.js +4 -4
  1043. package/dist/lib/node_modules/xgplayer/es/utils/util.js +4 -4
  1044. package/dist/lib/node_modules/xgplayer/es/utils/xgplayerTimeRange.js +4 -4
  1045. package/dist/lib/node_modules/xgplayer/es/version.js +4 -4
  1046. package/dist/lib/packages/components/index.js +4 -4
  1047. package/dist/lib/packages/hooks/dist/index.js +14 -0
  1048. package/dist/lib/packages/utils/dist/index.js +14 -0
  1049. package/dist/lib/styles/tokens.css +3 -3
  1050. package/index.d.ts +227 -113
  1051. package/package.json +26 -28
  1052. package/dist/es/Grid/src/Grid.css +0 -14
  1053. package/dist/es/Grid/src/Grid.vue.js +0 -14
  1054. package/dist/es/Grid/src/components/ActionBar.css +0 -14
  1055. package/dist/es/Grid/src/components/ActionBar.vue.js +0 -14
  1056. package/dist/es/Grid/src/components/CellEditor.vue.js +0 -14
  1057. package/dist/es/Grid/src/components/CellEditor2.css +0 -14
  1058. package/dist/es/Grid/src/components/ColumnFilter.css +0 -14
  1059. package/dist/es/Grid/src/components/ColumnFilter.vue.js +0 -14
  1060. package/dist/es/Grid/src/components/ColumnSettings.css +0 -14
  1061. package/dist/es/Grid/src/components/ColumnSettings.vue.js +0 -14
  1062. package/dist/es/Grid/src/components/DataTable.css +0 -14
  1063. package/dist/es/Grid/src/components/DataTable.vue.js +0 -14
  1064. package/dist/es/Grid/src/components/Pager.css +0 -14
  1065. package/dist/es/Grid/src/components/Pager.vue.js +0 -14
  1066. package/dist/es/Grid/src/components/QueryBar.css +0 -14
  1067. package/dist/es/Grid/src/components/QueryBar.vue.js +0 -14
  1068. package/dist/es/Grid/src/composables/useCellEditor.js +0 -14
  1069. package/dist/es/Grid/src/composables/useGridTable.js +0 -14
  1070. package/dist/es/Grid/src/styles/table.css +0 -14
  1071. package/dist/es/node_modules/@tanstack/store/dist/esm/derived.js +0 -14
  1072. package/dist/es/node_modules/@tanstack/store/dist/esm/scheduler.js +0 -14
  1073. package/dist/es/node_modules/@tanstack/table-core/build/lib/index.js +0 -14
  1074. package/dist/es/node_modules/@tanstack/vue-table/build/lib/index.js +0 -14
  1075. package/dist/lib/Grid/src/Grid.css +0 -14
  1076. package/dist/lib/Grid/src/Grid.vue.js +0 -14
  1077. package/dist/lib/Grid/src/components/ActionBar.css +0 -14
  1078. package/dist/lib/Grid/src/components/ActionBar.vue.js +0 -14
  1079. package/dist/lib/Grid/src/components/CellEditor.vue.js +0 -14
  1080. package/dist/lib/Grid/src/components/CellEditor2.css +0 -14
  1081. package/dist/lib/Grid/src/components/ColumnFilter.css +0 -14
  1082. package/dist/lib/Grid/src/components/ColumnFilter.vue.js +0 -14
  1083. package/dist/lib/Grid/src/components/ColumnSettings.css +0 -14
  1084. package/dist/lib/Grid/src/components/ColumnSettings.vue.js +0 -14
  1085. package/dist/lib/Grid/src/components/DataTable.css +0 -14
  1086. package/dist/lib/Grid/src/components/DataTable.vue.js +0 -14
  1087. package/dist/lib/Grid/src/components/Pager.css +0 -14
  1088. package/dist/lib/Grid/src/components/Pager.vue.js +0 -14
  1089. package/dist/lib/Grid/src/components/QueryBar.css +0 -14
  1090. package/dist/lib/Grid/src/components/QueryBar.vue.js +0 -14
  1091. package/dist/lib/Grid/src/composables/useCellEditor.js +0 -14
  1092. package/dist/lib/Grid/src/composables/useGridTable.js +0 -14
  1093. package/dist/lib/Grid/src/styles/table.css +0 -14
  1094. package/dist/lib/node_modules/@tanstack/store/dist/esm/derived.js +0 -14
  1095. package/dist/lib/node_modules/@tanstack/store/dist/esm/scheduler.js +0 -14
  1096. package/dist/lib/node_modules/@tanstack/table-core/build/lib/index.js +0 -14
  1097. package/dist/lib/node_modules/@tanstack/vue-table/build/lib/index.js +0 -14
@@ -7,8 +7,3801 @@ You shall not disclose such Confidential Information and shall use it only in
7
7
  accordance with the terms of the license agreement.
8
8
 
9
9
  --- Build Info ---
10
- Version: 1.1.5
11
- Build Time: 2026/3/3 17:22:50
12
- Build Commit: a388255c630130f5e69ede988a8585cdbdc065c1
10
+ Version: 1.1.7
11
+ Build Time: 2026/3/13 18:25:06
12
+ Build Commit: 0b162dea954baa715e67b70f80401a571205058a
13
13
  */
14
- import{NodeSelection as e,Selection as t,TextSelection as n,AllSelection as o}from"../../prosemirror-state/dist/index.js";import{Slice as i,DOMSerializer as s,Fragment as r,DOMParser as l,Mark as d}from"../../prosemirror-model/dist/index.js";import{dropPoint as a}from"../../prosemirror-transform/dist/index.js";const c=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},h=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let f=null;const u=function(e,t,n){let o=f||(f=document.createRange());return o.setEnd(e,null==n?e.nodeValue.length:n),o.setStart(e,t||0),o},p=function(e,t,n,o){return n&&(g(e,t,n,o,-1)||g(e,t,n,o,1))},m=/^(img|br|input|textarea|hr)$/i;function g(e,t,n,o,i){for(var s;;){if(e==n&&t==o)return!0;if(t==(i<0?0:y(e))){let n=e.parentNode;if(!n||1!=n.nodeType||b(e)||m.test(e.nodeName)||"false"==e.contentEditable)return!1;t=c(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(s=n.pmViewDesc)||void 0===s?void 0:s.ignoreForSelection))return!1;t+=i}else e=n,t=i<0?y(e):0}}}}function y(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function b(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const v=function(e){return e.focusNode&&p(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function w(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const D="undefined"!=typeof navigator?navigator:null,N="undefined"!=typeof document?document:null,S=D&&D.userAgent||"",C=/Edge\/(\d+)/.exec(S),O=/MSIE \d/.exec(S),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(S),x=!!(O||M||C),T=O?document.documentMode:M?+M[1]:C?+C[1]:0,k=!x&&/gecko\/(\d+)/i.test(S);k&&(/Firefox\/(\d+)/.exec(S)||[0,0])[1];const E=!x&&/Chrome\/(\d+)/.exec(S),P=!!E,A=E?+E[1]:0,V=!x&&!!D&&/Apple Computer/.test(D.vendor),R=V&&(/Mobile\/\w+/.test(S)||!!D&&D.maxTouchPoints>2),B=R||!!D&&/Mac/.test(D.platform),z=!!D&&/Win/.test(D.platform),I=/Android \d/.test(S),L=!!N&&"webkitFontSmoothing"in N.documentElement.style,F=L?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function $(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function q(e,t){return"number"==typeof e?e:e[t]}function K(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,o=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*o}}function W(e,t,n){let o=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let r=n||e.dom;r;){if(1!=r.nodeType){r=h(r);continue}let e=r,n=e==s.body,l=n?$(s):K(e),d=0,a=0;if(t.top<l.top+q(o,"top")?a=-(l.top-t.top+q(i,"top")):t.bottom>l.bottom-q(o,"bottom")&&(a=t.bottom-t.top>l.bottom-l.top?t.top+q(i,"top")-l.top:t.bottom-l.bottom+q(i,"bottom")),t.left<l.left+q(o,"left")?d=-(l.left-t.left+q(i,"left")):t.right>l.right-q(o,"right")&&(d=t.right-l.right+q(i,"right")),d||a)if(n)s.defaultView.scrollBy(d,a);else{let n=e.scrollLeft,o=e.scrollTop;a&&(e.scrollTop+=a),d&&(e.scrollLeft+=d);let i=e.scrollLeft-n,s=e.scrollTop-o;t={left:t.left-i,top:t.top-s,right:t.right-i,bottom:t.bottom-s}}let c=n?"fixed":getComputedStyle(r).position;if(/^(fixed|sticky)$/.test(c))break;r="absolute"==c?r.offsetParent:h(r)}}function H(e){let t=[],n=e.ownerDocument;for(let o=e;o&&(t.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),e!=n);o=h(o));return t}function _(e,t){for(let n=0;n<e.length;n++){let{dom:o,top:i,left:s}=e[n];o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=s&&(o.scrollLeft=s)}}let G=null;function U(e,t){let n,o,i,s,r=2e8,l=0,d=t.top,a=t.top;for(let c=e.firstChild,h=0;c;c=c.nextSibling,h++){let e;if(1==c.nodeType)e=c.getClientRects();else{if(3!=c.nodeType)continue;e=u(c).getClientRects()}for(let f=0;f<e.length;f++){let u=e[f];if(u.top<=d&&u.bottom>=a){d=Math.max(u.bottom,d),a=Math.min(u.top,a);let e=u.left>t.left?u.left-t.left:u.right<t.left?t.left-u.right:0;if(e<r){n=c,r=e,o=e&&3==n.nodeType?{left:u.right<t.left?u.right:u.left,top:t.top}:t,1==c.nodeType&&e&&(l=h+(t.left>=(u.left+u.right)/2?1:0));continue}}else u.top>t.top&&!i&&u.left<=t.left&&u.right>=t.left&&(i=c,s={left:Math.max(u.left,Math.min(u.right,t.left)),top:u.top});!n&&(t.left>=u.right&&t.top>=u.top||t.left>=u.left&&t.top>=u.bottom)&&(l=h+1)}}return!n&&i&&(n=i,o=s,r=0),n&&3==n.nodeType?function(e,t){let n,o=e.nodeValue.length,i=document.createRange();for(let s=0;s<o;s++){i.setEnd(e,s+1),i.setStart(e,s);let o=Q(i,1);if(o.top!=o.bottom&&j(t,o)){n={node:e,offset:s+(t.left>=(o.left+o.right)/2?1:0)};break}}return i.detach(),n||{node:e,offset:0}}(n,o):!n||r&&1==n.nodeType?{node:e,offset:l}:U(n,o)}function j(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Y(e,t,n){let o=e.childNodes.length;if(o&&n.top<n.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(t.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let n=e.childNodes[s];if(1==n.nodeType){let e=n.getClientRects();for(let o=0;o<e.length;o++){let i=e[o];if(j(t,i))return Y(n,t,i)}}if((s=(s+1)%o)==i)break}return e}function X(e,t){let n,o=e.dom.ownerDocument,i=0,s=function(e,t,n){if(e.caretPositionFromPoint)try{let o=e.caretPositionFromPoint(t,n);if(o)return{node:o.offsetNode,offset:Math.min(y(o.offsetNode),o.offset)}}catch(o){}if(e.caretRangeFromPoint){let o=e.caretRangeFromPoint(t,n);if(o)return{node:o.startContainer,offset:Math.min(y(o.startContainer),o.startOffset)}}}(o,t.left,t.top);s&&({node:n,offset:i}=s);let r,l=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=e.dom.getBoundingClientRect();if(!j(t,n))return null;if(l=Y(e.dom,t,n),!l)return null}if(V)for(let a=l;n&&a;a=h(a))a.draggable&&(n=void 0);if(l=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(k&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,o=n.childNodes[i];"IMG"==o.nodeName&&(e=o.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}let o;L&&i&&1==n.nodeType&&1==(o=n.childNodes[i-1]).nodeType&&"false"==o.contentEditable&&o.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?r=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(r=function(e,t,n,o){let i=-1;for(let s=t,r=!1;s!=e.dom;){let t,n=e.docView.nearestDesc(s,!0);if(!n)return null;if(1==n.dom.nodeType&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((t=n.dom.getBoundingClientRect()).width||t.height)&&(n.node.isBlock&&n.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(n.dom.nodeName)&&(!r&&t.left>o.left||t.top>o.top?i=n.posBefore:(!r&&t.right<o.left||t.bottom<o.top)&&(i=n.posAfter),r=!0),!n.contentDOM&&i<0&&!n.node.isText))return(n.node.isBlock?o.top<(t.top+t.bottom)/2:o.left<(t.left+t.right)/2)?n.posBefore:n.posAfter;s=n.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==r&&(r=function(e,t,n){let{node:o,offset:i}=U(t,n),s=-1;if(1==o.nodeType&&!o.firstChild){let e=o.getBoundingClientRect();s=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}(e,l,t));let d=e.docView.nearestDesc(l,!0);return{pos:r,inside:d?d.posAtStart-d.border:-1}}function J(e){return e.top<e.bottom||e.left<e.right}function Q(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(J(e))return e}return Array.prototype.find.call(n,J)||e.getBoundingClientRect()}const Z=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ee(e,t,n){let{node:o,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),r=L||k;if(3==o.nodeType){if(!r||!Z.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){let e=i,t=i,s=n<0?1:-1;return n<0&&!i?(t++,s=-1):n>=0&&i==o.nodeValue.length?(e--,s=1):n<0?e--:t++,te(Q(u(o,e,t),s),s<0)}{let e=Q(u(o,i,i),n);if(k&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let t=Q(u(o,i-1,i-1),-1);if(t.top==e.top){let n=Q(u(o,i,i+1),-1);if(n.top!=e.top)return te(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==y(o))){let e=o.childNodes[i-1];if(1==e.nodeType)return ne(e.getBoundingClientRect(),!1)}if(null==s&&i<y(o)){let e=o.childNodes[i];if(1==e.nodeType)return ne(e.getBoundingClientRect(),!0)}return ne(o.getBoundingClientRect(),n>=0)}if(null==s&&i&&(n<0||i==y(o))){let e=o.childNodes[i-1],t=3==e.nodeType?u(e,y(e)-(r?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return te(Q(t,1),!1)}if(null==s&&i<y(o)){let e=o.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?u(e,0,r?0:1):1==e.nodeType?e:null:null;if(t)return te(Q(t,-1),!0)}return te(Q(3==o.nodeType?u(o):o,-n),n>=0)}function te(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ne(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function oe(e,t,n){let o=e.state,i=e.root.activeElement;o!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{o!=t&&e.updateState(o),i!=e.dom&&i&&i.focus()}}const ie=/[\u0590-\u08ac]/;let se=null,re=null,le=!1;function de(e,t,n){return se==t&&re==n?le:(se=t,re=n,le="up"==n||"down"==n?function(e,t,n){let o=t.selection,i="up"==n?o.$from:o.$to;return oe(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let o=ee(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=u(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?o.top-i.top>2*(i.bottom-o.top):i.bottom-o.bottom>2*(o.bottom-i.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:o}=t.selection;if(!o.parent.isTextblock)return!1;let i=o.parentOffset,s=!i,r=i==o.parent.content.size,l=e.domSelection();return l?ie.test(o.parent.textContent)&&l.modify?oe(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:s,anchorOffset:r}=e.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",n,"character");let a=o.depth?e.docView.domAfterPos(o.before()):e.dom,{focusNode:c,focusOffset:h}=e.domSelectionRange(),f=c&&!a.contains(1==c.nodeType?c:c.parentNode)||t==c&&i==h;try{l.collapse(s,r),t&&(t!=s||i!=r)&&l.extend&&l.extend(t,i)}catch(u){}return null!=d&&(l.caretBidiLevel=d),f}):"left"==n||"backward"==n?s:r:o.pos==o.start()||o.pos==o.end()}(e,t,n))}class ae{constructor(e,t,n,o){this.parent=e,this.children=t,this.dom=n,this.contentDOM=o,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let o=this.children[t];if(o==e)return n;n+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,o;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(o=n.pmViewDesc)||o.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(o)+o.size:this.posAtStart}{let n,o;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(o=n.pmViewDesc)||o.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(o):this.posAtEnd}}let o;if(e==this.dom&&this.contentDOM)o=t>c(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){o=!1;break}if(t.previousSibling)break}if(null==o&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){o=!0;break}if(t.nextSibling)break}}return(null==o?n>0:o)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,o=e;o;o=o.parentNode){let i,s=this.getDesc(o);if(s&&(!t||s.node)){if(!n||!(i=s.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return s;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let o=this.children[t],i=n+o.size;if(n==e&&i!=n){for(;!o.border&&o.children.length;)for(let e=0;e<o.children.length;e++){let t=o.children[e];if(t.size){o=t;break}}return o}if(e<i)return o.descAt(e-n-o.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,o=0;for(let i=0;n<this.children.length;n++){let t=this.children[n],s=i+t.size;if(s>e||t instanceof ge){o=e-i;break}i=s}if(o)return this.children[n].domFromPos(o-this.children[n].border,t);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof ce&&i.side>=0;n--);if(t<=0){let e,o=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,o=!1);return e&&t&&o&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?c(e.dom)+1:0}}{let e,o=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,o=!1);return e&&o&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?c(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=n,r=0;;r++){let n=this.children[r],l=s+n.size;if(-1==o&&e<=l){let i=s+n.border;if(e>=i&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;for(let t=r;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){o=c(n.dom)+1;break}e-=n.size}-1==o&&(o=0)}if(o>-1&&(l>t||r==this.children.length-1)){t=l;for(let e=r+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=c(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}s=l}return{node:this.contentDOM,from:e,to:t,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,o=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let c=0,p=0;c<this.children.length;c++){let r=this.children[c],l=p+r.size;if(i>p&&s<l)return r.setSelection(e-p-r.border,t-p-r.border,n,o);p=l}let r=this.domFromPos(e,e?-1:1),l=t==e?r:this.domFromPos(t,t?-1:1),d=n.root.getSelection(),a=n.domSelectionRange(),h=!1;if((k||V)&&e==t){let{node:e,offset:t}=r;if(3==e.nodeType){if(h=!(!t||"\n"!=e.nodeValue[t-1]),h&&t==e.nodeValue.length)for(let n,o=e;o;o=o.parentNode){if(n=o.nextSibling){"BR"==n.nodeName&&(r=l={node:n.parentNode,offset:c(n)+1});break}let e=o.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];h=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(k&&a.focusNode&&a.focusNode!=l.node&&1==a.focusNode.nodeType){let e=a.focusNode.childNodes[a.focusOffset];e&&"false"==e.contentEditable&&(o=!0)}if(!(o||h&&V)&&p(r.node,r.offset,a.anchorNode,a.anchorOffset)&&p(l.node,l.offset,a.focusNode,a.focusOffset))return;let f=!1;if((d.extend||e==t)&&(!h||!k)){d.collapse(r.node,r.offset);try{e!=t&&d.extend(l.node,l.offset),f=!0}catch(u){}}if(!f){if(e>t){let e=r;r=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(r.node,r.offset),d.removeAllRanges(),d.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,o=0;o<this.children.length;o++){let i=this.children[o],s=n+i.size;if(n==s?e<=s&&t>=n:e<s&&t>n){let o=n+i.border,r=s-i.border;if(e>=o&&t<=r)return this.dirty=e==n||t==s?2:1,void(e!=o||t!=r||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-o,t-o):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class ce extends ae{constructor(e,t,n,o){let i,s=t.type.toDOM;if("function"==typeof s&&(s=s(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:o)),!t.type.spec.raw){if(1!=s.nodeType){let e=document.createElement("span");e.appendChild(s),s=e}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class he extends ae{constructor(e,t,n,o){super(e,[],t,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class fe extends ae{constructor(e,t,n,o,i){super(e,[],n,o),this.mark=t,this.spec=i}static create(e,t,n,o){let i=o.nodeViews[t.type.name],r=i&&i(t,o,n);return r&&r.dom||(r=s.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new fe(e,t,r.dom,r.contentDOM||r.dom,r)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let o=fe.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;t<s&&(i=ke(i,t,s,n)),e>0&&(i=ke(i,0,e,n));for(let r=0;r<i.length;r++)i[r].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ue extends ae{constructor(e,t,n,o,i,s,r,l,d){super(e,[],i,s),this.node=t,this.outerDeco=n,this.innerDeco=o,this.nodeDOM=r}static create(e,t,n,o,i,r){let l,d=i.nodeViews[t.type.name],a=d&&d(t,i,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:r,n,o),c=a&&a.dom,h=a&&a.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=s.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:h}=e)}h||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let f=c;return c=Ce(c,n,t),a?l=new ye(e,t,n,o,c,h||null,f,a,i,r+1):t.isText?new me(e,t,n,o,c,f,i):new ue(e,t,n,o,c,h||null,f,i,r+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>r.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Oe(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,r=i&&i.pos<0,l=new xe(this,s&&s.node,e);!function(e,t,n,o){let i=t.locals(e),s=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let r=e.child(n);o(r,i,t.forChild(s,r),n),s+=r.nodeSize}return}let r=0,l=[],d=null;for(let a=0;;){let c,h,f,u;for(;r<i.length&&i[r].to==s;){let e=i[r++];e.widget&&(c?(h||(h=[c])).push(e):c=e)}if(c)if(h){h.sort(Te);for(let e=0;e<h.length;e++)n(h[e],a,!!d)}else n(c,a,!!d);if(d)u=-1,f=d,d=null;else{if(!(a<e.childCount))break;u=a,f=e.child(a++)}for(let e=0;e<l.length;e++)l[e].to<=s&&l.splice(e--,1);for(;r<i.length&&i[r].from<=s&&i[r].to>s;)l.push(i[r++]);let p=s+f.nodeSize;if(f.isText){let e=p;r<i.length&&i[r].from<e&&(e=i[r].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<p&&(d=f.cut(e-s),f=f.cut(0,e-s),p=e,u=-1)}else for(;r<i.length&&i[r].to<p;)r++;o(f,f.isInline&&!f.isLeaf?l.filter(e=>!e.inline):l.slice(),t.forChild(s,f),u),s=p}}(this.node,this.innerDeco,(t,i,s)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!s&&l.syncToMarks(i==this.node.childCount?d.none:this.node.child(i).marks,n,e,i),l.placeWidget(t,e,o)},(t,s,d,a)=>{let c;l.syncToMarks(t.marks,n,e,a),l.findNodeMatch(t,s,d,a)||r&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(c=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(t,s,d,c,e)||l.updateNextNode(t,s,d,e,a,o)||l.addNode(t,s,d,e,o),o+=t.nodeSize}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),be(this.contentDOM,this.children,e),R&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:o,to:i}=e.state.selection;if(!(e.state.selection instanceof n)||o<t||i>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let e=s.nodeValue,n=function(e,t,n,o){for(let i=0,s=0;i<e.childCount&&s<=o;){let r=e.child(i++),l=s;if(s+=r.nodeSize,!r.isText)continue;let d=r.text;for(;i<e.childCount;){let t=e.child(i++);if(s+=t.nodeSize,!t.isText)break;d+=t.text}if(s>=n){if(s>=o&&d.slice(o-t.length-l,o-l)==t)return o-t.length;let e=l<o?d.lastIndexOf(t,o-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==o&&d.length>=o+t.length-l&&d.slice(o-l,o-l+t.length)==t)return o}}return-1}(this.node.content,e,o-t,i-t);return n<0?null:{node:s,pos:n,text:e}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:o}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new he(this,i,t,o);e.input.compositionNodes.push(s),this.children=ke(this.children,n,n+o.length,e,s)}update(e,t,n,o){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,o),!0)}updateInner(e,t,n,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Oe(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ne(this.dom,this.nodeDOM,De(this.outerDeco,this.node,t),De(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function pe(e,t,n,o,i){Ce(o,t,e);let s=new ue(void 0,e,t,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class me extends ue{constructor(e,t,n,o,i,s,r){super(e,t,n,o,i,null,s,r,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,o){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let o=this.node.cut(e,t),i=document.createTextNode(o.text);return new me(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ge extends ae{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ye extends ue{constructor(e,t,n,o,i,s,r,l,d,a){super(e,t,n,o,i,s,r,d,a),this.spec=l}update(e,t,n,o){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,o),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,o){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function be(e,t,n){let o=e.firstChild,i=!1;for(let s=0;s<t.length;s++){let r=t[s],l=r.dom;if(l.parentNode==e){for(;l!=o;)o=Me(o),i=!0;o=o.nextSibling}else i=!0,e.insertBefore(l,o);if(r instanceof fe){let t=o?o.previousSibling:e.lastChild;be(r.contentDOM,r.children,n),o=t?t.nextSibling:e.firstChild}}for(;o;)o=Me(o),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const ve=function(e){e&&(this.nodeName=e)};ve.prototype=/* @__PURE__ */Object.create(null);const we=[new ve];function De(e,t,n){if(0==e.length)return we;let o=n?we[0]:new ve,i=[o];for(let s=0;s<e.length;s++){let r=e[s].type.attrs;if(r){r.nodeName&&i.push(o=new ve(r.nodeName));for(let e in r){let s=r[e];null!=s&&(n&&1==i.length&&i.push(o=new ve(t.isInline?"span":"div")),"class"==e?o.class=(o.class?o.class+" ":"")+s:"style"==e?o.style=(o.style?o.style+";":"")+s:"nodeName"!=e&&(o[e]=s))}}}return i}function Ne(e,t,n,o){if(n==we&&o==we)return t;let i=t;for(let s=0;s<o.length;s++){let t=o[s],r=n[s];if(s){let n;r&&r.nodeName==t.nodeName&&i!=e&&(n=i.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(i),r=we[0]),i=n}Se(i,r||we[0],t)}return i}function Se(e,t,n){for(let o in t)"class"==o||"style"==o||"nodeName"==o||o in n||e.removeAttribute(o);for(let o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){let o=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<o.length;t++)-1==i.indexOf(o[t])&&e.classList.remove(o[t]);for(let t=0;t<i.length;t++)-1==o.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,o=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=o.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Ce(e,t,n){return Ne(e,e,we,De(t,n,1!=e.nodeType))}function Oe(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Me(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class xe{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,o=n.children.length,i=e.childCount,s=/* @__PURE__ */new Map,r=[];e:for(;i>0;){let l;for(;;)if(o){let e=n.children[o-1];if(!(e instanceof fe)){l=e,o--;break}n=e,o=e.children.length}else{if(n==t)break e;o=n.parent.children.indexOf(n),n=n.parent}let d=l.node;if(d){if(d!=e.child(i-1))break;--i,s.set(l,i),r.push(l)}}return{index:i,matched:s,matches:r.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,o){let i=0,s=this.stack.length>>1,r=Math.min(s,e.length);for(;i<r&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let i=-1,r=this.top.children.length;o<this.preMatch.index&&(r=Math.min(this.index+3,r));for(let t=this.index;t<r;t++){let n=this.top.children[t];if(n.matchesMark(e[s])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let o=fe.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,o),this.top=o,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,o){let i,s=-1;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))s=this.top.children.indexOf(i,this.index);else for(let r=this.index,l=Math.min(this.top.children.length,r+5);r<l;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){s=r;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,o,i){let s=this.top.children[o];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,n,i)&&(this.destroyBetween(this.index,o),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,o,i,s){for(let r=this.index;r<this.top.children.length;r++){let l=this.top.children[r];if(l instanceof ue){let d=this.preMatch.matched.get(l);if(null!=d&&d!=i)return!1;let a,c=l.dom,h=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&Oe(t,l.outerDeco));if(!h&&l.update(e,t,n,o))return this.destroyBetween(this.index,r),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(a=this.recreateWrapper(l,e,t,n,o,s)))return this.destroyBetween(this.index,r),this.top.children[this.index]=a,a.contentDOM&&(a.dirty=2,a.updateChildren(o,s+1),a.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,o,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Oe(n,e.outerDeco)||!o.eq(e.innerDeco))return null;let r=ue.create(this.top,t,n,o,i,s);if(r.contentDOM){r.children=e.children,e.children=[];for(let e of r.children)e.parent=r}return e.destroy(),r}addNode(e,t,n,o,i){let s=ue.create(this.top,e,t,n,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,n){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(!o||!o.matchesWidget(e)||e!=o.widget&&o.widget.type.toDOM.parentNode){let o=new ce(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof fe;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof me)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((V||P)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let o=new ge(this.top,[],n,null);t!=this.top?t.children.push(o):t.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function Te(e,t){return e.type.side-t.type.side}function ke(e,t,n,o,i){let s=[];for(let r=0,l=0;r<e.length;r++){let d=e[r],a=l,c=l+=d.size;a>=n||c<=t?s.push(d):(a<t&&s.push(d.slice(0,t-a,o)),i&&(s.push(i),i=void 0),c>n&&s.push(d.slice(n-a,d.size,o)))}return s}function Ee(t,n=null){let o=t.domSelectionRange(),i=t.state.doc;if(!o.focusNode)return null;let s=t.docView.nearestDesc(o.focusNode),r=s&&0==s.size,l=t.docView.posFromDOM(o.focusNode,o.focusOffset,1);if(l<0)return null;let d,a,h=i.resolve(l);if(v(o)){for(d=l;s&&!s.node;)s=s.parent;let t=s.node;if(s&&t.isAtom&&e.isSelectable(t)&&s.parent&&(!t.isInline||!function(e,t,n){for(let o=0==t,i=t==y(e);o||i;){if(e==n)return!0;let t=c(e);if(!(e=e.parentNode))return!1;o=o&&0==t,i=i&&t==y(e)}}(o.focusNode,o.focusOffset,s.dom))){let t=s.posBefore;a=new e(l==t?h:i.resolve(t))}}else{if(o instanceof t.dom.ownerDocument.defaultView.Selection&&o.rangeCount>1){let e=l,n=l;for(let i=0;i<o.rangeCount;i++){let s=o.getRangeAt(i);e=Math.min(e,t.docView.posFromDOM(s.startContainer,s.startOffset,1)),n=Math.max(n,t.docView.posFromDOM(s.endContainer,s.endOffset,-1))}if(e<0)return null;[d,l]=n==t.state.selection.anchor?[n,e]:[e,n],h=i.resolve(l)}else d=t.docView.posFromDOM(o.anchorNode,o.anchorOffset,1);if(d<0)return null}let f=i.resolve(d);if(!a){a=Fe(t,f,h,"pointer"==n||t.state.selection.head<h.pos&&!r?1:-1)}return a}function Pe(e){return e.editable?e.hasFocus():qe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ae(e,t=!1){let o=e.state.selection;if(Ie(e,o),Pe(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&P){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&p(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,o="IMG"==n.nodeName;o?t.collapse(n.parentNode,c(n)+1):t.collapse(n,0);!o&&!e.state.selection.visible&&x&&T<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let i,s,{anchor:r,head:l}=o;!Ve||o instanceof n||(o.$from.parent.inlineContent||(i=Re(e,o.from)),o.empty||o.$from.parent.inlineContent||(s=Re(e,o.to))),e.docView.setSelection(r,l,e,t),Ve&&(i&&ze(i),s&&ze(s)),o.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),o=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==o&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{Pe(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ve=V||P&&A<63;function Re(e,t){let{node:n,offset:o}=e.docView.domFromPos(t,0),i=o<n.childNodes.length?n.childNodes[o]:null,s=o?n.childNodes[o-1]:null;if(V&&i&&"false"==i.contentEditable)return Be(i);if(!(i&&"false"!=i.contentEditable||s&&"false"!=s.contentEditable)){if(i)return Be(i);if(s)return Be(s)}}function Be(e){return e.contentEditable="true",V&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ze(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ie(t,n){if(n instanceof e){let e=t.docView.descAt(n.from);e!=t.lastSelectedViewDesc&&(Le(t),e&&e.selectNode(),t.lastSelectedViewDesc=e)}else Le(t)}function Le(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Fe(e,t,o,i){return e.someProp("createSelectionBetween",n=>n(e,t,o))||n.between(t,o,i)}function $e(e){return!(e.editable&&!e.hasFocus())&&qe(e)}function qe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function Ke(e,n){let{$anchor:o,$head:i}=e.selection,s=n>0?o.max(i):o.min(i),r=s.parent.inlineContent?s.depth?e.doc.resolve(n>0?s.after():s.before()):null:s;return r&&t.findFrom(r,n)}function We(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function He(t,o,i){let s=t.state.selection;if(!(s instanceof n)){if(s instanceof e&&s.node.isInline)return We(t,new n(o>0?s.$to:s.$from));{let e=Ke(t.state,o);return!!e&&We(t,e)}}if(i.indexOf("s")>-1){let{$head:e}=s,i=e.textOffset?null:o<0?e.nodeBefore:e.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let r=t.state.doc.resolve(e.pos+i.nodeSize*(o<0?-1:1));return We(t,new n(s.$anchor,r))}if(!s.empty)return!1;if(t.endOfTextblock(o>0?"forward":"backward")){let n=Ke(t.state,o);return!!(n&&n instanceof e)&&We(t,n)}if(!(B&&i.indexOf("m")>-1)){let i,r=s.$head,l=r.textOffset?null:o<0?r.nodeBefore:r.nodeAfter;if(!l||l.isText)return!1;let d=o<0?r.pos-l.nodeSize:r.pos;return!!(l.isAtom||(i=t.docView.descAt(d))&&!i.contentDOM)&&(e.isSelectable(l)?We(t,new e(o<0?t.state.doc.resolve(r.pos-l.nodeSize):r)):!!L&&We(t,new n(t.state.doc.resolve(o<0?d:d+l.nodeSize))))}}function _e(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ge(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function Ue(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(!n)return;let i,s,r=!1;k&&1==n.nodeType&&o<_e(n)&&Ge(n.childNodes[o],-1)&&(r=!0);for(;;)if(o>0){if(1!=n.nodeType)break;{let e=n.childNodes[o-1];if(Ge(e,-1))i=n,s=--o;else{if(3!=e.nodeType)break;n=e,o=n.nodeValue.length}}}else{if(je(n))break;{let t=n.previousSibling;for(;t&&Ge(t,-1);)i=n.parentNode,s=c(t),t=t.previousSibling;if(t)n=t,o=_e(n);else{if(n=n.parentNode,n==e.dom)break;o=0}}}r?Ye(e,n,o):i&&Ye(e,i,s)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(!n)return;let i,s,r=_e(n);for(;;)if(o<r){if(1!=n.nodeType)break;if(!Ge(n.childNodes[o],1))break;i=n,s=++o}else{if(je(n))break;{let t=n.nextSibling;for(;t&&Ge(t,1);)i=t.parentNode,s=c(t)+1,t=t.nextSibling;if(t)n=t,o=0,r=_e(n);else{if(n=n.parentNode,n==e.dom)break;o=r=0}}}i&&Ye(e,i,s)}(e)}function je(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Ye(e,t,n){if(3!=t.nodeType){let e,o;(o=function(e,t){for(;e&&t==e.childNodes.length&&!b(e);)t=c(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=o,n=0):(e=function(e,t){for(;e&&!t&&!b(e);)t=c(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let o=e.domSelection();if(!o)return;if(v(o)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),o.removeAllRanges(),o.addRange(e)}else o.extend&&o.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Ae(e)},50)}function Xe(e,t){let n=e.state.doc.resolve(t);if(!P&&!z&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(n.left-o.left)>1)return n.left<o.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(n.left-o.left)>1)return n.left>o.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Je(i,s,r){let l=i.state.selection;if(l instanceof n&&!l.empty||r.indexOf("s")>-1)return!1;if(B&&r.indexOf("m")>-1)return!1;let{$from:d,$to:a}=l;if(!d.parent.inlineContent||i.endOfTextblock(s<0?"up":"down")){let t=Ke(i.state,s);if(t&&t instanceof e)return We(i,t)}if(!d.parent.inlineContent){let e=s<0?d:a,n=l instanceof o?t.near(e,s):t.findFrom(e,s);return!!n&&We(i,n)}return!1}function Qe(e,t){if(!(e.state.selection instanceof n))return!0;let{$head:o,$anchor:i,empty:s}=e.state.selection;if(!o.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let r=!o.textOffset&&(t<0?o.nodeBefore:o.nodeAfter);if(r&&!r.isText){let n=e.state.tr;return t<0?n.delete(o.pos-r.nodeSize,o.pos):n.delete(o.pos,o.pos+r.nodeSize),e.dispatch(n),!0}return!1}function Ze(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function et(e,t){let n=t.keyCode,o=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||B&&72==n&&"c"==o)return Qe(e,-1)||Ue(e,-1);if(46==n&&!t.shiftKey||B&&68==n&&"c"==o)return Qe(e,1)||Ue(e,1);if(13==n||27==n)return!0;if(37==n||B&&66==n&&"c"==o){let t=37==n?"ltr"==Xe(e,e.state.selection.from)?-1:1:-1;return He(e,t,o)||Ue(e,t)}if(39==n||B&&70==n&&"c"==o){let t=39==n?"ltr"==Xe(e,e.state.selection.from)?1:-1:1;return He(e,t,o)||Ue(e,t)}return 38==n||B&&80==n&&"c"==o?Je(e,-1,o)||Ue(e,-1):40==n||B&&78==n&&"c"==o?function(e){if(!V||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Ze(e,n,"true"),setTimeout(()=>Ze(e,n,"false"),20)}return!1}(e)||Je(e,1,o)||Ue(e,1):o==(B?"m":"c")&&(66==n||73==n||89==n||90==n)}function tt(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:o,openStart:i,openEnd:r}=t;for(;i>1&&r>1&&1==o.childCount&&1==o.firstChild.childCount;){i--,r--;let e=o.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),o=e.content}let l=e.someProp("clipboardSerializer")||s.fromSchema(e.state.schema),d=ht(),a=d.createElement("div");a.appendChild(l.serializeFragment(o,{document:d}));let c,h=a.firstChild,f=0;for(;h&&1==h.nodeType&&(c=at[h.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=d.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),f++}h=a.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${i} ${r}${f?` -${f}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function nt(e,t,n,o,d){let a,c,h=d.parent.type.spec.code;if(!n&&!t)return null;let f=!!t&&(o||h||!n);if(f){if(e.someProp("transformPastedText",n=>{t=n(t,h||o,e)}),h)return c=new i(r.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{c=t(c,e,!0)}),c;let n=e.someProp("clipboardTextParser",n=>n(t,d,o,e));if(n)c=n;else{let n=d.marks(),{schema:o}=e.state,i=s.fromSchema(o);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=a.appendChild(document.createElement("p"));e&&t.appendChild(i.serializeNode(o.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),a=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,o=ht().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&at[i[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join(""));if(o.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;ft||(ft=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return ft.createHTML(e)}(e),n)for(let s=0;s<n.length;s++)o=o.querySelector(n[s])||o;return o}(n),L&&function(e){let t=e.querySelectorAll(P?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let o=t[n];1==o.childNodes.length&&" "==o.textContent&&o.parentNode&&o.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),o)}}(a);let u=a&&a.querySelector("[data-pm-slice]"),p=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let i=+p[3];i>0;i--){let e=a.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;a=e}if(!c){let t=e.someProp("clipboardParser")||e.someProp("domParser")||l.fromSchema(e.state.schema);c=t.parseSlice(a,{preserveWhitespace:!(!f&&!p),context:d,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||ot.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(p)c=function(e,t){if(!e.size)return e;let n,o=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(a){return e}let{content:s,openStart:l,openEnd:d}=e;for(let i=n.length-2;i>=0;i-=2){let e=o.nodes[n[i]];if(!e||e.hasRequiredAttrs())break;s=r.from(e.create(n[i+1],s)),l++,d++}return new i(s,l,d)}(dt(c,+p[1],+p[2]),p[4]);else if(c=i.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o,i=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach(e=>{if(!s)return;let t,n=i.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&o.length&&st(n,o,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=rt(s[s.length-1],o.length));let t=it(e,n);s.push(t),i=i.matchType(t.type),o=n}}),s)return r.from(s)}return e}(c.content,d),!0),c.openStart||c.openEnd){let e=0,t=0;for(let n=c.content.firstChild;e<c.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=c.content.lastChild;t<c.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);c=dt(c,e,t)}return e.someProp("transformPasted",t=>{c=t(c,e,f)}),c}const ot=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function it(e,t,n=0){for(let o=t.length-1;o>=n;o--)e=t[o].create(null,r.from(e));return e}function st(e,t,n,o,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=st(e,t,n,o.lastChild,i+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(i==e.length-1?n.type:e[i+1]))return o.copy(o.content.append(r.from(it(n,e,i+1))))}}function rt(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,rt(e.lastChild,t-1)),o=e.contentMatchAt(e.childCount).fillBefore(r.empty,!0);return e.copy(n.append(o))}function lt(e,t,n,o,i,s){let l=t<0?e.firstChild:e.lastChild,d=l.content;return e.childCount>1&&(s=0),i<o-1&&(d=lt(d,t,n,o,i+1,s)),i>=n&&(d=t<0?l.contentMatchAt(0).fillBefore(d,s<=i).append(d):d.append(l.contentMatchAt(l.childCount).fillBefore(r.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(d))}function dt(e,t,n){return t<e.openStart&&(e=new i(lt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i(lt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const at={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ct=null;function ht(){return ct||(ct=document.implementation.createHTMLDocument("title"))}let ft=null;const ut={},pt={},mt={touchstart:!0,touchmove:!0};class gt{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=/* @__PURE__ */Object.create(null),this.hideSelectionGuard=null}}function yt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function bt(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>vt(e,t))})}function vt(e,t){return e.someProp("handleDOMEvents",n=>{let o=n[t.type];return!!o&&(o(e,t)||t.defaultPrevented)})}function wt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Dt(e){return{left:e.clientX,top:e.clientY}}function Nt(e,t,n,o,i){if(-1==o)return!1;let s=e.state.doc.resolve(o);for(let r=s.depth+1;r>0;r--)if(e.someProp(t,t=>r>s.depth?t(e,n,s.nodeAfter,s.before(r),i,!0):t(e,n,s.node(r),s.before(r),i,!1)))return!0;return!1}function St(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let o=e.state.tr.setSelection(t);o.setMeta("pointer",!0),e.dispatch(o)}function Ct(t,n,o,i,s){return Nt(t,"handleClickOn",n,o,i)||t.someProp("handleClick",e=>e(t,n,i))||(s?function(t,n){if(-1==n)return!1;let o,i,s=t.state.selection;s instanceof e&&(o=s.node);let r=t.state.doc.resolve(n);for(let l=r.depth+1;l>0;l--){let t=l>r.depth?r.nodeAfter:r.node(l);if(e.isSelectable(t)){i=o&&s.$from.depth>0&&l>=s.$from.depth&&r.before(s.$from.depth+1)==s.$from.pos?r.before(s.$from.depth):r.before(l);break}}return null!=i&&(St(t,e.create(t.state.doc,i)),!0)}(t,o):function(t,n){if(-1==n)return!1;let o=t.state.doc.resolve(n),i=o.nodeAfter;return!!(i&&i.isAtom&&e.isSelectable(i))&&(St(t,new e(o)),!0)}(t,o))}function Ot(e,t,n,o){return Nt(e,"handleDoubleClickOn",t,n,o)||e.someProp("handleDoubleClick",n=>n(e,t,o))}function Mt(t,o,i,s){return Nt(t,"handleTripleClickOn",o,i,s)||t.someProp("handleTripleClick",e=>e(t,o,s))||function(t,o,i){if(0!=i.button)return!1;let s=t.state.doc;if(-1==o)return!!s.inlineContent&&(St(t,n.create(s,0,s.content.size)),!0);let r=s.resolve(o);for(let l=r.depth+1;l>0;l--){let o=l>r.depth?r.nodeAfter:r.node(l),i=r.before(l);if(o.inlineContent)St(t,n.create(s,i+1,i+1+o.content.size));else{if(!e.isSelectable(o))continue;St(t,e.create(s,i))}return!0}}(t,i,s)}function xt(e){return Bt(e)}pt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Et(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!I||!P||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!R||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||et(e,n)?n.preventDefault():yt(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,w(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},pt.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},pt.keypress=(e,t)=>{let o=t;if(Et(e,o)||!o.charCode||o.ctrlKey&&!o.altKey||B&&o.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,o)))return void o.preventDefault();let i=e.state.selection;if(!(i instanceof n&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(o.charCode),n=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",o=>o(e,i.$from.pos,i.$to.pos,t,n))||e.dispatch(n()),o.preventDefault()}};const Tt=B?"metaKey":"ctrlKey";ut.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let o=xt(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,o=t.y-e.clientY;return n*n+o*o<100}(n,e.input.lastClick)&&!n[Tt]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?s="doubleClick":"doubleClick"==e.input.lastClick.type&&(s="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let r=e.posAtCoords(Dt(n));r&&("singleClick"==s?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new kt(e,r,n,!!o)):("doubleClick"==s?Ot:Mt)(e,r.pos,r.inside,n)?n.preventDefault():yt(e,"pointer"))};class kt{constructor(t,n,o,i){let s,r;if(this.view=t,this.pos=n,this.event=o,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!o[Tt],this.allowDefault=o.shiftKey,n.inside>-1)s=t.state.doc.nodeAt(n.inside),r=n.inside;else{let e=t.state.doc.resolve(n.pos);s=e.parent,r=e.depth?e.before():0}const l=i?null:o.target,d=l?t.docView.nearestDesc(l,!0):null;this.target=d&&1==d.nodeDOM.nodeType?d.nodeDOM:null;let{selection:a}=t.state;(0==o.button&&s.type.spec.draggable&&!1!==s.type.spec.selectable||a instanceof e&&a.from<=r&&a.to>r)&&(this.mightDrag={node:s,pos:r,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!k||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),yt(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ae(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Dt(e))),this.updateAllowDefault(e),this.allowDefault||!n?yt(this.view,"pointer"):Ct(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||V&&this.mightDrag&&!this.mightDrag.node.isAtom||P&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(St(this.view,t.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):yt(this.view,"pointer")}move(e){this.updateAllowDefault(e),yt(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Et(e,t){return!!e.composing||!!(V&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}ut.touchstart=e=>{e.input.lastTouch=Date.now(),xt(e),yt(e,"pointer")},ut.touchmove=e=>{e.input.lastTouch=Date.now(),yt(e,"pointer")},ut.contextmenu=e=>xt(e);const Pt=I?5e3:-1;function At(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Bt(e),t))}function Vt(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Rt(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=y(e=e.childNodes[t-1])}else{if(!e.parentNode||b(e))return null;t=c(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),o=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||b(e))return null;t=c(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&o&&n!=o){let t=o.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||o==i)return i;if(!t||!t.isText(o.nodeValue))return o;if(e.input.compositionNode==o){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return o}}return n||o}function Bt(e,t=!1){if(!(I&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Vt(e),t||e.docView&&e.docView.dirty){let n=Ee(e),o=e.state.selection;return n&&!n.eq(o)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}pt.compositionstart=pt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,o=t.selection.$to;if(t.selection instanceof n&&(t.storedMarks||!o.textOffset&&o.parentOffset&&o.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||P&&z&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let o=t.childNodes[n];return 1==o.nodeType&&"false"==o.contentEditable}(e)))e.markCursor=e.state.storedMarks||o.marks(),Bt(e,!0),e.markCursor=null;else if(Bt(e,!t.selection.empty),k&&t.selection.empty&&o.parentOffset&&!o.textOffset&&o.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,o=t.focusOffset;n&&1==n.nodeType&&0!=o;){let t=o<0?n.lastChild:n.childNodes[o-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,o=-1}}e.input.composing=!0}At(e,Pt)},pt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,At(e,20))};const zt=x&&T<15||R&&F<604;function It(e,t,n,o,s){let r=nt(e,t,n,o,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,s,r||i.empty)))return!0;if(!r)return!1;let l=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(r),d=l?e.state.tr.replaceSelectionWith(l,o):e.state.tr.replaceSelection(r);return e.dispatch(d.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Lt(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ut.copy=pt.cut=(e,t)=>{let n=t,o=e.state.selection,i="cut"==n.type;if(o.empty)return;let s=zt?null:n.clipboardData,r=o.content(),{dom:l,text:d}=tt(e,r);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",d)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let o=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),o.removeAllRanges(),o.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},pt.paste=(e,t)=>{let n=t;if(e.composing&&!I)return;let o=zt?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;o&&It(e,Lt(o),o.getData("text/html"),i,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,o=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),o.parentNode&&o.parentNode.removeChild(o),n?It(e,o.value,null,i,t):It(e,o.textContent,o.innerHTML,i,t)},50)}(e,n)};class Ft{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const $t=B?"altKey":"ctrlKey";function qt(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[$t]}ut.dragstart=(t,n)=>{let o=n,i=t.input.mouseDown;if(i&&i.done(),!o.dataTransfer)return;let s,r=t.state.selection,l=r.empty?null:t.posAtCoords(Dt(o));if(l&&l.pos>=r.from&&l.pos<=(r instanceof e?r.to-1:r.to));else if(i&&i.mightDrag)s=e.create(t.state.doc,i.mightDrag.pos);else if(o.target&&1==o.target.nodeType){let n=t.docView.nearestDesc(o.target,!0);n&&n.node.type.spec.draggable&&n!=t.docView&&(s=e.create(t.state.doc,n.posBefore))}let d=(s||t.state.selection).content(),{dom:a,text:c,slice:h}=tt(t,d);(!o.dataTransfer.files.length||!P||A>120)&&o.dataTransfer.clearData(),o.dataTransfer.setData(zt?"Text":"text/html",a.innerHTML),o.dataTransfer.effectAllowed="copyMove",zt||o.dataTransfer.setData("text/plain",c),t.dragging=new Ft(h,qt(t,o),s)},ut.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},pt.dragover=pt.dragenter=(e,t)=>t.preventDefault(),pt.drop=(t,n)=>{try{!function(t,n,o){if(!n.dataTransfer)return;let s=t.posAtCoords(Dt(n));if(!s)return;let r=t.state.doc.resolve(s.pos),l=o&&o.slice;l?t.someProp("transformPasted",e=>{l=e(l,t,!1)}):l=nt(t,Lt(n.dataTransfer),zt?null:n.dataTransfer.getData("text/html"),!1,r);let d=!(!o||!qt(t,n));if(t.someProp("handleDrop",e=>e(t,n,l||i.empty,d)))return void n.preventDefault();if(!l)return;n.preventDefault();let c=l?a(t.state.doc,r.pos,l):r.pos;null==c&&(c=r.pos);let h=t.state.tr;if(d){let{node:e}=o;e?e.replace(h):h.deleteSelection()}let f=h.mapping.map(c),u=0==l.openStart&&0==l.openEnd&&1==l.content.childCount,p=h.doc;u?h.replaceRangeWith(f,f,l.content.firstChild):h.replaceRange(f,f,l);if(h.doc.eq(p))return;let m=h.doc.resolve(f);if(u&&e.isSelectable(l.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(l.content.firstChild))h.setSelection(new e(m));else{let e=h.mapping.map(c);h.mapping.maps[h.mapping.maps.length-1].forEach((t,n,o,i)=>e=i),h.setSelection(Fe(t,m,h.doc.resolve(e)))}t.focus(),t.dispatch(h.setMeta("uiEvent","drop"))}(t,n,t.dragging)}finally{t.dragging=null}},ut.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Ae(e)},20))},ut.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},ut.beforeinput=(e,t)=>{if(P&&I&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,w(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let xn in pt)ut[xn]=pt[xn];function Kt(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Wt{constructor(e,t){this.toDOM=e,this.spec=t||jt,this.side=this.spec.side||0}map(e,t,n,o){let{pos:i,deleted:s}=e.mapResult(t.from+o,this.side<0?-1:1);return s?null:new Gt(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Wt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Kt(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ht{constructor(e,t){this.attrs=e,this.spec=t||jt}map(e,t,n,o){let i=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-n,s=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Gt(i,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Ht&&Kt(this.attrs,e.attrs)&&Kt(this.spec,e.spec)}static is(e){return e.type instanceof Ht}destroy(){}}class _t{constructor(e,t){this.attrs=e,this.spec=t||jt}map(e,t,n,o){let i=e.mapResult(t.from+o,1);if(i.deleted)return null;let s=e.mapResult(t.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Gt(i.pos-n,s.pos-n,this)}valid(e,t){let n,{index:o,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(o)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof _t&&Kt(this.attrs,e.attrs)&&Kt(this.spec,e.spec)}destroy(){}}class Gt{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Gt(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Gt(e,e,new Wt(t,n))}static inline(e,t,n,o){return new Gt(e,t,new Ht(n,o))}static node(e,t,n,o){return new Gt(e,t,new _t(n,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ht}get widget(){return this.type instanceof Wt}}const Ut=[],jt={};class Yt{constructor(e,t){this.local=e.length?e:Ut,this.children=t.length?t:Ut}static create(e,t){return t.length?tn(t,e,0,jt):Xt}find(e,t,n){let o=[];return this.findInner(null==e?0:e,null==t?1e9:t,o,0,n),o}findInner(e,t,n,o,i){for(let s=0;s<this.local.length;s++){let r=this.local[s];r.from<=t&&r.to>=e&&(!i||i(r.spec))&&n.push(r.copy(r.from+o,r.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let r=this.children[s]+1;this.children[s+2].findInner(e-r,t-r,n,o+r,i)}}map(e,t,n){return this==Xt||0==e.maps.length?this:this.mapInner(e,t,0,0,n||jt)}mapInner(e,t,n,o,i){let s;for(let r=0;r<this.local.length;r++){let l=this.local[r].map(e,n,o);l&&l.type.valid(t,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[r].spec)}return this.children.length?function(e,t,n,o,i,s,r){let l=e.slice();for(let a=0,c=s;a<n.maps.length;a++){let e=0;n.maps[a].forEach((t,n,o,i)=>{let s=i-o-(n-t);for(let r=0;r<l.length;r+=3){let o=l[r+1];if(o<0||t>o+c-e)continue;let i=l[r]+c-e;n>=i?l[r+1]=t<=i?-2:-1:t>=c&&s&&(l[r]+=s,l[r+1]+=s)}e+=s}),c=n.maps[a].map(c,-1)}let d=!1;for(let a=0;a<l.length;a+=3)if(l[a+1]<0){if(-2==l[a+1]){d=!0,l[a+1]=-1;continue}let t=n.map(e[a]+s),c=t-i;if(c<0||c>=o.content.size){d=!0;continue}let h=n.map(e[a+1]+s,-1)-i,{index:f,offset:u}=o.content.findIndex(c),p=o.maybeChild(f);if(p&&u==c&&u+p.nodeSize==h){let o=l[a+2].mapInner(n,p,t+1,e[a]+s+1,r);o!=Xt?(l[a]=c,l[a+1]=h,l[a+2]=o):(l[a+1]=-2,d=!0)}else d=!0}if(d){let d=function(e,t,n,o,i,s,r){function l(e,t){for(let s=0;s<e.local.length;s++){let l=e.local[s].map(o,i,t);l?n.push(l):r.onRemove&&r.onRemove(e.local[s].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let d=0;d<e.length;d+=3)-1==e[d+1]&&l(e[d+2],t[d]+s+1);return n}(l,e,t,n,i,s,r),a=tn(d,o,0,r);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new Yt(t.sort(nn),l)}(this.children,s||[],e,t,n,o,i):s?new Yt(s.sort(nn),Ut):Xt}add(e,t){return t.length?this==Xt?Yt.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let o,i=0;e.forEach((e,s)=>{let r,l=s+n;if(r=Zt(t,e,l)){for(o||(o=this.children.slice());i<o.length&&o[i]<s;)i+=3;o[i]==s?o[i+2]=o[i+2].addInner(e,r,l+1):o.splice(i,0,s,s+e.nodeSize,tn(r,e,l+1,jt)),i+=3}});let s=Qt(i?en(t):t,-n);for(let r=0;r<s.length;r++)s[r].type.valid(e,s[r])||s.splice(r--,1);return new Yt(s.length?this.local.concat(s).sort(nn):this.local,o||this.children)}remove(e){return 0==e.length||this==Xt?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,o=this.local;for(let i=0;i<n.length;i+=3){let o,s=n[i]+t,r=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>s&&t.to<r&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let l=n[i+2].removeInner(o,s+1);l!=Xt?n[i+2]=l:(n.splice(i,3),i-=3)}if(o.length)for(let i,s=0;s<e.length;s++)if(i=e[s])for(let e=0;e<o.length;e++)o[e].eq(i,t)&&(o==this.local&&(o=this.local.slice()),o.splice(e--,1));return n==this.children&&o==this.local?this:o.length||n.length?new Yt(o,n):Xt}forChild(e,t){if(this==Xt)return this;if(t.isLeaf)return Yt.empty;let n,o;for(let r=0;r<this.children.length;r+=3)if(this.children[r]>=e){this.children[r]==e&&(n=this.children[r+2]);break}let i=e+1,s=i+t.content.size;for(let r=0;r<this.local.length;r++){let e=this.local[r];if(e.from<s&&e.to>i&&e.type instanceof Ht){let t=Math.max(i,e.from)-i,n=Math.min(s,e.to)-i;t<n&&(o||(o=[])).push(e.copy(t,n))}}if(o){let e=new Yt(o.sort(nn),Ut);return n?new Jt([e,n]):e}return n||Xt}eq(e){if(this==e)return!0;if(!(e instanceof Yt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return on(this.localsInner(e))}localsInner(e){if(this==Xt)return Ut;if(e.inlineContent||!this.local.some(Ht.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Ht||t.push(this.local[n]);return t}forEachSet(e){e(this)}}Yt.empty=new Yt([],[]),Yt.removeOverlap=on;const Xt=Yt.empty;class Jt{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,jt));return Jt.from(n)}forChild(e,t){if(t.isLeaf)return Yt.empty;let n=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,t);i!=Xt&&(i instanceof Jt?n=n.concat(i.members):n.push(i))}return Jt.from(n)}eq(e){if(!(e instanceof Jt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?on(n?t:t.sort(nn)):Ut}static from(e){switch(e.length){case 0:return Xt;case 1:return e[0];default:return new Jt(e.every(e=>e instanceof Yt)?e:e.reduce((e,t)=>e.concat(t instanceof Yt?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Qt(e,t){if(!t||!e.length)return e;let n=[];for(let o=0;o<e.length;o++){let i=e[o];n.push(new Gt(i.from+t,i.to+t,i.type))}return n}function Zt(e,t,n){if(t.isLeaf)return null;let o=n+t.nodeSize,i=null;for(let s,r=0;r<e.length;r++)(s=e[r])&&s.from>n&&s.to<o&&((i||(i=[])).push(s),e[r]=null);return i}function en(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function tn(e,t,n,o){let i=[],s=!1;t.forEach((t,r)=>{let l=Zt(e,t,r+n);if(l){s=!0;let e=tn(l,t,n+r+1,o);e!=Xt&&i.push(r,r+t.nodeSize,e)}});let r=Qt(s?en(e):e,-n).sort(nn);for(let l=0;l<r.length;l++)r[l].type.valid(t,r[l])||(o.onRemove&&o.onRemove(r[l].spec),r.splice(l--,1));return r.length||i.length?new Yt(r,i):Xt}function nn(e,t){return e.from-t.from||e.to-t.to}function on(e){let t=e;for(let n=0;n<t.length-1;n++){let o=t[n];if(o.from!=o.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from!=o.from){s.from<o.to&&(t==e&&(t=e.slice()),t[n]=o.copy(o.from,s.from),sn(t,i,o.copy(s.from,o.to)));break}s.to!=o.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,o.to),sn(t,i+1,s.copy(o.to,s.to)))}}return t}function sn(e,t,n){for(;t<e.length&&nn(n,e[t])>0;)t++;e.splice(t,0,n)}function rn(e){let t=[];return e.someProp("decorations",n=>{let o=n(e.state);o&&o!=Xt&&t.push(o)}),e.cursorWrapper&&t.push(Yt.create(e.state.doc,[e.cursorWrapper.deco])),Jt.from(t)}const ln={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dn=x&&T<=11;class an{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class cn{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new an,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);x&&T<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():V&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),dn&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ln)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if($e(this.view)){if(this.suppressingSelectionUpdates)return Ae(this.view);if(x&&T<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&p(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=/* @__PURE__ */new Set;for(let i=e.focusNode;i;i=h(i))n.add(i);for(let i=e.anchorNode;i;i=h(i))if(n.has(i)){t=i;break}let o=t&&this.view.docView.nearestDesc(t);return o&&o.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let o=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&$e(e)&&!this.ignoreSelectionChange(o),s=-1,r=-1,l=!1,d=[];if(e.editable)for(let t=0;t<n.length;t++){let e=this.registerMutation(n[t],d);e&&(s=s<0?e.from:Math.min(e.from,s),r=r<0?e.to:Math.max(e.to,r),e.typeOver&&(l=!0))}if(!d.some(e=>"BR"==e.nodeName)||8!=e.input.lastKeyCode&&46!=e.input.lastKeyCode){if(k&&d.length){let t=d.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let o of t){let t=o.parentNode;!t||"LI"!=t.nodeName||n&&pn(e,n)==t||o.remove()}}}}else for(let t of d)if("BR"==t.nodeName&&t.parentNode){let e=t.nextSibling;e&&1==e.nodeType&&"false"==e.contentEditable&&t.parentNode.removeChild(t)}let a=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&v(o)&&(a=Ee(e))&&a.eq(t.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ae(e),this.currentSelection.set(o),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,r),function(e){if(hn.has(e))return;if(hn.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=k,fn)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),fn=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:o,focusOffset:i}=e.domSelectionRange();for(let s of t)if("TR"==(null===(n=s.parentNode)||void 0===n?void 0:n.nodeName)){let t=s.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(s,n.firstChild),o==s&&e.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}(e,d)),this.handleDOMChange(s,r,l,d),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(o)||Ae(e),this.currentSelection.set(o))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let o=e.addedNodes[n];t.push(o),3==o.nodeType&&(this.lastChangedTextNode=o)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let o=e.previousSibling,i=e.nextSibling;if(x&&T<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:s}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(o=n),(!s||Array.prototype.indexOf.call(e.addedNodes,s)<0)&&(i=s)}let s=o&&o.parentNode==e.target?c(o)+1:0,r=n.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?c(i):e.target.childNodes.length;return{from:r,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let hn=/* @__PURE__ */new WeakMap,fn=!1;function un(e,t){let n=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,r=e.domAtPos(e.state.selection.anchor);return p(r.node,r.offset,i,s)&&([n,o,i,s]=[i,s,n,o]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}function pn(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function mn(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(V&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||V&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const gn=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function yn(e,t,o,i,s){let d=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Ee(e,t);if(n&&!e.state.selection.eq(n)){if(P&&I&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,w(13,"Enter"))))return;let o=e.state.tr.setSelection(n);"pointer"==t?o.setMeta("pointer",!0):"key"==t&&o.scrollIntoView(),d&&o.setMeta("composition",d),e.dispatch(o)}return}let a=e.state.doc.resolve(t),c=a.sharedDepth(o);t=a.before(c+1),o=e.state.doc.resolve(o).after(c+1);let h,f,u=e.state.selection,p=function(e,t,n){let o,{node:i,fromOffset:s,toOffset:r,from:d,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),h=c.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(o=[{node:h,offset:c.anchorOffset}],v(c)||o.push({node:c.focusNode,offset:c.focusOffset})),P&&8===e.input.lastKeyCode)for(let l=r;l>s;l--){let e=i.childNodes[l-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){r=l;break}if(!t||t.size)break}let f=e.state.doc,u=e.someProp("domParser")||l.fromSchema(e.state.schema),p=f.resolve(d),m=null,g=u.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:r,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:o,ruleFromNode:mn,context:p});if(o&&null!=o[0].pos){let e=o[0].pos,t=o[1]&&o[1].pos;null==t&&(t=e),m={anchor:e+d,head:t+d}}return{doc:g,sel:m,from:d,to:a}}(e,t,o),m=e.state.doc,g=m.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(h=e.state.selection.to,f="end"):(h=e.state.selection.from,f="start"),e.input.lastKeyCode=null;let y=function(e,t,n,o,i){let s=e.findDiffStart(t,n);if(null==s)return null;let{a:r,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){o-=r+Math.max(0,s-Math.min(r,l))-s}if(r<s&&e.size<t.size){let e=o<=s&&o>=r?s-o:0;s-=e,s&&s<t.size&&wn(t.textBetween(s-1,s+1))&&(s+=e?1:-1),l=s+(l-r),r=s}else if(l<s){let t=o<=s&&o>=l?s-o:0;s-=t,s&&s<e.size&&wn(e.textBetween(s-1,s+1))&&(s+=t?1:-1),r=s+(r-l),l=s}return{start:s,endA:r,endB:l}}(g.content,p.doc.content,p.from,h,f);if(y&&e.input.domChangeCount++,(R&&e.input.lastIOSEnter>Date.now()-225||I)&&s.some(e=>1==e.nodeType&&!gn.test(e.nodeName))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",t=>t(e,w(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!y){if(!(i&&u instanceof n&&!u.empty&&u.$head.sameParent(u.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=bn(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);d&&n.setMeta("composition",d),e.dispatch(n)}}return}y={start:u.from,endA:u.to,endB:u.to}}e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof n&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),x&&T<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>p.from&&"  "==p.doc.textBetween(y.start-p.from-1,y.start-p.from+1)&&(y.start--,y.endA--,y.endB--);let b=p.doc.resolveNoCache(y.start-p.from),D=p.doc.resolveNoCache(y.endB-p.from),N=m.resolve(y.start),S=b.sameParent(D)&&b.parent.inlineContent&&N.end()>=y.endA;if((R&&e.input.lastIOSEnter>Date.now()-225&&(!S||s.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!S&&b.pos<p.doc.content.size&&(!b.sameParent(D)||!b.parent.inlineContent)&&b.pos<D.pos&&!/\S/.test(p.doc.textBetween(b.pos,D.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,w(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>y.start&&function(e,t,n,o,i){if(n-t<=i.pos-o.pos||vn(o,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!o.parent.isTextblock){let e=s.nodeAfter;return null!=e&&n==t+e.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let r=e.resolve(vn(s,!0,!0));return!(!r.parent.isTextblock||r.pos>n||vn(r,!0,!1)<n)&&o.parent.content.cut(o.parentOffset).eq(r.parent.content)}(m,y.start,y.endA,b,D)&&e.someProp("handleKeyDown",t=>t(e,w(8,"Backspace"))))return void(I&&P&&e.domObserver.suppressSelectionUpdates());P&&y.endB==y.start&&(e.input.lastChromeDelete=Date.now()),I&&!S&&b.start()!=D.start()&&0==D.parentOffset&&b.depth==D.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==y.endA&&(y.endB-=2,D=p.doc.resolveNoCache(y.endB-p.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,w(13,"Enter"))})},20));let C,O=y.start,M=y.endA,k=t=>{let n=t||e.state.tr.replace(O,M,p.doc.slice(y.start-p.from,y.endB-p.from));if(p.sel){let t=bn(e,n.doc,p.sel);t&&!(P&&e.composing&&t.empty&&(y.start!=y.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==O||t.head==n.mapping.map(M)-1)||x&&t.empty&&t.head==O)&&n.setSelection(t)}return d&&n.setMeta("composition",d),n.scrollIntoView()};if(S)if(b.pos==D.pos){x&&T<=11&&0==b.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ae(e),20));let t=k(e.state.tr.delete(O,M)),n=m.resolve(y.start).marksAcross(m.resolve(y.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(y.endA==y.endB&&(C=function(e,t){let n,o,i,s=e.firstChild.marks,l=t.firstChild.marks,d=s,a=l;for(let r=0;r<l.length;r++)d=l[r].removeFromSet(d);for(let r=0;r<s.length;r++)a=s[r].removeFromSet(a);if(1==d.length&&0==a.length)o=d[0],n="add",i=e=>e.mark(o.addToSet(e.marks));else{if(0!=d.length||1!=a.length)return null;o=a[0],n="remove",i=e=>e.mark(o.removeFromSet(e.marks))}let c=[];for(let r=0;r<t.childCount;r++)c.push(i(t.child(r)));if(r.from(c).eq(e))return{mark:o,type:n}}(b.parent.content.cut(b.parentOffset,D.parentOffset),N.parent.content.cut(N.parentOffset,y.endA-N.start())))){let t=k(e.state.tr);"add"==C.type?t.addMark(O,M,C.mark):t.removeMark(O,M,C.mark),e.dispatch(t)}else if(b.parent.child(b.index()).isText&&b.index()==D.index()-(D.textOffset?0:1)){let t=b.parent.textBetween(b.parentOffset,D.parentOffset),n=()=>k(e.state.tr.insertText(t,O,M));e.someProp("handleTextInput",o=>o(e,O,M,t,n))||e.dispatch(n())}else e.dispatch(k());else e.dispatch(k())}function bn(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Fe(e,t.resolve(n.anchor),t.resolve(n.head))}function vn(e,t,n){let o=e.depth,i=t?e.end():e.pos;for(;o>0&&(t||e.indexAfter(o)==e.node(o).childCount);)o--,i++,t=!1;if(n){let t=e.node(o).maybeChild(e.indexAfter(o));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function wn(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Dn{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new gt,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Mn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Cn(this),Sn(this),this.nodeViews=On(this),this.docView=pe(this.state.doc,Nn(this),rn(this),this.dom,this),this.domObserver=new cn(this,(e,t,n,o)=>yn(this,e,t,n,o)),this.domObserver.start(),function(e){for(let t in ut){let n=ut[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!wt(e,t)||vt(e,t)||!e.editable&&t.type in pt||n(e,t)},mt[t]?{passive:!0}:void 0)}V&&e.dom.addEventListener("input",()=>null),bt(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&bt(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Mn),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Vt(this),s=!0),this.state=e;let r=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(r||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=On(this);(function(e,t){let n=0,o=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)o++;return n!=o})(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(r||t.handleDOMEvents!=this._props.handleDOMEvents)&&bt(this),this.editable=Cn(this),Sn(this);let l=rn(this),d=Nn(this),a=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",c=i||!this.docView.matchesNode(e.doc,d,l);!c&&e.selection.eq(o.selection)||(s=!0);let h="preserve"==a&&s&&null==this.dom.style.overflowAnchor&&function(e){let t,n,o=e.dom.getBoundingClientRect(),i=Math.max(0,o.top);for(let s=(o.left+o.right)/2,r=i+1;r<Math.min(innerHeight,o.bottom);r+=5){let o=e.root.elementFromPoint(s,r);if(!o||o==e.dom||!e.dom.contains(o))continue;let l=o.getBoundingClientRect();if(l.top>=i-20){t=o,n=l.top;break}}return{refDOM:t,refTop:n,stack:H(e.dom)}}(this);if(s){this.domObserver.stop();let t=c&&(x||P)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(o.selection,e.selection);if(c){let n=P?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Rt(this)),!i&&this.docView.update(e.doc,d,l,this)||(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=pe(e.doc,d,l,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return p(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Ae(this,t):(Ie(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==a?this.dom.scrollTop=0:"to selection"==a?this.scrollToSelection():h&&function({refDOM:e,refTop:t,stack:n}){let o=e?e.getBoundingClientRect().top:0;_(n,0==o?0:o-t)}(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(t&&this.dom.contains(1==t.nodeType?t:t.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof e){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&W(this,e.getBoundingClientRect(),t)}else W(this,this.coordsAtPos(this.state.selection.head,1),t);else;}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(t,n){let o=t.node,i=-1;if(this.state.doc.nodeAt(o.from)==o.node)i=o.from;else{let e=o.from+(this.state.doc.content.size-n.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==o.node&&(i=e)}this.dragging=new Ft(t.slice,t.move,i<0?void 0:e.create(this.state.doc,i))}someProp(e,t){let n,o=this._props&&this._props[e];if(null!=o&&(n=t?t(o):o))return n;for(let s=0;s<this.directPlugins.length;s++){let o=this.directPlugins[s].props[e];if(null!=o&&(n=t?t(o):o))return n}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let o=i[s].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){if(x){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(G)return e.focus(G);let t=H(e);e.focus(null==G?{get preventScroll(){return G={preventScroll:!0},!0}}:void 0),G||(G=!1,_(t,0))}(this.dom),Ae(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return X(this,e)}coordsAtPos(e,t=1){return ee(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let o=this.docView.posFromDOM(e,t,n);if(null==o)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,t){return de(this,t||this.state,e)}pasteHTML(e,t){return It(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return It(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return tt(this,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,f=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){vt(e,t)||!ut[t.type]||!e.editable&&t.type in pt||ut[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?V&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return un(e,n)}let n;function o(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",o,!0),n?un(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Nn(e){let t=/* @__PURE__ */Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[Gt.node(0,e.state.doc.content.size,t)]}function Sn(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Gt.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Cn(e){return!e.someProp("editable",t=>!1===t(e.state))}function On(e){let t=/* @__PURE__ */Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Mn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Dn.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};export{Gt as Decoration,Yt as DecorationSet,Dn as EditorView};
14
+ import { NodeSelection as D, Selection as be, TextSelection as k, AllSelection as Cn } from "../../prosemirror-state/dist/index.js";
15
+ import { Slice as se, DOMSerializer as Ve, Fragment as j, DOMParser as $t, Mark as Sn } from "../../prosemirror-model/dist/index.js";
16
+ import { dropPoint as On } from "../../prosemirror-transform/dist/index.js";
17
+ const S = function(t) {
18
+ for (var e = 0; ; e++)
19
+ if (t = t.previousSibling, !t)
20
+ return e;
21
+ }, he = function(t) {
22
+ let e = t.assignedSlot || t.parentNode;
23
+ return e && e.nodeType == 11 ? e.host : e;
24
+ };
25
+ let qe = null;
26
+ const H = function(t, e, n) {
27
+ let o = qe || (qe = document.createRange());
28
+ return o.setEnd(t, n ?? t.nodeValue.length), o.setStart(t, e || 0), o;
29
+ }, xn = function() {
30
+ qe = null;
31
+ }, re = function(t, e, n, o) {
32
+ return n && (st(t, e, n, o, -1) || st(t, e, n, o, 1));
33
+ }, Mn = /^(img|br|input|textarea|hr)$/i;
34
+ function st(t, e, n, o, i) {
35
+ for (var s; ; ) {
36
+ if (t == n && e == o)
37
+ return !0;
38
+ if (e == (i < 0 ? 0 : R(t))) {
39
+ let r = t.parentNode;
40
+ if (!r || r.nodeType != 1 || Se(t) || Mn.test(t.nodeName) || t.contentEditable == "false")
41
+ return !1;
42
+ e = S(t) + (i < 0 ? 0 : 1), t = r;
43
+ } else if (t.nodeType == 1) {
44
+ let r = t.childNodes[e + (i < 0 ? -1 : 0)];
45
+ if (r.nodeType == 1 && r.contentEditable == "false")
46
+ if (!((s = r.pmViewDesc) === null || s === void 0) && s.ignoreForSelection)
47
+ e += i;
48
+ else
49
+ return !1;
50
+ else
51
+ t = r, e = i < 0 ? R(t) : 0;
52
+ } else
53
+ return !1;
54
+ }
55
+ }
56
+ function R(t) {
57
+ return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
58
+ }
59
+ function kn(t, e) {
60
+ for (; ; ) {
61
+ if (t.nodeType == 3 && e)
62
+ return t;
63
+ if (t.nodeType == 1 && e > 0) {
64
+ if (t.contentEditable == "false")
65
+ return null;
66
+ t = t.childNodes[e - 1], e = R(t);
67
+ } else if (t.parentNode && !Se(t))
68
+ e = S(t), t = t.parentNode;
69
+ else
70
+ return null;
71
+ }
72
+ }
73
+ function Tn(t, e) {
74
+ for (; ; ) {
75
+ if (t.nodeType == 3 && e < t.nodeValue.length)
76
+ return t;
77
+ if (t.nodeType == 1 && e < t.childNodes.length) {
78
+ if (t.contentEditable == "false")
79
+ return null;
80
+ t = t.childNodes[e], e = 0;
81
+ } else if (t.parentNode && !Se(t))
82
+ e = S(t) + 1, t = t.parentNode;
83
+ else
84
+ return null;
85
+ }
86
+ }
87
+ function En(t, e, n) {
88
+ for (let o = e == 0, i = e == R(t); o || i; ) {
89
+ if (t == n)
90
+ return !0;
91
+ let s = S(t);
92
+ if (t = t.parentNode, !t)
93
+ return !1;
94
+ o = o && s == 0, i = i && s == R(t);
95
+ }
96
+ }
97
+ function Se(t) {
98
+ let e;
99
+ for (let n = t; n && !(e = n.pmViewDesc); n = n.parentNode)
100
+ ;
101
+ return e && e.node && e.node.isBlock && (e.dom == t || e.contentDOM == t);
102
+ }
103
+ const Re = function(t) {
104
+ return t.focusNode && re(t.focusNode, t.focusOffset, t.anchorNode, t.anchorOffset);
105
+ };
106
+ function ee(t, e) {
107
+ let n = document.createEvent("Event");
108
+ return n.initEvent("keydown", !0, !0), n.keyCode = t, n.key = n.code = e, n;
109
+ }
110
+ function Pn(t) {
111
+ let e = t.activeElement;
112
+ for (; e && e.shadowRoot; )
113
+ e = e.shadowRoot.activeElement;
114
+ return e;
115
+ }
116
+ function An(t, e, n) {
117
+ if (t.caretPositionFromPoint)
118
+ try {
119
+ let o = t.caretPositionFromPoint(e, n);
120
+ if (o)
121
+ return { node: o.offsetNode, offset: Math.min(R(o.offsetNode), o.offset) };
122
+ } catch {
123
+ }
124
+ if (t.caretRangeFromPoint) {
125
+ let o = t.caretRangeFromPoint(e, n);
126
+ if (o)
127
+ return { node: o.startContainer, offset: Math.min(R(o.startContainer), o.startOffset) };
128
+ }
129
+ }
130
+ const $ = typeof navigator < "u" ? navigator : null, rt = typeof document < "u" ? document : null, w = $ && $.userAgent || "", He = /Edge\/(\d+)/.exec(w), Kt = /MSIE \d/.exec(w), We = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(w), A = !!(Kt || We || He), J = Kt ? document.documentMode : We ? +We[1] : He ? +He[1] : 0, B = !A && /gecko\/(\d+)/i.test(w);
131
+ B && +(/Firefox\/(\d+)/.exec(w) || [0, 0])[1];
132
+ const _e = !A && /Chrome\/(\d+)/.exec(w), O = !!_e, qt = _e ? +_e[1] : 0, M = !A && !!$ && /Apple Computer/.test($.vendor), ue = M && (/Mobile\/\w+/.test(w) || !!$ && $.maxTouchPoints > 2), V = ue || ($ ? /Mac/.test($.platform) : !1), Ht = $ ? /Win/.test($.platform) : !1, W = /Android \d/.test(w), Oe = !!rt && "webkitFontSmoothing" in rt.documentElement.style, Vn = Oe ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
133
+ function Rn(t) {
134
+ let e = t.defaultView && t.defaultView.visualViewport;
135
+ return e ? {
136
+ left: 0,
137
+ right: e.width,
138
+ top: 0,
139
+ bottom: e.height
140
+ } : {
141
+ left: 0,
142
+ right: t.documentElement.clientWidth,
143
+ top: 0,
144
+ bottom: t.documentElement.clientHeight
145
+ };
146
+ }
147
+ function q(t, e) {
148
+ return typeof t == "number" ? t : t[e];
149
+ }
150
+ function Bn(t) {
151
+ let e = t.getBoundingClientRect(), n = e.width / t.offsetWidth || 1, o = e.height / t.offsetHeight || 1;
152
+ return {
153
+ left: e.left,
154
+ right: e.left + t.clientWidth * n,
155
+ top: e.top,
156
+ bottom: e.top + t.clientHeight * o
157
+ };
158
+ }
159
+ function lt(t, e, n) {
160
+ let o = t.someProp("scrollThreshold") || 0, i = t.someProp("scrollMargin") || 5, s = t.dom.ownerDocument;
161
+ for (let r = n || t.dom; r; ) {
162
+ if (r.nodeType != 1) {
163
+ r = he(r);
164
+ continue;
165
+ }
166
+ let l = r, a = l == s.body, c = a ? Rn(s) : Bn(l), d = 0, f = 0;
167
+ if (e.top < c.top + q(o, "top") ? f = -(c.top - e.top + q(i, "top")) : e.bottom > c.bottom - q(o, "bottom") && (f = e.bottom - e.top > c.bottom - c.top ? e.top + q(i, "top") - c.top : e.bottom - c.bottom + q(i, "bottom")), e.left < c.left + q(o, "left") ? d = -(c.left - e.left + q(i, "left")) : e.right > c.right - q(o, "right") && (d = e.right - c.right + q(i, "right")), d || f)
168
+ if (a)
169
+ s.defaultView.scrollBy(d, f);
170
+ else {
171
+ let p = l.scrollLeft, h = l.scrollTop;
172
+ f && (l.scrollTop += f), d && (l.scrollLeft += d);
173
+ let g = l.scrollLeft - p, m = l.scrollTop - h;
174
+ e = { left: e.left - g, top: e.top - m, right: e.right - g, bottom: e.bottom - m };
175
+ }
176
+ let u = a ? "fixed" : getComputedStyle(r).position;
177
+ if (/^(fixed|sticky)$/.test(u))
178
+ break;
179
+ r = u == "absolute" ? r.offsetParent : he(r);
180
+ }
181
+ }
182
+ function In(t) {
183
+ let e = t.dom.getBoundingClientRect(), n = Math.max(0, e.top), o, i;
184
+ for (let s = (e.left + e.right) / 2, r = n + 1; r < Math.min(innerHeight, e.bottom); r += 5) {
185
+ let l = t.root.elementFromPoint(s, r);
186
+ if (!l || l == t.dom || !t.dom.contains(l))
187
+ continue;
188
+ let a = l.getBoundingClientRect();
189
+ if (a.top >= n - 20) {
190
+ o = l, i = a.top;
191
+ break;
192
+ }
193
+ }
194
+ return { refDOM: o, refTop: i, stack: Wt(t.dom) };
195
+ }
196
+ function Wt(t) {
197
+ let e = [], n = t.ownerDocument;
198
+ for (let o = t; o && (e.push({ dom: o, top: o.scrollTop, left: o.scrollLeft }), t != n); o = he(o))
199
+ ;
200
+ return e;
201
+ }
202
+ function Fn({ refDOM: t, refTop: e, stack: n }) {
203
+ let o = t ? t.getBoundingClientRect().top : 0;
204
+ _t(n, o == 0 ? 0 : o - e);
205
+ }
206
+ function _t(t, e) {
207
+ for (let n = 0; n < t.length; n++) {
208
+ let { dom: o, top: i, left: s } = t[n];
209
+ o.scrollTop != i + e && (o.scrollTop = i + e), o.scrollLeft != s && (o.scrollLeft = s);
210
+ }
211
+ }
212
+ let ae = null;
213
+ function zn(t) {
214
+ if (t.setActive)
215
+ return t.setActive();
216
+ if (ae)
217
+ return t.focus(ae);
218
+ let e = Wt(t);
219
+ t.focus(ae == null ? {
220
+ get preventScroll() {
221
+ return ae = { preventScroll: !0 }, !0;
222
+ }
223
+ } : void 0), ae || (ae = !1, _t(e, 0));
224
+ }
225
+ function jt(t, e) {
226
+ let n, o = 2e8, i, s = 0, r = e.top, l = e.top, a, c;
227
+ for (let d = t.firstChild, f = 0; d; d = d.nextSibling, f++) {
228
+ let u;
229
+ if (d.nodeType == 1)
230
+ u = d.getClientRects();
231
+ else if (d.nodeType == 3)
232
+ u = H(d).getClientRects();
233
+ else
234
+ continue;
235
+ for (let p = 0; p < u.length; p++) {
236
+ let h = u[p];
237
+ if (h.top <= r && h.bottom >= l) {
238
+ r = Math.max(h.bottom, r), l = Math.min(h.top, l);
239
+ let g = h.left > e.left ? h.left - e.left : h.right < e.left ? e.left - h.right : 0;
240
+ if (g < o) {
241
+ n = d, o = g, i = g && n.nodeType == 3 ? {
242
+ left: h.right < e.left ? h.right : h.left,
243
+ top: e.top
244
+ } : e, d.nodeType == 1 && g && (s = f + (e.left >= (h.left + h.right) / 2 ? 1 : 0));
245
+ continue;
246
+ }
247
+ } else h.top > e.top && !a && h.left <= e.left && h.right >= e.left && (a = d, c = { left: Math.max(h.left, Math.min(h.right, e.left)), top: h.top });
248
+ !n && (e.left >= h.right && e.top >= h.top || e.left >= h.left && e.top >= h.bottom) && (s = f + 1);
249
+ }
250
+ }
251
+ return !n && a && (n = a, i = c, o = 0), n && n.nodeType == 3 ? Ln(n, i) : !n || o && n.nodeType == 1 ? { node: t, offset: s } : jt(n, i);
252
+ }
253
+ function Ln(t, e) {
254
+ let n = t.nodeValue.length, o = document.createRange(), i;
255
+ for (let s = 0; s < n; s++) {
256
+ o.setEnd(t, s + 1), o.setStart(t, s);
257
+ let r = U(o, 1);
258
+ if (r.top != r.bottom && Ze(e, r)) {
259
+ i = { node: t, offset: s + (e.left >= (r.left + r.right) / 2 ? 1 : 0) };
260
+ break;
261
+ }
262
+ }
263
+ return o.detach(), i || { node: t, offset: 0 };
264
+ }
265
+ function Ze(t, e) {
266
+ return t.left >= e.left - 1 && t.left <= e.right + 1 && t.top >= e.top - 1 && t.top <= e.bottom + 1;
267
+ }
268
+ function $n(t, e) {
269
+ let n = t.parentNode;
270
+ return n && /^li$/i.test(n.nodeName) && e.left < t.getBoundingClientRect().left ? n : t;
271
+ }
272
+ function Kn(t, e, n) {
273
+ let { node: o, offset: i } = jt(e, n), s = -1;
274
+ if (o.nodeType == 1 && !o.firstChild) {
275
+ let r = o.getBoundingClientRect();
276
+ s = r.left != r.right && n.left > (r.left + r.right) / 2 ? 1 : -1;
277
+ }
278
+ return t.docView.posFromDOM(o, i, s);
279
+ }
280
+ function qn(t, e, n, o) {
281
+ let i = -1;
282
+ for (let s = e, r = !1; s != t.dom; ) {
283
+ let l = t.docView.nearestDesc(s, !0), a;
284
+ if (!l)
285
+ return null;
286
+ if (l.dom.nodeType == 1 && (l.node.isBlock && l.parent || !l.contentDOM) && // Ignore elements with zero-size bounding rectangles
287
+ ((a = l.dom.getBoundingClientRect()).width || a.height) && (l.node.isBlock && l.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName) && (!r && a.left > o.left || a.top > o.top ? i = l.posBefore : (!r && a.right < o.left || a.bottom < o.top) && (i = l.posAfter), r = !0), !l.contentDOM && i < 0 && !l.node.isText))
288
+ return (l.node.isBlock ? o.top < (a.top + a.bottom) / 2 : o.left < (a.left + a.right) / 2) ? l.posBefore : l.posAfter;
289
+ s = l.dom.parentNode;
290
+ }
291
+ return i > -1 ? i : t.docView.posFromDOM(e, n, -1);
292
+ }
293
+ function Ut(t, e, n) {
294
+ let o = t.childNodes.length;
295
+ if (o && n.top < n.bottom)
296
+ for (let i = Math.max(0, Math.min(o - 1, Math.floor(o * (e.top - n.top) / (n.bottom - n.top)) - 2)), s = i; ; ) {
297
+ let r = t.childNodes[s];
298
+ if (r.nodeType == 1) {
299
+ let l = r.getClientRects();
300
+ for (let a = 0; a < l.length; a++) {
301
+ let c = l[a];
302
+ if (Ze(e, c))
303
+ return Ut(r, e, c);
304
+ }
305
+ }
306
+ if ((s = (s + 1) % o) == i)
307
+ break;
308
+ }
309
+ return t;
310
+ }
311
+ function Hn(t, e) {
312
+ let n = t.dom.ownerDocument, o, i = 0, s = An(n, e.left, e.top);
313
+ s && ({ node: o, offset: i } = s);
314
+ let r = (t.root.elementFromPoint ? t.root : n).elementFromPoint(e.left, e.top), l;
315
+ if (!r || !t.dom.contains(r.nodeType != 1 ? r.parentNode : r)) {
316
+ let c = t.dom.getBoundingClientRect();
317
+ if (!Ze(e, c) || (r = Ut(t.dom, e, c), !r))
318
+ return null;
319
+ }
320
+ if (M)
321
+ for (let c = r; o && c; c = he(c))
322
+ c.draggable && (o = void 0);
323
+ if (r = $n(r, e), o) {
324
+ if (B && o.nodeType == 1 && (i = Math.min(i, o.childNodes.length), i < o.childNodes.length)) {
325
+ let d = o.childNodes[i], f;
326
+ d.nodeName == "IMG" && (f = d.getBoundingClientRect()).right <= e.left && f.bottom > e.top && i++;
327
+ }
328
+ let c;
329
+ Oe && i && o.nodeType == 1 && (c = o.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, o == t.dom && i == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = t.state.doc.content.size : (i == 0 || o.nodeType != 1 || o.childNodes[i - 1].nodeName != "BR") && (l = qn(t, o, i, e));
330
+ }
331
+ l == null && (l = Kn(t, r, e));
332
+ let a = t.docView.nearestDesc(r, !0);
333
+ return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
334
+ }
335
+ function at(t) {
336
+ return t.top < t.bottom || t.left < t.right;
337
+ }
338
+ function U(t, e) {
339
+ let n = t.getClientRects();
340
+ if (n.length) {
341
+ let o = n[e < 0 ? 0 : n.length - 1];
342
+ if (at(o))
343
+ return o;
344
+ }
345
+ return Array.prototype.find.call(n, at) || t.getBoundingClientRect();
346
+ }
347
+ const Wn = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
348
+ function Yt(t, e, n) {
349
+ let { node: o, offset: i, atom: s } = t.docView.domFromPos(e, n < 0 ? -1 : 1), r = Oe || B;
350
+ if (o.nodeType == 3)
351
+ if (r && (Wn.test(o.nodeValue) || (n < 0 ? !i : i == o.nodeValue.length))) {
352
+ let a = U(H(o, i, i), n);
353
+ if (B && i && /\s/.test(o.nodeValue[i - 1]) && i < o.nodeValue.length) {
354
+ let c = U(H(o, i - 1, i - 1), -1);
355
+ if (c.top == a.top) {
356
+ let d = U(H(o, i, i + 1), -1);
357
+ if (d.top != a.top)
358
+ return me(d, d.left < c.left);
359
+ }
360
+ }
361
+ return a;
362
+ } else {
363
+ let a = i, c = i, d = n < 0 ? 1 : -1;
364
+ return n < 0 && !i ? (c++, d = -1) : n >= 0 && i == o.nodeValue.length ? (a--, d = 1) : n < 0 ? a-- : c++, me(U(H(o, a, c), d), d < 0);
365
+ }
366
+ if (!t.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
367
+ if (s == null && i && (n < 0 || i == R(o))) {
368
+ let a = o.childNodes[i - 1];
369
+ if (a.nodeType == 1)
370
+ return Fe(a.getBoundingClientRect(), !1);
371
+ }
372
+ if (s == null && i < R(o)) {
373
+ let a = o.childNodes[i];
374
+ if (a.nodeType == 1)
375
+ return Fe(a.getBoundingClientRect(), !0);
376
+ }
377
+ return Fe(o.getBoundingClientRect(), n >= 0);
378
+ }
379
+ if (s == null && i && (n < 0 || i == R(o))) {
380
+ let a = o.childNodes[i - 1], c = a.nodeType == 3 ? H(a, R(a) - (r ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
381
+ if (c)
382
+ return me(U(c, 1), !1);
383
+ }
384
+ if (s == null && i < R(o)) {
385
+ let a = o.childNodes[i];
386
+ for (; a.pmViewDesc && a.pmViewDesc.ignoreForCoords; )
387
+ a = a.nextSibling;
388
+ let c = a ? a.nodeType == 3 ? H(a, 0, r ? 0 : 1) : a.nodeType == 1 ? a : null : null;
389
+ if (c)
390
+ return me(U(c, -1), !0);
391
+ }
392
+ return me(U(o.nodeType == 3 ? H(o) : o, -n), n >= 0);
393
+ }
394
+ function me(t, e) {
395
+ if (t.width == 0)
396
+ return t;
397
+ let n = e ? t.left : t.right;
398
+ return { top: t.top, bottom: t.bottom, left: n, right: n };
399
+ }
400
+ function Fe(t, e) {
401
+ if (t.height == 0)
402
+ return t;
403
+ let n = e ? t.top : t.bottom;
404
+ return { top: n, bottom: n, left: t.left, right: t.right };
405
+ }
406
+ function Gt(t, e, n) {
407
+ let o = t.state, i = t.root.activeElement;
408
+ o != e && t.updateState(e), i != t.dom && t.focus();
409
+ try {
410
+ return n();
411
+ } finally {
412
+ o != e && t.updateState(o), i != t.dom && i && i.focus();
413
+ }
414
+ }
415
+ function _n(t, e, n) {
416
+ let o = e.selection, i = n == "up" ? o.$from : o.$to;
417
+ return Gt(t, e, () => {
418
+ let { node: s } = t.docView.domFromPos(i.pos, n == "up" ? -1 : 1);
419
+ for (; ; ) {
420
+ let l = t.docView.nearestDesc(s, !0);
421
+ if (!l)
422
+ break;
423
+ if (l.node.isBlock) {
424
+ s = l.contentDOM || l.dom;
425
+ break;
426
+ }
427
+ s = l.dom.parentNode;
428
+ }
429
+ let r = Yt(t, i.pos, 1);
430
+ for (let l = s.firstChild; l; l = l.nextSibling) {
431
+ let a;
432
+ if (l.nodeType == 1)
433
+ a = l.getClientRects();
434
+ else if (l.nodeType == 3)
435
+ a = H(l, 0, l.nodeValue.length).getClientRects();
436
+ else
437
+ continue;
438
+ for (let c = 0; c < a.length; c++) {
439
+ let d = a[c];
440
+ if (d.bottom > d.top + 1 && (n == "up" ? r.top - d.top > (d.bottom - r.top) * 2 : d.bottom - r.bottom > (r.bottom - d.top) * 2))
441
+ return !1;
442
+ }
443
+ }
444
+ return !0;
445
+ });
446
+ }
447
+ const jn = /[\u0590-\u08ac]/;
448
+ function Un(t, e, n) {
449
+ let { $head: o } = e.selection;
450
+ if (!o.parent.isTextblock)
451
+ return !1;
452
+ let i = o.parentOffset, s = !i, r = i == o.parent.content.size, l = t.domSelection();
453
+ return l ? !jn.test(o.parent.textContent) || !l.modify ? n == "left" || n == "backward" ? s : r : Gt(t, e, () => {
454
+ let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: f } = t.domSelectionRange(), u = l.caretBidiLevel;
455
+ l.modify("move", n, "character");
456
+ let p = o.depth ? t.docView.domAfterPos(o.before()) : t.dom, { focusNode: h, focusOffset: g } = t.domSelectionRange(), m = h && !p.contains(h.nodeType == 1 ? h : h.parentNode) || a == h && c == g;
457
+ try {
458
+ l.collapse(d, f), a && (a != d || c != f) && l.extend && l.extend(a, c);
459
+ } catch {
460
+ }
461
+ return u != null && (l.caretBidiLevel = u), m;
462
+ }) : o.pos == o.start() || o.pos == o.end();
463
+ }
464
+ let ct = null, dt = null, ft = !1;
465
+ function Yn(t, e, n) {
466
+ return ct == e && dt == n ? ft : (ct = e, dt = n, ft = n == "up" || n == "down" ? _n(t, e, n) : Un(t, e, n));
467
+ }
468
+ const I = 0, ht = 1, te = 2, K = 3;
469
+ class xe {
470
+ constructor(e, n, o, i) {
471
+ this.parent = e, this.children = n, this.dom = o, this.contentDOM = i, this.dirty = I, o.pmViewDesc = this;
472
+ }
473
+ // Used to check whether a given description corresponds to a
474
+ // widget/mark/node.
475
+ matchesWidget(e) {
476
+ return !1;
477
+ }
478
+ matchesMark(e) {
479
+ return !1;
480
+ }
481
+ matchesNode(e, n, o) {
482
+ return !1;
483
+ }
484
+ matchesHack(e) {
485
+ return !1;
486
+ }
487
+ // When parsing in-editor content (in domchange.js), we allow
488
+ // descriptions to determine the parse rules that should be used to
489
+ // parse them.
490
+ parseRule() {
491
+ return null;
492
+ }
493
+ // Used by the editor's event handler to ignore events that come
494
+ // from certain descs.
495
+ stopEvent(e) {
496
+ return !1;
497
+ }
498
+ // The size of the content represented by this desc.
499
+ get size() {
500
+ let e = 0;
501
+ for (let n = 0; n < this.children.length; n++)
502
+ e += this.children[n].size;
503
+ return e;
504
+ }
505
+ // For block nodes, this represents the space taken up by their
506
+ // start/end tokens.
507
+ get border() {
508
+ return 0;
509
+ }
510
+ destroy() {
511
+ this.parent = void 0, this.dom.pmViewDesc == this && (this.dom.pmViewDesc = void 0);
512
+ for (let e = 0; e < this.children.length; e++)
513
+ this.children[e].destroy();
514
+ }
515
+ posBeforeChild(e) {
516
+ for (let n = 0, o = this.posAtStart; ; n++) {
517
+ let i = this.children[n];
518
+ if (i == e)
519
+ return o;
520
+ o += i.size;
521
+ }
522
+ }
523
+ get posBefore() {
524
+ return this.parent.posBeforeChild(this);
525
+ }
526
+ get posAtStart() {
527
+ return this.parent ? this.parent.posBeforeChild(this) + this.border : 0;
528
+ }
529
+ get posAfter() {
530
+ return this.posBefore + this.size;
531
+ }
532
+ get posAtEnd() {
533
+ return this.posAtStart + this.size - 2 * this.border;
534
+ }
535
+ localPosFromDOM(e, n, o) {
536
+ if (this.contentDOM && this.contentDOM.contains(e.nodeType == 1 ? e : e.parentNode))
537
+ if (o < 0) {
538
+ let s, r;
539
+ if (e == this.contentDOM)
540
+ s = e.childNodes[n - 1];
541
+ else {
542
+ for (; e.parentNode != this.contentDOM; )
543
+ e = e.parentNode;
544
+ s = e.previousSibling;
545
+ }
546
+ for (; s && !((r = s.pmViewDesc) && r.parent == this); )
547
+ s = s.previousSibling;
548
+ return s ? this.posBeforeChild(r) + r.size : this.posAtStart;
549
+ } else {
550
+ let s, r;
551
+ if (e == this.contentDOM)
552
+ s = e.childNodes[n];
553
+ else {
554
+ for (; e.parentNode != this.contentDOM; )
555
+ e = e.parentNode;
556
+ s = e.nextSibling;
557
+ }
558
+ for (; s && !((r = s.pmViewDesc) && r.parent == this); )
559
+ s = s.nextSibling;
560
+ return s ? this.posBeforeChild(r) : this.posAtEnd;
561
+ }
562
+ let i;
563
+ if (e == this.dom && this.contentDOM)
564
+ i = n > S(this.contentDOM);
565
+ else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))
566
+ i = e.compareDocumentPosition(this.contentDOM) & 2;
567
+ else if (this.dom.firstChild) {
568
+ if (n == 0)
569
+ for (let s = e; ; s = s.parentNode) {
570
+ if (s == this.dom) {
571
+ i = !1;
572
+ break;
573
+ }
574
+ if (s.previousSibling)
575
+ break;
576
+ }
577
+ if (i == null && n == e.childNodes.length)
578
+ for (let s = e; ; s = s.parentNode) {
579
+ if (s == this.dom) {
580
+ i = !0;
581
+ break;
582
+ }
583
+ if (s.nextSibling)
584
+ break;
585
+ }
586
+ }
587
+ return i ?? o > 0 ? this.posAtEnd : this.posAtStart;
588
+ }
589
+ nearestDesc(e, n = !1) {
590
+ for (let o = !0, i = e; i; i = i.parentNode) {
591
+ let s = this.getDesc(i), r;
592
+ if (s && (!n || s.node))
593
+ if (o && (r = s.nodeDOM) && !(r.nodeType == 1 ? r.contains(e.nodeType == 1 ? e : e.parentNode) : r == e))
594
+ o = !1;
595
+ else
596
+ return s;
597
+ }
598
+ }
599
+ getDesc(e) {
600
+ let n = e.pmViewDesc;
601
+ for (let o = n; o; o = o.parent)
602
+ if (o == this)
603
+ return n;
604
+ }
605
+ posFromDOM(e, n, o) {
606
+ for (let i = e; i; i = i.parentNode) {
607
+ let s = this.getDesc(i);
608
+ if (s)
609
+ return s.localPosFromDOM(e, n, o);
610
+ }
611
+ return -1;
612
+ }
613
+ // Find the desc for the node after the given pos, if any. (When a
614
+ // parent node overrode rendering, there might not be one.)
615
+ descAt(e) {
616
+ for (let n = 0, o = 0; n < this.children.length; n++) {
617
+ let i = this.children[n], s = o + i.size;
618
+ if (o == e && s != o) {
619
+ for (; !i.border && i.children.length; )
620
+ for (let r = 0; r < i.children.length; r++) {
621
+ let l = i.children[r];
622
+ if (l.size) {
623
+ i = l;
624
+ break;
625
+ }
626
+ }
627
+ return i;
628
+ }
629
+ if (e < s)
630
+ return i.descAt(e - o - i.border);
631
+ o = s;
632
+ }
633
+ }
634
+ domFromPos(e, n) {
635
+ if (!this.contentDOM)
636
+ return { node: this.dom, offset: 0, atom: e + 1 };
637
+ let o = 0, i = 0;
638
+ for (let s = 0; o < this.children.length; o++) {
639
+ let r = this.children[o], l = s + r.size;
640
+ if (l > e || r instanceof Jt) {
641
+ i = e - s;
642
+ break;
643
+ }
644
+ s = l;
645
+ }
646
+ if (i)
647
+ return this.children[o].domFromPos(i - this.children[o].border, n);
648
+ for (let s; o && !(s = this.children[o - 1]).size && s instanceof Xt && s.side >= 0; o--)
649
+ ;
650
+ if (n <= 0) {
651
+ let s, r = !0;
652
+ for (; s = o ? this.children[o - 1] : null, !(!s || s.dom.parentNode == this.contentDOM); o--, r = !1)
653
+ ;
654
+ return s && n && r && !s.border && !s.domAtom ? s.domFromPos(s.size, n) : { node: this.contentDOM, offset: s ? S(s.dom) + 1 : 0 };
655
+ } else {
656
+ let s, r = !0;
657
+ for (; s = o < this.children.length ? this.children[o] : null, !(!s || s.dom.parentNode == this.contentDOM); o++, r = !1)
658
+ ;
659
+ return s && r && !s.border && !s.domAtom ? s.domFromPos(0, n) : { node: this.contentDOM, offset: s ? S(s.dom) : this.contentDOM.childNodes.length };
660
+ }
661
+ }
662
+ // Used to find a DOM range in a single parent for a given changed
663
+ // range.
664
+ parseRange(e, n, o = 0) {
665
+ if (this.children.length == 0)
666
+ return { node: this.contentDOM, from: e, to: n, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };
667
+ let i = -1, s = -1;
668
+ for (let r = o, l = 0; ; l++) {
669
+ let a = this.children[l], c = r + a.size;
670
+ if (i == -1 && e <= c) {
671
+ let d = r + a.border;
672
+ if (e >= d && n <= c - a.border && a.node && a.contentDOM && this.contentDOM.contains(a.contentDOM))
673
+ return a.parseRange(e, n, d);
674
+ e = r;
675
+ for (let f = l; f > 0; f--) {
676
+ let u = this.children[f - 1];
677
+ if (u.size && u.dom.parentNode == this.contentDOM && !u.emptyChildAt(1)) {
678
+ i = S(u.dom) + 1;
679
+ break;
680
+ }
681
+ e -= u.size;
682
+ }
683
+ i == -1 && (i = 0);
684
+ }
685
+ if (i > -1 && (c > n || l == this.children.length - 1)) {
686
+ n = c;
687
+ for (let d = l + 1; d < this.children.length; d++) {
688
+ let f = this.children[d];
689
+ if (f.size && f.dom.parentNode == this.contentDOM && !f.emptyChildAt(-1)) {
690
+ s = S(f.dom);
691
+ break;
692
+ }
693
+ n += f.size;
694
+ }
695
+ s == -1 && (s = this.contentDOM.childNodes.length);
696
+ break;
697
+ }
698
+ r = c;
699
+ }
700
+ return { node: this.contentDOM, from: e, to: n, fromOffset: i, toOffset: s };
701
+ }
702
+ emptyChildAt(e) {
703
+ if (this.border || !this.contentDOM || !this.children.length)
704
+ return !1;
705
+ let n = this.children[e < 0 ? 0 : this.children.length - 1];
706
+ return n.size == 0 || n.emptyChildAt(e);
707
+ }
708
+ domAfterPos(e) {
709
+ let { node: n, offset: o } = this.domFromPos(e, 0);
710
+ if (n.nodeType != 1 || o == n.childNodes.length)
711
+ throw new RangeError("No node after pos " + e);
712
+ return n.childNodes[o];
713
+ }
714
+ // View descs are responsible for setting any selection that falls
715
+ // entirely inside of them, so that custom implementations can do
716
+ // custom things with the selection. Note that this falls apart when
717
+ // a selection starts in such a node and ends in another, in which
718
+ // case we just use whatever domFromPos produces as a best effort.
719
+ setSelection(e, n, o, i = !1) {
720
+ let s = Math.min(e, n), r = Math.max(e, n);
721
+ for (let p = 0, h = 0; p < this.children.length; p++) {
722
+ let g = this.children[p], m = h + g.size;
723
+ if (s > h && r < m)
724
+ return g.setSelection(e - h - g.border, n - h - g.border, o, i);
725
+ h = m;
726
+ }
727
+ let l = this.domFromPos(e, e ? -1 : 1), a = n == e ? l : this.domFromPos(n, n ? -1 : 1), c = o.root.getSelection(), d = o.domSelectionRange(), f = !1;
728
+ if ((B || M) && e == n) {
729
+ let { node: p, offset: h } = l;
730
+ if (p.nodeType == 3) {
731
+ if (f = !!(h && p.nodeValue[h - 1] == `
732
+ `), f && h == p.nodeValue.length)
733
+ for (let g = p, m; g; g = g.parentNode) {
734
+ if (m = g.nextSibling) {
735
+ m.nodeName == "BR" && (l = a = { node: m.parentNode, offset: S(m) + 1 });
736
+ break;
737
+ }
738
+ let y = g.pmViewDesc;
739
+ if (y && y.node && y.node.isBlock)
740
+ break;
741
+ }
742
+ } else {
743
+ let g = p.childNodes[h - 1];
744
+ f = g && (g.nodeName == "BR" || g.contentEditable == "false");
745
+ }
746
+ }
747
+ if (B && d.focusNode && d.focusNode != a.node && d.focusNode.nodeType == 1) {
748
+ let p = d.focusNode.childNodes[d.focusOffset];
749
+ p && p.contentEditable == "false" && (i = !0);
750
+ }
751
+ if (!(i || f && M) && re(l.node, l.offset, d.anchorNode, d.anchorOffset) && re(a.node, a.offset, d.focusNode, d.focusOffset))
752
+ return;
753
+ let u = !1;
754
+ if ((c.extend || e == n) && !(f && B)) {
755
+ c.collapse(l.node, l.offset);
756
+ try {
757
+ e != n && c.extend(a.node, a.offset), u = !0;
758
+ } catch {
759
+ }
760
+ }
761
+ if (!u) {
762
+ if (e > n) {
763
+ let h = l;
764
+ l = a, a = h;
765
+ }
766
+ let p = document.createRange();
767
+ p.setEnd(a.node, a.offset), p.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(p);
768
+ }
769
+ }
770
+ ignoreMutation(e) {
771
+ return !this.contentDOM && e.type != "selection";
772
+ }
773
+ get contentLost() {
774
+ return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);
775
+ }
776
+ // Remove a subtree of the element tree that has been touched
777
+ // by a DOM change, so that the next update will redraw it.
778
+ markDirty(e, n) {
779
+ for (let o = 0, i = 0; i < this.children.length; i++) {
780
+ let s = this.children[i], r = o + s.size;
781
+ if (o == r ? e <= r && n >= o : e < r && n > o) {
782
+ let l = o + s.border, a = r - s.border;
783
+ if (e >= l && n <= a) {
784
+ this.dirty = e == o || n == r ? te : ht, e == l && n == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = K : s.markDirty(e - l, n - l);
785
+ return;
786
+ } else
787
+ s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? te : K;
788
+ }
789
+ o = r;
790
+ }
791
+ this.dirty = te;
792
+ }
793
+ markParentsDirty() {
794
+ let e = 1;
795
+ for (let n = this.parent; n; n = n.parent, e++) {
796
+ let o = e == 1 ? te : ht;
797
+ n.dirty < o && (n.dirty = o);
798
+ }
799
+ }
800
+ get domAtom() {
801
+ return !1;
802
+ }
803
+ get ignoreForCoords() {
804
+ return !1;
805
+ }
806
+ get ignoreForSelection() {
807
+ return !1;
808
+ }
809
+ isText(e) {
810
+ return !1;
811
+ }
812
+ }
813
+ class Xt extends xe {
814
+ constructor(e, n, o, i) {
815
+ let s, r = n.type.toDOM;
816
+ if (typeof r == "function" && (r = r(o, () => {
817
+ if (!s)
818
+ return i;
819
+ if (s.parent)
820
+ return s.parent.posBeforeChild(s);
821
+ })), !n.type.spec.raw) {
822
+ if (r.nodeType != 1) {
823
+ let l = document.createElement("span");
824
+ l.appendChild(r), r = l;
825
+ }
826
+ r.contentEditable = "false", r.classList.add("ProseMirror-widget");
827
+ }
828
+ super(e, [], r, null), this.widget = n, this.widget = n, s = this;
829
+ }
830
+ matchesWidget(e) {
831
+ return this.dirty == I && e.type.eq(this.widget.type);
832
+ }
833
+ parseRule() {
834
+ return { ignore: !0 };
835
+ }
836
+ stopEvent(e) {
837
+ let n = this.widget.spec.stopEvent;
838
+ return n ? n(e) : !1;
839
+ }
840
+ ignoreMutation(e) {
841
+ return e.type != "selection" || this.widget.spec.ignoreSelection;
842
+ }
843
+ destroy() {
844
+ this.widget.type.destroy(this.dom), super.destroy();
845
+ }
846
+ get domAtom() {
847
+ return !0;
848
+ }
849
+ get ignoreForSelection() {
850
+ return !!this.widget.type.spec.relaxedSide;
851
+ }
852
+ get side() {
853
+ return this.widget.type.side;
854
+ }
855
+ }
856
+ class Gn extends xe {
857
+ constructor(e, n, o, i) {
858
+ super(e, [], n, null), this.textDOM = o, this.text = i;
859
+ }
860
+ get size() {
861
+ return this.text.length;
862
+ }
863
+ localPosFromDOM(e, n) {
864
+ return e != this.textDOM ? this.posAtStart + (n ? this.size : 0) : this.posAtStart + n;
865
+ }
866
+ domFromPos(e) {
867
+ return { node: this.textDOM, offset: e };
868
+ }
869
+ ignoreMutation(e) {
870
+ return e.type === "characterData" && e.target.nodeValue == e.oldValue;
871
+ }
872
+ }
873
+ class le extends xe {
874
+ constructor(e, n, o, i, s) {
875
+ super(e, [], o, i), this.mark = n, this.spec = s;
876
+ }
877
+ static create(e, n, o, i) {
878
+ let s = i.nodeViews[n.type.name], r = s && s(n, i, o);
879
+ return (!r || !r.dom) && (r = Ve.renderSpec(document, n.type.spec.toDOM(n, o), null, n.attrs)), new le(e, n, r.dom, r.contentDOM || r.dom, r);
880
+ }
881
+ parseRule() {
882
+ return this.dirty & K || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
883
+ }
884
+ matchesMark(e) {
885
+ return this.dirty != K && this.mark.eq(e);
886
+ }
887
+ markDirty(e, n) {
888
+ if (super.markDirty(e, n), this.dirty != I) {
889
+ let o = this.parent;
890
+ for (; !o.node; )
891
+ o = o.parent;
892
+ o.dirty < this.dirty && (o.dirty = this.dirty), this.dirty = I;
893
+ }
894
+ }
895
+ slice(e, n, o) {
896
+ let i = le.create(this.parent, this.mark, !0, o), s = this.children, r = this.size;
897
+ n < r && (s = Ue(s, n, r, o)), e > 0 && (s = Ue(s, 0, e, o));
898
+ for (let l = 0; l < s.length; l++)
899
+ s[l].parent = i;
900
+ return i.children = s, i;
901
+ }
902
+ ignoreMutation(e) {
903
+ return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
904
+ }
905
+ destroy() {
906
+ this.spec.destroy && this.spec.destroy(), super.destroy();
907
+ }
908
+ }
909
+ class Z extends xe {
910
+ constructor(e, n, o, i, s, r, l, a, c) {
911
+ super(e, [], s, r), this.node = n, this.outerDeco = o, this.innerDeco = i, this.nodeDOM = l;
912
+ }
913
+ // By default, a node is rendered using the `toDOM` method from the
914
+ // node type spec. But client code can use the `nodeViews` spec to
915
+ // supply a custom node view, which can influence various aspects of
916
+ // the way the node works.
917
+ //
918
+ // (Using subclassing for this was intentionally decided against,
919
+ // since it'd require exposing a whole slew of finicky
920
+ // implementation details to the user code that they probably will
921
+ // never need.)
922
+ static create(e, n, o, i, s, r) {
923
+ let l = s.nodeViews[n.type.name], a, c = l && l(n, s, () => {
924
+ if (!a)
925
+ return r;
926
+ if (a.parent)
927
+ return a.parent.posBeforeChild(a);
928
+ }, o, i), d = c && c.dom, f = c && c.contentDOM;
929
+ if (n.isText) {
930
+ if (!d)
931
+ d = document.createTextNode(n.text);
932
+ else if (d.nodeType != 3)
933
+ throw new RangeError("Text must be rendered as a DOM text node");
934
+ } else d || ({ dom: d, contentDOM: f } = Ve.renderSpec(document, n.type.spec.toDOM(n), null, n.attrs));
935
+ !f && !n.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), n.type.spec.draggable && (d.draggable = !0));
936
+ let u = d;
937
+ return d = wt(d, o, n), c ? a = new Xn(e, n, o, i, d, f || null, u, c, s, r + 1) : n.isText ? new Be(e, n, o, i, d, u, s) : new Z(e, n, o, i, d, f || null, u, s, r + 1);
938
+ }
939
+ parseRule() {
940
+ if (this.node.type.spec.reparseInView)
941
+ return null;
942
+ let e = { node: this.node.type.name, attrs: this.node.attrs };
943
+ if (this.node.type.whitespace == "pre" && (e.preserveWhitespace = "full"), !this.contentDOM)
944
+ e.getContent = () => this.node.content;
945
+ else if (!this.contentLost)
946
+ e.contentElement = this.contentDOM;
947
+ else {
948
+ for (let n = this.children.length - 1; n >= 0; n--) {
949
+ let o = this.children[n];
950
+ if (this.dom.contains(o.dom.parentNode)) {
951
+ e.contentElement = o.dom.parentNode;
952
+ break;
953
+ }
954
+ }
955
+ e.contentElement || (e.getContent = () => j.empty);
956
+ }
957
+ return e;
958
+ }
959
+ matchesNode(e, n, o) {
960
+ return this.dirty == I && e.eq(this.node) && ke(n, this.outerDeco) && o.eq(this.innerDeco);
961
+ }
962
+ get size() {
963
+ return this.node.nodeSize;
964
+ }
965
+ get border() {
966
+ return this.node.isLeaf ? 0 : 1;
967
+ }
968
+ // Syncs `this.children` to match `this.node.content` and the local
969
+ // decorations, possibly introducing nesting for marks. Then, in a
970
+ // separate step, syncs the DOM inside `this.contentDOM` to
971
+ // `this.children`.
972
+ updateChildren(e, n) {
973
+ let o = this.node.inlineContent, i = n, s = e.composing ? this.localCompositionInfo(e, n) : null, r = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new Zn(this, r && r.node, e);
974
+ vn(this.node, this.innerDeco, (c, d, f) => {
975
+ c.spec.marks ? a.syncToMarks(c.spec.marks, o, e, d) : c.type.side >= 0 && !f && a.syncToMarks(d == this.node.childCount ? Sn.none : this.node.child(d).marks, o, e, d), a.placeWidget(c, e, i);
976
+ }, (c, d, f, u) => {
977
+ a.syncToMarks(c.marks, o, e, u);
978
+ let p;
979
+ a.findNodeMatch(c, d, f, u) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (p = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, f, p, e) || a.updateNextNode(c, d, f, e, u, i) || a.addNode(c, d, f, e, i), i += c.nodeSize;
980
+ }), a.syncToMarks([], o, e, 0), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == te) && (r && this.protectLocalComposition(e, r), Zt(this.contentDOM, this.children, e), ue && eo(this.dom));
981
+ }
982
+ localCompositionInfo(e, n) {
983
+ let { from: o, to: i } = e.state.selection;
984
+ if (!(e.state.selection instanceof k) || o < n || i > n + this.node.content.size)
985
+ return null;
986
+ let s = e.input.compositionNode;
987
+ if (!s || !this.dom.contains(s.parentNode))
988
+ return null;
989
+ if (this.node.inlineContent) {
990
+ let r = s.nodeValue, l = to(this.node.content, r, o - n, i - n);
991
+ return l < 0 ? null : { node: s, pos: l, text: r };
992
+ } else
993
+ return { node: s, pos: -1, text: "" };
994
+ }
995
+ protectLocalComposition(e, { node: n, pos: o, text: i }) {
996
+ if (this.getDesc(n))
997
+ return;
998
+ let s = n;
999
+ for (; s.parentNode != this.contentDOM; s = s.parentNode) {
1000
+ for (; s.previousSibling; )
1001
+ s.parentNode.removeChild(s.previousSibling);
1002
+ for (; s.nextSibling; )
1003
+ s.parentNode.removeChild(s.nextSibling);
1004
+ s.pmViewDesc && (s.pmViewDesc = void 0);
1005
+ }
1006
+ let r = new Gn(this, s, n, i);
1007
+ e.input.compositionNodes.push(r), this.children = Ue(this.children, o, o + i.length, e, r);
1008
+ }
1009
+ // If this desc must be updated to match the given node decoration,
1010
+ // do so and return true.
1011
+ update(e, n, o, i) {
1012
+ return this.dirty == K || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, n, o, i), !0);
1013
+ }
1014
+ updateInner(e, n, o, i) {
1015
+ this.updateOuterDeco(n), this.node = e, this.innerDeco = o, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = I;
1016
+ }
1017
+ updateOuterDeco(e) {
1018
+ if (ke(e, this.outerDeco))
1019
+ return;
1020
+ let n = this.nodeDOM.nodeType != 1, o = this.dom;
1021
+ this.dom = Qt(this.dom, this.nodeDOM, je(this.outerDeco, this.node, n), je(e, this.node, n)), this.dom != o && (o.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
1022
+ }
1023
+ // Mark this node as being the selected node.
1024
+ selectNode() {
1025
+ this.nodeDOM.nodeType == 1 && (this.nodeDOM.classList.add("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && (this.nodeDOM.draggable = !0));
1026
+ }
1027
+ // Remove selected node marking from this node.
1028
+ deselectNode() {
1029
+ this.nodeDOM.nodeType == 1 && (this.nodeDOM.classList.remove("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && this.nodeDOM.removeAttribute("draggable"));
1030
+ }
1031
+ get domAtom() {
1032
+ return this.node.isAtom;
1033
+ }
1034
+ }
1035
+ function ut(t, e, n, o, i) {
1036
+ wt(o, e, t);
1037
+ let s = new Z(void 0, t, e, n, o, o, o, i, 0);
1038
+ return s.contentDOM && s.updateChildren(i, 0), s;
1039
+ }
1040
+ class Be extends Z {
1041
+ constructor(e, n, o, i, s, r, l) {
1042
+ super(e, n, o, i, s, null, r, l, 0);
1043
+ }
1044
+ parseRule() {
1045
+ let e = this.nodeDOM.parentNode;
1046
+ for (; e && e != this.dom && !e.pmIsDeco; )
1047
+ e = e.parentNode;
1048
+ return { skip: e || !0 };
1049
+ }
1050
+ update(e, n, o, i) {
1051
+ return this.dirty == K || this.dirty != I && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(n), (this.dirty != I || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, i.trackWrites == this.nodeDOM && (i.trackWrites = null)), this.node = e, this.dirty = I, !0);
1052
+ }
1053
+ inParent() {
1054
+ let e = this.parent.contentDOM;
1055
+ for (let n = this.nodeDOM; n; n = n.parentNode)
1056
+ if (n == e)
1057
+ return !0;
1058
+ return !1;
1059
+ }
1060
+ domFromPos(e) {
1061
+ return { node: this.nodeDOM, offset: e };
1062
+ }
1063
+ localPosFromDOM(e, n, o) {
1064
+ return e == this.nodeDOM ? this.posAtStart + Math.min(n, this.node.text.length) : super.localPosFromDOM(e, n, o);
1065
+ }
1066
+ ignoreMutation(e) {
1067
+ return e.type != "characterData" && e.type != "selection";
1068
+ }
1069
+ slice(e, n, o) {
1070
+ let i = this.node.cut(e, n), s = document.createTextNode(i.text);
1071
+ return new Be(this.parent, i, this.outerDeco, this.innerDeco, s, s, o);
1072
+ }
1073
+ markDirty(e, n) {
1074
+ super.markDirty(e, n), this.dom != this.nodeDOM && (e == 0 || n == this.nodeDOM.nodeValue.length) && (this.dirty = K);
1075
+ }
1076
+ get domAtom() {
1077
+ return !1;
1078
+ }
1079
+ isText(e) {
1080
+ return this.node.text == e;
1081
+ }
1082
+ }
1083
+ class Jt extends xe {
1084
+ parseRule() {
1085
+ return { ignore: !0 };
1086
+ }
1087
+ matchesHack(e) {
1088
+ return this.dirty == I && this.dom.nodeName == e;
1089
+ }
1090
+ get domAtom() {
1091
+ return !0;
1092
+ }
1093
+ get ignoreForCoords() {
1094
+ return this.dom.nodeName == "IMG";
1095
+ }
1096
+ }
1097
+ class Xn extends Z {
1098
+ constructor(e, n, o, i, s, r, l, a, c, d) {
1099
+ super(e, n, o, i, s, r, l, c, d), this.spec = a;
1100
+ }
1101
+ // A custom `update` method gets to decide whether the update goes
1102
+ // through. If it does, and there's a `contentDOM` node, our logic
1103
+ // updates the children.
1104
+ update(e, n, o, i) {
1105
+ if (this.dirty == K)
1106
+ return !1;
1107
+ if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
1108
+ let s = this.spec.update(e, n, o);
1109
+ return s && this.updateInner(e, n, o, i), s;
1110
+ } else return !this.contentDOM && !e.isLeaf ? !1 : super.update(e, n, o, i);
1111
+ }
1112
+ selectNode() {
1113
+ this.spec.selectNode ? this.spec.selectNode() : super.selectNode();
1114
+ }
1115
+ deselectNode() {
1116
+ this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();
1117
+ }
1118
+ setSelection(e, n, o, i) {
1119
+ this.spec.setSelection ? this.spec.setSelection(e, n, o.root) : super.setSelection(e, n, o, i);
1120
+ }
1121
+ destroy() {
1122
+ this.spec.destroy && this.spec.destroy(), super.destroy();
1123
+ }
1124
+ stopEvent(e) {
1125
+ return this.spec.stopEvent ? this.spec.stopEvent(e) : !1;
1126
+ }
1127
+ ignoreMutation(e) {
1128
+ return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
1129
+ }
1130
+ }
1131
+ function Zt(t, e, n) {
1132
+ let o = t.firstChild, i = !1;
1133
+ for (let s = 0; s < e.length; s++) {
1134
+ let r = e[s], l = r.dom;
1135
+ if (l.parentNode == t) {
1136
+ for (; l != o; )
1137
+ o = pt(o), i = !0;
1138
+ o = o.nextSibling;
1139
+ } else
1140
+ i = !0, t.insertBefore(l, o);
1141
+ if (r instanceof le) {
1142
+ let a = o ? o.previousSibling : t.lastChild;
1143
+ Zt(r.contentDOM, r.children, n), o = a ? a.nextSibling : t.firstChild;
1144
+ }
1145
+ }
1146
+ for (; o; )
1147
+ o = pt(o), i = !0;
1148
+ i && n.trackWrites == t && (n.trackWrites = null);
1149
+ }
1150
+ const ge = function(t) {
1151
+ t && (this.nodeName = t);
1152
+ };
1153
+ ge.prototype = /* @__PURE__ */ Object.create(null);
1154
+ const ne = [new ge()];
1155
+ function je(t, e, n) {
1156
+ if (t.length == 0)
1157
+ return ne;
1158
+ let o = n ? ne[0] : new ge(), i = [o];
1159
+ for (let s = 0; s < t.length; s++) {
1160
+ let r = t[s].type.attrs;
1161
+ if (r) {
1162
+ r.nodeName && i.push(o = new ge(r.nodeName));
1163
+ for (let l in r) {
1164
+ let a = r[l];
1165
+ a != null && (n && i.length == 1 && i.push(o = new ge(e.isInline ? "span" : "div")), l == "class" ? o.class = (o.class ? o.class + " " : "") + a : l == "style" ? o.style = (o.style ? o.style + ";" : "") + a : l != "nodeName" && (o[l] = a));
1166
+ }
1167
+ }
1168
+ }
1169
+ return i;
1170
+ }
1171
+ function Qt(t, e, n, o) {
1172
+ if (n == ne && o == ne)
1173
+ return e;
1174
+ let i = e;
1175
+ for (let s = 0; s < o.length; s++) {
1176
+ let r = o[s], l = n[s];
1177
+ if (s) {
1178
+ let a;
1179
+ l && l.nodeName == r.nodeName && i != t && (a = i.parentNode) && a.nodeName.toLowerCase() == r.nodeName || (a = document.createElement(r.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = ne[0]), i = a;
1180
+ }
1181
+ Jn(i, l || ne[0], r);
1182
+ }
1183
+ return i;
1184
+ }
1185
+ function Jn(t, e, n) {
1186
+ for (let o in e)
1187
+ o != "class" && o != "style" && o != "nodeName" && !(o in n) && t.removeAttribute(o);
1188
+ for (let o in n)
1189
+ o != "class" && o != "style" && o != "nodeName" && n[o] != e[o] && t.setAttribute(o, n[o]);
1190
+ if (e.class != n.class) {
1191
+ let o = e.class ? e.class.split(" ").filter(Boolean) : [], i = n.class ? n.class.split(" ").filter(Boolean) : [];
1192
+ for (let s = 0; s < o.length; s++)
1193
+ i.indexOf(o[s]) == -1 && t.classList.remove(o[s]);
1194
+ for (let s = 0; s < i.length; s++)
1195
+ o.indexOf(i[s]) == -1 && t.classList.add(i[s]);
1196
+ t.classList.length == 0 && t.removeAttribute("class");
1197
+ }
1198
+ if (e.style != n.style) {
1199
+ if (e.style) {
1200
+ let o = /\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g, i;
1201
+ for (; i = o.exec(e.style); )
1202
+ t.style.removeProperty(i[1]);
1203
+ }
1204
+ n.style && (t.style.cssText += n.style);
1205
+ }
1206
+ }
1207
+ function wt(t, e, n) {
1208
+ return Qt(t, t, ne, je(e, n, t.nodeType != 1));
1209
+ }
1210
+ function ke(t, e) {
1211
+ if (t.length != e.length)
1212
+ return !1;
1213
+ for (let n = 0; n < t.length; n++)
1214
+ if (!t[n].type.eq(e[n].type))
1215
+ return !1;
1216
+ return !0;
1217
+ }
1218
+ function pt(t) {
1219
+ let e = t.nextSibling;
1220
+ return t.parentNode.removeChild(t), e;
1221
+ }
1222
+ class Zn {
1223
+ constructor(e, n, o) {
1224
+ this.lock = n, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Qn(e.node.content, e);
1225
+ }
1226
+ // Destroy and remove the children between the given indices in
1227
+ // `this.top`.
1228
+ destroyBetween(e, n) {
1229
+ if (e != n) {
1230
+ for (let o = e; o < n; o++)
1231
+ this.top.children[o].destroy();
1232
+ this.top.children.splice(e, n - e), this.changed = !0;
1233
+ }
1234
+ }
1235
+ // Destroy all remaining children in `this.top`.
1236
+ destroyRest() {
1237
+ this.destroyBetween(this.index, this.top.children.length);
1238
+ }
1239
+ // Sync the current stack of mark descs with the given array of
1240
+ // marks, reusing existing mark descs when possible.
1241
+ syncToMarks(e, n, o, i) {
1242
+ let s = 0, r = this.stack.length >> 1, l = Math.min(r, e.length);
1243
+ for (; s < l && (s == r - 1 ? this.top : this.stack[s + 1 << 1]).matchesMark(e[s]) && e[s].type.spec.spanning !== !1; )
1244
+ s++;
1245
+ for (; s < r; )
1246
+ this.destroyRest(), this.top.dirty = I, this.index = this.stack.pop(), this.top = this.stack.pop(), r--;
1247
+ for (; r < e.length; ) {
1248
+ this.stack.push(this.top, this.index + 1);
1249
+ let a = -1, c = this.top.children.length;
1250
+ i < this.preMatch.index && (c = Math.min(this.index + 3, c));
1251
+ for (let d = this.index; d < c; d++) {
1252
+ let f = this.top.children[d];
1253
+ if (f.matchesMark(e[r]) && !this.isLocked(f.dom)) {
1254
+ a = d;
1255
+ break;
1256
+ }
1257
+ }
1258
+ if (a > -1)
1259
+ a > this.index && (this.changed = !0, this.destroyBetween(this.index, a)), this.top = this.top.children[this.index];
1260
+ else {
1261
+ let d = le.create(this.top, e[r], n, o);
1262
+ this.top.children.splice(this.index, 0, d), this.top = d, this.changed = !0;
1263
+ }
1264
+ this.index = 0, r++;
1265
+ }
1266
+ }
1267
+ // Try to find a node desc matching the given data. Skip over it and
1268
+ // return true when successful.
1269
+ findNodeMatch(e, n, o, i) {
1270
+ let s = -1, r;
1271
+ if (i >= this.preMatch.index && (r = this.preMatch.matches[i - this.preMatch.index]).parent == this.top && r.matchesNode(e, n, o))
1272
+ s = this.top.children.indexOf(r, this.index);
1273
+ else
1274
+ for (let l = this.index, a = Math.min(this.top.children.length, l + 5); l < a; l++) {
1275
+ let c = this.top.children[l];
1276
+ if (c.matchesNode(e, n, o) && !this.preMatch.matched.has(c)) {
1277
+ s = l;
1278
+ break;
1279
+ }
1280
+ }
1281
+ return s < 0 ? !1 : (this.destroyBetween(this.index, s), this.index++, !0);
1282
+ }
1283
+ updateNodeAt(e, n, o, i, s) {
1284
+ let r = this.top.children[i];
1285
+ return r.dirty == K && r.dom == r.contentDOM && (r.dirty = te), r.update(e, n, o, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
1286
+ }
1287
+ findIndexWithChild(e) {
1288
+ for (; ; ) {
1289
+ let n = e.parentNode;
1290
+ if (!n)
1291
+ return -1;
1292
+ if (n == this.top.contentDOM) {
1293
+ let o = e.pmViewDesc;
1294
+ if (o) {
1295
+ for (let i = this.index; i < this.top.children.length; i++)
1296
+ if (this.top.children[i] == o)
1297
+ return i;
1298
+ }
1299
+ return -1;
1300
+ }
1301
+ e = n;
1302
+ }
1303
+ }
1304
+ // Try to update the next node, if any, to the given data. Checks
1305
+ // pre-matches to avoid overwriting nodes that could still be used.
1306
+ updateNextNode(e, n, o, i, s, r) {
1307
+ for (let l = this.index; l < this.top.children.length; l++) {
1308
+ let a = this.top.children[l];
1309
+ if (a instanceof Z) {
1310
+ let c = this.preMatch.matched.get(a);
1311
+ if (c != null && c != s)
1312
+ return !1;
1313
+ let d = a.dom, f, u = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != K && ke(n, a.outerDeco));
1314
+ if (!u && a.update(e, n, o, i))
1315
+ return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
1316
+ if (!u && (f = this.recreateWrapper(a, e, n, o, i, r)))
1317
+ return this.destroyBetween(this.index, l), this.top.children[this.index] = f, f.contentDOM && (f.dirty = te, f.updateChildren(i, r + 1), f.dirty = I), this.changed = !0, this.index++, !0;
1318
+ break;
1319
+ }
1320
+ }
1321
+ return !1;
1322
+ }
1323
+ // When a node with content is replaced by a different node with
1324
+ // identical content, move over its children.
1325
+ recreateWrapper(e, n, o, i, s, r) {
1326
+ if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content) || !ke(o, e.outerDeco) || !i.eq(e.innerDeco))
1327
+ return null;
1328
+ let l = Z.create(this.top, n, o, i, s, r);
1329
+ if (l.contentDOM) {
1330
+ l.children = e.children, e.children = [];
1331
+ for (let a of l.children)
1332
+ a.parent = l;
1333
+ }
1334
+ return e.destroy(), l;
1335
+ }
1336
+ // Insert the node as a newly created node desc.
1337
+ addNode(e, n, o, i, s) {
1338
+ let r = Z.create(this.top, e, n, o, i, s);
1339
+ r.contentDOM && r.updateChildren(i, s + 1), this.top.children.splice(this.index++, 0, r), this.changed = !0;
1340
+ }
1341
+ placeWidget(e, n, o) {
1342
+ let i = this.index < this.top.children.length ? this.top.children[this.index] : null;
1343
+ if (i && i.matchesWidget(e) && (e == i.widget || !i.widget.type.toDOM.parentNode))
1344
+ this.index++;
1345
+ else {
1346
+ let s = new Xt(this.top, e, n, o);
1347
+ this.top.children.splice(this.index++, 0, s), this.changed = !0;
1348
+ }
1349
+ }
1350
+ // Make sure a textblock looks and behaves correctly in
1351
+ // contentEditable.
1352
+ addTextblockHacks() {
1353
+ let e = this.top.children[this.index - 1], n = this.top;
1354
+ for (; e instanceof le; )
1355
+ n = e, e = n.children[n.children.length - 1];
1356
+ (!e || // Empty textblock
1357
+ !(e instanceof Be) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((M || O) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", n), this.addHackNode("BR", this.top));
1358
+ }
1359
+ addHackNode(e, n) {
1360
+ if (n == this.top && this.index < n.children.length && n.children[this.index].matchesHack(e))
1361
+ this.index++;
1362
+ else {
1363
+ let o = document.createElement(e);
1364
+ e == "IMG" && (o.className = "ProseMirror-separator", o.alt = ""), e == "BR" && (o.className = "ProseMirror-trailingBreak");
1365
+ let i = new Jt(this.top, [], o, null);
1366
+ n != this.top ? n.children.push(i) : n.children.splice(this.index++, 0, i), this.changed = !0;
1367
+ }
1368
+ }
1369
+ isLocked(e) {
1370
+ return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
1371
+ }
1372
+ }
1373
+ function Qn(t, e) {
1374
+ let n = e, o = n.children.length, i = t.childCount, s = /* @__PURE__ */ new Map(), r = [];
1375
+ e: for (; i > 0; ) {
1376
+ let l;
1377
+ for (; ; )
1378
+ if (o) {
1379
+ let c = n.children[o - 1];
1380
+ if (c instanceof le)
1381
+ n = c, o = c.children.length;
1382
+ else {
1383
+ l = c, o--;
1384
+ break;
1385
+ }
1386
+ } else {
1387
+ if (n == e)
1388
+ break e;
1389
+ o = n.parent.children.indexOf(n), n = n.parent;
1390
+ }
1391
+ let a = l.node;
1392
+ if (a) {
1393
+ if (a != t.child(i - 1))
1394
+ break;
1395
+ --i, s.set(l, i), r.push(l);
1396
+ }
1397
+ }
1398
+ return { index: i, matched: s, matches: r.reverse() };
1399
+ }
1400
+ function wn(t, e) {
1401
+ return t.type.side - e.type.side;
1402
+ }
1403
+ function vn(t, e, n, o) {
1404
+ let i = e.locals(t), s = 0;
1405
+ if (i.length == 0) {
1406
+ for (let c = 0; c < t.childCount; c++) {
1407
+ let d = t.child(c);
1408
+ o(d, i, e.forChild(s, d), c), s += d.nodeSize;
1409
+ }
1410
+ return;
1411
+ }
1412
+ let r = 0, l = [], a = null;
1413
+ for (let c = 0; ; ) {
1414
+ let d, f;
1415
+ for (; r < i.length && i[r].to == s; ) {
1416
+ let m = i[r++];
1417
+ m.widget && (d ? (f || (f = [d])).push(m) : d = m);
1418
+ }
1419
+ if (d)
1420
+ if (f) {
1421
+ f.sort(wn);
1422
+ for (let m = 0; m < f.length; m++)
1423
+ n(f[m], c, !!a);
1424
+ } else
1425
+ n(d, c, !!a);
1426
+ let u, p;
1427
+ if (a)
1428
+ p = -1, u = a, a = null;
1429
+ else if (c < t.childCount)
1430
+ p = c, u = t.child(c++);
1431
+ else
1432
+ break;
1433
+ for (let m = 0; m < l.length; m++)
1434
+ l[m].to <= s && l.splice(m--, 1);
1435
+ for (; r < i.length && i[r].from <= s && i[r].to > s; )
1436
+ l.push(i[r++]);
1437
+ let h = s + u.nodeSize;
1438
+ if (u.isText) {
1439
+ let m = h;
1440
+ r < i.length && i[r].from < m && (m = i[r].from);
1441
+ for (let y = 0; y < l.length; y++)
1442
+ l[y].to < m && (m = l[y].to);
1443
+ m < h && (a = u.cut(m - s), u = u.cut(0, m - s), h = m, p = -1);
1444
+ } else
1445
+ for (; r < i.length && i[r].to < h; )
1446
+ r++;
1447
+ let g = u.isInline && !u.isLeaf ? l.filter((m) => !m.inline) : l.slice();
1448
+ o(u, g, e.forChild(s, u), p), s = h;
1449
+ }
1450
+ }
1451
+ function eo(t) {
1452
+ if (t.nodeName == "UL" || t.nodeName == "OL") {
1453
+ let e = t.style.cssText;
1454
+ t.style.cssText = e + "; list-style: square !important", window.getComputedStyle(t).listStyle, t.style.cssText = e;
1455
+ }
1456
+ }
1457
+ function to(t, e, n, o) {
1458
+ for (let i = 0, s = 0; i < t.childCount && s <= o; ) {
1459
+ let r = t.child(i++), l = s;
1460
+ if (s += r.nodeSize, !r.isText)
1461
+ continue;
1462
+ let a = r.text;
1463
+ for (; i < t.childCount; ) {
1464
+ let c = t.child(i++);
1465
+ if (s += c.nodeSize, !c.isText)
1466
+ break;
1467
+ a += c.text;
1468
+ }
1469
+ if (s >= n) {
1470
+ if (s >= o && a.slice(o - e.length - l, o - l) == e)
1471
+ return o - e.length;
1472
+ let c = l < o ? a.lastIndexOf(e, o - l - 1) : -1;
1473
+ if (c >= 0 && c + e.length + l >= n)
1474
+ return l + c;
1475
+ if (n == o && a.length >= o + e.length - l && a.slice(o - l, o - l + e.length) == e)
1476
+ return o;
1477
+ }
1478
+ }
1479
+ return -1;
1480
+ }
1481
+ function Ue(t, e, n, o, i) {
1482
+ let s = [];
1483
+ for (let r = 0, l = 0; r < t.length; r++) {
1484
+ let a = t[r], c = l, d = l += a.size;
1485
+ c >= n || d <= e ? s.push(a) : (c < e && s.push(a.slice(0, e - c, o)), i && (s.push(i), i = void 0), d > n && s.push(a.slice(n - c, a.size, o)));
1486
+ }
1487
+ return s;
1488
+ }
1489
+ function Qe(t, e = null) {
1490
+ let n = t.domSelectionRange(), o = t.state.doc;
1491
+ if (!n.focusNode)
1492
+ return null;
1493
+ let i = t.docView.nearestDesc(n.focusNode), s = i && i.size == 0, r = t.docView.posFromDOM(n.focusNode, n.focusOffset, 1);
1494
+ if (r < 0)
1495
+ return null;
1496
+ let l = o.resolve(r), a, c;
1497
+ if (Re(n)) {
1498
+ for (a = r; i && !i.node; )
1499
+ i = i.parent;
1500
+ let f = i.node;
1501
+ if (i && f.isAtom && D.isSelectable(f) && i.parent && !(f.isInline && En(n.focusNode, n.focusOffset, i.dom))) {
1502
+ let u = i.posBefore;
1503
+ c = new D(r == u ? l : o.resolve(u));
1504
+ }
1505
+ } else {
1506
+ if (n instanceof t.dom.ownerDocument.defaultView.Selection && n.rangeCount > 1) {
1507
+ let f = r, u = r;
1508
+ for (let p = 0; p < n.rangeCount; p++) {
1509
+ let h = n.getRangeAt(p);
1510
+ f = Math.min(f, t.docView.posFromDOM(h.startContainer, h.startOffset, 1)), u = Math.max(u, t.docView.posFromDOM(h.endContainer, h.endOffset, -1));
1511
+ }
1512
+ if (f < 0)
1513
+ return null;
1514
+ [a, r] = u == t.state.selection.anchor ? [u, f] : [f, u], l = o.resolve(r);
1515
+ } else
1516
+ a = t.docView.posFromDOM(n.anchorNode, n.anchorOffset, 1);
1517
+ if (a < 0)
1518
+ return null;
1519
+ }
1520
+ let d = o.resolve(a);
1521
+ if (!c) {
1522
+ let f = e == "pointer" || t.state.selection.head < l.pos && !s ? 1 : -1;
1523
+ c = we(t, d, l, f);
1524
+ }
1525
+ return c;
1526
+ }
1527
+ function vt(t) {
1528
+ return t.editable ? t.hasFocus() : tn(t) && document.activeElement && document.activeElement.contains(t.dom);
1529
+ }
1530
+ function _(t, e = !1) {
1531
+ let n = t.state.selection;
1532
+ if (en(t, n), !!vt(t)) {
1533
+ if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault && O) {
1534
+ let o = t.domSelectionRange(), i = t.domObserver.currentSelection;
1535
+ if (o.anchorNode && i.anchorNode && re(o.anchorNode, o.anchorOffset, i.anchorNode, i.anchorOffset)) {
1536
+ t.input.mouseDown.delayedSelectionSync = !0, t.domObserver.setCurSelection();
1537
+ return;
1538
+ }
1539
+ }
1540
+ if (t.domObserver.disconnectSelection(), t.cursorWrapper)
1541
+ oo(t);
1542
+ else {
1543
+ let { anchor: o, head: i } = n, s, r;
1544
+ mt && !(n instanceof k) && (n.$from.parent.inlineContent || (s = gt(t, n.from)), !n.empty && !n.$from.parent.inlineContent && (r = gt(t, n.to))), t.docView.setSelection(o, i, t, e), mt && (s && yt(s), r && yt(r)), n.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && no(t));
1545
+ }
1546
+ t.domObserver.setCurSelection(), t.domObserver.connectSelection();
1547
+ }
1548
+ }
1549
+ const mt = M || O && qt < 63;
1550
+ function gt(t, e) {
1551
+ let { node: n, offset: o } = t.docView.domFromPos(e, 0), i = o < n.childNodes.length ? n.childNodes[o] : null, s = o ? n.childNodes[o - 1] : null;
1552
+ if (M && i && i.contentEditable == "false")
1553
+ return ze(i);
1554
+ if ((!i || i.contentEditable == "false") && (!s || s.contentEditable == "false")) {
1555
+ if (i)
1556
+ return ze(i);
1557
+ if (s)
1558
+ return ze(s);
1559
+ }
1560
+ }
1561
+ function ze(t) {
1562
+ return t.contentEditable = "true", M && t.draggable && (t.draggable = !1, t.wasDraggable = !0), t;
1563
+ }
1564
+ function yt(t) {
1565
+ t.contentEditable = "false", t.wasDraggable && (t.draggable = !0, t.wasDraggable = null);
1566
+ }
1567
+ function no(t) {
1568
+ let e = t.dom.ownerDocument;
1569
+ e.removeEventListener("selectionchange", t.input.hideSelectionGuard);
1570
+ let n = t.domSelectionRange(), o = n.anchorNode, i = n.anchorOffset;
1571
+ e.addEventListener("selectionchange", t.input.hideSelectionGuard = () => {
1572
+ (n.anchorNode != o || n.anchorOffset != i) && (e.removeEventListener("selectionchange", t.input.hideSelectionGuard), setTimeout(() => {
1573
+ (!vt(t) || t.state.selection.visible) && t.dom.classList.remove("ProseMirror-hideselection");
1574
+ }, 20));
1575
+ });
1576
+ }
1577
+ function oo(t) {
1578
+ let e = t.domSelection();
1579
+ if (!e)
1580
+ return;
1581
+ let n = t.cursorWrapper.dom, o = n.nodeName == "IMG";
1582
+ o ? e.collapse(n.parentNode, S(n) + 1) : e.collapse(n, 0), !o && !t.state.selection.visible && A && J <= 11 && (n.disabled = !0, n.disabled = !1);
1583
+ }
1584
+ function en(t, e) {
1585
+ if (e instanceof D) {
1586
+ let n = t.docView.descAt(e.from);
1587
+ n != t.lastSelectedViewDesc && (bt(t), n && n.selectNode(), t.lastSelectedViewDesc = n);
1588
+ } else
1589
+ bt(t);
1590
+ }
1591
+ function bt(t) {
1592
+ t.lastSelectedViewDesc && (t.lastSelectedViewDesc.parent && t.lastSelectedViewDesc.deselectNode(), t.lastSelectedViewDesc = void 0);
1593
+ }
1594
+ function we(t, e, n, o) {
1595
+ return t.someProp("createSelectionBetween", (i) => i(t, e, n)) || k.between(e, n, o);
1596
+ }
1597
+ function Dt(t) {
1598
+ return t.editable && !t.hasFocus() ? !1 : tn(t);
1599
+ }
1600
+ function tn(t) {
1601
+ let e = t.domSelectionRange();
1602
+ if (!e.anchorNode)
1603
+ return !1;
1604
+ try {
1605
+ return t.dom.contains(e.anchorNode.nodeType == 3 ? e.anchorNode.parentNode : e.anchorNode) && (t.editable || t.dom.contains(e.focusNode.nodeType == 3 ? e.focusNode.parentNode : e.focusNode));
1606
+ } catch {
1607
+ return !1;
1608
+ }
1609
+ }
1610
+ function io(t) {
1611
+ let e = t.docView.domFromPos(t.state.selection.anchor, 0), n = t.domSelectionRange();
1612
+ return re(e.node, e.offset, n.anchorNode, n.anchorOffset);
1613
+ }
1614
+ function Ye(t, e) {
1615
+ let { $anchor: n, $head: o } = t.selection, i = e > 0 ? n.max(o) : n.min(o), s = i.parent.inlineContent ? i.depth ? t.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
1616
+ return s && be.findFrom(s, e);
1617
+ }
1618
+ function Y(t, e) {
1619
+ return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()), !0;
1620
+ }
1621
+ function Nt(t, e, n) {
1622
+ let o = t.state.selection;
1623
+ if (o instanceof k)
1624
+ if (n.indexOf("s") > -1) {
1625
+ let { $head: i } = o, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter;
1626
+ if (!s || s.isText || !s.isLeaf)
1627
+ return !1;
1628
+ let r = t.state.doc.resolve(i.pos + s.nodeSize * (e < 0 ? -1 : 1));
1629
+ return Y(t, new k(o.$anchor, r));
1630
+ } else if (o.empty) {
1631
+ if (t.endOfTextblock(e > 0 ? "forward" : "backward")) {
1632
+ let i = Ye(t.state, e);
1633
+ return i && i instanceof D ? Y(t, i) : !1;
1634
+ } else if (!(V && n.indexOf("m") > -1)) {
1635
+ let i = o.$head, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, r;
1636
+ if (!s || s.isText)
1637
+ return !1;
1638
+ let l = e < 0 ? i.pos - s.nodeSize : i.pos;
1639
+ return s.isAtom || (r = t.docView.descAt(l)) && !r.contentDOM ? D.isSelectable(s) ? Y(t, new D(e < 0 ? t.state.doc.resolve(i.pos - s.nodeSize) : i)) : Oe ? Y(t, new k(t.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
1640
+ }
1641
+ } else return !1;
1642
+ else {
1643
+ if (o instanceof D && o.node.isInline)
1644
+ return Y(t, new k(e > 0 ? o.$to : o.$from));
1645
+ {
1646
+ let i = Ye(t.state, e);
1647
+ return i ? Y(t, i) : !1;
1648
+ }
1649
+ }
1650
+ }
1651
+ function Te(t) {
1652
+ return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
1653
+ }
1654
+ function ye(t, e) {
1655
+ let n = t.pmViewDesc;
1656
+ return n && n.size == 0 && (e < 0 || t.nextSibling || t.nodeName != "BR");
1657
+ }
1658
+ function ce(t, e) {
1659
+ return e < 0 ? so(t) : ro(t);
1660
+ }
1661
+ function so(t) {
1662
+ let e = t.domSelectionRange(), n = e.focusNode, o = e.focusOffset;
1663
+ if (!n)
1664
+ return;
1665
+ let i, s, r = !1;
1666
+ for (B && n.nodeType == 1 && o < Te(n) && ye(n.childNodes[o], -1) && (r = !0); ; )
1667
+ if (o > 0) {
1668
+ if (n.nodeType != 1)
1669
+ break;
1670
+ {
1671
+ let l = n.childNodes[o - 1];
1672
+ if (ye(l, -1))
1673
+ i = n, s = --o;
1674
+ else if (l.nodeType == 3)
1675
+ n = l, o = n.nodeValue.length;
1676
+ else
1677
+ break;
1678
+ }
1679
+ } else {
1680
+ if (nn(n))
1681
+ break;
1682
+ {
1683
+ let l = n.previousSibling;
1684
+ for (; l && ye(l, -1); )
1685
+ i = n.parentNode, s = S(l), l = l.previousSibling;
1686
+ if (l)
1687
+ n = l, o = Te(n);
1688
+ else {
1689
+ if (n = n.parentNode, n == t.dom)
1690
+ break;
1691
+ o = 0;
1692
+ }
1693
+ }
1694
+ }
1695
+ r ? Ge(t, n, o) : i && Ge(t, i, s);
1696
+ }
1697
+ function ro(t) {
1698
+ let e = t.domSelectionRange(), n = e.focusNode, o = e.focusOffset;
1699
+ if (!n)
1700
+ return;
1701
+ let i = Te(n), s, r;
1702
+ for (; ; )
1703
+ if (o < i) {
1704
+ if (n.nodeType != 1)
1705
+ break;
1706
+ let l = n.childNodes[o];
1707
+ if (ye(l, 1))
1708
+ s = n, r = ++o;
1709
+ else
1710
+ break;
1711
+ } else {
1712
+ if (nn(n))
1713
+ break;
1714
+ {
1715
+ let l = n.nextSibling;
1716
+ for (; l && ye(l, 1); )
1717
+ s = l.parentNode, r = S(l) + 1, l = l.nextSibling;
1718
+ if (l)
1719
+ n = l, o = 0, i = Te(n);
1720
+ else {
1721
+ if (n = n.parentNode, n == t.dom)
1722
+ break;
1723
+ o = i = 0;
1724
+ }
1725
+ }
1726
+ }
1727
+ s && Ge(t, s, r);
1728
+ }
1729
+ function nn(t) {
1730
+ let e = t.pmViewDesc;
1731
+ return e && e.node && e.node.isBlock;
1732
+ }
1733
+ function lo(t, e) {
1734
+ for (; t && e == t.childNodes.length && !Se(t); )
1735
+ e = S(t) + 1, t = t.parentNode;
1736
+ for (; t && e < t.childNodes.length; ) {
1737
+ let n = t.childNodes[e];
1738
+ if (n.nodeType == 3)
1739
+ return n;
1740
+ if (n.nodeType == 1 && n.contentEditable == "false")
1741
+ break;
1742
+ t = n, e = 0;
1743
+ }
1744
+ }
1745
+ function ao(t, e) {
1746
+ for (; t && !e && !Se(t); )
1747
+ e = S(t), t = t.parentNode;
1748
+ for (; t && e; ) {
1749
+ let n = t.childNodes[e - 1];
1750
+ if (n.nodeType == 3)
1751
+ return n;
1752
+ if (n.nodeType == 1 && n.contentEditable == "false")
1753
+ break;
1754
+ t = n, e = t.childNodes.length;
1755
+ }
1756
+ }
1757
+ function Ge(t, e, n) {
1758
+ if (e.nodeType != 3) {
1759
+ let s, r;
1760
+ (r = lo(e, n)) ? (e = r, n = 0) : (s = ao(e, n)) && (e = s, n = s.nodeValue.length);
1761
+ }
1762
+ let o = t.domSelection();
1763
+ if (!o)
1764
+ return;
1765
+ if (Re(o)) {
1766
+ let s = document.createRange();
1767
+ s.setEnd(e, n), s.setStart(e, n), o.removeAllRanges(), o.addRange(s);
1768
+ } else o.extend && o.extend(e, n);
1769
+ t.domObserver.setCurSelection();
1770
+ let { state: i } = t;
1771
+ setTimeout(() => {
1772
+ t.state == i && _(t);
1773
+ }, 50);
1774
+ }
1775
+ function Ct(t, e) {
1776
+ let n = t.state.doc.resolve(e);
1777
+ if (!(O || Ht) && n.parent.inlineContent) {
1778
+ let i = t.coordsAtPos(e);
1779
+ if (e > n.start()) {
1780
+ let s = t.coordsAtPos(e - 1), r = (s.top + s.bottom) / 2;
1781
+ if (r > i.top && r < i.bottom && Math.abs(s.left - i.left) > 1)
1782
+ return s.left < i.left ? "ltr" : "rtl";
1783
+ }
1784
+ if (e < n.end()) {
1785
+ let s = t.coordsAtPos(e + 1), r = (s.top + s.bottom) / 2;
1786
+ if (r > i.top && r < i.bottom && Math.abs(s.left - i.left) > 1)
1787
+ return s.left > i.left ? "ltr" : "rtl";
1788
+ }
1789
+ }
1790
+ return getComputedStyle(t.dom).direction == "rtl" ? "rtl" : "ltr";
1791
+ }
1792
+ function St(t, e, n) {
1793
+ let o = t.state.selection;
1794
+ if (o instanceof k && !o.empty || n.indexOf("s") > -1 || V && n.indexOf("m") > -1)
1795
+ return !1;
1796
+ let { $from: i, $to: s } = o;
1797
+ if (!i.parent.inlineContent || t.endOfTextblock(e < 0 ? "up" : "down")) {
1798
+ let r = Ye(t.state, e);
1799
+ if (r && r instanceof D)
1800
+ return Y(t, r);
1801
+ }
1802
+ if (!i.parent.inlineContent) {
1803
+ let r = e < 0 ? i : s, l = o instanceof Cn ? be.near(r, e) : be.findFrom(r, e);
1804
+ return l ? Y(t, l) : !1;
1805
+ }
1806
+ return !1;
1807
+ }
1808
+ function Ot(t, e) {
1809
+ if (!(t.state.selection instanceof k))
1810
+ return !0;
1811
+ let { $head: n, $anchor: o, empty: i } = t.state.selection;
1812
+ if (!n.sameParent(o))
1813
+ return !0;
1814
+ if (!i)
1815
+ return !1;
1816
+ if (t.endOfTextblock(e > 0 ? "forward" : "backward"))
1817
+ return !0;
1818
+ let s = !n.textOffset && (e < 0 ? n.nodeBefore : n.nodeAfter);
1819
+ if (s && !s.isText) {
1820
+ let r = t.state.tr;
1821
+ return e < 0 ? r.delete(n.pos - s.nodeSize, n.pos) : r.delete(n.pos, n.pos + s.nodeSize), t.dispatch(r), !0;
1822
+ }
1823
+ return !1;
1824
+ }
1825
+ function xt(t, e, n) {
1826
+ t.domObserver.stop(), e.contentEditable = n, t.domObserver.start();
1827
+ }
1828
+ function co(t) {
1829
+ if (!M || t.state.selection.$head.parentOffset > 0)
1830
+ return !1;
1831
+ let { focusNode: e, focusOffset: n } = t.domSelectionRange();
1832
+ if (e && e.nodeType == 1 && n == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
1833
+ let o = e.firstChild;
1834
+ xt(t, o, "true"), setTimeout(() => xt(t, o, "false"), 20);
1835
+ }
1836
+ return !1;
1837
+ }
1838
+ function fo(t) {
1839
+ let e = "";
1840
+ return t.ctrlKey && (e += "c"), t.metaKey && (e += "m"), t.altKey && (e += "a"), t.shiftKey && (e += "s"), e;
1841
+ }
1842
+ function ho(t, e) {
1843
+ let n = e.keyCode, o = fo(e);
1844
+ if (n == 8 || V && n == 72 && o == "c")
1845
+ return Ot(t, -1) || ce(t, -1);
1846
+ if (n == 46 && !e.shiftKey || V && n == 68 && o == "c")
1847
+ return Ot(t, 1) || ce(t, 1);
1848
+ if (n == 13 || n == 27)
1849
+ return !0;
1850
+ if (n == 37 || V && n == 66 && o == "c") {
1851
+ let i = n == 37 ? Ct(t, t.state.selection.from) == "ltr" ? -1 : 1 : -1;
1852
+ return Nt(t, i, o) || ce(t, i);
1853
+ } else if (n == 39 || V && n == 70 && o == "c") {
1854
+ let i = n == 39 ? Ct(t, t.state.selection.from) == "ltr" ? 1 : -1 : 1;
1855
+ return Nt(t, i, o) || ce(t, i);
1856
+ } else {
1857
+ if (n == 38 || V && n == 80 && o == "c")
1858
+ return St(t, -1, o) || ce(t, -1);
1859
+ if (n == 40 || V && n == 78 && o == "c")
1860
+ return co(t) || St(t, 1, o) || ce(t, 1);
1861
+ if (o == (V ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90))
1862
+ return !0;
1863
+ }
1864
+ return !1;
1865
+ }
1866
+ function ve(t, e) {
1867
+ t.someProp("transformCopied", (p) => {
1868
+ e = p(e, t);
1869
+ });
1870
+ let n = [], { content: o, openStart: i, openEnd: s } = e;
1871
+ for (; i > 1 && s > 1 && o.childCount == 1 && o.firstChild.childCount == 1; ) {
1872
+ i--, s--;
1873
+ let p = o.firstChild;
1874
+ n.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), o = p.content;
1875
+ }
1876
+ let r = t.someProp("clipboardSerializer") || Ve.fromSchema(t.state.schema), l = cn(), a = l.createElement("div");
1877
+ a.appendChild(r.serializeFragment(o, { document: l }));
1878
+ let c = a.firstChild, d, f = 0;
1879
+ for (; c && c.nodeType == 1 && (d = an[c.nodeName.toLowerCase()]); ) {
1880
+ for (let p = d.length - 1; p >= 0; p--) {
1881
+ let h = l.createElement(d[p]);
1882
+ for (; a.firstChild; )
1883
+ h.appendChild(a.firstChild);
1884
+ a.appendChild(h), f++;
1885
+ }
1886
+ c = a.firstChild;
1887
+ }
1888
+ c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${i} ${s}${f ? ` -${f}` : ""} ${JSON.stringify(n)}`);
1889
+ let u = t.someProp("clipboardTextSerializer", (p) => p(e, t)) || e.content.textBetween(0, e.content.size, `
1890
+
1891
+ `);
1892
+ return { dom: a, text: u, slice: e };
1893
+ }
1894
+ function on(t, e, n, o, i) {
1895
+ let s = i.parent.type.spec.code, r, l;
1896
+ if (!n && !e)
1897
+ return null;
1898
+ let a = !!e && (o || s || !n);
1899
+ if (a) {
1900
+ if (t.someProp("transformPastedText", (u) => {
1901
+ e = u(e, s || o, t);
1902
+ }), s)
1903
+ return l = new se(j.from(t.state.schema.text(e.replace(/\r\n?/g, `
1904
+ `))), 0, 0), t.someProp("transformPasted", (u) => {
1905
+ l = u(l, t, !0);
1906
+ }), l;
1907
+ let f = t.someProp("clipboardTextParser", (u) => u(e, i, o, t));
1908
+ if (f)
1909
+ l = f;
1910
+ else {
1911
+ let u = i.marks(), { schema: p } = t.state, h = Ve.fromSchema(p);
1912
+ r = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((g) => {
1913
+ let m = r.appendChild(document.createElement("p"));
1914
+ g && m.appendChild(h.serializeNode(p.text(g, u)));
1915
+ });
1916
+ }
1917
+ } else
1918
+ t.someProp("transformPastedHTML", (f) => {
1919
+ n = f(n, t);
1920
+ }), r = go(n), Oe && yo(r);
1921
+ let c = r && r.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
1922
+ if (d && d[3])
1923
+ for (let f = +d[3]; f > 0; f--) {
1924
+ let u = r.firstChild;
1925
+ for (; u && u.nodeType != 1; )
1926
+ u = u.nextSibling;
1927
+ if (!u)
1928
+ break;
1929
+ r = u;
1930
+ }
1931
+ if (l || (l = (t.someProp("clipboardParser") || t.someProp("domParser") || $t.fromSchema(t.state.schema)).parseSlice(r, {
1932
+ preserveWhitespace: !!(a || d),
1933
+ context: i,
1934
+ ruleFromNode(u) {
1935
+ return u.nodeName == "BR" && !u.nextSibling && u.parentNode && !uo.test(u.parentNode.nodeName) ? { ignore: !0 } : null;
1936
+ }
1937
+ })), d)
1938
+ l = bo(Mt(l, +d[1], +d[2]), d[4]);
1939
+ else if (l = se.maxOpen(po(l.content, i), !0), l.openStart || l.openEnd) {
1940
+ let f = 0, u = 0;
1941
+ for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
1942
+ ;
1943
+ for (let p = l.content.lastChild; u < l.openEnd && !p.type.spec.isolating; u++, p = p.lastChild)
1944
+ ;
1945
+ l = Mt(l, f, u);
1946
+ }
1947
+ return t.someProp("transformPasted", (f) => {
1948
+ l = f(l, t, a);
1949
+ }), l;
1950
+ }
1951
+ const uo = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
1952
+ function po(t, e) {
1953
+ if (t.childCount < 2)
1954
+ return t;
1955
+ for (let n = e.depth; n >= 0; n--) {
1956
+ let i = e.node(n).contentMatchAt(e.index(n)), s, r = [];
1957
+ if (t.forEach((l) => {
1958
+ if (!r)
1959
+ return;
1960
+ let a = i.findWrapping(l.type), c;
1961
+ if (!a)
1962
+ return r = null;
1963
+ if (c = r.length && s.length && rn(a, s, l, r[r.length - 1], 0))
1964
+ r[r.length - 1] = c;
1965
+ else {
1966
+ r.length && (r[r.length - 1] = ln(r[r.length - 1], s.length));
1967
+ let d = sn(l, a);
1968
+ r.push(d), i = i.matchType(d.type), s = a;
1969
+ }
1970
+ }), r)
1971
+ return j.from(r);
1972
+ }
1973
+ return t;
1974
+ }
1975
+ function sn(t, e, n = 0) {
1976
+ for (let o = e.length - 1; o >= n; o--)
1977
+ t = e[o].create(null, j.from(t));
1978
+ return t;
1979
+ }
1980
+ function rn(t, e, n, o, i) {
1981
+ if (i < t.length && i < e.length && t[i] == e[i]) {
1982
+ let s = rn(t, e, n, o.lastChild, i + 1);
1983
+ if (s)
1984
+ return o.copy(o.content.replaceChild(o.childCount - 1, s));
1985
+ if (o.contentMatchAt(o.childCount).matchType(i == t.length - 1 ? n.type : t[i + 1]))
1986
+ return o.copy(o.content.append(j.from(sn(n, t, i + 1))));
1987
+ }
1988
+ }
1989
+ function ln(t, e) {
1990
+ if (e == 0)
1991
+ return t;
1992
+ let n = t.content.replaceChild(t.childCount - 1, ln(t.lastChild, e - 1)), o = t.contentMatchAt(t.childCount).fillBefore(j.empty, !0);
1993
+ return t.copy(n.append(o));
1994
+ }
1995
+ function Xe(t, e, n, o, i, s) {
1996
+ let r = e < 0 ? t.firstChild : t.lastChild, l = r.content;
1997
+ return t.childCount > 1 && (s = 0), i < o - 1 && (l = Xe(l, e, n, o, i + 1, s)), i >= n && (l = e < 0 ? r.contentMatchAt(0).fillBefore(l, s <= i).append(l) : l.append(r.contentMatchAt(r.childCount).fillBefore(j.empty, !0))), t.replaceChild(e < 0 ? 0 : t.childCount - 1, r.copy(l));
1998
+ }
1999
+ function Mt(t, e, n) {
2000
+ return e < t.openStart && (t = new se(Xe(t.content, -1, e, t.openStart, 0, t.openEnd), e, t.openEnd)), n < t.openEnd && (t = new se(Xe(t.content, 1, n, t.openEnd, 0, 0), t.openStart, n)), t;
2001
+ }
2002
+ const an = {
2003
+ thead: ["table"],
2004
+ tbody: ["table"],
2005
+ tfoot: ["table"],
2006
+ caption: ["table"],
2007
+ colgroup: ["table"],
2008
+ col: ["table", "colgroup"],
2009
+ tr: ["table", "tbody"],
2010
+ td: ["table", "tbody", "tr"],
2011
+ th: ["table", "tbody", "tr"]
2012
+ };
2013
+ let kt = null;
2014
+ function cn() {
2015
+ return kt || (kt = document.implementation.createHTMLDocument("title"));
2016
+ }
2017
+ let Le = null;
2018
+ function mo(t) {
2019
+ let e = window.trustedTypes;
2020
+ return e ? (Le || (Le = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (n) => n })), Le.createHTML(t)) : t;
2021
+ }
2022
+ function go(t) {
2023
+ let e = /^(\s*<meta [^>]*>)*/.exec(t);
2024
+ e && (t = t.slice(e[0].length));
2025
+ let n = cn().createElement("div"), o = /<([a-z][^>\s]+)/i.exec(t), i;
2026
+ if ((i = o && an[o[1].toLowerCase()]) && (t = i.map((s) => "<" + s + ">").join("") + t + i.map((s) => "</" + s + ">").reverse().join("")), n.innerHTML = mo(t), i)
2027
+ for (let s = 0; s < i.length; s++)
2028
+ n = n.querySelector(i[s]) || n;
2029
+ return n;
2030
+ }
2031
+ function yo(t) {
2032
+ let e = t.querySelectorAll(O ? "span:not([class]):not([style])" : "span.Apple-converted-space");
2033
+ for (let n = 0; n < e.length; n++) {
2034
+ let o = e[n];
2035
+ o.childNodes.length == 1 && o.textContent == " " && o.parentNode && o.parentNode.replaceChild(t.ownerDocument.createTextNode(" "), o);
2036
+ }
2037
+ }
2038
+ function bo(t, e) {
2039
+ if (!t.size)
2040
+ return t;
2041
+ let n = t.content.firstChild.type.schema, o;
2042
+ try {
2043
+ o = JSON.parse(e);
2044
+ } catch {
2045
+ return t;
2046
+ }
2047
+ let { content: i, openStart: s, openEnd: r } = t;
2048
+ for (let l = o.length - 2; l >= 0; l -= 2) {
2049
+ let a = n.nodes[o[l]];
2050
+ if (!a || a.hasRequiredAttrs())
2051
+ break;
2052
+ i = j.from(a.create(o[l + 1], i)), s++, r++;
2053
+ }
2054
+ return new se(i, s, r);
2055
+ }
2056
+ const T = {}, E = {}, Do = { touchstart: !0, touchmove: !0 };
2057
+ class No {
2058
+ constructor() {
2059
+ this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.badSafariComposition = !1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
2060
+ }
2061
+ }
2062
+ function Co(t) {
2063
+ for (let e in T) {
2064
+ let n = T[e];
2065
+ t.dom.addEventListener(e, t.input.eventHandlers[e] = (o) => {
2066
+ Oo(t, o) && !et(t, o) && (t.editable || !(o.type in E)) && n(t, o);
2067
+ }, Do[e] ? { passive: !0 } : void 0);
2068
+ }
2069
+ M && t.dom.addEventListener("input", () => null), Je(t);
2070
+ }
2071
+ function X(t, e) {
2072
+ t.input.lastSelectionOrigin = e, t.input.lastSelectionTime = Date.now();
2073
+ }
2074
+ function So(t) {
2075
+ t.domObserver.stop();
2076
+ for (let e in t.input.eventHandlers)
2077
+ t.dom.removeEventListener(e, t.input.eventHandlers[e]);
2078
+ clearTimeout(t.input.composingTimeout), clearTimeout(t.input.lastIOSEnterFallbackTimeout);
2079
+ }
2080
+ function Je(t) {
2081
+ t.someProp("handleDOMEvents", (e) => {
2082
+ for (let n in e)
2083
+ t.input.eventHandlers[n] || t.dom.addEventListener(n, t.input.eventHandlers[n] = (o) => et(t, o));
2084
+ });
2085
+ }
2086
+ function et(t, e) {
2087
+ return t.someProp("handleDOMEvents", (n) => {
2088
+ let o = n[e.type];
2089
+ return o ? o(t, e) || e.defaultPrevented : !1;
2090
+ });
2091
+ }
2092
+ function Oo(t, e) {
2093
+ if (!e.bubbles)
2094
+ return !0;
2095
+ if (e.defaultPrevented)
2096
+ return !1;
2097
+ for (let n = e.target; n != t.dom; n = n.parentNode)
2098
+ if (!n || n.nodeType == 11 || n.pmViewDesc && n.pmViewDesc.stopEvent(e))
2099
+ return !1;
2100
+ return !0;
2101
+ }
2102
+ function xo(t, e) {
2103
+ !et(t, e) && T[e.type] && (t.editable || !(e.type in E)) && T[e.type](t, e);
2104
+ }
2105
+ E.keydown = (t, e) => {
2106
+ let n = e;
2107
+ if (t.input.shiftKey = n.keyCode == 16 || n.shiftKey, !fn(t, n) && (t.input.lastKeyCode = n.keyCode, t.input.lastKeyCodeTime = Date.now(), !(W && O && n.keyCode == 13)))
2108
+ if (n.keyCode != 229 && t.domObserver.forceFlush(), ue && n.keyCode == 13 && !n.ctrlKey && !n.altKey && !n.metaKey) {
2109
+ let o = Date.now();
2110
+ t.input.lastIOSEnter = o, t.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
2111
+ t.input.lastIOSEnter == o && (t.someProp("handleKeyDown", (i) => i(t, ee(13, "Enter"))), t.input.lastIOSEnter = 0);
2112
+ }, 200);
2113
+ } else t.someProp("handleKeyDown", (o) => o(t, n)) || ho(t, n) ? n.preventDefault() : X(t, "key");
2114
+ };
2115
+ E.keyup = (t, e) => {
2116
+ e.keyCode == 16 && (t.input.shiftKey = !1);
2117
+ };
2118
+ E.keypress = (t, e) => {
2119
+ let n = e;
2120
+ if (fn(t, n) || !n.charCode || n.ctrlKey && !n.altKey || V && n.metaKey)
2121
+ return;
2122
+ if (t.someProp("handleKeyPress", (i) => i(t, n))) {
2123
+ n.preventDefault();
2124
+ return;
2125
+ }
2126
+ let o = t.state.selection;
2127
+ if (!(o instanceof k) || !o.$from.sameParent(o.$to)) {
2128
+ let i = String.fromCharCode(n.charCode), s = () => t.state.tr.insertText(i).scrollIntoView();
2129
+ !/[\r\n]/.test(i) && !t.someProp("handleTextInput", (r) => r(t, o.$from.pos, o.$to.pos, i, s)) && t.dispatch(s()), n.preventDefault();
2130
+ }
2131
+ };
2132
+ function Ie(t) {
2133
+ return { left: t.clientX, top: t.clientY };
2134
+ }
2135
+ function Mo(t, e) {
2136
+ let n = e.x - t.clientX, o = e.y - t.clientY;
2137
+ return n * n + o * o < 100;
2138
+ }
2139
+ function tt(t, e, n, o, i) {
2140
+ if (o == -1)
2141
+ return !1;
2142
+ let s = t.state.doc.resolve(o);
2143
+ for (let r = s.depth + 1; r > 0; r--)
2144
+ if (t.someProp(e, (l) => r > s.depth ? l(t, n, s.nodeAfter, s.before(r), i, !0) : l(t, n, s.node(r), s.before(r), i, !1)))
2145
+ return !0;
2146
+ return !1;
2147
+ }
2148
+ function fe(t, e, n) {
2149
+ if (t.focused || t.focus(), t.state.selection.eq(e))
2150
+ return;
2151
+ let o = t.state.tr.setSelection(e);
2152
+ o.setMeta("pointer", !0), t.dispatch(o);
2153
+ }
2154
+ function ko(t, e) {
2155
+ if (e == -1)
2156
+ return !1;
2157
+ let n = t.state.doc.resolve(e), o = n.nodeAfter;
2158
+ return o && o.isAtom && D.isSelectable(o) ? (fe(t, new D(n)), !0) : !1;
2159
+ }
2160
+ function To(t, e) {
2161
+ if (e == -1)
2162
+ return !1;
2163
+ let n = t.state.selection, o, i;
2164
+ n instanceof D && (o = n.node);
2165
+ let s = t.state.doc.resolve(e);
2166
+ for (let r = s.depth + 1; r > 0; r--) {
2167
+ let l = r > s.depth ? s.nodeAfter : s.node(r);
2168
+ if (D.isSelectable(l)) {
2169
+ o && n.$from.depth > 0 && r >= n.$from.depth && s.before(n.$from.depth + 1) == n.$from.pos ? i = s.before(n.$from.depth) : i = s.before(r);
2170
+ break;
2171
+ }
2172
+ }
2173
+ return i != null ? (fe(t, D.create(t.state.doc, i)), !0) : !1;
2174
+ }
2175
+ function Eo(t, e, n, o, i) {
2176
+ return tt(t, "handleClickOn", e, n, o) || t.someProp("handleClick", (s) => s(t, e, o)) || (i ? To(t, n) : ko(t, n));
2177
+ }
2178
+ function Po(t, e, n, o) {
2179
+ return tt(t, "handleDoubleClickOn", e, n, o) || t.someProp("handleDoubleClick", (i) => i(t, e, o));
2180
+ }
2181
+ function Ao(t, e, n, o) {
2182
+ return tt(t, "handleTripleClickOn", e, n, o) || t.someProp("handleTripleClick", (i) => i(t, e, o)) || Vo(t, n, o);
2183
+ }
2184
+ function Vo(t, e, n) {
2185
+ if (n.button != 0)
2186
+ return !1;
2187
+ let o = t.state.doc;
2188
+ if (e == -1)
2189
+ return o.inlineContent ? (fe(t, k.create(o, 0, o.content.size)), !0) : !1;
2190
+ let i = o.resolve(e);
2191
+ for (let s = i.depth + 1; s > 0; s--) {
2192
+ let r = s > i.depth ? i.nodeAfter : i.node(s), l = i.before(s);
2193
+ if (r.inlineContent)
2194
+ fe(t, k.create(o, l + 1, l + 1 + r.content.size));
2195
+ else if (D.isSelectable(r))
2196
+ fe(t, D.create(o, l));
2197
+ else
2198
+ continue;
2199
+ return !0;
2200
+ }
2201
+ }
2202
+ function nt(t) {
2203
+ return Ee(t);
2204
+ }
2205
+ const dn = V ? "metaKey" : "ctrlKey";
2206
+ T.mousedown = (t, e) => {
2207
+ let n = e;
2208
+ t.input.shiftKey = n.shiftKey;
2209
+ let o = nt(t), i = Date.now(), s = "singleClick";
2210
+ i - t.input.lastClick.time < 500 && Mo(n, t.input.lastClick) && !n[dn] && t.input.lastClick.button == n.button && (t.input.lastClick.type == "singleClick" ? s = "doubleClick" : t.input.lastClick.type == "doubleClick" && (s = "tripleClick")), t.input.lastClick = { time: i, x: n.clientX, y: n.clientY, type: s, button: n.button };
2211
+ let r = t.posAtCoords(Ie(n));
2212
+ r && (s == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new Ro(t, r, n, !!o)) : (s == "doubleClick" ? Po : Ao)(t, r.pos, r.inside, n) ? n.preventDefault() : X(t, "pointer"));
2213
+ };
2214
+ class Ro {
2215
+ constructor(e, n, o, i) {
2216
+ this.view = e, this.pos = n, this.event = o, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!o[dn], this.allowDefault = o.shiftKey;
2217
+ let s, r;
2218
+ if (n.inside > -1)
2219
+ s = e.state.doc.nodeAt(n.inside), r = n.inside;
2220
+ else {
2221
+ let d = e.state.doc.resolve(n.pos);
2222
+ s = d.parent, r = d.depth ? d.before() : 0;
2223
+ }
2224
+ const l = i ? null : o.target, a = l ? e.docView.nearestDesc(l, !0) : null;
2225
+ this.target = a && a.nodeDOM.nodeType == 1 ? a.nodeDOM : null;
2226
+ let { selection: c } = e.state;
2227
+ (o.button == 0 && s.type.spec.draggable && s.type.spec.selectable !== !1 || c instanceof D && c.from <= r && c.to > r) && (this.mightDrag = {
2228
+ node: s,
2229
+ pos: r,
2230
+ addAttr: !!(this.target && !this.target.draggable),
2231
+ setUneditable: !!(this.target && B && !this.target.hasAttribute("contentEditable"))
2232
+ }), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
2233
+ this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
2234
+ }, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), X(e, "pointer");
2235
+ }
2236
+ done() {
2237
+ this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => _(this.view)), this.view.input.mouseDown = null;
2238
+ }
2239
+ up(e) {
2240
+ if (this.done(), !this.view.dom.contains(e.target))
2241
+ return;
2242
+ let n = this.pos;
2243
+ this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(Ie(e))), this.updateAllowDefault(e), this.allowDefault || !n ? X(this.view, "pointer") : Eo(this.view, n.pos, n.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
2244
+ M && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
2245
+ // cursor, but still report that the node is selected
2246
+ // when asked through getSelection. You'll then get a
2247
+ // situation where clicking at the point where that
2248
+ // (hidden) cursor is doesn't change the selection, and
2249
+ // thus doesn't get a reaction from ProseMirror. This
2250
+ // works around that.
2251
+ O && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (fe(this.view, be.near(this.view.state.doc.resolve(n.pos))), e.preventDefault()) : X(this.view, "pointer");
2252
+ }
2253
+ move(e) {
2254
+ this.updateAllowDefault(e), X(this.view, "pointer"), e.buttons == 0 && this.done();
2255
+ }
2256
+ updateAllowDefault(e) {
2257
+ !this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);
2258
+ }
2259
+ }
2260
+ T.touchstart = (t) => {
2261
+ t.input.lastTouch = Date.now(), nt(t), X(t, "pointer");
2262
+ };
2263
+ T.touchmove = (t) => {
2264
+ t.input.lastTouch = Date.now(), X(t, "pointer");
2265
+ };
2266
+ T.contextmenu = (t) => nt(t);
2267
+ function fn(t, e) {
2268
+ return t.composing ? !0 : M && Math.abs(e.timeStamp - t.input.compositionEndedAt) < 500 ? (t.input.compositionEndedAt = -2e8, !0) : !1;
2269
+ }
2270
+ const Bo = W ? 5e3 : -1;
2271
+ E.compositionstart = E.compositionupdate = (t) => {
2272
+ if (!t.composing) {
2273
+ t.domObserver.flush();
2274
+ let { state: e } = t, n = e.selection.$to;
2275
+ if (e.selection instanceof k && (e.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((o) => o.type.spec.inclusive === !1) || O && Ht && Io(t)))
2276
+ t.markCursor = t.state.storedMarks || n.marks(), Ee(t, !0), t.markCursor = null;
2277
+ else if (Ee(t, !e.selection.empty), B && e.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
2278
+ let o = t.domSelectionRange();
2279
+ for (let i = o.focusNode, s = o.focusOffset; i && i.nodeType == 1 && s != 0; ) {
2280
+ let r = s < 0 ? i.lastChild : i.childNodes[s - 1];
2281
+ if (!r)
2282
+ break;
2283
+ if (r.nodeType == 3) {
2284
+ let l = t.domSelection();
2285
+ l && l.collapse(r, r.nodeValue.length);
2286
+ break;
2287
+ } else
2288
+ i = r, s = -1;
2289
+ }
2290
+ }
2291
+ t.input.composing = !0;
2292
+ }
2293
+ hn(t, Bo);
2294
+ };
2295
+ function Io(t) {
2296
+ let { focusNode: e, focusOffset: n } = t.domSelectionRange();
2297
+ if (!e || e.nodeType != 1 || n >= e.childNodes.length)
2298
+ return !1;
2299
+ let o = e.childNodes[n];
2300
+ return o.nodeType == 1 && o.contentEditable == "false";
2301
+ }
2302
+ E.compositionend = (t, e) => {
2303
+ t.composing && (t.input.composing = !1, t.input.compositionEndedAt = e.timeStamp, t.input.compositionPendingChanges = t.domObserver.pendingRecords().length ? t.input.compositionID : 0, t.input.compositionNode = null, t.input.badSafariComposition ? t.domObserver.forceFlush() : t.input.compositionPendingChanges && Promise.resolve().then(() => t.domObserver.flush()), t.input.compositionID++, hn(t, 20));
2304
+ };
2305
+ function hn(t, e) {
2306
+ clearTimeout(t.input.composingTimeout), e > -1 && (t.input.composingTimeout = setTimeout(() => Ee(t), e));
2307
+ }
2308
+ function un(t) {
2309
+ for (t.composing && (t.input.composing = !1, t.input.compositionEndedAt = zo()); t.input.compositionNodes.length > 0; )
2310
+ t.input.compositionNodes.pop().markParentsDirty();
2311
+ }
2312
+ function Fo(t) {
2313
+ let e = t.domSelectionRange();
2314
+ if (!e.focusNode)
2315
+ return null;
2316
+ let n = kn(e.focusNode, e.focusOffset), o = Tn(e.focusNode, e.focusOffset);
2317
+ if (n && o && n != o) {
2318
+ let i = o.pmViewDesc, s = t.domObserver.lastChangedTextNode;
2319
+ if (n == s || o == s)
2320
+ return s;
2321
+ if (!i || !i.isText(o.nodeValue))
2322
+ return o;
2323
+ if (t.input.compositionNode == o) {
2324
+ let r = n.pmViewDesc;
2325
+ if (!(!r || !r.isText(n.nodeValue)))
2326
+ return o;
2327
+ }
2328
+ }
2329
+ return n || o;
2330
+ }
2331
+ function zo() {
2332
+ let t = document.createEvent("Event");
2333
+ return t.initEvent("event", !0, !0), t.timeStamp;
2334
+ }
2335
+ function Ee(t, e = !1) {
2336
+ if (!(W && t.domObserver.flushingSoon >= 0)) {
2337
+ if (t.domObserver.forceFlush(), un(t), e || t.docView && t.docView.dirty) {
2338
+ let n = Qe(t), o = t.state.selection;
2339
+ return n && !n.eq(o) ? t.dispatch(t.state.tr.setSelection(n)) : (t.markCursor || e) && !o.$from.node(o.$from.sharedDepth(o.to)).inlineContent ? t.dispatch(t.state.tr.deleteSelection()) : t.updateState(t.state), !0;
2340
+ }
2341
+ return !1;
2342
+ }
2343
+ }
2344
+ function Lo(t, e) {
2345
+ if (!t.dom.parentNode)
2346
+ return;
2347
+ let n = t.dom.parentNode.appendChild(document.createElement("div"));
2348
+ n.appendChild(e), n.style.cssText = "position: fixed; left: -10000px; top: 10px";
2349
+ let o = getSelection(), i = document.createRange();
2350
+ i.selectNodeContents(e), t.dom.blur(), o.removeAllRanges(), o.addRange(i), setTimeout(() => {
2351
+ n.parentNode && n.parentNode.removeChild(n), t.focus();
2352
+ }, 50);
2353
+ }
2354
+ const De = A && J < 15 || ue && Vn < 604;
2355
+ T.copy = E.cut = (t, e) => {
2356
+ let n = e, o = t.state.selection, i = n.type == "cut";
2357
+ if (o.empty)
2358
+ return;
2359
+ let s = De ? null : n.clipboardData, r = o.content(), { dom: l, text: a } = ve(t, r);
2360
+ s ? (n.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Lo(t, l), i && t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
2361
+ };
2362
+ function $o(t) {
2363
+ return t.openStart == 0 && t.openEnd == 0 && t.content.childCount == 1 ? t.content.firstChild : null;
2364
+ }
2365
+ function Ko(t, e) {
2366
+ if (!t.dom.parentNode)
2367
+ return;
2368
+ let n = t.input.shiftKey || t.state.selection.$from.parent.type.spec.code, o = t.dom.parentNode.appendChild(document.createElement(n ? "textarea" : "div"));
2369
+ n || (o.contentEditable = "true"), o.style.cssText = "position: fixed; left: -10000px; top: 10px", o.focus();
2370
+ let i = t.input.shiftKey && t.input.lastKeyCode != 45;
2371
+ setTimeout(() => {
2372
+ t.focus(), o.parentNode && o.parentNode.removeChild(o), n ? Ne(t, o.value, null, i, e) : Ne(t, o.textContent, o.innerHTML, i, e);
2373
+ }, 50);
2374
+ }
2375
+ function Ne(t, e, n, o, i) {
2376
+ let s = on(t, e, n, o, t.state.selection.$from);
2377
+ if (t.someProp("handlePaste", (a) => a(t, i, s || se.empty)))
2378
+ return !0;
2379
+ if (!s)
2380
+ return !1;
2381
+ let r = $o(s), l = r ? t.state.tr.replaceSelectionWith(r, o) : t.state.tr.replaceSelection(s);
2382
+ return t.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
2383
+ }
2384
+ function pn(t) {
2385
+ let e = t.getData("text/plain") || t.getData("Text");
2386
+ if (e)
2387
+ return e;
2388
+ let n = t.getData("text/uri-list");
2389
+ return n ? n.replace(/\r?\n/g, " ") : "";
2390
+ }
2391
+ E.paste = (t, e) => {
2392
+ let n = e;
2393
+ if (t.composing && !W)
2394
+ return;
2395
+ let o = De ? null : n.clipboardData, i = t.input.shiftKey && t.input.lastKeyCode != 45;
2396
+ o && Ne(t, pn(o), o.getData("text/html"), i, n) ? n.preventDefault() : Ko(t, n);
2397
+ };
2398
+ class mn {
2399
+ constructor(e, n, o) {
2400
+ this.slice = e, this.move = n, this.node = o;
2401
+ }
2402
+ }
2403
+ const qo = V ? "altKey" : "ctrlKey";
2404
+ function gn(t, e) {
2405
+ let n = t.someProp("dragCopies", (o) => !o(e));
2406
+ return n ?? !e[qo];
2407
+ }
2408
+ T.dragstart = (t, e) => {
2409
+ let n = e, o = t.input.mouseDown;
2410
+ if (o && o.done(), !n.dataTransfer)
2411
+ return;
2412
+ let i = t.state.selection, s = i.empty ? null : t.posAtCoords(Ie(n)), r;
2413
+ if (!(s && s.pos >= i.from && s.pos <= (i instanceof D ? i.to - 1 : i.to))) {
2414
+ if (o && o.mightDrag)
2415
+ r = D.create(t.state.doc, o.mightDrag.pos);
2416
+ else if (n.target && n.target.nodeType == 1) {
2417
+ let f = t.docView.nearestDesc(n.target, !0);
2418
+ f && f.node.type.spec.draggable && f != t.docView && (r = D.create(t.state.doc, f.posBefore));
2419
+ }
2420
+ }
2421
+ let l = (r || t.state.selection).content(), { dom: a, text: c, slice: d } = ve(t, l);
2422
+ (!n.dataTransfer.files.length || !O || qt > 120) && n.dataTransfer.clearData(), n.dataTransfer.setData(De ? "Text" : "text/html", a.innerHTML), n.dataTransfer.effectAllowed = "copyMove", De || n.dataTransfer.setData("text/plain", c), t.dragging = new mn(d, gn(t, n), r);
2423
+ };
2424
+ T.dragend = (t) => {
2425
+ let e = t.dragging;
2426
+ window.setTimeout(() => {
2427
+ t.dragging == e && (t.dragging = null);
2428
+ }, 50);
2429
+ };
2430
+ E.dragover = E.dragenter = (t, e) => e.preventDefault();
2431
+ E.drop = (t, e) => {
2432
+ try {
2433
+ Ho(t, e, t.dragging);
2434
+ } finally {
2435
+ t.dragging = null;
2436
+ }
2437
+ };
2438
+ function Ho(t, e, n) {
2439
+ if (!e.dataTransfer)
2440
+ return;
2441
+ let o = t.posAtCoords(Ie(e));
2442
+ if (!o)
2443
+ return;
2444
+ let i = t.state.doc.resolve(o.pos), s = n && n.slice;
2445
+ s ? t.someProp("transformPasted", (p) => {
2446
+ s = p(s, t, !1);
2447
+ }) : s = on(t, pn(e.dataTransfer), De ? null : e.dataTransfer.getData("text/html"), !1, i);
2448
+ let r = !!(n && gn(t, e));
2449
+ if (t.someProp("handleDrop", (p) => p(t, e, s || se.empty, r))) {
2450
+ e.preventDefault();
2451
+ return;
2452
+ }
2453
+ if (!s)
2454
+ return;
2455
+ e.preventDefault();
2456
+ let l = s ? On(t.state.doc, i.pos, s) : i.pos;
2457
+ l == null && (l = i.pos);
2458
+ let a = t.state.tr;
2459
+ if (r) {
2460
+ let { node: p } = n;
2461
+ p ? p.replace(a) : a.deleteSelection();
2462
+ }
2463
+ let c = a.mapping.map(l), d = s.openStart == 0 && s.openEnd == 0 && s.content.childCount == 1, f = a.doc;
2464
+ if (d ? a.replaceRangeWith(c, c, s.content.firstChild) : a.replaceRange(c, c, s), a.doc.eq(f))
2465
+ return;
2466
+ let u = a.doc.resolve(c);
2467
+ if (d && D.isSelectable(s.content.firstChild) && u.nodeAfter && u.nodeAfter.sameMarkup(s.content.firstChild))
2468
+ a.setSelection(new D(u));
2469
+ else {
2470
+ let p = a.mapping.map(l);
2471
+ a.mapping.maps[a.mapping.maps.length - 1].forEach((h, g, m, y) => p = y), a.setSelection(we(t, u, a.doc.resolve(p)));
2472
+ }
2473
+ t.focus(), t.dispatch(a.setMeta("uiEvent", "drop"));
2474
+ }
2475
+ T.focus = (t) => {
2476
+ t.input.lastFocus = Date.now(), t.focused || (t.domObserver.stop(), t.dom.classList.add("ProseMirror-focused"), t.domObserver.start(), t.focused = !0, setTimeout(() => {
2477
+ t.docView && t.hasFocus() && !t.domObserver.currentSelection.eq(t.domSelectionRange()) && _(t);
2478
+ }, 20));
2479
+ };
2480
+ T.blur = (t, e) => {
2481
+ let n = e;
2482
+ t.focused && (t.domObserver.stop(), t.dom.classList.remove("ProseMirror-focused"), t.domObserver.start(), n.relatedTarget && t.dom.contains(n.relatedTarget) && t.domObserver.currentSelection.clear(), t.focused = !1);
2483
+ };
2484
+ T.beforeinput = (t, e) => {
2485
+ if (O && W && e.inputType == "deleteContentBackward") {
2486
+ t.domObserver.flushSoon();
2487
+ let { domChangeCount: o } = t.input;
2488
+ setTimeout(() => {
2489
+ if (t.input.domChangeCount != o || (t.dom.blur(), t.focus(), t.someProp("handleKeyDown", (s) => s(t, ee(8, "Backspace")))))
2490
+ return;
2491
+ let { $cursor: i } = t.state.selection;
2492
+ i && i.pos > 0 && t.dispatch(t.state.tr.delete(i.pos - 1, i.pos).scrollIntoView());
2493
+ }, 50);
2494
+ }
2495
+ };
2496
+ for (let t in E)
2497
+ T[t] = E[t];
2498
+ function Ce(t, e) {
2499
+ if (t == e)
2500
+ return !0;
2501
+ for (let n in t)
2502
+ if (t[n] !== e[n])
2503
+ return !1;
2504
+ for (let n in e)
2505
+ if (!(n in t))
2506
+ return !1;
2507
+ return !0;
2508
+ }
2509
+ class Pe {
2510
+ constructor(e, n) {
2511
+ this.toDOM = e, this.spec = n || oe, this.side = this.spec.side || 0;
2512
+ }
2513
+ map(e, n, o, i) {
2514
+ let { pos: s, deleted: r } = e.mapResult(n.from + i, this.side < 0 ? -1 : 1);
2515
+ return r ? null : new L(s - o, s - o, this);
2516
+ }
2517
+ valid() {
2518
+ return !0;
2519
+ }
2520
+ eq(e) {
2521
+ return this == e || e instanceof Pe && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Ce(this.spec, e.spec));
2522
+ }
2523
+ destroy(e) {
2524
+ this.spec.destroy && this.spec.destroy(e);
2525
+ }
2526
+ }
2527
+ class Q {
2528
+ constructor(e, n) {
2529
+ this.attrs = e, this.spec = n || oe;
2530
+ }
2531
+ map(e, n, o, i) {
2532
+ let s = e.map(n.from + i, this.spec.inclusiveStart ? -1 : 1) - o, r = e.map(n.to + i, this.spec.inclusiveEnd ? 1 : -1) - o;
2533
+ return s >= r ? null : new L(s, r, this);
2534
+ }
2535
+ valid(e, n) {
2536
+ return n.from < n.to;
2537
+ }
2538
+ eq(e) {
2539
+ return this == e || e instanceof Q && Ce(this.attrs, e.attrs) && Ce(this.spec, e.spec);
2540
+ }
2541
+ static is(e) {
2542
+ return e.type instanceof Q;
2543
+ }
2544
+ destroy() {
2545
+ }
2546
+ }
2547
+ class ot {
2548
+ constructor(e, n) {
2549
+ this.attrs = e, this.spec = n || oe;
2550
+ }
2551
+ map(e, n, o, i) {
2552
+ let s = e.mapResult(n.from + i, 1);
2553
+ if (s.deleted)
2554
+ return null;
2555
+ let r = e.mapResult(n.to + i, -1);
2556
+ return r.deleted || r.pos <= s.pos ? null : new L(s.pos - o, r.pos - o, this);
2557
+ }
2558
+ valid(e, n) {
2559
+ let { index: o, offset: i } = e.content.findIndex(n.from), s;
2560
+ return i == n.from && !(s = e.child(o)).isText && i + s.nodeSize == n.to;
2561
+ }
2562
+ eq(e) {
2563
+ return this == e || e instanceof ot && Ce(this.attrs, e.attrs) && Ce(this.spec, e.spec);
2564
+ }
2565
+ destroy() {
2566
+ }
2567
+ }
2568
+ class L {
2569
+ /**
2570
+ @internal
2571
+ */
2572
+ constructor(e, n, o) {
2573
+ this.from = e, this.to = n, this.type = o;
2574
+ }
2575
+ /**
2576
+ @internal
2577
+ */
2578
+ copy(e, n) {
2579
+ return new L(e, n, this.type);
2580
+ }
2581
+ /**
2582
+ @internal
2583
+ */
2584
+ eq(e, n = 0) {
2585
+ return this.type.eq(e.type) && this.from + n == e.from && this.to + n == e.to;
2586
+ }
2587
+ /**
2588
+ @internal
2589
+ */
2590
+ map(e, n, o) {
2591
+ return this.type.map(e, this, n, o);
2592
+ }
2593
+ /**
2594
+ Creates a widget decoration, which is a DOM node that's shown in
2595
+ the document at the given position. It is recommended that you
2596
+ delay rendering the widget by passing a function that will be
2597
+ called when the widget is actually drawn in a view, but you can
2598
+ also directly pass a DOM node. `getPos` can be used to find the
2599
+ widget's current document position.
2600
+ */
2601
+ static widget(e, n, o) {
2602
+ return new L(e, e, new Pe(n, o));
2603
+ }
2604
+ /**
2605
+ Creates an inline decoration, which adds the given attributes to
2606
+ each inline node between `from` and `to`.
2607
+ */
2608
+ static inline(e, n, o, i) {
2609
+ return new L(e, n, new Q(o, i));
2610
+ }
2611
+ /**
2612
+ Creates a node decoration. `from` and `to` should point precisely
2613
+ before and after a node in the document. That node, and only that
2614
+ node, will receive the given attributes.
2615
+ */
2616
+ static node(e, n, o, i) {
2617
+ return new L(e, n, new ot(o, i));
2618
+ }
2619
+ /**
2620
+ The spec provided when creating this decoration. Can be useful
2621
+ if you've stored extra information in that object.
2622
+ */
2623
+ get spec() {
2624
+ return this.type.spec;
2625
+ }
2626
+ /**
2627
+ @internal
2628
+ */
2629
+ get inline() {
2630
+ return this.type instanceof Q;
2631
+ }
2632
+ /**
2633
+ @internal
2634
+ */
2635
+ get widget() {
2636
+ return this.type instanceof Pe;
2637
+ }
2638
+ }
2639
+ const de = [], oe = {};
2640
+ class C {
2641
+ /**
2642
+ @internal
2643
+ */
2644
+ constructor(e, n) {
2645
+ this.local = e.length ? e : de, this.children = n.length ? n : de;
2646
+ }
2647
+ /**
2648
+ Create a set of decorations, using the structure of the given
2649
+ document. This will consume (modify) the `decorations` array, so
2650
+ you must make a copy if you want need to preserve that.
2651
+ */
2652
+ static create(e, n) {
2653
+ return n.length ? Ae(n, e, 0, oe) : x;
2654
+ }
2655
+ /**
2656
+ Find all decorations in this set which touch the given range
2657
+ (including decorations that start or end directly at the
2658
+ boundaries) and match the given predicate on their spec. When
2659
+ `start` and `end` are omitted, all decorations in the set are
2660
+ considered. When `predicate` isn't given, all decorations are
2661
+ assumed to match.
2662
+ */
2663
+ find(e, n, o) {
2664
+ let i = [];
2665
+ return this.findInner(e ?? 0, n ?? 1e9, i, 0, o), i;
2666
+ }
2667
+ findInner(e, n, o, i, s) {
2668
+ for (let r = 0; r < this.local.length; r++) {
2669
+ let l = this.local[r];
2670
+ l.from <= n && l.to >= e && (!s || s(l.spec)) && o.push(l.copy(l.from + i, l.to + i));
2671
+ }
2672
+ for (let r = 0; r < this.children.length; r += 3)
2673
+ if (this.children[r] < n && this.children[r + 1] > e) {
2674
+ let l = this.children[r] + 1;
2675
+ this.children[r + 2].findInner(e - l, n - l, o, i + l, s);
2676
+ }
2677
+ }
2678
+ /**
2679
+ Map the set of decorations in response to a change in the
2680
+ document.
2681
+ */
2682
+ map(e, n, o) {
2683
+ return this == x || e.maps.length == 0 ? this : this.mapInner(e, n, 0, 0, o || oe);
2684
+ }
2685
+ /**
2686
+ @internal
2687
+ */
2688
+ mapInner(e, n, o, i, s) {
2689
+ let r;
2690
+ for (let l = 0; l < this.local.length; l++) {
2691
+ let a = this.local[l].map(e, o, i);
2692
+ a && a.type.valid(n, a) ? (r || (r = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
2693
+ }
2694
+ return this.children.length ? Wo(this.children, r || [], e, n, o, i, s) : r ? new C(r.sort(ie), de) : x;
2695
+ }
2696
+ /**
2697
+ Add the given array of decorations to the ones in the set,
2698
+ producing a new set. Consumes the `decorations` array. Needs
2699
+ access to the current document to create the appropriate tree
2700
+ structure.
2701
+ */
2702
+ add(e, n) {
2703
+ return n.length ? this == x ? C.create(e, n) : this.addInner(e, n, 0) : this;
2704
+ }
2705
+ addInner(e, n, o) {
2706
+ let i, s = 0;
2707
+ e.forEach((l, a) => {
2708
+ let c = a + o, d;
2709
+ if (d = bn(n, l, c)) {
2710
+ for (i || (i = this.children.slice()); s < i.length && i[s] < a; )
2711
+ s += 3;
2712
+ i[s] == a ? i[s + 2] = i[s + 2].addInner(l, d, c + 1) : i.splice(s, 0, a, a + l.nodeSize, Ae(d, l, c + 1, oe)), s += 3;
2713
+ }
2714
+ });
2715
+ let r = yn(s ? Dn(n) : n, -o);
2716
+ for (let l = 0; l < r.length; l++)
2717
+ r[l].type.valid(e, r[l]) || r.splice(l--, 1);
2718
+ return new C(r.length ? this.local.concat(r).sort(ie) : this.local, i || this.children);
2719
+ }
2720
+ /**
2721
+ Create a new set that contains the decorations in this set, minus
2722
+ the ones in the given array.
2723
+ */
2724
+ remove(e) {
2725
+ return e.length == 0 || this == x ? this : this.removeInner(e, 0);
2726
+ }
2727
+ removeInner(e, n) {
2728
+ let o = this.children, i = this.local;
2729
+ for (let s = 0; s < o.length; s += 3) {
2730
+ let r, l = o[s] + n, a = o[s + 1] + n;
2731
+ for (let d = 0, f; d < e.length; d++)
2732
+ (f = e[d]) && f.from > l && f.to < a && (e[d] = null, (r || (r = [])).push(f));
2733
+ if (!r)
2734
+ continue;
2735
+ o == this.children && (o = this.children.slice());
2736
+ let c = o[s + 2].removeInner(r, l + 1);
2737
+ c != x ? o[s + 2] = c : (o.splice(s, 3), s -= 3);
2738
+ }
2739
+ if (i.length) {
2740
+ for (let s = 0, r; s < e.length; s++)
2741
+ if (r = e[s])
2742
+ for (let l = 0; l < i.length; l++)
2743
+ i[l].eq(r, n) && (i == this.local && (i = this.local.slice()), i.splice(l--, 1));
2744
+ }
2745
+ return o == this.children && i == this.local ? this : i.length || o.length ? new C(i, o) : x;
2746
+ }
2747
+ forChild(e, n) {
2748
+ if (this == x)
2749
+ return this;
2750
+ if (n.isLeaf)
2751
+ return C.empty;
2752
+ let o, i;
2753
+ for (let l = 0; l < this.children.length; l += 3)
2754
+ if (this.children[l] >= e) {
2755
+ this.children[l] == e && (o = this.children[l + 2]);
2756
+ break;
2757
+ }
2758
+ let s = e + 1, r = s + n.content.size;
2759
+ for (let l = 0; l < this.local.length; l++) {
2760
+ let a = this.local[l];
2761
+ if (a.from < r && a.to > s && a.type instanceof Q) {
2762
+ let c = Math.max(s, a.from) - s, d = Math.min(r, a.to) - s;
2763
+ c < d && (i || (i = [])).push(a.copy(c, d));
2764
+ }
2765
+ }
2766
+ if (i) {
2767
+ let l = new C(i.sort(ie), de);
2768
+ return o ? new G([l, o]) : l;
2769
+ }
2770
+ return o || x;
2771
+ }
2772
+ /**
2773
+ @internal
2774
+ */
2775
+ eq(e) {
2776
+ if (this == e)
2777
+ return !0;
2778
+ if (!(e instanceof C) || this.local.length != e.local.length || this.children.length != e.children.length)
2779
+ return !1;
2780
+ for (let n = 0; n < this.local.length; n++)
2781
+ if (!this.local[n].eq(e.local[n]))
2782
+ return !1;
2783
+ for (let n = 0; n < this.children.length; n += 3)
2784
+ if (this.children[n] != e.children[n] || this.children[n + 1] != e.children[n + 1] || !this.children[n + 2].eq(e.children[n + 2]))
2785
+ return !1;
2786
+ return !0;
2787
+ }
2788
+ /**
2789
+ @internal
2790
+ */
2791
+ locals(e) {
2792
+ return it(this.localsInner(e));
2793
+ }
2794
+ /**
2795
+ @internal
2796
+ */
2797
+ localsInner(e) {
2798
+ if (this == x)
2799
+ return de;
2800
+ if (e.inlineContent || !this.local.some(Q.is))
2801
+ return this.local;
2802
+ let n = [];
2803
+ for (let o = 0; o < this.local.length; o++)
2804
+ this.local[o].type instanceof Q || n.push(this.local[o]);
2805
+ return n;
2806
+ }
2807
+ forEachSet(e) {
2808
+ e(this);
2809
+ }
2810
+ }
2811
+ C.empty = new C([], []);
2812
+ C.removeOverlap = it;
2813
+ const x = C.empty;
2814
+ class G {
2815
+ constructor(e) {
2816
+ this.members = e;
2817
+ }
2818
+ map(e, n) {
2819
+ const o = this.members.map((i) => i.map(e, n, oe));
2820
+ return G.from(o);
2821
+ }
2822
+ forChild(e, n) {
2823
+ if (n.isLeaf)
2824
+ return C.empty;
2825
+ let o = [];
2826
+ for (let i = 0; i < this.members.length; i++) {
2827
+ let s = this.members[i].forChild(e, n);
2828
+ s != x && (s instanceof G ? o = o.concat(s.members) : o.push(s));
2829
+ }
2830
+ return G.from(o);
2831
+ }
2832
+ eq(e) {
2833
+ if (!(e instanceof G) || e.members.length != this.members.length)
2834
+ return !1;
2835
+ for (let n = 0; n < this.members.length; n++)
2836
+ if (!this.members[n].eq(e.members[n]))
2837
+ return !1;
2838
+ return !0;
2839
+ }
2840
+ locals(e) {
2841
+ let n, o = !0;
2842
+ for (let i = 0; i < this.members.length; i++) {
2843
+ let s = this.members[i].localsInner(e);
2844
+ if (s.length)
2845
+ if (!n)
2846
+ n = s;
2847
+ else {
2848
+ o && (n = n.slice(), o = !1);
2849
+ for (let r = 0; r < s.length; r++)
2850
+ n.push(s[r]);
2851
+ }
2852
+ }
2853
+ return n ? it(o ? n : n.sort(ie)) : de;
2854
+ }
2855
+ // Create a group for the given array of decoration sets, or return
2856
+ // a single set when possible.
2857
+ static from(e) {
2858
+ switch (e.length) {
2859
+ case 0:
2860
+ return x;
2861
+ case 1:
2862
+ return e[0];
2863
+ default:
2864
+ return new G(e.every((n) => n instanceof C) ? e : e.reduce((n, o) => n.concat(o instanceof C ? o : o.members), []));
2865
+ }
2866
+ }
2867
+ forEachSet(e) {
2868
+ for (let n = 0; n < this.members.length; n++)
2869
+ this.members[n].forEachSet(e);
2870
+ }
2871
+ }
2872
+ function Wo(t, e, n, o, i, s, r) {
2873
+ let l = t.slice();
2874
+ for (let c = 0, d = s; c < n.maps.length; c++) {
2875
+ let f = 0;
2876
+ n.maps[c].forEach((u, p, h, g) => {
2877
+ let m = g - h - (p - u);
2878
+ for (let y = 0; y < l.length; y += 3) {
2879
+ let F = l[y + 1];
2880
+ if (F < 0 || u > F + d - f)
2881
+ continue;
2882
+ let z = l[y] + d - f;
2883
+ p >= z ? l[y + 1] = u <= z ? -2 : -1 : u >= d && m && (l[y] += m, l[y + 1] += m);
2884
+ }
2885
+ f += m;
2886
+ }), d = n.maps[c].map(d, -1);
2887
+ }
2888
+ let a = !1;
2889
+ for (let c = 0; c < l.length; c += 3)
2890
+ if (l[c + 1] < 0) {
2891
+ if (l[c + 1] == -2) {
2892
+ a = !0, l[c + 1] = -1;
2893
+ continue;
2894
+ }
2895
+ let d = n.map(t[c] + s), f = d - i;
2896
+ if (f < 0 || f >= o.content.size) {
2897
+ a = !0;
2898
+ continue;
2899
+ }
2900
+ let u = n.map(t[c + 1] + s, -1), p = u - i, { index: h, offset: g } = o.content.findIndex(f), m = o.maybeChild(h);
2901
+ if (m && g == f && g + m.nodeSize == p) {
2902
+ let y = l[c + 2].mapInner(n, m, d + 1, t[c] + s + 1, r);
2903
+ y != x ? (l[c] = f, l[c + 1] = p, l[c + 2] = y) : (l[c + 1] = -2, a = !0);
2904
+ } else
2905
+ a = !0;
2906
+ }
2907
+ if (a) {
2908
+ let c = _o(l, t, e, n, i, s, r), d = Ae(c, o, 0, r);
2909
+ e = d.local;
2910
+ for (let f = 0; f < l.length; f += 3)
2911
+ l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
2912
+ for (let f = 0, u = 0; f < d.children.length; f += 3) {
2913
+ let p = d.children[f];
2914
+ for (; u < l.length && l[u] < p; )
2915
+ u += 3;
2916
+ l.splice(u, 0, d.children[f], d.children[f + 1], d.children[f + 2]);
2917
+ }
2918
+ }
2919
+ return new C(e.sort(ie), l);
2920
+ }
2921
+ function yn(t, e) {
2922
+ if (!e || !t.length)
2923
+ return t;
2924
+ let n = [];
2925
+ for (let o = 0; o < t.length; o++) {
2926
+ let i = t[o];
2927
+ n.push(new L(i.from + e, i.to + e, i.type));
2928
+ }
2929
+ return n;
2930
+ }
2931
+ function _o(t, e, n, o, i, s, r) {
2932
+ function l(a, c) {
2933
+ for (let d = 0; d < a.local.length; d++) {
2934
+ let f = a.local[d].map(o, i, c);
2935
+ f ? n.push(f) : r.onRemove && r.onRemove(a.local[d].spec);
2936
+ }
2937
+ for (let d = 0; d < a.children.length; d += 3)
2938
+ l(a.children[d + 2], a.children[d] + c + 1);
2939
+ }
2940
+ for (let a = 0; a < t.length; a += 3)
2941
+ t[a + 1] == -1 && l(t[a + 2], e[a] + s + 1);
2942
+ return n;
2943
+ }
2944
+ function bn(t, e, n) {
2945
+ if (e.isLeaf)
2946
+ return null;
2947
+ let o = n + e.nodeSize, i = null;
2948
+ for (let s = 0, r; s < t.length; s++)
2949
+ (r = t[s]) && r.from > n && r.to < o && ((i || (i = [])).push(r), t[s] = null);
2950
+ return i;
2951
+ }
2952
+ function Dn(t) {
2953
+ let e = [];
2954
+ for (let n = 0; n < t.length; n++)
2955
+ t[n] != null && e.push(t[n]);
2956
+ return e;
2957
+ }
2958
+ function Ae(t, e, n, o) {
2959
+ let i = [], s = !1;
2960
+ e.forEach((l, a) => {
2961
+ let c = bn(t, l, a + n);
2962
+ if (c) {
2963
+ s = !0;
2964
+ let d = Ae(c, l, n + a + 1, o);
2965
+ d != x && i.push(a, a + l.nodeSize, d);
2966
+ }
2967
+ });
2968
+ let r = yn(s ? Dn(t) : t, -n).sort(ie);
2969
+ for (let l = 0; l < r.length; l++)
2970
+ r[l].type.valid(e, r[l]) || (o.onRemove && o.onRemove(r[l].spec), r.splice(l--, 1));
2971
+ return r.length || i.length ? new C(r, i) : x;
2972
+ }
2973
+ function ie(t, e) {
2974
+ return t.from - e.from || t.to - e.to;
2975
+ }
2976
+ function it(t) {
2977
+ let e = t;
2978
+ for (let n = 0; n < e.length - 1; n++) {
2979
+ let o = e[n];
2980
+ if (o.from != o.to)
2981
+ for (let i = n + 1; i < e.length; i++) {
2982
+ let s = e[i];
2983
+ if (s.from == o.from) {
2984
+ s.to != o.to && (e == t && (e = t.slice()), e[i] = s.copy(s.from, o.to), Tt(e, i + 1, s.copy(o.to, s.to)));
2985
+ continue;
2986
+ } else {
2987
+ s.from < o.to && (e == t && (e = t.slice()), e[n] = o.copy(o.from, s.from), Tt(e, i, o.copy(s.from, o.to)));
2988
+ break;
2989
+ }
2990
+ }
2991
+ }
2992
+ return e;
2993
+ }
2994
+ function Tt(t, e, n) {
2995
+ for (; e < t.length && ie(n, t[e]) > 0; )
2996
+ e++;
2997
+ t.splice(e, 0, n);
2998
+ }
2999
+ function $e(t) {
3000
+ let e = [];
3001
+ return t.someProp("decorations", (n) => {
3002
+ let o = n(t.state);
3003
+ o && o != x && e.push(o);
3004
+ }), t.cursorWrapper && e.push(C.create(t.state.doc, [t.cursorWrapper.deco])), G.from(e);
3005
+ }
3006
+ const jo = {
3007
+ childList: !0,
3008
+ characterData: !0,
3009
+ characterDataOldValue: !0,
3010
+ attributes: !0,
3011
+ attributeOldValue: !0,
3012
+ subtree: !0
3013
+ }, Uo = A && J <= 11;
3014
+ class Yo {
3015
+ constructor() {
3016
+ this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
3017
+ }
3018
+ set(e) {
3019
+ this.anchorNode = e.anchorNode, this.anchorOffset = e.anchorOffset, this.focusNode = e.focusNode, this.focusOffset = e.focusOffset;
3020
+ }
3021
+ clear() {
3022
+ this.anchorNode = this.focusNode = null;
3023
+ }
3024
+ eq(e) {
3025
+ return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
3026
+ }
3027
+ }
3028
+ class Go {
3029
+ constructor(e, n) {
3030
+ this.view = e, this.handleDOMChange = n, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Yo(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
3031
+ for (let i = 0; i < o.length; i++)
3032
+ this.queue.push(o[i]);
3033
+ A && J <= 11 && o.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : M && e.composing && o.some((i) => i.type == "childList" && i.target.nodeName == "TR") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();
3034
+ }), Uo && (this.onCharData = (o) => {
3035
+ this.queue.push({ target: o.target, type: "characterData", oldValue: o.prevValue }), this.flushSoon();
3036
+ }), this.onSelectionChange = this.onSelectionChange.bind(this);
3037
+ }
3038
+ flushSoon() {
3039
+ this.flushingSoon < 0 && (this.flushingSoon = window.setTimeout(() => {
3040
+ this.flushingSoon = -1, this.flush();
3041
+ }, 20));
3042
+ }
3043
+ forceFlush() {
3044
+ this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
3045
+ }
3046
+ start() {
3047
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, jo)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
3048
+ }
3049
+ stop() {
3050
+ if (this.observer) {
3051
+ let e = this.observer.takeRecords();
3052
+ if (e.length) {
3053
+ for (let n = 0; n < e.length; n++)
3054
+ this.queue.push(e[n]);
3055
+ window.setTimeout(() => this.flush(), 20);
3056
+ }
3057
+ this.observer.disconnect();
3058
+ }
3059
+ this.onCharData && this.view.dom.removeEventListener("DOMCharacterDataModified", this.onCharData), this.disconnectSelection();
3060
+ }
3061
+ connectSelection() {
3062
+ this.view.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange);
3063
+ }
3064
+ disconnectSelection() {
3065
+ this.view.dom.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange);
3066
+ }
3067
+ suppressSelectionUpdates() {
3068
+ this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
3069
+ }
3070
+ onSelectionChange() {
3071
+ if (Dt(this.view)) {
3072
+ if (this.suppressingSelectionUpdates)
3073
+ return _(this.view);
3074
+ if (A && J <= 11 && !this.view.state.selection.empty) {
3075
+ let e = this.view.domSelectionRange();
3076
+ if (e.focusNode && re(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
3077
+ return this.flushSoon();
3078
+ }
3079
+ this.flush();
3080
+ }
3081
+ }
3082
+ setCurSelection() {
3083
+ this.currentSelection.set(this.view.domSelectionRange());
3084
+ }
3085
+ ignoreSelectionChange(e) {
3086
+ if (!e.focusNode)
3087
+ return !0;
3088
+ let n = /* @__PURE__ */ new Set(), o;
3089
+ for (let s = e.focusNode; s; s = he(s))
3090
+ n.add(s);
3091
+ for (let s = e.anchorNode; s; s = he(s))
3092
+ if (n.has(s)) {
3093
+ o = s;
3094
+ break;
3095
+ }
3096
+ let i = o && this.view.docView.nearestDesc(o);
3097
+ if (i && i.ignoreMutation({
3098
+ type: "selection",
3099
+ target: o.nodeType == 3 ? o.parentNode : o
3100
+ }))
3101
+ return this.setCurSelection(), !0;
3102
+ }
3103
+ pendingRecords() {
3104
+ if (this.observer)
3105
+ for (let e of this.observer.takeRecords())
3106
+ this.queue.push(e);
3107
+ return this.queue;
3108
+ }
3109
+ flush() {
3110
+ let { view: e } = this;
3111
+ if (!e.docView || this.flushingSoon > -1)
3112
+ return;
3113
+ let n = this.pendingRecords();
3114
+ n.length && (this.queue = []);
3115
+ let o = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(o) && Dt(e) && !this.ignoreSelectionChange(o), s = -1, r = -1, l = !1, a = [];
3116
+ if (e.editable)
3117
+ for (let d = 0; d < n.length; d++) {
3118
+ let f = this.registerMutation(n[d], a);
3119
+ f && (s = s < 0 ? f.from : Math.min(f.from, s), r = r < 0 ? f.to : Math.max(f.to, r), f.typeOver && (l = !0));
3120
+ }
3121
+ if (a.some((d) => d.nodeName == "BR") && (e.input.lastKeyCode == 8 || e.input.lastKeyCode == 46)) {
3122
+ for (let d of a)
3123
+ if (d.nodeName == "BR" && d.parentNode) {
3124
+ let f = d.nextSibling;
3125
+ f && f.nodeType == 1 && f.contentEditable == "false" && d.parentNode.removeChild(d);
3126
+ }
3127
+ } else if (B && a.length) {
3128
+ let d = a.filter((f) => f.nodeName == "BR");
3129
+ if (d.length == 2) {
3130
+ let [f, u] = d;
3131
+ f.parentNode && f.parentNode.parentNode == u.parentNode ? u.remove() : f.remove();
3132
+ } else {
3133
+ let { focusNode: f } = this.currentSelection;
3134
+ for (let u of d) {
3135
+ let p = u.parentNode;
3136
+ p && p.nodeName == "LI" && (!f || Zo(e, f) != p) && u.remove();
3137
+ }
3138
+ }
3139
+ }
3140
+ let c = null;
3141
+ s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Re(o) && (c = Qe(e)) && c.eq(be.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, _(e), this.currentSelection.set(o), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, r), Xo(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, Qo(e, a)), this.handleDOMChange(s, r, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(o) || _(e), this.currentSelection.set(o));
3142
+ }
3143
+ registerMutation(e, n) {
3144
+ if (n.indexOf(e.target) > -1)
3145
+ return null;
3146
+ let o = this.view.docView.nearestDesc(e.target);
3147
+ if (e.type == "attributes" && (o == this.view.docView || e.attributeName == "contenteditable" || // Firefox sometimes fires spurious events for null/empty styles
3148
+ e.attributeName == "style" && !e.oldValue && !e.target.getAttribute("style")) || !o || o.ignoreMutation(e))
3149
+ return null;
3150
+ if (e.type == "childList") {
3151
+ for (let d = 0; d < e.addedNodes.length; d++) {
3152
+ let f = e.addedNodes[d];
3153
+ n.push(f), f.nodeType == 3 && (this.lastChangedTextNode = f);
3154
+ }
3155
+ if (o.contentDOM && o.contentDOM != o.dom && !o.contentDOM.contains(e.target))
3156
+ return { from: o.posBefore, to: o.posAfter };
3157
+ let i = e.previousSibling, s = e.nextSibling;
3158
+ if (A && J <= 11 && e.addedNodes.length)
3159
+ for (let d = 0; d < e.addedNodes.length; d++) {
3160
+ let { previousSibling: f, nextSibling: u } = e.addedNodes[d];
3161
+ (!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (i = f), (!u || Array.prototype.indexOf.call(e.addedNodes, u) < 0) && (s = u);
3162
+ }
3163
+ let r = i && i.parentNode == e.target ? S(i) + 1 : 0, l = o.localPosFromDOM(e.target, r, -1), a = s && s.parentNode == e.target ? S(s) : e.target.childNodes.length, c = o.localPosFromDOM(e.target, a, 1);
3164
+ return { from: l, to: c };
3165
+ } else return e.type == "attributes" ? { from: o.posAtStart - o.border, to: o.posAtEnd + o.border } : (this.lastChangedTextNode = e.target, {
3166
+ from: o.posAtStart,
3167
+ to: o.posAtEnd,
3168
+ // An event was generated for a text change that didn't change
3169
+ // any text. Mark the dom change to fall back to assuming the
3170
+ // selection was typed over with an identical value if it can't
3171
+ // find another change.
3172
+ typeOver: e.target.nodeValue == e.oldValue
3173
+ });
3174
+ }
3175
+ }
3176
+ let Et = /* @__PURE__ */ new WeakMap(), Pt = !1;
3177
+ function Xo(t) {
3178
+ if (!Et.has(t) && (Et.set(t, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace) !== -1)) {
3179
+ if (t.requiresGeckoHackNode = B, Pt)
3180
+ return;
3181
+ console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), Pt = !0;
3182
+ }
3183
+ }
3184
+ function At(t, e) {
3185
+ let n = e.startContainer, o = e.startOffset, i = e.endContainer, s = e.endOffset, r = t.domAtPos(t.state.selection.anchor);
3186
+ return re(r.node, r.offset, i, s) && ([n, o, i, s] = [i, s, n, o]), { anchorNode: n, anchorOffset: o, focusNode: i, focusOffset: s };
3187
+ }
3188
+ function Jo(t, e) {
3189
+ if (e.getComposedRanges) {
3190
+ let i = e.getComposedRanges(t.root)[0];
3191
+ if (i)
3192
+ return At(t, i);
3193
+ }
3194
+ let n;
3195
+ function o(i) {
3196
+ i.preventDefault(), i.stopImmediatePropagation(), n = i.getTargetRanges()[0];
3197
+ }
3198
+ return t.dom.addEventListener("beforeinput", o, !0), document.execCommand("indent"), t.dom.removeEventListener("beforeinput", o, !0), n ? At(t, n) : null;
3199
+ }
3200
+ function Zo(t, e) {
3201
+ for (let n = e.parentNode; n && n != t.dom; n = n.parentNode) {
3202
+ let o = t.docView.nearestDesc(n, !0);
3203
+ if (o && o.node.isBlock)
3204
+ return n;
3205
+ }
3206
+ return null;
3207
+ }
3208
+ function Qo(t, e) {
3209
+ var n;
3210
+ let { focusNode: o, focusOffset: i } = t.domSelectionRange();
3211
+ for (let s of e)
3212
+ if (((n = s.parentNode) === null || n === void 0 ? void 0 : n.nodeName) == "TR") {
3213
+ let r = s.nextSibling;
3214
+ for (; r && r.nodeName != "TD" && r.nodeName != "TH"; )
3215
+ r = r.nextSibling;
3216
+ if (r) {
3217
+ let l = r;
3218
+ for (; ; ) {
3219
+ let a = l.firstChild;
3220
+ if (!a || a.nodeType != 1 || a.contentEditable == "false" || /^(BR|IMG)$/.test(a.nodeName))
3221
+ break;
3222
+ l = a;
3223
+ }
3224
+ l.insertBefore(s, l.firstChild), o == s && t.domSelection().collapse(s, i);
3225
+ } else
3226
+ s.parentNode.removeChild(s);
3227
+ }
3228
+ }
3229
+ function wo(t, e, n) {
3230
+ let { node: o, fromOffset: i, toOffset: s, from: r, to: l } = t.docView.parseRange(e, n), a = t.domSelectionRange(), c, d = a.anchorNode;
3231
+ if (d && t.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Re(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), O && t.input.lastKeyCode === 8)
3232
+ for (let m = s; m > i; m--) {
3233
+ let y = o.childNodes[m - 1], F = y.pmViewDesc;
3234
+ if (y.nodeName == "BR" && !F) {
3235
+ s = m;
3236
+ break;
3237
+ }
3238
+ if (!F || F.size)
3239
+ break;
3240
+ }
3241
+ let f = t.state.doc, u = t.someProp("domParser") || $t.fromSchema(t.state.schema), p = f.resolve(r), h = null, g = u.parse(o, {
3242
+ topNode: p.parent,
3243
+ topMatch: p.parent.contentMatchAt(p.index()),
3244
+ topOpen: !0,
3245
+ from: i,
3246
+ to: s,
3247
+ preserveWhitespace: p.parent.type.whitespace == "pre" ? "full" : !0,
3248
+ findPositions: c,
3249
+ ruleFromNode: vo,
3250
+ context: p
3251
+ });
3252
+ if (c && c[0].pos != null) {
3253
+ let m = c[0].pos, y = c[1] && c[1].pos;
3254
+ y == null && (y = m), h = { anchor: m + r, head: y + r };
3255
+ }
3256
+ return { doc: g, sel: h, from: r, to: l };
3257
+ }
3258
+ function vo(t) {
3259
+ let e = t.pmViewDesc;
3260
+ if (e)
3261
+ return e.parseRule();
3262
+ if (t.nodeName == "BR" && t.parentNode) {
3263
+ if (M && /^(ul|ol)$/i.test(t.parentNode.nodeName)) {
3264
+ let n = document.createElement("div");
3265
+ return n.appendChild(document.createElement("li")), { skip: n };
3266
+ } else if (t.parentNode.lastChild == t || M && /^(tr|table)$/i.test(t.parentNode.nodeName))
3267
+ return { ignore: !0 };
3268
+ } else if (t.nodeName == "IMG" && t.getAttribute("mark-placeholder"))
3269
+ return { ignore: !0 };
3270
+ return null;
3271
+ }
3272
+ const ei = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
3273
+ function ti(t, e, n, o, i) {
3274
+ let s = t.input.compositionPendingChanges || (t.composing ? t.input.compositionID : 0);
3275
+ if (t.input.compositionPendingChanges = 0, e < 0) {
3276
+ let b = t.input.lastSelectionTime > Date.now() - 50 ? t.input.lastSelectionOrigin : null, N = Qe(t, b);
3277
+ if (N && !t.state.selection.eq(N)) {
3278
+ if (O && W && t.input.lastKeyCode === 13 && Date.now() - 100 < t.input.lastKeyCodeTime && t.someProp("handleKeyDown", (Nn) => Nn(t, ee(13, "Enter"))))
3279
+ return;
3280
+ let P = t.state.tr.setSelection(N);
3281
+ b == "pointer" ? P.setMeta("pointer", !0) : b == "key" && P.scrollIntoView(), s && P.setMeta("composition", s), t.dispatch(P);
3282
+ }
3283
+ return;
3284
+ }
3285
+ let r = t.state.doc.resolve(e), l = r.sharedDepth(n);
3286
+ e = r.before(l + 1), n = t.state.doc.resolve(n).after(l + 1);
3287
+ let a = t.state.selection, c = wo(t, e, n), d = t.state.doc, f = d.slice(c.from, c.to), u, p;
3288
+ t.input.lastKeyCode === 8 && Date.now() - 100 < t.input.lastKeyCodeTime ? (u = t.state.selection.to, p = "end") : (u = t.state.selection.from, p = "start"), t.input.lastKeyCode = null;
3289
+ let h = ii(f.content, c.doc.content, c.from, u, p);
3290
+ if (h && t.input.domChangeCount++, (ue && t.input.lastIOSEnter > Date.now() - 225 || W) && i.some((b) => b.nodeType == 1 && !ei.test(b.nodeName)) && (!h || h.endA >= h.endB) && t.someProp("handleKeyDown", (b) => b(t, ee(13, "Enter")))) {
3291
+ t.input.lastIOSEnter = 0;
3292
+ return;
3293
+ }
3294
+ if (!h)
3295
+ if (o && a instanceof k && !a.empty && a.$head.sameParent(a.$anchor) && !t.composing && !(c.sel && c.sel.anchor != c.sel.head))
3296
+ h = { start: a.from, endA: a.to, endB: a.to };
3297
+ else {
3298
+ if (c.sel) {
3299
+ let b = Vt(t, t.state.doc, c.sel);
3300
+ if (b && !b.eq(t.state.selection)) {
3301
+ let N = t.state.tr.setSelection(b);
3302
+ s && N.setMeta("composition", s), t.dispatch(N);
3303
+ }
3304
+ }
3305
+ return;
3306
+ }
3307
+ t.state.selection.from < t.state.selection.to && h.start == h.endB && t.state.selection instanceof k && (h.start > t.state.selection.from && h.start <= t.state.selection.from + 2 && t.state.selection.from >= c.from ? h.start = t.state.selection.from : h.endA < t.state.selection.to && h.endA >= t.state.selection.to - 2 && t.state.selection.to <= c.to && (h.endB += t.state.selection.to - h.endA, h.endA = t.state.selection.to)), A && J <= 11 && h.endB == h.start + 1 && h.endA == h.start && h.start > c.from && c.doc.textBetween(h.start - c.from - 1, h.start - c.from + 1) == "  " && (h.start--, h.endA--, h.endB--);
3308
+ let g = c.doc.resolveNoCache(h.start - c.from), m = c.doc.resolveNoCache(h.endB - c.from), y = d.resolve(h.start), F = g.sameParent(m) && g.parent.inlineContent && y.end() >= h.endA;
3309
+ if ((ue && t.input.lastIOSEnter > Date.now() - 225 && (!F || i.some((b) => b.nodeName == "DIV" || b.nodeName == "P")) || !F && g.pos < c.doc.content.size && (!g.sameParent(m) || !g.parent.inlineContent) && g.pos < m.pos && !/\S/.test(c.doc.textBetween(g.pos, m.pos, "", ""))) && t.someProp("handleKeyDown", (b) => b(t, ee(13, "Enter")))) {
3310
+ t.input.lastIOSEnter = 0;
3311
+ return;
3312
+ }
3313
+ if (t.state.selection.anchor > h.start && oi(d, h.start, h.endA, g, m) && t.someProp("handleKeyDown", (b) => b(t, ee(8, "Backspace")))) {
3314
+ W && O && t.domObserver.suppressSelectionUpdates();
3315
+ return;
3316
+ }
3317
+ O && h.endB == h.start && (t.input.lastChromeDelete = Date.now()), W && !F && g.start() != m.start() && m.parentOffset == 0 && g.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == h.endA && (h.endB -= 2, m = c.doc.resolveNoCache(h.endB - c.from), setTimeout(() => {
3318
+ t.someProp("handleKeyDown", function(b) {
3319
+ return b(t, ee(13, "Enter"));
3320
+ });
3321
+ }, 20));
3322
+ let z = h.start, v = h.endA, pe = (b) => {
3323
+ let N = b || t.state.tr.replace(z, v, c.doc.slice(h.start - c.from, h.endB - c.from));
3324
+ if (c.sel) {
3325
+ let P = Vt(t, N.doc, c.sel);
3326
+ P && !(O && t.composing && P.empty && (h.start != h.endB || t.input.lastChromeDelete < Date.now() - 100) && (P.head == z || P.head == N.mapping.map(v) - 1) || A && P.empty && P.head == z) && N.setSelection(P);
3327
+ }
3328
+ return s && N.setMeta("composition", s), N.scrollIntoView();
3329
+ }, Me;
3330
+ if (F)
3331
+ if (g.pos == m.pos) {
3332
+ A && J <= 11 && g.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => _(t), 20));
3333
+ let b = pe(t.state.tr.delete(z, v)), N = d.resolve(h.start).marksAcross(d.resolve(h.endA));
3334
+ N && b.ensureMarks(N), t.dispatch(b);
3335
+ } else if (
3336
+ // Adding or removing a mark
3337
+ h.endA == h.endB && (Me = ni(g.parent.content.cut(g.parentOffset, m.parentOffset), y.parent.content.cut(y.parentOffset, h.endA - y.start())))
3338
+ ) {
3339
+ let b = pe(t.state.tr);
3340
+ Me.type == "add" ? b.addMark(z, v, Me.mark) : b.removeMark(z, v, Me.mark), t.dispatch(b);
3341
+ } else if (g.parent.child(g.index()).isText && g.index() == m.index() - (m.textOffset ? 0 : 1)) {
3342
+ let b = g.parent.textBetween(g.parentOffset, m.parentOffset), N = () => pe(t.state.tr.insertText(b, z, v));
3343
+ t.someProp("handleTextInput", (P) => P(t, z, v, b, N)) || t.dispatch(N());
3344
+ } else
3345
+ t.dispatch(pe());
3346
+ else
3347
+ t.dispatch(pe());
3348
+ }
3349
+ function Vt(t, e, n) {
3350
+ return Math.max(n.anchor, n.head) > e.content.size ? null : we(t, e.resolve(n.anchor), e.resolve(n.head));
3351
+ }
3352
+ function ni(t, e) {
3353
+ let n = t.firstChild.marks, o = e.firstChild.marks, i = n, s = o, r, l, a;
3354
+ for (let d = 0; d < o.length; d++)
3355
+ i = o[d].removeFromSet(i);
3356
+ for (let d = 0; d < n.length; d++)
3357
+ s = n[d].removeFromSet(s);
3358
+ if (i.length == 1 && s.length == 0)
3359
+ l = i[0], r = "add", a = (d) => d.mark(l.addToSet(d.marks));
3360
+ else if (i.length == 0 && s.length == 1)
3361
+ l = s[0], r = "remove", a = (d) => d.mark(l.removeFromSet(d.marks));
3362
+ else
3363
+ return null;
3364
+ let c = [];
3365
+ for (let d = 0; d < e.childCount; d++)
3366
+ c.push(a(e.child(d)));
3367
+ if (j.from(c).eq(t))
3368
+ return { mark: l, type: r };
3369
+ }
3370
+ function oi(t, e, n, o, i) {
3371
+ if (
3372
+ // The content must have shrunk
3373
+ n - e <= i.pos - o.pos || // newEnd must point directly at or after the end of the block that newStart points into
3374
+ Ke(o, !0, !1) < i.pos
3375
+ )
3376
+ return !1;
3377
+ let s = t.resolve(e);
3378
+ if (!o.parent.isTextblock) {
3379
+ let l = s.nodeAfter;
3380
+ return l != null && n == e + l.nodeSize;
3381
+ }
3382
+ if (s.parentOffset < s.parent.content.size || !s.parent.isTextblock)
3383
+ return !1;
3384
+ let r = t.resolve(Ke(s, !0, !0));
3385
+ return !r.parent.isTextblock || r.pos > n || Ke(r, !0, !1) < n ? !1 : o.parent.content.cut(o.parentOffset).eq(r.parent.content);
3386
+ }
3387
+ function Ke(t, e, n) {
3388
+ let o = t.depth, i = e ? t.end() : t.pos;
3389
+ for (; o > 0 && (e || t.indexAfter(o) == t.node(o).childCount); )
3390
+ o--, i++, e = !1;
3391
+ if (n) {
3392
+ let s = t.node(o).maybeChild(t.indexAfter(o));
3393
+ for (; s && !s.isLeaf; )
3394
+ s = s.firstChild, i++;
3395
+ }
3396
+ return i;
3397
+ }
3398
+ function ii(t, e, n, o, i) {
3399
+ let s = t.findDiffStart(e, n);
3400
+ if (s == null)
3401
+ return null;
3402
+ let { a: r, b: l } = t.findDiffEnd(e, n + t.size, n + e.size);
3403
+ if (i == "end") {
3404
+ let a = Math.max(0, s - Math.min(r, l));
3405
+ o -= r + a - s;
3406
+ }
3407
+ if (r < s && t.size < e.size) {
3408
+ let a = o <= s && o >= r ? s - o : 0;
3409
+ s -= a, s && s < e.size && Rt(e.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), l = s + (l - r), r = s;
3410
+ } else if (l < s) {
3411
+ let a = o <= s && o >= l ? s - o : 0;
3412
+ s -= a, s && s < t.size && Rt(t.textBetween(s - 1, s + 1)) && (s += a ? 1 : -1), r = s + (r - l), l = s;
3413
+ }
3414
+ return { start: s, endA: r, endB: l };
3415
+ }
3416
+ function Rt(t) {
3417
+ if (t.length != 2)
3418
+ return !1;
3419
+ let e = t.charCodeAt(0), n = t.charCodeAt(1);
3420
+ return e >= 56320 && e <= 57343 && n >= 55296 && n <= 56319;
3421
+ }
3422
+ class si {
3423
+ /**
3424
+ Create a view. `place` may be a DOM node that the editor should
3425
+ be appended to, a function that will place it into the document,
3426
+ or an object whose `mount` property holds the node to use as the
3427
+ document container. If it is `null`, the editor will not be
3428
+ added to the document.
3429
+ */
3430
+ constructor(e, n) {
3431
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new No(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = n, this.state = n.state, this.directPlugins = n.plugins || [], this.directPlugins.forEach(Lt), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Ft(this), It(this), this.nodeViews = zt(this), this.docView = ut(this.state.doc, Bt(this), $e(this), this.dom, this), this.domObserver = new Go(this, (o, i, s, r) => ti(this, o, i, s, r)), this.domObserver.start(), Co(this), this.updatePluginViews();
3432
+ }
3433
+ /**
3434
+ Holds `true` when a
3435
+ [composition](https://w3c.github.io/uievents/#events-compositionevents)
3436
+ is active.
3437
+ */
3438
+ get composing() {
3439
+ return this.input.composing;
3440
+ }
3441
+ /**
3442
+ The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).
3443
+ */
3444
+ get props() {
3445
+ if (this._props.state != this.state) {
3446
+ let e = this._props;
3447
+ this._props = {};
3448
+ for (let n in e)
3449
+ this._props[n] = e[n];
3450
+ this._props.state = this.state;
3451
+ }
3452
+ return this._props;
3453
+ }
3454
+ /**
3455
+ Update the view's props. Will immediately cause an update to
3456
+ the DOM.
3457
+ */
3458
+ update(e) {
3459
+ e.handleDOMEvents != this._props.handleDOMEvents && Je(this);
3460
+ let n = this._props;
3461
+ this._props = e, e.plugins && (e.plugins.forEach(Lt), this.directPlugins = e.plugins), this.updateStateInner(e.state, n);
3462
+ }
3463
+ /**
3464
+ Update the view by updating existing props object with the object
3465
+ given as argument. Equivalent to `view.update(Object.assign({},
3466
+ view.props, props))`.
3467
+ */
3468
+ setProps(e) {
3469
+ let n = {};
3470
+ for (let o in this._props)
3471
+ n[o] = this._props[o];
3472
+ n.state = this.state;
3473
+ for (let o in e)
3474
+ n[o] = e[o];
3475
+ this.update(n);
3476
+ }
3477
+ /**
3478
+ Update the editor's `state` prop, without touching any of the
3479
+ other props.
3480
+ */
3481
+ updateState(e) {
3482
+ this.updateStateInner(e, this._props);
3483
+ }
3484
+ updateStateInner(e, n) {
3485
+ var o;
3486
+ let i = this.state, s = !1, r = !1;
3487
+ e.storedMarks && this.composing && (un(this), r = !0), this.state = e;
3488
+ let l = i.plugins != e.plugins || this._props.plugins != n.plugins;
3489
+ if (l || this._props.plugins != n.plugins || this._props.nodeViews != n.nodeViews) {
3490
+ let p = zt(this);
3491
+ li(p, this.nodeViews) && (this.nodeViews = p, s = !0);
3492
+ }
3493
+ (l || n.handleDOMEvents != this._props.handleDOMEvents) && Je(this), this.editable = Ft(this), It(this);
3494
+ let a = $e(this), c = Bt(this), d = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", f = s || !this.docView.matchesNode(e.doc, c, a);
3495
+ (f || !e.selection.eq(i.selection)) && (r = !0);
3496
+ let u = d == "preserve" && r && this.dom.style.overflowAnchor == null && In(this);
3497
+ if (r) {
3498
+ this.domObserver.stop();
3499
+ let p = f && (A || O) && !this.composing && !i.selection.empty && !e.selection.empty && ri(i.selection, e.selection);
3500
+ if (f) {
3501
+ let h = O ? this.trackWrites = this.domSelectionRange().focusNode : null;
3502
+ this.composing && (this.input.compositionNode = Fo(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ut(e.doc, c, a, this.dom, this)), h && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (p = !0);
3503
+ }
3504
+ p || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && io(this)) ? _(this, p) : (en(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
3505
+ }
3506
+ this.updatePluginViews(i), !((o = this.dragging) === null || o === void 0) && o.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : u && Fn(u);
3507
+ }
3508
+ /**
3509
+ @internal
3510
+ */
3511
+ scrollToSelection() {
3512
+ let e = this.domSelectionRange().focusNode;
3513
+ if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
3514
+ if (!this.someProp("handleScrollToSelection", (n) => n(this))) if (this.state.selection instanceof D) {
3515
+ let n = this.docView.domAfterPos(this.state.selection.from);
3516
+ n.nodeType == 1 && lt(this, n.getBoundingClientRect(), e);
3517
+ } else
3518
+ lt(this, this.coordsAtPos(this.state.selection.head, 1), e);
3519
+ }
3520
+ }
3521
+ destroyPluginViews() {
3522
+ let e;
3523
+ for (; e = this.pluginViews.pop(); )
3524
+ e.destroy && e.destroy();
3525
+ }
3526
+ updatePluginViews(e) {
3527
+ if (!e || e.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {
3528
+ this.prevDirectPlugins = this.directPlugins, this.destroyPluginViews();
3529
+ for (let n = 0; n < this.directPlugins.length; n++) {
3530
+ let o = this.directPlugins[n];
3531
+ o.spec.view && this.pluginViews.push(o.spec.view(this));
3532
+ }
3533
+ for (let n = 0; n < this.state.plugins.length; n++) {
3534
+ let o = this.state.plugins[n];
3535
+ o.spec.view && this.pluginViews.push(o.spec.view(this));
3536
+ }
3537
+ } else
3538
+ for (let n = 0; n < this.pluginViews.length; n++) {
3539
+ let o = this.pluginViews[n];
3540
+ o.update && o.update(this, e);
3541
+ }
3542
+ }
3543
+ updateDraggedNode(e, n) {
3544
+ let o = e.node, i = -1;
3545
+ if (this.state.doc.nodeAt(o.from) == o.node)
3546
+ i = o.from;
3547
+ else {
3548
+ let s = o.from + (this.state.doc.content.size - n.doc.content.size);
3549
+ (s > 0 && this.state.doc.nodeAt(s)) == o.node && (i = s);
3550
+ }
3551
+ this.dragging = new mn(e.slice, e.move, i < 0 ? void 0 : D.create(this.state.doc, i));
3552
+ }
3553
+ someProp(e, n) {
3554
+ let o = this._props && this._props[e], i;
3555
+ if (o != null && (i = n ? n(o) : o))
3556
+ return i;
3557
+ for (let r = 0; r < this.directPlugins.length; r++) {
3558
+ let l = this.directPlugins[r].props[e];
3559
+ if (l != null && (i = n ? n(l) : l))
3560
+ return i;
3561
+ }
3562
+ let s = this.state.plugins;
3563
+ if (s)
3564
+ for (let r = 0; r < s.length; r++) {
3565
+ let l = s[r].props[e];
3566
+ if (l != null && (i = n ? n(l) : l))
3567
+ return i;
3568
+ }
3569
+ }
3570
+ /**
3571
+ Query whether the view has focus.
3572
+ */
3573
+ hasFocus() {
3574
+ if (A) {
3575
+ let e = this.root.activeElement;
3576
+ if (e == this.dom)
3577
+ return !0;
3578
+ if (!e || !this.dom.contains(e))
3579
+ return !1;
3580
+ for (; e && this.dom != e && this.dom.contains(e); ) {
3581
+ if (e.contentEditable == "false")
3582
+ return !1;
3583
+ e = e.parentElement;
3584
+ }
3585
+ return !0;
3586
+ }
3587
+ return this.root.activeElement == this.dom;
3588
+ }
3589
+ /**
3590
+ Focus the editor.
3591
+ */
3592
+ focus() {
3593
+ this.domObserver.stop(), this.editable && zn(this.dom), _(this), this.domObserver.start();
3594
+ }
3595
+ /**
3596
+ Get the document root in which the editor exists. This will
3597
+ usually be the top-level `document`, but might be a [shadow
3598
+ DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)
3599
+ root if the editor is inside one.
3600
+ */
3601
+ get root() {
3602
+ let e = this._root;
3603
+ if (e == null) {
3604
+ for (let n = this.dom.parentNode; n; n = n.parentNode)
3605
+ if (n.nodeType == 9 || n.nodeType == 11 && n.host)
3606
+ return n.getSelection || (Object.getPrototypeOf(n).getSelection = () => n.ownerDocument.getSelection()), this._root = n;
3607
+ }
3608
+ return e || document;
3609
+ }
3610
+ /**
3611
+ When an existing editor view is moved to a new document or
3612
+ shadow tree, call this to make it recompute its root.
3613
+ */
3614
+ updateRoot() {
3615
+ this._root = null;
3616
+ }
3617
+ /**
3618
+ Given a pair of viewport coordinates, return the document
3619
+ position that corresponds to them. May return null if the given
3620
+ coordinates aren't inside of the editor. When an object is
3621
+ returned, its `pos` property is the position nearest to the
3622
+ coordinates, and its `inside` property holds the position of the
3623
+ inner node that the position falls inside of, or -1 if it is at
3624
+ the top level, not in any node.
3625
+ */
3626
+ posAtCoords(e) {
3627
+ return Hn(this, e);
3628
+ }
3629
+ /**
3630
+ Returns the viewport rectangle at a given document position.
3631
+ `left` and `right` will be the same number, as this returns a
3632
+ flat cursor-ish rectangle. If the position is between two things
3633
+ that aren't directly adjacent, `side` determines which element
3634
+ is used. When < 0, the element before the position is used,
3635
+ otherwise the element after.
3636
+ */
3637
+ coordsAtPos(e, n = 1) {
3638
+ return Yt(this, e, n);
3639
+ }
3640
+ /**
3641
+ Find the DOM position that corresponds to the given document
3642
+ position. When `side` is negative, find the position as close as
3643
+ possible to the content before the position. When positive,
3644
+ prefer positions close to the content after the position. When
3645
+ zero, prefer as shallow a position as possible.
3646
+
3647
+ Note that you should **not** mutate the editor's internal DOM,
3648
+ only inspect it (and even that is usually not necessary).
3649
+ */
3650
+ domAtPos(e, n = 0) {
3651
+ return this.docView.domFromPos(e, n);
3652
+ }
3653
+ /**
3654
+ Find the DOM node that represents the document node after the
3655
+ given position. May return `null` when the position doesn't point
3656
+ in front of a node or if the node is inside an opaque node view.
3657
+
3658
+ This is intended to be able to call things like
3659
+ `getBoundingClientRect` on that DOM node. Do **not** mutate the
3660
+ editor DOM directly, or add styling this way, since that will be
3661
+ immediately overriden by the editor as it redraws the node.
3662
+ */
3663
+ nodeDOM(e) {
3664
+ let n = this.docView.descAt(e);
3665
+ return n ? n.nodeDOM : null;
3666
+ }
3667
+ /**
3668
+ Find the document position that corresponds to a given DOM
3669
+ position. (Whenever possible, it is preferable to inspect the
3670
+ document structure directly, rather than poking around in the
3671
+ DOM, but sometimes—for example when interpreting an event
3672
+ target—you don't have a choice.)
3673
+
3674
+ The `bias` parameter can be used to influence which side of a DOM
3675
+ node to use when the position is inside a leaf node.
3676
+ */
3677
+ posAtDOM(e, n, o = -1) {
3678
+ let i = this.docView.posFromDOM(e, n, o);
3679
+ if (i == null)
3680
+ throw new RangeError("DOM position not inside the editor");
3681
+ return i;
3682
+ }
3683
+ /**
3684
+ Find out whether the selection is at the end of a textblock when
3685
+ moving in a given direction. When, for example, given `"left"`,
3686
+ it will return true if moving left from the current cursor
3687
+ position would leave that position's parent textblock. Will apply
3688
+ to the view's current state by default, but it is possible to
3689
+ pass a different state.
3690
+ */
3691
+ endOfTextblock(e, n) {
3692
+ return Yn(this, n || this.state, e);
3693
+ }
3694
+ /**
3695
+ Run the editor's paste logic with the given HTML string. The
3696
+ `event`, if given, will be passed to the
3697
+ [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
3698
+ */
3699
+ pasteHTML(e, n) {
3700
+ return Ne(this, "", e, !1, n || new ClipboardEvent("paste"));
3701
+ }
3702
+ /**
3703
+ Run the editor's paste logic with the given plain-text input.
3704
+ */
3705
+ pasteText(e, n) {
3706
+ return Ne(this, e, null, !0, n || new ClipboardEvent("paste"));
3707
+ }
3708
+ /**
3709
+ Serialize the given slice as it would be if it was copied from
3710
+ this editor. Returns a DOM element that contains a
3711
+ representation of the slice as its children, a textual
3712
+ representation, and the transformed slice (which can be
3713
+ different from the given input due to hooks like
3714
+ [`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).
3715
+ */
3716
+ serializeForClipboard(e) {
3717
+ return ve(this, e);
3718
+ }
3719
+ /**
3720
+ Removes the editor from the DOM and destroys all [node
3721
+ views](https://prosemirror.net/docs/ref/#view.NodeView).
3722
+ */
3723
+ destroy() {
3724
+ this.docView && (So(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], $e(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, xn());
3725
+ }
3726
+ /**
3727
+ This is true when the view has been
3728
+ [destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be
3729
+ used anymore).
3730
+ */
3731
+ get isDestroyed() {
3732
+ return this.docView == null;
3733
+ }
3734
+ /**
3735
+ Used for testing.
3736
+ */
3737
+ dispatchEvent(e) {
3738
+ return xo(this, e);
3739
+ }
3740
+ /**
3741
+ @internal
3742
+ */
3743
+ domSelectionRange() {
3744
+ let e = this.domSelection();
3745
+ return e ? M && this.root.nodeType === 11 && Pn(this.dom.ownerDocument) == this.dom && Jo(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
3746
+ }
3747
+ /**
3748
+ @internal
3749
+ */
3750
+ domSelection() {
3751
+ return this.root.getSelection();
3752
+ }
3753
+ }
3754
+ si.prototype.dispatch = function(t) {
3755
+ let e = this._props.dispatchTransaction;
3756
+ e ? e.call(this, t) : this.updateState(this.state.apply(t));
3757
+ };
3758
+ function Bt(t) {
3759
+ let e = /* @__PURE__ */ Object.create(null);
3760
+ return e.class = "ProseMirror", e.contenteditable = String(t.editable), t.someProp("attributes", (n) => {
3761
+ if (typeof n == "function" && (n = n(t.state)), n)
3762
+ for (let o in n)
3763
+ o == "class" ? e.class += " " + n[o] : o == "style" ? e.style = (e.style ? e.style + ";" : "") + n[o] : !e[o] && o != "contenteditable" && o != "nodeName" && (e[o] = String(n[o]));
3764
+ }), e.translate || (e.translate = "no"), [L.node(0, t.state.doc.content.size, e)];
3765
+ }
3766
+ function It(t) {
3767
+ if (t.markCursor) {
3768
+ let e = document.createElement("img");
3769
+ e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), t.cursorWrapper = { dom: e, deco: L.widget(t.state.selection.from, e, { raw: !0, marks: t.markCursor }) };
3770
+ } else
3771
+ t.cursorWrapper = null;
3772
+ }
3773
+ function Ft(t) {
3774
+ return !t.someProp("editable", (e) => e(t.state) === !1);
3775
+ }
3776
+ function ri(t, e) {
3777
+ let n = Math.min(t.$anchor.sharedDepth(t.head), e.$anchor.sharedDepth(e.head));
3778
+ return t.$anchor.start(n) != e.$anchor.start(n);
3779
+ }
3780
+ function zt(t) {
3781
+ let e = /* @__PURE__ */ Object.create(null);
3782
+ function n(o) {
3783
+ for (let i in o)
3784
+ Object.prototype.hasOwnProperty.call(e, i) || (e[i] = o[i]);
3785
+ }
3786
+ return t.someProp("nodeViews", n), t.someProp("markViews", n), e;
3787
+ }
3788
+ function li(t, e) {
3789
+ let n = 0, o = 0;
3790
+ for (let i in t) {
3791
+ if (t[i] != e[i])
3792
+ return !0;
3793
+ n++;
3794
+ }
3795
+ for (let i in e)
3796
+ o++;
3797
+ return n != o;
3798
+ }
3799
+ function Lt(t) {
3800
+ if (t.spec.state || t.spec.filterTransaction || t.spec.appendTransaction)
3801
+ throw new RangeError("Plugins passed directly to the view must not have a state component");
3802
+ }
3803
+ export {
3804
+ L as Decoration,
3805
+ C as DecorationSet,
3806
+ si as EditorView
3807
+ };