@aquera/nile-elements 2.0.15 → 2.0.17
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.
- package/README.md +6 -0
- package/demo/nxtgen-classes.css +5 -5
- package/demo/nxtgen-dark.css +16 -16
- package/demo/nxtgen-properties.css +2 -2
- package/demo/nxtgen-utilities.css +5 -5
- package/demo/nxtgen.css +5 -5
- package/demo/utilities.css +2 -2
- package/demo/variables.css +2 -2
- package/dist/{index-f6944844.cjs.js → index-0c0c869d.cjs.js} +2 -2
- package/dist/{index-f6944844.cjs.js.map → index-0c0c869d.cjs.js.map} +1 -1
- package/dist/{index-403841c7.cjs.js → index-129ef6fb.cjs.js} +3 -3
- package/dist/{index-403841c7.cjs.js.map → index-129ef6fb.cjs.js.map} +1 -1
- package/dist/{index-1faa963c.esm.js → index-36f2a6b5.esm.js} +1 -1
- package/dist/index-4df50481.esm.js +1 -0
- package/dist/index-5d34cff1.esm.js +1 -0
- package/dist/index-7ae95edd.cjs.js +2 -0
- package/dist/{index-3ca67627.cjs.js.map → index-7ae95edd.cjs.js.map} +1 -1
- package/dist/index-7ca72b78.esm.js +1 -0
- package/dist/index-bbe23ad8.cjs.js +2 -0
- package/dist/index-bbe23ad8.cjs.js.map +1 -0
- package/dist/index-ccc6a799.cjs.js +5 -0
- package/dist/index-ccc6a799.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +124 -72
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/portal-manager.cjs.js +1 -1
- package/dist/nile-auto-complete/portal-utils.cjs.js +1 -1
- package/dist/nile-code-editor/extensionSetup.cjs.js +2 -2
- package/dist/nile-code-editor/index.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
- package/dist/nile-code-editor/theme.cjs.js +1 -1
- package/dist/nile-color-picker/index.cjs.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
- package/dist/nile-combobox/index.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/portal-manager.cjs.js +1 -1
- package/dist/nile-context-menu/index.cjs.js +1 -1
- package/dist/nile-context-menu/nile-context-menu.cjs.js +1 -1
- package/dist/nile-context-submenu/index.cjs.js +1 -1
- package/dist/nile-context-submenu/nile-context-submenu.cjs.js +1 -1
- package/dist/nile-detail/index.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js +1 -1
- package/dist/nile-dropdown/index.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
- package/dist/nile-dropdown/portal-manager.cjs.js +1 -1
- package/dist/nile-file-upload/index.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +1 -1
- package/dist/nile-floating-panel/index.cjs.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
- package/dist/nile-lite-tooltip/index.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.css.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.css.esm.js +1 -1
- package/dist/nile-markdown-editor/index.cjs.js +1 -1
- package/dist/nile-markdown-editor/nile-markdown-editor.cjs.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +1 -1
- package/dist/nile-popover/portal-manager.cjs.js +1 -1
- package/dist/nile-popup/index.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.cjs.js +1 -1
- package/dist/nile-segmented-progress-bar/index.cjs.js +1 -1
- package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.cjs.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/portal-manager.cjs.js +1 -1
- package/dist/nile-side-bar-action/index.cjs.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
- package/dist/nile-side-bar-action/portal-manager.cjs.js +1 -1
- package/dist/nile-tooltip/index.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.esm.js +1 -1
- package/dist/nile-virtual-select/index.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
- package/dist/nile-virtual-select/portal-manager.cjs.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/email-css.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/email-css.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/email-css.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/email-render.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/email-render.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/email-render.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/html-detect.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/html-detect.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/html-detect.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/inputrules.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +2 -1
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +45 -4
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +2 -2
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +2 -2
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +5 -5
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +2 -2
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +3 -3
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +3 -3
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +9 -9
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +4 -4
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +23 -12
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +7 -7
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.css.js +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/create-state.d.ts +5 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.js +2 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/email-css.d.ts +14 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-css.js +140 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-css.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.js +1045 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-render.d.ts +11 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-render.js +93 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-render.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/html-detect.d.ts +2 -0
- package/dist/src/nile-wysiwyg-editor/engine/html-detect.js +24 -0
- package/dist/src/nile-wysiwyg-editor/engine/html-detect.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +4 -1
- package/dist/src/nile-wysiwyg-editor/engine/index.js +3 -1
- package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.d.ts +0 -5
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.js +19 -0
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js +3 -2
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.d.ts +4 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js +56 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.d.ts +5 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js +27 -6
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +30 -7
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +46 -0
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +9 -1
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +730 -7
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +3 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.js +215 -34
- package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.js +3 -1
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/serializer.d.ts +12 -4
- package/dist/src/nile-wysiwyg-editor/engine/serializer.js +18 -8
- package/dist/src/nile-wysiwyg-editor/engine/serializer.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.js +287 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +45 -4
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +23 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +113 -15
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +213 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +2 -2
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +2 -2
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js +2 -2
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +14 -3
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +2 -2
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/version.cjs.js +1 -1
- package/dist/version.cjs.js.map +1 -1
- package/dist/version.esm.js +1 -1
- package/package.json +1 -1
- package/src/nile-lite-tooltip/nile-lite-tooltip.css.ts +1 -1
- package/src/nile-tooltip/nile-tooltip.css.ts +1 -1
- package/src/nile-wysiwyg-editor/engine/create-state.ts +7 -0
- package/src/nile-wysiwyg-editor/engine/email-css.ts +136 -0
- package/src/nile-wysiwyg-editor/engine/email-fidelity.test.ts +1347 -0
- package/src/nile-wysiwyg-editor/engine/email-render.ts +99 -0
- package/src/nile-wysiwyg-editor/engine/html-detect.ts +26 -0
- package/src/nile-wysiwyg-editor/engine/index.ts +10 -1
- package/src/nile-wysiwyg-editor/engine/inputrules.ts +18 -1
- package/src/nile-wysiwyg-editor/engine/plugins/image-view.ts +3 -2
- package/src/nile-wysiwyg-editor/engine/plugins/link.ts +58 -2
- package/src/nile-wysiwyg-editor/engine/plugins/paste.ts +31 -8
- package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +29 -7
- package/src/nile-wysiwyg-editor/engine/pm.test.ts +73 -0
- package/src/nile-wysiwyg-editor/engine/sanitize.ts +729 -7
- package/src/nile-wysiwyg-editor/engine/schema.ts +206 -33
- package/src/nile-wysiwyg-editor/engine/selection-state.ts +3 -1
- package/src/nile-wysiwyg-editor/engine/serializer.ts +30 -8
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.ts +357 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +45 -4
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +258 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +119 -12
- package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +2 -2
- package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/embed-menu.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/embed-panel.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/find-replace.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/image-menu.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/image-panel.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/insert-menu.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/link-editor.ts +2 -2
- package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/math-panel.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/source-view.ts +2 -2
- package/src/nile-wysiwyg-editor/ui/special-chars.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/suggest-list.ts +14 -3
- package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +2 -2
- package/src/nile-wysiwyg-editor/ui/table-menu.ts +1 -1
- package/vscode-html-custom-data.json +15 -1
- package/web-test-runner.config.mjs +4 -0
- package/dist/index-3ca67627.cjs.js +0 -2
- package/dist/index-6f3fa4ab.esm.js +0 -1
- package/dist/index-7b1c9857.esm.js +0 -1
- package/dist/index-89c520e9.cjs.js +0 -5
- package/dist/index-89c520e9.cjs.js.map +0 -1
- package/dist/index-ba47645d.esm.js +0 -1
- package/dist/index-c3210a9c.cjs.js +0 -2
- package/dist/index-c3210a9c.cjs.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as t,R as e,F as r,M as i,b as n,N as s}from"./index-5d34cff1.esm.js";const h=Math.pow(2,16);function l(t){return 65535&t}class o{constructor(t,e,r){this.pos=t,this.delInfo=e,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class u{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&u.empty)return u.empty}recover(t){let e=0,r=l(t);if(!this.inverted)for(let t=0;t<r;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*r]+e+function(t){return(t-(65535&t))/h}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,r){let i=0,n=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?i:0);if(u>t)break;let f=this.ranges[l+n],a=this.ranges[l+s],c=u+f;if(t<=c){let n=u+i+((f?t==u?-1:t==c?1:e:e)<0?0:a);if(r)return n;let s=t==(e<0?u:c)?null:l/3+(t-u)*h,p=t==u?2:t==c?1:4;return(e<0?t!=u:t!=c)&&(p|=8),new o(n,p,s)}i+=a-f}return r?t+i:new o(t+i,0,null)}touches(t,e){let r=0,i=l(e),n=this.inverted?2:1,s=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let h=this.ranges[e]-(this.inverted?r:0);if(h>t)break;let l=this.ranges[e+n];if(t<=h+l&&e==3*i)return!0;r+=this.ranges[e+s]-l}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,n=0;i<this.ranges.length;i+=3){let s=this.ranges[i],h=s-(this.inverted?n:0),l=s+(this.inverted?0:n),o=this.ranges[i+e],u=this.ranges[i+r];t(h,h+o,l,l+u),n+=u-o}}invert(){return new u(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?u.empty:new u(t<0?[0,-t,0]:[0,0,t])}}u.empty=new u([]);class f{constructor(t,e,r=0,i=(t?t.length:0)){this.mirror=e,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||e)}get maps(){return this._maps}slice(t=0,e=this.maps.length){return new f(this._maps,this.mirror,t,e)}appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),null!=e&&this.setMirror(this._maps.length-1,e)}appendMapping(t){for(let e=0,r=this._maps.length;e<t._maps.length;e++){let i=t.getMirror(e);this.appendMap(t._maps[e],null!=i&&i<e?r+i:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,r=this._maps.length+t._maps.length;e>=0;e--){let i=t.getMirror(e);this.appendMap(t._maps[e].invert(),null!=i&&i>e?r-i-1:void 0)}}invert(){let t=new f;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,r){let i=0;for(let r=this.from;r<this.to;r++){let n=this._maps[r].mapResult(t,e);if(null!=n.recover){let e=this.getMirror(r);if(null!=e&&e>r&&e<this.to){r=e,t=this._maps[e].recover(n.recover);continue}}i|=n.delInfo,t=n.pos}return r?t:new o(t,i,null)}}const a=Object.create(null);class c{getMap(){return u.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=a[e.stepType];if(!r)throw new RangeError(`No step type ${e.stepType} defined`);return r.fromJSON(t,e)}static jsonID(t,e){if(t in a)throw new RangeError("Duplicate use of step JSON ID "+t);return a[t]=e,e.prototype.jsonID=t,e}}class p{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new p(t,null)}static fail(t){return new p(null,t)}static fromReplace(t,r,i,n){try{return p.ok(t.replace(r,i,n))}catch(t){if(t instanceof e)return p.fail(t.message);throw t}}}function w(t,e,i){let n=[];for(let r=0;r<t.childCount;r++){let s=t.child(r);s.content.size&&(s=s.copy(w(s.content,e,s))),s.isInline&&(s=e(s,i,r)),n.push(s)}return r.fromArray(n)}class d extends c{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(e){let r=e.slice(this.from,this.to),i=e.resolve(this.from),n=i.node(i.sharedDepth(this.to)),s=new t(w(r.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),n),r.openStart,r.openEnd);return p.fromReplace(e,this.from,this.to,s)}invert(){return new m(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new d(e.pos,r.pos,this.mark)}merge(t){return t instanceof d&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new d(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new d(e.from,e.to,t.markFromJSON(e.mark))}}c.jsonID("addMark",d);class m extends c{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(e){let r=e.slice(this.from,this.to),i=new t(w(r.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),e),r.openStart,r.openEnd);return p.fromReplace(e,this.from,this.to,i)}invert(){return new d(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new m(e.pos,r.pos,this.mark)}merge(t){return t instanceof m&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new m(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new m(e.from,e.to,t.markFromJSON(e.mark))}}c.jsonID("removeMark",m);class g extends c{constructor(t,e){super(),this.pos=t,this.mark=e}apply(e){let i=e.nodeAt(this.pos);if(!i)return p.fail("No node at mark step's position");let n=i.type.create(i.attrs,null,this.mark.addToSet(i.marks));return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(n),0,i.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let r=0;r<e.marks.length;r++)if(!e.marks[r].isInSet(t))return new g(this.pos,e.marks[r]);return new g(this.pos,this.mark)}}return new S(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new g(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new g(e.pos,t.markFromJSON(e.mark))}}c.jsonID("addNodeMark",g);class S extends c{constructor(t,e){super(),this.pos=t,this.mark=e}apply(e){let i=e.nodeAt(this.pos);if(!i)return p.fail("No node at mark step's position");let n=i.type.create(i.attrs,null,this.mark.removeFromSet(i.marks));return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(n),0,i.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new g(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new S(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new S(e.pos,t.markFromJSON(e.mark))}}c.jsonID("removeNodeMark",S);class y extends c{constructor(t,e,r,i=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=i}apply(t){return this.structure&&v(t,this.from,this.to)?p.fail("Structure replace would overwrite content"):p.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new u([this.from,this.to-this.from,this.slice.size])}invert(t){return new y(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.to,-1),r=this.from==this.to&&y.MAP_BIAS<0?e:t.mapResult(this.from,1);return r.deletedAcross&&e.deletedAcross?null:new y(r.pos,Math.max(r.pos,e.pos),this.slice,this.structure)}merge(e){if(!(e instanceof y)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let r=this.slice.size+e.slice.size==0?t.empty:new t(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new y(e.from,this.to,r,this.structure)}}{let r=this.slice.size+e.slice.size==0?t.empty:new t(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new y(this.from,this.to+(e.to-e.from),r,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(e,r){if("number"!=typeof r.from||"number"!=typeof r.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new y(r.from,r.to,t.fromJSON(e,r.slice),!!r.structure)}}y.MAP_BIAS=1,c.jsonID("replace",y);class N extends c{constructor(t,e,r,i,n,s,h=!1){super(),this.from=t,this.to=e,this.gapFrom=r,this.gapTo=i,this.slice=n,this.insert=s,this.structure=h}apply(t){if(this.structure&&(v(t,this.from,this.gapFrom)||v(t,this.gapTo,this.to)))return p.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return p.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?p.fromReplace(t,this.from,this.to,r):p.fail("Content does not fit in gap")}getMap(){return new u([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new N(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),n=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||n>r.pos?null:new N(e.pos,r.pos,i,n,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(e,r){if("number"!=typeof r.from||"number"!=typeof r.to||"number"!=typeof r.gapFrom||"number"!=typeof r.gapTo||"number"!=typeof r.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new N(r.from,r.to,r.gapFrom,r.gapTo,t.fromJSON(e,r.slice),r.insert,!!r.structure)}}function v(t,e,r){let i=t.resolve(e),n=r-e,s=i.depth;for(;n>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,n--;if(n>0){let t=i.node(s).maybeChild(i.indexAfter(s));for(;n>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,n--}}return!1}function M(e,i,n,s=n.contentMatch,h=!0){let l=e.doc.nodeAt(i),o=[],u=i+1;for(let i=0;i<l.childCount;i++){let f=l.child(i),a=u+f.nodeSize,c=s.matchType(f.type);if(c){s=c;for(let t=0;t<f.marks.length;t++)n.allowsMarkType(f.marks[t].type)||e.step(new m(u,a,f.marks[t]));if(h&&f.isText&&"pre"!=n.whitespace){let e,i,s=/\r?\n|\r/g;for(;e=s.exec(f.text);)i||(i=new t(r.from(n.schema.text(" ",n.allowedMarks(f.marks))),0,0)),o.push(new y(u+e.index,u+e.index+e[0].length,i))}}else o.push(new y(u,a,t.empty));u=a}if(!s.validEnd){let i=s.fillBefore(r.empty,!0);e.replace(u,u,new t(i,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function k(t,e,r){return(0==e||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function b(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,n=0;;--r){let s=t.$from.node(r),h=t.$from.index(r)+i,l=t.$to.indexAfter(r)-n;if(r<t.depth&&s.canReplace(h,l,e))return r;if(0==r||s.type.spec.isolating||!k(s,h,l))break;h&&(i=1),l<s.childCount&&(n=1)}return null}function O(t,e,r=null,i=t){let n=function(t,e){let{parent:r,startIndex:i,endIndex:n}=t,s=r.contentMatchAt(i).findWrapping(e);if(!s)return null;let h=s.length?s[0]:e;return r.canReplaceWith(i,n,h)?s:null}(t,e),s=n&&function(t,e){let{parent:r,startIndex:i,endIndex:n}=t,s=r.child(i),h=e.contentMatch.findWrapping(s.type);if(!h)return null;let l=(h.length?h[h.length-1]:e).contentMatch;for(let t=i;l&&t<n;t++)l=l.matchType(r.child(t).type);return l&&l.validEnd?h:null}(i,e);return s?n.map(J).concat({type:e,attrs:r}).concat(s.map(J)):null}function J(t){return{type:t,attrs:null}}function R(t,e,r,i){e.forEach(((n,s)=>{if(n.isText){let h,l=/\r?\n|\r/g;for(;h=l.exec(n.text);){let n=t.mapping.slice(i).map(r+1+s+h.index);t.replaceWith(n,n+1,e.type.schema.linebreakReplacement.create())}}}))}function E(t,e,r,i){e.forEach(((n,s)=>{if(n.type==n.type.schema.linebreakReplacement){let n=t.mapping.slice(i).map(r+1+s);t.replaceWith(n,n+1,e.type.schema.text("\n"))}}))}function I(t,e,r=1,i){let n=t.resolve(e),s=n.depth-r,h=i&&i[i.length-1]||n.parent;if(s<0||n.parent.type.spec.isolating||!n.parent.canReplace(n.index(),n.parent.childCount)||!h.type.validContent(n.parent.content.cutByIndex(n.index(),n.parent.childCount)))return!1;for(let t=n.depth-1,e=r-2;t>s;t--,e--){let r=n.node(t),s=n.index(t);if(r.type.spec.isolating)return!1;let h=r.content.cutByIndex(s,r.childCount),l=i&&i[e+1];l&&(h=h.replaceChild(0,l.type.create(l.attrs)));let o=i&&i[e]||r;if(!r.canReplace(s+1,r.childCount)||!o.type.validContent(h))return!1}let l=n.indexAfter(s),o=i&&i[0];return n.node(s).canReplaceWith(l,l,o?o.type:n.node(s+1).type)}function x(t,e){let r=t.resolve(e),i=r.index();return n=r.nodeBefore,s=r.nodeAfter,!(!n||!s||n.isLeaf||!function(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:i}=t.type.schema;for(let n=0;n<e.childCount;n++){let s=e.child(n),h=s.type==i?t.type.schema.nodes.text:s.type;if(r=r.matchType(h),!r)return!1;if(!t.type.allowsMarks(s.marks))return!1}return r.validEnd}(n,s))&&r.parent.canReplace(i,i+1);var n,s}function T(t,e,r){let i=t.resolve(e);if(!r.content.size)return e;let n=r.content;for(let t=0;t<r.openStart;t++)n=n.firstChild.content;for(let t=1;t<=(0==r.openStart&&r.size?2:1);t++)for(let e=i.depth;e>=0;e--){let r=e==i.depth?0:i.pos<=(i.start(e+1)+i.end(e+1))/2?-1:1,s=i.index(e)+(r>0?1:0),h=i.node(e),l=!1;if(1==t)l=h.canReplace(s,s,n);else{let t=h.contentMatchAt(s).findWrapping(n.firstChild.type);l=t&&h.canReplaceWith(s,s,t[0])}if(l)return 0==r?i.pos:r<0?i.before(e+1):i.after(e+1)}return null}function j(e,r,i=r,n=t.empty){if(r==i&&!n.size)return null;let s=e.resolve(r),h=e.resolve(i);return A(s,h,n)?new y(r,i,n):new D(s,h,n).fit()}function A(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}c.jsonID("replaceAround",N);class D{constructor(t,e,i){this.$from=t,this.$to=e,this.unplaced=i,this.frontier=[],this.placed=r.empty;for(let e=0;e<=t.depth;e++){let r=t.node(e);this.frontier.push({type:r.type,match:r.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=r.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,i=this.$from,n=this.close(e<0?this.$to:i.doc.resolve(e));if(!n)return null;let s=this.placed,h=i.depth,l=n.depth;for(;h&&l&&1==s.childCount;)s=s.firstChild.content,h--,l--;let o=new t(s,h,l);return e>-1?new N(i.pos,e,this.$to.pos,this.$to.end(),o,r):o.size||i.pos!=this.$to.pos?new y(i.pos,n.pos,o):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let n=e.firstChild;if(e.childCount>1&&(i=0),n.type.spec.isolating&&i<=r){t=r;break}e=n.content}for(let e=1;e<=2;e++)for(let i=1==e?t:this.unplaced.openStart;i>=0;i--){let t,n=null;i?(n=F(this.unplaced.content,i-1).firstChild,t=n.content):t=this.unplaced.content;let s=t.firstChild;for(let t=this.depth;t>=0;t--){let h,{type:l,match:o}=this.frontier[t],u=null;if(1==e&&(s?o.matchType(s.type)||(u=o.fillBefore(r.from(s),!1)):n&&l.compatibleContent(n.type)))return{sliceDepth:i,frontierDepth:t,parent:n,inject:u};if(2==e&&s&&(h=o.findWrapping(s.type)))return{sliceDepth:i,frontierDepth:t,parent:n,wrap:h};if(n&&o.matchType(n.type))break}}}openMore(){let{content:e,openStart:r,openEnd:i}=this.unplaced,n=F(e,r);return!(!n.childCount||n.firstChild.isLeaf)&&(this.unplaced=new t(e,r+1,Math.max(i,n.size+r>=e.size-i?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:i}=this.unplaced,n=F(e,r);if(n.childCount<=1&&r>0){let s=e.size-r<=r+n.size;this.unplaced=new t($(e,r-1,1),r-1,s?r-1:i)}else this.unplaced=new t($(e,r,1),r,i)}placeNodes({sliceDepth:e,frontierDepth:i,parent:n,inject:s,wrap:h}){for(;this.depth>i;)this.closeFrontierNode();if(h)for(let t=0;t<h.length;t++)this.openFrontierNode(h[t]);let l=this.unplaced,o=n?n.content:l.content,u=l.openStart-e,f=0,a=[],{match:c,type:p}=this.frontier[i];if(s){for(let t=0;t<s.childCount;t++)a.push(s.child(t));c=c.matchFragment(s)}let w=o.size+e-(l.content.size-l.openEnd);for(;f<o.childCount;){let t=o.child(f),e=c.matchType(t.type);if(!e)break;f++,(f>1||0==u||t.content.size)&&(c=e,a.push(W(t.mark(p.allowedMarks(t.marks)),1==f?u:0,f==o.childCount?w:-1)))}let d=f==o.childCount;d||(w=-1),this.placed=B(this.placed,i,r.from(a)),this.frontier[i].match=c,d&&w<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=o;t<w;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=d?0==e?t.empty:new t($(l.content,e-1,1),e-1,w<0?l.openEnd:e-1):new t($(l.content,e,f),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!q(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:r,type:i}=this.frontier[e],n=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=q(t,e,i,r,n);if(s){for(let r=e-1;r>=0;r--){let{match:e,type:i}=this.frontier[r],n=q(t,r,i,e,!0);if(!n||n.childCount)continue t}return{depth:e,fit:s,move:n?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=B(this.placed,e.depth,e.fit)),t=e.move;for(let r=e.depth+1;r<=t.depth;r++){let e=t.node(r),i=e.type.contentMatch.fillBefore(e.content,!0,t.index(r));this.openFrontierNode(e.type,e.attrs,i)}return t}openFrontierNode(t,e=null,i){let n=this.frontier[this.depth];n.match=n.match.matchType(t),this.placed=B(this.placed,this.depth,r.from(t.create(e,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.empty,!0);t.childCount&&(this.placed=B(this.placed,this.frontier.length,t))}}function $(t,e,r){return 0==e?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy($(t.firstChild.content,e-1,r)))}function B(t,e,r){return 0==e?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(B(t.lastChild.content,e-1,r)))}function F(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function W(t,e,i){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,W(n.firstChild,e-1,1==n.childCount?i-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),i<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(r.empty,!0)))),t.copy(n)}function q(t,e,r,i,n){let s=t.node(e),h=n?t.indexAfter(e):t.index(e);if(h==s.childCount&&!r.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,h);return l&&!function(t,e,r){for(let i=r;i<e.childCount;i++)if(!t.allowsMarks(e.child(i).marks))return!0;return!1}(r,s.content,h)?l:null}function C(t,e,i,n,s){if(e<i){let r=t.firstChild;t=t.replaceChild(0,r.copy(C(r.content,e+1,i,n,r)))}if(e>n){let e=s.contentMatchAt(0),i=e.fillBefore(t).append(t);t=i.append(e.matchFragment(i).fillBefore(r.empty,!0))}return t}function G(t,e){let r=[];for(let i=Math.min(t.depth,e.depth);i>=0;i--){let n=t.start(i);if(n<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(n==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==n-1)&&r.push(i)}return r}class V extends c{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(e){let i=e.nodeAt(this.pos);if(!i)return p.fail("No node at attribute step's position");let n=Object.create(null);for(let t in i.attrs)n[t]=i.attrs[t];n[this.attr]=this.value;let s=i.type.create(n,null,i.marks);return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(s),0,i.isLeaf?0:1))}getMap(){return u.empty}invert(t){return new V(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new V(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new V(e.pos,e.attr,e.value)}}c.jsonID("attr",V);class _ extends c{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let r=t.type.create(e,t.content,t.marks);return p.ok(r)}getMap(){return u.empty}invert(t){return new _(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new _(e.attr,e.value)}}c.jsonID("docAttr",_);let L=class extends Error{};L=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r},(L.prototype=Object.create(Error.prototype)).constructor=L,L.prototype.name="TransformError";class P{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new f}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new L(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,e=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),e=i.map(e,-1)),i.forEach(((r,i,n,s)=>{t=Math.min(t,n),e=Math.max(e,s)}))}return 1e9==t?null:{from:t,to:e}}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(e,r=e,i=t.empty){let n=j(this.doc,e,r,i);return n&&this.step(n),this}replaceWith(e,i,n){return this.replace(e,i,new t(r.from(n),0,0))}delete(e,r){return this.replace(e,r,t.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(e,r,i){return function(e,r,i,n){if(!n.size)return e.deleteRange(r,i);let s=e.doc.resolve(r),h=e.doc.resolve(i);if(A(s,h,n))return e.step(new y(r,i,n));let l=G(s,h);0==l[l.length-1]&&l.pop();let o=-(s.depth+1);l.unshift(o);for(let t=s.depth,e=s.pos-1;t>0;t--,e--){let r=s.node(t).type.spec;if(r.defining||r.definingAsContext||r.isolating)break;l.indexOf(t)>-1?o=t:s.before(t)==e&&l.splice(1,0,-t)}let u=l.indexOf(o),f=[],a=n.openStart;for(let t=n.content,e=0;;e++){let r=t.firstChild;if(f.push(r),e==n.openStart)break;t=r.content}for(let t=a-1;t>=0;t--){let e=f[t],r=(c=e.type).spec.defining||c.spec.definingForContent;if(r&&!e.sameMarkup(s.node(Math.abs(o)-1)))a=t;else if(r||!e.type.isTextblock)break}var c;for(let r=n.openStart;r>=0;r--){let o=(r+a+1)%(n.openStart+1),c=f[o];if(c)for(let r=0;r<l.length;r++){let f=l[(r+u)%l.length],a=!0;f<0&&(a=!1,f=-f);let p=s.node(f-1),w=s.index(f-1);if(p.canReplaceWith(w,w,c.type,c.marks))return e.replace(s.before(f),a?h.after(f):i,new t(C(n.content,0,n.openStart,o),o,n.openEnd))}}let p=e.steps.length;for(let t=l.length-1;t>=0&&(e.replace(r,i,n),!(e.steps.length>p));t--){let e=l[t];e<0||(r=s.before(e),i=h.after(e))}}(this,e,r,i),this}replaceRangeWith(e,i,n){return function(e,i,n,s){if(!s.isInline&&i==n&&e.doc.resolve(i).parent.content.size){let t=function(t,e,r){let i=t.resolve(e);if(i.parent.canReplaceWith(i.index(),i.index(),r))return e;if(0==i.parentOffset)for(let t=i.depth-1;t>=0;t--){let e=i.index(t);if(i.node(t).canReplaceWith(e,e,r))return i.before(t+1);if(e>0)return null}if(i.parentOffset==i.parent.content.size)for(let t=i.depth-1;t>=0;t--){let e=i.indexAfter(t);if(i.node(t).canReplaceWith(e,e,r))return i.after(t+1);if(e<i.node(t).childCount)return null}return null}(e.doc,i,s.type);null!=t&&(i=n=t)}e.replaceRange(i,n,new t(r.from(s),0,0))}(this,e,i,n),this}deleteRange(t,e){return function(t,e,r){let i=t.doc.resolve(e),n=t.doc.resolve(r);if(i.parent.isTextblock&&n.parent.isTextblock&&i.start()!=n.start()&&0==i.parentOffset&&0==n.parentOffset){let s=i.sharedDepth(r),h=!1;for(let t=i.depth;t>s;t--)i.node(t).type.spec.isolating&&(h=!0);for(let t=n.depth;t>s;t--)n.node(t).type.spec.isolating&&(h=!0);if(!h){for(let t=i.depth;t>0&&e==i.start(t);t--)e=i.before(t);for(let t=n.depth;t>0&&r==n.start(t);t--)r=n.before(t);i=t.doc.resolve(e),n=t.doc.resolve(r)}}let s=G(i,n);for(let e=0;e<s.length;e++){let r=s[e],h=e==s.length-1;if(h&&0==r||i.node(r).type.contentMatch.validEnd)return t.delete(i.start(r),n.end(r));if(r>0&&(h||i.node(r-1).canReplace(i.index(r-1),n.indexAfter(r-1))))return t.delete(i.before(r),n.after(r))}for(let s=1;s<=i.depth&&s<=n.depth;s++)if(e-i.start(s)==i.depth-s&&r>i.end(s)&&n.end(s)-r!=n.depth-s&&i.start(s-1)==n.start(s-1)&&i.node(s-1).canReplace(i.index(s-1),n.index(s-1)))return t.delete(i.before(s),r);t.delete(e,r)}(this,t,e),this}lift(e,i){return function(e,i,n){let{$from:s,$to:h,depth:l}=i,o=s.before(l+1),u=h.after(l+1),f=o,a=u,c=r.empty,p=0;for(let t=l,e=!1;t>n;t--)e||s.index(t)>0?(e=!0,c=r.from(s.node(t).copy(c)),p++):f--;let w=r.empty,d=0;for(let t=l,e=!1;t>n;t--)e||h.after(t+1)<h.end(t)?(e=!0,w=r.from(h.node(t).copy(w)),d++):a++;e.step(new N(f,a,o,u,new t(c.append(w),p,d),c.size-p,!0))}(this,e,i),this}join(e,r=1){return function(e,r,i){let n=null,{linebreakReplacement:s}=e.doc.type.schema,h=e.doc.resolve(r-i),l=h.node().type;if(s&&l.inlineContent){let t="pre"==l.whitespace,e=!!l.contentMatch.matchType(s);t&&!e?n=!1:!t&&e&&(n=!0)}let o=e.steps.length;if(!1===n){let t=e.doc.resolve(r+i);E(e,t.node(),t.before(),o)}l.inlineContent&&M(e,r+i-1,l,h.node().contentMatchAt(h.index()),null==n);let u=e.mapping.slice(o),f=u.map(r-i);if(e.step(new y(f,u.map(r+i,-1),t.empty,!0)),!0===n){let t=e.doc.resolve(f);R(e,t.node(),t.before(),e.steps.length)}}(this,e,r),this}wrap(e,i){return function(e,i,n){let s=r.empty;for(let t=n.length-1;t>=0;t--){if(s.size){let e=n[t].type.contentMatch.matchFragment(s);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=r.from(n[t].type.create(n[t].attrs,s))}let h=i.start,l=i.end;e.step(new N(h,l,h,l,new t(s,0,0),n.length,!0))}(this,e,i),this}setBlockType(e,i=e,n,s=null){return function(e,i,n,s,h){if(!s.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=e.steps.length;e.doc.nodesBetween(i,n,((i,n)=>{let o="function"==typeof h?h(i):h;if(i.isTextblock&&!i.hasMarkup(s,o)&&function(t,e,r){let i=t.resolve(e),n=i.index();return i.parent.canReplaceWith(n,n+1,r)}(e.doc,e.mapping.slice(l).map(n),s)){let h=null;if(s.schema.linebreakReplacement){let t="pre"==s.whitespace,e=!!s.contentMatch.matchType(s.schema.linebreakReplacement);t&&!e?h=!1:!t&&e&&(h=!0)}!1===h&&E(e,i,n,l),M(e,e.mapping.slice(l).map(n,1),s,void 0,null===h);let u=e.mapping.slice(l),f=u.map(n,1),a=u.map(n+i.nodeSize,1);return e.step(new N(f,a,f+1,a-1,new t(r.from(s.create(o,null,i.marks)),0,0),1,!0)),!0===h&&R(e,i,n,l),!1}}))}(this,e,i,n,s),this}setNodeMarkup(e,i,n=null,s){return function(e,i,n,s,h){let l=e.doc.nodeAt(i);if(!l)throw new RangeError("No node at given position");n||(n=l.type);let o=n.create(s,null,h||l.marks);if(l.isLeaf)return e.replaceWith(i,i+l.nodeSize,o);if(!n.validContent(l.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new N(i,i+l.nodeSize,i+1,i+l.nodeSize-1,new t(r.from(o),0,0),1,!0))}(this,e,i,n,s),this}setNodeAttribute(t,e,r){return this.step(new V(t,e,r)),this}setDocAttribute(t,e){return this.step(new _(t,e)),this}addNodeMark(t,e){return this.step(new g(t,e)),this}removeNodeMark(t,e){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(e instanceof i)e.isInSet(r.marks)&&this.step(new S(t,e));else{let i,n=r.marks,s=[];for(;i=e.isInSet(n);)s.push(new S(t,i)),n=i.removeFromSet(n);for(let t=s.length-1;t>=0;t--)this.step(s[t])}return this}split(e,i=1,n){return function(e,i,n=1,s){let h=e.doc.resolve(i),l=r.empty,o=r.empty;for(let t=h.depth,e=h.depth-n,i=n-1;t>e;t--,i--){l=r.from(h.node(t).copy(l));let e=s&&s[i];o=r.from(e?e.type.create(e.attrs,o):h.node(t).copy(o))}e.step(new y(i,i,new t(l.append(o),n,n),!0))}(this,e,i,n),this}addMark(t,e,r){return function(t,e,r,i){let n,s,h=[],l=[];t.doc.nodesBetween(e,r,((t,o,u)=>{if(!t.isInline)return;let f=t.marks;if(!i.isInSet(f)&&u.type.allowsMarkType(i.type)){let u=Math.max(o,e),a=Math.min(o+t.nodeSize,r),c=i.addToSet(f);for(let t=0;t<f.length;t++)f[t].isInSet(c)||(n&&n.to==u&&n.mark.eq(f[t])?n.to=a:h.push(n=new m(u,a,f[t])));s&&s.to==u?s.to=a:l.push(s=new d(u,a,i))}})),h.forEach((e=>t.step(e))),l.forEach((e=>t.step(e)))}(this,t,e,r),this}removeMark(t,e,r){return function(t,e,r,i){let s=[],h=0;t.doc.nodesBetween(e,r,((t,l)=>{if(!t.isInline)return;h++;let o=null;if(i instanceof n){let e,r=t.marks;for(;e=i.isInSet(r);)(o||(o=[])).push(e),r=e.removeFromSet(r)}else i?i.isInSet(t.marks)&&(o=[i]):o=t.marks;if(o&&o.length){let i=Math.min(l+t.nodeSize,r);for(let t=0;t<o.length;t++){let r,n=o[t];for(let t=0;t<s.length;t++){let e=s[t];e.step==h-1&&n.eq(s[t].style)&&(r=e)}r?(r.to=i,r.step=h):s.push({style:n,from:Math.max(l,e),to:i,step:h})}}})),s.forEach((e=>t.step(new m(e.from,e.to,e.style))))}(this,t,e,r),this}clearIncompatible(t,e,r){return M(this,t,e,r),this}}const z=Object.create(null);class H{constructor(t,e,r){this.$anchor=t,this.$head=e,this.ranges=r||[new K(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=t.empty){let i=r.content.lastChild,n=null;for(let t=0;t<r.openEnd;t++)n=i,i=i.lastChild;let s=e.steps.length,h=this.ranges;for(let l=0;l<h.length;l++){let{$from:o,$to:u}=h[l],f=e.mapping.slice(s);e.replaceRange(f.map(o.pos),f.map(u.pos),l?t.empty:r),0==l&&nt(e,s,(i?i.isInline:n&&n.isTextblock)?-1:1)}}replaceWith(t,e){let r=t.steps.length,i=this.ranges;for(let n=0;n<i.length;n++){let{$from:s,$to:h}=i[n],l=t.mapping.slice(r),o=l.map(s.pos),u=l.map(h.pos);n?t.deleteRange(o,u):(t.replaceRangeWith(o,u,e),nt(t,r,e.isInline?-1:1))}}static findFrom(t,e,r=!1){let i=t.parent.inlineContent?new X(t):it(t.node(0),t.parent,t.pos,t.index(),e,r);if(i)return i;for(let i=t.depth-1;i>=0;i--){let n=e<0?it(t.node(0),t.node(i),t.before(i+1),t.index(i),e,r):it(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,r);if(n)return n}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new et(t.node(0))}static atStart(t){return it(t,t,0,0,1)||new et(t)}static atEnd(t){return it(t,t,t.content.size,t.childCount,-1)||new et(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=z[e.type];if(!r)throw new RangeError(`No selection type ${e.type} defined`);return r.fromJSON(t,e)}static jsonID(t,e){if(t in z)throw new RangeError("Duplicate use of selection JSON ID "+t);return z[t]=e,e.prototype.jsonID=t,e}getBookmark(){return X.between(this.$anchor,this.$head).getBookmark()}}H.prototype.visible=!0;class K{constructor(t,e){this.$from=t,this.$to=e}}let Q=!1;function U(t){Q||t.parent.inlineContent||(Q=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class X extends H{constructor(t,e=t){U(t),U(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return H.near(r);let i=t.resolve(e.map(this.anchor));return new X(i.parent.inlineContent?i:r,r)}replace(e,r=t.empty){if(super.replace(e,r),r==t.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof X&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Y(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new X(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,r=e){let i=t.resolve(e);return new this(i,r==e?i:t.resolve(r))}static between(t,e,r){let i=t.pos-e.pos;if(r&&!i||(r=i>=0?1:-1),!e.parent.inlineContent){let t=H.findFrom(e,r,!0)||H.findFrom(e,-r,!0);if(!t)return H.near(e,r);e=t.$head}return t.parent.inlineContent||(0==i||(t=(H.findFrom(t,-r,!0)||H.findFrom(t,r,!0)).$anchor).pos<e.pos!=i<0)&&(t=e),new X(t,e)}}H.jsonID("text",X);class Y{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Y(t.map(this.anchor),t.map(this.head))}resolve(t){return X.between(t.resolve(this.anchor),t.resolve(this.head))}}class Z extends H{constructor(t){let e=t.nodeAfter,r=t.node(0).resolve(t.pos+e.nodeSize);super(t,r),this.node=e}map(t,e){let{deleted:r,pos:i}=e.mapResult(this.anchor),n=t.resolve(i);return r?H.near(n):new Z(n)}content(){return new t(r.from(this.node),0,0)}eq(t){return t instanceof Z&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new tt(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Z(t.resolve(e.anchor))}static create(t,e){return new Z(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Z.prototype.visible=!1,H.jsonID("node",Z);class tt{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:r}=t.mapResult(this.anchor);return e?new Y(r,r):new tt(r)}resolve(t){let e=t.resolve(this.anchor),r=e.nodeAfter;return r&&Z.isSelectable(r)?new Z(e):H.near(e)}}class et extends H{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(e,r=t.empty){if(r==t.empty){e.delete(0,e.doc.content.size);let t=H.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(t){return new et(t)}map(t){return new et(t)}eq(t){return t instanceof et}getBookmark(){return rt}}H.jsonID("all",et);const rt={map(){return this},resolve:t=>new et(t)};function it(t,e,r,i,n,s=!1){if(e.inlineContent)return X.create(t,r);for(let h=i-(n>0?0:1);n>0?h<e.childCount:h>=0;h+=n){let i=e.child(h);if(i.isAtom){if(!s&&Z.isSelectable(i))return Z.create(t,r-(n<0?i.nodeSize:0))}else{let e=it(t,i,r+n,n<0?i.childCount:0,n,s);if(e)return e}r+=i.nodeSize*n}return null}function nt(t,e,r){let i=t.steps.length-1;if(i<e)return;let n,s=t.steps[i];(s instanceof y||s instanceof N)&&(t.mapping.maps[i].forEach(((t,e,r,i)=>{null==n&&(n=i)})),t.setSelection(H.near(t.doc.resolve(n),r)))}class st extends P{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return i.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let r=this.selection;return e&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||i.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,r){let i=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(null==r&&(r=e),!t)return this.deleteRange(e,r);let n=this.storedMarks;if(!n){let t=this.doc.resolve(e);n=r==e?t.marks():t.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(e,r,i.text(t,n)),this.selection.empty||this.selection.to!=e+t.length||this.setSelection(H.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function ht(t,e){return e&&t?t.bind(e):t}class lt{constructor(t,e,r){this.name=t,this.init=ht(e.init,r),this.apply=ht(e.apply,r)}}const ot=[new lt("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new lt("selection",{init:(t,e)=>t.selection||H.atStart(e.doc),apply:t=>t.selection}),new lt("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,r,i)=>i.selection.$cursor?t.storedMarks:null}),new lt("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class ut{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ot.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new lt(t.key,t.spec.state,t))}))}}class ft{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=e){let e=this.config.plugins[r];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],r=this.applyInner(t),i=null;for(;;){let n=!1;for(let s=0;s<this.config.plugins.length;s++){let h=this.config.plugins[s];if(h.spec.appendTransaction){let l=i?i[s].n:0,o=i?i[s].state:this,u=l<e.length&&h.spec.appendTransaction.call(h,l?e.slice(l):e,o,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",t),!i){i=[];for(let t=0;t<this.config.plugins.length;t++)i.push(t<s?{state:r,n:e.length}:{state:this,n:0})}e.push(u),r=r.applyInner(u),n=!0}i&&(i[s]={state:r,n:e.length})}}if(!n)return{state:r,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new ft(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let n=r[i];e[n.name]=n.apply(t,this[n.name],this,e)}return e}get tr(){return new st(this)}static create(t){let e=new ut(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new ft(e);for(let i=0;i<e.fields.length;i++)r[e.fields[i].name]=e.fields[i].init(t,r);return r}reconfigure(t){let e=new ut(this.schema,t.plugins),r=e.fields,i=new ft(e);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((t=>t.toJSON()))),t&&"object"==typeof t)for(let r in t){if("doc"==r||"selection"==r)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],n=i.spec.state;n&&n.toJSON&&(e[r]=n.toJSON.call(i,this[i.key]))}return e}static fromJSON(t,e,r){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new ut(t.schema,t.plugins),n=new ft(i);return i.fields.forEach((i=>{if("doc"==i.name)n.doc=s.fromJSON(t.schema,e.doc);else if("selection"==i.name)n.selection=H.fromJSON(n.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(n.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let s in r){let h=r[s],l=h.spec.state;if(h.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,s))return void(n[i.name]=l.fromJSON.call(h,t,e[s],n))}n[i.name]=i.init(t,n)}})),n}}function at(t,e,r){for(let i in t){let n=t[i];n instanceof Function?n=n.bind(e):"handleDOMEvents"==i&&(n=at(n,e,{})),r[i]=n}return r}class ct{constructor(t){this.spec=t,this.props={},t.props&&at(t.props,this,this.props),this.key=t.key?t.key.key:wt("plugin")}getState(t){return t[this.key]}}const pt=Object.create(null);function wt(t){return t in pt?t+"$"+ ++pt[t]:(pt[t]=0,t+"$")}class dt{constructor(t="key"){this.key=wt(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}export{et as A,ft as E,f as M,Z as N,dt as P,N as R,H as S,X as T,ct as a,I as b,x as c,T as d,K as e,O as f,P as g,b as l,j as r};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./index-ccc6a799.cjs.js"],function(_export,_context){"use strict";var t,e,r,i,n,s,h,o,u,f,a,c,p,d,m,g,S,y,N,D,V,_,L,P,z,H,K,Q,X,Y,Z,tt,et,rt,st,lt,ot,ut,ft,ct,pt,dt;function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}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 _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);}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 _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 l(t){return 65535&t;}function w(t,e,i){var n=[];for(var _r5=0;_r5<t.childCount;_r5++){var _s3=t.child(_r5);_s3.content.size&&(_s3=_s3.copy(w(_s3.content,e,_s3))),_s3.isInline&&(_s3=e(_s3,i,_r5)),n.push(_s3);}return r.fromArray(n);}function v(t,e,r){var i=t.resolve(e),n=r-e,s=i.depth;for(;n>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,n--;if(n>0){var _t3=i.node(s).maybeChild(i.indexAfter(s));for(;n>0;){if(!_t3||_t3.isLeaf)return!0;_t3=_t3.firstChild,n--;}}return!1;}function M(e,i,n){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:n.contentMatch;var h=arguments.length>4&&arguments[4]!==undefined?arguments[4]:!0;var l=e.doc.nodeAt(i),o=[],u=i+1;for(var _i4=0;_i4<l.childCount;_i4++){var _f2=l.child(_i4),_a2=u+_f2.nodeSize,_c8=s.matchType(_f2.type);if(_c8){s=_c8;for(var _t4=0;_t4<_f2.marks.length;_t4++)n.allowsMarkType(_f2.marks[_t4].type)||e.step(new m(u,_a2,_f2.marks[_t4]));if(h&&_f2.isText&&"pre"!=n.whitespace){var _e6=void 0,_i5=void 0,_s4=/\r?\n|\r/g;for(;_e6=_s4.exec(_f2.text);)_i5||(_i5=new t(r.from(n.schema.text(" ",n.allowedMarks(_f2.marks))),0,0)),o.push(new y(u+_e6.index,u+_e6.index+_e6[0].length,_i5));}}else o.push(new y(u,_a2,t.empty));u=_a2;}if(!s.validEnd){var _i6=s.fillBefore(r.empty,!0);e.replace(u,u,new t(_i6,0,0));}for(var _t5=o.length-1;_t5>=0;_t5--)e.step(o[_t5]);}function k(t,e,r){return(0==e||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r));}function b(t){var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(var _r9=t.depth,_i7=0,_n4=0;;--_r9){var _s5=t.$from.node(_r9),_h3=t.$from.index(_r9)+_i7,_l4=t.$to.indexAfter(_r9)-_n4;if(_r9<t.depth&&_s5.canReplace(_h3,_l4,e))return _r9;if(0==_r9||_s5.type.spec.isolating||!k(_s5,_h3,_l4))break;_h3&&(_i7=1),_l4<_s5.childCount&&(_n4=1);}return null;}function O(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:t;var n=function(t,e){var r=t.parent,i=t.startIndex,n=t.endIndex,s=r.contentMatchAt(i).findWrapping(e);if(!s)return null;var h=s.length?s[0]:e;return r.canReplaceWith(i,n,h)?s:null;}(t,e),s=n&&function(t,e){var r=t.parent,i=t.startIndex,n=t.endIndex,s=r.child(i),h=e.contentMatch.findWrapping(s.type);if(!h)return null;var l=(h.length?h[h.length-1]:e).contentMatch;for(var _t6=i;l&&_t6<n;_t6++)l=l.matchType(r.child(_t6).type);return l&&l.validEnd?h:null;}(i,e);return s?n.map(J).concat({type:e,attrs:r}).concat(s.map(J)):null;}function J(t){return{type:t,attrs:null};}function R(t,e,r,i){e.forEach(function(n,s){if(n.isText){var _h4,_l5=/\r?\n|\r/g;for(;_h4=_l5.exec(n.text);){var _n5=t.mapping.slice(i).map(r+1+s+_h4.index);t.replaceWith(_n5,_n5+1,e.type.schema.linebreakReplacement.create());}}});}function E(t,e,r,i){e.forEach(function(n,s){if(n.type==n.type.schema.linebreakReplacement){var _n6=t.mapping.slice(i).map(r+1+s);t.replaceWith(_n6,_n6+1,e.type.schema.text("\n"));}});}function I(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var i=arguments.length>3?arguments[3]:undefined;var n=t.resolve(e),s=n.depth-r,h=i&&i[i.length-1]||n.parent;if(s<0||n.parent.type.spec.isolating||!n.parent.canReplace(n.index(),n.parent.childCount)||!h.type.validContent(n.parent.content.cutByIndex(n.index(),n.parent.childCount)))return!1;for(var _t7=n.depth-1,_e7=r-2;_t7>s;_t7--,_e7--){var _r10=n.node(_t7),_s6=n.index(_t7);if(_r10.type.spec.isolating)return!1;var _h5=_r10.content.cutByIndex(_s6,_r10.childCount),_l6=i&&i[_e7+1];_l6&&(_h5=_h5.replaceChild(0,_l6.type.create(_l6.attrs)));var _o2=i&&i[_e7]||_r10;if(!_r10.canReplace(_s6+1,_r10.childCount)||!_o2.type.validContent(_h5))return!1;}var l=n.indexAfter(s),o=i&&i[0];return n.node(s).canReplaceWith(l,l,o?o.type:n.node(s+1).type);}function x(t,e){var r=t.resolve(e),i=r.index();return n=r.nodeBefore,s=r.nodeAfter,!(!n||!s||n.isLeaf||!function(t,e){e.content.size||t.type.compatibleContent(e.type);var r=t.contentMatchAt(t.childCount),i=t.type.schema.linebreakReplacement;for(var _n7=0;_n7<e.childCount;_n7++){var _s7=e.child(_n7),_h6=_s7.type==i?t.type.schema.nodes.text:_s7.type;if(r=r.matchType(_h6),!r)return!1;if(!t.type.allowsMarks(_s7.marks))return!1;}return r.validEnd;}(n,s))&&r.parent.canReplace(i,i+1);var n,s;}function T(t,e,r){var i=t.resolve(e);if(!r.content.size)return e;var n=r.content;for(var _t8=0;_t8<r.openStart;_t8++)n=n.firstChild.content;for(var _t9=1;_t9<=(0==r.openStart&&r.size?2:1);_t9++)for(var _e8=i.depth;_e8>=0;_e8--){var _r11=_e8==i.depth?0:i.pos<=(i.start(_e8+1)+i.end(_e8+1))/2?-1:1,_s8=i.index(_e8)+(_r11>0?1:0),_h7=i.node(_e8),_l7=!1;if(1==_t9)_l7=_h7.canReplace(_s8,_s8,n);else{var _t10=_h7.contentMatchAt(_s8).findWrapping(n.firstChild.type);_l7=_t10&&_h7.canReplaceWith(_s8,_s8,_t10[0]);}if(_l7)return 0==_r11?i.pos:_r11<0?i.before(_e8+1):i.after(_e8+1);}return null;}function j(e,r){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:r;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:t.empty;if(r==i&&!n.size)return null;var s=e.resolve(r),h=e.resolve(i);return A(s,h,n)?new y(r,i,n):new D(s,h,n).fit();}function A(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content);}function $(t,e,r){return 0==e?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy($(t.firstChild.content,e-1,r)));}function B(t,e,r){return 0==e?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(B(t.lastChild.content,e-1,r)));}function F(t,e){for(var _r17=0;_r17<e;_r17++)t=t.firstChild.content;return t;}function W(t,e,i){if(e<=0)return t;var n=t.content;return e>1&&(n=n.replaceChild(0,W(n.firstChild,e-1,1==n.childCount?i-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),i<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(r.empty,!0)))),t.copy(n);}function q(t,e,r,i,n){var s=t.node(e),h=n?t.indexAfter(e):t.index(e);if(h==s.childCount&&!r.compatibleContent(s.type))return null;var l=i.fillBefore(s.content,!0,h);return l&&!function(t,e,r){for(var _i13=r;_i13<e.childCount;_i13++)if(!t.allowsMarks(e.child(_i13).marks))return!0;return!1;}(r,s.content,h)?l:null;}function C(t,e,i,n,s){if(e<i){var _r18=t.firstChild;t=t.replaceChild(0,_r18.copy(C(_r18.content,e+1,i,n,_r18)));}if(e>n){var _e18=s.contentMatchAt(0),_i14=_e18.fillBefore(t).append(t);t=_i14.append(_e18.matchFragment(_i14).fillBefore(r.empty,!0));}return t;}function G(t,e){var r=[];for(var _i15=Math.min(t.depth,e.depth);_i15>=0;_i15--){var _n12=t.start(_i15);if(_n12<t.pos-(t.depth-_i15)||e.end(_i15)>e.pos+(e.depth-_i15)||t.node(_i15).type.spec.isolating||e.node(_i15).type.spec.isolating)break;(_n12==e.start(_i15)||_i15==t.depth&&_i15==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&_i15&&e.start(_i15-1)==_n12-1)&&r.push(_i15);}return r;}function U(t){Q||t.parent.inlineContent||(Q=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"));}function it(t,e,r,i,n){var s=arguments.length>5&&arguments[5]!==undefined?arguments[5]:!1;if(e.inlineContent)return X.create(t,r);for(var _h13=i-(n>0?0:1);n>0?_h13<e.childCount:_h13>=0;_h13+=n){var _i21=e.child(_h13);if(_i21.isAtom){if(!s&&Z.isSelectable(_i21))return Z.create(t,r-(n<0?_i21.nodeSize:0));}else{var _e36=it(t,_i21,r+n,n<0?_i21.childCount:0,n,s);if(_e36)return _e36;}r+=_i21.nodeSize*n;}return null;}function nt(t,e,r){var i=t.steps.length-1;if(i<e)return;var n,s=t.steps[i];(s instanceof y||s instanceof N)&&(t.mapping.maps[i].forEach(function(t,e,r,i){null==n&&(n=i);}),t.setSelection(H.near(t.doc.resolve(n),r)));}function ht(t,e){return e&&t?t.bind(e):t;}function at(t,e,r){for(var _i25 in t){var _n22=t[_i25];_n22 instanceof Function?_n22=_n22.bind(e):"handleDOMEvents"==_i25&&(_n22=at(_n22,e,{})),r[_i25]=_n22;}return r;}function wt(t){return t in pt?t+"$"+ ++pt[t]:(pt[t]=0,t+"$");}_export({b:I,c:x,d:T,f:O,l:b,r:j});return{setters:[function(_index00bCjsJs){t=_index00bCjsJs.S;e=_index00bCjsJs.R;r=_index00bCjsJs.F;i=_index00bCjsJs.M;n=_index00bCjsJs.b;s=_index00bCjsJs.N;}],execute:function execute(){h=Math.pow(2,16);o=/*#__PURE__*/function(){function o(t,e,r){_classCallCheck(this,o);this.pos=t,this.delInfo=e,this.recover=r;}return _createClass(o,[{key:"deleted",get:function get(){return(8&this.delInfo)>0;}},{key:"deletedBefore",get:function get(){return(5&this.delInfo)>0;}},{key:"deletedAfter",get:function get(){return(6&this.delInfo)>0;}},{key:"deletedAcross",get:function get(){return(4&this.delInfo)>0;}}]);}();u=/*#__PURE__*/function(){function u(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;_classCallCheck(this,u);if(this.ranges=t,this.inverted=e,!t.length&&u.empty)return u.empty;}return _createClass(u,[{key:"recover",value:function recover(t){var e=0,r=l(t);if(!this.inverted)for(var _t=0;_t<r;_t++)e+=this.ranges[3*_t+2]-this.ranges[3*_t+1];return this.ranges[3*r]+e+function(t){return(t-(65535&t))/h;}(t);}},{key:"mapResult",value:function mapResult(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this._map(t,e,!1);}},{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this._map(t,e,!0);}},{key:"_map",value:function _map(t,e,r){var i=0,n=this.inverted?2:1,s=this.inverted?1:2;for(var _l=0;_l<this.ranges.length;_l+=3){var _u=this.ranges[_l]-(this.inverted?i:0);if(_u>t)break;var _f=this.ranges[_l+n],_a=this.ranges[_l+s],_c=_u+_f;if(t<=_c){var _n=_u+i+((_f?t==_u?-1:t==_c?1:e:e)<0?0:_a);if(r)return _n;var _s=t==(e<0?_u:_c)?null:_l/3+(t-_u)*h,_p=t==_u?2:t==_c?1:4;return(e<0?t!=_u:t!=_c)&&(_p|=8),new o(_n,_p,_s);}i+=_a-_f;}return r?t+i:new o(t+i,0,null);}},{key:"touches",value:function touches(t,e){var r=0,i=l(e),n=this.inverted?2:1,s=this.inverted?1:2;for(var _e=0;_e<this.ranges.length;_e+=3){var _h=this.ranges[_e]-(this.inverted?r:0);if(_h>t)break;var _l2=this.ranges[_e+n];if(t<=_h+_l2&&_e==3*i)return!0;r+=this.ranges[_e+s]-_l2;}return!1;}},{key:"forEach",value:function forEach(t){var e=this.inverted?2:1,r=this.inverted?1:2;for(var _i=0,_n2=0;_i<this.ranges.length;_i+=3){var _s2=this.ranges[_i],_h2=_s2-(this.inverted?_n2:0),_l3=_s2+(this.inverted?0:_n2),_o=this.ranges[_i+e],_u2=this.ranges[_i+r];t(_h2,_h2+_o,_l3,_l3+_u2),_n2+=_u2-_o;}}},{key:"invert",value:function invert(){return new u(this.ranges,!this.inverted);}},{key:"toString",value:function toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges);}}],[{key:"offset",value:function offset(t){return 0==t?u.empty:new u(t<0?[0,-t,0]:[0,0,t]);}}]);}();u.empty=new u([]);_export("M",f=/*#__PURE__*/function(){function f(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:t?t.length:0;_classCallCheck(this,f);this.mirror=e,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||e);}return _createClass(f,[{key:"maps",get:function get(){return this._maps;}},{key:"slice",value:function slice(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.maps.length;return new f(this._maps,this.mirror,t,e);}},{key:"appendMap",value:function appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),null!=e&&this.setMirror(this._maps.length-1,e);}},{key:"appendMapping",value:function appendMapping(t){for(var _e2=0,_r=this._maps.length;_e2<t._maps.length;_e2++){var _i2=t.getMirror(_e2);this.appendMap(t._maps[_e2],null!=_i2&&_i2<_e2?_r+_i2:void 0);}}},{key:"getMirror",value:function getMirror(t){if(this.mirror)for(var _e3=0;_e3<this.mirror.length;_e3++)if(this.mirror[_e3]==t)return this.mirror[_e3+(_e3%2?-1:1)];}},{key:"setMirror",value:function setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e);}},{key:"appendMappingInverted",value:function appendMappingInverted(t){for(var _e4=t.maps.length-1,_r2=this._maps.length+t._maps.length;_e4>=0;_e4--){var _i3=t.getMirror(_e4);this.appendMap(t._maps[_e4].invert(),null!=_i3&&_i3>_e4?_r2-_i3-1:void 0);}}},{key:"invert",value:function invert(){var t=new f();return t.appendMappingInverted(this),t;}},{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;if(this.mirror)return this._map(t,e,!0);for(var _r3=this.from;_r3<this.to;_r3++)t=this._maps[_r3].map(t,e);return t;}},{key:"mapResult",value:function mapResult(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this._map(t,e,!1);}},{key:"_map",value:function _map(t,e,r){var i=0;for(var _r4=this.from;_r4<this.to;_r4++){var _n3=this._maps[_r4].mapResult(t,e);if(null!=_n3.recover){var _e5=this.getMirror(_r4);if(null!=_e5&&_e5>_r4&&_e5<this.to){_r4=_e5,t=this._maps[_e5].recover(_n3.recover);continue;}}i|=_n3.delInfo,t=_n3.pos;}return r?t:new o(t,i,null);}}]);}());a=Object.create(null);c=/*#__PURE__*/function(){function c(){_classCallCheck(this,c);}return _createClass(c,[{key:"getMap",value:function getMap(){return u.empty;}},{key:"merge",value:function merge(t){return null;}}],[{key:"fromJSON",value:function fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var r=a[e.stepType];if(!r)throw new RangeError("No step type ".concat(e.stepType," defined"));return r.fromJSON(t,e);}},{key:"jsonID",value:function jsonID(t,e){if(t in a)throw new RangeError("Duplicate use of step JSON ID "+t);return a[t]=e,e.prototype.jsonID=t,e;}}]);}();p=/*#__PURE__*/function(){function p(t,e){_classCallCheck(this,p);this.doc=t,this.failed=e;}return _createClass(p,null,[{key:"ok",value:function ok(t){return new p(t,null);}},{key:"fail",value:function fail(t){return new p(null,t);}},{key:"fromReplace",value:function fromReplace(t,r,i,n){try{return p.ok(t.replace(r,i,n));}catch(t){if(t instanceof e)return p.fail(t.message);throw t;}}}]);}();d=/*#__PURE__*/function(_c2){function d(t,e,r){var _this;_classCallCheck(this,d);_this=_callSuper(this,d),_this.from=t,_this.to=e,_this.mark=r;return _this;}_inherits(d,_c2);return _createClass(d,[{key:"apply",value:function apply(e){var _this2=this;var r=e.slice(this.from,this.to),i=e.resolve(this.from),n=i.node(i.sharedDepth(this.to)),s=new t(w(r.content,function(t,e){return t.isAtom&&e.type.allowsMarkType(_this2.mark.type)?t.mark(_this2.mark.addToSet(t.marks)):t;},n),r.openStart,r.openEnd);return p.fromReplace(e,this.from,this.to,s);}},{key:"invert",value:function invert(){return new m(this.from,this.to,this.mark);}},{key:"map",value:function map(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new d(e.pos,r.pos,this.mark);}},{key:"merge",value:function merge(t){return t instanceof d&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new d(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null;}},{key:"toJSON",value:function toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to};}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new d(e.from,e.to,t.markFromJSON(e.mark));}}]);}(c);c.jsonID("addMark",d);m=/*#__PURE__*/function(_c3){function m(t,e,r){var _this3;_classCallCheck(this,m);_this3=_callSuper(this,m),_this3.from=t,_this3.to=e,_this3.mark=r;return _this3;}_inherits(m,_c3);return _createClass(m,[{key:"apply",value:function apply(e){var _this4=this;var r=e.slice(this.from,this.to),i=new t(w(r.content,function(t){return t.mark(_this4.mark.removeFromSet(t.marks));},e),r.openStart,r.openEnd);return p.fromReplace(e,this.from,this.to,i);}},{key:"invert",value:function invert(){return new d(this.from,this.to,this.mark);}},{key:"map",value:function map(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new m(e.pos,r.pos,this.mark);}},{key:"merge",value:function merge(t){return t instanceof m&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new m(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null;}},{key:"toJSON",value:function toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to};}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new m(e.from,e.to,t.markFromJSON(e.mark));}}]);}(c);c.jsonID("removeMark",m);g=/*#__PURE__*/function(_c4){function g(t,e){var _this5;_classCallCheck(this,g);_this5=_callSuper(this,g),_this5.pos=t,_this5.mark=e;return _this5;}_inherits(g,_c4);return _createClass(g,[{key:"apply",value:function apply(e){var i=e.nodeAt(this.pos);if(!i)return p.fail("No node at mark step's position");var n=i.type.create(i.attrs,null,this.mark.addToSet(i.marks));return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(n),0,i.isLeaf?0:1));}},{key:"invert",value:function invert(t){var e=t.nodeAt(this.pos);if(e){var _t2=this.mark.addToSet(e.marks);if(_t2.length==e.marks.length){for(var _r6=0;_r6<e.marks.length;_r6++)if(!e.marks[_r6].isInSet(_t2))return new g(this.pos,e.marks[_r6]);return new g(this.pos,this.mark);}}return new S(this.pos,this.mark);}},{key:"map",value:function map(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new g(e.pos,this.mark);}},{key:"toJSON",value:function toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()};}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new g(e.pos,t.markFromJSON(e.mark));}}]);}(c);c.jsonID("addNodeMark",g);S=/*#__PURE__*/function(_c5){function S(t,e){var _this6;_classCallCheck(this,S);_this6=_callSuper(this,S),_this6.pos=t,_this6.mark=e;return _this6;}_inherits(S,_c5);return _createClass(S,[{key:"apply",value:function apply(e){var i=e.nodeAt(this.pos);if(!i)return p.fail("No node at mark step's position");var n=i.type.create(i.attrs,null,this.mark.removeFromSet(i.marks));return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(n),0,i.isLeaf?0:1));}},{key:"invert",value:function invert(t){var e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new g(this.pos,this.mark):this;}},{key:"map",value:function map(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new S(e.pos,this.mark);}},{key:"toJSON",value:function toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()};}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new S(e.pos,t.markFromJSON(e.mark));}}]);}(c);c.jsonID("removeNodeMark",S);y=/*#__PURE__*/function(_c6){function y(t,e,r){var _this7;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;_classCallCheck(this,y);_this7=_callSuper(this,y),_this7.from=t,_this7.to=e,_this7.slice=r,_this7.structure=i;return _this7;}_inherits(y,_c6);return _createClass(y,[{key:"apply",value:function apply(t){return this.structure&&v(t,this.from,this.to)?p.fail("Structure replace would overwrite content"):p.fromReplace(t,this.from,this.to,this.slice);}},{key:"getMap",value:function getMap(){return new u([this.from,this.to-this.from,this.slice.size]);}},{key:"invert",value:function invert(t){return new y(this.from,this.from+this.slice.size,t.slice(this.from,this.to));}},{key:"map",value:function map(t){var e=t.mapResult(this.to,-1),r=this.from==this.to&&y.MAP_BIAS<0?e:t.mapResult(this.from,1);return r.deletedAcross&&e.deletedAcross?null:new y(r.pos,Math.max(r.pos,e.pos),this.slice,this.structure);}},{key:"merge",value:function merge(e){if(!(e instanceof y)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{var _r7=this.slice.size+e.slice.size==0?t.empty:new t(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new y(e.from,this.to,_r7,this.structure);}}{var _r8=this.slice.size+e.slice.size==0?t.empty:new t(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new y(this.from,this.to+(e.to-e.from),_r8,this.structure);}}},{key:"toJSON",value:function toJSON(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t;}}],[{key:"fromJSON",value:function fromJSON(e,r){if("number"!=typeof r.from||"number"!=typeof r.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new y(r.from,r.to,t.fromJSON(e,r.slice),!!r.structure);}}]);}(c);y.MAP_BIAS=1,c.jsonID("replace",y);_export("R",N=/*#__PURE__*/function(_c7){function N(t,e,r,i,n,s){var _this8;var h=arguments.length>6&&arguments[6]!==undefined?arguments[6]:!1;_classCallCheck(this,N);_this8=_callSuper(this,N),_this8.from=t,_this8.to=e,_this8.gapFrom=r,_this8.gapTo=i,_this8.slice=n,_this8.insert=s,_this8.structure=h;return _this8;}_inherits(N,_c7);return _createClass(N,[{key:"apply",value:function apply(t){if(this.structure&&(v(t,this.from,this.gapFrom)||v(t,this.gapTo,this.to)))return p.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return p.fail("Gap is not a flat range");var r=this.slice.insertAt(this.insert,e.content);return r?p.fromReplace(t,this.from,this.to,r):p.fail("Content does not fit in gap");}},{key:"getMap",value:function getMap(){return new u([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert]);}},{key:"invert",value:function invert(t){var e=this.gapTo-this.gapFrom;return new N(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure);}},{key:"map",value:function map(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),n=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||n>r.pos?null:new N(e.pos,r.pos,i,n,this.slice,this.insert,this.structure);}},{key:"toJSON",value:function toJSON(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t;}}],[{key:"fromJSON",value:function fromJSON(e,r){if("number"!=typeof r.from||"number"!=typeof r.to||"number"!=typeof r.gapFrom||"number"!=typeof r.gapTo||"number"!=typeof r.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new N(r.from,r.to,r.gapFrom,r.gapTo,t.fromJSON(e,r.slice),r.insert,!!r.structure);}}]);}(c));c.jsonID("replaceAround",N);D=/*#__PURE__*/function(){function D(t,e,i){_classCallCheck(this,D);this.$from=t,this.$to=e,this.unplaced=i,this.frontier=[],this.placed=r.empty;for(var _e9=0;_e9<=t.depth;_e9++){var _r12=t.node(_e9);this.frontier.push({type:_r12.type,match:_r12.contentMatchAt(t.indexAfter(_e9))});}for(var _e10=t.depth;_e10>0;_e10--)this.placed=r.from(t.node(_e10).copy(this.placed));}return _createClass(D,[{key:"depth",get:function get(){return this.frontier.length-1;}},{key:"fit",value:function fit(){for(;this.unplaced.size;){var _t11=this.findFittable();_t11?this.placeNodes(_t11):this.openMore()||this.dropNode();}var e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,i=this.$from,n=this.close(e<0?this.$to:i.doc.resolve(e));if(!n)return null;var s=this.placed,h=i.depth,l=n.depth;for(;h&&l&&1==s.childCount;)s=s.firstChild.content,h--,l--;var o=new t(s,h,l);return e>-1?new N(i.pos,e,this.$to.pos,this.$to.end(),o,r):o.size||i.pos!=this.$to.pos?new y(i.pos,n.pos,o):null;}},{key:"findFittable",value:function findFittable(){var t=this.unplaced.openStart;for(var _e11=this.unplaced.content,_r13=0,_i8=this.unplaced.openEnd;_r13<t;_r13++){var _n8=_e11.firstChild;if(_e11.childCount>1&&(_i8=0),_n8.type.spec.isolating&&_i8<=_r13){t=_r13;break;}_e11=_n8.content;}for(var _e12=1;_e12<=2;_e12++)for(var _i9=1==_e12?t:this.unplaced.openStart;_i9>=0;_i9--){var _t12=void 0,_n9=null;_i9?(_n9=F(this.unplaced.content,_i9-1).firstChild,_t12=_n9.content):_t12=this.unplaced.content;var _s9=_t12.firstChild;for(var _t13=this.depth;_t13>=0;_t13--){var _h8=void 0,_this$frontier$_t=this.frontier[_t13],_l8=_this$frontier$_t.type,_o3=_this$frontier$_t.match,_u3=null;if(1==_e12&&(_s9?_o3.matchType(_s9.type)||(_u3=_o3.fillBefore(r.from(_s9),!1)):_n9&&_l8.compatibleContent(_n9.type)))return{sliceDepth:_i9,frontierDepth:_t13,parent:_n9,inject:_u3};if(2==_e12&&_s9&&(_h8=_o3.findWrapping(_s9.type)))return{sliceDepth:_i9,frontierDepth:_t13,parent:_n9,wrap:_h8};if(_n9&&_o3.matchType(_n9.type))break;}}}},{key:"openMore",value:function openMore(){var _this$unplaced=this.unplaced,e=_this$unplaced.content,r=_this$unplaced.openStart,i=_this$unplaced.openEnd,n=F(e,r);return!(!n.childCount||n.firstChild.isLeaf)&&(this.unplaced=new t(e,r+1,Math.max(i,n.size+r>=e.size-i?r+1:0)),!0);}},{key:"dropNode",value:function dropNode(){var _this$unplaced2=this.unplaced,e=_this$unplaced2.content,r=_this$unplaced2.openStart,i=_this$unplaced2.openEnd,n=F(e,r);if(n.childCount<=1&&r>0){var _s10=e.size-r<=r+n.size;this.unplaced=new t($(e,r-1,1),r-1,_s10?r-1:i);}else this.unplaced=new t($(e,r,1),r,i);}},{key:"placeNodes",value:function placeNodes(_ref){var e=_ref.sliceDepth,i=_ref.frontierDepth,n=_ref.parent,s=_ref.inject,h=_ref.wrap;for(;this.depth>i;)this.closeFrontierNode();if(h)for(var _t14=0;_t14<h.length;_t14++)this.openFrontierNode(h[_t14]);var l=this.unplaced,o=n?n.content:l.content,u=l.openStart-e,f=0,a=[],_this$frontier$i=this.frontier[i],c=_this$frontier$i.match,p=_this$frontier$i.type;if(s){for(var _t15=0;_t15<s.childCount;_t15++)a.push(s.child(_t15));c=c.matchFragment(s);}var w=o.size+e-(l.content.size-l.openEnd);for(;f<o.childCount;){var _t16=o.child(f),_e13=c.matchType(_t16.type);if(!_e13)break;f++,(f>1||0==u||_t16.content.size)&&(c=_e13,a.push(W(_t16.mark(p.allowedMarks(_t16.marks)),1==f?u:0,f==o.childCount?w:-1)));}var d=f==o.childCount;d||(w=-1),this.placed=B(this.placed,i,r.from(a)),this.frontier[i].match=c,d&&w<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var _t17=0,_e14=o;_t17<w;_t17++){var _t18=_e14.lastChild;this.frontier.push({type:_t18.type,match:_t18.contentMatchAt(_t18.childCount)}),_e14=_t18.content;}this.unplaced=d?0==e?t.empty:new t($(l.content,e-1,1),e-1,w<0?l.openEnd:e-1):new t($(l.content,e,f),l.openStart,l.openEnd);}},{key:"mustMoveInline",value:function mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!q(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;var r=this.$to.depth,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i;}},{key:"findCloseLevel",value:function findCloseLevel(t){t:for(var _e15=Math.min(this.depth,t.depth);_e15>=0;_e15--){var _this$frontier$_e=this.frontier[_e15],_r14=_this$frontier$_e.match,_i10=_this$frontier$_e.type,_n10=_e15<t.depth&&t.end(_e15+1)==t.pos+(t.depth-(_e15+1)),_s11=q(t,_e15,_i10,_r14,_n10);if(_s11){for(var _r15=_e15-1;_r15>=0;_r15--){var _this$frontier$_r=this.frontier[_r15],_e16=_this$frontier$_r.match,_i11=_this$frontier$_r.type,_n11=q(t,_r15,_i11,_e16,!0);if(!_n11||_n11.childCount)continue t;}return{depth:_e15,fit:_s11,move:_n10?t.doc.resolve(t.after(_e15+1)):t};}}}},{key:"close",value:function close(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=B(this.placed,e.depth,e.fit)),t=e.move;for(var _r16=e.depth+1;_r16<=t.depth;_r16++){var _e17=t.node(_r16),_i12=_e17.type.contentMatch.fillBefore(_e17.content,!0,t.index(_r16));this.openFrontierNode(_e17.type,_e17.attrs,_i12);}return t;}},{key:"openFrontierNode",value:function openFrontierNode(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2?arguments[2]:undefined;var n=this.frontier[this.depth];n.match=n.match.matchType(t),this.placed=B(this.placed,this.depth,r.from(t.create(e,i))),this.frontier.push({type:t,match:t.contentMatch});}},{key:"closeFrontierNode",value:function closeFrontierNode(){var t=this.frontier.pop().match.fillBefore(r.empty,!0);t.childCount&&(this.placed=B(this.placed,this.frontier.length,t));}}]);}();V=/*#__PURE__*/function(_c9){function V(t,e,r){var _this9;_classCallCheck(this,V);_this9=_callSuper(this,V),_this9.pos=t,_this9.attr=e,_this9.value=r;return _this9;}_inherits(V,_c9);return _createClass(V,[{key:"apply",value:function apply(e){var i=e.nodeAt(this.pos);if(!i)return p.fail("No node at attribute step's position");var n=Object.create(null);for(var _t19 in i.attrs)n[_t19]=i.attrs[_t19];n[this.attr]=this.value;var s=i.type.create(n,null,i.marks);return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(s),0,i.isLeaf?0:1));}},{key:"getMap",value:function getMap(){return u.empty;}},{key:"invert",value:function invert(t){return new V(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr]);}},{key:"map",value:function map(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new V(e.pos,this.attr,this.value);}},{key:"toJSON",value:function toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value};}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new V(e.pos,e.attr,e.value);}}]);}(c);c.jsonID("attr",V);_=/*#__PURE__*/function(_c10){function _(t,e){var _this10;_classCallCheck(this,_);_this10=_callSuper(this,_),_this10.attr=t,_this10.value=e;return _this10;}_inherits(_,_c10);return _createClass(_,[{key:"apply",value:function apply(t){var e=Object.create(null);for(var _r19 in t.attrs)e[_r19]=t.attrs[_r19];e[this.attr]=this.value;var r=t.type.create(e,t.content,t.marks);return p.ok(r);}},{key:"getMap",value:function getMap(){return u.empty;}},{key:"invert",value:function invert(t){return new _(this.attr,t.attrs[this.attr]);}},{key:"map",value:function map(t){return this;}},{key:"toJSON",value:function toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value};}}],[{key:"fromJSON",value:function fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new _(e.attr,e.value);}}]);}(c);c.jsonID("docAttr",_);L=/*#__PURE__*/function(_Error){function L(){_classCallCheck(this,L);return _callSuper(this,L,arguments);}_inherits(L,_Error);return _createClass(L);}(/*#__PURE__*/_wrapNativeSuper(Error));L=function t(e){var r=Error.call(this,e);return r.__proto__=t.prototype,r;},(L.prototype=Object.create(Error.prototype)).constructor=L,L.prototype.name="TransformError";_export("g",P=/*#__PURE__*/function(){function P(t){_classCallCheck(this,P);this.doc=t,this.steps=[],this.docs=[],this.mapping=new f();}return _createClass(P,[{key:"before",get:function get(){return this.docs.length?this.docs[0]:this.doc;}},{key:"step",value:function step(t){var e=this.maybeStep(t);if(e.failed)throw new L(e.failed);return this;}},{key:"maybeStep",value:function maybeStep(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e;}},{key:"docChanged",get:function get(){return this.steps.length>0;}},{key:"changedRange",value:function changedRange(){var t=1e9,e=-1e9;for(var _r20=0;_r20<this.mapping.maps.length;_r20++){var _i16=this.mapping.maps[_r20];_r20&&(t=_i16.map(t,1),e=_i16.map(e,-1)),_i16.forEach(function(r,i,n,s){t=Math.min(t,n),e=Math.max(e,s);});}return 1e9==t?null:{from:t,to:e};}},{key:"addStep",value:function addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e;}},{key:"replace",value:function replace(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:e;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.empty;var n=j(this.doc,e,r,i);return n&&this.step(n),this;}},{key:"replaceWith",value:function replaceWith(e,i,n){return this.replace(e,i,new t(r.from(n),0,0));}},{key:"delete",value:function _delete(e,r){return this.replace(e,r,t.empty);}},{key:"insert",value:function insert(t,e){return this.replaceWith(t,t,e);}},{key:"replaceRange",value:function replaceRange(e,r,i){return function(e,r,i,n){if(!n.size)return e.deleteRange(r,i);var s=e.doc.resolve(r),h=e.doc.resolve(i);if(A(s,h,n))return e.step(new y(r,i,n));var l=G(s,h);0==l[l.length-1]&&l.pop();var o=-(s.depth+1);l.unshift(o);for(var _t20=s.depth,_e19=s.pos-1;_t20>0;_t20--,_e19--){var _r21=s.node(_t20).type.spec;if(_r21.defining||_r21.definingAsContext||_r21.isolating)break;l.indexOf(_t20)>-1?o=_t20:s.before(_t20)==_e19&&l.splice(1,0,-_t20);}var u=l.indexOf(o),f=[],a=n.openStart;for(var _t21=n.content,_e20=0;;_e20++){var _r22=_t21.firstChild;if(f.push(_r22),_e20==n.openStart)break;_t21=_r22.content;}for(var _t22=a-1;_t22>=0;_t22--){var _e21=f[_t22],_r23=(c=_e21.type).spec.defining||c.spec.definingForContent;if(_r23&&!_e21.sameMarkup(s.node(Math.abs(o)-1)))a=_t22;else if(_r23||!_e21.type.isTextblock)break;}var c;for(var _r24=n.openStart;_r24>=0;_r24--){var _o4=(_r24+a+1)%(n.openStart+1),_c11=f[_o4];if(_c11)for(var _r25=0;_r25<l.length;_r25++){var _f3=l[(_r25+u)%l.length],_a3=!0;_f3<0&&(_a3=!1,_f3=-_f3);var _p2=s.node(_f3-1),_w=s.index(_f3-1);if(_p2.canReplaceWith(_w,_w,_c11.type,_c11.marks))return e.replace(s.before(_f3),_a3?h.after(_f3):i,new t(C(n.content,0,n.openStart,_o4),_o4,n.openEnd));}}var p=e.steps.length;for(var _t23=l.length-1;_t23>=0&&(e.replace(r,i,n),!(e.steps.length>p));_t23--){var _e22=l[_t23];_e22<0||(r=s.before(_e22),i=h.after(_e22));}}(this,e,r,i),this;}},{key:"replaceRangeWith",value:function replaceRangeWith(e,i,n){return function(e,i,n,s){if(!s.isInline&&i==n&&e.doc.resolve(i).parent.content.size){var _t24=function(t,e,r){var i=t.resolve(e);if(i.parent.canReplaceWith(i.index(),i.index(),r))return e;if(0==i.parentOffset)for(var _t25=i.depth-1;_t25>=0;_t25--){var _e23=i.index(_t25);if(i.node(_t25).canReplaceWith(_e23,_e23,r))return i.before(_t25+1);if(_e23>0)return null;}if(i.parentOffset==i.parent.content.size)for(var _t26=i.depth-1;_t26>=0;_t26--){var _e24=i.indexAfter(_t26);if(i.node(_t26).canReplaceWith(_e24,_e24,r))return i.after(_t26+1);if(_e24<i.node(_t26).childCount)return null;}return null;}(e.doc,i,s.type);null!=_t24&&(i=n=_t24);}e.replaceRange(i,n,new t(r.from(s),0,0));}(this,e,i,n),this;}},{key:"deleteRange",value:function deleteRange(t,e){return function(t,e,r){var i=t.doc.resolve(e),n=t.doc.resolve(r);if(i.parent.isTextblock&&n.parent.isTextblock&&i.start()!=n.start()&&0==i.parentOffset&&0==n.parentOffset){var _s12=i.sharedDepth(r),_h9=!1;for(var _t27=i.depth;_t27>_s12;_t27--)i.node(_t27).type.spec.isolating&&(_h9=!0);for(var _t28=n.depth;_t28>_s12;_t28--)n.node(_t28).type.spec.isolating&&(_h9=!0);if(!_h9){for(var _t29=i.depth;_t29>0&&e==i.start(_t29);_t29--)e=i.before(_t29);for(var _t30=n.depth;_t30>0&&r==n.start(_t30);_t30--)r=n.before(_t30);i=t.doc.resolve(e),n=t.doc.resolve(r);}}var s=G(i,n);for(var _e25=0;_e25<s.length;_e25++){var _r26=s[_e25],_h10=_e25==s.length-1;if(_h10&&0==_r26||i.node(_r26).type.contentMatch.validEnd)return t["delete"](i.start(_r26),n.end(_r26));if(_r26>0&&(_h10||i.node(_r26-1).canReplace(i.index(_r26-1),n.indexAfter(_r26-1))))return t["delete"](i.before(_r26),n.after(_r26));}for(var _s13=1;_s13<=i.depth&&_s13<=n.depth;_s13++)if(e-i.start(_s13)==i.depth-_s13&&r>i.end(_s13)&&n.end(_s13)-r!=n.depth-_s13&&i.start(_s13-1)==n.start(_s13-1)&&i.node(_s13-1).canReplace(i.index(_s13-1),n.index(_s13-1)))return t["delete"](i.before(_s13),r);t["delete"](e,r);}(this,t,e),this;}},{key:"lift",value:function lift(e,i){return function(e,i,n){var s=i.$from,h=i.$to,l=i.depth,o=s.before(l+1),u=h.after(l+1),f=o,a=u,c=r.empty,p=0;for(var _t31=l,_e26=!1;_t31>n;_t31--)_e26||s.index(_t31)>0?(_e26=!0,c=r.from(s.node(_t31).copy(c)),p++):f--;var w=r.empty,d=0;for(var _t32=l,_e27=!1;_t32>n;_t32--)_e27||h.after(_t32+1)<h.end(_t32)?(_e27=!0,w=r.from(h.node(_t32).copy(w)),d++):a++;e.step(new N(f,a,o,u,new t(c.append(w),p,d),c.size-p,!0));}(this,e,i),this;}},{key:"join",value:function join(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return function(e,r,i){var n=null,s=e.doc.type.schema.linebreakReplacement,h=e.doc.resolve(r-i),l=h.node().type;if(s&&l.inlineContent){var _t33="pre"==l.whitespace,_e28=!!l.contentMatch.matchType(s);_t33&&!_e28?n=!1:!_t33&&_e28&&(n=!0);}var o=e.steps.length;if(!1===n){var _t34=e.doc.resolve(r+i);E(e,_t34.node(),_t34.before(),o);}l.inlineContent&&M(e,r+i-1,l,h.node().contentMatchAt(h.index()),null==n);var u=e.mapping.slice(o),f=u.map(r-i);if(e.step(new y(f,u.map(r+i,-1),t.empty,!0)),!0===n){var _t35=e.doc.resolve(f);R(e,_t35.node(),_t35.before(),e.steps.length);}}(this,e,r),this;}},{key:"wrap",value:function wrap(e,i){return function(e,i,n){var s=r.empty;for(var _t36=n.length-1;_t36>=0;_t36--){if(s.size){var _e29=n[_t36].type.contentMatch.matchFragment(s);if(!_e29||!_e29.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");}s=r.from(n[_t36].type.create(n[_t36].attrs,s));}var h=i.start,l=i.end;e.step(new N(h,l,h,l,new t(s,0,0),n.length,!0));}(this,e,i),this;}},{key:"setBlockType",value:function setBlockType(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:e;var n=arguments.length>2?arguments[2]:undefined;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return function(e,i,n,s,h){if(!s.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var l=e.steps.length;e.doc.nodesBetween(i,n,function(i,n){var o="function"==typeof h?h(i):h;if(i.isTextblock&&!i.hasMarkup(s,o)&&function(t,e,r){var i=t.resolve(e),n=i.index();return i.parent.canReplaceWith(n,n+1,r);}(e.doc,e.mapping.slice(l).map(n),s)){var _h11=null;if(s.schema.linebreakReplacement){var _t37="pre"==s.whitespace,_e30=!!s.contentMatch.matchType(s.schema.linebreakReplacement);_t37&&!_e30?_h11=!1:!_t37&&_e30&&(_h11=!0);}!1===_h11&&E(e,i,n,l),M(e,e.mapping.slice(l).map(n,1),s,void 0,null===_h11);var _u4=e.mapping.slice(l),_f4=_u4.map(n,1),_a4=_u4.map(n+i.nodeSize,1);return e.step(new N(_f4,_a4,_f4+1,_a4-1,new t(r.from(s.create(o,null,i.marks)),0,0),1,!0)),!0===_h11&&R(e,i,n,l),!1;}});}(this,e,i,n,s),this;}},{key:"setNodeMarkup",value:function setNodeMarkup(e,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var s=arguments.length>3?arguments[3]:undefined;return function(e,i,n,s,h){var l=e.doc.nodeAt(i);if(!l)throw new RangeError("No node at given position");n||(n=l.type);var o=n.create(s,null,h||l.marks);if(l.isLeaf)return e.replaceWith(i,i+l.nodeSize,o);if(!n.validContent(l.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new N(i,i+l.nodeSize,i+1,i+l.nodeSize-1,new t(r.from(o),0,0),1,!0));}(this,e,i,n,s),this;}},{key:"setNodeAttribute",value:function setNodeAttribute(t,e,r){return this.step(new V(t,e,r)),this;}},{key:"setDocAttribute",value:function setDocAttribute(t,e){return this.step(new _(t,e)),this;}},{key:"addNodeMark",value:function addNodeMark(t,e){return this.step(new g(t,e)),this;}},{key:"removeNodeMark",value:function removeNodeMark(t,e){var r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(e instanceof i)e.isInSet(r.marks)&&this.step(new S(t,e));else{var _i17,_n13=r.marks,_s14=[];for(;_i17=e.isInSet(_n13);)_s14.push(new S(t,_i17)),_n13=_i17.removeFromSet(_n13);for(var _t38=_s14.length-1;_t38>=0;_t38--)this.step(_s14[_t38]);}return this;}},{key:"split",value:function split(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var n=arguments.length>2?arguments[2]:undefined;return function(e,i){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var s=arguments.length>3?arguments[3]:undefined;var h=e.doc.resolve(i),l=r.empty,o=r.empty;for(var _t39=h.depth,_e31=h.depth-n,_i18=n-1;_t39>_e31;_t39--,_i18--){l=r.from(h.node(_t39).copy(l));var _e32=s&&s[_i18];o=r.from(_e32?_e32.type.create(_e32.attrs,o):h.node(_t39).copy(o));}e.step(new y(i,i,new t(l.append(o),n,n),!0));}(this,e,i,n),this;}},{key:"addMark",value:function addMark(t,e,r){return function(t,e,r,i){var n,s,h=[],l=[];t.doc.nodesBetween(e,r,function(t,o,u){if(!t.isInline)return;var f=t.marks;if(!i.isInSet(f)&&u.type.allowsMarkType(i.type)){var _u5=Math.max(o,e),_a5=Math.min(o+t.nodeSize,r),_c12=i.addToSet(f);for(var _t40=0;_t40<f.length;_t40++)f[_t40].isInSet(_c12)||(n&&n.to==_u5&&n.mark.eq(f[_t40])?n.to=_a5:h.push(n=new m(_u5,_a5,f[_t40])));s&&s.to==_u5?s.to=_a5:l.push(s=new d(_u5,_a5,i));}}),h.forEach(function(e){return t.step(e);}),l.forEach(function(e){return t.step(e);});}(this,t,e,r),this;}},{key:"removeMark",value:function removeMark(t,e,r){return function(t,e,r,i){var s=[],h=0;t.doc.nodesBetween(e,r,function(t,l){if(!t.isInline)return;h++;var o=null;if(i instanceof n){var _e33,_r27=t.marks;for(;_e33=i.isInSet(_r27);)(o||(o=[])).push(_e33),_r27=_e33.removeFromSet(_r27);}else i?i.isInSet(t.marks)&&(o=[i]):o=t.marks;if(o&&o.length){var _i19=Math.min(l+t.nodeSize,r);for(var _t41=0;_t41<o.length;_t41++){var _r28=void 0,_n14=o[_t41];for(var _t42=0;_t42<s.length;_t42++){var _e34=s[_t42];_e34.step==h-1&&_n14.eq(s[_t42].style)&&(_r28=_e34);}_r28?(_r28.to=_i19,_r28.step=h):s.push({style:_n14,from:Math.max(l,e),to:_i19,step:h});}}}),s.forEach(function(e){return t.step(new m(e.from,e.to,e.style));});}(this,t,e,r),this;}},{key:"clearIncompatible",value:function clearIncompatible(t,e,r){return M(this,t,e,r),this;}}]);}());z=Object.create(null);_export("S",H=/*#__PURE__*/function(){function H(t,e,r){_classCallCheck(this,H);this.$anchor=t,this.$head=e,this.ranges=r||[new K(t.min(e),t.max(e))];}return _createClass(H,[{key:"anchor",get:function get(){return this.$anchor.pos;}},{key:"head",get:function get(){return this.$head.pos;}},{key:"from",get:function get(){return this.$from.pos;}},{key:"to",get:function get(){return this.$to.pos;}},{key:"$from",get:function get(){return this.ranges[0].$from;}},{key:"$to",get:function get(){return this.ranges[0].$to;}},{key:"empty",get:function get(){var t=this.ranges;for(var _e35=0;_e35<t.length;_e35++)if(t[_e35].$from.pos!=t[_e35].$to.pos)return!1;return!0;}},{key:"content",value:function content(){return this.$from.doc.slice(this.from,this.to,!0);}},{key:"replace",value:function replace(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.empty;var i=r.content.lastChild,n=null;for(var _t43=0;_t43<r.openEnd;_t43++)n=i,i=i.lastChild;var s=e.steps.length,h=this.ranges;for(var _l9=0;_l9<h.length;_l9++){var _h$_l=h[_l9],_o5=_h$_l.$from,_u6=_h$_l.$to,_f5=e.mapping.slice(s);e.replaceRange(_f5.map(_o5.pos),_f5.map(_u6.pos),_l9?t.empty:r),0==_l9&&nt(e,s,(i?i.isInline:n&&n.isTextblock)?-1:1);}}},{key:"replaceWith",value:function replaceWith(t,e){var r=t.steps.length,i=this.ranges;for(var _n15=0;_n15<i.length;_n15++){var _i$_n=i[_n15],_s15=_i$_n.$from,_h12=_i$_n.$to,_l10=t.mapping.slice(r),_o6=_l10.map(_s15.pos),_u7=_l10.map(_h12.pos);_n15?t.deleteRange(_o6,_u7):(t.replaceRangeWith(_o6,_u7,e),nt(t,r,e.isInline?-1:1));}}},{key:"getBookmark",value:function getBookmark(){return X.between(this.$anchor,this.$head).getBookmark();}}],[{key:"findFrom",value:function findFrom(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var i=t.parent.inlineContent?new X(t):it(t.node(0),t.parent,t.pos,t.index(),e,r);if(i)return i;for(var _i20=t.depth-1;_i20>=0;_i20--){var _n16=e<0?it(t.node(0),t.node(_i20),t.before(_i20+1),t.index(_i20),e,r):it(t.node(0),t.node(_i20),t.after(_i20+1),t.index(_i20)+1,e,r);if(_n16)return _n16;}return null;}},{key:"near",value:function near(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this.findFrom(t,e)||this.findFrom(t,-e)||new et(t.node(0));}},{key:"atStart",value:function atStart(t){return it(t,t,0,0,1)||new et(t);}},{key:"atEnd",value:function atEnd(t){return it(t,t,t.content.size,t.childCount,-1)||new et(t);}},{key:"fromJSON",value:function fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var r=z[e.type];if(!r)throw new RangeError("No selection type ".concat(e.type," defined"));return r.fromJSON(t,e);}},{key:"jsonID",value:function jsonID(t,e){if(t in z)throw new RangeError("Duplicate use of selection JSON ID "+t);return z[t]=e,e.prototype.jsonID=t,e;}}]);}());H.prototype.visible=!0;_export("e",K=/*#__PURE__*/_createClass(function K(t,e){_classCallCheck(this,K);this.$from=t,this.$to=e;}));Q=!1;_export("T",X=/*#__PURE__*/function(_H){function X(t){var _this11;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;_classCallCheck(this,X);U(t),U(e),_this11=_callSuper(this,X,[t,e]);return _this11;}_inherits(X,_H);return _createClass(X,[{key:"$cursor",get:function get(){return this.$anchor.pos==this.$head.pos?this.$head:null;}},{key:"map",value:function map(t,e){var r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return H.near(r);var i=t.resolve(e.map(this.anchor));return new X(i.parent.inlineContent?i:r,r);}},{key:"replace",value:function replace(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.empty;if(_superPropGet(X,"replace",this,3)([e,r]),r==t.empty){var _t44=this.$from.marksAcross(this.$to);_t44&&e.ensureMarks(_t44);}}},{key:"eq",value:function eq(t){return t instanceof X&&t.anchor==this.anchor&&t.head==this.head;}},{key:"getBookmark",value:function getBookmark(){return new Y(this.anchor,this.head);}},{key:"toJSON",value:function toJSON(){return{type:"text",anchor:this.anchor,head:this.head};}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new X(t.resolve(e.anchor),t.resolve(e.head));}},{key:"create",value:function create(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e;var i=t.resolve(e);return new this(i,r==e?i:t.resolve(r));}},{key:"between",value:function between(t,e,r){var i=t.pos-e.pos;if(r&&!i||(r=i>=0?1:-1),!e.parent.inlineContent){var _t45=H.findFrom(e,r,!0)||H.findFrom(e,-r,!0);if(!_t45)return H.near(e,r);e=_t45.$head;}return t.parent.inlineContent||(0==i||(t=(H.findFrom(t,-r,!0)||H.findFrom(t,r,!0)).$anchor).pos<e.pos!=i<0)&&(t=e),new X(t,e);}}]);}(H));H.jsonID("text",X);Y=/*#__PURE__*/function(){function Y(t,e){_classCallCheck(this,Y);this.anchor=t,this.head=e;}return _createClass(Y,[{key:"map",value:function map(t){return new Y(t.map(this.anchor),t.map(this.head));}},{key:"resolve",value:function resolve(t){return X.between(t.resolve(this.anchor),t.resolve(this.head));}}]);}();_export("N",Z=/*#__PURE__*/function(_H2){function Z(t){var _this12;_classCallCheck(this,Z);var e=t.nodeAfter,r=t.node(0).resolve(t.pos+e.nodeSize);_this12=_callSuper(this,Z,[t,r]),_this12.node=e;return _this12;}_inherits(Z,_H2);return _createClass(Z,[{key:"map",value:function map(t,e){var _e$mapResult=e.mapResult(this.anchor),r=_e$mapResult.deleted,i=_e$mapResult.pos,n=t.resolve(i);return r?H.near(n):new Z(n);}},{key:"content",value:function content(){return new t(r.from(this.node),0,0);}},{key:"eq",value:function eq(t){return t instanceof Z&&t.anchor==this.anchor;}},{key:"toJSON",value:function toJSON(){return{type:"node",anchor:this.anchor};}},{key:"getBookmark",value:function getBookmark(){return new tt(this.anchor);}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Z(t.resolve(e.anchor));}},{key:"create",value:function create(t,e){return new Z(t.resolve(e));}},{key:"isSelectable",value:function isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable;}}]);}(H));Z.prototype.visible=!1,H.jsonID("node",Z);tt=/*#__PURE__*/function(){function tt(t){_classCallCheck(this,tt);this.anchor=t;}return _createClass(tt,[{key:"map",value:function map(t){var _t$mapResult=t.mapResult(this.anchor),e=_t$mapResult.deleted,r=_t$mapResult.pos;return e?new Y(r,r):new tt(r);}},{key:"resolve",value:function resolve(t){var e=t.resolve(this.anchor),r=e.nodeAfter;return r&&Z.isSelectable(r)?new Z(e):H.near(e);}}]);}();_export("A",et=/*#__PURE__*/function(_H3){function et(t){_classCallCheck(this,et);return _callSuper(this,et,[t.resolve(0),t.resolve(t.content.size)]);}_inherits(et,_H3);return _createClass(et,[{key:"replace",value:function replace(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.empty;if(r==t.empty){e["delete"](0,e.doc.content.size);var _t46=H.atStart(e.doc);_t46.eq(e.selection)||e.setSelection(_t46);}else _superPropGet(et,"replace",this,3)([e,r]);}},{key:"toJSON",value:function toJSON(){return{type:"all"};}},{key:"map",value:function map(t){return new et(t);}},{key:"eq",value:function eq(t){return t instanceof et;}},{key:"getBookmark",value:function getBookmark(){return rt;}}],[{key:"fromJSON",value:function fromJSON(t){return new et(t);}}]);}(H));H.jsonID("all",et);rt={map:function map(){return this;},resolve:function resolve(t){return new et(t);}};st=/*#__PURE__*/function(_P){function st(t){var _this13;_classCallCheck(this,st);_this13=_callSuper(this,st,[t.doc]),_this13.curSelectionFor=0,_this13.updated=0,_this13.meta=Object.create(null),_this13.time=Date.now(),_this13.curSelection=t.selection,_this13.storedMarks=t.storedMarks;return _this13;}_inherits(st,_P);return _createClass(st,[{key:"selection",get:function get(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection;}},{key:"setSelection",value:function setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this;}},{key:"selectionSet",get:function get(){return(1&this.updated)>0;}},{key:"setStoredMarks",value:function setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this;}},{key:"ensureMarks",value:function ensureMarks(t){return i.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this;}},{key:"addStoredMark",value:function addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()));}},{key:"removeStoredMark",value:function removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()));}},{key:"storedMarksSet",get:function get(){return(2&this.updated)>0;}},{key:"addStep",value:function addStep(t,e){_superPropGet(st,"addStep",this,3)([t,e]),this.updated=-3&this.updated,this.storedMarks=null;}},{key:"setTime",value:function setTime(t){return this.time=t,this;}},{key:"replaceSelection",value:function replaceSelection(t){return this.selection.replace(this,t),this;}},{key:"replaceSelectionWith",value:function replaceSelectionWith(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var r=this.selection;return e&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||i.none))),r.replaceWith(this,t),this;}},{key:"deleteSelection",value:function deleteSelection(){return this.selection.replace(this),this;}},{key:"insertText",value:function insertText(t,e,r){var i=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(null==r&&(r=e),!t)return this.deleteRange(e,r);var _n17=this.storedMarks;if(!_n17){var _t47=this.doc.resolve(e);_n17=r==e?_t47.marks():_t47.marksAcross(this.doc.resolve(r));}return this.replaceRangeWith(e,r,i.text(t,_n17)),this.selection.empty||this.selection.to!=e+t.length||this.setSelection(H.near(this.selection.$to)),this;}}},{key:"setMeta",value:function setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this;}},{key:"getMeta",value:function getMeta(t){return this.meta["string"==typeof t?t:t.key];}},{key:"isGeneric",get:function get(){for(var _t48 in this.meta)return!1;return!0;}},{key:"scrollIntoView",value:function scrollIntoView(){return this.updated|=4,this;}},{key:"scrolledIntoView",get:function get(){return(4&this.updated)>0;}}]);}(P);lt=/*#__PURE__*/_createClass(function lt(t,e,r){_classCallCheck(this,lt);this.name=t,this.init=ht(e.init,r),this.apply=ht(e.apply,r);});ot=[new lt("doc",{init:function init(t){return t.doc||t.schema.topNodeType.createAndFill();},apply:function apply(t){return t.doc;}}),new lt("selection",{init:function init(t,e){return t.selection||H.atStart(e.doc);},apply:function apply(t){return t.selection;}}),new lt("storedMarks",{init:function init(t){return t.storedMarks||null;},apply:function apply(t,e,r,i){return i.selection.$cursor?t.storedMarks:null;}}),new lt("scrollToSelection",{init:function init(){return 0;},apply:function apply(t,e){return t.scrolledIntoView?e+1:e;}})];ut=/*#__PURE__*/_createClass(function ut(t,e){var _this14=this;_classCallCheck(this,ut);this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ot.slice(),e&&e.forEach(function(t){if(_this14.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");_this14.plugins.push(t),_this14.pluginsByKey[t.key]=t,t.spec.state&&_this14.fields.push(new lt(t.key,t.spec.state,t));});});_export("E",ft=/*#__PURE__*/function(){function ft(t){_classCallCheck(this,ft);this.config=t;}return _createClass(ft,[{key:"schema",get:function get(){return this.config.schema;}},{key:"plugins",get:function get(){return this.config.plugins;}},{key:"apply",value:function apply(t){return this.applyTransaction(t).state;}},{key:"filterTransaction",value:function filterTransaction(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;for(var _r29=0;_r29<this.config.plugins.length;_r29++)if(_r29!=e){var _e37=this.config.plugins[_r29];if(_e37.spec.filterTransaction&&!_e37.spec.filterTransaction.call(_e37,t,this))return!1;}return!0;}},{key:"applyTransaction",value:function applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};var e=[t],r=this.applyInner(t),i=null;for(;;){var _n18=!1;for(var _s16=0;_s16<this.config.plugins.length;_s16++){var _h14=this.config.plugins[_s16];if(_h14.spec.appendTransaction){var _l11=i?i[_s16].n:0,_o7=i?i[_s16].state:this,_u8=_l11<e.length&&_h14.spec.appendTransaction.call(_h14,_l11?e.slice(_l11):e,_o7,r);if(_u8&&r.filterTransaction(_u8,_s16)){if(_u8.setMeta("appendedTransaction",t),!i){i=[];for(var _t49=0;_t49<this.config.plugins.length;_t49++)i.push(_t49<_s16?{state:r,n:e.length}:{state:this,n:0});}e.push(_u8),r=r.applyInner(_u8),_n18=!0;}i&&(i[_s16]={state:r,n:e.length});}}if(!_n18)return{state:r,transactions:e};}}},{key:"applyInner",value:function applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");var e=new ft(this.config),r=this.config.fields;for(var _i22=0;_i22<r.length;_i22++){var _n19=r[_i22];e[_n19.name]=_n19.apply(t,this[_n19.name],this,e);}return e;}},{key:"tr",get:function get(){return new st(this);}},{key:"reconfigure",value:function reconfigure(t){var e=new ut(this.schema,t.plugins),r=e.fields,i=new ft(e);for(var _e38=0;_e38<r.length;_e38++){var _n20=r[_e38].name;i[_n20]=this.hasOwnProperty(_n20)?this[_n20]:r[_e38].init(t,i);}return i;}},{key:"toJSON",value:function toJSON(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(function(t){return t.toJSON();})),t&&"object"==_typeof(t))for(var _r30 in t){if("doc"==_r30||"selection"==_r30)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var _i23=t[_r30],_n21=_i23.spec.state;_n21&&_n21.toJSON&&(e[_r30]=_n21.toJSON.call(_i23,this[_i23.key]));}return e;}}],[{key:"create",value:function create(t){var e=new ut(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new ft(e);for(var _i24=0;_i24<e.fields.length;_i24++)r[e.fields[_i24].name]=e.fields[_i24].init(t,r);return r;}},{key:"fromJSON",value:function fromJSON(t,e,r){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var i=new ut(t.schema,t.plugins),n=new ft(i);return i.fields.forEach(function(i){if("doc"==i.name)n.doc=s.fromJSON(t.schema,e.doc);else if("selection"==i.name)n.selection=H.fromJSON(n.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(n.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(r)for(var _s17 in r){var _h15=r[_s17],_l12=_h15.spec.state;if(_h15.key==i.name&&_l12&&_l12.fromJSON&&Object.prototype.hasOwnProperty.call(e,_s17))return void(n[i.name]=_l12.fromJSON.call(_h15,t,e[_s17],n));}n[i.name]=i.init(t,n);}}),n;}}]);}());_export("a",ct=/*#__PURE__*/function(){function ct(t){_classCallCheck(this,ct);this.spec=t,this.props={},t.props&&at(t.props,this,this.props),this.key=t.key?t.key.key:wt("plugin");}return _createClass(ct,[{key:"getState",value:function getState(t){return t[this.key];}}]);}());pt=Object.create(null);_export("P",dt=/*#__PURE__*/function(){function dt(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"key";_classCallCheck(this,dt);this.key=wt(t);}return _createClass(dt,[{key:"get",value:function get(t){return t.config.pluginsByKey[this.key];}},{key:"getState",value:function getState(t){return t[this.key];}}]);}());}};});
|
|
2
|
+
//# sourceMappingURL=index-bbe23ad8.cjs.js.map
|