@aquera/nile-elements 1.9.11 → 2.0.0
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 +4 -0
- package/demo/nxtgen-dark.css +2265 -0
- package/dist/{index-6832c52b.cjs.js → index-3ca67627.cjs.js} +2 -2
- package/dist/{index-6832c52b.cjs.js.map → index-3ca67627.cjs.js.map} +1 -1
- package/dist/{index-f956f56d.cjs.js → index-403841c7.cjs.js} +2 -2
- package/dist/{index-f956f56d.cjs.js.map → index-403841c7.cjs.js.map} +1 -1
- package/dist/{index-50880eb7.cjs.js → index-c3210a9c.cjs.js} +2 -2
- package/dist/{index-50880eb7.cjs.js.map → index-c3210a9c.cjs.js.map} +1 -1
- package/dist/index-ccff99d6.esm.js +1 -0
- package/dist/index-e43755f5.cjs.js +2 -0
- package/dist/index-e43755f5.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +362 -350
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.esm.js +10 -10
- package/dist/nile-carousel/nile-carousel.cjs.js +1 -1
- package/dist/nile-carousel/nile-carousel.cjs.js.map +1 -1
- package/dist/nile-carousel/nile-carousel.esm.js +2 -0
- package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/index.cjs.js +1 -1
- package/dist/nile-code-editor/index.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.esm.js +3 -3
- package/dist/nile-code-editor/theme.cjs.js +1 -1
- package/dist/nile-code-editor/theme.cjs.js.map +1 -1
- package/dist/nile-code-editor/theme.esm.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.css.cjs.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.css.cjs.js.map +1 -1
- package/dist/nile-color-picker/nile-color-picker.css.esm.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-drawer/nile-drawer.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.esm.js +2 -1
- package/dist/nile-drawer/nile-drawer.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.esm.js +4 -3
- package/dist/nile-error-notification/nile-error-notification.css.cjs.js +1 -1
- package/dist/nile-error-notification/nile-error-notification.css.cjs.js.map +1 -1
- package/dist/nile-error-notification/nile-error-notification.css.esm.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-hero/nile-hero.css.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js.map +1 -1
- package/dist/nile-hero/nile-hero.css.esm.js +1 -0
- 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-popup/nile-popup.css.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.css.cjs.js.map +1 -1
- package/dist/nile-popup/nile-popup.css.esm.js +5 -4
- 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 +7 -1
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.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.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.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +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/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/single-line.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +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/nile-wysiwyg-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.js +4 -4
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-carousel/nile-carousel.js +2 -0
- package/dist/src/nile-carousel/nile-carousel.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.css.js +2 -2
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.js +4 -3
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-code-editor/theme.d.ts +118 -2
- package/dist/src/nile-code-editor/theme.js +169 -19
- package/dist/src/nile-code-editor/theme.js.map +1 -1
- package/dist/src/nile-color-picker/nile-color-picker.css.js +12 -12
- package/dist/src/nile-color-picker/nile-color-picker.css.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.css.js +2 -1
- package/dist/src/nile-drawer/nile-drawer.css.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.js +1 -1
- package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.css.js +2 -1
- package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.css.js +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.css.js.map +1 -1
- package/dist/src/nile-hero/nile-hero.css.js +1 -0
- package/dist/src/nile-hero/nile-hero.css.js.map +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-popup/nile-popup.css.js +3 -2
- package/dist/src/nile-popup/nile-popup.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +7 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-calendar/nile-calendar.css.ts +1 -1
- package/src/nile-calendar/nile-calendar.ts +4 -4
- package/src/nile-carousel/nile-carousel.ts +2 -0
- package/src/nile-code-editor/nile-code-editor.css.ts +2 -2
- package/src/nile-code-editor/nile-code-editor.ts +3 -3
- package/src/nile-code-editor/theme.ts +172 -19
- package/src/nile-color-picker/nile-color-picker.css.ts +12 -12
- package/src/nile-drawer/nile-drawer.css.ts +2 -1
- package/src/nile-drawer/nile-drawer.ts +1 -1
- package/src/nile-error-message/nile-error-message.css.ts +2 -1
- package/src/nile-error-notification/nile-error-notification.css.ts +1 -1
- package/src/nile-hero/nile-hero.css.ts +1 -0
- package/src/nile-lite-tooltip/nile-lite-tooltip.css.ts +1 -1
- package/src/nile-popup/nile-popup.css.ts +3 -2
- package/src/nile-tooltip/nile-tooltip.css.ts +7 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./index-89c520e9.cjs.js"],function(_export,_context){"use strict";var t,e,i,r,n,s,l,o,h,f,u,c,a,d,p,m,k,y,v,D,x,O,S,T,C,P,E,N,R,A,B,$,I,F,K,L,G,_,nt,st,lt,ot,ft,ut,ct,at,dt,mt,bt,gt,kt,Mt,Tt,At,re,fe,ce,ae,de,pe,me,Ce,Pe,Ee,Ne,Ae,Ke,He,We,_t67,ze,Ge,Ue,Je,Ye,Qe,Xe,Ze,_e,hi,fi,ui,ci,ai,di,bi,gi,yi;function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n36){function n(){return _n36.apply(this,arguments);}n.toString=function(){return _n36.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _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 _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 _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 b(t,e,i,r,n){for(var s;;){if(t==i&&e==r)return!0;if(e==(n<0?0:g(t))){var _i=t.parentNode;if(!_i||1!=_i.nodeType||w(t)||m.test(t.nodeName)||"false"==t.contentEditable)return!1;e=u(t)+(n<0?0:1),t=_i;}else{if(1!=t.nodeType)return!1;{var _i2=t.childNodes[e+(n<0?-1:0)];if(1==_i2.nodeType&&"false"==_i2.contentEditable){if(!(null===(s=_i2.pmViewDesc)||void 0===s?void 0:s.ignoreForSelection))return!1;e+=n;}else t=_i2,e=n<0?g(t):0;}}}}function g(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length;}function w(t){var e;for(var _i3=t;_i3&&!(e=_i3.pmViewDesc);_i3=_i3.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t);}function M(t,e){var i=document.createEvent("Event");return i.initEvent("keydown",!0,!0),i.keyCode=t,i.key=i.code=e,i;}function q(t){var e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight};}function H(t,e){return"number"==typeof t?t:t[e];}function W(t){var e=t.getBoundingClientRect(),i=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*i,top:e.top,bottom:e.top+t.clientHeight*r};}function j(t,e,i){if(!X(e)&&0==e.left)return;var r=t.someProp("scrollThreshold")||0,n=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(var _l=i||t.dom;_l;){if(1!=_l.nodeType){_l=c(_l);continue;}var _t2=_l,_i4=_t2==s.body,_o=_i4?q(s):W(_t2),_h=0,_f=0;if(e.top<_o.top+H(r,"top")?_f=-(_o.top-e.top+H(n,"top")):e.bottom>_o.bottom-H(r,"bottom")&&(_f=e.bottom-e.top>_o.bottom-_o.top?e.top+H(n,"top")-_o.top:e.bottom-_o.bottom+H(n,"bottom")),e.left<_o.left+H(r,"left")?_h=-(_o.left-e.left+H(n,"left")):e.right>_o.right-H(r,"right")&&(_h=e.right-_o.right+H(n,"right")),_h||_f)if(_i4)s.defaultView.scrollBy(_h,_f);else{var _i5=_t2.scrollLeft,_r=_t2.scrollTop;_f&&(_t2.scrollTop+=_f),_h&&(_t2.scrollLeft+=_h);var _n=_t2.scrollLeft-_i5,_s=_t2.scrollTop-_r;e={left:e.left-_n,top:e.top-_s,right:e.right-_n,bottom:e.bottom-_s};}var _u=_i4?"fixed":getComputedStyle(_l).position;if(/^(fixed|sticky)$/.test(_u))break;_l="absolute"==_u?_l.offsetParent:c(_l);}}function V(t){var e=[],i=t.ownerDocument;for(var _r2=t;_r2&&(e.push({dom:_r2,top:_r2.scrollTop,left:_r2.scrollLeft}),t!=i);_r2=c(_r2));return e;}function z(t,e){for(var _i6=0;_i6<t.length;_i6++){var _t$_i=t[_i6],_r3=_t$_i.dom,_n2=_t$_i.top,_s2=_t$_i.left;_r3.scrollTop!=_n2+e&&(_r3.scrollTop=_n2+e),_r3.scrollLeft!=_s2&&(_r3.scrollLeft=_s2);}}function U(t,e){var i,r,n,s,l=2e8,o=0,h=e.top,f=e.top;for(var _u2=t.firstChild,_c=0;_u2;_u2=_u2.nextSibling,_c++){var _t3=void 0;if(1==_u2.nodeType)_t3=_u2.getClientRects();else{if(3!=_u2.nodeType)continue;_t3=d(_u2).getClientRects();}for(var _a=0;_a<_t3.length;_a++){var _d=_t3[_a];if(_d.top<=h&&_d.bottom>=f){h=Math.max(_d.bottom,h),f=Math.min(_d.top,f);var _t4=_d.left>e.left?_d.left-e.left:_d.right<e.left?e.left-_d.right:0;if(_t4<l){i=_u2,l=_t4,r=_t4&&3==i.nodeType?{left:_d.right<e.left?_d.right:_d.left,top:e.top}:e,1==_u2.nodeType&&_t4&&(o=_c+(e.left>=(_d.left+_d.right)/2?1:0));continue;}}else _d.top>e.top&&!n&&_d.left<=e.left&&_d.right>=e.left&&(n=_u2,s={left:Math.max(_d.left,Math.min(_d.right,e.left)),top:_d.top});!i&&(e.left>=_d.right&&e.top>=_d.top||e.left>=_d.left&&e.top>=_d.bottom)&&(o=_c+1);}}return!i&&n&&(i=n,r=s,l=0),i&&3==i.nodeType?function(t,e){var i,r=t.nodeValue.length,n=document.createRange();for(var _s3=0;_s3<r;_s3++){n.setEnd(t,_s3+1),n.setStart(t,_s3);var _r4=Z(n,1);if(_r4.top!=_r4.bottom&&J(e,_r4)){i={node:t,offset:_s3+(e.left>=(_r4.left+_r4.right)/2?1:0)};break;}}return n.detach(),i||{node:t,offset:0};}(i,r):!i||l&&1==i.nodeType?{node:t,offset:o}:U(i,r);}function J(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1;}function Y(t,e,i){var r=t.childNodes.length;if(r&&i.top<i.bottom)for(var _n3=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-i.top)/(i.bottom-i.top))-2)),_s4=_n3;;){var _i7=t.childNodes[_s4];if(1==_i7.nodeType){var _t5=_i7.getClientRects();for(var _r5=0;_r5<_t5.length;_r5++){var _n4=_t5[_r5];if(J(e,_n4))return Y(_i7,e,_n4);}}if((_s4=(_s4+1)%r)==_n3)break;}return t;}function Q(t,e){var _s5;var i,r=t.dom.ownerDocument,n=0,s=function(t,e,i){if(t.caretPositionFromPoint)try{var _r6=t.caretPositionFromPoint(e,i);if(_r6)return{node:_r6.offsetNode,offset:Math.min(g(_r6.offsetNode),_r6.offset)};}catch(t){}if(t.caretRangeFromPoint){var _r7=t.caretRangeFromPoint(e,i);if(_r7)return{node:_r7.startContainer,offset:Math.min(g(_r7.startContainer),_r7.startOffset)};}}(r,e.left,e.top);s&&(_s5=s,i=_s5.node,n=_s5.offset,_s5);var l,o=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!o||!t.dom.contains(1!=o.nodeType?o.parentNode:o)){var _i8=t.dom.getBoundingClientRect();if(!J(e,_i8))return null;if(o=Y(t.dom,e,_i8),!o)return null;}if(A)for(var _t6=o;i&&_t6;_t6=c(_t6))_t6.draggable&&(i=void 0);if(o=function(t,e){var i=t.parentNode;return i&&/^li$/i.test(i.nodeName)&&e.left<t.getBoundingClientRect().left?i:t;}(o,e),i){if(P&&1==i.nodeType&&(n=Math.min(n,i.childNodes.length),n<i.childNodes.length)){var _t7,_r8=i.childNodes[n];"IMG"==_r8.nodeName&&(_t7=_r8.getBoundingClientRect()).right<=e.left&&_t7.bottom>e.top&&n++;}var _r9;K&&n&&1==i.nodeType&&1==(_r9=i.childNodes[n-1]).nodeType&&"false"==_r9.contentEditable&&_r9.getBoundingClientRect().top>=e.top&&n--,i==t.dom&&n==i.childNodes.length-1&&1==i.lastChild.nodeType&&e.top>i.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:0!=n&&1==i.nodeType&&"BR"==i.childNodes[n-1].nodeName||(l=function(t,e,i,r){var n=-1;for(var _i9=e,_s6=!1;_i9!=t.dom;){var _e2=void 0,_l2=t.docView.nearestDesc(_i9,!0);if(!_l2)return null;if(1==_l2.dom.nodeType&&(_l2.node.isBlock&&_l2.parent||!_l2.contentDOM)&&((_e2=_l2.dom.getBoundingClientRect()).width||_e2.height)&&(_l2.node.isBlock&&_l2.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(_l2.dom.nodeName)&&(!_s6&&_e2.left>r.left||_e2.top>r.top?n=_l2.posBefore:(!_s6&&_e2.right<r.left||_e2.bottom<r.top)&&(n=_l2.posAfter),_s6=!0),!_l2.contentDOM&&n<0&&!_l2.node.isText))return(_l2.node.isBlock?r.top<(_e2.top+_e2.bottom)/2:r.left<(_e2.left+_e2.right)/2)?_l2.posBefore:_l2.posAfter;_i9=_l2.dom.parentNode;}return n>-1?n:t.docView.posFromDOM(e,i,-1);}(t,i,n,e));}null==l&&(l=function(t,e,i){var _U=U(e,i),r=_U.node,n=_U.offset,s=-1;if(1==r.nodeType&&!r.firstChild){var _t8=r.getBoundingClientRect();s=_t8.left!=_t8.right&&i.left>(_t8.left+_t8.right)/2?1:-1;}return t.docView.posFromDOM(r,n,s);}(t,o,e));var h=t.docView.nearestDesc(o,!0);return{pos:l,inside:h?h.posAtStart-h.border:-1};}function X(t){return t.top<t.bottom||t.left<t.right;}function Z(t,e){var i=t.getClientRects();if(i.length){var _t9=i[e<0?0:i.length-1];if(X(_t9))return _t9;}return Array.prototype.find.call(i,X)||t.getBoundingClientRect();}function tt(t,e,i){var _t$docView$domFromPos=t.docView.domFromPos(e,i<0?-1:1),r=_t$docView$domFromPos.node,n=_t$docView$domFromPos.offset,s=_t$docView$domFromPos.atom,l=K||P;if(3==r.nodeType){if(!l||!_.test(r.nodeValue)&&(i<0?n:n!=r.nodeValue.length)){var _t10=n,_e3=n,_s7=i<0?1:-1;return i<0&&!n?(_e3++,_s7=-1):i>=0&&n==r.nodeValue.length?(_t10--,_s7=1):i<0?_t10--:_e3++,et(Z(d(r,_t10,_e3),_s7),_s7<0);}{var _t11=Z(d(r,n,n),i);if(P&&n&&/\s/.test(r.nodeValue[n-1])&&n<r.nodeValue.length){var _e4=Z(d(r,n-1,n-1),-1);if(_e4.top==_t11.top){var _i10=Z(d(r,n,n+1),-1);if(_i10.top!=_t11.top)return et(_i10,_i10.left<_e4.left);}}return _t11;}}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(null==s&&n&&(i<0||n==g(r))){var _t12=r.childNodes[n-1];if(1==_t12.nodeType)return it(_t12.getBoundingClientRect(),!1);}if(null==s&&n<g(r)){var _t13=r.childNodes[n];if(1==_t13.nodeType)return it(_t13.getBoundingClientRect(),!0);}return it(r.getBoundingClientRect(),i>=0);}if(null==s&&n&&(i<0||n==g(r))){var _t14=r.childNodes[n-1],_e5=3==_t14.nodeType?d(_t14,g(_t14)-(l?0:1)):1!=_t14.nodeType||"BR"==_t14.nodeName&&_t14.nextSibling?null:_t14;if(_e5)return et(Z(_e5,1),!1);}if(null==s&&n<g(r)){var _t15=r.childNodes[n];for(;_t15.pmViewDesc&&_t15.pmViewDesc.ignoreForCoords;)_t15=_t15.nextSibling;var _e6=_t15?3==_t15.nodeType?d(_t15,0,l?0:1):1==_t15.nodeType?_t15:null:null;if(_e6)return et(Z(_e6,-1),!0);}return et(Z(3==r.nodeType?d(r):r,-i),i>=0);}function et(t,e){if(0==t.width)return t;var i=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:i,right:i};}function it(t,e){if(0==t.height)return t;var i=e?t.top:t.bottom;return{top:i,bottom:i,left:t.left,right:t.right};}function rt(t,e,i){var r=t.state,n=t.root.activeElement;r!=e&&t.updateState(e),n!=t.dom&&t.focus();try{return i();}finally{r!=e&&t.updateState(r),n!=t.dom&&n&&n.focus();}}function ht(t,e,i){return st==e&<==i?ot:(st=e,lt=i,ot="up"==i||"down"==i?function(t,e,i){var r=e.selection,n="up"==i?r.$from:r.$to;return rt(t,e,function(){var _t$docView$domFromPos2=t.docView.domFromPos(n.pos,"up"==i?-1:1),e=_t$docView$domFromPos2.node;for(;;){var _i11=t.docView.nearestDesc(e,!0);if(!_i11)break;if(_i11.node.isBlock){e=_i11.contentDOM||_i11.dom;break;}e=_i11.dom.parentNode;}var r=tt(t,n.pos,1);for(var _t16=e.firstChild;_t16;_t16=_t16.nextSibling){var _e7=void 0;if(1==_t16.nodeType)_e7=_t16.getClientRects();else{if(3!=_t16.nodeType)continue;_e7=d(_t16,0,_t16.nodeValue.length).getClientRects();}for(var _t17=0;_t17<_e7.length;_t17++){var _n5=_e7[_t17];if(_n5.bottom>_n5.top+1&&("up"==i?r.top-_n5.top>2*(_n5.bottom-r.top):_n5.bottom-r.bottom>2*(r.bottom-_n5.top)))return!1;}}return!0;});}(t,e,i):function(t,e,i){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var n=r.parentOffset,s=!n,l=n==r.parent.content.size,o=t.domSelection();return o?nt.test(r.parent.textContent)&&o.modify?rt(t,e,function(){var _t$domSelectionRange=t.domSelectionRange(),e=_t$domSelectionRange.focusNode,n=_t$domSelectionRange.focusOffset,s=_t$domSelectionRange.anchorNode,l=_t$domSelectionRange.anchorOffset,h=o.caretBidiLevel;o.modify("move",i,"character");var f=r.depth?t.docView.domAfterPos(r.before()):t.dom,_t$domSelectionRange2=t.domSelectionRange(),u=_t$domSelectionRange2.focusNode,c=_t$domSelectionRange2.focusOffset,a=u&&!f.contains(1==u.nodeType?u:u.parentNode)||e==u&&n==c;try{o.collapse(s,l),e&&(e!=s||n!=l)&&o.extend&&o.extend(e,n);}catch(t){}return null!=h&&(o.caretBidiLevel=h),a;}):"left"==i||"backward"==i?s:l:r.pos==r.start()||r.pos==r.end();}(t,e,i));}function pt(t,e,i,r,n){xt(r,e,t);var s=new dt(void 0,t,e,i,r,r,r);return s.contentDOM&&s.updateChildren(n,0),s;}function wt(t,e,i){var r=t.firstChild,n=!1;for(var _s13=0;_s13<e.length;_s13++){var _l9=e[_s13],_o5=_l9.dom;if(_o5.parentNode==t){for(;_o5!=r;)r=St(r),n=!0;r=r.nextSibling;}else n=!0,t.insertBefore(_o5,r);if(_l9 instanceof at){var _e24=r?r.previousSibling:t.lastChild;wt(_l9.contentDOM,_l9.children,i),r=_e24?_e24.nextSibling:t.firstChild;}}for(;r;)r=St(r),n=!0;n&&i.trackWrites==t&&(i.trackWrites=null);}function yt(t,e,i){if(0==t.length)return Mt;var r=i?Mt[0]:new kt(),n=[r];for(var _s14=0;_s14<t.length;_s14++){var _l10=t[_s14].type.attrs;if(_l10){_l10.nodeName&&n.push(r=new kt(_l10.nodeName));for(var _t40 in _l10){var _s15=_l10[_t40];null!=_s15&&(i&&1==n.length&&n.push(r=new kt(e.isInline?"span":"div")),"class"==_t40?r["class"]=(r["class"]?r["class"]+" ":"")+_s15:"style"==_t40?r.style=(r.style?r.style+";":"")+_s15:"nodeName"!=_t40&&(r[_t40]=_s15));}}}return n;}function vt(t,e,i,r){if(i==Mt&&r==Mt)return e;var n=e;for(var _e25=0;_e25<r.length;_e25++){var _s16=r[_e25],_l11=i[_e25];if(_e25){var _e26=void 0;_l11&&_l11.nodeName==_s16.nodeName&&n!=t&&(_e26=n.parentNode)&&_e26.nodeName.toLowerCase()==_s16.nodeName||(_e26=document.createElement(_s16.nodeName),_e26.pmIsDeco=!0,_e26.appendChild(n),_l11=Mt[0]),n=_e26;}Dt(n,_l11||Mt[0],_s16);}return n;}function Dt(t,e,i){for(var _r20 in e)"class"==_r20||"style"==_r20||"nodeName"==_r20||_r20 in i||t.removeAttribute(_r20);for(var _r21 in i)"class"!=_r21&&"style"!=_r21&&"nodeName"!=_r21&&i[_r21]!=e[_r21]&&t.setAttribute(_r21,i[_r21]);if(e["class"]!=i["class"]){var _r22=e["class"]?e["class"].split(" ").filter(Boolean):[],_n14=i["class"]?i["class"].split(" ").filter(Boolean):[];for(var _e27=0;_e27<_r22.length;_e27++)-1==_n14.indexOf(_r22[_e27])&&t.classList.remove(_r22[_e27]);for(var _e28=0;_e28<_n14.length;_e28++)-1==_r22.indexOf(_n14[_e28])&&t.classList.add(_n14[_e28]);0==t.classList.length&&t.removeAttribute("class");}if(e.style!=i.style){if(e.style){var _i28,_r23=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;_i28=_r23.exec(e.style);)t.style.removeProperty(_i28[1]);}i.style&&(t.style.cssText+=i.style);}}function xt(t,e,i){return vt(t,t,Mt,yt(e,i,1!=t.nodeType));}function Ot(t,e){if(t.length!=e.length)return!1;for(var _i29=0;_i29<t.length;_i29++)if(!t[_i29].type.eq(e[_i29].type))return!1;return!0;}function St(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e;}function Ct(t,e){return t.type.side-e.type.side;}function Pt(t,e,i,r,n){var s=[];for(var _l14=0,_o8=0;_l14<t.length;_l14++){var _h6=t[_l14],_f5=_o8,_u5=_o8+=_h6.size;_f5>=i||_u5<=e?s.push(_h6):(_f5<e&&s.push(_h6.slice(0,e-_f5,r)),n&&(s.push(n),n=void 0),_u5>i&&s.push(_h6.slice(i-_f5,_h6.size,r)));}return s;}function Et(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;var s=e.docView.nearestDesc(r.focusNode),l=s&&0==s.size,o=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(o<0)return null;var h,f,c=n.resolve(o);if(k(r)){for(h=o;s&&!s.node;)s=s.parent;var _e33=s.node;if(s&&_e33.isAtom&&t.isSelectable(_e33)&&s.parent&&(!_e33.isInline||!function(t,e,i){for(var _r28=0==e,_n18=e==g(t);_r28||_n18;){if(t==i)return!0;var _e34=u(t);if(!(t=t.parentNode))return!1;_r28=_r28&&0==_e34,_n18=_n18&&_e34==g(t);}}(r.focusNode,r.focusOffset,s.dom))){var _e35=s.posBefore;f=new t(o==_e35?c:n.resolve(_e35));}}else{if(r instanceof e.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){var _ref2,_ref3;var _t44=o,_i33=o;for(var _n19=0;_n19<r.rangeCount;_n19++){var _s17=r.getRangeAt(_n19);_t44=Math.min(_t44,e.docView.posFromDOM(_s17.startContainer,_s17.startOffset,1)),_i33=Math.max(_i33,e.docView.posFromDOM(_s17.endContainer,_s17.endOffset,-1));}if(_t44<0)return null;_ref2=_i33==e.state.selection.anchor?[_i33,_t44]:[_t44,_i33],_ref3=_slicedToArray(_ref2,2),h=_ref3[0],o=_ref3[1],c=n.resolve(o);}else h=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(h<0)return null;}var a=n.resolve(h);if(!f){f=Lt(e,a,c,"pointer"==i||e.state.selection.head<c.pos&&!l?1:-1);}return f;}function Nt(t){return t.editable?t.hasFocus():Ht(t)&&document.activeElement&&document.activeElement.contains(t.dom);}function Rt(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var r=t.state.selection;if(Ft(t,r),!Nt(t))return;var n=t.input.mouseDown;if(!i&&N&&n){var _e36=t.domSelectionRange(),_i34=t.domObserver.currentSelection;if(_e36.anchorNode&&_i34.anchorNode&&p(_e36.anchorNode,_e36.anchorOffset,_i34.anchorNode,_i34.anchorOffset)&&n.delaySelUpdate())return void t.domObserver.setCurSelection();}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.domSelection();if(!e)return;var i=t.cursorWrapper.dom,r="IMG"==i.nodeName;r?e.collapse(i.parentNode,u(i)+1):e.collapse(i,0);!r&&!t.state.selection.visible&&T&&C<=11&&(i.disabled=!0,i.disabled=!1);}(t);else{var _n20,_s18,_l15=r.anchor,_o9=r.head;!At||r instanceof e||(r.$from.parent.inlineContent||(_n20=Bt(t,r.from)),r.empty||r.$from.parent.inlineContent||(_s18=Bt(t,r.to))),t.docView.setSelection(_l15,_o9,t,i),At&&(_n20&&It(_n20),_s18&&It(_s18)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);var i=t.domSelectionRange(),r=i.anchorNode,n=i.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=function(){i.anchorNode==r&&i.anchorOffset==n||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(function(){Nt(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection");},20));});}(t));}t.domObserver.setCurSelection(),t.domObserver.connectSelection();}function Bt(t,e){var _t$docView$domFromPos3=t.docView.domFromPos(e,0),i=_t$docView$domFromPos3.node,r=_t$docView$domFromPos3.offset,n=r<i.childNodes.length?i.childNodes[r]:null,s=r?i.childNodes[r-1]:null;if(A&&n&&"false"==n.contentEditable)return $t(n);if(!(n&&"false"!=n.contentEditable||s&&"false"!=s.contentEditable)){if(n)return $t(n);if(s)return $t(s);}}function $t(t){return t.contentEditable="true",A&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t;}function It(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null);}function Ft(e,i){if(i instanceof t){var _t45=e.docView.descAt(i.from);_t45!=e.lastSelectedViewDesc&&(Kt(e),_t45&&_t45.selectNode(),e.lastSelectedViewDesc=_t45);}else Kt(e);}function Kt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0);}function Lt(t,i,r,n){return t.someProp("createSelectionBetween",function(e){return e(t,i,r);})||e.between(i,r,n);}function qt(t){return!(t.editable&&!t.hasFocus())&&Ht(t);}function Ht(t){var e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode));}catch(t){return!1;}}function Wt(t,e){var _t$selection=t.selection,i=_t$selection.$anchor,n=_t$selection.$head,s=e>0?i.max(n):i.min(n),l=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return l&&r.findFrom(l,e);}function jt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0;}function Vt(i,r,n){var s=i.state.selection;if(!(s instanceof e)){if(s instanceof t&&s.node.isInline)return jt(i,new e(r>0?s.$to:s.$from));{var _t46=Wt(i.state,r);return!!_t46&&jt(i,_t46);}}if(n.indexOf("s")>-1){var _t47=s.$head,_n21=_t47.textOffset?null:r<0?_t47.nodeBefore:_t47.nodeAfter;if(!_n21||_n21.isText||!_n21.isLeaf)return!1;var _l16=i.state.doc.resolve(_t47.pos+_n21.nodeSize*(r<0?-1:1));return jt(i,new e(s.$anchor,_l16));}if(!s.empty)return!1;if(i.endOfTextblock(r>0?"forward":"backward")){var _e37=Wt(i.state,r);return!!(_e37&&_e37 instanceof t)&&jt(i,_e37);}if(!($&&n.indexOf("m")>-1)){var _n22,_l17=s.$head,_o10=_l17.textOffset?null:r<0?_l17.nodeBefore:_l17.nodeAfter;if(!_o10||_o10.isText)return!1;var _h7=r<0?_l17.pos-_o10.nodeSize:_l17.pos;return!!(_o10.isAtom||(_n22=i.docView.descAt(_h7))&&!_n22.contentDOM)&&(t.isSelectable(_o10)?jt(i,new t(r<0?i.state.doc.resolve(_l17.pos-_o10.nodeSize):_l17)):!!K&&jt(i,new e(i.state.doc.resolve(r<0?_h7:_h7+_o10.nodeSize))));}}function zt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length;}function Gt(t,e){var i=t.pmViewDesc;return i&&0==i.size&&(e<0||t.nextSibling||"BR"!=t.nodeName);}function Ut(t,e){return e<0?function(t){var e=t.domSelectionRange(),i=e.focusNode,r=e.focusOffset;if(!i)return;var n,s,l=!1;P&&1==i.nodeType&&r<zt(i)&&Gt(i.childNodes[r],-1)&&(l=!0);for(;;)if(r>0){if(1!=i.nodeType)break;{var _t48=i.childNodes[r-1];if(Gt(_t48,-1))n=i,s=--r;else{if(3!=_t48.nodeType)break;i=_t48,r=i.nodeValue.length;}}}else{if(Jt(i))break;{var _e38=i.previousSibling;for(;_e38&&Gt(_e38,-1);)n=i.parentNode,s=u(_e38),_e38=_e38.previousSibling;if(_e38)i=_e38,r=zt(i);else{if(i=i.parentNode,i==t.dom)break;r=0;}}}l?Yt(t,i,r):n&&Yt(t,n,s);}(t):function(t){var e=t.domSelectionRange(),i=e.focusNode,r=e.focusOffset;if(!i)return;var n,s,l=zt(i);for(;;)if(r<l){if(1!=i.nodeType)break;if(!Gt(i.childNodes[r],1))break;n=i,s=++r;}else{if(Jt(i))break;{var _e39=i.nextSibling;for(;_e39&&Gt(_e39,1);)n=_e39.parentNode,s=u(_e39)+1,_e39=_e39.nextSibling;if(_e39)i=_e39,r=0,l=zt(i);else{if(i=i.parentNode,i==t.dom)break;r=l=0;}}}n&&Yt(t,n,s);}(t);}function Jt(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock;}function Yt(t,e,i){if(3!=e.nodeType){var _t49,_r29;(_r29=function(t,e){for(;t&&e==t.childNodes.length&&!w(t);)e=u(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){var _i35=t.childNodes[e];if(3==_i35.nodeType)return _i35;if(1==_i35.nodeType&&"false"==_i35.contentEditable)break;t=_i35,e=0;}}(e,i))?(e=_r29,i=0):(_t49=function(t,e){for(;t&&!e&&!w(t);)e=u(t),t=t.parentNode;for(;t&&e;){var _i36=t.childNodes[e-1];if(3==_i36.nodeType)return _i36;if(1==_i36.nodeType&&"false"==_i36.contentEditable)break;e=(t=_i36).childNodes.length;}}(e,i))&&(e=_t49,i=_t49.nodeValue.length);}var r=t.domSelection();if(!r)return;if(k(r)){var _t50=document.createRange();_t50.setEnd(e,i),_t50.setStart(e,i),r.removeAllRanges(),r.addRange(_t50);}else r.extend&&r.extend(e,i);t.domObserver.setCurSelection();var n=t.state;setTimeout(function(){t.state==n&&Rt(t);},50);}function Qt(t,e){var i=t.state.doc.resolve(e);if(!N&&!I&&i.parent.inlineContent){var _r30=t.coordsAtPos(e);if(e>i.start()){var _i37=t.coordsAtPos(e-1),_n23=(_i37.top+_i37.bottom)/2;if(_n23>_r30.top&&_n23<_r30.bottom&&Math.abs(_i37.left-_r30.left)>1)return _i37.left<_r30.left?"ltr":"rtl";}if(e<i.end()){var _i38=t.coordsAtPos(e+1),_n24=(_i38.top+_i38.bottom)/2;if(_n24>_r30.top&&_n24<_r30.bottom&&Math.abs(_i38.left-_r30.left)>1)return _i38.left>_r30.left?"ltr":"rtl";}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr";}function Xt(i,n,s){var l=i.state.selection;if(l instanceof e&&!l.empty||s.indexOf("s")>-1)return!1;if($&&s.indexOf("m")>-1)return!1;var o=l.$from,h=l.$to;if(!o.parent.inlineContent||i.endOfTextblock(n<0?"up":"down")){var _e40=Wt(i.state,n);if(_e40&&_e40 instanceof t)return jt(i,_e40);}if(!o.parent.inlineContent){var _t51=n<0?o:h,_e41=l instanceof f?r.near(_t51,n):r.findFrom(_t51,n);return!!_e41&&jt(i,_e41);}return!1;}function Zt(t,i){if(!(t.state.selection instanceof e))return!0;var _t$state$selection2=t.state.selection,r=_t$state$selection2.$head,n=_t$state$selection2.$anchor,s=_t$state$selection2.empty;if(!r.sameParent(n))return!0;if(!s)return!1;if(t.endOfTextblock(i>0?"forward":"backward"))return!0;var l=!r.textOffset&&(i<0?r.nodeBefore:r.nodeAfter);if(l&&!l.isText){var _e42=t.state.tr;return i<0?_e42["delete"](r.pos-l.nodeSize,r.pos):_e42["delete"](r.pos,r.pos+l.nodeSize),t.dispatch(_e42),!0;}return!1;}function _t(t,e,i){t.domObserver.stop(),e.contentEditable=i,t.domObserver.start();}function te(t,e){var i=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e;}(e);if(8==i||$&&72==i&&"c"==r)return Zt(t,-1)||Ut(t,-1);if(46==i&&!e.shiftKey||$&&68==i&&"c"==r)return Zt(t,1)||Ut(t,1);if(13==i||27==i)return!0;if(37==i||$&&66==i&&"c"==r){var _e43=37==i?"ltr"==Qt(t,t.state.selection.from)?-1:1:-1;return Vt(t,_e43,r)||Ut(t,_e43);}if(39==i||$&&70==i&&"c"==r){var _e44=39==i?"ltr"==Qt(t,t.state.selection.from)?1:-1:1;return Vt(t,_e44,r)||Ut(t,_e44);}return 38==i||$&&80==i&&"c"==r?Xt(t,-1,r)||Ut(t,-1):40==i||$&&78==i&&"c"==r?function(t){if(!A||t.state.selection.$head.parentOffset>0)return!1;var _t$domSelectionRange3=t.domSelectionRange(),e=_t$domSelectionRange3.focusNode,i=_t$domSelectionRange3.focusOffset;if(e&&1==e.nodeType&&0==i&&e.firstChild&&"false"==e.firstChild.contentEditable){var _i39=e.firstChild;_t(t,_i39,"true"),setTimeout(function(){return _t(t,_i39,"false");},20);}return!1;}(t)||Xt(t,1,r)||Ut(t,1):r==($?"m":"c")&&(66==i||73==i||89==i||90==i);}function ee(t,e){t.someProp("transformCopied",function(i){e=i(e,t);});var r=[],_e45=e,n=_e45.content,s=_e45.openStart,l=_e45.openEnd;for(;s>1&&l>1&&1==n.childCount&&1==n.firstChild.childCount;){s--,l--;var _t52=n.firstChild;r.push(_t52.type.name,_t52.attrs!=_t52.type.defaultAttrs?_t52.attrs:null),n=_t52.content;}var o=t.someProp("clipboardSerializer")||i.fromSchema(t.state.schema),h=ue(),f=h.createElement("div");f.appendChild(o.serializeFragment(n,{document:h}));var u,c=f.firstChild,a=0;for(;c&&1==c.nodeType&&(u=fe[c.nodeName.toLowerCase()]);){for(var _t53=u.length-1;_t53>=0;_t53--){var _e46=h.createElement(u[_t53]);for(;f.firstChild;)_e46.appendChild(f.firstChild);f.appendChild(_e46),a++;}c=f.firstChild;}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice","".concat(s," ").concat(l).concat(a?" -".concat(a):""," ").concat(JSON.stringify(r))),{dom:f,text:t.someProp("clipboardTextSerializer",function(i){return i(e,t);})||e.content.textBetween(0,e.content.size,"\n\n"),slice:e};}function ie(t,e,r,s,h){var f,u,c=h.parent.type.spec.code;if(!r&&!e)return null;var a=!!e&&(s||c||!r);if(a){if(t.someProp("transformPastedText",function(i){e=i(e,c||s,t);}),c)return u=new n(l.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0),t.someProp("transformPasted",function(e){u=e(u,t,!0);}),u;var _r31=t.someProp("clipboardTextParser",function(i){return i(e,h,s,t);});if(_r31)u=_r31;else{var _r32=h.marks(),_n25=t.state.schema,_s19=i.fromSchema(_n25);f=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(function(t){var e=f.appendChild(document.createElement("p"));t&&e.appendChild(_s19.serializeNode(_n25.text(t,_r32)));});}}else t.someProp("transformPastedHTML",function(e){r=e(r,t);}),f=function(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var i,r=ue(),n=r.body,s=/<([a-z][^>\s]+)/i.exec(t);(i=s&&fe[s[1].toLowerCase()])&&(t=i.map(function(t){return"<"+t+">";}).join("")+t+i.map(function(t){return"</"+t+">";}).reverse().join(""));if(n.innerHTML=function(t){var e=window.trustedTypes;if(!e)return t;ce||(ce=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:function createHTML(t){return t;}}));return ce.createHTML(t);}(t),i)for(var _t54=0;_t54<i.length;_t54++)n=n.querySelector(i[_t54])||n;for(var _t55=0;_t55<r.styleSheets.length;_t55++){var _e47=r.styleSheets[_t55];for(var _t56=0;_t56<_e47.rules.length;_t56++){var _i40=_e47.rules[_t56];if(_i40 instanceof CSSStyleRule){var _t57=n.querySelectorAll(_i40.selectorText);for(var _e48=0;_e48<_t57.length;_e48++)_t57[_e48].style.cssText+=_i40.style.cssText;}}}return n;}(r),K&&function(t){var e=t.querySelectorAll(N?"span:not([class]):not([style])":"span.Apple-converted-space");for(var _i41=0;_i41<e.length;_i41++){var _r33=e[_i41];1==_r33.childNodes.length&&" "==_r33.textContent&&_r33.parentNode&&_r33.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),_r33);}}(f);var d=f&&f.querySelector("[data-pm-slice]"),p=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(p&&p[3])for(var _t58=+p[3];_t58>0;_t58--){var _t59=f.firstChild;for(;_t59&&1!=_t59.nodeType;)_t59=_t59.nextSibling;if(!_t59)break;f=_t59;}if(!u){var _e49=t.someProp("clipboardParser")||t.someProp("domParser")||o.fromSchema(t.state.schema);u=_e49.parseSlice(f,{preserveWhitespace:!(!a&&!p),context:h,ruleFromNode:function ruleFromNode(t){return"BR"!=t.nodeName||t.nextSibling||!t.parentNode||re.test(t.parentNode.nodeName)?null:{ignore:!0};}});}if(p)u=function(t,e){if(!t.size)return t;var i,r=t.content.firstChild.type.schema;try{i=JSON.parse(e);}catch(e){return t;}var s=t.content,o=t.openStart,h=t.openEnd;for(var _t60=i.length-2;_t60>=0;_t60-=2){var _e50=r.nodes[i[_t60]];if(!_e50||_e50.hasRequiredAttrs())break;s=l.from(_e50.create(i[_t60+1],s)),o++,h++;}return new n(s,o,h);}(he(u,+p[1],+p[2]),p[4]);else if(u=n.maxOpen(function(t,e){if(t.childCount<2)return t;var _loop=function _loop(){var r,n=e.node(_i42).contentMatchAt(e.index(_i42)),s=[];if(t.forEach(function(t){if(!s)return;var e,i=n.findWrapping(t.type);if(!i)return s=null;if(e=s.length&&r.length&&se(i,r,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=le(s[s.length-1],r.length));var _e51=ne(t,i);s.push(_e51),n=n.matchType(_e51.type),r=i;}}),s)return{v:l.from(s)};},_ret;for(var _i42=e.depth;_i42>=0;_i42--){_ret=_loop();if(_ret)return _ret.v;}return t;}(u.content,h),!0),u.openStart||u.openEnd){var _t61=0,_e52=0;for(var _e53=u.content.firstChild;_t61<u.openStart&&!_e53.type.spec.isolating;_t61++,_e53=_e53.firstChild);for(var _t62=u.content.lastChild;_e52<u.openEnd&&!_t62.type.spec.isolating;_e52++,_t62=_t62.lastChild);u=he(u,_t61,_e52);}return t.someProp("transformPasted",function(e){u=e(u,t,a);}),u;}function ne(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;for(var _r34=e.length-1;_r34>=i;_r34--)t=e[_r34].create(null,l.from(t));return t;}function se(t,e,i,r,n){if(n<t.length&&n<e.length&&t[n]==e[n]){var _s20=se(t,e,i,r.lastChild,n+1);if(_s20)return r.copy(r.content.replaceChild(r.childCount-1,_s20));if(r.contentMatchAt(r.childCount).matchType(n==t.length-1?i.type:t[n+1]))return r.copy(r.content.append(l.from(ne(i,t,n+1))));}}function le(t,e){if(0==e)return t;var i=t.content.replaceChild(t.childCount-1,le(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(l.empty,!0);return t.copy(i.append(r));}function oe(t,e,i,r,n,s){var o=e<0?t.firstChild:t.lastChild,h=o.content;return t.childCount>1&&(s=0),n<r-1&&(h=oe(h,e,i,r,n+1,s)),n>=i&&(h=e<0?o.contentMatchAt(0).fillBefore(h,s<=n).append(h):h.append(o.contentMatchAt(o.childCount).fillBefore(l.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(h));}function he(t,e,i){return e<t.openStart&&(t=new n(oe(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),i<t.openEnd&&(t=new n(oe(t.content,1,i,t.openEnd,0,0),t.openStart,i)),t;}function ue(){return document.implementation.createHTMLDocument("title");}function be(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now();}function ge(t){t.someProp("handleDOMEvents",function(e){for(var _i43 in e)t.input.eventHandlers[_i43]||t.dom.addEventListener(_i43,t.input.eventHandlers[_i43]=function(e){return we(t,e);});});}function we(t,e){return t.someProp("handleDOMEvents",function(i){var r=i[e.type];return!!r&&(r(t,e)||e.defaultPrevented);});}function ke(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var _i44=e.target;_i44!=t.dom;_i44=_i44.parentNode)if(!_i44||11==_i44.nodeType||_i44.pmViewDesc&&_i44.pmViewDesc.stopEvent(e))return!1;return!0;}function Me(t){return{left:t.clientX,top:t.clientY};}function ye(t,e,i,r,n){if(-1==r)return!1;var s=t.state.doc.resolve(r);var _loop2=function _loop2(_r35){if(t.someProp(e,function(e){return _r35>s.depth?e(t,i,s.nodeAfter,s.before(_r35),n,!0):e(t,i,s.node(_r35),s.before(_r35),n,!1);}))return{v:!0};},_ret2;for(var _r35=s.depth+1;_r35>0;_r35--){_ret2=_loop2(_r35);if(_ret2)return _ret2.v;}return!1;}function ve(t,e,i){if(t.focused||t.focus(),t.state.selection.eq(e))return;var r=t.state.tr.setSelection(e);"pointer"==i&&r.setMeta("pointer",!0),t.dispatch(r);}function De(e,i,r,n,s){return ye(e,"handleClickOn",i,r,n)||e.someProp("handleClick",function(t){return t(e,i,n);})||(s?function(e,i){if(-1==i)return!1;var r,n,s=e.state.selection;s instanceof t&&(r=s.node);var l=e.state.doc.resolve(i);for(var _e54=l.depth+1;_e54>0;_e54--){var _i45=_e54>l.depth?l.nodeAfter:l.node(_e54);if(t.isSelectable(_i45)){n=r&&s.$from.depth>0&&_e54>=s.$from.depth&&l.before(s.$from.depth+1)==s.$from.pos?l.before(s.$from.depth):l.before(_e54);break;}}return null!=n&&(ve(e,t.create(e.state.doc,n),"pointer"),!0);}(e,r):function(e,i){if(-1==i)return!1;var r=e.state.doc.resolve(i),n=r.nodeAfter;return!!(n&&n.isAtom&&t.isSelectable(n))&&(ve(e,new t(r),"pointer"),!0);}(e,r));}function xe(t,e,i,r){return ye(t,"handleDoubleClickOn",e,i,r)||t.someProp("handleDoubleClick",function(i){return i(t,e,r);});}function Oe(t,i,r,n){return ye(t,"handleTripleClickOn",i,r,n)||t.someProp("handleTripleClick",function(e){return e(t,i,n);})||function(t,i,r){if(0!=r.button)return!1;var n=Se(t,i,!0),s=t.state.doc;if(!n)return!1;ve(t,n,"pointer"),n instanceof e&&s.eq(t.state.doc)&&(t.input.mouseDown=new Ne(t,n));return!0;}(t,r,n);}function Se(i,r,n){var s=i.state.doc;if(-1==r)return s.inlineContent?e.create(s,0,s.content.size):null;var l=s.resolve(r);for(var _i46=l.depth+1;_i46>0;_i46--){var _r36=_i46>l.depth?l.nodeAfter:l.node(_i46),_o11=l.before(_i46);if(_r36.inlineContent)return e.create(s,_o11+1,_o11+1+_r36.content.size);if(n&&t.isSelectable(_r36))return t.create(s,_o11);}return null;}function Te(t){return Fe(t);}function Re(t,e){return!!t.composing||!!(A&&Math.abs(Date.now()-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0);}function Be(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(function(){return Fe(t);},e));}function $e(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty();}function Ie(t){var e=t.domSelectionRange();if(!e.focusNode)return null;var i=function(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;e=g(t=t.childNodes[e-1]);}else{if(!t.parentNode||w(t))return null;e=u(t),t=t.parentNode;}}}(e.focusNode,e.focusOffset),r=function(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0;}else{if(!t.parentNode||w(t))return null;e=u(t)+1,t=t.parentNode;}}}(e.focusNode,e.focusOffset);if(i&&r&&i!=r){var _e57=r.pmViewDesc,_n26=t.domObserver.lastChangedTextNode;if(i==_n26||r==_n26)return _n26;if(!_e57||!_e57.isText(r.nodeValue))return r;if(t.input.compositionNode==r){var _t64=i.pmViewDesc;if(_t64&&_t64.isText(i.nodeValue))return r;}}return i||r;}function Fe(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;if(!(F&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),$e(t),e||t.docView&&t.docView.dirty){var _i48=Et(t),_r37=t.state.selection;return _i48&&!_i48.eq(_r37)?t.dispatch(t.state.tr.setSelection(_i48)):!t.markCursor&&!e||_r37.$from.node(_r37.$from.sharedDepth(_r37.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0;}return!1;}}function Le(t,e,i,r,s){var l=ie(t,e,i,r,t.state.selection.$from);if(t.someProp("handlePaste",function(e){return e(t,s,l||n.empty);}))return!0;if(!l)return!1;var o=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null;}(l),h=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(l);return t.dispatch(h.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0;}function qe(t){var e=t.getData("text/plain")||t.getData("Text");if(e)return e;var i=t.getData("text/uri-list");return i?i.replace(/\r?\n/g," "):"";}function je(t,e){var i;return t.someProp("dragCopies",function(t){i=i||t(e);}),null!=i?!i:!e[We];}function Ve(t,e){if(t==e)return!0;for(var _i53 in t)if(t[_i53]!==e[_i53])return!1;for(var _i54 in e)if(!(_i54 in t))return!1;return!0;}function ti(t,e){if(!e||!t.length)return t;var i=[];for(var _r44=0;_r44<t.length;_r44++){var _n32=t[_r44];i.push(new Je(_n32.from+e,_n32.to+e,_n32.type));}return i;}function ei(t,e,i){if(e.isLeaf)return null;var r=i+e.nodeSize,n=null;for(var _e73,_s26=0;_s26<t.length;_s26++)(_e73=t[_s26])&&_e73.from>i&&_e73.to<r&&((n||(n=[])).push(_e73),t[_s26]=null);return n;}function ii(t){var e=[];for(var _i61=0;_i61<t.length;_i61++)null!=t[_i61]&&e.push(t[_i61]);return e;}function ri(t,e,i,r){var n=[],s=!1;e.forEach(function(e,l){var o=ei(t,e,l+i);if(o){s=!0;var _t77=ri(o,e,i+l+1,r);_t77!=Ze&&n.push(l,l+e.nodeSize,_t77);}});var l=ti(s?ii(t):t,-i).sort(ni);for(var _t78=0;_t78<l.length;_t78++)l[_t78].type.valid(e,l[_t78])||(r.onRemove&&r.onRemove(l[_t78].spec),l.splice(_t78--,1));return l.length||n.length?new Xe(l,n):Ze;}function ni(t,e){return t.from-e.from||t.to-e.to;}function si(t){var e=t;for(var _i62=0;_i62<e.length-1;_i62++){var _r45=e[_i62];if(_r45.from!=_r45.to)for(var _n33=_i62+1;_n33<e.length;_n33++){var _s27=e[_n33];if(_s27.from!=_r45.from){_s27.from<_r45.to&&(e==t&&(e=t.slice()),e[_i62]=_r45.copy(_r45.from,_s27.from),li(e,_n33,_r45.copy(_s27.from,_r45.to)));break;}_s27.to!=_r45.to&&(e==t&&(e=t.slice()),e[_n33]=_s27.copy(_s27.from,_r45.to),li(e,_n33+1,_s27.copy(_r45.to,_s27.to)));}}return e;}function li(t,e,i){for(;e<t.length&&ni(i,t[e])>0;)e++;t.splice(e,0,i);}function oi(t){var e=[];return t.someProp("decorations",function(i){var r=i(t.state);r&&r!=Ze&&e.push(r);}),t.cursorWrapper&&e.push(Xe.create(t.state.doc,[t.cursorWrapper.deco])),_e.from(e);}function pi(t,e){var _ref6;var i=e.startContainer,r=e.startOffset,n=e.endContainer,s=e.endOffset,l=t.domAtPos(t.state.selection.anchor);return p(l.node,l.offset,n,s)&&(_ref6=[n,s,i,r],i=_ref6[0],r=_ref6[1],n=_ref6[2],s=_ref6[3],_ref6),{anchorNode:i,anchorOffset:r,focusNode:n,focusOffset:s};}function mi(t,e){for(var _i69=e.parentNode;_i69&&_i69!=t.dom;_i69=_i69.parentNode){var _e82=t.docView.nearestDesc(_i69,!0);if(_e82&&_e82.node.isBlock)return _i69;}return null;}function wi(t,i,r,n,s){var h=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,i<0){var _e83=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,_i70=Et(t,_e83);if(_i70&&!t.state.selection.eq(_i70)){if(N&&F&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));}))return;var _r50=t.state.tr.setSelection(_i70);"pointer"==_e83?_r50.setMeta("pointer",!0):"key"==_e83&&_r50.scrollIntoView(),h&&_r50.setMeta("composition",h),t.dispatch(_r50);}return;}var f=t.state.doc.resolve(i),u=f.sharedDepth(r);i=f.before(u+1),r=t.state.doc.resolve(r).after(u+1);var c,a,d=t.state.selection,p=function(t,e,i,r){var n,_t$docView$parseRange=t.docView.parseRange(e,i),s=_t$docView$parseRange.node,l=_t$docView$parseRange.fromOffset,h=_t$docView$parseRange.toOffset,f=_t$docView$parseRange.from,u=_t$docView$parseRange.to,c=t.domSelectionRange(),a=c.anchorNode;if(a&&t.dom.contains(1==a.nodeType?a:a.parentNode)&&(n=[{node:a,offset:c.anchorOffset}],k(c)||n.push({node:c.focusNode,offset:c.focusOffset})),N&&8===t.input.lastKeyCode)for(var _t88=h;_t88>l;_t88--){var _e84=s.childNodes[_t88-1],_i71=_e84.pmViewDesc;if("BR"==_e84.nodeName&&!_i71){h=_t88;break;}if(!_i71||_i71.size)break;}var d=t.state.doc,p=t.someProp("domParser")||o.fromSchema(t.state.schema),m=d.resolve(f),b=null,g=p.parse(s,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:l,to:h,preserveWhitespace:"pre"!=m.parent.type.whitespace||"full",findPositions:n,ruleFromNode:bi(r),context:m});if(n&&null!=n[0].pos){var _t89=n[0].pos,_e85=n[1]&&n[1].pos;null==_e85&&(_e85=_t89),b={anchor:_t89+f,head:_e85+f};}return{doc:g,sel:b,from:f,to:u};}(t,i,r,s),m=t.state.doc,b=m.slice(p.from,p.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(c=t.state.selection.to,a="end"):(c=t.state.selection.from,a="start"),t.input.lastKeyCode=null;var g=function(t,e,i,r,n){var s=t.findDiffStart(e,i),l=i+t.size,o=i+e.size;if(null==s)return null;var _t$findDiffEnd=t.findDiffEnd(e,l,o),h=_t$findDiffEnd.a,f=_t$findDiffEnd.b;if("end"==n){r-=h+Math.max(0,s-Math.min(h,f))-s;}if(h<s&&l<o){s-=r<=s&&r>=h?s-r:0,f=s+(f-h),h=s;}else if(f<s){s-=r<=s&&r>=f?s-r:0,h=s+(h-f),f=s;}return{start:s,endA:h,endB:f};}(b.content,p.doc.content,p.from,c,a);if(g&&t.input.domChangeCount++,(B&&t.input.lastIOSEnter>Date.now()-225||F)&&s.some(function(t){return 1==t.nodeType&&!gi.test(t.nodeName);})&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));}))return void(t.input.lastIOSEnter=0);if(!g){if(!(n&&d instanceof e&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){var _e86=ki(t,t.state.doc,p.sel);if(_e86&&!_e86.eq(t.state.selection)){var _i72=t.state.tr.setSelection(_e86);h&&_i72.setMeta("composition",h),t.dispatch(_i72);}}return;}g={start:d.from,endA:d.to,endB:d.to};}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof e&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=p.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=p.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),T&&C<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>p.from&&" "==p.doc.textBetween(g.start-p.from-1,g.start-p.from+1)&&(g.start--,g.endA--,g.endB--);var w=p.doc.resolveNoCache(g.start-p.from),y=p.doc.resolveNoCache(g.endB-p.from),v=m.resolve(g.start),D=w.sameParent(y)&&w.parent.inlineContent&&v.end()>=g.endA;if((B&&t.input.lastIOSEnter>Date.now()-225&&(!D||s.some(function(t){return"DIV"==t.nodeName||"P"==t.nodeName;}))||!D&&w.pos<p.doc.content.size&&(!w.sameParent(y)||!w.parent.inlineContent)&&w.pos<y.pos&&!/\S/.test(p.doc.textBetween(w.pos,y.pos,"","")))&&t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));}))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>g.start&&function(t,e,i,r,n){if(i-e<=n.pos-r.pos||Mi(r,!0,!1)<n.pos)return!1;var s=t.resolve(e);if(!r.parent.isTextblock){var _t90=s.nodeAfter;return null!=_t90&&i==e+_t90.nodeSize;}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;var l=t.resolve(Mi(s,!0,!0));return!(!l.parent.isTextblock||l.pos>i||Mi(l,!0,!1)<i)&&r.parent.content.cut(r.parentOffset).eq(l.parent.content);}(m,g.start,g.endA,w,y)&&t.someProp("handleKeyDown",function(e){return e(t,M(8,"Backspace"));}))return void(F&&N&&t.domObserver.suppressSelectionUpdates());N&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),F&&!D&&w.start()!=y.start()&&0==y.parentOffset&&w.depth==y.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==g.endA&&(g.endB-=2,y=p.doc.resolveNoCache(g.endB-p.from),setTimeout(function(){t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));});},20));var x,O=g.start,S=g.endA,P=function P(e){var i=e||t.state.tr.replace(O,S,p.doc.slice(g.start-p.from,g.endB-p.from));if(p.sel){var _e87=ki(t,i.doc,p.sel);_e87&&!(N&&t.composing&&_e87.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(_e87.head==O||_e87.head==i.mapping.map(S)-1)||T&&_e87.empty&&_e87.head==O)&&i.setSelection(_e87);}return h&&i.setMeta("composition",h),i.scrollIntoView();};if(D){if(w.pos==y.pos){T&&C<=11&&0==w.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(function(){return Rt(t);},20));var _e88=P(t.state.tr["delete"](O,S)),_i73=m.resolve(g.start).marksAcross(m.resolve(g.endA));_i73&&_e88.ensureMarks(_i73),t.dispatch(_e88);}else if(g.endA==g.endB&&(x=function(t,e){var i,r,n,s=t.firstChild.marks,o=e.firstChild.marks,h=s,f=o;for(var _t91=0;_t91<o.length;_t91++)h=o[_t91].removeFromSet(h);for(var _t92=0;_t92<s.length;_t92++)f=s[_t92].removeFromSet(f);if(1==h.length&&0==f.length)r=h[0],i="add",n=function n(t){return t.mark(r.addToSet(t.marks));};else{if(0!=h.length||1!=f.length)return null;r=f[0],i="remove",n=function n(t){return t.mark(r.removeFromSet(t.marks));};}var u=[];for(var _t93=0;_t93<e.childCount;_t93++)u.push(n(e.child(_t93)));if(l.from(u).eq(t))return{mark:r,type:i};}(w.parent.content.cut(w.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,g.endA-v.start())))){var _e89=P(t.state.tr);"add"==x.type?_e89.addMark(O,S,x.mark):_e89.removeMark(O,S,x.mark),t.dispatch(_e89);}else if(w.parent.child(w.index()).isText&&w.index()==y.index()-(y.textOffset?0:1)){var _e90=w.parent.textBetween(w.parentOffset,y.parentOffset),_i74=function _i74(){return P(t.state.tr.insertText(_e90,O,S));};t.someProp("handleTextInput",function(r){return r(t,O,S,_e90,_i74);})||t.dispatch(_i74());}else t.dispatch(P());}else t.dispatch(P());}function ki(t,e,i){return Math.max(i.anchor,i.head)>e.content.size?null:Lt(t,e.resolve(i.anchor),e.resolve(i.head));}function Mi(t,e,i){var r=t.depth,n=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,n++,e=!1;if(i){var _e91=t.node(r).maybeChild(t.indexAfter(r));for(;_e91&&!_e91.isLeaf;)_e91=_e91.firstChild,n++;}return n;}function vi(t){var e=Object.create(null);return e["class"]="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",function(i){if("function"==typeof i&&(i=i(t.state)),i)for(var _t104 in i)"class"==_t104?e["class"]+=" "+i[_t104]:"style"==_t104?e.style=(e.style?e.style+";":"")+i[_t104]:e[_t104]||"contenteditable"==_t104||"nodeName"==_t104||(e[_t104]=String(i[_t104]));}),e.translate||(e.translate="no"),[Je.node(0,t.state.doc.content.size,e)];}function Di(t){if(t.markCursor){var _e99=document.createElement("img");_e99.className="ProseMirror-separator",_e99.setAttribute("mark-placeholder","true"),_e99.setAttribute("alt",""),t.cursorWrapper={dom:_e99,deco:Je.widget(t.state.selection.from,_e99,{raw:!0,marks:t.markCursor})};}else t.cursorWrapper=null;}function xi(t){return!t.someProp("editable",function(e){return!1===e(t.state);});}function Oi(t){var e=Object.create(null);function i(t){for(var _i80 in t)Object.prototype.hasOwnProperty.call(e,_i80)||(e[_i80]=t[_i80]);}return t.someProp("nodeViews",i),t.someProp("markViews",i),e;}function Si(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component");}return{setters:[function(_index00aCjsJs){t=_index00aCjsJs.c;e=_index00aCjsJs.T;i=_index00aCjsJs.a;r=_index00aCjsJs.S;n=_index00aCjsJs.d;s=_index00aCjsJs.e;l=_index00aCjsJs.F;o=_index00aCjsJs.D;h=_index00aCjsJs.M;f=_index00aCjsJs.A;}],execute:function execute(){u=function u(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e;},c=function c(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e;};a=null;d=function d(t,e,i){var r=a||(a=document.createRange());return r.setEnd(t,null==i?t.nodeValue.length:i),r.setStart(t,e||0),r;},p=function p(t,e,i,r){return i&&(b(t,e,i,r,-1)||b(t,e,i,r,1));},m=/^(img|br|input|textarea|hr)$/i;k=function k(t){return t.focusNode&&p(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset);};y="undefined"!=typeof navigator?navigator:null,v="undefined"!=typeof document?document:null,D=y&&y.userAgent||"",x=/Edge\/(\d+)/.exec(D),O=/MSIE \d/.exec(D),S=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(D),T=!!(O||S||x),C=O?document.documentMode:S?+S[1]:x?+x[1]:0,P=!T&&/gecko\/(\d+)/i.test(D);P&&(/Firefox\/(\d+)/.exec(D)||[0,0])[1];E=!T&&/Chrome\/(\d+)/.exec(D),N=!!E,R=E?+E[1]:0,A=!T&&!!y&&/Apple Computer/.test(y.vendor),B=A&&(/Mobile\/\w+/.test(D)||!!y&&y.maxTouchPoints>2),$=B||!!y&&/Mac/.test(y.platform),I=!!y&&/Win/.test(y.platform),F=/Android \d/.test(D),K=!!v&&"webkitFontSmoothing"in v.documentElement.style,L=K?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;G=null;_=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;nt=/[\u0590-\u08ac]/;st=null,lt=null,ot=!1;ft=/*#__PURE__*/function(){function ft(t,e,i,r){_classCallCheck(this,ft);this.parent=t,this.children=e,this.dom=i,this.contentDOM=r,this.dirty=0,i.pmViewDesc=this;}return _createClass(ft,[{key:"matchesWidget",value:function matchesWidget(t){return!1;}},{key:"matchesMark",value:function matchesMark(t){return!1;}},{key:"matchesNode",value:function matchesNode(t,e,i){return!1;}},{key:"matchesHack",value:function matchesHack(t){return!1;}},{key:"parseRule",value:function parseRule(t){return null;}},{key:"stopEvent",value:function stopEvent(t){return!1;}},{key:"size",get:function get(){var t=0;for(var _e8=0;_e8<this.children.length;_e8++)t+=this.children[_e8].size;return t;}},{key:"border",get:function get(){return 0;}},{key:"destroy",value:function destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var _t18=0;_t18<this.children.length;_t18++)this.children[_t18].destroy();}},{key:"posBeforeChild",value:function posBeforeChild(t){for(var _e9=0,_i12=this.posAtStart;;_e9++){var _r10=this.children[_e9];if(_r10==t)return _i12;_i12+=_r10.size;}}},{key:"posBefore",get:function get(){return this.parent.posBeforeChild(this);}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBeforeChild(this)+this.border:0;}},{key:"posAfter",get:function get(){return this.posBefore+this.size;}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.size-2*this.border;}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e,i){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(i<0){var _i13,_r11;if(t==this.contentDOM)_i13=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;_i13=t.previousSibling;}for(;_i13&&(!(_r11=_i13.pmViewDesc)||_r11.parent!=this);)_i13=_i13.previousSibling;return _i13?this.posBeforeChild(_r11)+_r11.size:this.posAtStart;}{var _i14,_r12;if(t==this.contentDOM)_i14=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;_i14=t.nextSibling;}for(;_i14&&(!(_r12=_i14.pmViewDesc)||_r12.parent!=this);)_i14=_i14.nextSibling;return _i14?this.posBeforeChild(_r12):this.posAtEnd;}}var r;if(t==this.dom&&this.contentDOM)r=e>u(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var _e10=t;;_e10=_e10.parentNode){if(_e10==this.dom){r=!1;break;}if(_e10.previousSibling)break;}if(null==r&&e==t.childNodes.length)for(var _e11=t;;_e11=_e11.parentNode){if(_e11==this.dom){r=!0;break;}if(_e11.nextSibling)break;}}return(null==r?i>0:r)?this.posAtEnd:this.posAtStart;}},{key:"nearestDesc",value:function nearestDesc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;for(var _i15=!0,_r13=t;_r13;_r13=_r13.parentNode){var _n6=void 0,_s8=this.getDesc(_r13);if(_s8&&(!e||_s8.node)){if(!_i15||!(_n6=_s8.nodeDOM)||(1==_n6.nodeType?_n6.contains(1==t.nodeType?t:t.parentNode):_n6==t))return _s8;_i15=!1;}}}},{key:"getDesc",value:function getDesc(t){var e=t.pmViewDesc;for(var _t19=e;_t19;_t19=_t19.parent)if(_t19==this)return e;}},{key:"posFromDOM",value:function posFromDOM(t,e,i){for(var _r14=t;_r14;_r14=_r14.parentNode){var _n7=this.getDesc(_r14);if(_n7)return _n7.localPosFromDOM(t,e,i);}return-1;}},{key:"descAt",value:function descAt(t){for(var _e12=0,_i16=0;_e12<this.children.length;_e12++){var _r15=this.children[_e12],_n8=_i16+_r15.size;if(_i16==t&&_n8!=_i16){for(;!_r15.border&&_r15.children.length;)for(var _t20=0;_t20<_r15.children.length;_t20++){var _e13=_r15.children[_t20];if(_e13.size){_r15=_e13;break;}}return _r15;}if(t<_n8)return _r15.descAt(t-_i16-_r15.border);_i16=_n8;}}},{key:"domFromPos",value:function domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};var i=0,r=0;for(var _e14=0;i<this.children.length;i++){var _n9=this.children[i],_s9=_e14+_n9.size;if(_s9>t||_n9 instanceof bt){r=t-_e14;break;}_e14=_s9;}if(r)return this.children[i].domFromPos(r-this.children[i].border,e);for(var _t21;i&&!(_t21=this.children[i-1]).size&&_t21 instanceof ut&&_t21.side>=0;i--);if(e<=0){var _t22,_r16=!0;for(;_t22=i?this.children[i-1]:null,_t22&&_t22.dom.parentNode!=this.contentDOM;i--,_r16=!1);return _t22&&e&&_r16&&!_t22.border&&!_t22.domAtom?_t22.domFromPos(_t22.size,e):{node:this.contentDOM,offset:_t22?u(_t22.dom)+1:0};}{var _t23,_r17=!0;for(;_t23=i<this.children.length?this.children[i]:null,_t23&&_t23.dom.parentNode!=this.contentDOM;i++,_r17=!1);return _t23&&_r17&&!_t23.border&&!_t23.domAtom?_t23.domFromPos(0,e):{node:this.contentDOM,offset:_t23?u(_t23.dom):this.contentDOM.childNodes.length};}}},{key:"parseRange",value:function parseRange(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};var r=-1,n=-1;for(var _s10=i,_l3=0;;_l3++){var _i17=this.children[_l3],_o2=_s10+_i17.size;if(-1==r&&t<=_o2){var _n10=_s10+_i17.border;if(t>=_n10&&e<=_o2-_i17.border&&_i17.node&&_i17.contentDOM&&this.contentDOM.contains(_i17.contentDOM))return _i17.parseRange(t,e,_n10);t=_s10;for(var _e15=_l3;_e15>0;_e15--){var _i18=this.children[_e15-1];if(_i18.size&&_i18.dom.parentNode==this.contentDOM&&!_i18.emptyChildAt(1)){r=u(_i18.dom)+1;break;}t-=_i18.size;}-1==r&&(r=0);}if(r>-1&&(_o2>e||_l3==this.children.length-1)){e=_o2;for(var _t24=_l3+1;_t24<this.children.length;_t24++){var _i19=this.children[_t24];if(_i19.size&&_i19.dom.parentNode==this.contentDOM&&!_i19.emptyChildAt(-1)){n=u(_i19.dom);break;}e+=_i19.size;}-1==n&&(n=this.contentDOM.childNodes.length);break;}_s10=_o2;}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:n};}},{key:"emptyChildAt",value:function emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t);}},{key:"domAfterPos",value:function domAfterPos(t){var _this$domFromPos=this.domFromPos(t,0),e=_this$domFromPos.node,i=_this$domFromPos.offset;if(1!=e.nodeType||i==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[i];}},{key:"setSelection",value:function setSelection(t,e,i){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var n=Math.min(t,e),s=Math.max(t,e);for(var _l4=0,_o3=0;_l4<this.children.length;_l4++){var _h2=this.children[_l4],_f2=_o3+_h2.size;if(n>_o3&&s<_f2)return _h2.setSelection(t-_o3-_h2.border,e-_o3-_h2.border,i,r);_o3=_f2;}var l=this.domFromPos(t,t?-1:1),o=e==t?l:this.domFromPos(e,e?-1:1),h=i.root.getSelection(),f=i.domSelectionRange(),c=!1;if((P||A)&&t==e){var _l5=l,_t25=_l5.node,_e16=_l5.offset;if(3==_t25.nodeType){if(c=!(!_e16||"\n"!=_t25.nodeValue[_e16-1]),c&&_e16==_t25.nodeValue.length)for(var _e17,_i20=_t25;_i20;_i20=_i20.parentNode){if(_e17=_i20.nextSibling){"BR"==_e17.nodeName&&(l=o={node:_e17.parentNode,offset:u(_e17)+1});break;}var _t26=_i20.pmViewDesc;if(_t26&&_t26.node&&_t26.node.isBlock)break;}}else{var _i21=_t25.childNodes[_e16-1];c=_i21&&("BR"==_i21.nodeName||"false"==_i21.contentEditable);}}if(P&&f.focusNode&&f.focusNode!=o.node&&1==f.focusNode.nodeType){var _t27=f.focusNode.childNodes[f.focusOffset];_t27&&"false"==_t27.contentEditable&&(r=!0);}if(!(r||c&&A)&&p(l.node,l.offset,f.anchorNode,f.anchorOffset)&&p(o.node,o.offset,f.focusNode,f.focusOffset))return;var a=!1;if((h.extend||t==e)&&(!c||!P)){h.collapse(l.node,l.offset);try{t!=e&&h.extend(o.node,o.offset),a=!0;}catch(t){}}if(!a){if(t>e){var _t28=l;l=o,o=_t28;}var _i22=document.createRange();_i22.setEnd(o.node,o.offset),_i22.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(_i22);}}},{key:"ignoreMutation",value:function ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type;}},{key:"contentLost",get:function get(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM);}},{key:"markDirty",value:function markDirty(t,e){for(var _i23=0,_r18=0;_r18<this.children.length;_r18++){var _n11=this.children[_r18],_s11=_i23+_n11.size;if(_i23==_s11?t<=_s11&&e>=_i23:t<_s11&&e>_i23){var _r19=_i23+_n11.border,_l6=_s11-_n11.border;if(t>=_r19&&e<=_l6)return this.dirty=t==_i23||e==_s11?2:1,void(t!=_r19||e!=_l6||!_n11.contentLost&&_n11.dom.parentNode==this.contentDOM?_n11.markDirty(t-_r19,e-_r19):_n11.dirty=3);_n11.dirty=_n11.dom!=_n11.contentDOM||_n11.dom.parentNode!=this.contentDOM||_n11.children.length?3:2;}_i23=_s11;}this.dirty=2;}},{key:"markParentsDirty",value:function markParentsDirty(){var t=1;for(var _e18=this.parent;_e18;_e18=_e18.parent,t++){var _i24=1==t?2:1;_e18.dirty<_i24&&(_e18.dirty=_i24);}}},{key:"domAtom",get:function get(){return!1;}},{key:"ignoreForCoords",get:function get(){return!1;}},{key:"ignoreForSelection",get:function get(){return!1;}},{key:"isText",value:function isText(t){return!1;}}]);}();ut=/*#__PURE__*/function(_ft){function ut(t,e,i,r){var _this;_classCallCheck(this,ut);var n,s=e.type.toDOM;if("function"==typeof s&&(s=s(i,function(){return n?n.parent?n.parent.posBeforeChild(n):void 0:r;})),!e.type.spec.raw){if(1!=s.nodeType){var _t29=document.createElement("span");_t29.appendChild(s),s=_t29;}s.contentEditable="false",s.classList.add("ProseMirror-widget");}_this=_callSuper(this,ut,[t,[],s,null]),_this.widget=e,_this.widget=e,n=_assertThisInitialized(_this);return _this;}_inherits(ut,_ft);return _createClass(ut,[{key:"matchesWidget",value:function matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type);}},{key:"parseRule",value:function parseRule(){return{ignore:!0};}},{key:"stopEvent",value:function stopEvent(t){var e=this.widget.spec.stopEvent;return!!e&&e(t);}},{key:"ignoreMutation",value:function ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection;}},{key:"destroy",value:function destroy(){this.widget.type.destroy(this.dom),_superPropGet(ut,"destroy",this,3)([]);}},{key:"domAtom",get:function get(){return!0;}},{key:"ignoreForSelection",get:function get(){return!!this.widget.type.spec.relaxedSide;}},{key:"side",get:function get(){return this.widget.type.side;}}]);}(ft);ct=/*#__PURE__*/function(_ft2){function ct(t,e,i,r){var _this2;_classCallCheck(this,ct);_this2=_callSuper(this,ct,[t,[],e,null]),_this2.textDOM=i,_this2.text=r;return _this2;}_inherits(ct,_ft2);return _createClass(ct,[{key:"size",get:function get(){return this.text.length;}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e;}},{key:"domFromPos",value:function domFromPos(t){return{node:this.textDOM,offset:t};}},{key:"ignoreMutation",value:function ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue;}}]);}(ft);at=/*#__PURE__*/function(_ft3){function at(t,e,i,r,n){var _this3;_classCallCheck(this,at);_this3=_callSuper(this,at,[t,[],i,r]),_this3.mark=e,_this3.spec=n;return _this3;}_inherits(at,_ft3);return _createClass(at,[{key:"parseRule",value:function parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM};}},{key:"matchesMark",value:function matchesMark(t){return 3!=this.dirty&&this.mark.eq(t);}},{key:"markDirty",value:function markDirty(t,e){if(_superPropGet(at,"markDirty",this,3)([t,e]),0!=this.dirty){var _t30=this.parent;for(;!_t30.node;)_t30=_t30.parent;_t30.dirty<this.dirty&&(_t30.dirty=this.dirty),this.dirty=0;}}},{key:"slice",value:function slice(t,e,i){var r=at.create(this.parent,this.mark,!0,i),n=this.children,s=this.size;e<s&&(n=Pt(n,e,s,i)),t>0&&(n=Pt(n,0,t,i));for(var _t31=0;_t31<n.length;_t31++)n[_t31].parent=r;return r.children=n,r;}},{key:"ignoreMutation",value:function ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):_superPropGet(at,"ignoreMutation",this,3)([t]);}},{key:"destroy",value:function destroy(){this.spec.destroy&&this.spec.destroy(),_superPropGet(at,"destroy",this,3)([]);}}],[{key:"create",value:function create(t,e,r,n){var s=n.nodeViews[e.type.name],l=s&&s(e,n,r);return l&&l.dom||(l=i.renderSpec(document,e.type.spec.toDOM(e,r),null,e.attrs)),new at(t,e,l.dom,l.contentDOM||l.dom,l);}}]);}(ft);dt=/*#__PURE__*/function(_ft4){function dt(t,e,i,r,n,s,l){var _this4;_classCallCheck(this,dt);_this4=_callSuper(this,dt,[t,[],n,s]),_this4.node=e,_this4.outerDeco=i,_this4.innerDeco=r,_this4.nodeDOM=l;return _this4;}_inherits(dt,_ft4);return _createClass(dt,[{key:"parseRule",value:function parseRule(t){var _this5=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(var _t32=this.children.length-1;_t32>=0;_t32--){var _i25=this.children[_t32];if(this.dom.contains(_i25.dom.parentNode)){e.contentElement=_i25.dom.parentNode;break;}}if(!e.contentElement){var _i26=t&&t.find(function(e){return 1==e.nodeType&&t.indexOf(e.parentNode)<0&&_this5.dom.contains(e);});_i26?e.contentElement=_i26:e.getContent=function(){return l.empty;};}}else e.contentElement=this.contentDOM;}else e.getContent=function(){return _this5.node.content;};return e;}},{key:"matchesNode",value:function matchesNode(t,e,i){return 0==this.dirty&&t.eq(this.node)&&Ot(e,this.outerDeco)&&i.eq(this.innerDeco);}},{key:"size",get:function get(){return this.node.nodeSize;}},{key:"border",get:function get(){return this.node.isLeaf?0:1;}},{key:"updateChildren",value:function updateChildren(t,e){var _this6=this;var i=this.node.inlineContent,r=e,n=t.composing?this.localCompositionInfo(t,e):null,s=n&&n.pos>-1?n:null,l=n&&n.pos<0,o=new Tt(this,s&&s.node,t);!function(t,e,i,r){var n=e.locals(t),s=0;if(0==n.length){for(var _i27=0;_i27<t.childCount;_i27++){var _l7=t.child(_i27);r(_l7,n,e.forChild(s,_l7),_i27),s+=_l7.nodeSize;}return;}var l=0,o=[],h=null;for(var _f3=0;;){var _u3=void 0,_c2=void 0,_a2=void 0,_d2=void 0;for(;l<n.length&&n[l].to==s;){var _t33=n[l++];_t33.widget&&(_u3?(_c2||(_c2=[_u3])).push(_t33):_u3=_t33);}if(_u3)if(_c2){_c2.sort(Ct);for(var _t34=0;_t34<_c2.length;_t34++)i(_c2[_t34],_f3,!!h);}else i(_u3,_f3,!!h);if(h)_d2=-1,_a2=h,h=null;else{if(!(_f3<t.childCount))break;_d2=_f3,_a2=t.child(_f3++);}for(var _t35=0;_t35<o.length;_t35++)o[_t35].to<=s&&o.splice(_t35--,1);for(;l<n.length&&n[l].from<=s&&n[l].to>s;)o.push(n[l++]);var _p=s+_a2.nodeSize;if(_a2.isText){var _t36=_p;l<n.length&&n[l].from<_t36&&(_t36=n[l].from);for(var _e19=0;_e19<o.length;_e19++)o[_e19].to<_t36&&(_t36=o[_e19].to);_t36<_p&&(h=_a2.cut(_t36-s),_a2=_a2.cut(0,_t36-s),_p=_t36,_d2=-1);}else for(;l<n.length&&n[l].to<_p;)l++;r(_a2,_a2.isInline&&!_a2.isLeaf?o.filter(function(t){return!t.inline;}):o.slice(),e.forChild(s,_a2),_d2),s=_p;}}(this.node,this.innerDeco,function(e,n,s){e.spec.marks?o.syncToMarks(e.spec.marks,i,t,n):e.type.side>=0&&!s&&o.syncToMarks(n==_this6.node.childCount?h.none:_this6.node.child(n).marks,i,t,n),o.placeWidget(e,t,r);},function(e,s,h,f){var u;o.syncToMarks(e.marks,i,t,f),o.findNodeMatch(e,s,h,f)||l&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(u=o.findIndexWithChild(n.node))>-1&&o.updateNodeAt(e,s,h,u,t)||o.updateNextNode(e,s,h,t,f,r)||o.addNode(e,s,h,t,r),r+=e.nodeSize;}),o.syncToMarks([],i,t,0),this.node.isTextblock&&o.addTextblockHacks(),o.destroyRest(),(o.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),wt(this.contentDOM,this.children,t),B&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var _e20=t.style.cssText;t.style.cssText=_e20+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=_e20;}}(this.dom));}},{key:"localCompositionInfo",value:function localCompositionInfo(t,i){var _t$state$selection=t.state.selection,r=_t$state$selection.from,n=_t$state$selection.to;if(!(t.state.selection instanceof e)||r<i||n>i+this.node.content.size)return null;var s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){var _t37=s.nodeValue,_e21=function(t,e,i,r){for(var _n12=0,_s12=0;_n12<t.childCount&&_s12<=r;){var _l8=t.child(_n12++),_o4=_s12;if(_s12+=_l8.nodeSize,!_l8.isText)continue;var _h3=_l8.text;for(;_n12<t.childCount;){var _e22=t.child(_n12++);if(_s12+=_e22.nodeSize,!_e22.isText)break;_h3+=_e22.text;}if(_s12>=i){if(_s12>=r&&_h3.slice(r-e.length-_o4,r-_o4)==e)return r-e.length;var _t38=_o4<r?_h3.lastIndexOf(e,r-_o4-1):-1;if(_t38>=0&&_t38+e.length+_o4>=i)return _o4+_t38;if(i==r&&_h3.length>=r+e.length-_o4&&_h3.slice(r-_o4,r-_o4+e.length)==e)return r;}}return-1;}(this.node.content,_t37,r-i,n-i);return _e21<0?null:{node:s,pos:_e21,text:_t37};}return{node:s,pos:-1,text:""};}},{key:"protectLocalComposition",value:function protectLocalComposition(t,_ref){var e=_ref.node,i=_ref.pos,r=_ref.text;if(this.getDesc(e))return;var n=e;for(;n.parentNode!=this.contentDOM;n=n.parentNode){for(;n.previousSibling;)n.parentNode.removeChild(n.previousSibling);for(;n.nextSibling;)n.parentNode.removeChild(n.nextSibling);n.pmViewDesc&&(n.pmViewDesc=void 0);}var s=new ct(this,n,e,r);t.input.compositionNodes.push(s),this.children=Pt(this.children,i,i+r.length,t,s);}},{key:"update",value:function update(t,e,i,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,i,r),!0);}},{key:"updateInner",value:function updateInner(t,e,i,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=i,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0;}},{key:"updateOuterDeco",value:function updateOuterDeco(t){if(Ot(t,this.outerDeco))return;var e=1!=this.nodeDOM.nodeType,i=this.dom;this.dom=vt(this.dom,this.nodeDOM,yt(this.outerDeco,this.node,e),yt(t,this.node,e)),this.dom!=i&&(i.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t;}},{key:"selectNode",value:function selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0));}},{key:"deselectNode",value:function deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"));}},{key:"domAtom",get:function get(){return this.node.isAtom;}}],[{key:"create",value:function create(t,e,r,n,s,l){var o,h=s.nodeViews[e.type.name],f=h&&h(e,s,function(){return o?o.parent?o.parent.posBeforeChild(o):void 0:l;},r,n),u=f&&f.dom,c=f&&f.contentDOM;if(e.isText){if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node");}else u=document.createTextNode(e.text);}else if(!u){var _t39=i.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);u=_t39.dom;c=_t39.contentDOM;}c||e.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),e.type.spec.draggable&&(u.draggable=!0));var a=u;return u=xt(u,r,e),f?o=new gt(t,e,r,n,u,c||null,a,f):e.isText?new mt(t,e,r,n,u,a):new dt(t,e,r,n,u,c||null,a);}}]);}(ft);mt=/*#__PURE__*/function(_dt){function mt(t,e,i,r,n,s){_classCallCheck(this,mt);return _callSuper(this,mt,[t,e,i,r,n,null,s]);}_inherits(mt,_dt);return _createClass(mt,[{key:"parseRule",value:function parseRule(){var t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0};}},{key:"update",value:function update(t,e,i,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0);}},{key:"inParent",value:function inParent(){var t=this.parent.contentDOM;for(var _e23=this.nodeDOM;_e23;_e23=_e23.parentNode)if(_e23==t)return!0;return!1;}},{key:"domFromPos",value:function domFromPos(t){return{node:this.nodeDOM,offset:t};}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e,i){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):_superPropGet(mt,"localPosFromDOM",this,3)([t,e,i]);}},{key:"ignoreMutation",value:function ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type;}},{key:"slice",value:function slice(t,e,i){var r=this.node.cut(t,e),n=document.createTextNode(r.text);return new mt(this.parent,r,this.outerDeco,this.innerDeco,n,n);}},{key:"markDirty",value:function markDirty(t,e){_superPropGet(mt,"markDirty",this,3)([t,e]),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3);}},{key:"domAtom",get:function get(){return!1;}},{key:"isText",value:function isText(t){return this.node.text==t;}}]);}(dt);bt=/*#__PURE__*/function(_ft5){function bt(){_classCallCheck(this,bt);return _callSuper(this,bt,arguments);}_inherits(bt,_ft5);return _createClass(bt,[{key:"parseRule",value:function parseRule(){return{ignore:!0};}},{key:"matchesHack",value:function matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t;}},{key:"domAtom",get:function get(){return!0;}},{key:"ignoreForCoords",get:function get(){return"IMG"==this.dom.nodeName;}}]);}(ft);gt=/*#__PURE__*/function(_dt2){function gt(t,e,i,r,n,s,l,o){var _this7;_classCallCheck(this,gt);_this7=_callSuper(this,gt,[t,e,i,r,n,s,l]),_this7.spec=o;return _this7;}_inherits(gt,_dt2);return _createClass(gt,[{key:"update",value:function update(t,e,i,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){var _n13=this.spec.update(t,e,i);return _n13&&this.updateInner(t,e,i,r),_n13;}return!(!this.contentDOM&&!t.isLeaf)&&_superPropGet(gt,"update",this,3)([t,e,i,r]);}},{key:"selectNode",value:function selectNode(){this.spec.selectNode?this.spec.selectNode():_superPropGet(gt,"selectNode",this,3)([]);}},{key:"deselectNode",value:function deselectNode(){this.spec.deselectNode?this.spec.deselectNode():_superPropGet(gt,"deselectNode",this,3)([]);}},{key:"setSelection",value:function setSelection(t,e,i,r){this.spec.setSelection?this.spec.setSelection(t,e,i.root):_superPropGet(gt,"setSelection",this,3)([t,e,i,r]);}},{key:"destroy",value:function destroy(){this.spec.destroy&&this.spec.destroy(),_superPropGet(gt,"destroy",this,3)([]);}},{key:"stopEvent",value:function stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t);}},{key:"ignoreMutation",value:function ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):_superPropGet(gt,"ignoreMutation",this,3)([t]);}}]);}(dt);kt=function kt(t){t&&(this.nodeName=t);};kt.prototype=Object.create(null);Mt=[new kt()];Tt=/*#__PURE__*/function(){function Tt(t,e,i){_classCallCheck(this,Tt);this.lock=e,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,e){var i=e,r=i.children.length,n=t.childCount,s=new Map(),l=[];t:for(;n>0;){var _o6=void 0;for(;;)if(r){var _t41=i.children[r-1];if(!(_t41 instanceof at)){_o6=_t41,r--;break;}i=_t41,r=_t41.children.length;}else{if(i==e)break t;r=i.parent.children.indexOf(i),i=i.parent;}var _h4=_o6.node;if(_h4){if(_h4!=t.child(n-1))break;--n,s.set(_o6,n),l.push(_o6);}}return{index:n,matched:s,matches:l.reverse()};}(t.node.content,t);}return _createClass(Tt,[{key:"destroyBetween",value:function destroyBetween(t,e){if(t!=e){for(var _i30=t;_i30<e;_i30++)this.top.children[_i30].destroy();this.top.children.splice(t,e-t),this.changed=!0;}}},{key:"destroyRest",value:function destroyRest(){this.destroyBetween(this.index,this.top.children.length);}},{key:"syncToMarks",value:function syncToMarks(t,e,i,r){var n=0,s=this.stack.length>>1,l=Math.min(s,t.length);for(;n<l&&(n==s-1?this.top:this.stack[n+1<<1]).matchesMark(t[n])&&!1!==t[n].type.spec.spanning;)n++;for(;n<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);var _n15=-1,_l12=this.top.children.length;r<this.preMatch.index&&(_l12=Math.min(this.index+3,_l12));for(var _e29=this.index;_e29<_l12;_e29++){var _i31=this.top.children[_e29];if(_i31.matchesMark(t[s])&&!this.isLocked(_i31.dom)){_n15=_e29;break;}}if(_n15<0&&this.index<this.top.children.length){var _e30=this.top.children[this.index];_e30 instanceof at&&3!=_e30.dirty&&_e30.mark.type==t[s].type&&_e30.spec.update&&!this.isLocked(_e30.dom)&&_e30.spec.update(t[s])&&(_e30.mark=t[s],_n15=this.index,this.changed=!0);}if(_n15>-1)_n15>this.index&&(this.changed=!0,this.destroyBetween(this.index,_n15)),this.top=this.top.children[this.index];else{var _r24=at.create(this.top,t[s],e,i);this.top.children.splice(this.index,0,_r24),this.top=_r24,this.changed=!0;}this.index=0,s++;}}},{key:"findNodeMatch",value:function findNodeMatch(t,e,i,r){var n,s=-1;if(r>=this.preMatch.index&&(n=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&n.matchesNode(t,e,i))s=this.top.children.indexOf(n,this.index);else for(var _r25=this.index,_n16=Math.min(this.top.children.length,_r25+5);_r25<_n16;_r25++){var _n17=this.top.children[_r25];if(_n17.matchesNode(t,e,i)&&!this.preMatch.matched.has(_n17)){s=_r25;break;}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0);}},{key:"updateNodeAt",value:function updateNodeAt(t,e,i,r,n){var s=this.top.children[r];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(t,e,i,n)&&(this.destroyBetween(this.index,r),this.index++,!0);}},{key:"findIndexWithChild",value:function findIndexWithChild(t){for(;;){var _e31=t.parentNode;if(!_e31)return-1;if(_e31==this.top.contentDOM){var _e32=t.pmViewDesc;if(_e32)for(var _t42=this.index;_t42<this.top.children.length;_t42++)if(this.top.children[_t42]==_e32)return _t42;return-1;}t=_e31;}}},{key:"updateNextNode",value:function updateNextNode(t,e,i,r,n,s){for(var _l13=this.index;_l13<this.top.children.length;_l13++){var _o7=this.top.children[_l13];if(_o7 instanceof dt){var _h5=this.preMatch.matched.get(_o7);if(null!=_h5&&_h5!=n)return!1;var _f4=void 0,_u4=_o7.dom,_c3=this.isLocked(_u4)&&!(t.isText&&_o7.node&&_o7.node.isText&&_o7.nodeDOM.nodeValue==t.text&&3!=_o7.dirty&&Ot(e,_o7.outerDeco));if(!_c3&&_o7.update(t,e,i,r))return this.destroyBetween(this.index,_l13),_o7.dom!=_u4&&(this.changed=!0),this.index++,!0;if(!_c3&&(_f4=this.recreateWrapper(_o7,t,e,i,r,s)))return this.destroyBetween(this.index,_l13),this.top.children[this.index]=_f4,_f4.contentDOM&&(_f4.dirty=2,_f4.updateChildren(r,s+1),_f4.dirty=0),this.changed=!0,this.index++,!0;break;}}return!1;}},{key:"recreateWrapper",value:function recreateWrapper(t,e,i,r,n,s){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!Ot(i,t.outerDeco)||!r.eq(t.innerDeco))return null;var l=dt.create(this.top,e,i,r,n,s);if(l.contentDOM){l.children=t.children,t.children=[];var _iterator=_createForOfIteratorHelper(l.children),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _t43=_step.value;_t43.parent=l;}}catch(err){_iterator.e(err);}finally{_iterator.f();}}return t.destroy(),l;}},{key:"addNode",value:function addNode(t,e,i,r,n){var s=dt.create(this.top,t,e,i,r,n);s.contentDOM&&s.updateChildren(r,n+1),this.top.children.splice(this.index++,0,s),this.changed=!0;}},{key:"placeWidget",value:function placeWidget(t,e,i){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var _r26=new ut(this.top,t,e,i);this.top.children.splice(this.index++,0,_r26),this.changed=!0;}else this.index++;}},{key:"addTextblockHacks",value:function addTextblockHacks(){var t=this.top.children[this.index-1],e=this.top;for(;t instanceof at;)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof mt)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((A||N)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top));}},{key:"addHackNode",value:function addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{var _i32=document.createElement(t);"IMG"==t&&(_i32.className="ProseMirror-separator",_i32.alt=""),"BR"==t&&(_i32.className="ProseMirror-trailingBreak");var _r27=new bt(this.top,[],_i32,null);e!=this.top?e.children.push(_r27):e.children.splice(this.index++,0,_r27),this.changed=!0;}}},{key:"isLocked",value:function isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode));}}]);}();At=A||N&&R<63;re=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;fe={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};ce=null;ae={},de={},pe={touchstart:!0,touchmove:!0};me=/*#__PURE__*/_createClass(function me(){_classCallCheck(this,me);this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null;});de.keydown=function(t,e){var i=e;if(t.input.shiftKey=16==i.keyCode||i.shiftKey,!Re(t)&&(t.input.lastKeyCode=i.keyCode,t.input.lastKeyCodeTime=Date.now(),!F||!N||13!=i.keyCode))if(229!=i.keyCode&&t.domObserver.forceFlush(),!B||13!=i.keyCode||i.ctrlKey||i.altKey||i.metaKey)t.someProp("handleKeyDown",function(e){return e(t,i);})||te(t,i)?i.preventDefault():be(t,"key");else{var _e55=Date.now();t.input.lastIOSEnter=_e55,t.input.lastIOSEnterFallbackTimeout=setTimeout(function(){t.input.lastIOSEnter==_e55&&(t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));}),t.input.lastIOSEnter=0);},200);}},de.keyup=function(t,e){16==e.keyCode&&(t.input.shiftKey=!1);},de.keypress=function(t,i){var r=i;if(Re(t)||!r.charCode||r.ctrlKey&&!r.altKey||$&&r.metaKey)return;if(t.someProp("handleKeyPress",function(e){return e(t,r);}))return void r.preventDefault();var n=t.state.selection;if(!(n instanceof e&&n.$from.sameParent(n.$to))){var _e56=String.fromCharCode(r.charCode),_i47=function _i47(){return t.state.tr.insertText(_e56).scrollIntoView();};/[\r\n]/.test(_e56)||t.someProp("handleTextInput",function(r){return r(t,n.$from.pos,n.$to.pos,_e56,_i47);})||t.dispatch(_i47()),r.preventDefault();}};Ce=$?"metaKey":"ctrlKey";ae.mousedown=function(t,e){var i=e;t.input.shiftKey=i.shiftKey;var r=Te(t),n=Date.now(),s="singleClick";n-t.input.lastClick.time<500&&function(t,e){var i=e.x-t.clientX,r=e.y-t.clientY;return i*i+r*r<100;}(i,t.input.lastClick)&&!i[Ce]&&t.input.lastClick.button==i.button&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:n,x:i.clientX,y:i.clientY,type:s,button:i.button},t.input.mouseDown&&t.input.mouseDown.done();var l=t.posAtCoords(Me(i));l&&("singleClick"==s?t.input.mouseDown=new Ee(t,l,i,!!r):("doubleClick"==s?xe:Oe)(t,l.pos,l.inside,i)?i.preventDefault():be(t,"pointer"));};Pe=/*#__PURE__*/function(){function Pe(t){_classCallCheck(this,Pe);this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this));}return _createClass(Pe,[{key:"up",value:function up(t){this.done();}},{key:"move",value:function move(t){0==t.buttons&&this.done();}},{key:"done",value:function done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null);}},{key:"delaySelUpdate",value:function delaySelUpdate(){return!1;}}]);}();Ee=/*#__PURE__*/function(_Pe){function Ee(e,i,r,n){var _this8;_classCallCheck(this,Ee);var s,l;if(_this8=_callSuper(this,Ee,[e]),_this8.pos=i,_this8.event=r,_this8.flushed=n,_this8.delayedSelectionSync=!1,_this8.startDoc=e.state.doc,_this8.selectNode=!!r[Ce],_this8.allowDefault=r.shiftKey,i.inside>-1)s=e.state.doc.nodeAt(i.inside),l=i.inside;else{var _t63=e.state.doc.resolve(i.pos);s=_t63.parent,l=_t63.depth?_t63.before():0;}var o=n?null:r.target,h=o?e.docView.nearestDesc(o,!0):null;_this8.target=h&&1==h.nodeDOM.nodeType?h.nodeDOM:null;var f=e.state.selection;0==r.button&&(s.type.spec.draggable&&!1!==s.type.spec.selectable||f instanceof t&&f.from<=l&&f.to>l)&&(_this8.mightDrag={node:s,pos:l,addAttr:!(!_this8.target||_this8.target.draggable),setUneditable:!(!_this8.target||!P||_this8.target.hasAttribute("contentEditable"))}),_this8.target&&_this8.mightDrag&&(_this8.mightDrag.addAttr||_this8.mightDrag.setUneditable)&&(_this8.view.domObserver.stop(),_this8.mightDrag.addAttr&&(_this8.target.draggable=!0),_this8.mightDrag.setUneditable&&setTimeout(function(){_this8.view.input.mouseDown==_this8&&_this8.target.setAttribute("contentEditable","false");},20),_this8.view.domObserver.start()),be(e,"pointer");return _this8;}_inherits(Ee,_Pe);return _createClass(Ee,[{key:"done",value:function done(){var _this9=this;_superPropGet(Ee,"done",this,3)([]),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){_this9.view.isDestroyed||Rt(_this9.view);});}},{key:"up",value:function up(t){if(this.done(),!this.view.dom.contains(t.target))return;var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Me(t))),this.updateAllowDefault(t),this.allowDefault||!e?be(this.view,"pointer"):De(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||A&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(ve(this.view,r.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):be(this.view,"pointer");}},{key:"move",value:function move(t){this.updateAllowDefault(t),be(this.view,"pointer"),_superPropGet(Ee,"move",this,3)([t]);}},{key:"updateAllowDefault",value:function updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0);}},{key:"delaySelUpdate",value:function delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0);}}]);}(Pe);Ne=/*#__PURE__*/function(_Pe2){function Ne(t,e){var _this10;_classCallCheck(this,Ne);_this10=_callSuper(this,Ne,[t]),_this10.startSelection=e,_this10.startDoc=t.state.doc;return _this10;}_inherits(Ne,_Pe2);return _createClass(Ne,[{key:"move",value:function move(t){if(0==t.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();t.preventDefault(),be(this.view,"pointer");var i=this.view.posAtCoords(Me(t)),r=i&&Se(this.view,i.inside,!1);if(!r)return;var n=this.view.state.doc,s=this.startSelection,_ref4=r.from<s.from?[s.to,r.from]:[s.from,r.to],_ref5=_slicedToArray(_ref4,2),l=_ref5[0],o=_ref5[1];ve(this.view,e.create(n,l,o),"pointer");}}]);}(Pe);ae.touchstart=function(t){t.input.lastTouch=Date.now(),Te(t),be(t,"pointer");},ae.touchmove=function(t){t.input.lastTouch=Date.now(),be(t,"pointer");},ae.contextmenu=function(t){return Te(t);};Ae=F?5e3:-1;de.compositionstart=de.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var _i49=t.state,_r38=_i49.selection.$to;if(_i49.selection instanceof e&&(_i49.storedMarks||!_r38.textOffset&&_r38.parentOffset&&_r38.nodeBefore.marks.some(function(t){return!1===t.type.spec.inclusive;})||N&&I&&function(t){var _t$domSelectionRange4=t.domSelectionRange(),e=_t$domSelectionRange4.focusNode,i=_t$domSelectionRange4.focusOffset;if(!e||1!=e.nodeType||i>=e.childNodes.length)return!1;var r=e.childNodes[i];return 1==r.nodeType&&"false"==r.contentEditable;}(t)))t.markCursor=t.state.storedMarks||_r38.marks(),Fe(t,!0),t.markCursor=null;else if(Fe(t,!_i49.selection.empty),P&&_i49.selection.empty&&_r38.parentOffset&&!_r38.textOffset&&_r38.nodeBefore.marks.length){var _e58=t.domSelectionRange();for(var _i50=_e58.focusNode,_r39=_e58.focusOffset;_i50&&1==_i50.nodeType&&0!=_r39;){var _e59=_r39<0?_i50.lastChild:_i50.childNodes[_r39-1];if(!_e59)break;if(3==_e59.nodeType){var _i51=t.domSelection();_i51&&_i51.collapse(_e59,_e59.nodeValue.length);break;}_i50=_e59,_r39=-1;}}t.input.composing=!0;}Be(t,Ae);},de.compositionend=function(t,e){t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(function(){return t.domObserver.flush();}),t.input.compositionID++,Be(t,20));};Ke=T&&C<15||B&&L<604;ae.copy=de.cut=function(t,e){var i=e,r=t.state.selection,n="cut"==i.type;if(r.empty)return;var s=Ke?null:i.clipboardData,l=r.content(),_ee=ee(t,l),o=_ee.dom,h=_ee.text;s?(i.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",h)):function(t,e){if(!t.dom.parentNode)return;var i=t.dom.parentNode.appendChild(document.createElement("div"));i.appendChild(e),i.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),n=document.createRange();n.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(n),setTimeout(function(){i.parentNode&&i.parentNode.removeChild(i),t.focus();},50);}(t,o),n&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"));},de.paste=function(t,e){var i=e;if(t.composing&&!F)return;var r=Ke?null:i.clipboardData,n=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Le(t,qe(r),r.getData("text/html"),n,i)?i.preventDefault():function(t,e){if(!t.dom.parentNode)return;var i=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(i?"textarea":"div"));i||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();var n=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),i?Le(t,r.value,null,n,e):Le(t,r.textContent,r.innerHTML,n,e);},50);}(t,i);};He=/*#__PURE__*/_createClass(function He(t,e,i){_classCallCheck(this,He);this.slice=t,this.move=e,this.node=i;});We=$?"altKey":"ctrlKey";ae.dragstart=function(e,i){var r=i,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;var s,l=e.state.selection,o=l.empty?null:e.posAtCoords(Me(r));if(o&&o.pos>=l.from&&o.pos<=(l instanceof t?l.to-1:l.to));else if(n&&n.mightDrag)s=t.create(e.state.doc,n.mightDrag.pos);else if(r.target&&1==r.target.nodeType){var _i52=e.docView.nearestDesc(r.target,!0);_i52&&_i52.node.type.spec.draggable&&_i52!=e.docView&&(s=t.create(e.state.doc,_i52.posBefore));}var h=(s||e.state.selection).content(),_ee2=ee(e,h),f=_ee2.dom,u=_ee2.text,c=_ee2.slice;(!r.dataTransfer.files.length||!N||R>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(Ke?"Text":"text/html",f.innerHTML),r.dataTransfer.effectAllowed="copyMove",Ke||r.dataTransfer.setData("text/plain",u),e.dragging=new He(c,je(e,r),s);},ae.dragend=function(t){var e=t.dragging;window.setTimeout(function(){t.dragging==e&&(t.dragging=null);},50);},de.dragover=de.dragenter=function(t,e){return e.preventDefault();},de.drop=function(e,i){try{!function(e,i,r){if(!i.dataTransfer)return;var l=e.posAtCoords(Me(i));if(!l)return;var o=e.state.doc.resolve(l.pos),h=r&&r.slice;h?e.someProp("transformPasted",function(t){h=t(h,e,!1);}):h=ie(e,qe(i.dataTransfer),Ke?null:i.dataTransfer.getData("text/html"),!1,o);var f=!(!r||!je(e,i));if(e.someProp("handleDrop",function(t){return t(e,i,h||n.empty,f);}))return void i.preventDefault();if(!h)return;i.preventDefault();var u=h?s(e.state.doc,o.pos,h):o.pos;null==u&&(u=o.pos);var c=e.state.tr;if(f){var _t65=r.node;_t65?_t65.replace(c):c.deleteSelection();}var a=c.mapping.map(u),d=0==h.openStart&&0==h.openEnd&&1==h.content.childCount,p=c.doc;d?c.replaceRangeWith(a,a,h.content.firstChild):c.replaceRange(a,a,h);if(c.doc.eq(p))return;var m=c.doc.resolve(a);if(d&&t.isSelectable(h.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(h.content.firstChild))c.setSelection(new t(m));else{var _t66=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach(function(e,i,r,n){return _t66=n;}),c.setSelection(Lt(e,m,c.doc.resolve(_t66)));}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"));}(e,i,e.dragging);}finally{e.dragging=null;}},ae.focus=function(t){t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Rt(t);},20));},ae.blur=function(t,e){var i=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),i.relatedTarget&&t.dom.contains(i.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1);},ae.beforeinput=function(t,e){if(F&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var _e60=t.input.domChangeCount;setTimeout(function(){if(t.input.domChangeCount!=_e60)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",function(e){return e(t,M(8,"Backspace"));}))return;var i=t.state.selection.$cursor;i&&i.pos>0&&t.dispatch(t.state.tr["delete"](i.pos-1,i.pos).scrollIntoView());},50);}};for(_t67 in de)ae[_t67]=de[_t67];ze=/*#__PURE__*/function(){function ze(t,e){_classCallCheck(this,ze);this.toDOM=t,this.spec=e||Qe,this.side=this.spec.side||0;}return _createClass(ze,[{key:"map",value:function map(t,e,i,r){var _t$mapResult=t.mapResult(e.from+r,this.side<0?-1:1),n=_t$mapResult.pos,s=_t$mapResult.deleted;return s?null:new Je(n-i,n-i,this);}},{key:"valid",value:function valid(){return!0;}},{key:"eq",value:function eq(t){return this==t||t instanceof ze&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ve(this.spec,t.spec));}},{key:"destroy",value:function destroy(t){this.spec.destroy&&this.spec.destroy(t);}}]);}();Ge=/*#__PURE__*/function(){function Ge(t,e){_classCallCheck(this,Ge);this.attrs=t,this.spec=e||Qe;}return _createClass(Ge,[{key:"map",value:function map(t,e,i,r){var n=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-i,s=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-i;return n>=s?null:new Je(n,s,this);}},{key:"valid",value:function valid(t,e){return e.from<e.to;}},{key:"eq",value:function eq(t){return this==t||t instanceof Ge&&Ve(this.attrs,t.attrs)&&Ve(this.spec,t.spec);}},{key:"destroy",value:function destroy(){}}],[{key:"is",value:function is(t){return t.type instanceof Ge;}}]);}();Ue=/*#__PURE__*/function(){function Ue(t,e){_classCallCheck(this,Ue);this.attrs=t,this.spec=e||Qe;}return _createClass(Ue,[{key:"map",value:function map(t,e,i,r){var n=t.mapResult(e.from+r,1);if(n.deleted)return null;var s=t.mapResult(e.to+r,-1);return s.deleted||s.pos<=n.pos?null:new Je(n.pos-i,s.pos-i,this);}},{key:"valid",value:function valid(t,e){var i,_t$content$findIndex=t.content.findIndex(e.from),r=_t$content$findIndex.index,n=_t$content$findIndex.offset;return n==e.from&&!(i=t.child(r)).isText&&n+i.nodeSize==e.to;}},{key:"eq",value:function eq(t){return this==t||t instanceof Ue&&Ve(this.attrs,t.attrs)&&Ve(this.spec,t.spec);}},{key:"destroy",value:function destroy(){}}]);}();_export("a",Je=/*#__PURE__*/function(){function Je(t,e,i){_classCallCheck(this,Je);this.from=t,this.to=e,this.type=i;}return _createClass(Je,[{key:"copy",value:function copy(t,e){return new Je(t,e,this.type);}},{key:"eq",value:function eq(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to;}},{key:"map",value:function map(t,e,i){return this.type.map(t,this,e,i);}},{key:"spec",get:function get(){return this.type.spec;}},{key:"inline",get:function get(){return this.type instanceof Ge;}},{key:"widget",get:function get(){return this.type instanceof ze;}}],[{key:"widget",value:function widget(t,e,i){return new Je(t,t,new ze(e,i));}},{key:"inline",value:function inline(t,e,i,r){return new Je(t,e,new Ge(i,r));}},{key:"node",value:function node(t,e,i,r){return new Je(t,e,new Ue(i,r));}}]);}());Ye=[],Qe={};_export("D",Xe=/*#__PURE__*/function(){function Xe(t,e){_classCallCheck(this,Xe);this.local=t.length?t:Ye,this.children=e.length?e:Ye;}return _createClass(Xe,[{key:"find",value:function find(t,e,i){var r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,i),r;}},{key:"findInner",value:function findInner(t,e,i,r,n){for(var _s21=0;_s21<this.local.length;_s21++){var _l18=this.local[_s21];_l18.from<=e&&_l18.to>=t&&(!n||n(_l18.spec))&&i.push(_l18.copy(_l18.from+r,_l18.to+r));}for(var _s22=0;_s22<this.children.length;_s22+=3)if(this.children[_s22]<e&&this.children[_s22+1]>t){var _l19=this.children[_s22]+1;this.children[_s22+2].findInner(t-_l19,e-_l19,i,r+_l19,n);}}},{key:"map",value:function map(t,e,i){return this==Ze||0==t.maps.length?this:this.mapInner(t,e,0,0,i||Qe);}},{key:"mapInner",value:function mapInner(t,e,i,r,n){var s;for(var _l20=0;_l20<this.local.length;_l20++){var _o12=this.local[_l20].map(t,i,r);_o12&&_o12.type.valid(e,_o12)?(s||(s=[])).push(_o12):n.onRemove&&n.onRemove(this.local[_l20].spec);}return this.children.length?function(t,e,i,r,n,s,l){var o=t.slice();var _loop3=function _loop3(_e62){var r=0;i.maps[_t68].forEach(function(t,i,n,s){var l=s-n-(i-t);for(var _n27=0;_n27<o.length;_n27+=3){var _s24=o[_n27+1];if(_s24<0||t>_s24+_e62-r)continue;var _h9=o[_n27]+_e62-r;i>=_h9?o[_n27+1]=t<=_h9?-2:-1:t>=_e62&&l&&(o[_n27]+=l,o[_n27+1]+=l);}r+=l;}),_e62=i.maps[_t68].map(_e62,-1);_e61=_e62;};for(var _t68=0,_e61=s;_t68<i.maps.length;_t68++){_loop3(_e61);}var h=!1;for(var _e63=0;_e63<o.length;_e63+=3)if(o[_e63+1]<0){if(-2==o[_e63+1]){h=!0,o[_e63+1]=-1;continue;}var _f6=i.map(t[_e63]+s),_u6=_f6-n;if(_u6<0||_u6>=r.content.size){h=!0;continue;}var _c4=i.map(t[_e63+1]+s,-1)-n,_r$content$findIndex=r.content.findIndex(_u6),_a3=_r$content$findIndex.index,_d3=_r$content$findIndex.offset,_p2=r.maybeChild(_a3);if(_p2&&_d3==_u6&&_d3+_p2.nodeSize==_c4){var _r40=o[_e63+2].mapInner(i,_p2,_f6+1,t[_e63]+s+1,l);_r40!=Ze?(o[_e63]=_u6,o[_e63+1]=_c4,o[_e63+2]=_r40):(o[_e63+1]=-2,h=!0);}else h=!0;}if(h){var _h8=function(t,e,i,r,n,s,l){function o(t,e){for(var _s23=0;_s23<t.local.length;_s23++){var _o13=t.local[_s23].map(r,n,e);_o13?i.push(_o13):l.onRemove&&l.onRemove(t.local[_s23].spec);}for(var _i55=0;_i55<t.children.length;_i55+=3)o(t.children[_i55+2],t.children[_i55]+e+1);}for(var _i56=0;_i56<t.length;_i56+=3)-1==t[_i56+1]&&o(t[_i56+2],e[_i56]+s+1);return i;}(o,t,e,i,n,s,l),_f7=ri(_h8,r,0,l);e=_f7.local;for(var _t69=0;_t69<o.length;_t69+=3)o[_t69+1]<0&&(o.splice(_t69,3),_t69-=3);for(var _t70=0,_e64=0;_t70<_f7.children.length;_t70+=3){var _i57=_f7.children[_t70];for(;_e64<o.length&&o[_e64]<_i57;)_e64+=3;o.splice(_e64,0,_f7.children[_t70],_f7.children[_t70+1],_f7.children[_t70+2]);}}return new Xe(e.sort(ni),o);}(this.children,s||[],t,e,i,r,n):s?new Xe(s.sort(ni),Ye):Ze;}},{key:"add",value:function add(t,e){return e.length?this==Ze?Xe.create(t,e):this.addInner(t,e,0):this;}},{key:"addInner",value:function addInner(t,e,i){var _this11=this;var r,n=0;t.forEach(function(t,s){var l,o=s+i;if(l=ei(e,t,o)){for(r||(r=_this11.children.slice());n<r.length&&r[n]<s;)n+=3;r[n]==s?r[n+2]=r[n+2].addInner(t,l,o+1):r.splice(n,0,s,s+t.nodeSize,ri(l,t,o+1,Qe)),n+=3;}});var s=ti(n?ii(e):e,-i);for(var _e65=0;_e65<s.length;_e65++)s[_e65].type.valid(t,s[_e65])||s.splice(_e65--,1);return new Xe(s.length?this.local.concat(s).sort(ni):this.local,r||this.children);}},{key:"remove",value:function remove(t){return 0==t.length||this==Ze?this:this.removeInner(t,0);}},{key:"removeInner",value:function removeInner(t,e){var i=this.children,r=this.local;for(var _r41=0;_r41<i.length;_r41+=3){var _n28=void 0,_s25=i[_r41]+e,_l21=i[_r41+1]+e;for(var _e66,_i58=0;_i58<t.length;_i58++)(_e66=t[_i58])&&_e66.from>_s25&&_e66.to<_l21&&(t[_i58]=null,(_n28||(_n28=[])).push(_e66));if(!_n28)continue;i==this.children&&(i=this.children.slice());var _o14=i[_r41+2].removeInner(_n28,_s25+1);_o14!=Ze?i[_r41+2]=_o14:(i.splice(_r41,3),_r41-=3);}if(r.length)for(var _i59,_n29=0;_n29<t.length;_n29++)if(_i59=t[_n29])for(var _t71=0;_t71<r.length;_t71++)r[_t71].eq(_i59,e)&&(r==this.local&&(r=this.local.slice()),r.splice(_t71--,1));return i==this.children&&r==this.local?this:r.length||i.length?new Xe(r,i):Ze;}},{key:"forChild",value:function forChild(t,e){if(this==Ze)return this;if(e.isLeaf)return Xe.empty;var i,r;for(var _e67=0;_e67<this.children.length;_e67+=3)if(this.children[_e67]>=t){this.children[_e67]==t&&(i=this.children[_e67+2]);break;}var n=t+1,s=n+e.content.size;for(var _t72=0;_t72<this.local.length;_t72++){var _e68=this.local[_t72];if(_e68.from<s&&_e68.to>n&&_e68.type instanceof Ge){var _t73=Math.max(n,_e68.from)-n,_i60=Math.min(s,_e68.to)-n;_t73<_i60&&(r||(r=[])).push(_e68.copy(_t73,_i60));}}if(r){var _t74=new Xe(r.sort(ni),Ye);return i?new _e([_t74,i]):_t74;}return i||Ze;}},{key:"eq",value:function eq(t){if(this==t)return!0;if(!(t instanceof Xe)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var _e69=0;_e69<this.local.length;_e69++)if(!this.local[_e69].eq(t.local[_e69]))return!1;for(var _e70=0;_e70<this.children.length;_e70+=3)if(this.children[_e70]!=t.children[_e70]||this.children[_e70+1]!=t.children[_e70+1]||!this.children[_e70+2].eq(t.children[_e70+2]))return!1;return!0;}},{key:"locals",value:function locals(t){return si(this.localsInner(t));}},{key:"localsInner",value:function localsInner(t){if(this==Ze)return Ye;if(t.inlineContent||!this.local.some(Ge.is))return this.local;var e=[];for(var _t75=0;_t75<this.local.length;_t75++)this.local[_t75].type instanceof Ge||e.push(this.local[_t75]);return e;}},{key:"forEachSet",value:function forEachSet(t){t(this);}}],[{key:"create",value:function create(t,e){return e.length?ri(e,t,0,Qe):Ze;}}]);}());Xe.empty=new Xe([],[]),Xe.removeOverlap=si;Ze=Xe.empty;_e=/*#__PURE__*/function(){function _e(t){_classCallCheck(this,_e);this.members=t;}return _createClass(_e,[{key:"map",value:function map(t,e){var i=this.members.map(function(i){return i.map(t,e,Qe);});return _e.from(i);}},{key:"forChild",value:function forChild(t,e){if(e.isLeaf)return Xe.empty;var i=[];for(var _r42=0;_r42<this.members.length;_r42++){var _n30=this.members[_r42].forChild(t,e);_n30!=Ze&&(_n30 instanceof _e?i=i.concat(_n30.members):i.push(_n30));}return _e.from(i);}},{key:"eq",value:function eq(t){if(!(t instanceof _e)||t.members.length!=this.members.length)return!1;for(var _e71=0;_e71<this.members.length;_e71++)if(!this.members[_e71].eq(t.members[_e71]))return!1;return!0;}},{key:"locals",value:function locals(t){var e,i=!0;for(var _r43=0;_r43<this.members.length;_r43++){var _n31=this.members[_r43].localsInner(t);if(_n31.length)if(e){i&&(e=e.slice(),i=!1);for(var _t76=0;_t76<_n31.length;_t76++)e.push(_n31[_t76]);}else e=_n31;}return e?si(i?e:e.sort(ni)):Ye;}},{key:"forEachSet",value:function forEachSet(t){for(var _e72=0;_e72<this.members.length;_e72++)this.members[_e72].forEachSet(t);}}],[{key:"from",value:function from(t){switch(t.length){case 0:return Ze;case 1:return t[0];default:return new _e(t.every(function(t){return t instanceof Xe;})?t:t.reduce(function(t,e){return t.concat(e instanceof Xe?e:e.members);},[]));}}}]);}();hi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},fi=T&&C<=11;ui=/*#__PURE__*/function(){function ui(){_classCallCheck(this,ui);this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}return _createClass(ui,[{key:"set",value:function set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset;}},{key:"clear",value:function clear(){this.anchorNode=this.focusNode=null;}},{key:"eq",value:function eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset;}}]);}();ci=/*#__PURE__*/function(){function ci(t,e){var _this12=this;_classCallCheck(this,ci);this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ui(),this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){for(var _t79=0;_t79<e.length;_t79++)_this12.queue.push(e[_t79]);T&&C<=11&&e.some(function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length;})?_this12.flushSoon():A&&t.composing&&e.some(function(t){return"childList"==t.type&&"TR"==t.target.nodeName;})?(t.input.badSafariComposition=!0,_this12.flushSoon()):_this12.flush();}),fi&&(this.onCharData=function(t){_this12.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),_this12.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this);}return _createClass(ci,[{key:"flushSoon",value:function flushSoon(){var _this13=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){_this13.flushingSoon=-1,_this13.flush();},20));}},{key:"forceFlush",value:function forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush());}},{key:"start",value:function start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,hi)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection();}},{key:"stop",value:function stop(){var _this14=this;if(this.observer){var _t80=this.observer.takeRecords();if(_t80.length){for(var _e74=0;_e74<_t80.length;_e74++)this.queue.push(_t80[_e74]);window.setTimeout(function(){return _this14.flush();},20);}this.observer.disconnect();}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection();}},{key:"connectSelection",value:function connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange);}},{key:"disconnectSelection",value:function disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange);}},{key:"suppressSelectionUpdates",value:function suppressSelectionUpdates(){var _this15=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return _this15.suppressingSelectionUpdates=!1;},50);}},{key:"onSelectionChange",value:function onSelectionChange(){if(qt(this.view)){if(this.suppressingSelectionUpdates)return Rt(this.view);if(T&&C<=11&&!this.view.state.selection.empty){var _t81=this.view.domSelectionRange();if(_t81.focusNode&&p(_t81.focusNode,_t81.focusOffset,_t81.anchorNode,_t81.anchorOffset))return this.flushSoon();}this.flush();}}},{key:"setCurSelection",value:function setCurSelection(){this.currentSelection.set(this.view.domSelectionRange());}},{key:"ignoreSelectionChange",value:function ignoreSelectionChange(t){if(!t.focusNode)return!0;var e,i=new Set();for(var _e75=t.focusNode;_e75;_e75=c(_e75))i.add(_e75);for(var _r46=t.anchorNode;_r46;_r46=c(_r46))if(i.has(_r46)){e=_r46;break;}var r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0;}},{key:"pendingRecords",value:function pendingRecords(){if(this.observer){var _iterator2=_createForOfIteratorHelper(this.observer.takeRecords()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _t82=_step2.value;this.queue.push(_t82);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return this.queue;}},{key:"flush",value:function flush(){var t=this.view;if(!t.docView||this.flushingSoon>-1)return;var e=this.pendingRecords();e.length&&(this.queue=[]);var i=t.domSelectionRange(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&qt(t)&&!this.ignoreSelectionChange(i),s=-1,l=-1,o=!1,h=[];if(t.editable)for(var _t83=0;_t83<e.length;_t83++){var _i63=this.registerMutation(e[_t83],h);_i63&&(s=s<0?_i63.from:Math.min(_i63.from,s),l=l<0?_i63.to:Math.max(_i63.to,l),_i63.typeOver&&(o=!0));}if(h.some(function(t){return"BR"==t.nodeName;})&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||N&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&e.some(function(t){return"childList"==t.type&&t.removedNodes.length;}))){var _iterator3=_createForOfIteratorHelper(h),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _t84=_step3.value;if("BR"==_t84.nodeName&&_t84.parentNode){var _e76=_t84.nextSibling;for(;_e76&&1==_e76.nodeType;){if("false"==_e76.contentEditable){_t84.parentNode.removeChild(_t84);break;}_e76=_e76.firstChild;}}}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}else if(P&&h.length){var _e77=h.filter(function(t){return"BR"==t.nodeName;});if(2==_e77.length){var _e78=_slicedToArray(_e77,2),_t85=_e78[0],_i64=_e78[1];_t85.parentNode&&_t85.parentNode.parentNode==_i64.parentNode?_i64.remove():_t85.remove();}else{var _i65=this.currentSelection.focusNode;var _iterator4=_createForOfIteratorHelper(_e77),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _r47=_step4.value;var _e79=_r47.parentNode;!_e79||"LI"!=_e79.nodeName||_i65&&mi(t,_i65)==_e79||_r47.remove();}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}}var f=null;s<0&&n&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&k(i)&&(f=Et(t))&&f.eq(r.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Rt(t),this.currentSelection.set(i),t.scrollToSelection()):(s>-1||n)&&(s>-1&&(t.docView.markDirty(s,l),function(t){if(ai.has(t))return;if(ai.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=P,di)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),di=!0;}}(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(t,e){var i;var _t$domSelectionRange5=t.domSelectionRange(),r=_t$domSelectionRange5.focusNode,n=_t$domSelectionRange5.focusOffset;var _iterator5=_createForOfIteratorHelper(e),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _s28=_step5.value;if("TR"==(null===(i=_s28.parentNode)||void 0===i?void 0:i.nodeName)){var _e80=_s28.nextSibling;for(;_e80&&"TD"!=_e80.nodeName&&"TH"!=_e80.nodeName;)_e80=_e80.nextSibling;if(_e80){var _i66=_e80;for(;;){var _t86=_i66.firstChild;if(!_t86||1!=_t86.nodeType||"false"==_t86.contentEditable||/^(BR|IMG)$/.test(_t86.nodeName))break;_i66=_t86;}_i66.insertBefore(_s28,_i66.firstChild),r==_s28&&t.domSelection().collapse(_s28,n);}else _s28.parentNode.removeChild(_s28);}}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}(t,h)),this.handleDOMChange(s,l,o,h),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(i)||Rt(t),this.currentSelection.set(i));}},{key:"registerMutation",value:function registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;var i=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(i==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!i||i.ignoreMutation(t))return null;if("childList"==t.type){for(var _i67=0;_i67<t.addedNodes.length;_i67++){var _r48=t.addedNodes[_i67];e.push(_r48),3==_r48.nodeType&&(this.lastChangedTextNode=_r48);}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(t.target))return{from:i.posBefore,to:i.posAfter};var _r49=t.previousSibling,_n34=t.nextSibling;if(T&&C<=11&&t.addedNodes.length)for(var _e81=0;_e81<t.addedNodes.length;_e81++){var _t$addedNodes$_e=t.addedNodes[_e81],_i68=_t$addedNodes$_e.previousSibling,_s29=_t$addedNodes$_e.nextSibling;(!_i68||Array.prototype.indexOf.call(t.addedNodes,_i68)<0)&&(_r49=_i68),(!_s29||Array.prototype.indexOf.call(t.addedNodes,_s29)<0)&&(_n34=_s29);}var _s30=_r49&&_r49.parentNode==t.target?u(_r49)+1:0,_l22=i.localPosFromDOM(t.target,_s30,-1),_o15=_n34&&_n34.parentNode==t.target?u(_n34):t.target.childNodes.length;return{from:_l22,to:i.localPosFromDOM(t.target,_o15,1)};}return"attributes"==t.type?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=t.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:t.target.nodeValue==t.oldValue});}}]);}();ai=new WeakMap(),di=!1;bi=function bi(t){return function(e){var i=e.pmViewDesc;if(i)return i.parseRule(t);if("BR"==e.nodeName&&e.parentNode){if(A&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var _t87=document.createElement("div");return _t87.appendChild(document.createElement("li")),{skip:_t87};}if(e.parentNode.lastChild==e||A&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0};}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null;};},gi=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;_export("E",yi=/*#__PURE__*/function(){function yi(t,e){var _this16=this;_classCallCheck(this,yi);this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new me(),this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Si),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=xi(this),Di(this),this.nodeViews=Oi(this),this.docView=pt(this.state.doc,vi(this),oi(this),this.dom,this),this.domObserver=new ci(this,function(t,e,i,r){return wi(_this16,t,e,i,r);}),this.domObserver.start(),function(t){var _loop4=function _loop4(){var i=ae[_e92];t.dom.addEventListener(_e92,t.input.eventHandlers[_e92]=function(e){!ke(t,e)||we(t,e)||!t.editable&&e.type in de||i(t,e);},pe[_e92]?{passive:!0}:void 0);};for(var _e92 in ae){_loop4();}A&&t.dom.addEventListener("input",function(){return null;}),ge(t);}(this),this.updatePluginViews();}return _createClass(yi,[{key:"composing",get:function get(){return this.input.composing;}},{key:"props",get:function get(){if(this._props.state!=this.state){var _t94=this._props;this._props={};for(var _e93 in _t94)this._props[_e93]=_t94[_e93];this._props.state=this.state;}return this._props;}},{key:"update",value:function update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ge(this);var e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Si),this.directPlugins=t.plugins),this.updateStateInner(t.state,e);}},{key:"setProps",value:function setProps(t){var e={};for(var _t95 in this._props)e[_t95]=this._props[_t95];e.state=this.state;for(var _i75 in t)e[_i75]=t[_i75];this.update(e);}},{key:"updateState",value:function updateState(t){this.updateStateInner(t,this._props);}},{key:"updateStateInner",value:function updateStateInner(t,e){var i;var r=this.state,n=!1,s=!1;t.storedMarks&&this.composing&&($e(this),s=!0),this.state=t;var l=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(l||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){var _t96=Oi(this);(function(t,e){var i=0,r=0;for(var _r51 in t){if(t[_r51]!=e[_r51])return!0;i++;}for(var _t97 in e)r++;return i!=r;})(_t96,this.nodeViews)&&(this.nodeViews=_t96,n=!0);}(l||e.handleDOMEvents!=this._props.handleDOMEvents)&&ge(this),this.editable=xi(this),Di(this);var o=oi(this),h=vi(this),f=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=n||!this.docView.matchesNode(t.doc,h,o);!u&&t.selection.eq(r.selection)||(s=!0);var c="preserve"==f&&s&&null==this.dom.style.overflowAnchor&&function(t){var e,i,r=t.dom.getBoundingClientRect(),n=Math.max(0,r.top);for(var _s31=(r.left+r.right)/2,_l23=n+1;_l23<Math.min(innerHeight,r.bottom);_l23+=5){var _r52=t.root.elementFromPoint(_s31,_l23);if(!_r52||_r52==t.dom||!t.dom.contains(_r52))continue;var _o16=_r52.getBoundingClientRect();if(_o16.top>=n-20){e=_r52,i=_o16.top;break;}}return{refDOM:e,refTop:i,stack:V(t.dom)};}(this);if(s){this.domObserver.stop();var _e94=u&&(T||N)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&function(t,e){var i=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(i)!=e.$anchor.start(i);}(r.selection,t.selection);if(u){var _i76=N?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ie(this)),!n&&this.docView.update(t.doc,h,o,this)||(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=pt(t.doc,h,o,this.dom,this)),!_i76||this.trackWrites&&this.dom.contains(this.trackWrites)||(_e94=!0);}var _i77=this.input.mouseDown;_e94||!(_i77&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){var e=t.docView.domFromPos(t.state.selection.anchor,0),i=t.domSelectionRange();return p(e.node,e.offset,i.anchorNode,i.anchorOffset);}(this)&&_i77.delaySelUpdate())?Rt(this,_e94):(Ft(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start();}this.updatePluginViews(r),(null===(i=this.dragging)||void 0===i?void 0:i.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==f?this.dom.scrollTop=0:"to selection"==f?this.scrollToSelection():c&&function(_ref7){var t=_ref7.refDOM,e=_ref7.refTop,i=_ref7.stack;var r=t?t.getBoundingClientRect().top:0;z(i,0==r?0:r-e);}(c);}},{key:"scrollToSelection",value:function scrollToSelection(){var _this17=this;var e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode)){if(this.someProp("handleScrollToSelection",function(t){return t(_this17);}));else if(this.state.selection instanceof t){var _t98=this.docView.domAfterPos(this.state.selection.from);1==_t98.nodeType&&j(this,_t98.getBoundingClientRect(),e);}else j(this,this.coordsAtPos(this.state.selection.head,1),e);}else;}},{key:"destroyPluginViews",value:function destroyPluginViews(){var t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy();}},{key:"updatePluginViews",value:function updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var _e95=0;_e95<this.pluginViews.length;_e95++){var _i78=this.pluginViews[_e95];_i78.update&&_i78.update(this,t);}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var _t99=0;_t99<this.directPlugins.length;_t99++){var _e96=this.directPlugins[_t99];_e96.spec.view&&this.pluginViews.push(_e96.spec.view(this));}for(var _t100=0;_t100<this.state.plugins.length;_t100++){var _e97=this.state.plugins[_t100];_e97.spec.view&&this.pluginViews.push(_e97.spec.view(this));}}}},{key:"updateDraggedNode",value:function updateDraggedNode(e,i){var r=e.node,n=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)n=r.from;else{var _t101=r.from+(this.state.doc.content.size-i.doc.content.size);(_t101>0&&_t101<this.state.doc.content.size&&this.state.doc.nodeAt(_t101))==r.node&&(n=_t101);}this.dragging=new He(e.slice,e.move,n<0?void 0:t.create(this.state.doc,n));}},{key:"someProp",value:function someProp(t,e){var i,r=this._props&&this._props[t];if(null!=r&&(i=e?e(r):r))return i;for(var _r53=0;_r53<this.directPlugins.length;_r53++){var _n35=this.directPlugins[_r53].props[t];if(null!=_n35&&(i=e?e(_n35):_n35))return i;}var n=this.state.plugins;if(n)for(var _r54=0;_r54<n.length;_r54++){var _s32=n[_r54].props[t];if(null!=_s32&&(i=e?e(_s32):_s32))return i;}}},{key:"hasFocus",value:function hasFocus(){if(T){var _t102=this.root.activeElement;if(_t102==this.dom)return!0;if(!_t102||!this.dom.contains(_t102))return!1;for(;_t102&&this.dom!=_t102&&this.dom.contains(_t102);){if("false"==_t102.contentEditable)return!1;_t102=_t102.parentElement;}return!0;}return this.root.activeElement==this.dom;}},{key:"focus",value:function focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(G)return t.focus(G);var e=V(t);t.focus(null==G?{get preventScroll(){return G={preventScroll:!0},!0;}}:void 0),G||(G=!1,z(e,0));}(this.dom),Rt(this),this.domObserver.start();}},{key:"root",get:function get(){var _this18=this;var t=this._root;if(null==t){var _loop5=function _loop5(_t103){if(9==_t103.nodeType||11==_t103.nodeType&&_t103.host)return{v:(_t103.getSelection||(Object.getPrototypeOf(_t103).getSelection=function(){return _t103.ownerDocument.getSelection();}),_this18._root=_t103)};},_ret3;for(var _t103=this.dom.parentNode;_t103;_t103=_t103.parentNode){_ret3=_loop5(_t103);if(_ret3)return _ret3.v;}}return t||document;}},{key:"updateRoot",value:function updateRoot(){this._root=null;}},{key:"posAtCoords",value:function posAtCoords(t){return Q(this,t);}},{key:"coordsAtPos",value:function coordsAtPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return tt(this,t,e);}},{key:"domAtPos",value:function domAtPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.docView.domFromPos(t,e);}},{key:"nodeDOM",value:function nodeDOM(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null;}},{key:"posAtDOM",value:function posAtDOM(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var r=this.docView.posFromDOM(t,e,i);if(null==r)throw new RangeError("DOM position not inside the editor");return r;}},{key:"endOfTextblock",value:function endOfTextblock(t,e){return ht(this,e||this.state,t);}},{key:"pasteHTML",value:function pasteHTML(t,e){return Le(this,"",t,!1,e||new ClipboardEvent("paste"));}},{key:"pasteText",value:function pasteText(t,e){return Le(this,t,null,!0,e||new ClipboardEvent("paste"));}},{key:"serializeForClipboard",value:function serializeForClipboard(t){return ee(this,t);}},{key:"destroy",value:function destroy(){this.docView&&(!function(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(var _e98 in t.input.eventHandlers)t.dom.removeEventListener(_e98,t.input.eventHandlers[_e98]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout);}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],oi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,a=null);}},{key:"isDestroyed",get:function get(){return null==this.docView;}},{key:"dispatchEvent",value:function dispatchEvent(t){return function(t,e){we(t,e)||!ae[e.type]||!t.editable&&e.type in de||ae[e.type](t,e);}(this,t);}},{key:"domSelectionRange",value:function domSelectionRange(){var t=this.domSelection();return t?A&&11===this.root.nodeType&&function(t){var e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e;}(this.dom.ownerDocument)==this.dom&&function(t,e){if(e.getComposedRanges){var _i79=e.getComposedRanges(t.root)[0];if(_i79)return pi(t,_i79);}var i;function r(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0];}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),i?pi(t,i):null;}(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0};}},{key:"domSelection",value:function domSelection(){return this.root.getSelection();}}]);}());yi.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t));};}};});
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
System.register(["./index-89c520e9.cjs.js"],function(_export,_context){"use strict";var t,e,i,r,n,s,l,o,h,f,u,c,a,d,p,m,k,y,v,D,x,O,S,T,C,P,E,N,R,A,B,$,I,F,K,L,G,_,nt,st,lt,ot,ft,ut,ct,at,dt,mt,bt,gt,kt,Mt,Tt,At,re,fe,ce,ae,de,pe,me,Ce,Pe,Ee,Ne,Ae,Ke,He,We,_t67,ze,Ge,Ue,Je,Ye,Qe,Xe,Ze,_e,hi,fi,ui,ci,ai,di,bi,gi,yi;function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n36){function n(){return _n36.apply(this,arguments);}n.toString=function(){return _n36.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _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 _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 _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 b(t,e,i,r,n){for(var s;;){if(t==i&&e==r)return!0;if(e==(n<0?0:g(t))){var _i=t.parentNode;if(!_i||1!=_i.nodeType||w(t)||m.test(t.nodeName)||"false"==t.contentEditable)return!1;e=u(t)+(n<0?0:1),t=_i;}else{if(1!=t.nodeType)return!1;{var _i2=t.childNodes[e+(n<0?-1:0)];if(1==_i2.nodeType&&"false"==_i2.contentEditable){if(!(null===(s=_i2.pmViewDesc)||void 0===s?void 0:s.ignoreForSelection))return!1;e+=n;}else t=_i2,e=n<0?g(t):0;}}}}function g(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length;}function w(t){var e;for(var _i3=t;_i3&&!(e=_i3.pmViewDesc);_i3=_i3.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t);}function M(t,e){var i=document.createEvent("Event");return i.initEvent("keydown",!0,!0),i.keyCode=t,i.key=i.code=e,i;}function q(t){var e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight};}function H(t,e){return"number"==typeof t?t:t[e];}function W(t){var e=t.getBoundingClientRect(),i=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*i,top:e.top,bottom:e.top+t.clientHeight*r};}function j(t,e,i){if(!X(e)&&0==e.left)return;var r=t.someProp("scrollThreshold")||0,n=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(var _l=i||t.dom;_l;){if(1!=_l.nodeType){_l=c(_l);continue;}var _t2=_l,_i4=_t2==s.body,_o=_i4?q(s):W(_t2),_h=0,_f=0;if(e.top<_o.top+H(r,"top")?_f=-(_o.top-e.top+H(n,"top")):e.bottom>_o.bottom-H(r,"bottom")&&(_f=e.bottom-e.top>_o.bottom-_o.top?e.top+H(n,"top")-_o.top:e.bottom-_o.bottom+H(n,"bottom")),e.left<_o.left+H(r,"left")?_h=-(_o.left-e.left+H(n,"left")):e.right>_o.right-H(r,"right")&&(_h=e.right-_o.right+H(n,"right")),_h||_f)if(_i4)s.defaultView.scrollBy(_h,_f);else{var _i5=_t2.scrollLeft,_r=_t2.scrollTop;_f&&(_t2.scrollTop+=_f),_h&&(_t2.scrollLeft+=_h);var _n=_t2.scrollLeft-_i5,_s=_t2.scrollTop-_r;e={left:e.left-_n,top:e.top-_s,right:e.right-_n,bottom:e.bottom-_s};}var _u=_i4?"fixed":getComputedStyle(_l).position;if(/^(fixed|sticky)$/.test(_u))break;_l="absolute"==_u?_l.offsetParent:c(_l);}}function V(t){var e=[],i=t.ownerDocument;for(var _r2=t;_r2&&(e.push({dom:_r2,top:_r2.scrollTop,left:_r2.scrollLeft}),t!=i);_r2=c(_r2));return e;}function z(t,e){for(var _i6=0;_i6<t.length;_i6++){var _t$_i=t[_i6],_r3=_t$_i.dom,_n2=_t$_i.top,_s2=_t$_i.left;_r3.scrollTop!=_n2+e&&(_r3.scrollTop=_n2+e),_r3.scrollLeft!=_s2&&(_r3.scrollLeft=_s2);}}function U(t,e){var i,r,n,s,l=2e8,o=0,h=e.top,f=e.top;for(var _u2=t.firstChild,_c=0;_u2;_u2=_u2.nextSibling,_c++){var _t3=void 0;if(1==_u2.nodeType)_t3=_u2.getClientRects();else{if(3!=_u2.nodeType)continue;_t3=d(_u2).getClientRects();}for(var _a=0;_a<_t3.length;_a++){var _d=_t3[_a];if(_d.top<=h&&_d.bottom>=f){h=Math.max(_d.bottom,h),f=Math.min(_d.top,f);var _t4=_d.left>e.left?_d.left-e.left:_d.right<e.left?e.left-_d.right:0;if(_t4<l){i=_u2,l=_t4,r=_t4&&3==i.nodeType?{left:_d.right<e.left?_d.right:_d.left,top:e.top}:e,1==_u2.nodeType&&_t4&&(o=_c+(e.left>=(_d.left+_d.right)/2?1:0));continue;}}else _d.top>e.top&&!n&&_d.left<=e.left&&_d.right>=e.left&&(n=_u2,s={left:Math.max(_d.left,Math.min(_d.right,e.left)),top:_d.top});!i&&(e.left>=_d.right&&e.top>=_d.top||e.left>=_d.left&&e.top>=_d.bottom)&&(o=_c+1);}}return!i&&n&&(i=n,r=s,l=0),i&&3==i.nodeType?function(t,e){var i,r=t.nodeValue.length,n=document.createRange();for(var _s3=0;_s3<r;_s3++){n.setEnd(t,_s3+1),n.setStart(t,_s3);var _r4=Z(n,1);if(_r4.top!=_r4.bottom&&J(e,_r4)){i={node:t,offset:_s3+(e.left>=(_r4.left+_r4.right)/2?1:0)};break;}}return n.detach(),i||{node:t,offset:0};}(i,r):!i||l&&1==i.nodeType?{node:t,offset:o}:U(i,r);}function J(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1;}function Y(t,e,i){var r=t.childNodes.length;if(r&&i.top<i.bottom)for(var _n3=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-i.top)/(i.bottom-i.top))-2)),_s4=_n3;;){var _i7=t.childNodes[_s4];if(1==_i7.nodeType){var _t5=_i7.getClientRects();for(var _r5=0;_r5<_t5.length;_r5++){var _n4=_t5[_r5];if(J(e,_n4))return Y(_i7,e,_n4);}}if((_s4=(_s4+1)%r)==_n3)break;}return t;}function Q(t,e){var _s5;var i,r=t.dom.ownerDocument,n=0,s=function(t,e,i){if(t.caretPositionFromPoint)try{var _r6=t.caretPositionFromPoint(e,i);if(_r6)return{node:_r6.offsetNode,offset:Math.min(g(_r6.offsetNode),_r6.offset)};}catch(t){}if(t.caretRangeFromPoint){var _r7=t.caretRangeFromPoint(e,i);if(_r7)return{node:_r7.startContainer,offset:Math.min(g(_r7.startContainer),_r7.startOffset)};}}(r,e.left,e.top);s&&(_s5=s,i=_s5.node,n=_s5.offset,_s5);var l,o=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!o||!t.dom.contains(1!=o.nodeType?o.parentNode:o)){var _i8=t.dom.getBoundingClientRect();if(!J(e,_i8))return null;if(o=Y(t.dom,e,_i8),!o)return null;}if(A)for(var _t6=o;i&&_t6;_t6=c(_t6))_t6.draggable&&(i=void 0);if(o=function(t,e){var i=t.parentNode;return i&&/^li$/i.test(i.nodeName)&&e.left<t.getBoundingClientRect().left?i:t;}(o,e),i){if(P&&1==i.nodeType&&(n=Math.min(n,i.childNodes.length),n<i.childNodes.length)){var _t7,_r8=i.childNodes[n];"IMG"==_r8.nodeName&&(_t7=_r8.getBoundingClientRect()).right<=e.left&&_t7.bottom>e.top&&n++;}var _r9;K&&n&&1==i.nodeType&&1==(_r9=i.childNodes[n-1]).nodeType&&"false"==_r9.contentEditable&&_r9.getBoundingClientRect().top>=e.top&&n--,i==t.dom&&n==i.childNodes.length-1&&1==i.lastChild.nodeType&&e.top>i.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:0!=n&&1==i.nodeType&&"BR"==i.childNodes[n-1].nodeName||(l=function(t,e,i,r){var n=-1;for(var _i9=e,_s6=!1;_i9!=t.dom;){var _e2=void 0,_l2=t.docView.nearestDesc(_i9,!0);if(!_l2)return null;if(1==_l2.dom.nodeType&&(_l2.node.isBlock&&_l2.parent||!_l2.contentDOM)&&((_e2=_l2.dom.getBoundingClientRect()).width||_e2.height)&&(_l2.node.isBlock&&_l2.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(_l2.dom.nodeName)&&(!_s6&&_e2.left>r.left||_e2.top>r.top?n=_l2.posBefore:(!_s6&&_e2.right<r.left||_e2.bottom<r.top)&&(n=_l2.posAfter),_s6=!0),!_l2.contentDOM&&n<0&&!_l2.node.isText))return(_l2.node.isBlock?r.top<(_e2.top+_e2.bottom)/2:r.left<(_e2.left+_e2.right)/2)?_l2.posBefore:_l2.posAfter;_i9=_l2.dom.parentNode;}return n>-1?n:t.docView.posFromDOM(e,i,-1);}(t,i,n,e));}null==l&&(l=function(t,e,i){var _U=U(e,i),r=_U.node,n=_U.offset,s=-1;if(1==r.nodeType&&!r.firstChild){var _t8=r.getBoundingClientRect();s=_t8.left!=_t8.right&&i.left>(_t8.left+_t8.right)/2?1:-1;}return t.docView.posFromDOM(r,n,s);}(t,o,e));var h=t.docView.nearestDesc(o,!0);return{pos:l,inside:h?h.posAtStart-h.border:-1};}function X(t){return t.top<t.bottom||t.left<t.right;}function Z(t,e){var i=t.getClientRects();if(i.length){var _t9=i[e<0?0:i.length-1];if(X(_t9))return _t9;}return Array.prototype.find.call(i,X)||t.getBoundingClientRect();}function tt(t,e,i){var _t$docView$domFromPos=t.docView.domFromPos(e,i<0?-1:1),r=_t$docView$domFromPos.node,n=_t$docView$domFromPos.offset,s=_t$docView$domFromPos.atom,l=K||P;if(3==r.nodeType){if(!l||!_.test(r.nodeValue)&&(i<0?n:n!=r.nodeValue.length)){var _t10=n,_e3=n,_s7=i<0?1:-1;return i<0&&!n?(_e3++,_s7=-1):i>=0&&n==r.nodeValue.length?(_t10--,_s7=1):i<0?_t10--:_e3++,et(Z(d(r,_t10,_e3),_s7),_s7<0);}{var _t11=Z(d(r,n,n),i);if(P&&n&&/\s/.test(r.nodeValue[n-1])&&n<r.nodeValue.length){var _e4=Z(d(r,n-1,n-1),-1);if(_e4.top==_t11.top){var _i10=Z(d(r,n,n+1),-1);if(_i10.top!=_t11.top)return et(_i10,_i10.left<_e4.left);}}return _t11;}}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(null==s&&n&&(i<0||n==g(r))){var _t12=r.childNodes[n-1];if(1==_t12.nodeType)return it(_t12.getBoundingClientRect(),!1);}if(null==s&&n<g(r)){var _t13=r.childNodes[n];if(1==_t13.nodeType)return it(_t13.getBoundingClientRect(),!0);}return it(r.getBoundingClientRect(),i>=0);}if(null==s&&n&&(i<0||n==g(r))){var _t14=r.childNodes[n-1],_e5=3==_t14.nodeType?d(_t14,g(_t14)-(l?0:1)):1!=_t14.nodeType||"BR"==_t14.nodeName&&_t14.nextSibling?null:_t14;if(_e5)return et(Z(_e5,1),!1);}if(null==s&&n<g(r)){var _t15=r.childNodes[n];for(;_t15.pmViewDesc&&_t15.pmViewDesc.ignoreForCoords;)_t15=_t15.nextSibling;var _e6=_t15?3==_t15.nodeType?d(_t15,0,l?0:1):1==_t15.nodeType?_t15:null:null;if(_e6)return et(Z(_e6,-1),!0);}return et(Z(3==r.nodeType?d(r):r,-i),i>=0);}function et(t,e){if(0==t.width)return t;var i=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:i,right:i};}function it(t,e){if(0==t.height)return t;var i=e?t.top:t.bottom;return{top:i,bottom:i,left:t.left,right:t.right};}function rt(t,e,i){var r=t.state,n=t.root.activeElement;r!=e&&t.updateState(e),n!=t.dom&&t.focus();try{return i();}finally{r!=e&&t.updateState(r),n!=t.dom&&n&&n.focus();}}function ht(t,e,i){return st==e&<==i?ot:(st=e,lt=i,ot="up"==i||"down"==i?function(t,e,i){var r=e.selection,n="up"==i?r.$from:r.$to;return rt(t,e,function(){var _t$docView$domFromPos2=t.docView.domFromPos(n.pos,"up"==i?-1:1),e=_t$docView$domFromPos2.node;for(;;){var _i11=t.docView.nearestDesc(e,!0);if(!_i11)break;if(_i11.node.isBlock){e=_i11.contentDOM||_i11.dom;break;}e=_i11.dom.parentNode;}var r=tt(t,n.pos,1);for(var _t16=e.firstChild;_t16;_t16=_t16.nextSibling){var _e7=void 0;if(1==_t16.nodeType)_e7=_t16.getClientRects();else{if(3!=_t16.nodeType)continue;_e7=d(_t16,0,_t16.nodeValue.length).getClientRects();}for(var _t17=0;_t17<_e7.length;_t17++){var _n5=_e7[_t17];if(_n5.bottom>_n5.top+1&&("up"==i?r.top-_n5.top>2*(_n5.bottom-r.top):_n5.bottom-r.bottom>2*(r.bottom-_n5.top)))return!1;}}return!0;});}(t,e,i):function(t,e,i){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var n=r.parentOffset,s=!n,l=n==r.parent.content.size,o=t.domSelection();return o?nt.test(r.parent.textContent)&&o.modify?rt(t,e,function(){var _t$domSelectionRange=t.domSelectionRange(),e=_t$domSelectionRange.focusNode,n=_t$domSelectionRange.focusOffset,s=_t$domSelectionRange.anchorNode,l=_t$domSelectionRange.anchorOffset,h=o.caretBidiLevel;o.modify("move",i,"character");var f=r.depth?t.docView.domAfterPos(r.before()):t.dom,_t$domSelectionRange2=t.domSelectionRange(),u=_t$domSelectionRange2.focusNode,c=_t$domSelectionRange2.focusOffset,a=u&&!f.contains(1==u.nodeType?u:u.parentNode)||e==u&&n==c;try{o.collapse(s,l),e&&(e!=s||n!=l)&&o.extend&&o.extend(e,n);}catch(t){}return null!=h&&(o.caretBidiLevel=h),a;}):"left"==i||"backward"==i?s:l:r.pos==r.start()||r.pos==r.end();}(t,e,i));}function pt(t,e,i,r,n){xt(r,e,t);var s=new dt(void 0,t,e,i,r,r,r);return s.contentDOM&&s.updateChildren(n,0),s;}function wt(t,e,i){var r=t.firstChild,n=!1;for(var _s13=0;_s13<e.length;_s13++){var _l9=e[_s13],_o5=_l9.dom;if(_o5.parentNode==t){for(;_o5!=r;)r=St(r),n=!0;r=r.nextSibling;}else n=!0,t.insertBefore(_o5,r);if(_l9 instanceof at){var _e24=r?r.previousSibling:t.lastChild;wt(_l9.contentDOM,_l9.children,i),r=_e24?_e24.nextSibling:t.firstChild;}}for(;r;)r=St(r),n=!0;n&&i.trackWrites==t&&(i.trackWrites=null);}function yt(t,e,i){if(0==t.length)return Mt;var r=i?Mt[0]:new kt(),n=[r];for(var _s14=0;_s14<t.length;_s14++){var _l10=t[_s14].type.attrs;if(_l10){_l10.nodeName&&n.push(r=new kt(_l10.nodeName));for(var _t40 in _l10){var _s15=_l10[_t40];null!=_s15&&(i&&1==n.length&&n.push(r=new kt(e.isInline?"span":"div")),"class"==_t40?r["class"]=(r["class"]?r["class"]+" ":"")+_s15:"style"==_t40?r.style=(r.style?r.style+";":"")+_s15:"nodeName"!=_t40&&(r[_t40]=_s15));}}}return n;}function vt(t,e,i,r){if(i==Mt&&r==Mt)return e;var n=e;for(var _e25=0;_e25<r.length;_e25++){var _s16=r[_e25],_l11=i[_e25];if(_e25){var _e26=void 0;_l11&&_l11.nodeName==_s16.nodeName&&n!=t&&(_e26=n.parentNode)&&_e26.nodeName.toLowerCase()==_s16.nodeName||(_e26=document.createElement(_s16.nodeName),_e26.pmIsDeco=!0,_e26.appendChild(n),_l11=Mt[0]),n=_e26;}Dt(n,_l11||Mt[0],_s16);}return n;}function Dt(t,e,i){for(var _r20 in e)"class"==_r20||"style"==_r20||"nodeName"==_r20||_r20 in i||t.removeAttribute(_r20);for(var _r21 in i)"class"!=_r21&&"style"!=_r21&&"nodeName"!=_r21&&i[_r21]!=e[_r21]&&t.setAttribute(_r21,i[_r21]);if(e["class"]!=i["class"]){var _r22=e["class"]?e["class"].split(" ").filter(Boolean):[],_n14=i["class"]?i["class"].split(" ").filter(Boolean):[];for(var _e27=0;_e27<_r22.length;_e27++)-1==_n14.indexOf(_r22[_e27])&&t.classList.remove(_r22[_e27]);for(var _e28=0;_e28<_n14.length;_e28++)-1==_r22.indexOf(_n14[_e28])&&t.classList.add(_n14[_e28]);0==t.classList.length&&t.removeAttribute("class");}if(e.style!=i.style){if(e.style){var _i28,_r23=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;_i28=_r23.exec(e.style);)t.style.removeProperty(_i28[1]);}i.style&&(t.style.cssText+=i.style);}}function xt(t,e,i){return vt(t,t,Mt,yt(e,i,1!=t.nodeType));}function Ot(t,e){if(t.length!=e.length)return!1;for(var _i29=0;_i29<t.length;_i29++)if(!t[_i29].type.eq(e[_i29].type))return!1;return!0;}function St(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e;}function Ct(t,e){return t.type.side-e.type.side;}function Pt(t,e,i,r,n){var s=[];for(var _l14=0,_o8=0;_l14<t.length;_l14++){var _h6=t[_l14],_f5=_o8,_u5=_o8+=_h6.size;_f5>=i||_u5<=e?s.push(_h6):(_f5<e&&s.push(_h6.slice(0,e-_f5,r)),n&&(s.push(n),n=void 0),_u5>i&&s.push(_h6.slice(i-_f5,_h6.size,r)));}return s;}function Et(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;var s=e.docView.nearestDesc(r.focusNode),l=s&&0==s.size,o=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(o<0)return null;var h,f,c=n.resolve(o);if(k(r)){for(h=o;s&&!s.node;)s=s.parent;var _e33=s.node;if(s&&_e33.isAtom&&t.isSelectable(_e33)&&s.parent&&(!_e33.isInline||!function(t,e,i){for(var _r28=0==e,_n18=e==g(t);_r28||_n18;){if(t==i)return!0;var _e34=u(t);if(!(t=t.parentNode))return!1;_r28=_r28&&0==_e34,_n18=_n18&&_e34==g(t);}}(r.focusNode,r.focusOffset,s.dom))){var _e35=s.posBefore;f=new t(o==_e35?c:n.resolve(_e35));}}else{if(r instanceof e.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){var _ref2,_ref3;var _t44=o,_i33=o;for(var _n19=0;_n19<r.rangeCount;_n19++){var _s17=r.getRangeAt(_n19);_t44=Math.min(_t44,e.docView.posFromDOM(_s17.startContainer,_s17.startOffset,1)),_i33=Math.max(_i33,e.docView.posFromDOM(_s17.endContainer,_s17.endOffset,-1));}if(_t44<0)return null;_ref2=_i33==e.state.selection.anchor?[_i33,_t44]:[_t44,_i33],_ref3=_slicedToArray(_ref2,2),h=_ref3[0],o=_ref3[1],c=n.resolve(o);}else h=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(h<0)return null;}var a=n.resolve(h);if(!f){f=Lt(e,a,c,"pointer"==i||e.state.selection.head<c.pos&&!l?1:-1);}return f;}function Nt(t){return t.editable?t.hasFocus():Ht(t)&&document.activeElement&&document.activeElement.contains(t.dom);}function Rt(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var r=t.state.selection;if(Ft(t,r),!Nt(t))return;var n=t.input.mouseDown;if(!i&&N&&n){var _e36=t.domSelectionRange(),_i34=t.domObserver.currentSelection;if(_e36.anchorNode&&_i34.anchorNode&&p(_e36.anchorNode,_e36.anchorOffset,_i34.anchorNode,_i34.anchorOffset)&&n.delaySelUpdate())return void t.domObserver.setCurSelection();}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.domSelection();if(!e)return;var i=t.cursorWrapper.dom,r="IMG"==i.nodeName;r?e.collapse(i.parentNode,u(i)+1):e.collapse(i,0);!r&&!t.state.selection.visible&&T&&C<=11&&(i.disabled=!0,i.disabled=!1);}(t);else{var _n20,_s18,_l15=r.anchor,_o9=r.head;!At||r instanceof e||(r.$from.parent.inlineContent||(_n20=Bt(t,r.from)),r.empty||r.$from.parent.inlineContent||(_s18=Bt(t,r.to))),t.docView.setSelection(_l15,_o9,t,i),At&&(_n20&&It(_n20),_s18&&It(_s18)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);var i=t.domSelectionRange(),r=i.anchorNode,n=i.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=function(){i.anchorNode==r&&i.anchorOffset==n||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(function(){Nt(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection");},20));});}(t));}t.domObserver.setCurSelection(),t.domObserver.connectSelection();}function Bt(t,e){var _t$docView$domFromPos3=t.docView.domFromPos(e,0),i=_t$docView$domFromPos3.node,r=_t$docView$domFromPos3.offset,n=r<i.childNodes.length?i.childNodes[r]:null,s=r?i.childNodes[r-1]:null;if(A&&n&&"false"==n.contentEditable)return $t(n);if(!(n&&"false"!=n.contentEditable||s&&"false"!=s.contentEditable)){if(n)return $t(n);if(s)return $t(s);}}function $t(t){return t.contentEditable="true",A&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t;}function It(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null);}function Ft(e,i){if(i instanceof t){var _t45=e.docView.descAt(i.from);_t45!=e.lastSelectedViewDesc&&(Kt(e),_t45&&_t45.selectNode(),e.lastSelectedViewDesc=_t45);}else Kt(e);}function Kt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0);}function Lt(t,i,r,n){return t.someProp("createSelectionBetween",function(e){return e(t,i,r);})||e.between(i,r,n);}function qt(t){return!(t.editable&&!t.hasFocus())&&Ht(t);}function Ht(t){var e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode));}catch(t){return!1;}}function Wt(t,e){var _t$selection=t.selection,i=_t$selection.$anchor,n=_t$selection.$head,s=e>0?i.max(n):i.min(n),l=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return l&&r.findFrom(l,e);}function jt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0;}function Vt(i,r,n){var s=i.state.selection;if(!(s instanceof e)){if(s instanceof t&&s.node.isInline)return jt(i,new e(r>0?s.$to:s.$from));{var _t46=Wt(i.state,r);return!!_t46&&jt(i,_t46);}}if(n.indexOf("s")>-1){var _t47=s.$head,_n21=_t47.textOffset?null:r<0?_t47.nodeBefore:_t47.nodeAfter;if(!_n21||_n21.isText||!_n21.isLeaf)return!1;var _l16=i.state.doc.resolve(_t47.pos+_n21.nodeSize*(r<0?-1:1));return jt(i,new e(s.$anchor,_l16));}if(!s.empty)return!1;if(i.endOfTextblock(r>0?"forward":"backward")){var _e37=Wt(i.state,r);return!!(_e37&&_e37 instanceof t)&&jt(i,_e37);}if(!($&&n.indexOf("m")>-1)){var _n22,_l17=s.$head,_o10=_l17.textOffset?null:r<0?_l17.nodeBefore:_l17.nodeAfter;if(!_o10||_o10.isText)return!1;var _h7=r<0?_l17.pos-_o10.nodeSize:_l17.pos;return!!(_o10.isAtom||(_n22=i.docView.descAt(_h7))&&!_n22.contentDOM)&&(t.isSelectable(_o10)?jt(i,new t(r<0?i.state.doc.resolve(_l17.pos-_o10.nodeSize):_l17)):!!K&&jt(i,new e(i.state.doc.resolve(r<0?_h7:_h7+_o10.nodeSize))));}}function zt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length;}function Gt(t,e){var i=t.pmViewDesc;return i&&0==i.size&&(e<0||t.nextSibling||"BR"!=t.nodeName);}function Ut(t,e){return e<0?function(t){var e=t.domSelectionRange(),i=e.focusNode,r=e.focusOffset;if(!i)return;var n,s,l=!1;P&&1==i.nodeType&&r<zt(i)&&Gt(i.childNodes[r],-1)&&(l=!0);for(;;)if(r>0){if(1!=i.nodeType)break;{var _t48=i.childNodes[r-1];if(Gt(_t48,-1))n=i,s=--r;else{if(3!=_t48.nodeType)break;i=_t48,r=i.nodeValue.length;}}}else{if(Jt(i))break;{var _e38=i.previousSibling;for(;_e38&&Gt(_e38,-1);)n=i.parentNode,s=u(_e38),_e38=_e38.previousSibling;if(_e38)i=_e38,r=zt(i);else{if(i=i.parentNode,i==t.dom)break;r=0;}}}l?Yt(t,i,r):n&&Yt(t,n,s);}(t):function(t){var e=t.domSelectionRange(),i=e.focusNode,r=e.focusOffset;if(!i)return;var n,s,l=zt(i);for(;;)if(r<l){if(1!=i.nodeType)break;if(!Gt(i.childNodes[r],1))break;n=i,s=++r;}else{if(Jt(i))break;{var _e39=i.nextSibling;for(;_e39&&Gt(_e39,1);)n=_e39.parentNode,s=u(_e39)+1,_e39=_e39.nextSibling;if(_e39)i=_e39,r=0,l=zt(i);else{if(i=i.parentNode,i==t.dom)break;r=l=0;}}}n&&Yt(t,n,s);}(t);}function Jt(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock;}function Yt(t,e,i){if(3!=e.nodeType){var _t49,_r29;(_r29=function(t,e){for(;t&&e==t.childNodes.length&&!w(t);)e=u(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){var _i35=t.childNodes[e];if(3==_i35.nodeType)return _i35;if(1==_i35.nodeType&&"false"==_i35.contentEditable)break;t=_i35,e=0;}}(e,i))?(e=_r29,i=0):(_t49=function(t,e){for(;t&&!e&&!w(t);)e=u(t),t=t.parentNode;for(;t&&e;){var _i36=t.childNodes[e-1];if(3==_i36.nodeType)return _i36;if(1==_i36.nodeType&&"false"==_i36.contentEditable)break;e=(t=_i36).childNodes.length;}}(e,i))&&(e=_t49,i=_t49.nodeValue.length);}var r=t.domSelection();if(!r)return;if(k(r)){var _t50=document.createRange();_t50.setEnd(e,i),_t50.setStart(e,i),r.removeAllRanges(),r.addRange(_t50);}else r.extend&&r.extend(e,i);t.domObserver.setCurSelection();var n=t.state;setTimeout(function(){t.state==n&&Rt(t);},50);}function Qt(t,e){var i=t.state.doc.resolve(e);if(!N&&!I&&i.parent.inlineContent){var _r30=t.coordsAtPos(e);if(e>i.start()){var _i37=t.coordsAtPos(e-1),_n23=(_i37.top+_i37.bottom)/2;if(_n23>_r30.top&&_n23<_r30.bottom&&Math.abs(_i37.left-_r30.left)>1)return _i37.left<_r30.left?"ltr":"rtl";}if(e<i.end()){var _i38=t.coordsAtPos(e+1),_n24=(_i38.top+_i38.bottom)/2;if(_n24>_r30.top&&_n24<_r30.bottom&&Math.abs(_i38.left-_r30.left)>1)return _i38.left>_r30.left?"ltr":"rtl";}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr";}function Xt(i,n,s){var l=i.state.selection;if(l instanceof e&&!l.empty||s.indexOf("s")>-1)return!1;if($&&s.indexOf("m")>-1)return!1;var o=l.$from,h=l.$to;if(!o.parent.inlineContent||i.endOfTextblock(n<0?"up":"down")){var _e40=Wt(i.state,n);if(_e40&&_e40 instanceof t)return jt(i,_e40);}if(!o.parent.inlineContent){var _t51=n<0?o:h,_e41=l instanceof f?r.near(_t51,n):r.findFrom(_t51,n);return!!_e41&&jt(i,_e41);}return!1;}function Zt(t,i){if(!(t.state.selection instanceof e))return!0;var _t$state$selection2=t.state.selection,r=_t$state$selection2.$head,n=_t$state$selection2.$anchor,s=_t$state$selection2.empty;if(!r.sameParent(n))return!0;if(!s)return!1;if(t.endOfTextblock(i>0?"forward":"backward"))return!0;var l=!r.textOffset&&(i<0?r.nodeBefore:r.nodeAfter);if(l&&!l.isText){var _e42=t.state.tr;return i<0?_e42["delete"](r.pos-l.nodeSize,r.pos):_e42["delete"](r.pos,r.pos+l.nodeSize),t.dispatch(_e42),!0;}return!1;}function _t(t,e,i){t.domObserver.stop(),e.contentEditable=i,t.domObserver.start();}function te(t,e){var i=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e;}(e);if(8==i||$&&72==i&&"c"==r)return Zt(t,-1)||Ut(t,-1);if(46==i&&!e.shiftKey||$&&68==i&&"c"==r)return Zt(t,1)||Ut(t,1);if(13==i||27==i)return!0;if(37==i||$&&66==i&&"c"==r){var _e43=37==i?"ltr"==Qt(t,t.state.selection.from)?-1:1:-1;return Vt(t,_e43,r)||Ut(t,_e43);}if(39==i||$&&70==i&&"c"==r){var _e44=39==i?"ltr"==Qt(t,t.state.selection.from)?1:-1:1;return Vt(t,_e44,r)||Ut(t,_e44);}return 38==i||$&&80==i&&"c"==r?Xt(t,-1,r)||Ut(t,-1):40==i||$&&78==i&&"c"==r?function(t){if(!A||t.state.selection.$head.parentOffset>0)return!1;var _t$domSelectionRange3=t.domSelectionRange(),e=_t$domSelectionRange3.focusNode,i=_t$domSelectionRange3.focusOffset;if(e&&1==e.nodeType&&0==i&&e.firstChild&&"false"==e.firstChild.contentEditable){var _i39=e.firstChild;_t(t,_i39,"true"),setTimeout(function(){return _t(t,_i39,"false");},20);}return!1;}(t)||Xt(t,1,r)||Ut(t,1):r==($?"m":"c")&&(66==i||73==i||89==i||90==i);}function ee(t,e){t.someProp("transformCopied",function(i){e=i(e,t);});var r=[],_e45=e,n=_e45.content,s=_e45.openStart,l=_e45.openEnd;for(;s>1&&l>1&&1==n.childCount&&1==n.firstChild.childCount;){s--,l--;var _t52=n.firstChild;r.push(_t52.type.name,_t52.attrs!=_t52.type.defaultAttrs?_t52.attrs:null),n=_t52.content;}var o=t.someProp("clipboardSerializer")||i.fromSchema(t.state.schema),h=ue(),f=h.createElement("div");f.appendChild(o.serializeFragment(n,{document:h}));var u,c=f.firstChild,a=0;for(;c&&1==c.nodeType&&(u=fe[c.nodeName.toLowerCase()]);){for(var _t53=u.length-1;_t53>=0;_t53--){var _e46=h.createElement(u[_t53]);for(;f.firstChild;)_e46.appendChild(f.firstChild);f.appendChild(_e46),a++;}c=f.firstChild;}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice","".concat(s," ").concat(l).concat(a?" -".concat(a):""," ").concat(JSON.stringify(r))),{dom:f,text:t.someProp("clipboardTextSerializer",function(i){return i(e,t);})||e.content.textBetween(0,e.content.size,"\n\n"),slice:e};}function ie(t,e,r,s,h){var f,u,c=h.parent.type.spec.code;if(!r&&!e)return null;var a=!!e&&(s||c||!r);if(a){if(t.someProp("transformPastedText",function(i){e=i(e,c||s,t);}),c)return u=new n(l.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0),t.someProp("transformPasted",function(e){u=e(u,t,!0);}),u;var _r31=t.someProp("clipboardTextParser",function(i){return i(e,h,s,t);});if(_r31)u=_r31;else{var _r32=h.marks(),_n25=t.state.schema,_s19=i.fromSchema(_n25);f=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(function(t){var e=f.appendChild(document.createElement("p"));t&&e.appendChild(_s19.serializeNode(_n25.text(t,_r32)));});}}else t.someProp("transformPastedHTML",function(e){r=e(r,t);}),f=function(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var i,r=ue(),n=r.body,s=/<([a-z][^>\s]+)/i.exec(t);(i=s&&fe[s[1].toLowerCase()])&&(t=i.map(function(t){return"<"+t+">";}).join("")+t+i.map(function(t){return"</"+t+">";}).reverse().join(""));if(n.innerHTML=function(t){var e=window.trustedTypes;if(!e)return t;ce||(ce=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:function createHTML(t){return t;}}));return ce.createHTML(t);}(t),i)for(var _t54=0;_t54<i.length;_t54++)n=n.querySelector(i[_t54])||n;for(var _t55=0;_t55<r.styleSheets.length;_t55++){var _e47=r.styleSheets[_t55];for(var _t56=0;_t56<_e47.rules.length;_t56++){var _i40=_e47.rules[_t56];if(_i40 instanceof CSSStyleRule){var _t57=n.querySelectorAll(_i40.selectorText);for(var _e48=0;_e48<_t57.length;_e48++)_t57[_e48].style.cssText+=_i40.style.cssText;}}}return n;}(r),K&&function(t){var e=t.querySelectorAll(N?"span:not([class]):not([style])":"span.Apple-converted-space");for(var _i41=0;_i41<e.length;_i41++){var _r33=e[_i41];1==_r33.childNodes.length&&" "==_r33.textContent&&_r33.parentNode&&_r33.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),_r33);}}(f);var d=f&&f.querySelector("[data-pm-slice]"),p=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(p&&p[3])for(var _t58=+p[3];_t58>0;_t58--){var _t59=f.firstChild;for(;_t59&&1!=_t59.nodeType;)_t59=_t59.nextSibling;if(!_t59)break;f=_t59;}if(!u){var _e49=t.someProp("clipboardParser")||t.someProp("domParser")||o.fromSchema(t.state.schema);u=_e49.parseSlice(f,{preserveWhitespace:!(!a&&!p),context:h,ruleFromNode:function ruleFromNode(t){return"BR"!=t.nodeName||t.nextSibling||!t.parentNode||re.test(t.parentNode.nodeName)?null:{ignore:!0};}});}if(p)u=function(t,e){if(!t.size)return t;var i,r=t.content.firstChild.type.schema;try{i=JSON.parse(e);}catch(e){return t;}var s=t.content,o=t.openStart,h=t.openEnd;for(var _t60=i.length-2;_t60>=0;_t60-=2){var _e50=r.nodes[i[_t60]];if(!_e50||_e50.hasRequiredAttrs())break;s=l.from(_e50.create(i[_t60+1],s)),o++,h++;}return new n(s,o,h);}(he(u,+p[1],+p[2]),p[4]);else if(u=n.maxOpen(function(t,e){if(t.childCount<2)return t;var _loop=function _loop(){var r,n=e.node(_i42).contentMatchAt(e.index(_i42)),s=[];if(t.forEach(function(t){if(!s)return;var e,i=n.findWrapping(t.type);if(!i)return s=null;if(e=s.length&&r.length&&se(i,r,t,s[s.length-1],0))s[s.length-1]=e;else{s.length&&(s[s.length-1]=le(s[s.length-1],r.length));var _e51=ne(t,i);s.push(_e51),n=n.matchType(_e51.type),r=i;}}),s)return{v:l.from(s)};},_ret;for(var _i42=e.depth;_i42>=0;_i42--){_ret=_loop();if(_ret)return _ret.v;}return t;}(u.content,h),!0),u.openStart||u.openEnd){var _t61=0,_e52=0;for(var _e53=u.content.firstChild;_t61<u.openStart&&!_e53.type.spec.isolating;_t61++,_e53=_e53.firstChild);for(var _t62=u.content.lastChild;_e52<u.openEnd&&!_t62.type.spec.isolating;_e52++,_t62=_t62.lastChild);u=he(u,_t61,_e52);}return t.someProp("transformPasted",function(e){u=e(u,t,a);}),u;}function ne(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;for(var _r34=e.length-1;_r34>=i;_r34--)t=e[_r34].create(null,l.from(t));return t;}function se(t,e,i,r,n){if(n<t.length&&n<e.length&&t[n]==e[n]){var _s20=se(t,e,i,r.lastChild,n+1);if(_s20)return r.copy(r.content.replaceChild(r.childCount-1,_s20));if(r.contentMatchAt(r.childCount).matchType(n==t.length-1?i.type:t[n+1]))return r.copy(r.content.append(l.from(ne(i,t,n+1))));}}function le(t,e){if(0==e)return t;var i=t.content.replaceChild(t.childCount-1,le(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(l.empty,!0);return t.copy(i.append(r));}function oe(t,e,i,r,n,s){var o=e<0?t.firstChild:t.lastChild,h=o.content;return t.childCount>1&&(s=0),n<r-1&&(h=oe(h,e,i,r,n+1,s)),n>=i&&(h=e<0?o.contentMatchAt(0).fillBefore(h,s<=n).append(h):h.append(o.contentMatchAt(o.childCount).fillBefore(l.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(h));}function he(t,e,i){return e<t.openStart&&(t=new n(oe(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),i<t.openEnd&&(t=new n(oe(t.content,1,i,t.openEnd,0,0),t.openStart,i)),t;}function ue(){return document.implementation.createHTMLDocument("title");}function be(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now();}function ge(t){t.someProp("handleDOMEvents",function(e){for(var _i43 in e)t.input.eventHandlers[_i43]||t.dom.addEventListener(_i43,t.input.eventHandlers[_i43]=function(e){return we(t,e);});});}function we(t,e){return t.someProp("handleDOMEvents",function(i){var r=i[e.type];return!!r&&(r(t,e)||e.defaultPrevented);});}function ke(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var _i44=e.target;_i44!=t.dom;_i44=_i44.parentNode)if(!_i44||11==_i44.nodeType||_i44.pmViewDesc&&_i44.pmViewDesc.stopEvent(e))return!1;return!0;}function Me(t){return{left:t.clientX,top:t.clientY};}function ye(t,e,i,r,n){if(-1==r)return!1;var s=t.state.doc.resolve(r);var _loop2=function _loop2(_r35){if(t.someProp(e,function(e){return _r35>s.depth?e(t,i,s.nodeAfter,s.before(_r35),n,!0):e(t,i,s.node(_r35),s.before(_r35),n,!1);}))return{v:!0};},_ret2;for(var _r35=s.depth+1;_r35>0;_r35--){_ret2=_loop2(_r35);if(_ret2)return _ret2.v;}return!1;}function ve(t,e,i){if(t.focused||t.focus(),t.state.selection.eq(e))return;var r=t.state.tr.setSelection(e);"pointer"==i&&r.setMeta("pointer",!0),t.dispatch(r);}function De(e,i,r,n,s){return ye(e,"handleClickOn",i,r,n)||e.someProp("handleClick",function(t){return t(e,i,n);})||(s?function(e,i){if(-1==i)return!1;var r,n,s=e.state.selection;s instanceof t&&(r=s.node);var l=e.state.doc.resolve(i);for(var _e54=l.depth+1;_e54>0;_e54--){var _i45=_e54>l.depth?l.nodeAfter:l.node(_e54);if(t.isSelectable(_i45)){n=r&&s.$from.depth>0&&_e54>=s.$from.depth&&l.before(s.$from.depth+1)==s.$from.pos?l.before(s.$from.depth):l.before(_e54);break;}}return null!=n&&(ve(e,t.create(e.state.doc,n),"pointer"),!0);}(e,r):function(e,i){if(-1==i)return!1;var r=e.state.doc.resolve(i),n=r.nodeAfter;return!!(n&&n.isAtom&&t.isSelectable(n))&&(ve(e,new t(r),"pointer"),!0);}(e,r));}function xe(t,e,i,r){return ye(t,"handleDoubleClickOn",e,i,r)||t.someProp("handleDoubleClick",function(i){return i(t,e,r);});}function Oe(t,i,r,n){return ye(t,"handleTripleClickOn",i,r,n)||t.someProp("handleTripleClick",function(e){return e(t,i,n);})||function(t,i,r){if(0!=r.button)return!1;var n=Se(t,i,!0),s=t.state.doc;if(!n)return!1;ve(t,n,"pointer"),n instanceof e&&s.eq(t.state.doc)&&(t.input.mouseDown=new Ne(t,n));return!0;}(t,r,n);}function Se(i,r,n){var s=i.state.doc;if(-1==r)return s.inlineContent?e.create(s,0,s.content.size):null;var l=s.resolve(r);for(var _i46=l.depth+1;_i46>0;_i46--){var _r36=_i46>l.depth?l.nodeAfter:l.node(_i46),_o11=l.before(_i46);if(_r36.inlineContent)return e.create(s,_o11+1,_o11+1+_r36.content.size);if(n&&t.isSelectable(_r36))return t.create(s,_o11);}return null;}function Te(t){return Fe(t);}function Re(t,e){return!!t.composing||!!(A&&Math.abs(Date.now()-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0);}function Be(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(function(){return Fe(t);},e));}function $e(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty();}function Ie(t){var e=t.domSelectionRange();if(!e.focusNode)return null;var i=function(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;e=g(t=t.childNodes[e-1]);}else{if(!t.parentNode||w(t))return null;e=u(t),t=t.parentNode;}}}(e.focusNode,e.focusOffset),r=function(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0;}else{if(!t.parentNode||w(t))return null;e=u(t)+1,t=t.parentNode;}}}(e.focusNode,e.focusOffset);if(i&&r&&i!=r){var _e57=r.pmViewDesc,_n26=t.domObserver.lastChangedTextNode;if(i==_n26||r==_n26)return _n26;if(!_e57||!_e57.isText(r.nodeValue))return r;if(t.input.compositionNode==r){var _t64=i.pmViewDesc;if(_t64&&_t64.isText(i.nodeValue))return r;}}return i||r;}function Fe(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;if(!(F&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),$e(t),e||t.docView&&t.docView.dirty){var _i48=Et(t),_r37=t.state.selection;return _i48&&!_i48.eq(_r37)?t.dispatch(t.state.tr.setSelection(_i48)):!t.markCursor&&!e||_r37.$from.node(_r37.$from.sharedDepth(_r37.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0;}return!1;}}function Le(t,e,i,r,s){var l=ie(t,e,i,r,t.state.selection.$from);if(t.someProp("handlePaste",function(e){return e(t,s,l||n.empty);}))return!0;if(!l)return!1;var o=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null;}(l),h=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(l);return t.dispatch(h.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0;}function qe(t){var e=t.getData("text/plain")||t.getData("Text");if(e)return e;var i=t.getData("text/uri-list");return i?i.replace(/\r?\n/g," "):"";}function je(t,e){var i;return t.someProp("dragCopies",function(t){i=i||t(e);}),null!=i?!i:!e[We];}function Ve(t,e){if(t==e)return!0;for(var _i53 in t)if(t[_i53]!==e[_i53])return!1;for(var _i54 in e)if(!(_i54 in t))return!1;return!0;}function ti(t,e){if(!e||!t.length)return t;var i=[];for(var _r44=0;_r44<t.length;_r44++){var _n32=t[_r44];i.push(new Je(_n32.from+e,_n32.to+e,_n32.type));}return i;}function ei(t,e,i){if(e.isLeaf)return null;var r=i+e.nodeSize,n=null;for(var _e73,_s26=0;_s26<t.length;_s26++)(_e73=t[_s26])&&_e73.from>i&&_e73.to<r&&((n||(n=[])).push(_e73),t[_s26]=null);return n;}function ii(t){var e=[];for(var _i61=0;_i61<t.length;_i61++)null!=t[_i61]&&e.push(t[_i61]);return e;}function ri(t,e,i,r){var n=[],s=!1;e.forEach(function(e,l){var o=ei(t,e,l+i);if(o){s=!0;var _t77=ri(o,e,i+l+1,r);_t77!=Ze&&n.push(l,l+e.nodeSize,_t77);}});var l=ti(s?ii(t):t,-i).sort(ni);for(var _t78=0;_t78<l.length;_t78++)l[_t78].type.valid(e,l[_t78])||(r.onRemove&&r.onRemove(l[_t78].spec),l.splice(_t78--,1));return l.length||n.length?new Xe(l,n):Ze;}function ni(t,e){return t.from-e.from||t.to-e.to;}function si(t){var e=t;for(var _i62=0;_i62<e.length-1;_i62++){var _r45=e[_i62];if(_r45.from!=_r45.to)for(var _n33=_i62+1;_n33<e.length;_n33++){var _s27=e[_n33];if(_s27.from!=_r45.from){_s27.from<_r45.to&&(e==t&&(e=t.slice()),e[_i62]=_r45.copy(_r45.from,_s27.from),li(e,_n33,_r45.copy(_s27.from,_r45.to)));break;}_s27.to!=_r45.to&&(e==t&&(e=t.slice()),e[_n33]=_s27.copy(_s27.from,_r45.to),li(e,_n33+1,_s27.copy(_r45.to,_s27.to)));}}return e;}function li(t,e,i){for(;e<t.length&&ni(i,t[e])>0;)e++;t.splice(e,0,i);}function oi(t){var e=[];return t.someProp("decorations",function(i){var r=i(t.state);r&&r!=Ze&&e.push(r);}),t.cursorWrapper&&e.push(Xe.create(t.state.doc,[t.cursorWrapper.deco])),_e.from(e);}function pi(t,e){var _ref6;var i=e.startContainer,r=e.startOffset,n=e.endContainer,s=e.endOffset,l=t.domAtPos(t.state.selection.anchor);return p(l.node,l.offset,n,s)&&(_ref6=[n,s,i,r],i=_ref6[0],r=_ref6[1],n=_ref6[2],s=_ref6[3],_ref6),{anchorNode:i,anchorOffset:r,focusNode:n,focusOffset:s};}function mi(t,e){for(var _i69=e.parentNode;_i69&&_i69!=t.dom;_i69=_i69.parentNode){var _e82=t.docView.nearestDesc(_i69,!0);if(_e82&&_e82.node.isBlock)return _i69;}return null;}function wi(t,i,r,n,s){var h=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,i<0){var _e83=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,_i70=Et(t,_e83);if(_i70&&!t.state.selection.eq(_i70)){if(N&&F&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));}))return;var _r50=t.state.tr.setSelection(_i70);"pointer"==_e83?_r50.setMeta("pointer",!0):"key"==_e83&&_r50.scrollIntoView(),h&&_r50.setMeta("composition",h),t.dispatch(_r50);}return;}var f=t.state.doc.resolve(i),u=f.sharedDepth(r);i=f.before(u+1),r=t.state.doc.resolve(r).after(u+1);var c,a,d=t.state.selection,p=function(t,e,i,r){var n,_t$docView$parseRange=t.docView.parseRange(e,i),s=_t$docView$parseRange.node,l=_t$docView$parseRange.fromOffset,h=_t$docView$parseRange.toOffset,f=_t$docView$parseRange.from,u=_t$docView$parseRange.to,c=t.domSelectionRange(),a=c.anchorNode;if(a&&t.dom.contains(1==a.nodeType?a:a.parentNode)&&(n=[{node:a,offset:c.anchorOffset}],k(c)||n.push({node:c.focusNode,offset:c.focusOffset})),N&&8===t.input.lastKeyCode)for(var _t88=h;_t88>l;_t88--){var _e84=s.childNodes[_t88-1],_i71=_e84.pmViewDesc;if("BR"==_e84.nodeName&&!_i71){h=_t88;break;}if(!_i71||_i71.size)break;}var d=t.state.doc,p=t.someProp("domParser")||o.fromSchema(t.state.schema),m=d.resolve(f),b=null,g=p.parse(s,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:l,to:h,preserveWhitespace:"pre"!=m.parent.type.whitespace||"full",findPositions:n,ruleFromNode:bi(r),context:m});if(n&&null!=n[0].pos){var _t89=n[0].pos,_e85=n[1]&&n[1].pos;null==_e85&&(_e85=_t89),b={anchor:_t89+f,head:_e85+f};}return{doc:g,sel:b,from:f,to:u};}(t,i,r,s),m=t.state.doc,b=m.slice(p.from,p.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(c=t.state.selection.to,a="end"):(c=t.state.selection.from,a="start"),t.input.lastKeyCode=null;var g=function(t,e,i,r,n){var s=t.findDiffStart(e,i),l=i+t.size,o=i+e.size;if(null==s)return null;var _t$findDiffEnd=t.findDiffEnd(e,l,o),h=_t$findDiffEnd.a,f=_t$findDiffEnd.b;if("end"==n){r-=h+Math.max(0,s-Math.min(h,f))-s;}if(h<s&&l<o){s-=r<=s&&r>=h?s-r:0,f=s+(f-h),h=s;}else if(f<s){s-=r<=s&&r>=f?s-r:0,h=s+(h-f),f=s;}return{start:s,endA:h,endB:f};}(b.content,p.doc.content,p.from,c,a);if(g&&t.input.domChangeCount++,(B&&t.input.lastIOSEnter>Date.now()-225||F)&&s.some(function(t){return 1==t.nodeType&&!gi.test(t.nodeName);})&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));}))return void(t.input.lastIOSEnter=0);if(!g){if(!(n&&d instanceof e&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){var _e86=ki(t,t.state.doc,p.sel);if(_e86&&!_e86.eq(t.state.selection)){var _i72=t.state.tr.setSelection(_e86);h&&_i72.setMeta("composition",h),t.dispatch(_i72);}}return;}g={start:d.from,endA:d.to,endB:d.to};}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof e&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=p.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=p.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),T&&C<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>p.from&&" "==p.doc.textBetween(g.start-p.from-1,g.start-p.from+1)&&(g.start--,g.endA--,g.endB--);var w=p.doc.resolveNoCache(g.start-p.from),y=p.doc.resolveNoCache(g.endB-p.from),v=m.resolve(g.start),D=w.sameParent(y)&&w.parent.inlineContent&&v.end()>=g.endA;if((B&&t.input.lastIOSEnter>Date.now()-225&&(!D||s.some(function(t){return"DIV"==t.nodeName||"P"==t.nodeName;}))||!D&&w.pos<p.doc.content.size&&(!w.sameParent(y)||!w.parent.inlineContent)&&w.pos<y.pos&&!/\S/.test(p.doc.textBetween(w.pos,y.pos,"","")))&&t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));}))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>g.start&&function(t,e,i,r,n){if(i-e<=n.pos-r.pos||Mi(r,!0,!1)<n.pos)return!1;var s=t.resolve(e);if(!r.parent.isTextblock){var _t90=s.nodeAfter;return null!=_t90&&i==e+_t90.nodeSize;}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;var l=t.resolve(Mi(s,!0,!0));return!(!l.parent.isTextblock||l.pos>i||Mi(l,!0,!1)<i)&&r.parent.content.cut(r.parentOffset).eq(l.parent.content);}(m,g.start,g.endA,w,y)&&t.someProp("handleKeyDown",function(e){return e(t,M(8,"Backspace"));}))return void(F&&N&&t.domObserver.suppressSelectionUpdates());N&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),F&&!D&&w.start()!=y.start()&&0==y.parentOffset&&w.depth==y.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==g.endA&&(g.endB-=2,y=p.doc.resolveNoCache(g.endB-p.from),setTimeout(function(){t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));});},20));var x,O=g.start,S=g.endA,P=function P(e){var i=e||t.state.tr.replace(O,S,p.doc.slice(g.start-p.from,g.endB-p.from));if(p.sel){var _e87=ki(t,i.doc,p.sel);_e87&&!(N&&t.composing&&_e87.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(_e87.head==O||_e87.head==i.mapping.map(S)-1)||T&&_e87.empty&&_e87.head==O)&&i.setSelection(_e87);}return h&&i.setMeta("composition",h),i.scrollIntoView();};if(D){if(w.pos==y.pos){T&&C<=11&&0==w.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(function(){return Rt(t);},20));var _e88=P(t.state.tr["delete"](O,S)),_i73=m.resolve(g.start).marksAcross(m.resolve(g.endA));_i73&&_e88.ensureMarks(_i73),t.dispatch(_e88);}else if(g.endA==g.endB&&(x=function(t,e){var i,r,n,s=t.firstChild.marks,o=e.firstChild.marks,h=s,f=o;for(var _t91=0;_t91<o.length;_t91++)h=o[_t91].removeFromSet(h);for(var _t92=0;_t92<s.length;_t92++)f=s[_t92].removeFromSet(f);if(1==h.length&&0==f.length)r=h[0],i="add",n=function n(t){return t.mark(r.addToSet(t.marks));};else{if(0!=h.length||1!=f.length)return null;r=f[0],i="remove",n=function n(t){return t.mark(r.removeFromSet(t.marks));};}var u=[];for(var _t93=0;_t93<e.childCount;_t93++)u.push(n(e.child(_t93)));if(l.from(u).eq(t))return{mark:r,type:i};}(w.parent.content.cut(w.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,g.endA-v.start())))){var _e89=P(t.state.tr);"add"==x.type?_e89.addMark(O,S,x.mark):_e89.removeMark(O,S,x.mark),t.dispatch(_e89);}else if(w.parent.child(w.index()).isText&&w.index()==y.index()-(y.textOffset?0:1)){var _e90=w.parent.textBetween(w.parentOffset,y.parentOffset),_i74=function _i74(){return P(t.state.tr.insertText(_e90,O,S));};t.someProp("handleTextInput",function(r){return r(t,O,S,_e90,_i74);})||t.dispatch(_i74());}else t.dispatch(P());}else t.dispatch(P());}function ki(t,e,i){return Math.max(i.anchor,i.head)>e.content.size?null:Lt(t,e.resolve(i.anchor),e.resolve(i.head));}function Mi(t,e,i){var r=t.depth,n=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,n++,e=!1;if(i){var _e91=t.node(r).maybeChild(t.indexAfter(r));for(;_e91&&!_e91.isLeaf;)_e91=_e91.firstChild,n++;}return n;}function vi(t){var e=Object.create(null);return e["class"]="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",function(i){if("function"==typeof i&&(i=i(t.state)),i)for(var _t104 in i)"class"==_t104?e["class"]+=" "+i[_t104]:"style"==_t104?e.style=(e.style?e.style+";":"")+i[_t104]:e[_t104]||"contenteditable"==_t104||"nodeName"==_t104||(e[_t104]=String(i[_t104]));}),e.translate||(e.translate="no"),[Je.node(0,t.state.doc.content.size,e)];}function Di(t){if(t.markCursor){var _e99=document.createElement("img");_e99.className="ProseMirror-separator",_e99.setAttribute("mark-placeholder","true"),_e99.setAttribute("alt",""),t.cursorWrapper={dom:_e99,deco:Je.widget(t.state.selection.from,_e99,{raw:!0,marks:t.markCursor})};}else t.cursorWrapper=null;}function xi(t){return!t.someProp("editable",function(e){return!1===e(t.state);});}function Oi(t){var e=Object.create(null);function i(t){for(var _i80 in t)Object.prototype.hasOwnProperty.call(e,_i80)||(e[_i80]=t[_i80]);}return t.someProp("nodeViews",i),t.someProp("markViews",i),e;}function Si(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component");}return{setters:[function(_index00bCjsJs){t=_index00bCjsJs.c;e=_index00bCjsJs.T;i=_index00bCjsJs.a;r=_index00bCjsJs.S;n=_index00bCjsJs.d;s=_index00bCjsJs.e;l=_index00bCjsJs.F;o=_index00bCjsJs.D;h=_index00bCjsJs.M;f=_index00bCjsJs.A;}],execute:function execute(){u=function u(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e;},c=function c(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e;};a=null;d=function d(t,e,i){var r=a||(a=document.createRange());return r.setEnd(t,null==i?t.nodeValue.length:i),r.setStart(t,e||0),r;},p=function p(t,e,i,r){return i&&(b(t,e,i,r,-1)||b(t,e,i,r,1));},m=/^(img|br|input|textarea|hr)$/i;k=function k(t){return t.focusNode&&p(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset);};y="undefined"!=typeof navigator?navigator:null,v="undefined"!=typeof document?document:null,D=y&&y.userAgent||"",x=/Edge\/(\d+)/.exec(D),O=/MSIE \d/.exec(D),S=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(D),T=!!(O||S||x),C=O?document.documentMode:S?+S[1]:x?+x[1]:0,P=!T&&/gecko\/(\d+)/i.test(D);P&&(/Firefox\/(\d+)/.exec(D)||[0,0])[1];E=!T&&/Chrome\/(\d+)/.exec(D),N=!!E,R=E?+E[1]:0,A=!T&&!!y&&/Apple Computer/.test(y.vendor),B=A&&(/Mobile\/\w+/.test(D)||!!y&&y.maxTouchPoints>2),$=B||!!y&&/Mac/.test(y.platform),I=!!y&&/Win/.test(y.platform),F=/Android \d/.test(D),K=!!v&&"webkitFontSmoothing"in v.documentElement.style,L=K?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;G=null;_=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;nt=/[\u0590-\u08ac]/;st=null,lt=null,ot=!1;ft=/*#__PURE__*/function(){function ft(t,e,i,r){_classCallCheck(this,ft);this.parent=t,this.children=e,this.dom=i,this.contentDOM=r,this.dirty=0,i.pmViewDesc=this;}return _createClass(ft,[{key:"matchesWidget",value:function matchesWidget(t){return!1;}},{key:"matchesMark",value:function matchesMark(t){return!1;}},{key:"matchesNode",value:function matchesNode(t,e,i){return!1;}},{key:"matchesHack",value:function matchesHack(t){return!1;}},{key:"parseRule",value:function parseRule(t){return null;}},{key:"stopEvent",value:function stopEvent(t){return!1;}},{key:"size",get:function get(){var t=0;for(var _e8=0;_e8<this.children.length;_e8++)t+=this.children[_e8].size;return t;}},{key:"border",get:function get(){return 0;}},{key:"destroy",value:function destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var _t18=0;_t18<this.children.length;_t18++)this.children[_t18].destroy();}},{key:"posBeforeChild",value:function posBeforeChild(t){for(var _e9=0,_i12=this.posAtStart;;_e9++){var _r10=this.children[_e9];if(_r10==t)return _i12;_i12+=_r10.size;}}},{key:"posBefore",get:function get(){return this.parent.posBeforeChild(this);}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBeforeChild(this)+this.border:0;}},{key:"posAfter",get:function get(){return this.posBefore+this.size;}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.size-2*this.border;}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e,i){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(i<0){var _i13,_r11;if(t==this.contentDOM)_i13=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;_i13=t.previousSibling;}for(;_i13&&(!(_r11=_i13.pmViewDesc)||_r11.parent!=this);)_i13=_i13.previousSibling;return _i13?this.posBeforeChild(_r11)+_r11.size:this.posAtStart;}{var _i14,_r12;if(t==this.contentDOM)_i14=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;_i14=t.nextSibling;}for(;_i14&&(!(_r12=_i14.pmViewDesc)||_r12.parent!=this);)_i14=_i14.nextSibling;return _i14?this.posBeforeChild(_r12):this.posAtEnd;}}var r;if(t==this.dom&&this.contentDOM)r=e>u(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var _e10=t;;_e10=_e10.parentNode){if(_e10==this.dom){r=!1;break;}if(_e10.previousSibling)break;}if(null==r&&e==t.childNodes.length)for(var _e11=t;;_e11=_e11.parentNode){if(_e11==this.dom){r=!0;break;}if(_e11.nextSibling)break;}}return(null==r?i>0:r)?this.posAtEnd:this.posAtStart;}},{key:"nearestDesc",value:function nearestDesc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;for(var _i15=!0,_r13=t;_r13;_r13=_r13.parentNode){var _n6=void 0,_s8=this.getDesc(_r13);if(_s8&&(!e||_s8.node)){if(!_i15||!(_n6=_s8.nodeDOM)||(1==_n6.nodeType?_n6.contains(1==t.nodeType?t:t.parentNode):_n6==t))return _s8;_i15=!1;}}}},{key:"getDesc",value:function getDesc(t){var e=t.pmViewDesc;for(var _t19=e;_t19;_t19=_t19.parent)if(_t19==this)return e;}},{key:"posFromDOM",value:function posFromDOM(t,e,i){for(var _r14=t;_r14;_r14=_r14.parentNode){var _n7=this.getDesc(_r14);if(_n7)return _n7.localPosFromDOM(t,e,i);}return-1;}},{key:"descAt",value:function descAt(t){for(var _e12=0,_i16=0;_e12<this.children.length;_e12++){var _r15=this.children[_e12],_n8=_i16+_r15.size;if(_i16==t&&_n8!=_i16){for(;!_r15.border&&_r15.children.length;)for(var _t20=0;_t20<_r15.children.length;_t20++){var _e13=_r15.children[_t20];if(_e13.size){_r15=_e13;break;}}return _r15;}if(t<_n8)return _r15.descAt(t-_i16-_r15.border);_i16=_n8;}}},{key:"domFromPos",value:function domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};var i=0,r=0;for(var _e14=0;i<this.children.length;i++){var _n9=this.children[i],_s9=_e14+_n9.size;if(_s9>t||_n9 instanceof bt){r=t-_e14;break;}_e14=_s9;}if(r)return this.children[i].domFromPos(r-this.children[i].border,e);for(var _t21;i&&!(_t21=this.children[i-1]).size&&_t21 instanceof ut&&_t21.side>=0;i--);if(e<=0){var _t22,_r16=!0;for(;_t22=i?this.children[i-1]:null,_t22&&_t22.dom.parentNode!=this.contentDOM;i--,_r16=!1);return _t22&&e&&_r16&&!_t22.border&&!_t22.domAtom?_t22.domFromPos(_t22.size,e):{node:this.contentDOM,offset:_t22?u(_t22.dom)+1:0};}{var _t23,_r17=!0;for(;_t23=i<this.children.length?this.children[i]:null,_t23&&_t23.dom.parentNode!=this.contentDOM;i++,_r17=!1);return _t23&&_r17&&!_t23.border&&!_t23.domAtom?_t23.domFromPos(0,e):{node:this.contentDOM,offset:_t23?u(_t23.dom):this.contentDOM.childNodes.length};}}},{key:"parseRange",value:function parseRange(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};var r=-1,n=-1;for(var _s10=i,_l3=0;;_l3++){var _i17=this.children[_l3],_o2=_s10+_i17.size;if(-1==r&&t<=_o2){var _n10=_s10+_i17.border;if(t>=_n10&&e<=_o2-_i17.border&&_i17.node&&_i17.contentDOM&&this.contentDOM.contains(_i17.contentDOM))return _i17.parseRange(t,e,_n10);t=_s10;for(var _e15=_l3;_e15>0;_e15--){var _i18=this.children[_e15-1];if(_i18.size&&_i18.dom.parentNode==this.contentDOM&&!_i18.emptyChildAt(1)){r=u(_i18.dom)+1;break;}t-=_i18.size;}-1==r&&(r=0);}if(r>-1&&(_o2>e||_l3==this.children.length-1)){e=_o2;for(var _t24=_l3+1;_t24<this.children.length;_t24++){var _i19=this.children[_t24];if(_i19.size&&_i19.dom.parentNode==this.contentDOM&&!_i19.emptyChildAt(-1)){n=u(_i19.dom);break;}e+=_i19.size;}-1==n&&(n=this.contentDOM.childNodes.length);break;}_s10=_o2;}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:n};}},{key:"emptyChildAt",value:function emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t);}},{key:"domAfterPos",value:function domAfterPos(t){var _this$domFromPos=this.domFromPos(t,0),e=_this$domFromPos.node,i=_this$domFromPos.offset;if(1!=e.nodeType||i==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[i];}},{key:"setSelection",value:function setSelection(t,e,i){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var n=Math.min(t,e),s=Math.max(t,e);for(var _l4=0,_o3=0;_l4<this.children.length;_l4++){var _h2=this.children[_l4],_f2=_o3+_h2.size;if(n>_o3&&s<_f2)return _h2.setSelection(t-_o3-_h2.border,e-_o3-_h2.border,i,r);_o3=_f2;}var l=this.domFromPos(t,t?-1:1),o=e==t?l:this.domFromPos(e,e?-1:1),h=i.root.getSelection(),f=i.domSelectionRange(),c=!1;if((P||A)&&t==e){var _l5=l,_t25=_l5.node,_e16=_l5.offset;if(3==_t25.nodeType){if(c=!(!_e16||"\n"!=_t25.nodeValue[_e16-1]),c&&_e16==_t25.nodeValue.length)for(var _e17,_i20=_t25;_i20;_i20=_i20.parentNode){if(_e17=_i20.nextSibling){"BR"==_e17.nodeName&&(l=o={node:_e17.parentNode,offset:u(_e17)+1});break;}var _t26=_i20.pmViewDesc;if(_t26&&_t26.node&&_t26.node.isBlock)break;}}else{var _i21=_t25.childNodes[_e16-1];c=_i21&&("BR"==_i21.nodeName||"false"==_i21.contentEditable);}}if(P&&f.focusNode&&f.focusNode!=o.node&&1==f.focusNode.nodeType){var _t27=f.focusNode.childNodes[f.focusOffset];_t27&&"false"==_t27.contentEditable&&(r=!0);}if(!(r||c&&A)&&p(l.node,l.offset,f.anchorNode,f.anchorOffset)&&p(o.node,o.offset,f.focusNode,f.focusOffset))return;var a=!1;if((h.extend||t==e)&&(!c||!P)){h.collapse(l.node,l.offset);try{t!=e&&h.extend(o.node,o.offset),a=!0;}catch(t){}}if(!a){if(t>e){var _t28=l;l=o,o=_t28;}var _i22=document.createRange();_i22.setEnd(o.node,o.offset),_i22.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(_i22);}}},{key:"ignoreMutation",value:function ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type;}},{key:"contentLost",get:function get(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM);}},{key:"markDirty",value:function markDirty(t,e){for(var _i23=0,_r18=0;_r18<this.children.length;_r18++){var _n11=this.children[_r18],_s11=_i23+_n11.size;if(_i23==_s11?t<=_s11&&e>=_i23:t<_s11&&e>_i23){var _r19=_i23+_n11.border,_l6=_s11-_n11.border;if(t>=_r19&&e<=_l6)return this.dirty=t==_i23||e==_s11?2:1,void(t!=_r19||e!=_l6||!_n11.contentLost&&_n11.dom.parentNode==this.contentDOM?_n11.markDirty(t-_r19,e-_r19):_n11.dirty=3);_n11.dirty=_n11.dom!=_n11.contentDOM||_n11.dom.parentNode!=this.contentDOM||_n11.children.length?3:2;}_i23=_s11;}this.dirty=2;}},{key:"markParentsDirty",value:function markParentsDirty(){var t=1;for(var _e18=this.parent;_e18;_e18=_e18.parent,t++){var _i24=1==t?2:1;_e18.dirty<_i24&&(_e18.dirty=_i24);}}},{key:"domAtom",get:function get(){return!1;}},{key:"ignoreForCoords",get:function get(){return!1;}},{key:"ignoreForSelection",get:function get(){return!1;}},{key:"isText",value:function isText(t){return!1;}}]);}();ut=/*#__PURE__*/function(_ft){function ut(t,e,i,r){var _this;_classCallCheck(this,ut);var n,s=e.type.toDOM;if("function"==typeof s&&(s=s(i,function(){return n?n.parent?n.parent.posBeforeChild(n):void 0:r;})),!e.type.spec.raw){if(1!=s.nodeType){var _t29=document.createElement("span");_t29.appendChild(s),s=_t29;}s.contentEditable="false",s.classList.add("ProseMirror-widget");}_this=_callSuper(this,ut,[t,[],s,null]),_this.widget=e,_this.widget=e,n=_assertThisInitialized(_this);return _this;}_inherits(ut,_ft);return _createClass(ut,[{key:"matchesWidget",value:function matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type);}},{key:"parseRule",value:function parseRule(){return{ignore:!0};}},{key:"stopEvent",value:function stopEvent(t){var e=this.widget.spec.stopEvent;return!!e&&e(t);}},{key:"ignoreMutation",value:function ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection;}},{key:"destroy",value:function destroy(){this.widget.type.destroy(this.dom),_superPropGet(ut,"destroy",this,3)([]);}},{key:"domAtom",get:function get(){return!0;}},{key:"ignoreForSelection",get:function get(){return!!this.widget.type.spec.relaxedSide;}},{key:"side",get:function get(){return this.widget.type.side;}}]);}(ft);ct=/*#__PURE__*/function(_ft2){function ct(t,e,i,r){var _this2;_classCallCheck(this,ct);_this2=_callSuper(this,ct,[t,[],e,null]),_this2.textDOM=i,_this2.text=r;return _this2;}_inherits(ct,_ft2);return _createClass(ct,[{key:"size",get:function get(){return this.text.length;}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e;}},{key:"domFromPos",value:function domFromPos(t){return{node:this.textDOM,offset:t};}},{key:"ignoreMutation",value:function ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue;}}]);}(ft);at=/*#__PURE__*/function(_ft3){function at(t,e,i,r,n){var _this3;_classCallCheck(this,at);_this3=_callSuper(this,at,[t,[],i,r]),_this3.mark=e,_this3.spec=n;return _this3;}_inherits(at,_ft3);return _createClass(at,[{key:"parseRule",value:function parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM};}},{key:"matchesMark",value:function matchesMark(t){return 3!=this.dirty&&this.mark.eq(t);}},{key:"markDirty",value:function markDirty(t,e){if(_superPropGet(at,"markDirty",this,3)([t,e]),0!=this.dirty){var _t30=this.parent;for(;!_t30.node;)_t30=_t30.parent;_t30.dirty<this.dirty&&(_t30.dirty=this.dirty),this.dirty=0;}}},{key:"slice",value:function slice(t,e,i){var r=at.create(this.parent,this.mark,!0,i),n=this.children,s=this.size;e<s&&(n=Pt(n,e,s,i)),t>0&&(n=Pt(n,0,t,i));for(var _t31=0;_t31<n.length;_t31++)n[_t31].parent=r;return r.children=n,r;}},{key:"ignoreMutation",value:function ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):_superPropGet(at,"ignoreMutation",this,3)([t]);}},{key:"destroy",value:function destroy(){this.spec.destroy&&this.spec.destroy(),_superPropGet(at,"destroy",this,3)([]);}}],[{key:"create",value:function create(t,e,r,n){var s=n.nodeViews[e.type.name],l=s&&s(e,n,r);return l&&l.dom||(l=i.renderSpec(document,e.type.spec.toDOM(e,r),null,e.attrs)),new at(t,e,l.dom,l.contentDOM||l.dom,l);}}]);}(ft);dt=/*#__PURE__*/function(_ft4){function dt(t,e,i,r,n,s,l){var _this4;_classCallCheck(this,dt);_this4=_callSuper(this,dt,[t,[],n,s]),_this4.node=e,_this4.outerDeco=i,_this4.innerDeco=r,_this4.nodeDOM=l;return _this4;}_inherits(dt,_ft4);return _createClass(dt,[{key:"parseRule",value:function parseRule(t){var _this5=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(var _t32=this.children.length-1;_t32>=0;_t32--){var _i25=this.children[_t32];if(this.dom.contains(_i25.dom.parentNode)){e.contentElement=_i25.dom.parentNode;break;}}if(!e.contentElement){var _i26=t&&t.find(function(e){return 1==e.nodeType&&t.indexOf(e.parentNode)<0&&_this5.dom.contains(e);});_i26?e.contentElement=_i26:e.getContent=function(){return l.empty;};}}else e.contentElement=this.contentDOM;}else e.getContent=function(){return _this5.node.content;};return e;}},{key:"matchesNode",value:function matchesNode(t,e,i){return 0==this.dirty&&t.eq(this.node)&&Ot(e,this.outerDeco)&&i.eq(this.innerDeco);}},{key:"size",get:function get(){return this.node.nodeSize;}},{key:"border",get:function get(){return this.node.isLeaf?0:1;}},{key:"updateChildren",value:function updateChildren(t,e){var _this6=this;var i=this.node.inlineContent,r=e,n=t.composing?this.localCompositionInfo(t,e):null,s=n&&n.pos>-1?n:null,l=n&&n.pos<0,o=new Tt(this,s&&s.node,t);!function(t,e,i,r){var n=e.locals(t),s=0;if(0==n.length){for(var _i27=0;_i27<t.childCount;_i27++){var _l7=t.child(_i27);r(_l7,n,e.forChild(s,_l7),_i27),s+=_l7.nodeSize;}return;}var l=0,o=[],h=null;for(var _f3=0;;){var _u3=void 0,_c2=void 0,_a2=void 0,_d2=void 0;for(;l<n.length&&n[l].to==s;){var _t33=n[l++];_t33.widget&&(_u3?(_c2||(_c2=[_u3])).push(_t33):_u3=_t33);}if(_u3)if(_c2){_c2.sort(Ct);for(var _t34=0;_t34<_c2.length;_t34++)i(_c2[_t34],_f3,!!h);}else i(_u3,_f3,!!h);if(h)_d2=-1,_a2=h,h=null;else{if(!(_f3<t.childCount))break;_d2=_f3,_a2=t.child(_f3++);}for(var _t35=0;_t35<o.length;_t35++)o[_t35].to<=s&&o.splice(_t35--,1);for(;l<n.length&&n[l].from<=s&&n[l].to>s;)o.push(n[l++]);var _p=s+_a2.nodeSize;if(_a2.isText){var _t36=_p;l<n.length&&n[l].from<_t36&&(_t36=n[l].from);for(var _e19=0;_e19<o.length;_e19++)o[_e19].to<_t36&&(_t36=o[_e19].to);_t36<_p&&(h=_a2.cut(_t36-s),_a2=_a2.cut(0,_t36-s),_p=_t36,_d2=-1);}else for(;l<n.length&&n[l].to<_p;)l++;r(_a2,_a2.isInline&&!_a2.isLeaf?o.filter(function(t){return!t.inline;}):o.slice(),e.forChild(s,_a2),_d2),s=_p;}}(this.node,this.innerDeco,function(e,n,s){e.spec.marks?o.syncToMarks(e.spec.marks,i,t,n):e.type.side>=0&&!s&&o.syncToMarks(n==_this6.node.childCount?h.none:_this6.node.child(n).marks,i,t,n),o.placeWidget(e,t,r);},function(e,s,h,f){var u;o.syncToMarks(e.marks,i,t,f),o.findNodeMatch(e,s,h,f)||l&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(u=o.findIndexWithChild(n.node))>-1&&o.updateNodeAt(e,s,h,u,t)||o.updateNextNode(e,s,h,t,f,r)||o.addNode(e,s,h,t,r),r+=e.nodeSize;}),o.syncToMarks([],i,t,0),this.node.isTextblock&&o.addTextblockHacks(),o.destroyRest(),(o.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),wt(this.contentDOM,this.children,t),B&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var _e20=t.style.cssText;t.style.cssText=_e20+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=_e20;}}(this.dom));}},{key:"localCompositionInfo",value:function localCompositionInfo(t,i){var _t$state$selection=t.state.selection,r=_t$state$selection.from,n=_t$state$selection.to;if(!(t.state.selection instanceof e)||r<i||n>i+this.node.content.size)return null;var s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){var _t37=s.nodeValue,_e21=function(t,e,i,r){for(var _n12=0,_s12=0;_n12<t.childCount&&_s12<=r;){var _l8=t.child(_n12++),_o4=_s12;if(_s12+=_l8.nodeSize,!_l8.isText)continue;var _h3=_l8.text;for(;_n12<t.childCount;){var _e22=t.child(_n12++);if(_s12+=_e22.nodeSize,!_e22.isText)break;_h3+=_e22.text;}if(_s12>=i){if(_s12>=r&&_h3.slice(r-e.length-_o4,r-_o4)==e)return r-e.length;var _t38=_o4<r?_h3.lastIndexOf(e,r-_o4-1):-1;if(_t38>=0&&_t38+e.length+_o4>=i)return _o4+_t38;if(i==r&&_h3.length>=r+e.length-_o4&&_h3.slice(r-_o4,r-_o4+e.length)==e)return r;}}return-1;}(this.node.content,_t37,r-i,n-i);return _e21<0?null:{node:s,pos:_e21,text:_t37};}return{node:s,pos:-1,text:""};}},{key:"protectLocalComposition",value:function protectLocalComposition(t,_ref){var e=_ref.node,i=_ref.pos,r=_ref.text;if(this.getDesc(e))return;var n=e;for(;n.parentNode!=this.contentDOM;n=n.parentNode){for(;n.previousSibling;)n.parentNode.removeChild(n.previousSibling);for(;n.nextSibling;)n.parentNode.removeChild(n.nextSibling);n.pmViewDesc&&(n.pmViewDesc=void 0);}var s=new ct(this,n,e,r);t.input.compositionNodes.push(s),this.children=Pt(this.children,i,i+r.length,t,s);}},{key:"update",value:function update(t,e,i,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,i,r),!0);}},{key:"updateInner",value:function updateInner(t,e,i,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=i,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0;}},{key:"updateOuterDeco",value:function updateOuterDeco(t){if(Ot(t,this.outerDeco))return;var e=1!=this.nodeDOM.nodeType,i=this.dom;this.dom=vt(this.dom,this.nodeDOM,yt(this.outerDeco,this.node,e),yt(t,this.node,e)),this.dom!=i&&(i.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t;}},{key:"selectNode",value:function selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0));}},{key:"deselectNode",value:function deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"));}},{key:"domAtom",get:function get(){return this.node.isAtom;}}],[{key:"create",value:function create(t,e,r,n,s,l){var o,h=s.nodeViews[e.type.name],f=h&&h(e,s,function(){return o?o.parent?o.parent.posBeforeChild(o):void 0:l;},r,n),u=f&&f.dom,c=f&&f.contentDOM;if(e.isText){if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node");}else u=document.createTextNode(e.text);}else if(!u){var _t39=i.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);u=_t39.dom;c=_t39.contentDOM;}c||e.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),e.type.spec.draggable&&(u.draggable=!0));var a=u;return u=xt(u,r,e),f?o=new gt(t,e,r,n,u,c||null,a,f):e.isText?new mt(t,e,r,n,u,a):new dt(t,e,r,n,u,c||null,a);}}]);}(ft);mt=/*#__PURE__*/function(_dt){function mt(t,e,i,r,n,s){_classCallCheck(this,mt);return _callSuper(this,mt,[t,e,i,r,n,null,s]);}_inherits(mt,_dt);return _createClass(mt,[{key:"parseRule",value:function parseRule(){var t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0};}},{key:"update",value:function update(t,e,i,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0);}},{key:"inParent",value:function inParent(){var t=this.parent.contentDOM;for(var _e23=this.nodeDOM;_e23;_e23=_e23.parentNode)if(_e23==t)return!0;return!1;}},{key:"domFromPos",value:function domFromPos(t){return{node:this.nodeDOM,offset:t};}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e,i){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):_superPropGet(mt,"localPosFromDOM",this,3)([t,e,i]);}},{key:"ignoreMutation",value:function ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type;}},{key:"slice",value:function slice(t,e,i){var r=this.node.cut(t,e),n=document.createTextNode(r.text);return new mt(this.parent,r,this.outerDeco,this.innerDeco,n,n);}},{key:"markDirty",value:function markDirty(t,e){_superPropGet(mt,"markDirty",this,3)([t,e]),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3);}},{key:"domAtom",get:function get(){return!1;}},{key:"isText",value:function isText(t){return this.node.text==t;}}]);}(dt);bt=/*#__PURE__*/function(_ft5){function bt(){_classCallCheck(this,bt);return _callSuper(this,bt,arguments);}_inherits(bt,_ft5);return _createClass(bt,[{key:"parseRule",value:function parseRule(){return{ignore:!0};}},{key:"matchesHack",value:function matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t;}},{key:"domAtom",get:function get(){return!0;}},{key:"ignoreForCoords",get:function get(){return"IMG"==this.dom.nodeName;}}]);}(ft);gt=/*#__PURE__*/function(_dt2){function gt(t,e,i,r,n,s,l,o){var _this7;_classCallCheck(this,gt);_this7=_callSuper(this,gt,[t,e,i,r,n,s,l]),_this7.spec=o;return _this7;}_inherits(gt,_dt2);return _createClass(gt,[{key:"update",value:function update(t,e,i,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){var _n13=this.spec.update(t,e,i);return _n13&&this.updateInner(t,e,i,r),_n13;}return!(!this.contentDOM&&!t.isLeaf)&&_superPropGet(gt,"update",this,3)([t,e,i,r]);}},{key:"selectNode",value:function selectNode(){this.spec.selectNode?this.spec.selectNode():_superPropGet(gt,"selectNode",this,3)([]);}},{key:"deselectNode",value:function deselectNode(){this.spec.deselectNode?this.spec.deselectNode():_superPropGet(gt,"deselectNode",this,3)([]);}},{key:"setSelection",value:function setSelection(t,e,i,r){this.spec.setSelection?this.spec.setSelection(t,e,i.root):_superPropGet(gt,"setSelection",this,3)([t,e,i,r]);}},{key:"destroy",value:function destroy(){this.spec.destroy&&this.spec.destroy(),_superPropGet(gt,"destroy",this,3)([]);}},{key:"stopEvent",value:function stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t);}},{key:"ignoreMutation",value:function ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):_superPropGet(gt,"ignoreMutation",this,3)([t]);}}]);}(dt);kt=function kt(t){t&&(this.nodeName=t);};kt.prototype=Object.create(null);Mt=[new kt()];Tt=/*#__PURE__*/function(){function Tt(t,e,i){_classCallCheck(this,Tt);this.lock=e,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,e){var i=e,r=i.children.length,n=t.childCount,s=new Map(),l=[];t:for(;n>0;){var _o6=void 0;for(;;)if(r){var _t41=i.children[r-1];if(!(_t41 instanceof at)){_o6=_t41,r--;break;}i=_t41,r=_t41.children.length;}else{if(i==e)break t;r=i.parent.children.indexOf(i),i=i.parent;}var _h4=_o6.node;if(_h4){if(_h4!=t.child(n-1))break;--n,s.set(_o6,n),l.push(_o6);}}return{index:n,matched:s,matches:l.reverse()};}(t.node.content,t);}return _createClass(Tt,[{key:"destroyBetween",value:function destroyBetween(t,e){if(t!=e){for(var _i30=t;_i30<e;_i30++)this.top.children[_i30].destroy();this.top.children.splice(t,e-t),this.changed=!0;}}},{key:"destroyRest",value:function destroyRest(){this.destroyBetween(this.index,this.top.children.length);}},{key:"syncToMarks",value:function syncToMarks(t,e,i,r){var n=0,s=this.stack.length>>1,l=Math.min(s,t.length);for(;n<l&&(n==s-1?this.top:this.stack[n+1<<1]).matchesMark(t[n])&&!1!==t[n].type.spec.spanning;)n++;for(;n<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);var _n15=-1,_l12=this.top.children.length;r<this.preMatch.index&&(_l12=Math.min(this.index+3,_l12));for(var _e29=this.index;_e29<_l12;_e29++){var _i31=this.top.children[_e29];if(_i31.matchesMark(t[s])&&!this.isLocked(_i31.dom)){_n15=_e29;break;}}if(_n15<0&&this.index<this.top.children.length){var _e30=this.top.children[this.index];_e30 instanceof at&&3!=_e30.dirty&&_e30.mark.type==t[s].type&&_e30.spec.update&&!this.isLocked(_e30.dom)&&_e30.spec.update(t[s])&&(_e30.mark=t[s],_n15=this.index,this.changed=!0);}if(_n15>-1)_n15>this.index&&(this.changed=!0,this.destroyBetween(this.index,_n15)),this.top=this.top.children[this.index];else{var _r24=at.create(this.top,t[s],e,i);this.top.children.splice(this.index,0,_r24),this.top=_r24,this.changed=!0;}this.index=0,s++;}}},{key:"findNodeMatch",value:function findNodeMatch(t,e,i,r){var n,s=-1;if(r>=this.preMatch.index&&(n=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&n.matchesNode(t,e,i))s=this.top.children.indexOf(n,this.index);else for(var _r25=this.index,_n16=Math.min(this.top.children.length,_r25+5);_r25<_n16;_r25++){var _n17=this.top.children[_r25];if(_n17.matchesNode(t,e,i)&&!this.preMatch.matched.has(_n17)){s=_r25;break;}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0);}},{key:"updateNodeAt",value:function updateNodeAt(t,e,i,r,n){var s=this.top.children[r];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(t,e,i,n)&&(this.destroyBetween(this.index,r),this.index++,!0);}},{key:"findIndexWithChild",value:function findIndexWithChild(t){for(;;){var _e31=t.parentNode;if(!_e31)return-1;if(_e31==this.top.contentDOM){var _e32=t.pmViewDesc;if(_e32)for(var _t42=this.index;_t42<this.top.children.length;_t42++)if(this.top.children[_t42]==_e32)return _t42;return-1;}t=_e31;}}},{key:"updateNextNode",value:function updateNextNode(t,e,i,r,n,s){for(var _l13=this.index;_l13<this.top.children.length;_l13++){var _o7=this.top.children[_l13];if(_o7 instanceof dt){var _h5=this.preMatch.matched.get(_o7);if(null!=_h5&&_h5!=n)return!1;var _f4=void 0,_u4=_o7.dom,_c3=this.isLocked(_u4)&&!(t.isText&&_o7.node&&_o7.node.isText&&_o7.nodeDOM.nodeValue==t.text&&3!=_o7.dirty&&Ot(e,_o7.outerDeco));if(!_c3&&_o7.update(t,e,i,r))return this.destroyBetween(this.index,_l13),_o7.dom!=_u4&&(this.changed=!0),this.index++,!0;if(!_c3&&(_f4=this.recreateWrapper(_o7,t,e,i,r,s)))return this.destroyBetween(this.index,_l13),this.top.children[this.index]=_f4,_f4.contentDOM&&(_f4.dirty=2,_f4.updateChildren(r,s+1),_f4.dirty=0),this.changed=!0,this.index++,!0;break;}}return!1;}},{key:"recreateWrapper",value:function recreateWrapper(t,e,i,r,n,s){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!Ot(i,t.outerDeco)||!r.eq(t.innerDeco))return null;var l=dt.create(this.top,e,i,r,n,s);if(l.contentDOM){l.children=t.children,t.children=[];var _iterator=_createForOfIteratorHelper(l.children),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _t43=_step.value;_t43.parent=l;}}catch(err){_iterator.e(err);}finally{_iterator.f();}}return t.destroy(),l;}},{key:"addNode",value:function addNode(t,e,i,r,n){var s=dt.create(this.top,t,e,i,r,n);s.contentDOM&&s.updateChildren(r,n+1),this.top.children.splice(this.index++,0,s),this.changed=!0;}},{key:"placeWidget",value:function placeWidget(t,e,i){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var _r26=new ut(this.top,t,e,i);this.top.children.splice(this.index++,0,_r26),this.changed=!0;}else this.index++;}},{key:"addTextblockHacks",value:function addTextblockHacks(){var t=this.top.children[this.index-1],e=this.top;for(;t instanceof at;)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof mt)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((A||N)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top));}},{key:"addHackNode",value:function addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{var _i32=document.createElement(t);"IMG"==t&&(_i32.className="ProseMirror-separator",_i32.alt=""),"BR"==t&&(_i32.className="ProseMirror-trailingBreak");var _r27=new bt(this.top,[],_i32,null);e!=this.top?e.children.push(_r27):e.children.splice(this.index++,0,_r27),this.changed=!0;}}},{key:"isLocked",value:function isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode));}}]);}();At=A||N&&R<63;re=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;fe={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};ce=null;ae={},de={},pe={touchstart:!0,touchmove:!0};me=/*#__PURE__*/_createClass(function me(){_classCallCheck(this,me);this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null;});de.keydown=function(t,e){var i=e;if(t.input.shiftKey=16==i.keyCode||i.shiftKey,!Re(t)&&(t.input.lastKeyCode=i.keyCode,t.input.lastKeyCodeTime=Date.now(),!F||!N||13!=i.keyCode))if(229!=i.keyCode&&t.domObserver.forceFlush(),!B||13!=i.keyCode||i.ctrlKey||i.altKey||i.metaKey)t.someProp("handleKeyDown",function(e){return e(t,i);})||te(t,i)?i.preventDefault():be(t,"key");else{var _e55=Date.now();t.input.lastIOSEnter=_e55,t.input.lastIOSEnterFallbackTimeout=setTimeout(function(){t.input.lastIOSEnter==_e55&&(t.someProp("handleKeyDown",function(e){return e(t,M(13,"Enter"));}),t.input.lastIOSEnter=0);},200);}},de.keyup=function(t,e){16==e.keyCode&&(t.input.shiftKey=!1);},de.keypress=function(t,i){var r=i;if(Re(t)||!r.charCode||r.ctrlKey&&!r.altKey||$&&r.metaKey)return;if(t.someProp("handleKeyPress",function(e){return e(t,r);}))return void r.preventDefault();var n=t.state.selection;if(!(n instanceof e&&n.$from.sameParent(n.$to))){var _e56=String.fromCharCode(r.charCode),_i47=function _i47(){return t.state.tr.insertText(_e56).scrollIntoView();};/[\r\n]/.test(_e56)||t.someProp("handleTextInput",function(r){return r(t,n.$from.pos,n.$to.pos,_e56,_i47);})||t.dispatch(_i47()),r.preventDefault();}};Ce=$?"metaKey":"ctrlKey";ae.mousedown=function(t,e){var i=e;t.input.shiftKey=i.shiftKey;var r=Te(t),n=Date.now(),s="singleClick";n-t.input.lastClick.time<500&&function(t,e){var i=e.x-t.clientX,r=e.y-t.clientY;return i*i+r*r<100;}(i,t.input.lastClick)&&!i[Ce]&&t.input.lastClick.button==i.button&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:n,x:i.clientX,y:i.clientY,type:s,button:i.button},t.input.mouseDown&&t.input.mouseDown.done();var l=t.posAtCoords(Me(i));l&&("singleClick"==s?t.input.mouseDown=new Ee(t,l,i,!!r):("doubleClick"==s?xe:Oe)(t,l.pos,l.inside,i)?i.preventDefault():be(t,"pointer"));};Pe=/*#__PURE__*/function(){function Pe(t){_classCallCheck(this,Pe);this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this));}return _createClass(Pe,[{key:"up",value:function up(t){this.done();}},{key:"move",value:function move(t){0==t.buttons&&this.done();}},{key:"done",value:function done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null);}},{key:"delaySelUpdate",value:function delaySelUpdate(){return!1;}}]);}();Ee=/*#__PURE__*/function(_Pe){function Ee(e,i,r,n){var _this8;_classCallCheck(this,Ee);var s,l;if(_this8=_callSuper(this,Ee,[e]),_this8.pos=i,_this8.event=r,_this8.flushed=n,_this8.delayedSelectionSync=!1,_this8.startDoc=e.state.doc,_this8.selectNode=!!r[Ce],_this8.allowDefault=r.shiftKey,i.inside>-1)s=e.state.doc.nodeAt(i.inside),l=i.inside;else{var _t63=e.state.doc.resolve(i.pos);s=_t63.parent,l=_t63.depth?_t63.before():0;}var o=n?null:r.target,h=o?e.docView.nearestDesc(o,!0):null;_this8.target=h&&1==h.nodeDOM.nodeType?h.nodeDOM:null;var f=e.state.selection;0==r.button&&(s.type.spec.draggable&&!1!==s.type.spec.selectable||f instanceof t&&f.from<=l&&f.to>l)&&(_this8.mightDrag={node:s,pos:l,addAttr:!(!_this8.target||_this8.target.draggable),setUneditable:!(!_this8.target||!P||_this8.target.hasAttribute("contentEditable"))}),_this8.target&&_this8.mightDrag&&(_this8.mightDrag.addAttr||_this8.mightDrag.setUneditable)&&(_this8.view.domObserver.stop(),_this8.mightDrag.addAttr&&(_this8.target.draggable=!0),_this8.mightDrag.setUneditable&&setTimeout(function(){_this8.view.input.mouseDown==_this8&&_this8.target.setAttribute("contentEditable","false");},20),_this8.view.domObserver.start()),be(e,"pointer");return _this8;}_inherits(Ee,_Pe);return _createClass(Ee,[{key:"done",value:function done(){var _this9=this;_superPropGet(Ee,"done",this,3)([]),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){_this9.view.isDestroyed||Rt(_this9.view);});}},{key:"up",value:function up(t){if(this.done(),!this.view.dom.contains(t.target))return;var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Me(t))),this.updateAllowDefault(t),this.allowDefault||!e?be(this.view,"pointer"):De(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||A&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(ve(this.view,r.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):be(this.view,"pointer");}},{key:"move",value:function move(t){this.updateAllowDefault(t),be(this.view,"pointer"),_superPropGet(Ee,"move",this,3)([t]);}},{key:"updateAllowDefault",value:function updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0);}},{key:"delaySelUpdate",value:function delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0);}}]);}(Pe);Ne=/*#__PURE__*/function(_Pe2){function Ne(t,e){var _this10;_classCallCheck(this,Ne);_this10=_callSuper(this,Ne,[t]),_this10.startSelection=e,_this10.startDoc=t.state.doc;return _this10;}_inherits(Ne,_Pe2);return _createClass(Ne,[{key:"move",value:function move(t){if(0==t.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();t.preventDefault(),be(this.view,"pointer");var i=this.view.posAtCoords(Me(t)),r=i&&Se(this.view,i.inside,!1);if(!r)return;var n=this.view.state.doc,s=this.startSelection,_ref4=r.from<s.from?[s.to,r.from]:[s.from,r.to],_ref5=_slicedToArray(_ref4,2),l=_ref5[0],o=_ref5[1];ve(this.view,e.create(n,l,o),"pointer");}}]);}(Pe);ae.touchstart=function(t){t.input.lastTouch=Date.now(),Te(t),be(t,"pointer");},ae.touchmove=function(t){t.input.lastTouch=Date.now(),be(t,"pointer");},ae.contextmenu=function(t){return Te(t);};Ae=F?5e3:-1;de.compositionstart=de.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var _i49=t.state,_r38=_i49.selection.$to;if(_i49.selection instanceof e&&(_i49.storedMarks||!_r38.textOffset&&_r38.parentOffset&&_r38.nodeBefore.marks.some(function(t){return!1===t.type.spec.inclusive;})||N&&I&&function(t){var _t$domSelectionRange4=t.domSelectionRange(),e=_t$domSelectionRange4.focusNode,i=_t$domSelectionRange4.focusOffset;if(!e||1!=e.nodeType||i>=e.childNodes.length)return!1;var r=e.childNodes[i];return 1==r.nodeType&&"false"==r.contentEditable;}(t)))t.markCursor=t.state.storedMarks||_r38.marks(),Fe(t,!0),t.markCursor=null;else if(Fe(t,!_i49.selection.empty),P&&_i49.selection.empty&&_r38.parentOffset&&!_r38.textOffset&&_r38.nodeBefore.marks.length){var _e58=t.domSelectionRange();for(var _i50=_e58.focusNode,_r39=_e58.focusOffset;_i50&&1==_i50.nodeType&&0!=_r39;){var _e59=_r39<0?_i50.lastChild:_i50.childNodes[_r39-1];if(!_e59)break;if(3==_e59.nodeType){var _i51=t.domSelection();_i51&&_i51.collapse(_e59,_e59.nodeValue.length);break;}_i50=_e59,_r39=-1;}}t.input.composing=!0;}Be(t,Ae);},de.compositionend=function(t,e){t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(function(){return t.domObserver.flush();}),t.input.compositionID++,Be(t,20));};Ke=T&&C<15||B&&L<604;ae.copy=de.cut=function(t,e){var i=e,r=t.state.selection,n="cut"==i.type;if(r.empty)return;var s=Ke?null:i.clipboardData,l=r.content(),_ee=ee(t,l),o=_ee.dom,h=_ee.text;s?(i.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",h)):function(t,e){if(!t.dom.parentNode)return;var i=t.dom.parentNode.appendChild(document.createElement("div"));i.appendChild(e),i.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),n=document.createRange();n.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(n),setTimeout(function(){i.parentNode&&i.parentNode.removeChild(i),t.focus();},50);}(t,o),n&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"));},de.paste=function(t,e){var i=e;if(t.composing&&!F)return;var r=Ke?null:i.clipboardData,n=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Le(t,qe(r),r.getData("text/html"),n,i)?i.preventDefault():function(t,e){if(!t.dom.parentNode)return;var i=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(i?"textarea":"div"));i||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();var n=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),i?Le(t,r.value,null,n,e):Le(t,r.textContent,r.innerHTML,n,e);},50);}(t,i);};He=/*#__PURE__*/_createClass(function He(t,e,i){_classCallCheck(this,He);this.slice=t,this.move=e,this.node=i;});We=$?"altKey":"ctrlKey";ae.dragstart=function(e,i){var r=i,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;var s,l=e.state.selection,o=l.empty?null:e.posAtCoords(Me(r));if(o&&o.pos>=l.from&&o.pos<=(l instanceof t?l.to-1:l.to));else if(n&&n.mightDrag)s=t.create(e.state.doc,n.mightDrag.pos);else if(r.target&&1==r.target.nodeType){var _i52=e.docView.nearestDesc(r.target,!0);_i52&&_i52.node.type.spec.draggable&&_i52!=e.docView&&(s=t.create(e.state.doc,_i52.posBefore));}var h=(s||e.state.selection).content(),_ee2=ee(e,h),f=_ee2.dom,u=_ee2.text,c=_ee2.slice;(!r.dataTransfer.files.length||!N||R>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(Ke?"Text":"text/html",f.innerHTML),r.dataTransfer.effectAllowed="copyMove",Ke||r.dataTransfer.setData("text/plain",u),e.dragging=new He(c,je(e,r),s);},ae.dragend=function(t){var e=t.dragging;window.setTimeout(function(){t.dragging==e&&(t.dragging=null);},50);},de.dragover=de.dragenter=function(t,e){return e.preventDefault();},de.drop=function(e,i){try{!function(e,i,r){if(!i.dataTransfer)return;var l=e.posAtCoords(Me(i));if(!l)return;var o=e.state.doc.resolve(l.pos),h=r&&r.slice;h?e.someProp("transformPasted",function(t){h=t(h,e,!1);}):h=ie(e,qe(i.dataTransfer),Ke?null:i.dataTransfer.getData("text/html"),!1,o);var f=!(!r||!je(e,i));if(e.someProp("handleDrop",function(t){return t(e,i,h||n.empty,f);}))return void i.preventDefault();if(!h)return;i.preventDefault();var u=h?s(e.state.doc,o.pos,h):o.pos;null==u&&(u=o.pos);var c=e.state.tr;if(f){var _t65=r.node;_t65?_t65.replace(c):c.deleteSelection();}var a=c.mapping.map(u),d=0==h.openStart&&0==h.openEnd&&1==h.content.childCount,p=c.doc;d?c.replaceRangeWith(a,a,h.content.firstChild):c.replaceRange(a,a,h);if(c.doc.eq(p))return;var m=c.doc.resolve(a);if(d&&t.isSelectable(h.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(h.content.firstChild))c.setSelection(new t(m));else{var _t66=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach(function(e,i,r,n){return _t66=n;}),c.setSelection(Lt(e,m,c.doc.resolve(_t66)));}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"));}(e,i,e.dragging);}finally{e.dragging=null;}},ae.focus=function(t){t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Rt(t);},20));},ae.blur=function(t,e){var i=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),i.relatedTarget&&t.dom.contains(i.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1);},ae.beforeinput=function(t,e){if(F&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var _e60=t.input.domChangeCount;setTimeout(function(){if(t.input.domChangeCount!=_e60)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",function(e){return e(t,M(8,"Backspace"));}))return;var i=t.state.selection.$cursor;i&&i.pos>0&&t.dispatch(t.state.tr["delete"](i.pos-1,i.pos).scrollIntoView());},50);}};for(_t67 in de)ae[_t67]=de[_t67];ze=/*#__PURE__*/function(){function ze(t,e){_classCallCheck(this,ze);this.toDOM=t,this.spec=e||Qe,this.side=this.spec.side||0;}return _createClass(ze,[{key:"map",value:function map(t,e,i,r){var _t$mapResult=t.mapResult(e.from+r,this.side<0?-1:1),n=_t$mapResult.pos,s=_t$mapResult.deleted;return s?null:new Je(n-i,n-i,this);}},{key:"valid",value:function valid(){return!0;}},{key:"eq",value:function eq(t){return this==t||t instanceof ze&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ve(this.spec,t.spec));}},{key:"destroy",value:function destroy(t){this.spec.destroy&&this.spec.destroy(t);}}]);}();Ge=/*#__PURE__*/function(){function Ge(t,e){_classCallCheck(this,Ge);this.attrs=t,this.spec=e||Qe;}return _createClass(Ge,[{key:"map",value:function map(t,e,i,r){var n=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-i,s=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-i;return n>=s?null:new Je(n,s,this);}},{key:"valid",value:function valid(t,e){return e.from<e.to;}},{key:"eq",value:function eq(t){return this==t||t instanceof Ge&&Ve(this.attrs,t.attrs)&&Ve(this.spec,t.spec);}},{key:"destroy",value:function destroy(){}}],[{key:"is",value:function is(t){return t.type instanceof Ge;}}]);}();Ue=/*#__PURE__*/function(){function Ue(t,e){_classCallCheck(this,Ue);this.attrs=t,this.spec=e||Qe;}return _createClass(Ue,[{key:"map",value:function map(t,e,i,r){var n=t.mapResult(e.from+r,1);if(n.deleted)return null;var s=t.mapResult(e.to+r,-1);return s.deleted||s.pos<=n.pos?null:new Je(n.pos-i,s.pos-i,this);}},{key:"valid",value:function valid(t,e){var i,_t$content$findIndex=t.content.findIndex(e.from),r=_t$content$findIndex.index,n=_t$content$findIndex.offset;return n==e.from&&!(i=t.child(r)).isText&&n+i.nodeSize==e.to;}},{key:"eq",value:function eq(t){return this==t||t instanceof Ue&&Ve(this.attrs,t.attrs)&&Ve(this.spec,t.spec);}},{key:"destroy",value:function destroy(){}}]);}();_export("a",Je=/*#__PURE__*/function(){function Je(t,e,i){_classCallCheck(this,Je);this.from=t,this.to=e,this.type=i;}return _createClass(Je,[{key:"copy",value:function copy(t,e){return new Je(t,e,this.type);}},{key:"eq",value:function eq(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to;}},{key:"map",value:function map(t,e,i){return this.type.map(t,this,e,i);}},{key:"spec",get:function get(){return this.type.spec;}},{key:"inline",get:function get(){return this.type instanceof Ge;}},{key:"widget",get:function get(){return this.type instanceof ze;}}],[{key:"widget",value:function widget(t,e,i){return new Je(t,t,new ze(e,i));}},{key:"inline",value:function inline(t,e,i,r){return new Je(t,e,new Ge(i,r));}},{key:"node",value:function node(t,e,i,r){return new Je(t,e,new Ue(i,r));}}]);}());Ye=[],Qe={};_export("D",Xe=/*#__PURE__*/function(){function Xe(t,e){_classCallCheck(this,Xe);this.local=t.length?t:Ye,this.children=e.length?e:Ye;}return _createClass(Xe,[{key:"find",value:function find(t,e,i){var r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,i),r;}},{key:"findInner",value:function findInner(t,e,i,r,n){for(var _s21=0;_s21<this.local.length;_s21++){var _l18=this.local[_s21];_l18.from<=e&&_l18.to>=t&&(!n||n(_l18.spec))&&i.push(_l18.copy(_l18.from+r,_l18.to+r));}for(var _s22=0;_s22<this.children.length;_s22+=3)if(this.children[_s22]<e&&this.children[_s22+1]>t){var _l19=this.children[_s22]+1;this.children[_s22+2].findInner(t-_l19,e-_l19,i,r+_l19,n);}}},{key:"map",value:function map(t,e,i){return this==Ze||0==t.maps.length?this:this.mapInner(t,e,0,0,i||Qe);}},{key:"mapInner",value:function mapInner(t,e,i,r,n){var s;for(var _l20=0;_l20<this.local.length;_l20++){var _o12=this.local[_l20].map(t,i,r);_o12&&_o12.type.valid(e,_o12)?(s||(s=[])).push(_o12):n.onRemove&&n.onRemove(this.local[_l20].spec);}return this.children.length?function(t,e,i,r,n,s,l){var o=t.slice();var _loop3=function _loop3(_e62){var r=0;i.maps[_t68].forEach(function(t,i,n,s){var l=s-n-(i-t);for(var _n27=0;_n27<o.length;_n27+=3){var _s24=o[_n27+1];if(_s24<0||t>_s24+_e62-r)continue;var _h9=o[_n27]+_e62-r;i>=_h9?o[_n27+1]=t<=_h9?-2:-1:t>=_e62&&l&&(o[_n27]+=l,o[_n27+1]+=l);}r+=l;}),_e62=i.maps[_t68].map(_e62,-1);_e61=_e62;};for(var _t68=0,_e61=s;_t68<i.maps.length;_t68++){_loop3(_e61);}var h=!1;for(var _e63=0;_e63<o.length;_e63+=3)if(o[_e63+1]<0){if(-2==o[_e63+1]){h=!0,o[_e63+1]=-1;continue;}var _f6=i.map(t[_e63]+s),_u6=_f6-n;if(_u6<0||_u6>=r.content.size){h=!0;continue;}var _c4=i.map(t[_e63+1]+s,-1)-n,_r$content$findIndex=r.content.findIndex(_u6),_a3=_r$content$findIndex.index,_d3=_r$content$findIndex.offset,_p2=r.maybeChild(_a3);if(_p2&&_d3==_u6&&_d3+_p2.nodeSize==_c4){var _r40=o[_e63+2].mapInner(i,_p2,_f6+1,t[_e63]+s+1,l);_r40!=Ze?(o[_e63]=_u6,o[_e63+1]=_c4,o[_e63+2]=_r40):(o[_e63+1]=-2,h=!0);}else h=!0;}if(h){var _h8=function(t,e,i,r,n,s,l){function o(t,e){for(var _s23=0;_s23<t.local.length;_s23++){var _o13=t.local[_s23].map(r,n,e);_o13?i.push(_o13):l.onRemove&&l.onRemove(t.local[_s23].spec);}for(var _i55=0;_i55<t.children.length;_i55+=3)o(t.children[_i55+2],t.children[_i55]+e+1);}for(var _i56=0;_i56<t.length;_i56+=3)-1==t[_i56+1]&&o(t[_i56+2],e[_i56]+s+1);return i;}(o,t,e,i,n,s,l),_f7=ri(_h8,r,0,l);e=_f7.local;for(var _t69=0;_t69<o.length;_t69+=3)o[_t69+1]<0&&(o.splice(_t69,3),_t69-=3);for(var _t70=0,_e64=0;_t70<_f7.children.length;_t70+=3){var _i57=_f7.children[_t70];for(;_e64<o.length&&o[_e64]<_i57;)_e64+=3;o.splice(_e64,0,_f7.children[_t70],_f7.children[_t70+1],_f7.children[_t70+2]);}}return new Xe(e.sort(ni),o);}(this.children,s||[],t,e,i,r,n):s?new Xe(s.sort(ni),Ye):Ze;}},{key:"add",value:function add(t,e){return e.length?this==Ze?Xe.create(t,e):this.addInner(t,e,0):this;}},{key:"addInner",value:function addInner(t,e,i){var _this11=this;var r,n=0;t.forEach(function(t,s){var l,o=s+i;if(l=ei(e,t,o)){for(r||(r=_this11.children.slice());n<r.length&&r[n]<s;)n+=3;r[n]==s?r[n+2]=r[n+2].addInner(t,l,o+1):r.splice(n,0,s,s+t.nodeSize,ri(l,t,o+1,Qe)),n+=3;}});var s=ti(n?ii(e):e,-i);for(var _e65=0;_e65<s.length;_e65++)s[_e65].type.valid(t,s[_e65])||s.splice(_e65--,1);return new Xe(s.length?this.local.concat(s).sort(ni):this.local,r||this.children);}},{key:"remove",value:function remove(t){return 0==t.length||this==Ze?this:this.removeInner(t,0);}},{key:"removeInner",value:function removeInner(t,e){var i=this.children,r=this.local;for(var _r41=0;_r41<i.length;_r41+=3){var _n28=void 0,_s25=i[_r41]+e,_l21=i[_r41+1]+e;for(var _e66,_i58=0;_i58<t.length;_i58++)(_e66=t[_i58])&&_e66.from>_s25&&_e66.to<_l21&&(t[_i58]=null,(_n28||(_n28=[])).push(_e66));if(!_n28)continue;i==this.children&&(i=this.children.slice());var _o14=i[_r41+2].removeInner(_n28,_s25+1);_o14!=Ze?i[_r41+2]=_o14:(i.splice(_r41,3),_r41-=3);}if(r.length)for(var _i59,_n29=0;_n29<t.length;_n29++)if(_i59=t[_n29])for(var _t71=0;_t71<r.length;_t71++)r[_t71].eq(_i59,e)&&(r==this.local&&(r=this.local.slice()),r.splice(_t71--,1));return i==this.children&&r==this.local?this:r.length||i.length?new Xe(r,i):Ze;}},{key:"forChild",value:function forChild(t,e){if(this==Ze)return this;if(e.isLeaf)return Xe.empty;var i,r;for(var _e67=0;_e67<this.children.length;_e67+=3)if(this.children[_e67]>=t){this.children[_e67]==t&&(i=this.children[_e67+2]);break;}var n=t+1,s=n+e.content.size;for(var _t72=0;_t72<this.local.length;_t72++){var _e68=this.local[_t72];if(_e68.from<s&&_e68.to>n&&_e68.type instanceof Ge){var _t73=Math.max(n,_e68.from)-n,_i60=Math.min(s,_e68.to)-n;_t73<_i60&&(r||(r=[])).push(_e68.copy(_t73,_i60));}}if(r){var _t74=new Xe(r.sort(ni),Ye);return i?new _e([_t74,i]):_t74;}return i||Ze;}},{key:"eq",value:function eq(t){if(this==t)return!0;if(!(t instanceof Xe)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var _e69=0;_e69<this.local.length;_e69++)if(!this.local[_e69].eq(t.local[_e69]))return!1;for(var _e70=0;_e70<this.children.length;_e70+=3)if(this.children[_e70]!=t.children[_e70]||this.children[_e70+1]!=t.children[_e70+1]||!this.children[_e70+2].eq(t.children[_e70+2]))return!1;return!0;}},{key:"locals",value:function locals(t){return si(this.localsInner(t));}},{key:"localsInner",value:function localsInner(t){if(this==Ze)return Ye;if(t.inlineContent||!this.local.some(Ge.is))return this.local;var e=[];for(var _t75=0;_t75<this.local.length;_t75++)this.local[_t75].type instanceof Ge||e.push(this.local[_t75]);return e;}},{key:"forEachSet",value:function forEachSet(t){t(this);}}],[{key:"create",value:function create(t,e){return e.length?ri(e,t,0,Qe):Ze;}}]);}());Xe.empty=new Xe([],[]),Xe.removeOverlap=si;Ze=Xe.empty;_e=/*#__PURE__*/function(){function _e(t){_classCallCheck(this,_e);this.members=t;}return _createClass(_e,[{key:"map",value:function map(t,e){var i=this.members.map(function(i){return i.map(t,e,Qe);});return _e.from(i);}},{key:"forChild",value:function forChild(t,e){if(e.isLeaf)return Xe.empty;var i=[];for(var _r42=0;_r42<this.members.length;_r42++){var _n30=this.members[_r42].forChild(t,e);_n30!=Ze&&(_n30 instanceof _e?i=i.concat(_n30.members):i.push(_n30));}return _e.from(i);}},{key:"eq",value:function eq(t){if(!(t instanceof _e)||t.members.length!=this.members.length)return!1;for(var _e71=0;_e71<this.members.length;_e71++)if(!this.members[_e71].eq(t.members[_e71]))return!1;return!0;}},{key:"locals",value:function locals(t){var e,i=!0;for(var _r43=0;_r43<this.members.length;_r43++){var _n31=this.members[_r43].localsInner(t);if(_n31.length)if(e){i&&(e=e.slice(),i=!1);for(var _t76=0;_t76<_n31.length;_t76++)e.push(_n31[_t76]);}else e=_n31;}return e?si(i?e:e.sort(ni)):Ye;}},{key:"forEachSet",value:function forEachSet(t){for(var _e72=0;_e72<this.members.length;_e72++)this.members[_e72].forEachSet(t);}}],[{key:"from",value:function from(t){switch(t.length){case 0:return Ze;case 1:return t[0];default:return new _e(t.every(function(t){return t instanceof Xe;})?t:t.reduce(function(t,e){return t.concat(e instanceof Xe?e:e.members);},[]));}}}]);}();hi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},fi=T&&C<=11;ui=/*#__PURE__*/function(){function ui(){_classCallCheck(this,ui);this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}return _createClass(ui,[{key:"set",value:function set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset;}},{key:"clear",value:function clear(){this.anchorNode=this.focusNode=null;}},{key:"eq",value:function eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset;}}]);}();ci=/*#__PURE__*/function(){function ci(t,e){var _this12=this;_classCallCheck(this,ci);this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ui(),this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){for(var _t79=0;_t79<e.length;_t79++)_this12.queue.push(e[_t79]);T&&C<=11&&e.some(function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length;})?_this12.flushSoon():A&&t.composing&&e.some(function(t){return"childList"==t.type&&"TR"==t.target.nodeName;})?(t.input.badSafariComposition=!0,_this12.flushSoon()):_this12.flush();}),fi&&(this.onCharData=function(t){_this12.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),_this12.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this);}return _createClass(ci,[{key:"flushSoon",value:function flushSoon(){var _this13=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){_this13.flushingSoon=-1,_this13.flush();},20));}},{key:"forceFlush",value:function forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush());}},{key:"start",value:function start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,hi)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection();}},{key:"stop",value:function stop(){var _this14=this;if(this.observer){var _t80=this.observer.takeRecords();if(_t80.length){for(var _e74=0;_e74<_t80.length;_e74++)this.queue.push(_t80[_e74]);window.setTimeout(function(){return _this14.flush();},20);}this.observer.disconnect();}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection();}},{key:"connectSelection",value:function connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange);}},{key:"disconnectSelection",value:function disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange);}},{key:"suppressSelectionUpdates",value:function suppressSelectionUpdates(){var _this15=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return _this15.suppressingSelectionUpdates=!1;},50);}},{key:"onSelectionChange",value:function onSelectionChange(){if(qt(this.view)){if(this.suppressingSelectionUpdates)return Rt(this.view);if(T&&C<=11&&!this.view.state.selection.empty){var _t81=this.view.domSelectionRange();if(_t81.focusNode&&p(_t81.focusNode,_t81.focusOffset,_t81.anchorNode,_t81.anchorOffset))return this.flushSoon();}this.flush();}}},{key:"setCurSelection",value:function setCurSelection(){this.currentSelection.set(this.view.domSelectionRange());}},{key:"ignoreSelectionChange",value:function ignoreSelectionChange(t){if(!t.focusNode)return!0;var e,i=new Set();for(var _e75=t.focusNode;_e75;_e75=c(_e75))i.add(_e75);for(var _r46=t.anchorNode;_r46;_r46=c(_r46))if(i.has(_r46)){e=_r46;break;}var r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0;}},{key:"pendingRecords",value:function pendingRecords(){if(this.observer){var _iterator2=_createForOfIteratorHelper(this.observer.takeRecords()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _t82=_step2.value;this.queue.push(_t82);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}return this.queue;}},{key:"flush",value:function flush(){var t=this.view;if(!t.docView||this.flushingSoon>-1)return;var e=this.pendingRecords();e.length&&(this.queue=[]);var i=t.domSelectionRange(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&qt(t)&&!this.ignoreSelectionChange(i),s=-1,l=-1,o=!1,h=[];if(t.editable)for(var _t83=0;_t83<e.length;_t83++){var _i63=this.registerMutation(e[_t83],h);_i63&&(s=s<0?_i63.from:Math.min(_i63.from,s),l=l<0?_i63.to:Math.max(_i63.to,l),_i63.typeOver&&(o=!0));}if(h.some(function(t){return"BR"==t.nodeName;})&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||N&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&e.some(function(t){return"childList"==t.type&&t.removedNodes.length;}))){var _iterator3=_createForOfIteratorHelper(h),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _t84=_step3.value;if("BR"==_t84.nodeName&&_t84.parentNode){var _e76=_t84.nextSibling;for(;_e76&&1==_e76.nodeType;){if("false"==_e76.contentEditable){_t84.parentNode.removeChild(_t84);break;}_e76=_e76.firstChild;}}}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}else if(P&&h.length){var _e77=h.filter(function(t){return"BR"==t.nodeName;});if(2==_e77.length){var _e78=_slicedToArray(_e77,2),_t85=_e78[0],_i64=_e78[1];_t85.parentNode&&_t85.parentNode.parentNode==_i64.parentNode?_i64.remove():_t85.remove();}else{var _i65=this.currentSelection.focusNode;var _iterator4=_createForOfIteratorHelper(_e77),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _r47=_step4.value;var _e79=_r47.parentNode;!_e79||"LI"!=_e79.nodeName||_i65&&mi(t,_i65)==_e79||_r47.remove();}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}}var f=null;s<0&&n&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&k(i)&&(f=Et(t))&&f.eq(r.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Rt(t),this.currentSelection.set(i),t.scrollToSelection()):(s>-1||n)&&(s>-1&&(t.docView.markDirty(s,l),function(t){if(ai.has(t))return;if(ai.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=P,di)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),di=!0;}}(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(t,e){var i;var _t$domSelectionRange5=t.domSelectionRange(),r=_t$domSelectionRange5.focusNode,n=_t$domSelectionRange5.focusOffset;var _iterator5=_createForOfIteratorHelper(e),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _s28=_step5.value;if("TR"==(null===(i=_s28.parentNode)||void 0===i?void 0:i.nodeName)){var _e80=_s28.nextSibling;for(;_e80&&"TD"!=_e80.nodeName&&"TH"!=_e80.nodeName;)_e80=_e80.nextSibling;if(_e80){var _i66=_e80;for(;;){var _t86=_i66.firstChild;if(!_t86||1!=_t86.nodeType||"false"==_t86.contentEditable||/^(BR|IMG)$/.test(_t86.nodeName))break;_i66=_t86;}_i66.insertBefore(_s28,_i66.firstChild),r==_s28&&t.domSelection().collapse(_s28,n);}else _s28.parentNode.removeChild(_s28);}}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}(t,h)),this.handleDOMChange(s,l,o,h),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(i)||Rt(t),this.currentSelection.set(i));}},{key:"registerMutation",value:function registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;var i=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(i==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!i||i.ignoreMutation(t))return null;if("childList"==t.type){for(var _i67=0;_i67<t.addedNodes.length;_i67++){var _r48=t.addedNodes[_i67];e.push(_r48),3==_r48.nodeType&&(this.lastChangedTextNode=_r48);}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(t.target))return{from:i.posBefore,to:i.posAfter};var _r49=t.previousSibling,_n34=t.nextSibling;if(T&&C<=11&&t.addedNodes.length)for(var _e81=0;_e81<t.addedNodes.length;_e81++){var _t$addedNodes$_e=t.addedNodes[_e81],_i68=_t$addedNodes$_e.previousSibling,_s29=_t$addedNodes$_e.nextSibling;(!_i68||Array.prototype.indexOf.call(t.addedNodes,_i68)<0)&&(_r49=_i68),(!_s29||Array.prototype.indexOf.call(t.addedNodes,_s29)<0)&&(_n34=_s29);}var _s30=_r49&&_r49.parentNode==t.target?u(_r49)+1:0,_l22=i.localPosFromDOM(t.target,_s30,-1),_o15=_n34&&_n34.parentNode==t.target?u(_n34):t.target.childNodes.length;return{from:_l22,to:i.localPosFromDOM(t.target,_o15,1)};}return"attributes"==t.type?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=t.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:t.target.nodeValue==t.oldValue});}}]);}();ai=new WeakMap(),di=!1;bi=function bi(t){return function(e){var i=e.pmViewDesc;if(i)return i.parseRule(t);if("BR"==e.nodeName&&e.parentNode){if(A&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var _t87=document.createElement("div");return _t87.appendChild(document.createElement("li")),{skip:_t87};}if(e.parentNode.lastChild==e||A&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0};}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null;};},gi=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;_export("E",yi=/*#__PURE__*/function(){function yi(t,e){var _this16=this;_classCallCheck(this,yi);this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new me(),this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Si),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=xi(this),Di(this),this.nodeViews=Oi(this),this.docView=pt(this.state.doc,vi(this),oi(this),this.dom,this),this.domObserver=new ci(this,function(t,e,i,r){return wi(_this16,t,e,i,r);}),this.domObserver.start(),function(t){var _loop4=function _loop4(){var i=ae[_e92];t.dom.addEventListener(_e92,t.input.eventHandlers[_e92]=function(e){!ke(t,e)||we(t,e)||!t.editable&&e.type in de||i(t,e);},pe[_e92]?{passive:!0}:void 0);};for(var _e92 in ae){_loop4();}A&&t.dom.addEventListener("input",function(){return null;}),ge(t);}(this),this.updatePluginViews();}return _createClass(yi,[{key:"composing",get:function get(){return this.input.composing;}},{key:"props",get:function get(){if(this._props.state!=this.state){var _t94=this._props;this._props={};for(var _e93 in _t94)this._props[_e93]=_t94[_e93];this._props.state=this.state;}return this._props;}},{key:"update",value:function update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ge(this);var e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Si),this.directPlugins=t.plugins),this.updateStateInner(t.state,e);}},{key:"setProps",value:function setProps(t){var e={};for(var _t95 in this._props)e[_t95]=this._props[_t95];e.state=this.state;for(var _i75 in t)e[_i75]=t[_i75];this.update(e);}},{key:"updateState",value:function updateState(t){this.updateStateInner(t,this._props);}},{key:"updateStateInner",value:function updateStateInner(t,e){var i;var r=this.state,n=!1,s=!1;t.storedMarks&&this.composing&&($e(this),s=!0),this.state=t;var l=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(l||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){var _t96=Oi(this);(function(t,e){var i=0,r=0;for(var _r51 in t){if(t[_r51]!=e[_r51])return!0;i++;}for(var _t97 in e)r++;return i!=r;})(_t96,this.nodeViews)&&(this.nodeViews=_t96,n=!0);}(l||e.handleDOMEvents!=this._props.handleDOMEvents)&&ge(this),this.editable=xi(this),Di(this);var o=oi(this),h=vi(this),f=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=n||!this.docView.matchesNode(t.doc,h,o);!u&&t.selection.eq(r.selection)||(s=!0);var c="preserve"==f&&s&&null==this.dom.style.overflowAnchor&&function(t){var e,i,r=t.dom.getBoundingClientRect(),n=Math.max(0,r.top);for(var _s31=(r.left+r.right)/2,_l23=n+1;_l23<Math.min(innerHeight,r.bottom);_l23+=5){var _r52=t.root.elementFromPoint(_s31,_l23);if(!_r52||_r52==t.dom||!t.dom.contains(_r52))continue;var _o16=_r52.getBoundingClientRect();if(_o16.top>=n-20){e=_r52,i=_o16.top;break;}}return{refDOM:e,refTop:i,stack:V(t.dom)};}(this);if(s){this.domObserver.stop();var _e94=u&&(T||N)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&function(t,e){var i=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(i)!=e.$anchor.start(i);}(r.selection,t.selection);if(u){var _i76=N?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ie(this)),!n&&this.docView.update(t.doc,h,o,this)||(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=pt(t.doc,h,o,this.dom,this)),!_i76||this.trackWrites&&this.dom.contains(this.trackWrites)||(_e94=!0);}var _i77=this.input.mouseDown;_e94||!(_i77&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){var e=t.docView.domFromPos(t.state.selection.anchor,0),i=t.domSelectionRange();return p(e.node,e.offset,i.anchorNode,i.anchorOffset);}(this)&&_i77.delaySelUpdate())?Rt(this,_e94):(Ft(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start();}this.updatePluginViews(r),(null===(i=this.dragging)||void 0===i?void 0:i.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==f?this.dom.scrollTop=0:"to selection"==f?this.scrollToSelection():c&&function(_ref7){var t=_ref7.refDOM,e=_ref7.refTop,i=_ref7.stack;var r=t?t.getBoundingClientRect().top:0;z(i,0==r?0:r-e);}(c);}},{key:"scrollToSelection",value:function scrollToSelection(){var _this17=this;var e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode)){if(this.someProp("handleScrollToSelection",function(t){return t(_this17);}));else if(this.state.selection instanceof t){var _t98=this.docView.domAfterPos(this.state.selection.from);1==_t98.nodeType&&j(this,_t98.getBoundingClientRect(),e);}else j(this,this.coordsAtPos(this.state.selection.head,1),e);}else;}},{key:"destroyPluginViews",value:function destroyPluginViews(){var t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy();}},{key:"updatePluginViews",value:function updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var _e95=0;_e95<this.pluginViews.length;_e95++){var _i78=this.pluginViews[_e95];_i78.update&&_i78.update(this,t);}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var _t99=0;_t99<this.directPlugins.length;_t99++){var _e96=this.directPlugins[_t99];_e96.spec.view&&this.pluginViews.push(_e96.spec.view(this));}for(var _t100=0;_t100<this.state.plugins.length;_t100++){var _e97=this.state.plugins[_t100];_e97.spec.view&&this.pluginViews.push(_e97.spec.view(this));}}}},{key:"updateDraggedNode",value:function updateDraggedNode(e,i){var r=e.node,n=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)n=r.from;else{var _t101=r.from+(this.state.doc.content.size-i.doc.content.size);(_t101>0&&_t101<this.state.doc.content.size&&this.state.doc.nodeAt(_t101))==r.node&&(n=_t101);}this.dragging=new He(e.slice,e.move,n<0?void 0:t.create(this.state.doc,n));}},{key:"someProp",value:function someProp(t,e){var i,r=this._props&&this._props[t];if(null!=r&&(i=e?e(r):r))return i;for(var _r53=0;_r53<this.directPlugins.length;_r53++){var _n35=this.directPlugins[_r53].props[t];if(null!=_n35&&(i=e?e(_n35):_n35))return i;}var n=this.state.plugins;if(n)for(var _r54=0;_r54<n.length;_r54++){var _s32=n[_r54].props[t];if(null!=_s32&&(i=e?e(_s32):_s32))return i;}}},{key:"hasFocus",value:function hasFocus(){if(T){var _t102=this.root.activeElement;if(_t102==this.dom)return!0;if(!_t102||!this.dom.contains(_t102))return!1;for(;_t102&&this.dom!=_t102&&this.dom.contains(_t102);){if("false"==_t102.contentEditable)return!1;_t102=_t102.parentElement;}return!0;}return this.root.activeElement==this.dom;}},{key:"focus",value:function focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(G)return t.focus(G);var e=V(t);t.focus(null==G?{get preventScroll(){return G={preventScroll:!0},!0;}}:void 0),G||(G=!1,z(e,0));}(this.dom),Rt(this),this.domObserver.start();}},{key:"root",get:function get(){var _this18=this;var t=this._root;if(null==t){var _loop5=function _loop5(_t103){if(9==_t103.nodeType||11==_t103.nodeType&&_t103.host)return{v:(_t103.getSelection||(Object.getPrototypeOf(_t103).getSelection=function(){return _t103.ownerDocument.getSelection();}),_this18._root=_t103)};},_ret3;for(var _t103=this.dom.parentNode;_t103;_t103=_t103.parentNode){_ret3=_loop5(_t103);if(_ret3)return _ret3.v;}}return t||document;}},{key:"updateRoot",value:function updateRoot(){this._root=null;}},{key:"posAtCoords",value:function posAtCoords(t){return Q(this,t);}},{key:"coordsAtPos",value:function coordsAtPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return tt(this,t,e);}},{key:"domAtPos",value:function domAtPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.docView.domFromPos(t,e);}},{key:"nodeDOM",value:function nodeDOM(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null;}},{key:"posAtDOM",value:function posAtDOM(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var r=this.docView.posFromDOM(t,e,i);if(null==r)throw new RangeError("DOM position not inside the editor");return r;}},{key:"endOfTextblock",value:function endOfTextblock(t,e){return ht(this,e||this.state,t);}},{key:"pasteHTML",value:function pasteHTML(t,e){return Le(this,"",t,!1,e||new ClipboardEvent("paste"));}},{key:"pasteText",value:function pasteText(t,e){return Le(this,t,null,!0,e||new ClipboardEvent("paste"));}},{key:"serializeForClipboard",value:function serializeForClipboard(t){return ee(this,t);}},{key:"destroy",value:function destroy(){this.docView&&(!function(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(var _e98 in t.input.eventHandlers)t.dom.removeEventListener(_e98,t.input.eventHandlers[_e98]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout);}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],oi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,a=null);}},{key:"isDestroyed",get:function get(){return null==this.docView;}},{key:"dispatchEvent",value:function dispatchEvent(t){return function(t,e){we(t,e)||!ae[e.type]||!t.editable&&e.type in de||ae[e.type](t,e);}(this,t);}},{key:"domSelectionRange",value:function domSelectionRange(){var t=this.domSelection();return t?A&&11===this.root.nodeType&&function(t){var e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e;}(this.dom.ownerDocument)==this.dom&&function(t,e){if(e.getComposedRanges){var _i79=e.getComposedRanges(t.root)[0];if(_i79)return pi(t,_i79);}var i;function r(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0];}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),i?pi(t,i):null;}(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0};}},{key:"domSelection",value:function domSelection(){return this.root.getSelection();}}]);}());yi.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t));};}};});
|
|
2
|
+
//# sourceMappingURL=index-3ca67627.cjs.js.map
|