@aquera/nile-elements 1.9.8 → 1.9.10

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 (285) hide show
  1. package/README.md +7 -0
  2. package/dist/{index-df196058.cjs.js → index-50880eb7.cjs.js} +2 -2
  3. package/dist/index-50880eb7.cjs.js.map +1 -0
  4. package/dist/index-6832c52b.cjs.js +2 -0
  5. package/dist/index-6832c52b.cjs.js.map +1 -0
  6. package/dist/index-747d1880.cjs.js +2 -0
  7. package/dist/index-747d1880.cjs.js.map +1 -0
  8. package/dist/{index-249de90a.esm.js → index-7b1c9857.esm.js} +1 -1
  9. package/dist/index-a487d8b4.esm.js +1 -0
  10. package/dist/index-ba47645d.esm.js +1 -0
  11. package/dist/index.cjs.js +1 -1
  12. package/dist/index.esm.js +1 -1
  13. package/dist/index.js +1589 -1277
  14. package/dist/katex-44476ab4.esm.js +1 -0
  15. package/dist/katex-f4186f87.cjs.js +2 -0
  16. package/dist/katex-f4186f87.cjs.js.map +1 -0
  17. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  18. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  19. package/dist/nile-checkbox/nile-checkbox.esm.js +1 -1
  20. package/dist/nile-color-picker/index.cjs.js +1 -1
  21. package/dist/nile-color-picker/index.esm.js +1 -1
  22. package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
  23. package/dist/nile-color-picker/nile-color-picker.cjs.js.map +1 -1
  24. package/dist/nile-color-picker/nile-color-picker.esm.js +1 -1
  25. package/dist/nile-combobox/index.cjs.js +1 -1
  26. package/dist/nile-combobox/index.esm.js +1 -1
  27. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  28. package/dist/nile-combobox/nile-combobox.esm.js +1 -1
  29. package/dist/nile-detail/index.cjs.js +1 -1
  30. package/dist/nile-detail/index.esm.js +1 -1
  31. package/dist/nile-detail/nile-detail.cjs.js +1 -1
  32. package/dist/nile-detail/nile-detail.esm.js +1 -1
  33. package/dist/nile-nav-tab/nile-nav-tab.cjs.js +1 -1
  34. package/dist/nile-nav-tab/nile-nav-tab.cjs.js.map +1 -1
  35. package/dist/nile-nav-tab/nile-nav-tab.css.cjs.js +1 -1
  36. package/dist/nile-nav-tab/nile-nav-tab.css.cjs.js.map +1 -1
  37. package/dist/nile-nav-tab/nile-nav-tab.css.esm.js +11 -0
  38. package/dist/nile-nav-tab/nile-nav-tab.esm.js +1 -1
  39. package/dist/nile-nav-tab-group/nile-nav-tab-group.css.cjs.js +1 -1
  40. package/dist/nile-nav-tab-group/nile-nav-tab-group.css.cjs.js.map +1 -1
  41. package/dist/nile-nav-tab-group/nile-nav-tab-group.css.esm.js +1 -2
  42. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +1 -1
  43. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -1
  44. package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -1
  45. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
  46. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -1
  47. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
  48. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
  49. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
  50. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +1 -1
  51. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +1 -1
  52. package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -1
  53. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
  54. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -1
  55. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
  56. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +1 -1
  57. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -1
  58. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -1
  59. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +1 -1
  60. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -1
  61. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -1
  62. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +1 -1
  63. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -1
  64. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +1 -1
  65. package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -1
  66. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js +1 -1
  67. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js.map +1 -1
  68. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.esm.js +1 -1
  69. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +1 -1
  70. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -1
  71. package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.cjs.js +2 -0
  72. package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.cjs.js.map +1 -0
  73. package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.esm.js +1 -0
  74. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +1 -1
  75. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -1
  76. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
  77. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -1
  78. package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -1
  79. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +1 -1
  80. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -1
  81. package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -1
  82. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
  83. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -1
  84. package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -1
  85. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
  86. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -1
  87. package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -1
  88. package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
  89. package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
  90. package/dist/nile-wysiwyg-editor/math/katex-renderer.cjs.js +2 -0
  91. package/dist/nile-wysiwyg-editor/math/katex-renderer.cjs.js.map +1 -0
  92. package/dist/nile-wysiwyg-editor/math/katex-renderer.esm.js +1 -0
  93. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  94. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
  95. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
  96. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
  97. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +22 -3
  98. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +7 -6
  99. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +1 -1
  100. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -1
  101. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.cjs.js +2 -0
  102. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.cjs.js.map +1 -0
  103. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.esm.js +1 -0
  104. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +1 -1
  105. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js.map +1 -1
  106. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +1 -1
  107. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -1
  108. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +33 -54
  109. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +83 -95
  110. package/dist/nile-wysiwyg-editor/types.cjs.js +1 -1
  111. package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -1
  112. package/dist/nile-wysiwyg-editor/types.esm.js +1 -1
  113. package/dist/nile-wysiwyg-editor/ui/bubble-item.cjs.js +2 -0
  114. package/dist/nile-wysiwyg-editor/ui/bubble-item.cjs.js.map +1 -0
  115. package/dist/nile-wysiwyg-editor/ui/bubble-item.esm.js +1 -0
  116. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
  117. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -1
  118. package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +23 -15
  119. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
  120. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -1
  121. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +3 -3
  122. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +1 -1
  123. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -1
  124. package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +2 -2
  125. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +1 -1
  126. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -1
  127. package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +0 -3
  128. package/dist/nile-wysiwyg-editor/ui/preview.cjs.js +2 -0
  129. package/dist/nile-wysiwyg-editor/ui/preview.cjs.js.map +1 -0
  130. package/dist/nile-wysiwyg-editor/ui/preview.esm.js +8 -0
  131. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
  132. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -1
  133. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +225 -24
  134. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +1 -1
  135. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -1
  136. package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +9 -9
  137. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +1 -1
  138. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -1
  139. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +115 -13
  140. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
  141. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -1
  142. package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +13 -12
  143. package/dist/src/index.d.ts +5 -0
  144. package/dist/src/index.js +3 -0
  145. package/dist/src/index.js.map +1 -1
  146. package/dist/src/nile-checkbox/nile-checkbox.js +1 -0
  147. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  148. package/dist/src/nile-color-picker/nile-color-picker.d.ts +1 -0
  149. package/dist/src/nile-color-picker/nile-color-picker.js +1 -0
  150. package/dist/src/nile-color-picker/nile-color-picker.js.map +1 -1
  151. package/dist/src/nile-nav-tab/nile-nav-tab.css.js +11 -0
  152. package/dist/src/nile-nav-tab/nile-nav-tab.css.js.map +1 -1
  153. package/dist/src/nile-nav-tab/nile-nav-tab.d.ts +2 -0
  154. package/dist/src/nile-nav-tab/nile-nav-tab.js +13 -0
  155. package/dist/src/nile-nav-tab/nile-nav-tab.js.map +1 -1
  156. package/dist/src/nile-nav-tab-group/nile-nav-tab-group.css.js +1 -2
  157. package/dist/src/nile-nav-tab-group/nile-nav-tab-group.css.js.map +1 -1
  158. package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +1 -0
  159. package/dist/src/nile-wysiwyg-editor/engine/index.js +1 -0
  160. package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -1
  161. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js +3 -0
  162. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js.map +1 -1
  163. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.d.ts +19 -4
  164. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js +23 -18
  165. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js.map +1 -1
  166. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.d.ts +8 -3
  167. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js +41 -4
  168. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js.map +1 -1
  169. package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.d.ts +17 -0
  170. package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.js +174 -0
  171. package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.js.map +1 -0
  172. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +33 -2
  173. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -1
  174. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +49 -8
  175. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -1
  176. package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +12 -0
  177. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +76 -8
  178. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -1
  179. package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +2 -0
  180. package/dist/src/nile-wysiwyg-editor/engine/schema.js +154 -2
  181. package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -1
  182. package/dist/src/nile-wysiwyg-editor/index.d.ts +5 -0
  183. package/dist/src/nile-wysiwyg-editor/index.js +3 -0
  184. package/dist/src/nile-wysiwyg-editor/index.js.map +1 -1
  185. package/dist/src/nile-wysiwyg-editor/math/katex-renderer.d.ts +38 -0
  186. package/dist/src/nile-wysiwyg-editor/math/katex-renderer.js +40 -0
  187. package/dist/src/nile-wysiwyg-editor/math/katex-renderer.js.map +1 -0
  188. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +22 -3
  189. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
  190. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +36 -0
  191. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +125 -8
  192. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
  193. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +5 -2
  194. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -1
  195. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.d.ts +2 -0
  196. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js +1 -0
  197. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js.map +1 -1
  198. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.d.ts +55 -0
  199. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.js +79 -0
  200. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.js.map +1 -0
  201. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +33 -54
  202. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -1
  203. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.d.ts +50 -2
  204. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js +158 -102
  205. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js.map +1 -1
  206. package/dist/src/nile-wysiwyg-editor/types.d.ts +4 -2
  207. package/dist/src/nile-wysiwyg-editor/types.js +2 -2
  208. package/dist/src/nile-wysiwyg-editor/types.js.map +1 -1
  209. package/dist/src/nile-wysiwyg-editor/ui/bubble-item.d.ts +48 -0
  210. package/dist/src/nile-wysiwyg-editor/ui/bubble-item.js +69 -0
  211. package/dist/src/nile-wysiwyg-editor/ui/bubble-item.js.map +1 -0
  212. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.d.ts +17 -2
  213. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +128 -35
  214. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -1
  215. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.d.ts +2 -1
  216. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +4 -3
  217. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -1
  218. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +0 -3
  219. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -1
  220. package/dist/src/nile-wysiwyg-editor/ui/preview.d.ts +20 -0
  221. package/dist/src/nile-wysiwyg-editor/ui/preview.js +44 -0
  222. package/dist/src/nile-wysiwyg-editor/ui/preview.js.map +1 -0
  223. package/dist/src/nile-wysiwyg-editor/ui/source-view.d.ts +35 -3
  224. package/dist/src/nile-wysiwyg-editor/ui/source-view.js +337 -24
  225. package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -1
  226. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.d.ts +1 -0
  227. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +9 -0
  228. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -1
  229. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.d.ts +13 -2
  230. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +166 -10
  231. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -1
  232. package/dist/src/nile-wysiwyg-editor/ui/table-menu.d.ts +1 -0
  233. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +10 -8
  234. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -1
  235. package/dist/src/version.js +1 -1
  236. package/dist/src/version.js.map +1 -1
  237. package/dist/tsconfig.tsbuildinfo +1 -1
  238. package/dist/xml-25c4108a.esm.js +1 -0
  239. package/dist/xml-90fd974e.cjs.js +2 -0
  240. package/dist/xml-90fd974e.cjs.js.map +1 -0
  241. package/package.json +2 -1
  242. package/rollup.config.js +1 -0
  243. package/src/index.ts +8 -0
  244. package/src/nile-checkbox/nile-checkbox.ts +1 -0
  245. package/src/nile-color-picker/nile-color-picker.ts +1 -0
  246. package/src/nile-nav-tab/nile-nav-tab.css.ts +11 -0
  247. package/src/nile-nav-tab/nile-nav-tab.ts +17 -0
  248. package/src/nile-nav-tab-group/nile-nav-tab-group.css.ts +1 -2
  249. package/src/nile-wysiwyg-editor/engine/index.ts +1 -0
  250. package/src/nile-wysiwyg-editor/engine/plugins/embed-view.ts +3 -0
  251. package/src/nile-wysiwyg-editor/engine/plugins/embeds.ts +26 -20
  252. package/src/nile-wysiwyg-editor/engine/plugins/math-view.ts +45 -4
  253. package/src/nile-wysiwyg-editor/engine/plugins/style-block-view.ts +178 -0
  254. package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +34 -2
  255. package/src/nile-wysiwyg-editor/engine/pm.test.ts +58 -8
  256. package/src/nile-wysiwyg-editor/engine/sanitize.ts +71 -8
  257. package/src/nile-wysiwyg-editor/engine/schema.ts +158 -7
  258. package/src/nile-wysiwyg-editor/index.ts +5 -0
  259. package/src/nile-wysiwyg-editor/math/katex-renderer.ts +59 -0
  260. package/src/nile-wysiwyg-editor/math/katex.d.ts +17 -0
  261. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +22 -3
  262. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +5 -2
  263. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +142 -7
  264. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.ts +2 -0
  265. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.ts +68 -0
  266. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +33 -54
  267. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.ts +202 -108
  268. package/src/nile-wysiwyg-editor/types.ts +6 -4
  269. package/src/nile-wysiwyg-editor/ui/bubble-item.ts +60 -0
  270. package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +147 -40
  271. package/src/nile-wysiwyg-editor/ui/embed-panel.ts +4 -3
  272. package/src/nile-wysiwyg-editor/ui/math-panel.ts +0 -3
  273. package/src/nile-wysiwyg-editor/ui/preview.ts +42 -0
  274. package/src/nile-wysiwyg-editor/ui/source-view.ts +339 -31
  275. package/src/nile-wysiwyg-editor/ui/suggest-list.ts +10 -0
  276. package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +160 -10
  277. package/src/nile-wysiwyg-editor/ui/table-menu.ts +10 -8
  278. package/vscode-html-custom-data.json +75 -6
  279. package/dist/index-353172ed.esm.js +0 -1
  280. package/dist/index-b387a9f4.cjs.js +0 -2
  281. package/dist/index-b387a9f4.cjs.js.map +0 -1
  282. package/dist/index-cc1385e0.cjs.js +0 -2
  283. package/dist/index-cc1385e0.cjs.js.map +0 -1
  284. package/dist/index-dedc38a6.esm.js +0 -1
  285. package/dist/index-df196058.cjs.js.map +0 -1
@@ -3,6 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
3
3
  import NileElement from '../../internal/nile-element';
4
4
  import { renderGlyph } from '../../internal/glyph';
5
5
  import type { CommandName } from '../engine/commands';
6
+ import '../../nile-lite-tooltip/nile-lite-tooltip';
6
7
 
7
8
  interface TableOp {
8
9
  name: CommandName;
@@ -87,14 +88,15 @@ export class NileWysiwygTableMenu extends NileElement {
87
88
  <div class="menu" part="table-menu" @mousedown=${(e: Event) => e.preventDefault()}>
88
89
  ${OPS.map(
89
90
  op => html`
90
- <button
91
- type="button"
92
- title=${op.label}
93
- aria-label=${op.label}
94
- @click=${() => this.emit('wysiwyg-command', { name: op.name })}
95
- >
96
- ${renderGlyph(op.icon, 16)}
97
- </button>
91
+ <nile-lite-tooltip content=${op.label} placement="top">
92
+ <button
93
+ type="button"
94
+ aria-label=${op.label}
95
+ @click=${() => this.emit('wysiwyg-command', { name: op.name })}
96
+ >
97
+ ${renderGlyph(op.icon, 16)}
98
+ </button>
99
+ </nile-lite-tooltip>
98
100
  `
99
101
  )}
100
102
  </div>
@@ -8114,7 +8114,7 @@
8114
8114
  },
8115
8115
  {
8116
8116
  "name": "nile-wysiwyg-editor",
8117
- "description": "WYSIWYG rich text editor powered by ProseMirror.\n\nRequires evergreen browsers: selection inside shadow DOM relies on\n`Selection.getComposedRanges()` (Safari 17+, recent Firefox) or Chrome's\n`shadowRoot.getSelection()`.\n\nEvents:\n\n * `nile-change` {} - Debounced content change. detail: { value, json, content }\n\n * `nile-input` {} - Every document change. detail: { value, json, content }\n\n * `nile-focus` {} - Editor gained focus.\n\n * `nile-blur` {} - Editor lost focus.\n\n * `nile-selection-change` {} - detail: ToolbarState snapshot.\n\n * `nile-image-upload-request` {} - Cancelable. detail: { file, insert(src, alt) }.\nCall preventDefault() and use insert() to fully own the upload.\n\n * `nile-image-upload-error` {} - detail: { file, error } when uploadHandler rejects.\n\n * `nile-mention-query` {} - detail: { trigger, query, provide(items) } for async sources.\n\n * `nile-mention-select` {} - detail: { trigger, key, label } when a mention is inserted.\n\n * `nile-word-count` {} - detail: { words, characters } on every document change.\n\n * `nile-autosave` {} - detail: { value, json, content } on the autosave interval.\n\nAttributes:\n\n * `value` {`string`} - Document content as HTML. Not reflected to the attribute.\n\n * `placeholder` {`string`} - \n\n * `disabled` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `toolbar` {`string`} - Toolbar config string; `\"none\"` hides the toolbar.\n\n * `bubble-menu` {`boolean`} - Shows a balloon toolbar over text selections.\n\n * `sanitize` {`boolean`} - Sanitizes incoming HTML (value, paste, insertHTML). Leave on.\n\n * `singleline` {`boolean`} - Constrains content to a single paragraph.\n\n * `name` {`string`} - Form field name.\n\n * `required` {`boolean`} - \n\n * `upload-from-computer` {`boolean`} - Shows an \"Upload from computer\" button in the Insert Image dialog. Off by\ndefault (URL-only, like the RTE's default); files can always be added via\ndrag & drop or paste regardless.\n\n * `image-max-file-size` {`number`} - Max upload size (bytes) shown/enforced by the image dialog. Default 2 MB.\n\n * `mentions` - Mention config: trigger character → items, same shape and JSON attribute\nformat as nile-rich-text-editor. For async sources, configure the\ntrigger with an empty array and listen to nile-mention-query.\n\n * `no-slash-commands` {`boolean`} - Disables the \"/\" command menu.\n\n * `no-emoji` {`boolean`} - Disables the \":\" emoji picker.\n\n * `maxlength` {`number`} - Maximum character count; further input is rejected. 0 = unlimited.\n\n * `show-counter` {`boolean`} - Always show the word/character counter footer (implied by maxlength).\n\n * `sticky-toolbar` {`boolean`} - Keeps the toolbar pinned to the viewport while scrolling long content.\n\n * `snippets` {`SnippetConfig[]`} - Reusable snippets surfaced in the \"/\" menu (JSON attribute).\n\n * `merge-fields` {`MergeFieldConfig[]`} - Merge fields offered in the merge-field picker (JSON attribute).\n\n * `templates` {`TemplateConfig[]`} - Content templates offered in the template picker (JSON attribute).\n\n * `autosave-interval` {`number`} - Emit nile-autosave every N ms while the document has changed. 0 = off.\n\n * `paste-as-plain-text` {`boolean`} - When on, every paste drops formatting and inserts plain text.\n\n * `no-markdown-paste` {`boolean`} - Disables Markdown detection on plain-text pastes.\n\n * `no-text-transform` {`boolean`} - Disables typography autocorrect (smart quotes, dashes, (c) → ©).\n\n * `fullscreen` {`boolean`} - Expands the editor to fill the viewport. Esc exits.\n\n * `show-blocks` {`boolean`} - Outlines block boundaries (paragraphs, headings, lists…) while editing.\n\nProperties:\n\n * `formAssociated` {`boolean`} - \n\n * `value` {`string`} - Document content as HTML. Not reflected to the attribute.\n\n * `placeholder` {`string`} - \n\n * `disabled` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `toolbar` {`string`} - Toolbar config string; `\"none\"` hides the toolbar.\n\n * `bubbleMenu` {`boolean`} - Shows a balloon toolbar over text selections.\n\n * `sanitize` {`boolean`} - Sanitizes incoming HTML (value, paste, insertHTML). Leave on.\n\n * `singleLine` {`boolean`} - Constrains content to a single paragraph.\n\n * `name` {`string`} - Form field name.\n\n * `required` {`boolean`} - \n\n * `uploadHandler` - Async image upload handler. When set, pasted/dropped/picked image files\nare uploaded through it (an \"Uploading…\" placeholder shows meanwhile)\nand the returned src is inserted.\n\n * `allowBase64Images` {`boolean`} - Fallback when no uploadHandler is set and no nile-image-upload-request\nlistener takes over: embed image files as base64 data URLs.\n\n * `uploadFromComputer` {`boolean`} - Shows an \"Upload from computer\" button in the Insert Image dialog. Off by\ndefault (URL-only, like the RTE's default); files can always be added via\ndrag & drop or paste regardless.\n\n * `imageMaxFileSize` {`number`} - Max upload size (bytes) shown/enforced by the image dialog. Default 2 MB.\n\n * `mentions` - Mention config: trigger character → items, same shape and JSON attribute\nformat as nile-rich-text-editor. For async sources, configure the\ntrigger with an empty array and listen to nile-mention-query.\n\n * `noSlashCommands` {`boolean`} - Disables the \"/\" command menu.\n\n * `noEmoji` {`boolean`} - Disables the \":\" emoji picker.\n\n * `maxLength` {`number`} - Maximum character count; further input is rejected. 0 = unlimited.\n\n * `showCounter` {`boolean`} - Always show the word/character counter footer (implied by maxlength).\n\n * `stickyToolbar` {`boolean`} - Keeps the toolbar pinned to the viewport while scrolling long content.\n\n * `snippets` {`SnippetConfig[]`} - Reusable snippets surfaced in the \"/\" menu (JSON attribute).\n\n * `mergeFields` {`MergeFieldConfig[]`} - Merge fields offered in the merge-field picker (JSON attribute).\n\n * `templates` {`TemplateConfig[]`} - Content templates offered in the template picker (JSON attribute).\n\n * `mathRenderer` - Renders a math node's LaTeX to HTML (KaTeX/MathJax/MathML). When unset,\nthe raw LaTeX is shown. Same trust level as uploadHandler — output is\ninserted as HTML.\n\n * `autosaveInterval` {`number`} - Emit nile-autosave every N ms while the document has changed. 0 = off.\n\n * `pasteAsPlainText` {`boolean`} - When on, every paste drops formatting and inserts plain text.\n\n * `noMarkdownPaste` {`boolean`} - Disables Markdown detection on plain-text pastes.\n\n * `noTextTransform` {`boolean`} - Disables typography autocorrect (smart quotes, dashes, (c) → ©).\n\n * `fullscreen` {`boolean`} - Expands the editor to fill the viewport. Esc exits.\n\n * `showBlocks` {`boolean`} - Outlines block boundaries (paragraphs, headings, lists…) while editing.\n\n * `toolbarState` {`ToolbarState | undefined`} - \n\n * `hasFocus` {`boolean`} - \n\n * `sourceMode` {`boolean`} - \n\n * `counter` {`{ words: number; characters: number; }`} - \n\n * `insertMenuMode` {`\"template\" | \"merge\" | null`} - Which list the shared insert-menu is showing, if open.\n\n * `baseEl` {`HTMLElement`} - \n\n * `toolbarEl` {`HTMLElement | undefined`} - \n\n * `surfaceEl` {`HTMLElement`} - \n\n * `linkEditorEl` - \n\n * `bubbleMenuEl` - \n\n * `imagePanelEl` - \n\n * `tableMenuEl` - \n\n * `suggestListEl` - \n\n * `findBarEl` - \n\n * `sourceViewEl` - \n\n * `embedPanelEl` - \n\n * `bookmarkPanelEl` - \n\n * `codeMenuEl` - \n\n * `shortcutHelpEl` - \n\n * `imageMenuEl` - \n\n * `embedMenuEl` - \n\n * `specialCharsEl` - \n\n * `emojiPickerEl` - \n\n * `insertMenuEl` - \n\n * `mathPanelEl` - \n\n * `markdownPanelEl` - \n\n * `view` - \n\n * `mentionMatch` {`SuggestionMatch | null`} - \n\n * `slashMatch` {`SuggestionMatch | null`} - \n\n * `emojiMatch` {`SuggestionMatch | null`} - \n\n * `activeSuggestSource` {`\"mention\" | \"slash\" | \"emoji\" | null`} - \n\n * `suggestDismissed` {`string | null`} - \n\n * `mentionQueryToken` {`string`} - \n\n * `autosaveTimer` - \n\n * `lastAutosaveValue` {`string`} - \n\n * `internals` - \n\n * `defaultValue` {`string`} - \n\n * `syncingValue` {`boolean`} - \n\n * `changeTimer` - \n\n * `pendingChange` {`boolean`} - \n\n * `previousBodyOverflow` {`string | null`} - Body overflow value before fullscreen locked it; null = not locked.\n\n * `contentRoot` {`HTMLElement | null`} - The live, styled content element used as the source for exports.\n\n * `pmView` - The underlying ProseMirror EditorView. Advanced escape hatch.\n\n * `json` - Document as ProseMirror JSON.\n\n * `override` - \n\n * `floatingPanels` {`({ open: boolean; } | undefined)[]`} - The floating insert panels that should dismiss on outside interaction.\n\n * `onOutsidePointerDown` - Closes any open insert panel when the pointer goes down outside of it —\nwhether elsewhere in the editor (e.g. the content area) or off the widget.\n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8117
+ "description": "WYSIWYG rich text editor powered by ProseMirror.\n\nRequires evergreen browsers: selection inside shadow DOM relies on\n`Selection.getComposedRanges()` (Safari 17+, recent Firefox) or Chrome's\n`shadowRoot.getSelection()`.\n\nEvents:\n\n * `nile-change` {} - Debounced content change. detail: { value, json, content }\n\n * `nile-input` {} - Every document change. detail: { value, json, content }\n\n * `nile-focus` {} - Editor gained focus.\n\n * `nile-blur` {} - Editor lost focus.\n\n * `nile-selection-change` {} - detail: ToolbarState snapshot.\n\n * `nile-image-upload-request` {} - Cancelable. detail: { file, insert(src, alt) }.\nCall preventDefault() and use insert() to fully own the upload.\n\n * `nile-image-upload-error` {} - detail: { file, error } when uploadHandler rejects.\n\n * `nile-mention-query` {} - detail: { trigger, query, provide(items) } for async sources.\n\n * `nile-mention-select` {} - detail: { trigger, key, label } when a mention is inserted.\n\n * `nile-word-count` {} - detail: { words, characters } on every document change.\n\n * `nile-autosave` {} - detail: { value, json, content } on the autosave interval.\n\nAttributes:\n\n * `value` {`string`} - Document content as HTML. Not reflected to the attribute.\n\n * `placeholder` {`string`} - \n\n * `disabled` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `toolbar` {`string`} - Toolbar config string; `\"none\"` hides the toolbar.\n\n * `bubble-menu` {`boolean`} - Shows a balloon toolbar over text selections.\n\n * `sanitize` {`boolean`} - Sanitizes incoming HTML (value, paste, insertHTML). Leave on.\n\n * `singleline` {`boolean`} - Constrains content to a single paragraph.\n\n * `name` {`string`} - Form field name.\n\n * `required` {`boolean`} - \n\n * `upload-from-computer` {`boolean`} - Shows an \"Upload from computer\" button in the Insert Image dialog. Off by\ndefault (URL-only, like the RTE's default); files can always be added via\ndrag & drop or paste regardless.\n\n * `image-max-file-size` {`number`} - Max upload size (bytes) shown/enforced by the image dialog. Default 2 MB.\n\n * `mentions` - Mention config: trigger character → items, same shape and JSON attribute\nformat as nile-rich-text-editor. For async sources, configure the\ntrigger with an empty array and listen to nile-mention-query.\n\n * `no-slash-commands` {`boolean`} - Disables the \"/\" command menu.\n\n * `no-emoji` {`boolean`} - Disables the \":\" emoji picker.\n\n * `maxlength` {`number`} - Maximum character count; further input is rejected. 0 = unlimited.\n\n * `show-counter` {`boolean`} - Always show the word/character counter footer (implied by maxlength).\n\n * `sticky-toolbar` {`boolean`} - Keeps the toolbar pinned to the viewport while scrolling long content.\n\n * `snippets` {`SnippetConfig[]`} - Reusable snippets surfaced in the \"/\" menu (JSON attribute).\n\n * `merge-fields` {`MergeFieldConfig[]`} - Merge fields offered in the merge-field picker (JSON attribute).\n\n * `templates` {`TemplateConfig[]`} - Content templates offered in the template picker (JSON attribute).\n\n * `autosave-interval` {`number`} - Emit nile-autosave every N ms while the document has changed. 0 = off.\n\n * `paste-as-plain-text` {`boolean`} - When on, every paste drops formatting and inserts plain text.\n\n * `no-markdown-paste` {`boolean`} - Disables Markdown detection on plain-text pastes.\n\n * `no-text-transform` {`boolean`} - Disables typography autocorrect (smart quotes, dashes, (c) → ©).\n\n * `fullscreen` {`boolean`} - Expands the editor to fill the viewport. Esc exits.\n\n * `show-blocks` {`boolean`} - Outlines block boundaries (paragraphs, headings, lists…) while editing.\n\nProperties:\n\n * `formAssociated` {`boolean`} - \n\n * `value` {`string`} - Document content as HTML. Not reflected to the attribute.\n\n * `placeholder` {`string`} - \n\n * `disabled` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `toolbar` {`string`} - Toolbar config string; `\"none\"` hides the toolbar.\n\n * `authoredToolbar` {`AuthoredToolbarItem[] | undefined`} - Toolbar built from authored `<nile-wysiwyg-toolbar-item>` light-DOM\nchildren. When present it takes precedence over the `toolbar` string.\n\n * `authoredBubble` {`AuthoredToolbarItem[] | undefined`} - Bubble menu built from authored `<nile-wysiwyg-bubble-item>` light-DOM\nchildren. When present it replaces the built-in bold/italic/underline/\nstrike/link set.\n\n * `toolbarObserver` {`MutationObserver | undefined`} - Watches authored toolbar/bubble children so edits re-render them.\n\n * `bubbleMenu` {`boolean`} - Shows a balloon toolbar over text selections.\n\n * `sanitize` {`boolean`} - Sanitizes incoming HTML (value, paste, insertHTML). Leave on.\n\n * `singleLine` {`boolean`} - Constrains content to a single paragraph.\n\n * `name` {`string`} - Form field name.\n\n * `required` {`boolean`} - \n\n * `uploadHandler` - Async image upload handler. When set, pasted/dropped/picked image files\nare uploaded through it (an \"Uploading…\" placeholder shows meanwhile)\nand the returned src is inserted.\n\n * `allowBase64Images` {`boolean`} - Fallback when no uploadHandler is set and no nile-image-upload-request\nlistener takes over: embed image files as base64 data URLs.\n\n * `uploadFromComputer` {`boolean`} - Shows an \"Upload from computer\" button in the Insert Image dialog. Off by\ndefault (URL-only, like the RTE's default); files can always be added via\ndrag & drop or paste regardless.\n\n * `imageMaxFileSize` {`number`} - Max upload size (bytes) shown/enforced by the image dialog. Default 2 MB.\n\n * `mentions` - Mention config: trigger character → items, same shape and JSON attribute\nformat as nile-rich-text-editor. For async sources, configure the\ntrigger with an empty array and listen to nile-mention-query.\n\n * `noSlashCommands` {`boolean`} - Disables the \"/\" command menu.\n\n * `noEmoji` {`boolean`} - Disables the \":\" emoji picker.\n\n * `maxLength` {`number`} - Maximum character count; further input is rejected. 0 = unlimited.\n\n * `showCounter` {`boolean`} - Always show the word/character counter footer (implied by maxlength).\n\n * `stickyToolbar` {`boolean`} - Keeps the toolbar pinned to the viewport while scrolling long content.\n\n * `snippets` {`SnippetConfig[]`} - Reusable snippets surfaced in the \"/\" menu (JSON attribute).\n\n * `mergeFields` {`MergeFieldConfig[]`} - Merge fields offered in the merge-field picker (JSON attribute).\n\n * `templates` {`TemplateConfig[]`} - Content templates offered in the template picker (JSON attribute).\n\n * `mathRenderer` - Renders a math node's LaTeX to HTML (KaTeX/MathJax/MathML). When unset,\nthe raw LaTeX is shown. Same trust level as uploadHandler — output is\ninserted as HTML.\n\n * `autosaveInterval` {`number`} - Emit nile-autosave every N ms while the document has changed. 0 = off.\n\n * `pasteAsPlainText` {`boolean`} - When on, every paste drops formatting and inserts plain text.\n\n * `noMarkdownPaste` {`boolean`} - Disables Markdown detection on plain-text pastes.\n\n * `noTextTransform` {`boolean`} - Disables typography autocorrect (smart quotes, dashes, (c) → ©).\n\n * `fullscreen` {`boolean`} - Expands the editor to fill the viewport. Esc exits.\n\n * `showBlocks` {`boolean`} - Outlines block boundaries (paragraphs, headings, lists…) while editing.\n\n * `toolbarState` {`ToolbarState | undefined`} - \n\n * `hasFocus` {`boolean`} - \n\n * `sourceMode` {`boolean`} - \n\n * `counter` {`{ words: number; characters: number; }`} - \n\n * `insertMenuMode` {`\"template\" | \"merge\" | null`} - Which list the shared insert-menu is showing, if open.\n\n * `baseEl` {`HTMLElement`} - \n\n * `toolbarEl` {`HTMLElement | undefined`} - \n\n * `surfaceEl` {`HTMLElement`} - \n\n * `linkEditorEl` - \n\n * `bubbleMenuEl` - \n\n * `imagePanelEl` - \n\n * `tableMenuEl` - \n\n * `suggestListEl` - \n\n * `findBarEl` - \n\n * `sourceViewEl` - \n\n * `embedPanelEl` - \n\n * `bookmarkPanelEl` - \n\n * `codeMenuEl` - \n\n * `shortcutHelpEl` - \n\n * `imageMenuEl` - \n\n * `embedMenuEl` - \n\n * `specialCharsEl` - \n\n * `emojiPickerEl` - \n\n * `insertMenuEl` - \n\n * `mathPanelEl` - \n\n * `markdownPanelEl` - \n\n * `view` - \n\n * `mentionMatch` {`SuggestionMatch | null`} - \n\n * `slashMatch` {`SuggestionMatch | null`} - \n\n * `emojiMatch` {`SuggestionMatch | null`} - \n\n * `activeSuggestSource` {`\"mention\" | \"slash\" | \"emoji\" | null`} - \n\n * `suggestDismissed` {`string | null`} - \n\n * `mentionQueryToken` {`string`} - \n\n * `autosaveTimer` - \n\n * `lastAutosaveValue` {`string`} - \n\n * `internals` - \n\n * `defaultValue` {`string`} - \n\n * `syncingValue` {`boolean`} - \n\n * `changeTimer` - \n\n * `pendingChange` {`boolean`} - \n\n * `previousBodyOverflow` {`string | null`} - Body overflow value before fullscreen locked it; null = not locked.\n\n * `painterDragActive` {`boolean`} - True while a drag-selection is in progress with the format painter armed.\nSuppresses the mid-drag auto-apply in {@link handleTransaction} so the\ncopied formatting lands on the final, complete selection (on mouse-up).\n\n * `onPainterPointerDown` - \n\n * `onPainterPointerUp` - \n\n * `contentRoot` {`HTMLElement | null`} - The live, styled content element used as the source for exports.\n\n * `pmView` - The underlying ProseMirror EditorView. Advanced escape hatch.\n\n * `json` - Document as ProseMirror JSON.\n\n * `override` - \n\n * `floatingPanels` {`({ open: boolean; } | undefined)[]`} - The floating insert panels that should dismiss on outside interaction.\n\n * `onOutsidePointerDown` - Closes any open insert panel when the pointer goes down outside of it —\nwhether elsewhere in the editor (e.g. the content area) or off the widget.\n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8118
8118
  "attributes": [
8119
8119
  {
8120
8120
  "name": "value",
@@ -8286,9 +8286,37 @@
8286
8286
  }
8287
8287
  ]
8288
8288
  },
8289
+ {
8290
+ "name": "nile-wysiwyg-toolbar-item",
8291
+ "description": "Declarative, light-DOM marker for a single toolbar control.\n\nAuthor these inside a `<nile-wysiwyg-toolbar>` container within a\n`<nile-wysiwyg-editor>` to build the toolbar by hand instead of (or in\naddition to) the `toolbar` config string:\n\n```html\n<nile-wysiwyg-editor>\n <nile-wysiwyg-toolbar>\n <nile-wysiwyg-toolbar-item name=\"bold\" label=\"Bold\"></nile-wysiwyg-toolbar-item>\n <nile-wysiwyg-toolbar-item name=\"italic\"></nile-wysiwyg-toolbar-item>\n <nile-wysiwyg-toolbar-item divider></nile-wysiwyg-toolbar-item>\n <nile-wysiwyg-toolbar-item name=\"heading\"></nile-wysiwyg-toolbar-item>\n <!-- goes into the 3-dot \"more\" menu, wherever it sits in the list -->\n <nile-wysiwyg-toolbar-item name=\"sourceView\" overflow></nile-wysiwyg-toolbar-item>\n </nile-wysiwyg-toolbar>\n</nile-wysiwyg-editor>\n```\n\nThe container is optional — items may also be direct children of the editor.\n\n`name` maps to a built-in control (the same keys the `toolbar` string\naccepts, e.g. `bold`, `italic`, `heading`, `textColor`, `table`). `label`\nand `icon` override that control's built-in tooltip/glyph; set `divider` to\ninsert a group separator, or `overflow` to tuck this control into the\ntoolbar's collapsible 3-dot \"more\" menu.\n\nThe element renders nothing itself — the editor discovers it and renders the\nreal control inside its own shadow DOM.\n\nAttributes:\n\n * `name` {`string`} - Built-in control name — same keys accepted by the `toolbar` string.\n\n * `label` {`string`} - Overrides the control's tooltip / accessible label.\n\n * `icon` {`string`} - Overrides the control's glyph (a `nile-glyph` name).\n\n * `divider` {`boolean`} - Renders a group divider instead of a control.\n\n * `overflow` {`boolean`} - When set, this control is tucked into the toolbar's collapsible 3-dot\n\"more\" menu instead of the main bar — regardless of where it sits among\nthe items.\n\nProperties:\n\n * `name` {`string`} - Built-in control name — same keys accepted by the `toolbar` string.\n\n * `label` {`string`} - Overrides the control's tooltip / accessible label.\n\n * `icon` {`string`} - Overrides the control's glyph (a `nile-glyph` name).\n\n * `divider` {`boolean`} - Renders a group divider instead of a control.\n\n * `overflow` {`boolean`} - When set, this control is tucked into the toolbar's collapsible 3-dot\n\"more\" menu instead of the main bar — regardless of where it sits among\nthe items.",
8292
+ "attributes": [
8293
+ {
8294
+ "name": "name",
8295
+ "description": "`name` {`string`} - Built-in control name — same keys accepted by the `toolbar` string.\n\nProperty: name\n\nDefault: "
8296
+ },
8297
+ {
8298
+ "name": "label",
8299
+ "description": "`label` {`string`} - Overrides the control's tooltip / accessible label.\n\nProperty: label\n\nDefault: "
8300
+ },
8301
+ {
8302
+ "name": "icon",
8303
+ "description": "`icon` {`string`} - Overrides the control's glyph (a `nile-glyph` name).\n\nProperty: icon\n\nDefault: "
8304
+ },
8305
+ {
8306
+ "name": "divider",
8307
+ "description": "`divider` {`boolean`} - Renders a group divider instead of a control.\n\nProperty: divider\n\nDefault: false",
8308
+ "valueSet": "v"
8309
+ },
8310
+ {
8311
+ "name": "overflow",
8312
+ "description": "`overflow` {`boolean`} - When set, this control is tucked into the toolbar's collapsible 3-dot\n\"more\" menu instead of the main bar — regardless of where it sits among\nthe items.\n\nProperty: overflow\n\nDefault: false",
8313
+ "valueSet": "v"
8314
+ }
8315
+ ]
8316
+ },
8289
8317
  {
8290
8318
  "name": "nile-wysiwyg-toolbar",
8291
- "description": "Config-driven toolbar. Renders from a single immutable ToolbarState\nsnapshot; every interaction is dispatched to the host as a\n`wysiwyg-command` event — the toolbar never touches the editor directly.\n\nAttributes:\n\n * `config` {`string`} - Space-separated item names; `|` inserts a divider.\n\n * `disabled` {`boolean`} - \n\nProperties:\n\n * `config` {`string`} - Space-separated item names; `|` inserts a divider.\n\n * `disabled` {`boolean`} - \n\n * `toolbarState` {`ToolbarState | undefined`} - \n\n * `openMenu` {`string | null`} - Which dropdown/color panel is open (item name), if any.\n\n * `recentColors` - Recently used colors per color command, like nile-rte-color.\n\n * `handleOutsideClick` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8319
+ "description": "Config-driven toolbar. Renders from a single immutable ToolbarState\nsnapshot; every interaction is dispatched to the host as a\n`wysiwyg-command` event — the toolbar never touches the editor directly.\n\nAttributes:\n\n * `config` {`string`} - Space-separated item names; `|` inserts a divider.\n\n * `disabled` {`boolean`} - \n\nProperties:\n\n * `config` {`string`} - Space-separated item names; `|` inserts a divider.\n\n * `items` {`AuthoredToolbarItem[] | undefined`} - Structured item list authored in light DOM (from\n`<nile-wysiwyg-toolbar-item>` children). When set and non-empty it takes\nprecedence over `config`, and each item may override the built-in\nlabel/icon.\n\n * `disabled` {`boolean`} - \n\n * `toolbarState` {`ToolbarState | undefined`} - \n\n * `openMenu` {`string | null`} - Which dropdown/color panel is open (item name), if any.\n\n * `overflowOpen` {`boolean`} - Whether the overflow (\"more\" / 3-dot) menu panel is open.\n\n * `isAuthoringContainer` {`boolean`} - True when this instance is an author's declarative `<nile-wysiwyg-toolbar>`\ncontainer sitting in an editor's light DOM (holding\n`<nile-wysiwyg-toolbar-item>` children). Such an instance renders nothing\nand wires up no listeners — the editor reads the items and renders the real\ntoolbar in its own shadow DOM. The editor's internal instance lives inside\na shadow root, so `closest` (which stops at shadow boundaries) never\nmatches it; a standalone toolbar on a page has no editor ancestor either.\n\n * `handleOutsideClick` - \n\n * `toggleOverflow` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8292
8320
  "attributes": [
8293
8321
  {
8294
8322
  "name": "config",
@@ -8312,9 +8340,32 @@
8312
8340
  }
8313
8341
  ]
8314
8342
  },
8343
+ {
8344
+ "name": "nile-wysiwyg-bubble-item",
8345
+ "description": "Declarative, light-DOM marker for a single selection bubble-menu control.\n\nAuthor these as children of `<nile-wysiwyg-editor>` to build the bubble menu\nshown over a text selection by hand, instead of the built-in five\n(bold / italic / underline / strike / link) — the same pattern as\n`<nile-wysiwyg-toolbar-item>`:\n\n```html\n<nile-wysiwyg-editor bubble-menu>\n <nile-wysiwyg-bubble-item name=\"bold\"></nile-wysiwyg-bubble-item>\n <nile-wysiwyg-bubble-item name=\"italic\"></nile-wysiwyg-bubble-item>\n <nile-wysiwyg-bubble-item divider></nile-wysiwyg-bubble-item>\n <nile-wysiwyg-bubble-item name=\"link\" label=\"Add link\"></nile-wysiwyg-bubble-item>\n</nile-wysiwyg-editor>\n```\n\n`name` maps to a built-in control (`bold`, `italic`, `underline`, `strike`,\n`code`, `subscript`, `superscript`, `link`, `bulletList`, `orderedList`,\n`alignLeft`, `alignCenter`, `alignRight`, `clearFormatting`). `label` and\n`icon` override the built-in tooltip/glyph; set `divider` for a separator.\n\nAny other `name` is dispatched as a raw `wysiwyg-command` (so custom editor\ncommands work) as long as an `icon` is supplied.\n\nThe element renders nothing itself — the editor discovers it and renders the\nreal control inside the bubble menu's shadow DOM.\n\nAttributes:\n\n * `name` {`string`} - Built-in control name, or a raw command name when paired with `icon`.\n\n * `label` {`string`} - Overrides the control's tooltip / accessible label.\n\n * `icon` {`string`} - Overrides the control's glyph (a `nile-glyph` name).\n\n * `divider` {`boolean`} - Renders a separator instead of a control.\n\nProperties:\n\n * `name` {`string`} - Built-in control name, or a raw command name when paired with `icon`.\n\n * `label` {`string`} - Overrides the control's tooltip / accessible label.\n\n * `icon` {`string`} - Overrides the control's glyph (a `nile-glyph` name).\n\n * `divider` {`boolean`} - Renders a separator instead of a control.",
8346
+ "attributes": [
8347
+ {
8348
+ "name": "name",
8349
+ "description": "`name` {`string`} - Built-in control name, or a raw command name when paired with `icon`.\n\nProperty: name\n\nDefault: "
8350
+ },
8351
+ {
8352
+ "name": "label",
8353
+ "description": "`label` {`string`} - Overrides the control's tooltip / accessible label.\n\nProperty: label\n\nDefault: "
8354
+ },
8355
+ {
8356
+ "name": "icon",
8357
+ "description": "`icon` {`string`} - Overrides the control's glyph (a `nile-glyph` name).\n\nProperty: icon\n\nDefault: "
8358
+ },
8359
+ {
8360
+ "name": "divider",
8361
+ "description": "`divider` {`boolean`} - Renders a separator instead of a control.\n\nProperty: divider\n\nDefault: false",
8362
+ "valueSet": "v"
8363
+ }
8364
+ ]
8365
+ },
8315
8366
  {
8316
8367
  "name": "nile-wysiwyg-bubble-menu",
8317
- "description": "Balloon toolbar shown over non-empty selections. The host owns positioning\n(absolute left/top) and visibility; commands bubble up as\n`wysiwyg-command` events, same contract as the main toolbar.\n\nAttributes:\n\n * `open` {`boolean`} - \n\nProperties:\n\n * `open` {`boolean`} - \n\n * `toolbarState` {`ToolbarState | undefined`} - \n\n * `items` {`BubbleItem[]`} - Same icon set as the main toolbar, so both surfaces look identical.\n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8368
+ "description": "Balloon toolbar shown over non-empty selections. The host owns positioning\n(absolute left/top) and visibility; commands bubble up as\n`wysiwyg-command` events, same contract as the main toolbar.\n\nAttributes:\n\n * `open` {`boolean`} - \n\nProperties:\n\n * `open` {`boolean`} - \n\n * `toolbarState` {`ToolbarState | undefined`} - \n\n * `items` {`AuthoredToolbarItem[] | undefined`} - Structured item list authored in light DOM (from\n`<nile-wysiwyg-bubble-item>` children). `'|'` is a separator. Falls back to\n{@link DEFAULT_BUBBLE} when empty.\n\n * `isAuthoringContainer` {`boolean`} - True when this instance is an author's declarative `<nile-wysiwyg-bubble-menu>`\ncontainer in an editor's light DOM (holding `<nile-wysiwyg-bubble-item>`\nchildren). It renders nothing — the editor reads the items and renders the\nreal bubble menu in its own shadow DOM. The editor's internal instance\nlives in a shadow root, so `closest` never matches it.\n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8318
8369
  "attributes": [
8319
8370
  {
8320
8371
  "name": "open",
@@ -8352,7 +8403,7 @@
8352
8403
  },
8353
8404
  {
8354
8405
  "name": "nile-wysiwyg-embed-panel",
8355
- "description": "Floating embed-insert panel: paste a YouTube/Vimeo/Loom link. Styled to\nmatch the image panel (nile-input + nile-button). Emits\n`wysiwyg-embed-apply` detail: { src, provider } and `wysiwyg-embed-cancel`.\n\nAttributes:\n\n * `open` {`boolean`} - \n\nProperties:\n\n * `open` {`boolean`} - \n\n * `urlValue` {`string`} - \n\n * `error` {`string`} - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8406
+ "description": "Floating embed-insert panel: paste any https:// link (YouTube/Vimeo/Loom\nare auto-formatted; anything else embeds as a sandboxed iframe). Styled to\nmatch the image panel (nile-input + nile-button). Emits\n`wysiwyg-embed-apply` detail: { src, provider } and `wysiwyg-embed-cancel`.\n\nAttributes:\n\n * `open` {`boolean`} - \n\nProperties:\n\n * `open` {`boolean`} - \n\n * `urlValue` {`string`} - \n\n * `error` {`string`} - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8356
8407
  "attributes": [
8357
8408
  {
8358
8409
  "name": "open",
@@ -8497,6 +8548,16 @@
8497
8548
  }
8498
8549
  ]
8499
8550
  },
8551
+ {
8552
+ "name": "nile-wysiwyg-preview",
8553
+ "description": "Renders sanitized document HTML inside its OWN shadow root. Any author\n`<style>` block in the content is therefore scoped to this element and\ncannot leak into the surrounding source-view / editor chrome (which lives in\na different shadow root). Reuses the editor's content styles so the render\nmatches the live editor. The content wrapper is an `<article>`, not a\n`<div>`, so a blanket `div { … }` rule doesn't paint the wrapper itself.\n\nAttributes:\n\n * `content` {`string`} - Sanitized HTML to render (already run through sanitizeHtml).\n\nProperties:\n\n * `content` {`string`} - Sanitized HTML to render (already run through sanitizeHtml).",
8554
+ "attributes": [
8555
+ {
8556
+ "name": "content",
8557
+ "description": "`content` {`string`} - Sanitized HTML to render (already run through sanitizeHtml).\n\nProperty: content\n\nDefault: "
8558
+ }
8559
+ ]
8560
+ },
8500
8561
  {
8501
8562
  "name": "nile-wysiwyg-shortcut-help",
8502
8563
  "description": "Keyboard shortcut reference dialog, opened from the toolbar or Mod-/.\nEmits `wysiwyg-shortcut-help-close` when dismissed (Esc, ✕ or backdrop).\n\nAttributes:\n\n * `open` {`boolean`} - \n\nProperties:\n\n * `open` {`boolean`} - \n\n * `panelEl` {`HTMLElement | undefined`} - \n\n * `previousBodyOverflow` {`string | null`} - Body overflow value before we locked it; null = not locked by us.\n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
@@ -8510,7 +8571,7 @@
8510
8571
  },
8511
8572
  {
8512
8573
  "name": "nile-wysiwyg-source-view",
8513
- "description": "Raw HTML source editing mode. Replaces the rich surface while open; the\nhost re-parses (and re-sanitizes) the HTML on apply. Emits\n`wysiwyg-source-apply` detail: { html } and `wysiwyg-source-cancel`.\n\nAttributes:\n\n * `value` {`string`} - \n\nProperties:\n\n * `value` {`string`} - \n\n * `textarea` {`HTMLTextAreaElement | undefined`} - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8574
+ "description": "Raw HTML source editing mode. A split view: the raw HTML on the left, a\nlive rendered preview on the right, with a draggable divider between them\nand a resizable body. The preview runs the same sanitizer the host applies\non the way back, so what you see is what the document becomes. Emits\n`wysiwyg-source-apply` detail: { html } and `wysiwyg-source-cancel`.\n\nThe code pane is a lightweight editor: a real `<textarea>` for input, with a\nhighlight.js-coloured layer painted behind it and a synced line-number\ngutter. No heavyweight code-editor dependency.\n\nAttributes:\n\n * `value` {`string`} - \n\nProperties:\n\n * `value` {`string`} - \n\n * `textarea` {`HTMLTextAreaElement | undefined`} - \n\n * `highlightEl` {`HTMLElement | undefined`} - \n\n * `linenosEl` {`HTMLElement | undefined`} - \n\n * `bodyEl` {`HTMLElement | undefined`} - \n\n * `draft` {`string`} - Current source text, drives the live preview, highlight and gutter.\n\n * `splitRatio` {`number`} - Fraction of the body width given to the code pane (the rest is preview).\nClamped while dragging the divider.\n\n * `splitDragging` {`boolean`} - Whether the divider is currently being dragged.\n\n * `currentValue` {`string`} - The current (possibly edited) source text — what \"Done\" would apply.\n\n * `highlighted` {`string`} - highlight.js-coloured HTML for the current draft (falls back to escaped).\n\n * `lineCount` {`number`} - \n\n * `startSplitDrag` - Begins a pointer-driven resize of the split divider.\n\n * `resetSplit` - Resets the divider to a 50/50 layout (double-click affordance).\n\n * `onInput` - \n\n * `onScroll` - Keeps the highlight layer and line-number gutter aligned with scroll.\n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8514
8575
  "attributes": [
8515
8576
  {
8516
8577
  "name": "value",
@@ -8542,12 +8603,20 @@
8542
8603
  },
8543
8604
  {
8544
8605
  "name": "nile-wysiwyg-table-picker",
8545
- "description": "Toolbar item: a table button that opens an N×M hover grid. Picking a cell\nemits `wysiwyg-command` with `insertTable { rows, cols }`.\n\nAttributes:\n\n * `disabled` {`boolean`} - \n\nProperties:\n\n * `disabled` {`boolean`} - \n\n * `open` {`boolean`} - \n\n * `hoverRows` {`number`} - \n\n * `hoverCols` {`number`} - \n\n * `handleOutside` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8606
+ "description": "Toolbar item: a table button that opens a hover grid which auto-expands as\nthe pointer reaches the last row/column (up to `maxRows`×`maxCols`), plus a\n\"Custom\" rows×cols input for larger tables. Picking a cell or confirming the\ncustom size emits `wysiwyg-command` with `insertTable { rows, cols }`.\n\nAttributes:\n\n * `disabled` {`boolean`} - \n\n * `max-rows` {`number`} - Hard cap on the number of rows selectable via grid or custom input.\n\n * `max-cols` {`number`} - Hard cap on the number of columns selectable via grid or custom input.\n\nProperties:\n\n * `disabled` {`boolean`} - \n\n * `maxRows` {`number`} - Hard cap on the number of rows selectable via grid or custom input.\n\n * `maxCols` {`number`} - Hard cap on the number of columns selectable via grid or custom input.\n\n * `open` {`boolean`} - \n\n * `hoverRows` {`number`} - \n\n * `hoverCols` {`number`} - \n\n * `customRows` {`string`} - \n\n * `customCols` {`string`} - \n\n * `handleOutside` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
8546
8607
  "attributes": [
8547
8608
  {
8548
8609
  "name": "disabled",
8549
8610
  "description": "`disabled` {`boolean`} - \n\nProperty: disabled\n\nDefault: false",
8550
8611
  "valueSet": "v"
8612
+ },
8613
+ {
8614
+ "name": "max-rows",
8615
+ "description": "`max-rows` {`number`} - Hard cap on the number of rows selectable via grid or custom input.\n\nProperty: maxRows\n\nDefault: 20"
8616
+ },
8617
+ {
8618
+ "name": "max-cols",
8619
+ "description": "`max-cols` {`number`} - Hard cap on the number of columns selectable via grid or custom input.\n\nProperty: maxCols\n\nDefault: 20"
8551
8620
  }
8552
8621
  ]
8553
8622
  },
@@ -1 +0,0 @@
1
- import{c as t,T as e,a as i,S as r,d as n,e as s,F as l,D as o,M as h,A as f}from"./index-6f3fa4ab.esm.js";const u=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},c=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let a=null;const d=function(t,e,i){let r=a||(a=document.createRange());return r.setEnd(t,null==i?t.nodeValue.length:i),r.setStart(t,e||0),r},p=function(t,e,i,r){return i&&(b(t,e,i,r,-1)||b(t,e,i,r,1))},m=/^(img|br|input|textarea|hr)$/i;function b(t,e,i,r,n){for(var s;;){if(t==i&&e==r)return!0;if(e==(n<0?0:g(t))){let i=t.parentNode;if(!i||1!=i.nodeType||w(t)||m.test(t.nodeName)||"false"==t.contentEditable)return!1;e=u(t)+(n<0?0:1),t=i}else{if(1!=t.nodeType)return!1;{let i=t.childNodes[e+(n<0?-1:0)];if(1==i.nodeType&&"false"==i.contentEditable){if(!(null===(s=i.pmViewDesc)||void 0===s?void 0:s.ignoreForSelection))return!1;e+=n}else t=i,e=n<0?g(t):0}}}}function g(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function w(t){let e;for(let i=t;i&&!(e=i.pmViewDesc);i=i.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const k=function(t){return t.focusNode&&p(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function M(t,e){let i=document.createEvent("Event");return i.initEvent("keydown",!0,!0),i.keyCode=t,i.key=i.code=e,i}const y="undefined"!=typeof navigator?navigator:null,v="undefined"!=typeof document?document:null,D=y&&y.userAgent||"",x=/Edge\/(\d+)/.exec(D),O=/MSIE \d/.exec(D),S=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(D),T=!!(O||S||x),C=O?document.documentMode:S?+S[1]:x?+x[1]:0,P=!T&&/gecko\/(\d+)/i.test(D);P&&(/Firefox\/(\d+)/.exec(D)||[0,0])[1];const E=!T&&/Chrome\/(\d+)/.exec(D),N=!!E,R=E?+E[1]:0,A=!T&&!!y&&/Apple Computer/.test(y.vendor),B=A&&(/Mobile\/\w+/.test(D)||!!y&&y.maxTouchPoints>2),$=B||!!y&&/Mac/.test(y.platform),I=!!y&&/Win/.test(y.platform),F=/Android \d/.test(D),K=!!v&&"webkitFontSmoothing"in v.documentElement.style,L=K?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function q(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function H(t,e){return"number"==typeof t?t:t[e]}function W(t){let e=t.getBoundingClientRect(),i=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*i,top:e.top,bottom:e.top+t.clientHeight*r}}function V(t,e,i){if(!X(e)&&0==e.left)return;let r=t.someProp("scrollThreshold")||0,n=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let l=i||t.dom;l;){if(1!=l.nodeType){l=c(l);continue}let t=l,i=t==s.body,o=i?q(s):W(t),h=0,f=0;if(e.top<o.top+H(r,"top")?f=-(o.top-e.top+H(n,"top")):e.bottom>o.bottom-H(r,"bottom")&&(f=e.bottom-e.top>o.bottom-o.top?e.top+H(n,"top")-o.top:e.bottom-o.bottom+H(n,"bottom")),e.left<o.left+H(r,"left")?h=-(o.left-e.left+H(n,"left")):e.right>o.right-H(r,"right")&&(h=e.right-o.right+H(n,"right")),h||f)if(i)s.defaultView.scrollBy(h,f);else{let i=t.scrollLeft,r=t.scrollTop;f&&(t.scrollTop+=f),h&&(t.scrollLeft+=h);let n=t.scrollLeft-i,s=t.scrollTop-r;e={left:e.left-n,top:e.top-s,right:e.right-n,bottom:e.bottom-s}}let u=i?"fixed":getComputedStyle(l).position;if(/^(fixed|sticky)$/.test(u))break;l="absolute"==u?l.offsetParent:c(l)}}function j(t){let e=[],i=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=i);r=c(r));return e}function z(t,e){for(let i=0;i<t.length;i++){let{dom:r,top:n,left:s}=t[i];r.scrollTop!=n+e&&(r.scrollTop=n+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let G=null;function U(t,e){let i,r,n,s,l=2e8,o=0,h=e.top,f=e.top;for(let u=t.firstChild,c=0;u;u=u.nextSibling,c++){let t;if(1==u.nodeType)t=u.getClientRects();else{if(3!=u.nodeType)continue;t=d(u).getClientRects()}for(let a=0;a<t.length;a++){let d=t[a];if(d.top<=h&&d.bottom>=f){h=Math.max(d.bottom,h),f=Math.min(d.top,f);let t=d.left>e.left?d.left-e.left:d.right<e.left?e.left-d.right:0;if(t<l){i=u,l=t,r=t&&3==i.nodeType?{left:d.right<e.left?d.right:d.left,top:e.top}:e,1==u.nodeType&&t&&(o=c+(e.left>=(d.left+d.right)/2?1:0));continue}}else d.top>e.top&&!n&&d.left<=e.left&&d.right>=e.left&&(n=u,s={left:Math.max(d.left,Math.min(d.right,e.left)),top:d.top});!i&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(o=c+1)}}return!i&&n&&(i=n,r=s,l=0),i&&3==i.nodeType?function(t,e){let i,r=t.nodeValue.length,n=document.createRange();for(let s=0;s<r;s++){n.setEnd(t,s+1),n.setStart(t,s);let r=Z(n,1);if(r.top!=r.bottom&&J(e,r)){i={node:t,offset:s+(e.left>=(r.left+r.right)/2?1:0)};break}}return n.detach(),i||{node:t,offset:0}}(i,r):!i||l&&1==i.nodeType?{node:t,offset:o}:U(i,r)}function J(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Y(t,e,i){let r=t.childNodes.length;if(r&&i.top<i.bottom)for(let n=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-i.top)/(i.bottom-i.top))-2)),s=n;;){let i=t.childNodes[s];if(1==i.nodeType){let t=i.getClientRects();for(let r=0;r<t.length;r++){let n=t[r];if(J(e,n))return Y(i,e,n)}}if((s=(s+1)%r)==n)break}return t}function Q(t,e){let i,r=t.dom.ownerDocument,n=0,s=function(t,e,i){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,i);if(r)return{node:r.offsetNode,offset:Math.min(g(r.offsetNode),r.offset)}}catch(t){}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,i);if(r)return{node:r.startContainer,offset:Math.min(g(r.startContainer),r.startOffset)}}}(r,e.left,e.top);s&&({node:i,offset:n}=s);let l,o=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!o||!t.dom.contains(1!=o.nodeType?o.parentNode:o)){let i=t.dom.getBoundingClientRect();if(!J(e,i))return null;if(o=Y(t.dom,e,i),!o)return null}if(A)for(let t=o;i&&t;t=c(t))t.draggable&&(i=void 0);if(o=function(t,e){let i=t.parentNode;return i&&/^li$/i.test(i.nodeName)&&e.left<t.getBoundingClientRect().left?i:t}(o,e),i){if(P&&1==i.nodeType&&(n=Math.min(n,i.childNodes.length),n<i.childNodes.length)){let t,r=i.childNodes[n];"IMG"==r.nodeName&&(t=r.getBoundingClientRect()).right<=e.left&&t.bottom>e.top&&n++}let r;K&&n&&1==i.nodeType&&1==(r=i.childNodes[n-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=e.top&&n--,i==t.dom&&n==i.childNodes.length-1&&1==i.lastChild.nodeType&&e.top>i.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:0!=n&&1==i.nodeType&&"BR"==i.childNodes[n-1].nodeName||(l=function(t,e,i,r){let n=-1;for(let i=e,s=!1;i!=t.dom;){let e,l=t.docView.nearestDesc(i,!0);if(!l)return null;if(1==l.dom.nodeType&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((e=l.dom.getBoundingClientRect()).width||e.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!s&&e.left>r.left||e.top>r.top?n=l.posBefore:(!s&&e.right<r.left||e.bottom<r.top)&&(n=l.posAfter),s=!0),!l.contentDOM&&n<0&&!l.node.isText))return(l.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?l.posBefore:l.posAfter;i=l.dom.parentNode}return n>-1?n:t.docView.posFromDOM(e,i,-1)}(t,i,n,e))}null==l&&(l=function(t,e,i){let{node:r,offset:n}=U(e,i),s=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();s=t.left!=t.right&&i.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,n,s)}(t,o,e));let h=t.docView.nearestDesc(o,!0);return{pos:l,inside:h?h.posAtStart-h.border:-1}}function X(t){return t.top<t.bottom||t.left<t.right}function Z(t,e){let i=t.getClientRects();if(i.length){let t=i[e<0?0:i.length-1];if(X(t))return t}return Array.prototype.find.call(i,X)||t.getBoundingClientRect()}const _=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function tt(t,e,i){let{node:r,offset:n,atom:s}=t.docView.domFromPos(e,i<0?-1:1),l=K||P;if(3==r.nodeType){if(!l||!_.test(r.nodeValue)&&(i<0?n:n!=r.nodeValue.length)){let t=n,e=n,s=i<0?1:-1;return i<0&&!n?(e++,s=-1):i>=0&&n==r.nodeValue.length?(t--,s=1):i<0?t--:e++,et(Z(d(r,t,e),s),s<0)}{let t=Z(d(r,n,n),i);if(P&&n&&/\s/.test(r.nodeValue[n-1])&&n<r.nodeValue.length){let e=Z(d(r,n-1,n-1),-1);if(e.top==t.top){let i=Z(d(r,n,n+1),-1);if(i.top!=t.top)return et(i,i.left<e.left)}}return t}}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(null==s&&n&&(i<0||n==g(r))){let t=r.childNodes[n-1];if(1==t.nodeType)return it(t.getBoundingClientRect(),!1)}if(null==s&&n<g(r)){let t=r.childNodes[n];if(1==t.nodeType)return it(t.getBoundingClientRect(),!0)}return it(r.getBoundingClientRect(),i>=0)}if(null==s&&n&&(i<0||n==g(r))){let t=r.childNodes[n-1],e=3==t.nodeType?d(t,g(t)-(l?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return et(Z(e,1),!1)}if(null==s&&n<g(r)){let t=r.childNodes[n];for(;t.pmViewDesc&&t.pmViewDesc.ignoreForCoords;)t=t.nextSibling;let e=t?3==t.nodeType?d(t,0,l?0:1):1==t.nodeType?t:null:null;if(e)return et(Z(e,-1),!0)}return et(Z(3==r.nodeType?d(r):r,-i),i>=0)}function et(t,e){if(0==t.width)return t;let i=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:i,right:i}}function it(t,e){if(0==t.height)return t;let i=e?t.top:t.bottom;return{top:i,bottom:i,left:t.left,right:t.right}}function rt(t,e,i){let r=t.state,n=t.root.activeElement;r!=e&&t.updateState(e),n!=t.dom&&t.focus();try{return i()}finally{r!=e&&t.updateState(r),n!=t.dom&&n&&n.focus()}}const nt=/[\u0590-\u08ac]/;let st=null,lt=null,ot=!1;function ht(t,e,i){return st==e&&lt==i?ot:(st=e,lt=i,ot="up"==i||"down"==i?function(t,e,i){let r=e.selection,n="up"==i?r.$from:r.$to;return rt(t,e,(()=>{let{node:e}=t.docView.domFromPos(n.pos,"up"==i?-1:1);for(;;){let i=t.docView.nearestDesc(e,!0);if(!i)break;if(i.node.isBlock){e=i.contentDOM||i.dom;break}e=i.dom.parentNode}let r=tt(t,n.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=d(t,0,t.nodeValue.length).getClientRects()}for(let t=0;t<e.length;t++){let n=e[t];if(n.bottom>n.top+1&&("up"==i?r.top-n.top>2*(n.bottom-r.top):n.bottom-r.bottom>2*(r.bottom-n.top)))return!1}}return!0}))}(t,e,i):function(t,e,i){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let n=r.parentOffset,s=!n,l=n==r.parent.content.size,o=t.domSelection();return o?nt.test(r.parent.textContent)&&o.modify?rt(t,e,(()=>{let{focusNode:e,focusOffset:n,anchorNode:s,anchorOffset:l}=t.domSelectionRange(),h=o.caretBidiLevel;o.modify("move",i,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:u,focusOffset:c}=t.domSelectionRange(),a=u&&!f.contains(1==u.nodeType?u:u.parentNode)||e==u&&n==c;try{o.collapse(s,l),e&&(e!=s||n!=l)&&o.extend&&o.extend(e,n)}catch(t){}return null!=h&&(o.caretBidiLevel=h),a})):"left"==i||"backward"==i?s:l:r.pos==r.start()||r.pos==r.end()}(t,e,i))}class ft{constructor(t,e,i,r){this.parent=t,this.children=e,this.dom=i,this.contentDOM=r,this.dirty=0,i.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,i){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,i=this.posAtStart;;e++){let r=this.children[e];if(r==t)return i;i+=r.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(t,e,i){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(i<0){let i,r;if(t==this.contentDOM)i=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&(!(r=i.pmViewDesc)||r.parent!=this);)i=i.previousSibling;return i?this.posBeforeChild(r)+r.size:this.posAtStart}{let i,r;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&(!(r=i.pmViewDesc)||r.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(r):this.posAtEnd}}let r;if(t==this.dom&&this.contentDOM)r=e>u(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?i>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let i=!0,r=t;r;r=r.parentNode){let n,s=this.getDesc(r);if(s&&(!e||s.node)){if(!i||!(n=s.nodeDOM)||(1==n.nodeType?n.contains(1==t.nodeType?t:t.parentNode):n==t))return s;i=!1}}}getDesc(t){let e=t.pmViewDesc;for(let t=e;t;t=t.parent)if(t==this)return e}posFromDOM(t,e,i){for(let r=t;r;r=r.parentNode){let n=this.getDesc(r);if(n)return n.localPosFromDOM(t,e,i)}return-1}descAt(t){for(let e=0,i=0;e<this.children.length;e++){let r=this.children[e],n=i+r.size;if(i==t&&n!=i){for(;!r.border&&r.children.length;)for(let t=0;t<r.children.length;t++){let e=r.children[t];if(e.size){r=e;break}}return r}if(t<n)return r.descAt(t-i-r.border);i=n}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let i=0,r=0;for(let e=0;i<this.children.length;i++){let n=this.children[i],s=e+n.size;if(s>t||n instanceof bt){r=t-e;break}e=s}if(r)return this.children[i].domFromPos(r-this.children[i].border,e);for(let t;i&&!(t=this.children[i-1]).size&&t instanceof ut&&t.side>=0;i--);if(e<=0){let t,r=!0;for(;t=i?this.children[i-1]:null,t&&t.dom.parentNode!=this.contentDOM;i--,r=!1);return t&&e&&r&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?u(t.dom)+1:0}}{let t,r=!0;for(;t=i<this.children.length?this.children[i]:null,t&&t.dom.parentNode!=this.contentDOM;i++,r=!1);return t&&r&&!t.border&&!t.domAtom?t.domFromPos(0,e):{node:this.contentDOM,offset:t?u(t.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,i=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,n=-1;for(let s=i,l=0;;l++){let i=this.children[l],o=s+i.size;if(-1==r&&t<=o){let n=s+i.border;if(t>=n&&e<=o-i.border&&i.node&&i.contentDOM&&this.contentDOM.contains(i.contentDOM))return i.parseRange(t,e,n);t=s;for(let e=l;e>0;e--){let i=this.children[e-1];if(i.size&&i.dom.parentNode==this.contentDOM&&!i.emptyChildAt(1)){r=u(i.dom)+1;break}t-=i.size}-1==r&&(r=0)}if(r>-1&&(o>e||l==this.children.length-1)){e=o;for(let t=l+1;t<this.children.length;t++){let i=this.children[t];if(i.size&&i.dom.parentNode==this.contentDOM&&!i.emptyChildAt(-1)){n=u(i.dom);break}e+=i.size}-1==n&&(n=this.contentDOM.childNodes.length);break}s=o}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:n}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:i}=this.domFromPos(t,0);if(1!=e.nodeType||i==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[i]}setSelection(t,e,i,r=!1){let n=Math.min(t,e),s=Math.max(t,e);for(let l=0,o=0;l<this.children.length;l++){let h=this.children[l],f=o+h.size;if(n>o&&s<f)return h.setSelection(t-o-h.border,e-o-h.border,i,r);o=f}let l=this.domFromPos(t,t?-1:1),o=e==t?l:this.domFromPos(e,e?-1:1),h=i.root.getSelection(),f=i.domSelectionRange(),c=!1;if((P||A)&&t==e){let{node:t,offset:e}=l;if(3==t.nodeType){if(c=!(!e||"\n"!=t.nodeValue[e-1]),c&&e==t.nodeValue.length)for(let e,i=t;i;i=i.parentNode){if(e=i.nextSibling){"BR"==e.nodeName&&(l=o={node:e.parentNode,offset:u(e)+1});break}let t=i.pmViewDesc;if(t&&t.node&&t.node.isBlock)break}}else{let i=t.childNodes[e-1];c=i&&("BR"==i.nodeName||"false"==i.contentEditable)}}if(P&&f.focusNode&&f.focusNode!=o.node&&1==f.focusNode.nodeType){let t=f.focusNode.childNodes[f.focusOffset];t&&"false"==t.contentEditable&&(r=!0)}if(!(r||c&&A)&&p(l.node,l.offset,f.anchorNode,f.anchorOffset)&&p(o.node,o.offset,f.focusNode,f.focusOffset))return;let a=!1;if((h.extend||t==e)&&(!c||!P)){h.collapse(l.node,l.offset);try{t!=e&&h.extend(o.node,o.offset),a=!0}catch(t){}}if(!a){if(t>e){let t=l;l=o,o=t}let i=document.createRange();i.setEnd(o.node,o.offset),i.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(i)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let i=0,r=0;r<this.children.length;r++){let n=this.children[r],s=i+n.size;if(i==s?t<=s&&e>=i:t<s&&e>i){let r=i+n.border,l=s-n.border;if(t>=r&&e<=l)return this.dirty=t==i||e==s?2:1,void(t!=r||e!=l||!n.contentLost&&n.dom.parentNode==this.contentDOM?n.markDirty(t-r,e-r):n.dirty=3);n.dirty=n.dom!=n.contentDOM||n.dom.parentNode!=this.contentDOM||n.children.length?3:2}i=s}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let i=1==t?2:1;e.dirty<i&&(e.dirty=i)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class ut extends ft{constructor(t,e,i,r){let n,s=e.type.toDOM;if("function"==typeof s&&(s=s(i,(()=>n?n.parent?n.parent.posBeforeChild(n):void 0:r))),!e.type.spec.raw){if(1!=s.nodeType){let t=document.createElement("span");t.appendChild(s),s=t}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=e,this.widget=e,n=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.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 ct extends ft{constructor(t,e,i,r){super(t,[],e,null),this.textDOM=i,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class at extends ft{constructor(t,e,i,r,n){super(t,[],i,r),this.mark=e,this.spec=n}static create(t,e,r,n){let s=n.nodeViews[e.type.name],l=s&&s(e,n,r);return l&&l.dom||(l=i.renderSpec(document,e.type.spec.toDOM(e,r),null,e.attrs)),new at(t,e,l.dom,l.contentDOM||l.dom,l)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty<this.dirty&&(t.dirty=this.dirty),this.dirty=0}}slice(t,e,i){let r=at.create(this.parent,this.mark,!0,i),n=this.children,s=this.size;e<s&&(n=Pt(n,e,s,i)),t>0&&(n=Pt(n,0,t,i));for(let t=0;t<n.length;t++)n[t].parent=r;return r.children=n,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class dt extends ft{constructor(t,e,i,r,n,s,l){super(t,[],n,s),this.node=e,this.outerDeco=i,this.innerDeco=r,this.nodeDOM=l}static create(t,e,r,n,s,l){let o,h=s.nodeViews[e.type.name],f=h&&h(e,s,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:l),r,n),u=f&&f.dom,c=f&&f.contentDOM;if(e.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(e.text);else if(!u){let t=i.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);({dom:u,contentDOM:c}=t)}c||e.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),e.type.spec.draggable&&(u.draggable=!0));let a=u;return u=xt(u,r,e),f?o=new gt(t,e,r,n,u,c||null,a,f):e.isText?new mt(t,e,r,n,u,a):new dt(t,e,r,n,u,c||null,a)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let i=this.children[e];if(this.dom.contains(i.dom.parentNode)){t.contentElement=i.dom.parentNode;break}}t.contentElement||(t.getContent=()=>l.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,i){return 0==this.dirty&&t.eq(this.node)&&Ot(e,this.outerDeco)&&i.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let i=this.node.inlineContent,r=e,n=t.composing?this.localCompositionInfo(t,e):null,s=n&&n.pos>-1?n:null,l=n&&n.pos<0,o=new Tt(this,s&&s.node,t);!function(t,e,i,r){let n=e.locals(t),s=0;if(0==n.length){for(let i=0;i<t.childCount;i++){let l=t.child(i);r(l,n,e.forChild(s,l),i),s+=l.nodeSize}return}let l=0,o=[],h=null;for(let f=0;;){let u,c,a,d;for(;l<n.length&&n[l].to==s;){let t=n[l++];t.widget&&(u?(c||(c=[u])).push(t):u=t)}if(u)if(c){c.sort(Ct);for(let t=0;t<c.length;t++)i(c[t],f,!!h)}else i(u,f,!!h);if(h)d=-1,a=h,h=null;else{if(!(f<t.childCount))break;d=f,a=t.child(f++)}for(let t=0;t<o.length;t++)o[t].to<=s&&o.splice(t--,1);for(;l<n.length&&n[l].from<=s&&n[l].to>s;)o.push(n[l++]);let p=s+a.nodeSize;if(a.isText){let t=p;l<n.length&&n[l].from<t&&(t=n[l].from);for(let e=0;e<o.length;e++)o[e].to<t&&(t=o[e].to);t<p&&(h=a.cut(t-s),a=a.cut(0,t-s),p=t,d=-1)}else for(;l<n.length&&n[l].to<p;)l++;r(a,a.isInline&&!a.isLeaf?o.filter((t=>!t.inline)):o.slice(),e.forChild(s,a),d),s=p}}(this.node,this.innerDeco,((e,n,s)=>{e.spec.marks?o.syncToMarks(e.spec.marks,i,t,n):e.type.side>=0&&!s&&o.syncToMarks(n==this.node.childCount?h.none:this.node.child(n).marks,i,t,n),o.placeWidget(e,t,r)}),((e,s,h,f)=>{let u;o.syncToMarks(e.marks,i,t,f),o.findNodeMatch(e,s,h,f)||l&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(u=o.findIndexWithChild(n.node))>-1&&o.updateNodeAt(e,s,h,u,t)||o.updateNextNode(e,s,h,t,f,r)||o.addNode(e,s,h,t,r),r+=e.nodeSize})),o.syncToMarks([],i,t,0),this.node.isTextblock&&o.addTextblockHacks(),o.destroyRest(),(o.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),wt(this.contentDOM,this.children,t),B&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,i){let{from:r,to:n}=t.state.selection;if(!(t.state.selection instanceof e)||r<i||n>i+this.node.content.size)return null;let s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let t=s.nodeValue,e=function(t,e,i,r){for(let n=0,s=0;n<t.childCount&&s<=r;){let l=t.child(n++),o=s;if(s+=l.nodeSize,!l.isText)continue;let h=l.text;for(;n<t.childCount;){let e=t.child(n++);if(s+=e.nodeSize,!e.isText)break;h+=e.text}if(s>=i){if(s>=r&&h.slice(r-e.length-o,r-o)==e)return r-e.length;let t=o<r?h.lastIndexOf(e,r-o-1):-1;if(t>=0&&t+e.length+o>=i)return o+t;if(i==r&&h.length>=r+e.length-o&&h.slice(r-o,r-o+e.length)==e)return r}}return-1}(this.node.content,t,r-i,n-i);return e<0?null:{node:s,pos:e,text:t}}return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:i,text:r}){if(this.getDesc(e))return;let n=e;for(;n.parentNode!=this.contentDOM;n=n.parentNode){for(;n.previousSibling;)n.parentNode.removeChild(n.previousSibling);for(;n.nextSibling;)n.parentNode.removeChild(n.nextSibling);n.pmViewDesc&&(n.pmViewDesc=void 0)}let s=new ct(this,n,e,r);t.input.compositionNodes.push(s),this.children=Pt(this.children,i,i+r.length,t,s)}update(t,e,i,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,i,r),!0)}updateInner(t,e,i,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=i,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(Ot(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,i=this.dom;this.dom=vt(this.dom,this.nodeDOM,yt(this.outerDeco,this.node,e),yt(t,this.node,e)),this.dom!=i&&(i.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}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 pt(t,e,i,r,n){xt(r,e,t);let s=new dt(void 0,t,e,i,r,r,r);return s.contentDOM&&s.updateChildren(n,0),s}class mt extends dt{constructor(t,e,i,r,n,s){super(t,e,i,r,n,null,s)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,i,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,i){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,i)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,i){let r=this.node.cut(t,e),n=document.createTextNode(r.text);return new mt(this.parent,r,this.outerDeco,this.innerDeco,n,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(t){return this.node.text==t}}class bt extends ft{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class gt extends dt{constructor(t,e,i,r,n,s,l,o){super(t,e,i,r,n,s,l),this.spec=o}update(t,e,i,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let n=this.spec.update(t,e,i);return n&&this.updateInner(t,e,i,r),n}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,i,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,i,r){this.spec.setSelection?this.spec.setSelection(t,e,i.root):super.setSelection(t,e,i,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function wt(t,e,i){let r=t.firstChild,n=!1;for(let s=0;s<e.length;s++){let l=e[s],o=l.dom;if(o.parentNode==t){for(;o!=r;)r=St(r),n=!0;r=r.nextSibling}else n=!0,t.insertBefore(o,r);if(l instanceof at){let e=r?r.previousSibling:t.lastChild;wt(l.contentDOM,l.children,i),r=e?e.nextSibling:t.firstChild}}for(;r;)r=St(r),n=!0;n&&i.trackWrites==t&&(i.trackWrites=null)}const kt=function(t){t&&(this.nodeName=t)};kt.prototype=Object.create(null);const Mt=[new kt];function yt(t,e,i){if(0==t.length)return Mt;let r=i?Mt[0]:new kt,n=[r];for(let s=0;s<t.length;s++){let l=t[s].type.attrs;if(l){l.nodeName&&n.push(r=new kt(l.nodeName));for(let t in l){let s=l[t];null!=s&&(i&&1==n.length&&n.push(r=new kt(e.isInline?"span":"div")),"class"==t?r.class=(r.class?r.class+" ":"")+s:"style"==t?r.style=(r.style?r.style+";":"")+s:"nodeName"!=t&&(r[t]=s))}}}return n}function vt(t,e,i,r){if(i==Mt&&r==Mt)return e;let n=e;for(let e=0;e<r.length;e++){let s=r[e],l=i[e];if(e){let e;l&&l.nodeName==s.nodeName&&n!=t&&(e=n.parentNode)&&e.nodeName.toLowerCase()==s.nodeName||(e=document.createElement(s.nodeName),e.pmIsDeco=!0,e.appendChild(n),l=Mt[0]),n=e}Dt(n,l||Mt[0],s)}return n}function Dt(t,e,i){for(let r in e)"class"==r||"style"==r||"nodeName"==r||r in i||t.removeAttribute(r);for(let r in i)"class"!=r&&"style"!=r&&"nodeName"!=r&&i[r]!=e[r]&&t.setAttribute(r,i[r]);if(e.class!=i.class){let r=e.class?e.class.split(" ").filter(Boolean):[],n=i.class?i.class.split(" ").filter(Boolean):[];for(let e=0;e<r.length;e++)-1==n.indexOf(r[e])&&t.classList.remove(r[e]);for(let e=0;e<n.length;e++)-1==r.indexOf(n[e])&&t.classList.add(n[e]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=i.style){if(e.style){let i,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}i.style&&(t.style.cssText+=i.style)}}function xt(t,e,i){return vt(t,t,Mt,yt(e,i,1!=t.nodeType))}function Ot(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].type.eq(e[i].type))return!1;return!0}function St(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Tt{constructor(t,e,i){this.lock=e,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,e){let i=e,r=i.children.length,n=t.childCount,s=new Map,l=[];t:for(;n>0;){let o;for(;;)if(r){let t=i.children[r-1];if(!(t instanceof at)){o=t,r--;break}i=t,r=t.children.length}else{if(i==e)break t;r=i.parent.children.indexOf(i),i=i.parent}let h=o.node;if(h){if(h!=t.child(n-1))break;--n,s.set(o,n),l.push(o)}}return{index:n,matched:s,matches:l.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let i=t;i<e;i++)this.top.children[i].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,i,r){let n=0,s=this.stack.length>>1,l=Math.min(s,t.length);for(;n<l&&(n==s-1?this.top:this.stack[n+1<<1]).matchesMark(t[n])&&!1!==t[n].type.spec.spanning;)n++;for(;n<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);let n=-1,l=this.top.children.length;r<this.preMatch.index&&(l=Math.min(this.index+3,l));for(let e=this.index;e<l;e++){let i=this.top.children[e];if(i.matchesMark(t[s])&&!this.isLocked(i.dom)){n=e;break}}if(n<0&&this.index<this.top.children.length){let e=this.top.children[this.index];e instanceof at&&3!=e.dirty&&e.mark.type==t[s].type&&e.spec.update&&!this.isLocked(e.dom)&&e.spec.update(t[s])&&(e.mark=t[s],n=this.index,this.changed=!0)}if(n>-1)n>this.index&&(this.changed=!0,this.destroyBetween(this.index,n)),this.top=this.top.children[this.index];else{let r=at.create(this.top,t[s],e,i);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,s++}}findNodeMatch(t,e,i,r){let n,s=-1;if(r>=this.preMatch.index&&(n=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&n.matchesNode(t,e,i))s=this.top.children.indexOf(n,this.index);else for(let r=this.index,n=Math.min(this.top.children.length,r+5);r<n;r++){let n=this.top.children[r];if(n.matchesNode(t,e,i)&&!this.preMatch.matched.has(n)){s=r;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(t,e,i,r,n){let s=this.top.children[r];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(t,e,i,n)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let e=t.pmViewDesc;if(e)for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==e)return t;return-1}t=e}}updateNextNode(t,e,i,r,n,s){for(let l=this.index;l<this.top.children.length;l++){let o=this.top.children[l];if(o instanceof dt){let h=this.preMatch.matched.get(o);if(null!=h&&h!=n)return!1;let f,u=o.dom,c=this.isLocked(u)&&!(t.isText&&o.node&&o.node.isText&&o.nodeDOM.nodeValue==t.text&&3!=o.dirty&&Ot(e,o.outerDeco));if(!c&&o.update(t,e,i,r))return this.destroyBetween(this.index,l),o.dom!=u&&(this.changed=!0),this.index++,!0;if(!c&&(f=this.recreateWrapper(o,t,e,i,r,s)))return this.destroyBetween(this.index,l),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=2,f.updateChildren(r,s+1),f.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,i,r,n,s){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!Ot(i,t.outerDeco)||!r.eq(t.innerDeco))return null;let l=dt.create(this.top,e,i,r,n,s);if(l.contentDOM){l.children=t.children,t.children=[];for(let t of l.children)t.parent=l}return t.destroy(),l}addNode(t,e,i,r,n){let s=dt.create(this.top,t,e,i,r,n);s.contentDOM&&s.updateChildren(r,n+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,e,i){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){let r=new ut(this.top,t,e,i);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof at;)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof mt)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((A||N)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let i=document.createElement(t);"IMG"==t&&(i.className="ProseMirror-separator",i.alt=""),"BR"==t&&(i.className="ProseMirror-trailingBreak");let r=new bt(this.top,[],i,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function Ct(t,e){return t.type.side-e.type.side}function Pt(t,e,i,r,n){let s=[];for(let l=0,o=0;l<t.length;l++){let h=t[l],f=o,u=o+=h.size;f>=i||u<=e?s.push(h):(f<e&&s.push(h.slice(0,e-f,r)),n&&(s.push(n),n=void 0),u>i&&s.push(h.slice(i-f,h.size,r)))}return s}function Et(e,i=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let s=e.docView.nearestDesc(r.focusNode),l=s&&0==s.size,o=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(o<0)return null;let h,f,c=n.resolve(o);if(k(r)){for(h=o;s&&!s.node;)s=s.parent;let e=s.node;if(s&&e.isAtom&&t.isSelectable(e)&&s.parent&&(!e.isInline||!function(t,e,i){for(let r=0==e,n=e==g(t);r||n;){if(t==i)return!0;let e=u(t);if(!(t=t.parentNode))return!1;r=r&&0==e,n=n&&e==g(t)}}(r.focusNode,r.focusOffset,s.dom))){let e=s.posBefore;f=new t(o==e?c:n.resolve(e))}}else{if(r instanceof e.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let t=o,i=o;for(let n=0;n<r.rangeCount;n++){let s=r.getRangeAt(n);t=Math.min(t,e.docView.posFromDOM(s.startContainer,s.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(s.endContainer,s.endOffset,-1))}if(t<0)return null;[h,o]=i==e.state.selection.anchor?[i,t]:[t,i],c=n.resolve(o)}else h=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(h<0)return null}let a=n.resolve(h);if(!f){f=Lt(e,a,c,"pointer"==i||e.state.selection.head<c.pos&&!l?1:-1)}return f}function Nt(t){return t.editable?t.hasFocus():Ht(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Rt(t,i=!1){let r=t.state.selection;if(Ft(t,r),!Nt(t))return;let n=t.input.mouseDown;if(!i&&N&&n){let e=t.domSelectionRange(),i=t.domObserver.currentSelection;if(e.anchorNode&&i.anchorNode&&p(e.anchorNode,e.anchorOffset,i.anchorNode,i.anchorOffset)&&n.delaySelUpdate())return void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection();if(!e)return;let i=t.cursorWrapper.dom,r="IMG"==i.nodeName;r?e.collapse(i.parentNode,u(i)+1):e.collapse(i,0);!r&&!t.state.selection.visible&&T&&C<=11&&(i.disabled=!0,i.disabled=!1)}(t);else{let n,s,{anchor:l,head:o}=r;!At||r instanceof e||(r.$from.parent.inlineContent||(n=Bt(t,r.from)),r.empty||r.$from.parent.inlineContent||(s=Bt(t,r.to))),t.docView.setSelection(l,o,t,i),At&&(n&&It(n),s&&It(s)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let i=t.domSelectionRange(),r=i.anchorNode,n=i.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{i.anchorNode==r&&i.anchorOffset==n||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Nt(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const At=A||N&&R<63;function Bt(t,e){let{node:i,offset:r}=t.docView.domFromPos(e,0),n=r<i.childNodes.length?i.childNodes[r]:null,s=r?i.childNodes[r-1]:null;if(A&&n&&"false"==n.contentEditable)return $t(n);if(!(n&&"false"!=n.contentEditable||s&&"false"!=s.contentEditable)){if(n)return $t(n);if(s)return $t(s)}}function $t(t){return t.contentEditable="true",A&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function It(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Ft(e,i){if(i instanceof t){let t=e.docView.descAt(i.from);t!=e.lastSelectedViewDesc&&(Kt(e),t&&t.selectNode(),e.lastSelectedViewDesc=t)}else Kt(e)}function Kt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Lt(t,i,r,n){return t.someProp("createSelectionBetween",(e=>e(t,i,r)))||e.between(i,r,n)}function qt(t){return!(t.editable&&!t.hasFocus())&&Ht(t)}function Ht(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Wt(t,e){let{$anchor:i,$head:n}=t.selection,s=e>0?i.max(n):i.min(n),l=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return l&&r.findFrom(l,e)}function Vt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function jt(i,r,n){let s=i.state.selection;if(!(s instanceof e)){if(s instanceof t&&s.node.isInline)return Vt(i,new e(r>0?s.$to:s.$from));{let t=Wt(i.state,r);return!!t&&Vt(i,t)}}if(n.indexOf("s")>-1){let{$head:t}=s,n=t.textOffset?null:r<0?t.nodeBefore:t.nodeAfter;if(!n||n.isText||!n.isLeaf)return!1;let l=i.state.doc.resolve(t.pos+n.nodeSize*(r<0?-1:1));return Vt(i,new e(s.$anchor,l))}if(!s.empty)return!1;if(i.endOfTextblock(r>0?"forward":"backward")){let e=Wt(i.state,r);return!!(e&&e instanceof t)&&Vt(i,e)}if(!($&&n.indexOf("m")>-1)){let n,l=s.$head,o=l.textOffset?null:r<0?l.nodeBefore:l.nodeAfter;if(!o||o.isText)return!1;let h=r<0?l.pos-o.nodeSize:l.pos;return!!(o.isAtom||(n=i.docView.descAt(h))&&!n.contentDOM)&&(t.isSelectable(o)?Vt(i,new t(r<0?i.state.doc.resolve(l.pos-o.nodeSize):l)):!!K&&Vt(i,new e(i.state.doc.resolve(r<0?h:h+o.nodeSize))))}}function zt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Gt(t,e){let i=t.pmViewDesc;return i&&0==i.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function Ut(t,e){return e<0?function(t){let e=t.domSelectionRange(),i=e.focusNode,r=e.focusOffset;if(!i)return;let n,s,l=!1;P&&1==i.nodeType&&r<zt(i)&&Gt(i.childNodes[r],-1)&&(l=!0);for(;;)if(r>0){if(1!=i.nodeType)break;{let t=i.childNodes[r-1];if(Gt(t,-1))n=i,s=--r;else{if(3!=t.nodeType)break;i=t,r=i.nodeValue.length}}}else{if(Jt(i))break;{let e=i.previousSibling;for(;e&&Gt(e,-1);)n=i.parentNode,s=u(e),e=e.previousSibling;if(e)i=e,r=zt(i);else{if(i=i.parentNode,i==t.dom)break;r=0}}}l?Yt(t,i,r):n&&Yt(t,n,s)}(t):function(t){let e=t.domSelectionRange(),i=e.focusNode,r=e.focusOffset;if(!i)return;let n,s,l=zt(i);for(;;)if(r<l){if(1!=i.nodeType)break;if(!Gt(i.childNodes[r],1))break;n=i,s=++r}else{if(Jt(i))break;{let e=i.nextSibling;for(;e&&Gt(e,1);)n=e.parentNode,s=u(e)+1,e=e.nextSibling;if(e)i=e,r=0,l=zt(i);else{if(i=i.parentNode,i==t.dom)break;r=l=0}}}n&&Yt(t,n,s)}(t)}function Jt(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Yt(t,e,i){if(3!=e.nodeType){let t,r;(r=function(t,e){for(;t&&e==t.childNodes.length&&!w(t);)e=u(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let i=t.childNodes[e];if(3==i.nodeType)return i;if(1==i.nodeType&&"false"==i.contentEditable)break;t=i,e=0}}(e,i))?(e=r,i=0):(t=function(t,e){for(;t&&!e&&!w(t);)e=u(t),t=t.parentNode;for(;t&&e;){let i=t.childNodes[e-1];if(3==i.nodeType)return i;if(1==i.nodeType&&"false"==i.contentEditable)break;e=(t=i).childNodes.length}}(e,i))&&(e=t,i=t.nodeValue.length)}let r=t.domSelection();if(!r)return;if(k(r)){let t=document.createRange();t.setEnd(e,i),t.setStart(e,i),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,i);t.domObserver.setCurSelection();let{state:n}=t;setTimeout((()=>{t.state==n&&Rt(t)}),50)}function Qt(t,e){let i=t.state.doc.resolve(e);if(!N&&!I&&i.parent.inlineContent){let r=t.coordsAtPos(e);if(e>i.start()){let i=t.coordsAtPos(e-1),n=(i.top+i.bottom)/2;if(n>r.top&&n<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(e<i.end()){let i=t.coordsAtPos(e+1),n=(i.top+i.bottom)/2;if(n>r.top&&n<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function Xt(i,n,s){let l=i.state.selection;if(l instanceof e&&!l.empty||s.indexOf("s")>-1)return!1;if($&&s.indexOf("m")>-1)return!1;let{$from:o,$to:h}=l;if(!o.parent.inlineContent||i.endOfTextblock(n<0?"up":"down")){let e=Wt(i.state,n);if(e&&e instanceof t)return Vt(i,e)}if(!o.parent.inlineContent){let t=n<0?o:h,e=l instanceof f?r.near(t,n):r.findFrom(t,n);return!!e&&Vt(i,e)}return!1}function Zt(t,i){if(!(t.state.selection instanceof e))return!0;let{$head:r,$anchor:n,empty:s}=t.state.selection;if(!r.sameParent(n))return!0;if(!s)return!1;if(t.endOfTextblock(i>0?"forward":"backward"))return!0;let l=!r.textOffset&&(i<0?r.nodeBefore:r.nodeAfter);if(l&&!l.isText){let e=t.state.tr;return i<0?e.delete(r.pos-l.nodeSize,r.pos):e.delete(r.pos,r.pos+l.nodeSize),t.dispatch(e),!0}return!1}function _t(t,e,i){t.domObserver.stop(),e.contentEditable=i,t.domObserver.start()}function te(t,e){let i=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==i||$&&72==i&&"c"==r)return Zt(t,-1)||Ut(t,-1);if(46==i&&!e.shiftKey||$&&68==i&&"c"==r)return Zt(t,1)||Ut(t,1);if(13==i||27==i)return!0;if(37==i||$&&66==i&&"c"==r){let e=37==i?"ltr"==Qt(t,t.state.selection.from)?-1:1:-1;return jt(t,e,r)||Ut(t,e)}if(39==i||$&&70==i&&"c"==r){let e=39==i?"ltr"==Qt(t,t.state.selection.from)?1:-1:1;return jt(t,e,r)||Ut(t,e)}return 38==i||$&&80==i&&"c"==r?Xt(t,-1,r)||Ut(t,-1):40==i||$&&78==i&&"c"==r?function(t){if(!A||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:i}=t.domSelectionRange();if(e&&1==e.nodeType&&0==i&&e.firstChild&&"false"==e.firstChild.contentEditable){let i=e.firstChild;_t(t,i,"true"),setTimeout((()=>_t(t,i,"false")),20)}return!1}(t)||Xt(t,1,r)||Ut(t,1):r==($?"m":"c")&&(66==i||73==i||89==i||90==i)}function ee(t,e){t.someProp("transformCopied",(i=>{e=i(e,t)}));let r=[],{content:n,openStart:s,openEnd:l}=e;for(;s>1&&l>1&&1==n.childCount&&1==n.firstChild.childCount;){s--,l--;let t=n.firstChild;r.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),n=t.content}let o=t.someProp("clipboardSerializer")||i.fromSchema(t.state.schema),h=ue(),f=h.createElement("div");f.appendChild(o.serializeFragment(n,{document:h}));let u,c=f.firstChild,a=0;for(;c&&1==c.nodeType&&(u=fe[c.nodeName.toLowerCase()]);){for(let t=u.length-1;t>=0;t--){let e=h.createElement(u[t]);for(;f.firstChild;)e.appendChild(f.firstChild);f.appendChild(e),a++}c=f.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${s} ${l}${a?` -${a}`:""} ${JSON.stringify(r)}`),{dom:f,text:t.someProp("clipboardTextSerializer",(i=>i(e,t)))||e.content.textBetween(0,e.content.size,"\n\n"),slice:e}}function ie(t,e,r,s,h){let f,u,c=h.parent.type.spec.code;if(!r&&!e)return null;let a=!!e&&(s||c||!r);if(a){if(t.someProp("transformPastedText",(i=>{e=i(e,c||s,t)})),c)return u=new n(l.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0),t.someProp("transformPasted",(e=>{u=e(u,t,!0)})),u;let r=t.someProp("clipboardTextParser",(i=>i(e,h,s,t)));if(r)u=r;else{let r=h.marks(),{schema:n}=t.state,s=i.fromSchema(n);f=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=f.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(n.text(t,r)))}))}}else t.someProp("transformPastedHTML",(e=>{r=e(r,t)})),f=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let i,r=ue(),n=r.body,s=/<([a-z][^>\s]+)/i.exec(t);(i=s&&fe[s[1].toLowerCase()])&&(t=i.map((t=>"<"+t+">")).join("")+t+i.map((t=>"</"+t+">")).reverse().join(""));if(n.innerHTML=function(t){let e=window.trustedTypes;if(!e)return t;ce||(ce=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t}));return ce.createHTML(t)}(t),i)for(let t=0;t<i.length;t++)n=n.querySelector(i[t])||n;for(let t=0;t<r.styleSheets.length;t++){let e=r.styleSheets[t];for(let t=0;t<e.rules.length;t++){let i=e.rules[t];if(i instanceof CSSStyleRule){let t=n.querySelectorAll(i.selectorText);for(let e=0;e<t.length;e++)t[e].style.cssText+=i.style.cssText}}}return n}(r),K&&function(t){let e=t.querySelectorAll(N?"span:not([class]):not([style])":"span.Apple-converted-space");for(let i=0;i<e.length;i++){let r=e[i];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(f);let d=f&&f.querySelector("[data-pm-slice]"),p=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let t=+p[3];t>0;t--){let t=f.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;f=t}if(!u){let e=t.someProp("clipboardParser")||t.someProp("domParser")||o.fromSchema(t.state.schema);u=e.parseSlice(f,{preserveWhitespace:!(!a&&!p),context:h,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||re.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(p)u=function(t,e){if(!t.size)return t;let i,r=t.content.firstChild.type.schema;try{i=JSON.parse(e)}catch(e){return t}let{content:s,openStart:o,openEnd:h}=t;for(let t=i.length-2;t>=0;t-=2){let e=r.nodes[i[t]];if(!e||e.hasRequiredAttrs())break;s=l.from(e.create(i[t+1],s)),o++,h++}return new n(s,o,h)}(he(u,+p[1],+p[2]),p[4]);else if(u=n.maxOpen(function(t,e){if(t.childCount<2)return t;for(let i=e.depth;i>=0;i--){let r,n=e.node(i).contentMatchAt(e.index(i)),s=[];if(t.forEach((t=>{if(!s)return;let e,i=n.findWrapping(t.type);if(!i)return s=null;if(e=s.length&&r.length&&se(i,r,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=le(s[s.length-1],r.length));let e=ne(t,i);s.push(e),n=n.matchType(e.type),r=i}})),s)return l.from(s)}return t}(u.content,h),!0),u.openStart||u.openEnd){let t=0,e=0;for(let e=u.content.firstChild;t<u.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=u.content.lastChild;e<u.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);u=he(u,t,e)}return t.someProp("transformPasted",(e=>{u=e(u,t,a)})),u}const re=/^(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 ne(t,e,i=0){for(let r=e.length-1;r>=i;r--)t=e[r].create(null,l.from(t));return t}function se(t,e,i,r,n){if(n<t.length&&n<e.length&&t[n]==e[n]){let s=se(t,e,i,r.lastChild,n+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(n==t.length-1?i.type:t[n+1]))return r.copy(r.content.append(l.from(ne(i,t,n+1))))}}function le(t,e){if(0==e)return t;let i=t.content.replaceChild(t.childCount-1,le(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(l.empty,!0);return t.copy(i.append(r))}function oe(t,e,i,r,n,s){let o=e<0?t.firstChild:t.lastChild,h=o.content;return t.childCount>1&&(s=0),n<r-1&&(h=oe(h,e,i,r,n+1,s)),n>=i&&(h=e<0?o.contentMatchAt(0).fillBefore(h,s<=n).append(h):h.append(o.contentMatchAt(o.childCount).fillBefore(l.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(h))}function he(t,e,i){return e<t.openStart&&(t=new n(oe(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),i<t.openEnd&&(t=new n(oe(t.content,1,i,t.openEnd,0,0),t.openStart,i)),t}const fe={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function ue(){return document.implementation.createHTMLDocument("title")}let ce=null;const ae={},de={},pe={touchstart:!0,touchmove:!0};class me{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=Object.create(null),this.hideSelectionGuard=null}}function be(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function ge(t){t.someProp("handleDOMEvents",(e=>{for(let i in e)t.input.eventHandlers[i]||t.dom.addEventListener(i,t.input.eventHandlers[i]=e=>we(t,e))}))}function we(t,e){return t.someProp("handleDOMEvents",(i=>{let r=i[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function ke(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target;i!=t.dom;i=i.parentNode)if(!i||11==i.nodeType||i.pmViewDesc&&i.pmViewDesc.stopEvent(e))return!1;return!0}function Me(t){return{left:t.clientX,top:t.clientY}}function ye(t,e,i,r,n){if(-1==r)return!1;let s=t.state.doc.resolve(r);for(let r=s.depth+1;r>0;r--)if(t.someProp(e,(e=>r>s.depth?e(t,i,s.nodeAfter,s.before(r),n,!0):e(t,i,s.node(r),s.before(r),n,!1))))return!0;return!1}function ve(t,e,i){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);"pointer"==i&&r.setMeta("pointer",!0),t.dispatch(r)}function De(e,i,r,n,s){return ye(e,"handleClickOn",i,r,n)||e.someProp("handleClick",(t=>t(e,i,n)))||(s?function(e,i){if(-1==i)return!1;let r,n,s=e.state.selection;s instanceof t&&(r=s.node);let l=e.state.doc.resolve(i);for(let e=l.depth+1;e>0;e--){let i=e>l.depth?l.nodeAfter:l.node(e);if(t.isSelectable(i)){n=r&&s.$from.depth>0&&e>=s.$from.depth&&l.before(s.$from.depth+1)==s.$from.pos?l.before(s.$from.depth):l.before(e);break}}return null!=n&&(ve(e,t.create(e.state.doc,n),"pointer"),!0)}(e,r):function(e,i){if(-1==i)return!1;let r=e.state.doc.resolve(i),n=r.nodeAfter;return!!(n&&n.isAtom&&t.isSelectable(n))&&(ve(e,new t(r),"pointer"),!0)}(e,r))}function xe(t,e,i,r){return ye(t,"handleDoubleClickOn",e,i,r)||t.someProp("handleDoubleClick",(i=>i(t,e,r)))}function Oe(t,i,r,n){return ye(t,"handleTripleClickOn",i,r,n)||t.someProp("handleTripleClick",(e=>e(t,i,n)))||function(t,i,r){if(0!=r.button)return!1;let n=Se(t,i,!0),s=t.state.doc;if(!n)return!1;ve(t,n,"pointer"),n instanceof e&&s.eq(t.state.doc)&&(t.input.mouseDown=new Ne(t,n));return!0}(t,r,n)}function Se(i,r,n){let s=i.state.doc;if(-1==r)return s.inlineContent?e.create(s,0,s.content.size):null;let l=s.resolve(r);for(let i=l.depth+1;i>0;i--){let r=i>l.depth?l.nodeAfter:l.node(i),o=l.before(i);if(r.inlineContent)return e.create(s,o+1,o+1+r.content.size);if(n&&t.isSelectable(r))return t.create(s,o)}return null}function Te(t){return Fe(t)}de.keydown=(t,e)=>{let i=e;if(t.input.shiftKey=16==i.keyCode||i.shiftKey,!Re(t)&&(t.input.lastKeyCode=i.keyCode,t.input.lastKeyCodeTime=Date.now(),!F||!N||13!=i.keyCode))if(229!=i.keyCode&&t.domObserver.forceFlush(),!B||13!=i.keyCode||i.ctrlKey||i.altKey||i.metaKey)t.someProp("handleKeyDown",(e=>e(t,i)))||te(t,i)?i.preventDefault():be(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,M(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},de.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},de.keypress=(t,i)=>{let r=i;if(Re(t)||!r.charCode||r.ctrlKey&&!r.altKey||$&&r.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,r))))return void r.preventDefault();let n=t.state.selection;if(!(n instanceof e&&n.$from.sameParent(n.$to))){let e=String.fromCharCode(r.charCode),i=()=>t.state.tr.insertText(e).scrollIntoView();/[\r\n]/.test(e)||t.someProp("handleTextInput",(r=>r(t,n.$from.pos,n.$to.pos,e,i)))||t.dispatch(i()),r.preventDefault()}};const Ce=$?"metaKey":"ctrlKey";ae.mousedown=(t,e)=>{let i=e;t.input.shiftKey=i.shiftKey;let r=Te(t),n=Date.now(),s="singleClick";n-t.input.lastClick.time<500&&function(t,e){let i=e.x-t.clientX,r=e.y-t.clientY;return i*i+r*r<100}(i,t.input.lastClick)&&!i[Ce]&&t.input.lastClick.button==i.button&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:n,x:i.clientX,y:i.clientY,type:s,button:i.button},t.input.mouseDown&&t.input.mouseDown.done();let l=t.posAtCoords(Me(i));l&&("singleClick"==s?t.input.mouseDown=new Ee(t,l,i,!!r):("doubleClick"==s?xe:Oe)(t,l.pos,l.inside,i)?i.preventDefault():be(t,"pointer"))};class Pe{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){0==t.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class Ee extends Pe{constructor(e,i,r,n){let s,l;if(super(e),this.pos=i,this.event=r,this.flushed=n,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[Ce],this.allowDefault=r.shiftKey,i.inside>-1)s=e.state.doc.nodeAt(i.inside),l=i.inside;else{let t=e.state.doc.resolve(i.pos);s=t.parent,l=t.depth?t.before():0}const o=n?null:r.target,h=o?e.docView.nearestDesc(o,!0):null;this.target=h&&1==h.nodeDOM.nodeType?h.nodeDOM:null;let{selection:f}=e.state;0==r.button&&(s.type.spec.draggable&&!1!==s.type.spec.selectable||f instanceof t&&f.from<=l&&f.to>l)&&(this.mightDrag={node:s,pos:l,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!P||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()),be(e,"pointer")}done(){super.done(),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.isDestroyed||Rt(this.view)}))}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Me(t))),this.updateAllowDefault(t),this.allowDefault||!e?be(this.view,"pointer"):De(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||A&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(ve(this.view,r.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):be(this.view,"pointer")}move(t){this.updateAllowDefault(t),be(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}}class Ne extends Pe{constructor(t,e){super(t),this.startSelection=e,this.startDoc=t.state.doc}move(t){if(0==t.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();t.preventDefault(),be(this.view,"pointer");let i=this.view.posAtCoords(Me(t)),r=i&&Se(this.view,i.inside,!1);if(!r)return;let{doc:n}=this.view.state,s=this.startSelection,[l,o]=r.from<s.from?[s.to,r.from]:[s.from,r.to];ve(this.view,e.create(n,l,o),"pointer")}}function Re(t,e){return!!t.composing||!!(A&&Math.abs(Date.now()-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}ae.touchstart=t=>{t.input.lastTouch=Date.now(),Te(t),be(t,"pointer")},ae.touchmove=t=>{t.input.lastTouch=Date.now(),be(t,"pointer")},ae.contextmenu=t=>Te(t);const Ae=F?5e3:-1;function Be(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Fe(t)),e))}function $e(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Ie(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let i=function(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;e=g(t=t.childNodes[e-1])}else{if(!t.parentNode||w(t))return null;e=u(t),t=t.parentNode}}}(e.focusNode,e.focusOffset),r=function(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0}else{if(!t.parentNode||w(t))return null;e=u(t)+1,t=t.parentNode}}}(e.focusNode,e.focusOffset);if(i&&r&&i!=r){let e=r.pmViewDesc,n=t.domObserver.lastChangedTextNode;if(i==n||r==n)return n;if(!e||!e.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let t=i.pmViewDesc;if(t&&t.isText(i.nodeValue))return r}}return i||r}function Fe(t,e=!1){if(!(F&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),$e(t),e||t.docView&&t.docView.dirty){let i=Et(t),r=t.state.selection;return i&&!i.eq(r)?t.dispatch(t.state.tr.setSelection(i)):!t.markCursor&&!e||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}de.compositionstart=de.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:i}=t,r=i.selection.$to;if(i.selection instanceof e&&(i.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))||N&&I&&function(t){let{focusNode:e,focusOffset:i}=t.domSelectionRange();if(!e||1!=e.nodeType||i>=e.childNodes.length)return!1;let r=e.childNodes[i];return 1==r.nodeType&&"false"==r.contentEditable}(t)))t.markCursor=t.state.storedMarks||r.marks(),Fe(t,!0),t.markCursor=null;else if(Fe(t,!i.selection.empty),P&&i.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let e=t.domSelectionRange();for(let i=e.focusNode,r=e.focusOffset;i&&1==i.nodeType&&0!=r;){let e=r<0?i.lastChild:i.childNodes[r-1];if(!e)break;if(3==e.nodeType){let i=t.domSelection();i&&i.collapse(e,e.nodeValue.length);break}i=e,r=-1}}t.input.composing=!0}Be(t,Ae)},de.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),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++,Be(t,20))};const Ke=T&&C<15||B&&L<604;function Le(t,e,i,r,s){let l=ie(t,e,i,r,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,s,l||n.empty))))return!0;if(!l)return!1;let o=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(l),h=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(l);return t.dispatch(h.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function qe(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let i=t.getData("text/uri-list");return i?i.replace(/\r?\n/g," "):""}ae.copy=de.cut=(t,e)=>{let i=e,r=t.state.selection,n="cut"==i.type;if(r.empty)return;let s=Ke?null:i.clipboardData,l=r.content(),{dom:o,text:h}=ee(t,l);s?(i.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",h)):function(t,e){if(!t.dom.parentNode)return;let i=t.dom.parentNode.appendChild(document.createElement("div"));i.appendChild(e),i.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),n=document.createRange();n.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(n),setTimeout((()=>{i.parentNode&&i.parentNode.removeChild(i),t.focus()}),50)}(t,o),n&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},de.paste=(t,e)=>{let i=e;if(t.composing&&!F)return;let r=Ke?null:i.clipboardData,n=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Le(t,qe(r),r.getData("text/html"),n,i)?i.preventDefault():function(t,e){if(!t.dom.parentNode)return;let i=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(i?"textarea":"div"));i||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let n=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),i?Le(t,r.value,null,n,e):Le(t,r.textContent,r.innerHTML,n,e)}),50)}(t,i)};class He{constructor(t,e,i){this.slice=t,this.move=e,this.node=i}}const We=$?"altKey":"ctrlKey";function Ve(t,e){let i;return t.someProp("dragCopies",(t=>{i=i||t(e)})),null!=i?!i:!e[We]}ae.dragstart=(e,i)=>{let r=i,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let s,l=e.state.selection,o=l.empty?null:e.posAtCoords(Me(r));if(o&&o.pos>=l.from&&o.pos<=(l instanceof t?l.to-1:l.to));else if(n&&n.mightDrag)s=t.create(e.state.doc,n.mightDrag.pos);else if(r.target&&1==r.target.nodeType){let i=e.docView.nearestDesc(r.target,!0);i&&i.node.type.spec.draggable&&i!=e.docView&&(s=t.create(e.state.doc,i.posBefore))}let h=(s||e.state.selection).content(),{dom:f,text:u,slice:c}=ee(e,h);(!r.dataTransfer.files.length||!N||R>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(Ke?"Text":"text/html",f.innerHTML),r.dataTransfer.effectAllowed="copyMove",Ke||r.dataTransfer.setData("text/plain",u),e.dragging=new He(c,Ve(e,r),s)},ae.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},de.dragover=de.dragenter=(t,e)=>e.preventDefault(),de.drop=(e,i)=>{try{!function(e,i,r){if(!i.dataTransfer)return;let l=e.posAtCoords(Me(i));if(!l)return;let o=e.state.doc.resolve(l.pos),h=r&&r.slice;h?e.someProp("transformPasted",(t=>{h=t(h,e,!1)})):h=ie(e,qe(i.dataTransfer),Ke?null:i.dataTransfer.getData("text/html"),!1,o);let f=!(!r||!Ve(e,i));if(e.someProp("handleDrop",(t=>t(e,i,h||n.empty,f))))return void i.preventDefault();if(!h)return;i.preventDefault();let u=h?s(e.state.doc,o.pos,h):o.pos;null==u&&(u=o.pos);let c=e.state.tr;if(f){let{node:t}=r;t?t.replace(c):c.deleteSelection()}let a=c.mapping.map(u),d=0==h.openStart&&0==h.openEnd&&1==h.content.childCount,p=c.doc;d?c.replaceRangeWith(a,a,h.content.firstChild):c.replaceRange(a,a,h);if(c.doc.eq(p))return;let m=c.doc.resolve(a);if(d&&t.isSelectable(h.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(h.content.firstChild))c.setSelection(new t(m));else{let t=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,i,r,n)=>t=n)),c.setSelection(Lt(e,m,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}(e,i,e.dragging)}finally{e.dragging=null}},ae.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Rt(t)}),20))},ae.blur=(t,e)=>{let i=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),i.relatedTarget&&t.dom.contains(i.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},ae.beforeinput=(t,e)=>{if(N&&F&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,M(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())}),50)}};for(let t in de)ae[t]=de[t];function je(t,e){if(t==e)return!0;for(let i in t)if(t[i]!==e[i])return!1;for(let i in e)if(!(i in t))return!1;return!0}class ze{constructor(t,e){this.toDOM=t,this.spec=e||Qe,this.side=this.spec.side||0}map(t,e,i,r){let{pos:n,deleted:s}=t.mapResult(e.from+r,this.side<0?-1:1);return s?null:new Je(n-i,n-i,this)}valid(){return!0}eq(t){return this==t||t instanceof ze&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&je(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ge{constructor(t,e){this.attrs=t,this.spec=e||Qe}map(t,e,i,r){let n=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-i,s=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-i;return n>=s?null:new Je(n,s,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Ge&&je(this.attrs,t.attrs)&&je(this.spec,t.spec)}static is(t){return t.type instanceof Ge}destroy(){}}class Ue{constructor(t,e){this.attrs=t,this.spec=e||Qe}map(t,e,i,r){let n=t.mapResult(e.from+r,1);if(n.deleted)return null;let s=t.mapResult(e.to+r,-1);return s.deleted||s.pos<=n.pos?null:new Je(n.pos-i,s.pos-i,this)}valid(t,e){let i,{index:r,offset:n}=t.content.findIndex(e.from);return n==e.from&&!(i=t.child(r)).isText&&n+i.nodeSize==e.to}eq(t){return this==t||t instanceof Ue&&je(this.attrs,t.attrs)&&je(this.spec,t.spec)}destroy(){}}class Je{constructor(t,e,i){this.from=t,this.to=e,this.type=i}copy(t,e){return new Je(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,i){return this.type.map(t,this,e,i)}static widget(t,e,i){return new Je(t,t,new ze(e,i))}static inline(t,e,i,r){return new Je(t,e,new Ge(i,r))}static node(t,e,i,r){return new Je(t,e,new Ue(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ge}get widget(){return this.type instanceof ze}}const Ye=[],Qe={};class Xe{constructor(t,e){this.local=t.length?t:Ye,this.children=e.length?e:Ye}static create(t,e){return e.length?ri(e,t,0,Qe):Ze}find(t,e,i){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,i),r}findInner(t,e,i,r,n){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=e&&l.to>=t&&(!n||n(l.spec))&&i.push(l.copy(l.from+r,l.to+r))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<e&&this.children[s+1]>t){let l=this.children[s]+1;this.children[s+2].findInner(t-l,e-l,i,r+l,n)}}map(t,e,i){return this==Ze||0==t.maps.length?this:this.mapInner(t,e,0,0,i||Qe)}mapInner(t,e,i,r,n){let s;for(let l=0;l<this.local.length;l++){let o=this.local[l].map(t,i,r);o&&o.type.valid(e,o)?(s||(s=[])).push(o):n.onRemove&&n.onRemove(this.local[l].spec)}return this.children.length?function(t,e,i,r,n,s,l){let o=t.slice();for(let t=0,e=s;t<i.maps.length;t++){let r=0;i.maps[t].forEach(((t,i,n,s)=>{let l=s-n-(i-t);for(let n=0;n<o.length;n+=3){let s=o[n+1];if(s<0||t>s+e-r)continue;let h=o[n]+e-r;i>=h?o[n+1]=t<=h?-2:-1:t>=e&&l&&(o[n]+=l,o[n+1]+=l)}r+=l})),e=i.maps[t].map(e,-1)}let h=!1;for(let e=0;e<o.length;e+=3)if(o[e+1]<0){if(-2==o[e+1]){h=!0,o[e+1]=-1;continue}let f=i.map(t[e]+s),u=f-n;if(u<0||u>=r.content.size){h=!0;continue}let c=i.map(t[e+1]+s,-1)-n,{index:a,offset:d}=r.content.findIndex(u),p=r.maybeChild(a);if(p&&d==u&&d+p.nodeSize==c){let r=o[e+2].mapInner(i,p,f+1,t[e]+s+1,l);r!=Ze?(o[e]=u,o[e+1]=c,o[e+2]=r):(o[e+1]=-2,h=!0)}else h=!0}if(h){let h=function(t,e,i,r,n,s,l){function o(t,e){for(let s=0;s<t.local.length;s++){let o=t.local[s].map(r,n,e);o?i.push(o):l.onRemove&&l.onRemove(t.local[s].spec)}for(let i=0;i<t.children.length;i+=3)o(t.children[i+2],t.children[i]+e+1)}for(let i=0;i<t.length;i+=3)-1==t[i+1]&&o(t[i+2],e[i]+s+1);return i}(o,t,e,i,n,s,l),f=ri(h,r,0,l);e=f.local;for(let t=0;t<o.length;t+=3)o[t+1]<0&&(o.splice(t,3),t-=3);for(let t=0,e=0;t<f.children.length;t+=3){let i=f.children[t];for(;e<o.length&&o[e]<i;)e+=3;o.splice(e,0,f.children[t],f.children[t+1],f.children[t+2])}}return new Xe(e.sort(ni),o)}(this.children,s||[],t,e,i,r,n):s?new Xe(s.sort(ni),Ye):Ze}add(t,e){return e.length?this==Ze?Xe.create(t,e):this.addInner(t,e,0):this}addInner(t,e,i){let r,n=0;t.forEach(((t,s)=>{let l,o=s+i;if(l=ei(e,t,o)){for(r||(r=this.children.slice());n<r.length&&r[n]<s;)n+=3;r[n]==s?r[n+2]=r[n+2].addInner(t,l,o+1):r.splice(n,0,s,s+t.nodeSize,ri(l,t,o+1,Qe)),n+=3}}));let s=ti(n?ii(e):e,-i);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||s.splice(e--,1);return new Xe(s.length?this.local.concat(s).sort(ni):this.local,r||this.children)}remove(t){return 0==t.length||this==Ze?this:this.removeInner(t,0)}removeInner(t,e){let i=this.children,r=this.local;for(let r=0;r<i.length;r+=3){let n,s=i[r]+e,l=i[r+1]+e;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>s&&e.to<l&&(t[i]=null,(n||(n=[])).push(e));if(!n)continue;i==this.children&&(i=this.children.slice());let o=i[r+2].removeInner(n,s+1);o!=Ze?i[r+2]=o:(i.splice(r,3),r-=3)}if(r.length)for(let i,n=0;n<t.length;n++)if(i=t[n])for(let t=0;t<r.length;t++)r[t].eq(i,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return i==this.children&&r==this.local?this:r.length||i.length?new Xe(r,i):Ze}forChild(t,e){if(this==Ze)return this;if(e.isLeaf)return Xe.empty;let i,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(i=this.children[e+2]);break}let n=t+1,s=n+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<s&&e.to>n&&e.type instanceof Ge){let t=Math.max(n,e.from)-n,i=Math.min(s,e.to)-n;t<i&&(r||(r=[])).push(e.copy(t,i))}}if(r){let t=new Xe(r.sort(ni),Ye);return i?new _e([t,i]):t}return i||Ze}eq(t){if(this==t)return!0;if(!(t instanceof Xe)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return si(this.localsInner(t))}localsInner(t){if(this==Ze)return Ye;if(t.inlineContent||!this.local.some(Ge.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof Ge||e.push(this.local[t]);return e}forEachSet(t){t(this)}}Xe.empty=new Xe([],[]),Xe.removeOverlap=si;const Ze=Xe.empty;class _e{constructor(t){this.members=t}map(t,e){const i=this.members.map((i=>i.map(t,e,Qe)));return _e.from(i)}forChild(t,e){if(e.isLeaf)return Xe.empty;let i=[];for(let r=0;r<this.members.length;r++){let n=this.members[r].forChild(t,e);n!=Ze&&(n instanceof _e?i=i.concat(n.members):i.push(n))}return _e.from(i)}eq(t){if(!(t instanceof _e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,i=!0;for(let r=0;r<this.members.length;r++){let n=this.members[r].localsInner(t);if(n.length)if(e){i&&(e=e.slice(),i=!1);for(let t=0;t<n.length;t++)e.push(n[t])}else e=n}return e?si(i?e:e.sort(ni)):Ye}static from(t){switch(t.length){case 0:return Ze;case 1:return t[0];default:return new _e(t.every((t=>t instanceof Xe))?t:t.reduce(((t,e)=>t.concat(e instanceof Xe?e:e.members)),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function ti(t,e){if(!e||!t.length)return t;let i=[];for(let r=0;r<t.length;r++){let n=t[r];i.push(new Je(n.from+e,n.to+e,n.type))}return i}function ei(t,e,i){if(e.isLeaf)return null;let r=i+e.nodeSize,n=null;for(let e,s=0;s<t.length;s++)(e=t[s])&&e.from>i&&e.to<r&&((n||(n=[])).push(e),t[s]=null);return n}function ii(t){let e=[];for(let i=0;i<t.length;i++)null!=t[i]&&e.push(t[i]);return e}function ri(t,e,i,r){let n=[],s=!1;e.forEach(((e,l)=>{let o=ei(t,e,l+i);if(o){s=!0;let t=ri(o,e,i+l+1,r);t!=Ze&&n.push(l,l+e.nodeSize,t)}}));let l=ti(s?ii(t):t,-i).sort(ni);for(let t=0;t<l.length;t++)l[t].type.valid(e,l[t])||(r.onRemove&&r.onRemove(l[t].spec),l.splice(t--,1));return l.length||n.length?new Xe(l,n):Ze}function ni(t,e){return t.from-e.from||t.to-e.to}function si(t){let e=t;for(let i=0;i<e.length-1;i++){let r=e[i];if(r.from!=r.to)for(let n=i+1;n<e.length;n++){let s=e[n];if(s.from!=r.from){s.from<r.to&&(e==t&&(e=t.slice()),e[i]=r.copy(r.from,s.from),li(e,n,r.copy(s.from,r.to)));break}s.to!=r.to&&(e==t&&(e=t.slice()),e[n]=s.copy(s.from,r.to),li(e,n+1,s.copy(r.to,s.to)))}}return e}function li(t,e,i){for(;e<t.length&&ni(i,t[e])>0;)e++;t.splice(e,0,i)}function oi(t){let e=[];return t.someProp("decorations",(i=>{let r=i(t.state);r&&r!=Ze&&e.push(r)})),t.cursorWrapper&&e.push(Xe.create(t.state.doc,[t.cursorWrapper.deco])),_e.from(e)}const hi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},fi=T&&C<=11;class ui{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class ci{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ui,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);T&&C<=11&&e.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():A&&t.composing&&e.some((t=>"childList"==t.type&&"TR"==t.target.nodeName))?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()})),fi&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,hi)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);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(qt(this.view)){if(this.suppressingSelectionUpdates)return Rt(this.view);if(T&&C<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&p(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,i=new Set;for(let e=t.focusNode;e;e=c(e))i.add(e);for(let r=t.anchorNode;r;r=c(r))if(i.has(r)){e=r;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let i=t.domSelectionRange(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&qt(t)&&!this.ignoreSelectionChange(i),s=-1,l=-1,o=!1,h=[];if(t.editable)for(let t=0;t<e.length;t++){let i=this.registerMutation(e[t],h);i&&(s=s<0?i.from:Math.min(i.from,s),l=l<0?i.to:Math.max(i.to,l),i.typeOver&&(o=!0))}if(h.some((t=>"BR"==t.nodeName))&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||N&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&e.some((t=>"childList"==t.type&&t.removedNodes.length)))){for(let t of h)if("BR"==t.nodeName&&t.parentNode){let e=t.nextSibling;for(;e&&1==e.nodeType;){if("false"==e.contentEditable){t.parentNode.removeChild(t);break}e=e.firstChild}}}else if(P&&h.length){let e=h.filter((t=>"BR"==t.nodeName));if(2==e.length){let[t,i]=e;t.parentNode&&t.parentNode.parentNode==i.parentNode?i.remove():t.remove()}else{let{focusNode:i}=this.currentSelection;for(let r of e){let e=r.parentNode;!e||"LI"!=e.nodeName||i&&mi(t,i)==e||r.remove()}}}let f=null;s<0&&n&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&k(i)&&(f=Et(t))&&f.eq(r.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Rt(t),this.currentSelection.set(i),t.scrollToSelection()):(s>-1||n)&&(s>-1&&(t.docView.markDirty(s,l),function(t){if(ai.has(t))return;if(ai.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=P,di)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."),di=!0}}(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(t,e){var i;let{focusNode:r,focusOffset:n}=t.domSelectionRange();for(let s of e)if("TR"==(null===(i=s.parentNode)||void 0===i?void 0:i.nodeName)){let e=s.nextSibling;for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.nextSibling;if(e){let i=e;for(;;){let t=i.firstChild;if(!t||1!=t.nodeType||"false"==t.contentEditable||/^(BR|IMG)$/.test(t.nodeName))break;i=t}i.insertBefore(s,i.firstChild),r==s&&t.domSelection().collapse(s,n)}else s.parentNode.removeChild(s)}}(t,h)),this.handleDOMChange(s,l,o,h),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(i)||Rt(t),this.currentSelection.set(i))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let i=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(i==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!i||i.ignoreMutation(t))return null;if("childList"==t.type){for(let i=0;i<t.addedNodes.length;i++){let r=t.addedNodes[i];e.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(t.target))return{from:i.posBefore,to:i.posAfter};let r=t.previousSibling,n=t.nextSibling;if(T&&C<=11&&t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){let{previousSibling:i,nextSibling:s}=t.addedNodes[e];(!i||Array.prototype.indexOf.call(t.addedNodes,i)<0)&&(r=i),(!s||Array.prototype.indexOf.call(t.addedNodes,s)<0)&&(n=s)}let s=r&&r.parentNode==t.target?u(r)+1:0,l=i.localPosFromDOM(t.target,s,-1),o=n&&n.parentNode==t.target?u(n):t.target.childNodes.length;return{from:l,to:i.localPosFromDOM(t.target,o,1)}}return"attributes"==t.type?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=t.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let ai=new WeakMap,di=!1;function pi(t,e){let i=e.startContainer,r=e.startOffset,n=e.endContainer,s=e.endOffset,l=t.domAtPos(t.state.selection.anchor);return p(l.node,l.offset,n,s)&&([i,r,n,s]=[n,s,i,r]),{anchorNode:i,anchorOffset:r,focusNode:n,focusOffset:s}}function mi(t,e){for(let i=e.parentNode;i&&i!=t.dom;i=i.parentNode){let e=t.docView.nearestDesc(i,!0);if(e&&e.node.isBlock)return i}return null}function bi(t){let e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(A&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(t.parentNode.lastChild==t||A&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const gi=/^(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 wi(t,i,r,n,s){let h=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,i<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,i=Et(t,e);if(i&&!t.state.selection.eq(i)){if(N&&F&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",(e=>e(t,M(13,"Enter")))))return;let r=t.state.tr.setSelection(i);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),h&&r.setMeta("composition",h),t.dispatch(r)}return}let f=t.state.doc.resolve(i),u=f.sharedDepth(r);i=f.before(u+1),r=t.state.doc.resolve(r).after(u+1);let c,a,d=t.state.selection,p=function(t,e,i){let r,{node:n,fromOffset:s,toOffset:l,from:h,to:f}=t.docView.parseRange(e,i),u=t.domSelectionRange(),c=u.anchorNode;if(c&&t.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:u.anchorOffset}],k(u)||r.push({node:u.focusNode,offset:u.focusOffset})),N&&8===t.input.lastKeyCode)for(let t=l;t>s;t--){let e=n.childNodes[t-1],i=e.pmViewDesc;if("BR"==e.nodeName&&!i){l=t;break}if(!i||i.size)break}let a=t.state.doc,d=t.someProp("domParser")||o.fromSchema(t.state.schema),p=a.resolve(h),m=null,b=d.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:l,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:bi,context:p});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),m={anchor:t+h,head:e+h}}return{doc:b,sel:m,from:h,to:f}}(t,i,r),m=t.state.doc,b=m.slice(p.from,p.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(c=t.state.selection.to,a="end"):(c=t.state.selection.from,a="start"),t.input.lastKeyCode=null;let g=function(t,e,i,r,n){let s=t.findDiffStart(e,i),l=i+t.size,o=i+e.size;if(null==s)return null;let{a:h,b:f}=t.findDiffEnd(e,l,o);if("end"==n){r-=h+Math.max(0,s-Math.min(h,f))-s}if(h<s&&l<o){s-=r<=s&&r>=h?s-r:0,f=s+(f-h),h=s}else if(f<s){s-=r<=s&&r>=f?s-r:0,h=s+(h-f),f=s}return{start:s,endA:h,endB:f}}(b.content,p.doc.content,p.from,c,a);if(g&&t.input.domChangeCount++,(B&&t.input.lastIOSEnter>Date.now()-225||F)&&s.some((t=>1==t.nodeType&&!gi.test(t.nodeName)))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",(e=>e(t,M(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!g){if(!(n&&d instanceof e&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let e=ki(t,t.state.doc,p.sel);if(e&&!e.eq(t.state.selection)){let i=t.state.tr.setSelection(e);h&&i.setMeta("composition",h),t.dispatch(i)}}return}g={start:d.from,endA:d.to,endB:d.to}}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof e&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=p.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=p.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),T&&C<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>p.from&&"  "==p.doc.textBetween(g.start-p.from-1,g.start-p.from+1)&&(g.start--,g.endA--,g.endB--);let w=p.doc.resolveNoCache(g.start-p.from),y=p.doc.resolveNoCache(g.endB-p.from),v=m.resolve(g.start),D=w.sameParent(y)&&w.parent.inlineContent&&v.end()>=g.endA;if((B&&t.input.lastIOSEnter>Date.now()-225&&(!D||s.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!D&&w.pos<p.doc.content.size&&(!w.sameParent(y)||!w.parent.inlineContent)&&w.pos<y.pos&&!/\S/.test(p.doc.textBetween(w.pos,y.pos,"","")))&&t.someProp("handleKeyDown",(e=>e(t,M(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>g.start&&function(t,e,i,r,n){if(i-e<=n.pos-r.pos||Mi(r,!0,!1)<n.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let t=s.nodeAfter;return null!=t&&i==e+t.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let l=t.resolve(Mi(s,!0,!0));return!(!l.parent.isTextblock||l.pos>i||Mi(l,!0,!1)<i)&&r.parent.content.cut(r.parentOffset).eq(l.parent.content)}(m,g.start,g.endA,w,y)&&t.someProp("handleKeyDown",(e=>e(t,M(8,"Backspace")))))return void(F&&N&&t.domObserver.suppressSelectionUpdates());N&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),F&&!D&&w.start()!=y.start()&&0==y.parentOffset&&w.depth==y.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==g.endA&&(g.endB-=2,y=p.doc.resolveNoCache(g.endB-p.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,M(13,"Enter"))}))}),20));let x,O=g.start,S=g.endA,P=e=>{let i=e||t.state.tr.replace(O,S,p.doc.slice(g.start-p.from,g.endB-p.from));if(p.sel){let e=ki(t,i.doc,p.sel);e&&!(N&&t.composing&&e.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(e.head==O||e.head==i.mapping.map(S)-1)||T&&e.empty&&e.head==O)&&i.setSelection(e)}return h&&i.setMeta("composition",h),i.scrollIntoView()};if(D)if(w.pos==y.pos){T&&C<=11&&0==w.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>Rt(t)),20));let e=P(t.state.tr.delete(O,S)),i=m.resolve(g.start).marksAcross(m.resolve(g.endA));i&&e.ensureMarks(i),t.dispatch(e)}else if(g.endA==g.endB&&(x=function(t,e){let i,r,n,s=t.firstChild.marks,o=e.firstChild.marks,h=s,f=o;for(let t=0;t<o.length;t++)h=o[t].removeFromSet(h);for(let t=0;t<s.length;t++)f=s[t].removeFromSet(f);if(1==h.length&&0==f.length)r=h[0],i="add",n=t=>t.mark(r.addToSet(t.marks));else{if(0!=h.length||1!=f.length)return null;r=f[0],i="remove",n=t=>t.mark(r.removeFromSet(t.marks))}let u=[];for(let t=0;t<e.childCount;t++)u.push(n(e.child(t)));if(l.from(u).eq(t))return{mark:r,type:i}}(w.parent.content.cut(w.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,g.endA-v.start())))){let e=P(t.state.tr);"add"==x.type?e.addMark(O,S,x.mark):e.removeMark(O,S,x.mark),t.dispatch(e)}else if(w.parent.child(w.index()).isText&&w.index()==y.index()-(y.textOffset?0:1)){let e=w.parent.textBetween(w.parentOffset,y.parentOffset),i=()=>P(t.state.tr.insertText(e,O,S));t.someProp("handleTextInput",(r=>r(t,O,S,e,i)))||t.dispatch(i())}else t.dispatch(P());else t.dispatch(P())}function ki(t,e,i){return Math.max(i.anchor,i.head)>e.content.size?null:Lt(t,e.resolve(i.anchor),e.resolve(i.head))}function Mi(t,e,i){let r=t.depth,n=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,n++,e=!1;if(i){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,n++}return n}class yi{constructor(t,e){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 me,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Si),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=xi(this),Di(this),this.nodeViews=Oi(this),this.docView=pt(this.state.doc,vi(this),oi(this),this.dom,this),this.domObserver=new ci(this,((t,e,i,r)=>wi(this,t,e,i,r))),this.domObserver.start(),function(t){for(let e in ae){let i=ae[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!ke(t,e)||we(t,e)||!t.editable&&e.type in de||i(t,e)},pe[e]?{passive:!0}:void 0)}A&&t.dom.addEventListener("input",(()=>null)),ge(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ge(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Si),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let t in this._props)e[t]=this._props[t];e.state=this.state;for(let i in t)e[i]=t[i];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var i;let r=this.state,n=!1,s=!1;t.storedMarks&&this.composing&&($e(this),s=!0),this.state=t;let l=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(l||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=Oi(this);(function(t,e){let i=0,r=0;for(let r in t){if(t[r]!=e[r])return!0;i++}for(let t in e)r++;return i!=r})(t,this.nodeViews)&&(this.nodeViews=t,n=!0)}(l||e.handleDOMEvents!=this._props.handleDOMEvents)&&ge(this),this.editable=xi(this),Di(this);let o=oi(this),h=vi(this),f=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=n||!this.docView.matchesNode(t.doc,h,o);!u&&t.selection.eq(r.selection)||(s=!0);let c="preserve"==f&&s&&null==this.dom.style.overflowAnchor&&function(t){let e,i,r=t.dom.getBoundingClientRect(),n=Math.max(0,r.top);for(let s=(r.left+r.right)/2,l=n+1;l<Math.min(innerHeight,r.bottom);l+=5){let r=t.root.elementFromPoint(s,l);if(!r||r==t.dom||!t.dom.contains(r))continue;let o=r.getBoundingClientRect();if(o.top>=n-20){e=r,i=o.top;break}}return{refDOM:e,refTop:i,stack:j(t.dom)}}(this);if(s){this.domObserver.stop();let e=u&&(T||N)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&function(t,e){let i=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(i)!=e.$anchor.start(i)}(r.selection,t.selection);if(u){let i=N?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ie(this)),!n&&this.docView.update(t.doc,h,o,this)||(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=pt(t.doc,h,o,this.dom,this)),!i||this.trackWrites&&this.dom.contains(this.trackWrites)||(e=!0)}let i=this.input.mouseDown;e||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),i=t.domSelectionRange();return p(e.node,e.offset,i.anchorNode,i.anchorOffset)}(this)&&i.delaySelUpdate())?Rt(this,e):(Ft(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(i=this.dragging)||void 0===i?void 0:i.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==f?this.dom.scrollTop=0:"to selection"==f?this.scrollToSelection():c&&function({refDOM:t,refTop:e,stack:i}){let r=t?t.getBoundingClientRect().top:0;z(i,0==r?0:r-e)}(c)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof t){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&V(this,t.getBoundingClientRect(),e)}else V(this,this.coordsAtPos(this.state.selection.head,1),e);else;}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e<this.pluginViews.length;e++){let i=this.pluginViews[e];i.update&&i.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let e=this.directPlugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let e=this.state.plugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}}}updateDraggedNode(e,i){let r=e.node,n=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)n=r.from;else{let t=r.from+(this.state.doc.content.size-i.doc.content.size);(t>0&&t<this.state.doc.content.size&&this.state.doc.nodeAt(t))==r.node&&(n=t)}this.dragging=new He(e.slice,e.move,n<0?void 0:t.create(this.state.doc,n))}someProp(t,e){let i,r=this._props&&this._props[t];if(null!=r&&(i=e?e(r):r))return i;for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r].props[t];if(null!=n&&(i=e?e(n):n))return i}let n=this.state.plugins;if(n)for(let r=0;r<n.length;r++){let s=n[r].props[t];if(null!=s&&(i=e?e(s):s))return i}}hasFocus(){if(T){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(G)return t.focus(G);let e=j(t);t.focus(null==G?{get preventScroll(){return G={preventScroll:!0},!0}}:void 0),G||(G=!1,z(e,0))}(this.dom),Rt(this),this.domObserver.start()}get root(){let t=this._root;if(null==t)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 t||document}updateRoot(){this._root=null}posAtCoords(t){return Q(this,t)}coordsAtPos(t,e=1){return tt(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,i=-1){let r=this.docView.posFromDOM(t,e,i);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return ht(this,e||this.state,t)}pasteHTML(t,e){return Le(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Le(this,t,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(t){return ee(this,t)}destroy(){this.docView&&(!function(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],oi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,a=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){we(t,e)||!ae[e.type]||!t.editable&&e.type in de||ae[e.type](t,e)}(this,t)}domSelectionRange(){let t=this.domSelection();return t?A&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return pi(t,i)}let i;function r(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),i?pi(t,i):null}(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function vi(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(i=>{if("function"==typeof i&&(i=i(t.state)),i)for(let t in i)"class"==t?e.class+=" "+i[t]:"style"==t?e.style=(e.style?e.style+";":"")+i[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(i[t]))})),e.translate||(e.translate="no"),[Je.node(0,t.state.doc.content.size,e)]}function Di(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Je.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function xi(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function Oi(t){let e=Object.create(null);function i(t){for(let i in t)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=t[i])}return t.someProp("nodeViews",i),t.someProp("markViews",i),e}function Si(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}yi.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};export{Xe as D,yi as E,Je as a};
@@ -1,2 +0,0 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register([],function(_export,_context){"use strict";var s,h,n,e,l,r,o,u,a,c,d,f,v,b,g,m;function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n15=0,F=function F(){};return{s:F,n:function n(){return _n15>=r.length?{done:!0}:{done:!1,value:r[_n15++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function t(t,i,s){var _s$initialDeps;var h,n=(_s$initialDeps=s.initialDeps)!==null&&_s$initialDeps!==void 0?_s$initialDeps:[],e=!0;function l(){var l=t();return l.length!==n.length||l.some(function(t,i){return n[i]!==t;})?(n=l,h=i.apply(void 0,_toConsumableArray(l)),!(null==s?void 0:s.onChange)||e&&s.skipInitialOnChange||s.onChange(h),e=!1,h):h;}return l.updateDeps=function(t){n=t;},l;}function i(t,i){if(void 0===t)throw new Error("Unexpected undefined"+(i?": ".concat(i):""));return t;}return{setters:[],execute:function execute(){s=function s(t,i,_s){var h;return function(){var _this=this;for(var _len=arguments.length,n=new Array(_len),_key=0;_key<_len;_key++){n[_key]=arguments[_key];}t.clearTimeout(h),h=t.setTimeout(function(){return i.apply(_this,n);},_s);};};n=function n(){if(void 0!==h)return h;if("undefined"==typeof navigator)return h=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return h=!0;var t=navigator.maxTouchPoints;return h="MacIntel"===navigator.platform&&void 0!==t&&t>0;},e=function e(t){var i=t.offsetWidth,s=t.offsetHeight;return{width:i,height:s};},l=function l(t){return t;},r=function r(t){var i=Math.max(t.startIndex-t.overscan,0),s=Math.min(t.endIndex+t.overscan,t.count-1)-i+1,h=new Array(s);for(var _t=0;_t<s;_t++)h[_t]=i+_t;return h;},o=function o(t,i){var s=t.scrollElement;if(!s)return;var h=t.targetWindow;if(!h)return;var n=function n(t){var s=t.width,h=t.height;i({width:Math.round(s),height:Math.round(h)});};if(n(e(s)),!h.ResizeObserver)return function(){};var l=new h.ResizeObserver(function(i){var h=function h(){var t=i[0];if(null==t?void 0:t.borderBoxSize){var _i=t.borderBoxSize[0];if(_i)return void n({width:_i.inlineSize,height:_i.blockSize});}n(e(s));};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(h):h();});return l.observe(s,{box:"border-box"}),function(){l.unobserve(s);};},u={passive:!0},a="undefined"==typeof window||"onscrollend"in window,c=function c(t,i){return function(t,i,h){var n=t.scrollElement;if(!n)return;var e=t.targetWindow;if(!e)return;var l=t.options.useScrollendEvent&&a;var r=0;var o=l?null:s(e,function(){return i(r,!1);},t.options.isScrollingResetDelay),c=function c(t){return function(){r=h(n),null==o||o(),i(r,t);};},d=c(!0),f=c(!1);return n.addEventListener("scroll",d,u),l&&n.addEventListener("scrollend",f,u),function(){n.removeEventListener("scroll",d),l&&n.removeEventListener("scrollend",f);};}(t,i,function(i){var _t$options=t.options,s=_t$options.horizontal,h=_t$options.isRtl;return s?i.scrollLeft*(h?-1:1):i.scrollTop;});},d=function d(t,i,s){if(s.options.useCachedMeasurements){var _s$itemSizeCache$get;var _i2=s.indexFromElement(t),_h=s.options.getItemKey(_i2);return(_s$itemSizeCache$get=s.itemSizeCache.get(_h))!==null&&_s$itemSizeCache$get!==void 0?_s$itemSizeCache$get:s.options.estimateSize(_i2);}if(null==i?void 0:i.borderBoxSize){var _t2=i.borderBoxSize[0];if(_t2){return Math.round(_t2[s.options.horizontal?"inlineSize":"blockSize"]);}}if(!i){var _i3=s.indexFromElement(t),_h2=s.options.getItemKey(_i3),_n=s.itemSizeCache.get(_h2);if(void 0!==_n)return _n;}return t[s.options.horizontal?"offsetWidth":"offsetHeight"];},f=function f(t,_ref,h){var _ref$adjustments=_ref.adjustments,i=_ref$adjustments===void 0?0:_ref$adjustments,s=_ref.behavior;var n,e;null==(e=null==(n=h.scrollElement)?void 0:n.scrollTo)||e.call(n,_defineProperty(_defineProperty({},h.options.horizontal?"left":"top",t+i),"behavior",s));};v=/*#__PURE__*/function(){function v(s){var _this2=this;_classCallCheck(this,v);this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map(),this.itemSizeCacheVersion=0,this.laneAssignments=new Map(),this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map(),this.now=function(){var _ref2;var t,i,s;return(_ref2=null==(s=null==(i=null==(t=_this2.targetWindow)?void 0:t.performance)?void 0:i.now)?void 0:s.call(i))!==null&&_ref2!==void 0?_ref2:Date.now();},this.observer=function(){var t=null;var i=function i(){return t||(_this2.targetWindow&&_this2.targetWindow.ResizeObserver?t=new _this2.targetWindow.ResizeObserver(function(t){t.forEach(function(t){var i=function i(){var i=t.target,s=_this2.indexFromElement(i);if(i.isConnected)_this2.shouldMeasureDuringScroll(s)&&_this2.resizeItem(s,_this2.options.measureElement(i,t,_this2));else{_this2.observer.unobserve(i);var _iterator=_createForOfIteratorHelper(_this2.elementsCache),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step$value=_slicedToArray(_step.value,2),_t3=_step$value[0],_s2=_step$value[1];if(_s2===i){_this2.elementsCache["delete"](_t3);break;}}}catch(err){_iterator.e(err);}finally{_iterator.f();}}};_this2.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i();});}):null);};return{disconnect:function disconnect(){var s;null==(s=i())||s.disconnect(),t=null;},observe:function observe(t){var s;return null==(s=i())?void 0:s.observe(t,{box:"border-box"});},unobserve:function unobserve(t){var s;return null==(s=i())?void 0:s.unobserve(t);}};}(),this.range=null,this.setOptions=function(t){var i,s;var h={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:l,rangeExtractor:r,onChange:function onChange(){},measureElement:d,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(var _i4 in t){var _s3=t[_i4];void 0!==_s3&&(h[_i4]=_s3);}var n=_this2.options;var e=null,o=null,u=!1;if(void 0!==n&&n.enabled&&h.enabled&&"end"===h.anchorTo&&null!==_this2.scrollElement){var _ref3,_ref4;var _t4=n.count,_l=h.count,_r=_this2.getMeasurements(),_a=_t4>0?(_ref3=null==(i=_r[0])?void 0:i.key)!==null&&_ref3!==void 0?_ref3:n.getItemKey(0):null,_c=_t4>0?(_ref4=null==(s=_r[_t4-1])?void 0:s.key)!==null&&_ref4!==void 0?_ref4:n.getItemKey(_t4-1):null;if(_l!==_t4||_t4>0&&_l>0&&(h.getItemKey(0)!==_a||h.getItemKey(_l-1)!==_c)){var _this2$getVirtualItem;u=!0;var _i5=_t4>0?(_this2$getVirtualItem=_this2.getVirtualItemForOffset(_this2.getScrollOffset()))!==null&&_this2$getVirtualItem!==void 0?_this2$getVirtualItem:_r[0]:null;_i5&&(e=[_i5.key,_this2.getScrollOffset()-_i5.start]);var _s4=!0===h.followOnAppend?"auto":h.followOnAppend||null;_s4&&_l>_t4&&_this2.isAtEnd(n.scrollEndThreshold)&&(0===_t4||h.getItemKey(_l-1)!==_c)&&(o=_s4);}}_this2.options=h,u&&(_this2.pendingMin=0,_this2.itemSizeCacheVersion++);var a=!1,c=0;if(e&&null!==_this2.scrollOffset){var _e=e,_e2=_slicedToArray(_e,2),_t5=_e2[0],_i6=_e2[1],_s5=_this2.getMeasurements(),_this2$options=_this2.options,_h3=_this2$options.count,_n2=_this2$options.getItemKey;var _l2=0;for(;_l2<_h3&&_n2(_l2)!==_t5;)_l2++;if(_l2<_h3){var _t6=_s5[_l2];if(_t6){var _s6=_t6.start+_i6;_s6!==_this2.scrollOffset&&(c=_s6-_this2.scrollOffset,_this2.scrollOffset=_s6,a=!0);}}}(a||o)&&(_this2.pendingScrollAnchor=[a?e[0]:null,a?e[1]:0,o,c]);},this.notify=function(t){var i,s;null==(s=(i=_this2.options).onChange)||s.call(i,_this2,t);},this.maybeNotify=t(function(){return _this2.calculateRange(),[_this2.isScrolling,_this2.range?_this2.range.startIndex:null,_this2.range?_this2.range.endIndex:null];},function(t){_this2.notify(t);},{key:!1,debug:function debug(){return _this2.options.debug;},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){_this2.unsubs.filter(Boolean).forEach(function(t){return t();}),_this2.unsubs=[],_this2.observer.disconnect(),null!=_this2.rafId&&_this2.targetWindow&&(_this2.targetWindow.cancelAnimationFrame(_this2.rafId),_this2.rafId=null),_this2.scrollState=null,_this2._iosDeferredAdjustment=0,_this2._iosTouching=!1,_this2._iosJustTouchEnded=!1,_this2.scrollElement=null,_this2.targetWindow=null;},this._didMount=function(){return function(){_this2.cleanup();};},this._willUpdate=function(){var t;var i=_this2.options.enabled?_this2.options.getScrollElement():null;if(_this2.scrollElement!==i){var _ref5;if(_this2.cleanup(),!i)return void _this2.maybeNotify();if(_this2.scrollElement=i,_this2.scrollElement&&"ownerDocument"in _this2.scrollElement?_this2.targetWindow=_this2.scrollElement.ownerDocument.defaultView:_this2.targetWindow=(_ref5=null==(t=_this2.scrollElement)?void 0:t.window)!==null&&_ref5!==void 0?_ref5:null,_this2.elementsCache.forEach(function(t){_this2.observer.observe(t);}),_this2.unsubs.push(_this2.options.observeElementRect(_this2,function(t){_this2.scrollRect=t,_this2.maybeNotify();})),_this2.unsubs.push(_this2.options.observeElementOffset(_this2,function(t,i){if(i&&null===_this2._intendedScrollOffset&&t===_this2.scrollOffset)return;null!==_this2._intendedScrollOffset&&Math.abs(t-_this2._intendedScrollOffset)<1.5&&(t=_this2._intendedScrollOffset),_this2._intendedScrollOffset=null,_this2.scrollAdjustments=0;var s=_this2.getScrollOffset();_this2.scrollDirection=i?s===t?_this2.scrollDirection:s<t?"forward":"backward":null,_this2.scrollOffset=t,_this2.isScrolling=i,_this2._flushIosDeferredIfReady(),_this2.scrollState&&_this2.scheduleScrollReconcile(),_this2.maybeNotify();})),"addEventListener"in _this2.scrollElement){var _t7=_this2.scrollElement,_i7=function _i7(){_this2._iosTouching=!0,_this2._iosJustTouchEnded=!1,null!==_this2._iosTouchEndTimerId&&null!=_this2.targetWindow&&(_this2.targetWindow.clearTimeout(_this2._iosTouchEndTimerId),_this2._iosTouchEndTimerId=null);},_s7=function _s7(){_this2._iosTouching=!1,n()&&null!=_this2.targetWindow&&(_this2._iosJustTouchEnded=!0,_this2._iosTouchEndTimerId=_this2.targetWindow.setTimeout(function(){_this2._iosJustTouchEnded=!1,_this2._iosTouchEndTimerId=null,_this2._flushIosDeferredIfReady();},150));};_t7.addEventListener("touchstart",_i7,u),_t7.addEventListener("touchend",_s7,u),_this2.unsubs.push(function(){_t7.removeEventListener("touchstart",_i7),_t7.removeEventListener("touchend",_s7),null!==_this2._iosTouchEndTimerId&&null!=_this2.targetWindow&&(_this2.targetWindow.clearTimeout(_this2._iosTouchEndTimerId),_this2._iosTouchEndTimerId=null);});}_this2._scrollToOffset(_this2.getScrollOffset(),{adjustments:void 0,behavior:void 0});}var s=_this2.pendingScrollAnchor;if(_this2.pendingScrollAnchor=null,s&&_this2.scrollElement&&_this2.options.enabled){var _s8=_slicedToArray(s,4),_t8=_s8[0],_i8=_s8[1],_h4=_s8[2],_e3=_s8[3];null===_t8||_h4||(n()&&(_this2.isScrolling||_this2._iosTouching||_this2._iosJustTouchEnded)?0!==_e3&&(_this2._iosDeferredAdjustment+=_e3):_this2._scrollToOffset(_this2.getScrollOffset(),{adjustments:void 0,behavior:void 0})),_h4&&_this2.scrollToEnd({behavior:_h4});}},this._flushIosDeferredIfReady=function(){if(0===_this2._iosDeferredAdjustment)return;if(_this2.isScrolling)return;if(_this2._iosTouching)return;if(_this2._iosJustTouchEnded)return;var t=_this2.getScrollOffset(),i=_this2.getMaxScrollOffset();if(t<0||t>i)return;var s=_this2._iosDeferredAdjustment;_this2._iosDeferredAdjustment=0,_this2._scrollToOffset(t,{adjustments:_this2.scrollAdjustments+=s,behavior:void 0});},this.rafId=null,this.getSize=function(){var _this2$scrollRect;return _this2.options.enabled?(_this2.scrollRect=(_this2$scrollRect=_this2.scrollRect)!==null&&_this2$scrollRect!==void 0?_this2$scrollRect:_this2.options.initialRect,_this2.scrollRect[_this2.options.horizontal?"width":"height"]):(_this2.scrollRect=null,0);},this.getScrollOffset=function(){var _this2$scrollOffset;return _this2.options.enabled?(_this2.scrollOffset=(_this2$scrollOffset=_this2.scrollOffset)!==null&&_this2$scrollOffset!==void 0?_this2$scrollOffset:"function"==typeof _this2.options.initialOffset?_this2.options.initialOffset():_this2.options.initialOffset,_this2.scrollOffset):(_this2.scrollOffset=null,0);},this.getMeasurementOptions=t(function(){return[_this2.options.count,_this2.options.paddingStart,_this2.options.scrollMargin,_this2.options.getItemKey,_this2.options.enabled,_this2.options.lanes,_this2.options.laneAssignmentMode,_this2.options.gap];},function(t,i,s,h,n,e,l,r){return void 0!==_this2.prevLanes&&_this2.prevLanes!==e&&(_this2.lanesChangedFlag=!0),_this2.prevLanes=e,_this2.pendingMin=null,{count:t,paddingStart:i,scrollMargin:s,getItemKey:h,enabled:n,lanes:e,laneAssignmentMode:l,gap:r};},{key:!1}),this.getMeasurements=t(function(){return[_this2.getMeasurementOptions(),_this2.itemSizeCacheVersion];},function(_ref6,o){var _this2$pendingMin;var t=_ref6.count,i=_ref6.paddingStart,s=_ref6.scrollMargin,h=_ref6.getItemKey,n=_ref6.enabled,e=_ref6.lanes,l=_ref6.laneAssignmentMode,r=_ref6.gap;var u=_this2.itemSizeCache;if(!n)return _this2.measurementsCache=[],_this2.itemSizeCache.clear(),_this2.laneAssignments.clear(),[];if(_this2.laneAssignments.size>t){var _iterator2=_createForOfIteratorHelper(_this2.laneAssignments.keys()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _i9=_step2.value;_i9>=t&&_this2.laneAssignments["delete"](_i9);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}_this2.lanesChangedFlag&&(_this2.lanesChangedFlag=!1,_this2.lanesSettling=!0,_this2.measurementsCache=[],_this2.itemSizeCache.clear(),_this2.laneAssignments.clear(),_this2.pendingMin=null),0!==_this2.measurementsCache.length||_this2.lanesSettling||(_this2.measurementsCache=_this2.options.initialMeasurementsCache,_this2.measurementsCache.forEach(function(t){_this2.itemSizeCache.set(t.key,t.size);}));var a=_this2.lanesSettling?0:(_this2$pendingMin=_this2.pendingMin)!==null&&_this2$pendingMin!==void 0?_this2$pendingMin:0;if(_this2.pendingMin=null,_this2.lanesSettling&&_this2.measurementsCache.length===t&&(_this2.lanesSettling=!1),1===e){var _n3=2*t;var _e4,_l3=_this2._flatMeasurements;if(!_l3||_l3.length<_n3){var _t9=new Float64Array(_n3);_l3&&a>0&&_t9.set(_l3.subarray(0,2*a)),_l3=_t9,_this2._flatMeasurements=_l3;}if(0===a)_e4=i+s;else{var _t10=a-1;_e4=_l3[2*_t10]+_l3[2*_t10+1]+r;}for(var _i10=a;_i10<t;_i10++){var _t11=h(_i10),_s9=u.get(_t11),_n4="number"==typeof _s9?_s9:_this2.options.estimateSize(_i10);_l3[2*_i10]=_e4,_l3[2*_i10+1]=_n4,_e4+=_n4+r;}var _o=function(t,i,s){var h=new Array(t);return new Proxy(h,{get:function get(h,n,e){if("string"==typeof n){var _e5=n.charCodeAt(0);if(_e5>=48&&_e5<=57){var _e6=+n;if(Number.isInteger(_e6)&&_e6>=0&&_e6<t){var _t12=h[_e6];if(!_t12){var _n5=i[2*_e6];_t12=h[_e6]={index:_e6,key:s(_e6),start:_n5,size:i[2*_e6+1],end:_n5+i[2*_e6+1],lane:0};}return _t12;}}if("length"===n)return t;}return Reflect.get(h,n,e);}});}(t,_l3,h);return _this2.measurementsCache=_o,_o;}var c=_this2.measurementsCache.slice(0,a),d=new Array(e).fill(void 0),f=new Float64Array(e);var _v=0;for(var _t13=0;_t13<a;_t13++){var _i11=c[_t13];_i11&&(void 0===d[_i11.lane]&&_v++,d[_i11.lane]=_t13,f[_i11.lane]=_i11.end);}for(var _n6=a;_n6<t;_n6++){var _t14=h(_n6),_o2=_this2.laneAssignments.get(_n6);var _a2=void 0,_b=void 0;var _g="estimate"===l||u.has(_t14);if(void 0!==_o2&&_this2.options.lanes>1){_a2=_o2;var _t15=d[_a2],_h5=void 0!==_t15?c[_t15]:void 0;_b=_h5?_h5.end+r:i+s;}else if(_v===e){var _t16=0,_i12=f[0],_s10=d[0];for(var _h6=1;_h6<e;_h6++){var _n7=f[_h6];(_n7<_i12||_n7===_i12&&d[_h6]<_s10)&&(_t16=_h6,_i12=_n7,_s10=d[_h6]);}_a2=_t16,_b=_i12+r,_g&&_this2.laneAssignments.set(_n6,_a2);}else _a2=_n6%_this2.options.lanes,_b=i+s,_g&&_this2.laneAssignments.set(_n6,_a2);var _m=u.get(_t14),M="number"==typeof _m?_m:_this2.options.estimateSize(_n6),y=_b+M;c[_n6]={index:_n6,start:_b,size:M,end:y,key:_t14,lane:_a2},void 0===d[_a2]&&_v++,d[_a2]=_n6,f[_a2]=y;}return _this2.measurementsCache=c,c;},{key:!1,debug:function debug(){return _this2.options.debug;}}),this.calculateRange=t(function(){return[_this2.getMeasurements(),_this2.getSize(),_this2.getScrollOffset(),_this2.options.lanes];},function(t,i,s,h){return 0===t.length||0===i?(_this2.range=null,null):(_this2.range=function(t,i,s,h,n){var e=t.length-1;if(t.length<=h)return{startIndex:0,endIndex:e};if(1===h&&null!==n){var _t17=function(t,i,s){var h=0;for(;h<=i;){var _n8=(h+i)/2|0,_e7=t[2*_n8];if(_e7<s)h=_n8+1;else{if(!(_e7>s))return _n8;i=_n8-1;}}return h>0?h-1:0;}(n,e,s);var _h7=_t17;var _l4=s+i;for(;_h7<e&&n[2*_h7]+n[2*_h7+1]<_l4;)_h7++;return{startIndex:_t17,endIndex:_h7};}var l=function l(i){return t[i].start;};var r=b(0,e,l,s),o=r;if(1===h)for(;o<e&&t[o].end<s+i;)o++;else if(h>1){var _n9=Array(h).fill(0);for(;o<e&&_n9.some(function(t){return t<s+i;});){var _i13=t[o];_n9[_i13.lane]=_i13.end,o++;}var _l5=Array(h).fill(s+i);for(;r>=0&&_l5.some(function(t){return t>=s;});){var _i14=t[r];_l5[_i14.lane]=_i14.start,r--;}r=Math.max(0,r-r%h),o=Math.min(e,o+(h-1-o%h));}return{startIndex:r,endIndex:o};}(t,i,s,h,1===h&&null!=_this2._flatMeasurements?_this2._flatMeasurements:null),_this2.range);},{key:!1,debug:function debug(){return _this2.options.debug;}}),this.getVirtualIndexes=t(function(){var t=null,i=null;var s=_this2.calculateRange();return s&&(t=s.startIndex,i=s.endIndex),_this2.maybeNotify.updateDeps([_this2.isScrolling,t,i]),[_this2.options.rangeExtractor,_this2.options.overscan,_this2.options.count,t,i];},function(t,i,s,h,n){return null===h||null===n?[]:t({startIndex:h,endIndex:n,overscan:i,count:s});},{key:!1,debug:function debug(){return _this2.options.debug;}}),this.indexFromElement=function(t){var i=_this2.options.indexAttribute,s=t.getAttribute(i);return s?parseInt(s,10):(console.warn("Missing attribute name '".concat(i,"={index}' on measured element.")),-1);},this.shouldMeasureDuringScroll=function(t){var _this2$scrollState$in;var i;if(!_this2.scrollState||"smooth"!==_this2.scrollState.behavior)return!0;var s=(_this2$scrollState$in=_this2.scrollState.index)!==null&&_this2$scrollState$in!==void 0?_this2$scrollState$in:null==(i=_this2.getVirtualItemForOffset(_this2.scrollState.lastTargetOffset))?void 0:i.index;if(void 0!==s&&_this2.range){var _i15=Math.max(_this2.options.overscan,Math.ceil((_this2.range.endIndex-_this2.range.startIndex)/2)),_h8=Math.max(0,s-_i15),_n10=Math.min(_this2.options.count-1,s+_i15);return t>=_h8&&t<=_n10;}return!0;},this.measureElement=function(t){if(!t)return void _this2.elementsCache.forEach(function(t,i){t.isConnected||(_this2.observer.unobserve(t),_this2.elementsCache["delete"](i));});var i=_this2.indexFromElement(t),s=_this2.options.getItemKey(i),h=_this2.elementsCache.get(s);h!==t&&(h&&_this2.observer.unobserve(h),_this2.observer.observe(t),_this2.elementsCache.set(s,t)),_this2.isScrolling&&!_this2.scrollState||!_this2.shouldMeasureDuringScroll(i)||_this2.resizeItem(i,_this2.options.measureElement(t,void 0,_this2));},this.resizeItem=function(t,i){var _this2$itemSizeCache$;var s,h;if(t<0||t>=_this2.options.count)return;var n,e,l;var r=_this2._flatMeasurements;if(1===_this2.options.lanes&&null!==r)l=_this2.options.getItemKey(t),e=r[2*t],n=r[2*t+1];else{var _i16=_this2.measurementsCache[t];if(!_i16)return;l=_i16.key,e=_i16.start,n=_i16.size;}var o=i-((_this2$itemSizeCache$=_this2.itemSizeCache.get(l))!==null&&_this2$itemSizeCache$!==void 0?_this2$itemSizeCache$:n);if(0!==o){var _this2$measurementsCa;var _r2="end"===_this2.options.anchorTo&&"smooth"!==(null==(s=_this2.scrollState)?void 0:s.behavior)&&_this2.getVirtualDistanceFromEnd()<=_this2.options.scrollEndThreshold,_u=_r2?_this2.getTotalSize():0,_a3="smooth"!==(null==(h=_this2.scrollState)?void 0:h.behavior)&&(void 0!==_this2.shouldAdjustScrollPositionOnItemSizeChange?_this2.shouldAdjustScrollPositionOnItemSizeChange((_this2$measurementsCa=_this2.measurementsCache[t])!==null&&_this2$measurementsCa!==void 0?_this2$measurementsCa:{index:t,key:l,start:e,size:n,end:e+n,lane:0},o,_this2):e<_this2.getScrollOffset()+_this2.scrollAdjustments&&(!_this2.itemSizeCache.has(l)||"backward"!==_this2.scrollDirection));(null===_this2.pendingMin||t<_this2.pendingMin)&&(_this2.pendingMin=t),_this2.itemSizeCache.set(l,i),_this2.itemSizeCacheVersion++,_r2?_this2.applyScrollAdjustment(_this2.getTotalSize()-_u):_a3&&_this2.applyScrollAdjustment(o),_this2.notify(!1);}},this.getVirtualItems=t(function(){return[_this2.getVirtualIndexes(),_this2.getMeasurements()];},function(t,i){var s=[];for(var _h9=0,_n11=t.length;_h9<_n11;_h9++){var _n12=i[t[_h9]];s.push(_n12);}return s;},{key:!1,debug:function debug(){return _this2.options.debug;}}),this.getVirtualItemForOffset=function(t){var s=_this2.getMeasurements();if(0===s.length)return;var h=_this2._flatMeasurements,n=1===_this2.options.lanes&&null!=h,e=b(0,s.length-1,n?function(t){return h[2*t];}:function(t){return i(s[t]).start;},t);return i(s[e]);},this.getMaxScrollOffset=function(){if(!_this2.scrollElement)return 0;if("scrollHeight"in _this2.scrollElement)return _this2.options.horizontal?_this2.scrollElement.scrollWidth-_this2.scrollElement.clientWidth:_this2.scrollElement.scrollHeight-_this2.scrollElement.clientHeight;{var _t18=_this2.scrollElement.document.documentElement;return _this2.options.horizontal?_t18.scrollWidth-_this2.scrollElement.innerWidth:_t18.scrollHeight-_this2.scrollElement.innerHeight;}},this.getVirtualDistanceFromEnd=function(){return Math.max(_this2.getTotalSize()-_this2.getSize()-_this2.getScrollOffset(),0);},this.getDistanceFromEnd=function(){return Math.max(_this2.getMaxScrollOffset()-_this2.getScrollOffset(),0);},this.isAtEnd=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:_this2.options.scrollEndThreshold;return _this2.getDistanceFromEnd()<=t;},this.getOffsetForAlignment=function(t,i){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!_this2.scrollElement)return 0;var h=_this2.getSize(),n=_this2.getScrollOffset();"auto"===i&&(i=t>=n+h?"end":"start"),"center"===i?t+=(s-h)/2:"end"===i&&(t-=h);var e=_this2.getMaxScrollOffset();return Math.max(Math.min(e,t),0);},this.getOffsetForIndex=function(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"auto";t=Math.max(0,Math.min(t,_this2.options.count-1));var s=_this2.getSize(),h=_this2.getScrollOffset(),n=_this2.measurementsCache[t];if(!n)return;if("auto"===i)if(n.end>=h+s-_this2.options.scrollPaddingEnd)i="end";else{if(!(n.start<=h+_this2.options.scrollPaddingStart))return[h,i];i="start";}if("end"===i&&t===_this2.options.count-1)return[_this2.getMaxScrollOffset(),i];var e="end"===i?n.end+_this2.options.scrollPaddingEnd:n.start-_this2.options.scrollPaddingStart;return[_this2.getOffsetForAlignment(e,i,n.size),i];},this.scrollToOffset=function(t){var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$align=_ref7.align,i=_ref7$align===void 0?"start":_ref7$align,_ref7$behavior=_ref7.behavior,s=_ref7$behavior===void 0?"auto":_ref7$behavior;var h=_this2.getOffsetForAlignment(t,i),n=_this2.now();_this2.scrollState={index:null,align:i,behavior:s,startedAt:n,lastTargetOffset:h,stableFrames:0},_this2._scrollToOffset(h,{adjustments:void 0,behavior:s}),_this2.scheduleScrollReconcile();},this.scrollToIndex=function(t){var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref8$align=_ref8.align,i=_ref8$align===void 0?"auto":_ref8$align,_ref8$behavior=_ref8.behavior,s=_ref8$behavior===void 0?"auto":_ref8$behavior;t=Math.max(0,Math.min(t,_this2.options.count-1));var h=_this2.getOffsetForIndex(t,i);if(!h)return;var _h10=_slicedToArray(h,2),n=_h10[0],e=_h10[1],l=_this2.now();_this2.scrollState={index:t,align:e,behavior:s,startedAt:l,lastTargetOffset:n,stableFrames:0},_this2._scrollToOffset(n,{adjustments:void 0,behavior:s}),_this2.scheduleScrollReconcile();},this.scrollBy=function(t){var _ref9=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref9$behavior=_ref9.behavior,i=_ref9$behavior===void 0?"auto":_ref9$behavior;var s=_this2.getScrollOffset()+t,h=_this2.now();_this2.scrollState={index:null,align:"start",behavior:i,startedAt:h,lastTargetOffset:s,stableFrames:0},_this2._scrollToOffset(s,{adjustments:void 0,behavior:i}),_this2.scheduleScrollReconcile();},this.scrollToEnd=function(){var _ref10=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref10$behavior=_ref10.behavior,t=_ref10$behavior===void 0?"auto":_ref10$behavior;_this2.options.count>0?_this2.scrollToIndex(_this2.options.count-1,{align:"end",behavior:t}):_this2.scrollToOffset(Math.max(_this2.getTotalSize()-_this2.getSize(),0),{behavior:t});},this.getTotalSize=function(){var t;var i=_this2.getMeasurements();var s;if(0===i.length)s=_this2.options.paddingStart;else if(1===_this2.options.lanes){var _ref11;var _h11=i.length-1,_n13=_this2._flatMeasurements;s=null!=_n13?_n13[2*_h11]+_n13[2*_h11+1]:(_ref11=null==(t=i[_h11])?void 0:t.end)!==null&&_ref11!==void 0?_ref11:0;}else{var _t19=Array(_this2.options.lanes).fill(null);var _h12=i.length-1;for(;_h12>=0&&_t19.some(function(t){return null===t;});){var _s11=i[_h12];null===_t19[_s11.lane]&&(_t19[_s11.lane]=_s11.end),_h12--;}s=Math.max.apply(Math,_toConsumableArray(_t19.filter(function(t){return null!==t;})));}return Math.max(s-_this2.options.scrollMargin+_this2.options.paddingEnd,0);},this.takeSnapshot=function(){var t=[];if(0===_this2.itemSizeCache.size)return t;var i=_this2.getMeasurements();var _iterator3=_createForOfIteratorHelper(i),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _s12=_step3.value;_s12&&_this2.itemSizeCache.has(_s12.key)&&t.push({index:_s12.index,key:_s12.key,start:_s12.start,size:_s12.size,end:_s12.end,lane:_s12.lane});}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}return t;},this._scrollToOffset=function(t,_ref12){var i=_ref12.adjustments,s=_ref12.behavior;_this2._intendedScrollOffset=t+(i!==null&&i!==void 0?i:0),_this2.options.scrollToFn(t,{behavior:s,adjustments:i},_this2);},this.measure=function(){_this2.pendingMin=null,_this2.itemSizeCache.clear(),_this2.laneAssignments.clear(),_this2.itemSizeCacheVersion++,_this2.notify(!1);},this.setOptions(s);}return _createClass(v,[{key:"applyScrollAdjustment",value:function applyScrollAdjustment(t,i){0!==t&&(n()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:i}),null!==this.scrollOffset&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)));}},{key:"scheduleScrollReconcile",value:function scheduleScrollReconcile(){var _this3=this;this.targetWindow?null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(function(){_this3.rafId=null,_this3.reconcileScroll();})):this.scrollState=null;}},{key:"reconcileScroll",value:function reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3)return void(this.scrollState=null);var t=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=t?t[0]:this.scrollState.lastTargetOffset,s=i!==this.scrollState.lastTargetOffset;if(!s&&(h=i,n=this.getScrollOffset(),Math.abs(h-n)<1.01)){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1)return this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),void(this.scrollState=null);}else if(this.scrollState.stableFrames=0,s){var _t20=this.getSize()||600,_s13=Math.abs(i-this.getScrollOffset()),_h13="smooth"===this.scrollState.behavior&&_s13>_t20;this.scrollState.lastTargetOffset=i,_h13||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:_h13?"smooth":"auto"});}var h,n;this.scheduleScrollReconcile();}}]);}();b=function b(t,i,s,h){for(;t<=i;){var _n14=(t+i)/2|0,_e8=s(_n14);if(_e8<h)t=_n14+1;else{if(!(_e8>h))return _n14;i=_n14-1;}}return t>0?t-1:0;};g=/*#__PURE__*/function(){function g(t,i){var _this4=this;_classCallCheck(this,g);this.cleanup=function(){};var s=_objectSpread(_objectSpread({},i),{},{onChange:function onChange(t,s){var h;_this4.host.updateComplete.then(function(){return _this4.host.requestUpdate();}),null==(h=i.onChange)||h.call(i,t,s);}});this.virtualizer=new v(s),(this.host=t).addController(this);}return _createClass(g,[{key:"getVirtualizer",value:function getVirtualizer(){return this.virtualizer;}},{key:"hostConnected",value:function hostConnected(){this.cleanup=this.virtualizer._didMount();}},{key:"hostUpdated",value:function hostUpdated(){this.virtualizer._willUpdate();}},{key:"hostDisconnected",value:function hostDisconnected(){this.cleanup();}}]);}();_export("V",m=/*#__PURE__*/function(_g2){function m(t,i){_classCallCheck(this,m);return _callSuper(this,m,[t,_objectSpread({observeElementRect:o,observeElementOffset:c,scrollToFn:f},i)]);}_inherits(m,_g2);return _createClass(m);}(g));}};});
2
- //# sourceMappingURL=index-b387a9f4.cjs.js.map