"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8774],{27743:function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(){return(r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}}).apply(this,arguments)}function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return l(e)}(this,n)}}function l(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n2),q=L||!!C&&/Mac/.test(C.platform),K=/Android \d/.test(x),_=!!M&&"webkitFontSmoothing"in M.documentElement.style,$=_?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function W(e,t){return"number"==typeof e?e:e[t]}function H(e,t,n){for(var o=e.someProp("scrollThreshold")||0,r=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=n||e.dom;s;s=g(s))if(1==s.nodeType){var a=s,l=a==i.body,c=l?{left:0,right:i.documentElement.clientWidth,top:0,bottom:i.documentElement.clientHeight}:function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,o=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*o}}(a),d=0,u=0;if(t.topc.bottom-W(o,"bottom")&&(u=t.bottom-c.bottom+W(r,"bottom")),t.leftc.right-W(o,"right")&&(d=t.right-c.right+W(r,"right")),d||u){if(l)i.defaultView.scrollBy(d,u);else{var f=a.scrollLeft,h=a.scrollTop;u&&(a.scrollTop+=u),d&&(a.scrollLeft+=d);var p=a.scrollLeft-f,v=a.scrollTop-h;t={left:t.left-p,top:t.top-v,right:t.right-p,bottom:t.bottom-v}}}if(l)break}}function j(e){for(var t=[],n=e.ownerDocument,o=e;o&&(t.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),e!=n);o=g(o));return t}function G(e,t){for(var n=0;n=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Y(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var J=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Q(e,t,n){var o=e.docView.domFromPos(t,n<0?-1:1),r=o.node,i=o.offset,s=o.atom,a=_||R;if(3==r.nodeType){if(a&&(J.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){var l=Y(b(r,i,i),n);if(R&&i&&/\s/.test(r.nodeValue[i-1])&&i=0&&i==r.nodeValue.length?(u--,h=1):n<0?u--:f++,Z(Y(b(r,u,f),1),h<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==D(r))){var p=r.childNodes[i-1];if(1==p.nodeType)return ee(p.getBoundingClientRect(),!1)}if(null==s&&i=0)}if(null==s&&i&&(n<0||i==D(r))){var m=r.childNodes[i-1],g=3==m.nodeType?b(m,D(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(g)return Z(Y(g,1),!1)}if(null==s&&i=0)}function Z(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ee(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function et(e,t,n){var o=e.state,r=e.root.activeElement;o!=t&&e.updateState(t),r!=e.dom&&e.focus();try{return n()}finally{o!=t&&e.updateState(o),r!=e.dom&&r&&r.focus()}}var en=/[\u0590-\u08ac]/,eo=null,er=null,ei=!1,es=function(){function e(t,n,o,r){d(this,e),this.parent=t,this.children=n,this.dom=o,this.contentDOM=r,this.dirty=0,o.pmViewDesc=this}return f(e,[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;tm(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var o,r,i,s,a,l=e;;l=l.parentNode){if(l==this.dom){a=!1;break}if(l.previousSibling)break}if(null==a&&t==e.childNodes.length)for(var c=e;;c=c.parentNode){if(c==this.dom){a=!0;break}if(c.nextSibling)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,o=e;o;o=o.parentNode){var r=this.getDesc(o),i=void 0;if(r&&(!t||r.node)){if(!n||!(i=r.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return r;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var o=e;o;o=o.parentNode){var r=this.getDesc(o);if(r)return r.localPosFromDOM(e,t,n)}return -1}},{key:"descAt",value:function(e){for(var t=0,n=0;te||i instanceof eh){o=e-r;break}r=s}if(o)return this.children[n].domFromPos(o-this.children[n].border,t);for(;n&&!(a=this.children[n-1]).size&&a instanceof ea&&a.side>=0;n--);if(t<=0){for(var a,l,c=!0;(l=n?this.children[n-1]:null)&&l.dom.parentNode!=this.contentDOM;n--,c=!1);return l&&t&&c&&!l.border&&!l.domAtom?l.domFromPos(l.size,t):{node:this.contentDOM,offset:l?m(l.dom)+1:0}}for(var d,u=!0;(d=n2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var o=-1,r=-1,i=n,s=0;;s++){var a=this.children[s],l=i+a.size;if(-1==o&&e<=l){var c=i+a.border;if(e>=c&&t<=l-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,c);e=i;for(var d=s;d>0;d--){var u=this.children[d-1];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(1)){o=m(u.dom)+1;break}e-=u.size}-1==o&&(o=0)}if(o>-1&&(l>t||s==this.children.length-1)){t=l;for(var f=s+1;f3&&void 0!==arguments[3]&&arguments[3],r=Math.min(e,t),i=Math.max(e,t),s=0,a=0;sa&&it){var O=d;d=u,u=O}var C=document.createRange();C.setEnd(u.node,u.offset),C.setStart(d.node,d.offset),f.removeAllRanges(),f.addRange(C)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,o=0;o=n:en){var s=n+r.border,a=i-r.border;if(e>=s&&t<=a){this.dirty=e==n||t==i?2:1,e==s&&t==a&&(r.contentLost||r.dom.parentNode!=this.contentDOM)?r.dirty=3:r.markDirty(e-s,t-s);return}r.dirty=r.dom!=r.contentDOM||r.dom.parentNode!=this.contentDOM||r.children.length?3:2}n=i}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty0&&(i=eN(i,0,e,o));for(var a=0;a=0;n--){var o=this.children[n];if(this.dom.contains(o.dom.parentNode)){t.contentElement=o.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return p.Fragment.empty})}else t.contentElement=this.contentDOM}else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ek(t,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(e,t){var n=this,o=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new eS(this,s&&s.node,e);(function(e,t,n,o){var r=t.locals(e),i=0;if(0==r.length){for(var s=0;si;)c.push(r[l++]);var y=i+v.nodeSize;if(v.isText){var b=y;l=0&&!s&&l.syncToMarks(i==n.node.childCount?p.Mark.none:n.node.child(i).marks,o,e),l.placeWidget(t,e,r)},function(t,n,s,c){var d;l.syncToMarks(t.marks,o,e),l.findNodeMatch(t,n,s,c)||a&&e.state.selection.from>r&&e.state.selection.to-1&&l.updateNodeAt(t,n,s,d,e)||l.updateNextNode(t,n,s,e,c)||l.addNode(t,n,s,e,r),r+=t.nodeSize}),l.syncToMarks([],o,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),function e(t,n,o){for(var r=t.firstChild,i=!1,s=0;st+this.node.content.size)return null;var i=e.domSelectionRange(),s=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=D(e=e.childNodes[t-1])}else{if(1!=e.nodeType||!(t=n){var d=a=0&&d+t.length+a>=n)return a+d;if(n==o&&l.length>=o+t.length-a&&l.slice(o-a,o-a+t.length)==t)return o}}}return -1}(this.node.content,a,o-t,r-t);return l<0?null:{node:s,pos:l,text:a}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,o=t.pos,r=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var s=new el(this,i,n,r);e.input.compositionNodes.push(s),this.children=eN(this.children,o,o+r.length,e,s)}}},{key:"update",value:function(e,t,n,o){return!!(3!=this.dirty&&e.sameMarkup(this.node))&&(this.updateInner(e,t,n,o),!0)}},{key:"updateInner",value:function(e,t,n,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!ek(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ey(this.dom,this.nodeDOM,eg(this.outerDeco,this.node,t),eg(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(e,t,o,r,i,s){var a,l=i.nodeViews[t.type.name],c=l&&l(t,i,function(){return a?a.parent?a.parent.posBeforeChild(a):void 0:s},o,r),d=c&&c.dom,u=c&&c.contentDOM;if(t.isText){if(d){if(3!=d.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(t.text)}else if(!d){var f=p.DOMSerializer.renderSpec(document,t.type.spec.toDOM(t));d=f.dom,u=f.contentDOM}u||t.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));var h=d;return(d=eb(d,o,t),c)?a=new ep(e,t,o,r,d,u||null,h,c,i,s+1):t.isText?new ef(e,t,o,r,d,h,i):new n(e,t,o,r,d,u||null,h,i,s+1)}}]),n}(es);function eu(e,t,n,o,r){return eb(o,t,e),new ed(void 0,e,t,n,o,o,o,r,0)}var ef=function(e){i(n,e);var t=a(n);function n(e,o,r,i,s,a,l){return d(this,n),t.call(this,e,o,r,i,s,null,a,l,0)}return f(n,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,o){return!!(3!=this.dirty&&(0==this.dirty||this.inParent())&&e.sameMarkup(this.node))&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,t,o){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):r(c(n.prototype),"localPosFromDOM",this).call(this,e,t,o)}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,t,o){var r=this.node.cut(e,t),i=document.createTextNode(r.text);return new n(this.parent,r,this.outerDeco,this.innerDeco,i,i,o)}},{key:"markDirty",value:function(e,t){r(c(n.prototype),"markDirty",this).call(this,e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(ed),eh=function(e){i(n,e);var t=a(n);function n(){return d(this,n),t.apply(this,arguments)}return f(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(es),ep=function(e){i(n,e);var t=a(n);function n(e,o,r,i,s,a,l,c,u,f){var h;return d(this,n),(h=t.call(this,e,o,r,i,s,a,l,u,f)).spec=c,h}return f(n,[{key:"update",value:function(e,t,o,i){if(3==this.dirty)return!1;if(this.spec.update){var s=this.spec.update(e,t,o);return s&&this.updateInner(e,t,o,i),s}return(!!this.contentDOM||!!e.isLeaf)&&r(c(n.prototype),"update",this).call(this,e,t,o,i)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():r(c(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():r(c(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,o,i){this.spec.setSelection?this.spec.setSelection(e,t,o):r(c(n.prototype),"setSelection",this).call(this,e,t,o,i)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),r(c(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):r(c(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(ed),ev=function(e){e&&(this.nodeName=e)};ev.prototype=Object.create(null);var em=[new ev];function eg(e,t,n){if(0==e.length)return em;for(var o=n?em[0]:new ev,r=[o],i=0;i0;){for(var a=void 0;;)if(o){var l=n.children[o-1];if(l instanceof ec)n=l,o=l.children.length;else{a=l,o--;break}}else if(n==t)break e;else o=n.parent.children.indexOf(n),n=n.parent;var c=a.node;if(c){if(c!=e.child(r-1))break;--r,i.set(a,r),s.push(a)}}return{index:r,matched:i,matches:s.reverse()}}(t.node.content,t)}return f(e,[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(r,e.length);o-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=ec.create(this.top,e[r],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,r++}}},{key:"findNodeMatch",value:function(e,t,n,o){var r,i=-1;if(o>=this.preMatch.index&&(r=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&r.matchesNode(e,t,n))i=this.top.children.indexOf(r,this.index);else for(var s=this.index,a=Math.min(this.top.children.length,s+5);s=n||d<=t?i.push(l):(cn&&i.push(l.slice(n-c,l.size,o)))}return i}function eO(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelectionRange(),o=e.state.doc;if(!n.focusNode)return null;var r=e.docView.nearestDesc(n.focusNode),i=r&&0==r.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;var a,l,c=o.resolve(s);if(N(n)){for(a=c;r&&!r.node;)r=r.parent;var d=r.node;if(r&&d.isAtom&&h.NodeSelection.isSelectable(d)&&r.parent&&!(d.isInline&&function(e,t,n){for(var o=0==t,r=t==D(e);o||r;){if(e==n)return!0;var i=m(e);if(!(e=e.parentNode))return!1;o=o&&0==i,r=r&&i==D(e)}}(n.focusNode,n.focusOffset,r.dom))){var u=r.posBefore;l=new h.NodeSelection(s==u?c:o.resolve(u))}}else{var f=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;a=o.resolve(f)}if(!l){var p="pointer"==t||e.state.selection.head1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(eA(e,n),eC(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&F){var o=e.domSelectionRange(),r=e.domObserver.currentSelection;if(o.anchorNode&&r.anchorNode&&k(o.anchorNode,o.anchorOffset,r.anchorNode,r.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)i=e.domSelection(),s=document.createRange(),(l="IMG"==(a=e.cursorWrapper.dom).nodeName)?s.setEnd(a.parentNode,m(a)+1):s.setEnd(a,0),s.collapse(!1),i.removeAllRanges(),i.addRange(s),!l&&!e.state.selection.visible&&A&&V<=11&&(a.disabled=!0,a.disabled=!1);else{var i,s,a,l,c,d,u,f,p,v,g=n.anchor,y=n.head;!ex||n instanceof h.TextSelection||(n.$from.parent.inlineContent||(p=eT(e,n.from)),n.empty||n.$from.parent.inlineContent||(v=eT(e,n.to))),e.docView.setSelection(g,y,e.root,t),ex&&(p&&eP(p),v&&eP(v)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((c=e.dom.ownerDocument).removeEventListener("selectionchange",e.input.hideSelectionGuard),u=(d=e.domSelectionRange()).anchorNode,f=d.anchorOffset,c.addEventListener("selectionchange",e.input.hideSelectionGuard=function(){(d.anchorNode!=u||d.anchorOffset!=f)&&(c.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(function(){(!eC(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var ex=I||F&&z<63;function eT(e,t){var n=e.docView.domFromPos(t,0),o=n.node,r=n.offset,i=r0?o.max(r):o.min(r),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&h.Selection.findFrom(s,t)}function eI(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function eL(e,t,n){var o=e.state.selection;if(o instanceof h.TextSelection){if(!o.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var r=ez(e.state,t);return!!r&&r instanceof h.NodeSelection&&eI(e,r)}if(!(q&&n.indexOf("m")>-1)){var i,s=o.$head,a=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!a||a.isText)return!1;var l=t<0?s.pos-a.nodeSize:s.pos;return!!(a.isAtom||(i=e.docView.descAt(l))&&!i.contentDOM)&&(h.NodeSelection.isSelectable(a)?eI(e,new h.NodeSelection(t<0?e.state.doc.resolve(s.pos-a.nodeSize):s)):!!_&&eI(e,new h.TextSelection(e.state.doc.resolve(t<0?l:l+a.nodeSize))))}}else{if(o instanceof h.NodeSelection&&o.node.isInline)return eI(e,new h.TextSelection(t>0?o.$to:o.$from));var c=ez(e.state,t);return!!c&&eI(e,c)}}function eq(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function eK(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function e_(e){var t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(n){var r,i,s=!1;for(R&&1==n.nodeType&&o0){if(1!=n.nodeType)break;var a=n.childNodes[o-1];if(eK(a))r=n,i=--o;else if(3==a.nodeType)o=(n=a).nodeValue.length;else break}else if(eW(n))break;else{for(var l=n.previousSibling;l&&eK(l);)r=n.parentNode,i=m(l),l=l.previousSibling;if(l)o=eq(n=l);else{if((n=n.parentNode)==e.dom)break;o=0}}s?eH(e,n,o):r&&eH(e,r,i)}}function e$(e){var t,n,o=e.domSelectionRange(),r=o.focusNode,i=o.focusOffset;if(r){for(var s=eq(r);;)if(i-1||q&&n.indexOf("m")>-1)return!1;var r=o.$from,i=o.$to;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var s=ez(e.state,t);if(s&&s instanceof h.NodeSelection)return eI(e,s)}if(!r.parent.inlineContent){var a=t<0?r:i,l=o instanceof h.AllSelection?h.Selection.near(a,t):h.Selection.findFrom(a,t);return!!l&&eI(e,l)}return!1}function eG(e,t){if(!(e.state.selection instanceof h.TextSelection))return!0;var n=e.state.selection,o=n.$head,r=n.$anchor,i=n.empty;if(!o.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var s=!o.textOffset&&(t<0?o.nodeBefore:o.nodeAfter);if(s&&!s.isText){var a=e.state.tr;return t<0?a.delete(o.pos-s.nodeSize,o.pos):a.delete(o.pos,o.pos+s.nodeSize),e.dispatch(a),!0}return!1}function eU(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function eX(e,t){e.someProp("transformCopied",function(n){t=n(t,e)});for(var n=[],o=t.content,r=t.openStart,i=t.openEnd;r>1&&i>1&&1==o.childCount&&1==o.firstChild.childCount;){r--,i--;var s=o.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),o=s.content}var a=e.someProp("clipboardSerializer")||p.DOMSerializer.fromSchema(e.state.schema),l=e3(),c=l.createElement("div");c.appendChild(a.serializeFragment(o,{document:l}));for(var d,u=c.firstChild,f=0;u&&1==u.nodeType&&(d=e1[u.nodeName.toLowerCase()]);){for(var h=d.length-1;h>=0;h--){for(var v=l.createElement(d[h]);c.firstChild;)v.appendChild(c.firstChild);c.appendChild(v),f++}u=c.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice","".concat(r," ").concat(i).concat(f?" -".concat(f):""," ").concat(JSON.stringify(n))),{dom:c,text:e.someProp("clipboardTextSerializer",function(n){return n(t,e)})||t.content.textBetween(0,t.content.size,"\n\n")}}function eY(e,t,n,r,i){var s,a,l=i.parent.type.spec.code;if(!n&&!t)return null;var c=t&&(r||l||!n);if(c){if(e.someProp("transformPastedText",function(n){t=n(t,l||r,e)}),l)return t?new p.Slice(p.Fragment.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):p.Slice.empty;var d=e.someProp("clipboardTextParser",function(n){return n(t,i,r,e)});if(d)a=d;else{var u=i.marks(),f=e.state.schema,h=p.DOMSerializer.fromSchema(f);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(function(e){var t=s.appendChild(document.createElement("p"));e&&t.appendChild(h.serializeNode(f.text(e,u)))})}}else e.someProp("transformPastedHTML",function(t){n=t(n,e)}),s=function(e){var t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,o=e3().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e);if((n=r&&e1[r[1].toLowerCase()])&&(e=n.map(function(e){return"<"+e+">"}).join("")+e+n.map(function(e){return""}).reverse().join("")),o.innerHTML=e,n)for(var i=0;i0;g--){for(var y=s.firstChild;y&&1!=y.nodeType;)y=y.nextSibling;if(!y)break;s=y}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||p.DOMParser.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||m),context:i,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||eJ.test(e.parentNode.nodeName)?null:{ignore:!0}}})),m)a=function(e,t){if(!e.size)return e;var n,o=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}for(var r=e.content,i=e.openStart,s=e.openEnd,a=n.length-2;a>=0;a-=2){var l=o.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;r=p.Fragment.from(l.create(n[a+1],r)),i++,s++}return new p.Slice(r,i,s)}(e0(a,+m[1],+m[2]),m[4]);else if((a=p.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=t.depth;n>=0;n--){var r=function(n){var o=t.node(n).contentMatchAt(t.index(n)),r=void 0,i=[];if(e.forEach(function(e){if(i){var t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&function e(t,n,o,r,i){if(i2&&void 0!==arguments[2]?arguments[2]:0,o=t.length-1;o>=n;o--)e=t[o].create(null,p.Fragment.from(e));return e}function eZ(e,t,n,o,r,i){var s=t<0?e.firstChild:e.lastChild,a=s.content;return r=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||i<=r).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(p.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function e0(e,t,n){return ts.depth?t(e,n,s.nodeAfter,s.before(o),i,!0):t(e,n,s.node(o),s.before(o),i,!1)}))return{v:!0}},l=s.depth+1;l>0;l--){var c=a(l);if("object"===o(c))return c.v}return!1}function to(e,t,n){e.focused||e.focus();var o=e.state.tr.setSelection(t);"pointer"==n&&o.setMeta("pointer",!0),e.dispatch(o)}e8.keydown=function(e,t){if(e.input.shiftKey=16==t.keyCode||t.shiftKey,!ts(e,t)&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!K||!F||13!=t.keyCode)){if(229!=t.keyCode&&e.domObserver.forceFlush(),!L||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",function(n){return n(e,t)})||function(e,t){var n,o=t.keyCode,r=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==o||q&&72==o&&"c"==r)return eG(e,-1)||e_(e);if(46==o||q&&68==o&&"c"==r)return eG(e,1)||e$(e);if(13==o||27==o)return!0;if(37==o||q&&66==o&&"c"==r)return eL(e,-1,r)||e_(e);if(39==o||q&&70==o&&"c"==r)return eL(e,1,r)||e$(e);if(38==o||q&&80==o&&"c"==r)return ej(e,-1,r)||e_(e);if(40==o||q&&78==o&&"c"==r)return function(e){if(!I||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(n&&1==n.nodeType&&0==o&&n.firstChild&&"false"==n.firstChild.contentEditable){var r=n.firstChild;eU(e,r,"true"),setTimeout(function(){return eU(e,r,"false")},20)}return!1}(e)||ej(e,1,r)||e$(e);else if(r==(q?"m":"c")&&(66==o||73==o||89==o||90==o))return!0;return!1}(e,t)?t.preventDefault():e9(e,"key");else{var n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(function(){e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",function(t){return t(e,O(13,"Enter"))}),e.input.lastIOSEnter=0)},200)}}},e8.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},e8.keypress=function(e,t){if(!ts(e,t)&&t.charCode&&(!t.ctrlKey||t.altKey)&&(!q||!t.metaKey)){if(e.someProp("handleKeyPress",function(n){return n(e,t)})){t.preventDefault();return}var n=e.state.selection;if(!(n instanceof h.TextSelection)||!n.$from.sameParent(n.$to)){var o=String.fromCharCode(t.charCode);/[\r\n]/.test(o)||e.someProp("handleTextInput",function(t){return t(e,n.$from.pos,n.$to.pos,o)})||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),t.preventDefault()}}};var tr=q?"metaKey":"ctrlKey";e5.mousedown=function(e,t){e.input.shiftKey=t.shiftKey;var n,o,r,i=td(e),s=Date.now(),a="singleClick";s-e.input.lastClick.time<500&&(o=(n=e.input.lastClick).x-t.clientX)*o+(r=n.y-t.clientY)*r<100&&!t[tr]&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:a};var l=e.posAtCoords(tt(t));l&&("singleClick"==a?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ti(e,l,t,!!i)):("doubleClick"==a?function(e,t,n,o){return tn(e,"handleDoubleClickOn",t,n,o)||e.someProp("handleDoubleClick",function(n){return n(e,t,o)})}:function(e,t,n,o){return tn(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",function(n){return n(e,t,o)})||function(e,t,n){if(0!=n.button)return!1;var o=e.state.doc;if(-1==t)return!!o.inlineContent&&(to(e,h.TextSelection.create(o,0,o.content.size),"pointer"),!0);for(var r=o.resolve(t),i=r.depth+1;i>0;i--){var s=i>r.depth?r.nodeAfter:r.node(i),a=r.before(i);if(s.inlineContent)to(e,h.TextSelection.create(o,a+1,a+1+s.content.size),"pointer");else{if(!h.NodeSelection.isSelectable(s))continue;to(e,h.NodeSelection.create(o,a),"pointer")}return!0}}(e,n,o)})(e,l.pos,l.inside,t)?t.preventDefault():e9(e,"pointer"))};var ti=function(){function e(t,n,o,r){var i,s,a=this;if(d(this,e),this.view=t,this.pos=n,this.event=o,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!o[tr],this.allowDefault=o.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),s=n.inside;else{var l=t.state.doc.resolve(n.pos);i=l.parent,s=l.depth?l.before():0}var c=r?null:o.target,u=c?t.docView.nearestDesc(c,!0):null;this.target=u?u.dom:null;var f=t.state.selection;(0==o.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||f instanceof h.NodeSelection&&f.from<=s&&f.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&R&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){a.view.input.mouseDown==a&&a.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),e9(t,"pointer")}return f(e,[{key:"done",value:function(){var e=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return eM(e.view)}),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t,n,o,r,i=this.pos;(this.view.state.doc!=this.startDoc&&(i=this.view.posAtCoords(tt(e))),this.updateAllowDefault(e),this.allowDefault||!i)?e9(this.view,"pointer"):(t=this.view,n=i.pos,o=i.inside,r=this.selectNode,tn(t,"handleClickOn",n,o,e)||t.someProp("handleClick",function(o){return o(t,n,e)})||(r?function(e,t){if(-1==t)return!1;var n,o,r=e.state.selection;r instanceof h.NodeSelection&&(n=r.node);for(var i=e.state.doc.resolve(t),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(h.NodeSelection.isSelectable(a)){o=n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?i.before(r.$from.depth):i.before(s);break}}return null!=o&&(to(e,h.NodeSelection.create(e.state.doc,o),"pointer"),!0)}(t,o):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),o=n.nodeAfter;return!!(o&&o.isAtom&&h.NodeSelection.isSelectable(o))&&(to(e,new h.NodeSelection(n),"pointer"),!0)}(t,o)))?e.preventDefault():0==e.button&&(this.flushed||I&&this.mightDrag&&!this.mightDrag.node.isAtom||F&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(i.pos-this.view.state.selection.from),Math.abs(i.pos-this.view.state.selection.to)))?(to(this.view,h.Selection.near(this.view.state.doc.resolve(i.pos)),"pointer"),e.preventDefault()):e9(this.view,"pointer")}}},{key:"move",value:function(e){this.updateAllowDefault(e),e9(this.view,"pointer"),0==e.buttons&&this.done()}},{key:"updateAllowDefault",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}]),e}();function ts(e,t){return!!e.composing||!!(I&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}e5.touchstart=function(e){e.input.lastTouch=Date.now(),td(e),e9(e,"pointer")},e5.touchmove=function(e){e.input.lastTouch=Date.now(),e9(e,"pointer")},e5.contextmenu=function(e){return td(e)};var ta=K?5e3:-1;function tl(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(function(){return td(e)},t))}function tc(e){var t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function td(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!K||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),tc(e),t||e.docView&&e.docView.dirty){var n=eO(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}e8.compositionstart=e8.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(function(e){return!1===e.type.spec.inclusive})))e.markCursor=e.state.storedMarks||n.marks(),td(e,!0),e.markCursor=null;else if(td(e),R&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var o=e.domSelectionRange(),r=o.focusNode,i=o.focusOffset;r&&1==r.nodeType&&0!=i;){var s=i<0?r.lastChild:r.childNodes[i-1];if(!s)break;if(3==s.nodeType){e.domSelection().collapse(s,s.nodeValue.length);break}r=s,i=-1}e.input.composing=!0}tl(e,ta)},e8.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,tl(e,20))};var tu=A&&V<15||L&&$<604;function tf(e,t,n,o,r){var i=eY(e,t,n,o,e.state.selection.$from);if(e.someProp("handlePaste",function(t){return t(e,r,i||p.Slice.empty)}))return!0;if(!i)return!1;var s=0==i.openStart&&0==i.openEnd&&1==i.content.childCount?i.content.firstChild:null,a=s?e.state.tr.replaceSelectionWith(s,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}e5.copy=e8.cut=function(e,t){var n=e.state.selection,o="cut"==t.type;if(!n.empty){var r=tu?null:t.clipboardData,i=eX(e,n.content()),s=i.dom,a=i.text;r?(t.preventDefault(),r.clearData(),r.setData("text/html",s.innerHTML),r.setData("text/plain",a)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var o=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),o.removeAllRanges(),o.addRange(r),setTimeout(function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},e8.paste=function(e,t){if(!e.composing||K){var n=tu?null:t.clipboardData;n&&tf(e,n.getData("text/plain"),n.getData("text/html"),e.input.shiftKey,t)?t.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,o=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus(),setTimeout(function(){e.focus(),o.parentNode&&o.parentNode.removeChild(o),n?tf(e,o.value,null,e.input.shiftKey,t):tf(e,o.textContent,o.innerHTML,e.input.shiftKey,t)},50)}}(e,t)}};var th=f(function e(t,n){d(this,e),this.slice=t,this.move=n}),tp=q?"altKey":"ctrlKey";for(var tv in e5.dragstart=function(e,t){var n=e.input.mouseDown;if(n&&n.done(),t.dataTransfer){var o=e.state.selection,r=o.empty?null:e.posAtCoords(tt(t));if(r&&r.pos>=o.from&&r.pos<=(o instanceof h.NodeSelection?o.to-1:o.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(h.NodeSelection.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var i=e.docView.nearestDesc(t.target,!0);i&&i.node.type.spec.draggable&&i!=e.docView&&e.dispatch(e.state.tr.setSelection(h.NodeSelection.create(e.state.doc,i.posBefore)))}var s=e.state.selection.content(),a=eX(e,s),l=a.dom,c=a.text;t.dataTransfer.clearData(),t.dataTransfer.setData(tu?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",tu||t.dataTransfer.setData("text/plain",c),e.dragging=new th(s,!t[tp])}},e5.dragend=function(e){var t=e.dragging;window.setTimeout(function(){e.dragging==t&&(e.dragging=null)},50)},e8.dragover=e8.dragenter=function(e,t){return t.preventDefault()},e8.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var o=e.posAtCoords(tt(t));if(o){var r=e.state.doc.resolve(o.pos),i=n&&n.slice;i?e.someProp("transformPasted",function(t){i=t(i,e)}):i=eY(e,t.dataTransfer.getData(tu?"Text":"text/plain"),tu?null:t.dataTransfer.getData("text/html"),!1,r);var s=!!(n&&!t[tp]);if(e.someProp("handleDrop",function(n){return n(e,t,i||p.Slice.empty,s)})){t.preventDefault();return}if(i){t.preventDefault();var a=i?v.dropPoint(e.state.doc,r.pos,i):r.pos;null==a&&(a=r.pos);var l=e.state.tr;s&&l.deleteSelection();var c=l.mapping.map(a),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=l.doc;if(d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),!l.doc.eq(u)){var f=l.doc.resolve(c);if(d&&h.NodeSelection.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new h.NodeSelection(f));else{var m=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach(function(e,t,n,o){return m=o}),l.setSelection(eR(e,f,l.doc.resolve(m)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}}}}},e5.focus=function(e){e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&eM(e)},20))},e5.blur=function(e,t){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},e5.beforeinput=function(e,t){if(F&&K&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout(function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(t){return t(e,O(8,"Backspace"))}))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}},50)}},e8)e5[tv]=e8[tv];function tm(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var o in t)if(!(o in e))return!1;return!0}var tg=function(){function e(t,n){d(this,e),this.toDOM=t,this.spec=n||tS,this.side=this.spec.side||0}return f(e,[{key:"map",value:function(e,t,n,o){var r=e.mapResult(t.from+o,this.side<0?-1:1),i=r.pos;return r.deleted?null:new tk(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&tm(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),ty=function(){function e(t,n){d(this,e),this.attrs=t,this.spec=n||tS}return f(e,[{key:"map",value:function(e,t,n,o){var r=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-n;return r>=i?null:new tk(r,i,this)}},{key:"valid",value:function(e,t){return t.from1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof ty}}],[{key:"widget",value:function(t,n,o){return new e(t,t,new tg(n,o))}},{key:"inline",value:function(t,n,o,r){return new e(t,n,new ty(o,r))}},{key:"node",value:function(t,n,o,r){return new e(t,n,new tb(o,r))}}]),e}(),tw=[],tS={},tD=function(){function e(t,n){d(this,e),this.local=t.length?t:tw,this.children=n.length?n:tw}return f(e,[{key:"find",value:function(e,t,n){var o=[];return this.findInner(null==e?0:e,null==t?1e9:t,o,0,n),o}},{key:"findInner",value:function(e,t,n,o,r){for(var i=0;i=e&&(!r||r(s.spec))&&n.push(s.copy(s.from+o,s.to+o))}for(var a=0;ae){var l=this.children[a]+1;this.children[a+2].findInner(e-l,t-l,n,o+l,r)}}},{key:"map",value:function(e,t,n){return this==tN||0==e.maps.length?this:this.mapInner(e,t,0,0,n||tS)}},{key:"mapInner",value:function(t,n,o,r,i){for(var s,a=0;ad+t-o)){var u=a[c]+t-o;n>=u?a[c+1]=e<=u?-2:-1:i>=r&&l&&(a[c]+=l,a[c+1]+=l)}}o+=l}),d=t=n.maps[e].map(t,-1)},c=0,d=i;c=o.content.size){u=!0;continue}var v=n.map(e[f+1]+i,-1)-r,m=o.content.findIndex(p),g=m.index,y=m.offset,b=o.maybeChild(g);if(b&&y==p&&y+b.nodeSize==v){var k=a[f+2].mapInner(n,b,h+1,e[f]+i+1,s);k!=tN?(a[f]=p,a[f+1]=v,a[f+2]=k):(a[f+1]=-2,u=!0)}else u=!0}if(u){var w=tT(function(e,t,n,o,r,i,s){for(var a=0;al&&s.to=t){this.children[i]==t&&(o=this.children[i+2]);break}for(var s=t+1,a=s+n.content.size,l=0;ls&&c.type instanceof ty){var d=Math.max(s,c.from)-s,u=Math.min(a,c.to)-s;dn&&o.to0;)t++;e.splice(t,0,n)}function tV(e){var t=[];return e.someProp("decorations",function(n){var o=n(e.state);o&&o!=tN&&t.push(o)}),e.cursorWrapper&&t.push(tD.create(e.state.doc,[e.cursorWrapper.deco])),tO.from(t)}var tR={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tB=A&&V<=11,tF=function(){function e(){d(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return f(e,[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}]),e}(),tz=function(){function e(t,n){var o=this;d(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tF,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){for(var t=0;te.target.nodeValue.length})?o.flushSoon():o.flush()}),tB&&(this.onCharData=function(e){o.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),o.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return f(e,[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){e.flushingSoon=-1,e.flush()},20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,tR)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var n=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&eB(e)&&!this.ignoreSelectionChange(n),r=-1,i=-1,s=!1,a=[];if(e.editable)for(var l=0;l1){var d=a.filter(function(e){return"BR"==e.nodeName});if(2==d.length){var u=d[0],f=d[1];u.parentNode&&u.parentNode.parentNode==f.parentNode?f.remove():u.remove()}}var p=null;r<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||o)&&(r>-1&&(e.docView.markDirty(r,i),tI.has(e)||(tI.set(e,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))||(e.requiresGeckoHackNode=R,tL||(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."),tL=!0))),this.handleDOMChange(r,i,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||eM(e),this.currentSelection.set(n))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var o=0;oArray.prototype.indexOf.call(e.addedNodes,l))&&(r=l),(!c||0>Array.prototype.indexOf.call(e.addedNodes,c))&&(i=c)}var d=r&&r.parentNode==e.target?m(r)+1:0,u=n.localPosFromDOM(e.target,d,-1),f=i&&i.parentNode==e.target?m(i):e.target.childNodes.length;return{from:u,to:n.localPosFromDOM(e.target,f,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}]),e}(),tI=new WeakMap,tL=!1;function tq(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(I&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||I&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function tK(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:eR(e,t.resolve(n.anchor),t.resolve(n.head))}function t_(e,t,n){for(var o=e.depth,r=t?e.end():e.pos;o>0&&(t||e.indexAfter(o)==e.node(o).childCount);)o--,r++,t=!1;if(n)for(var i=e.node(o).maybeChild(e.indexAfter(o));i&&!i.isLeaf;)i=i.firstChild,r++;return r}var t$=function(){function e(t,n){var o=this;d(this,e),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new e7,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(tU),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=tj(this),tH(this),this.nodeViews=tG(this),this.docView=eu(this.state.doc,tW(this),tV(this),this.dom,this),this.domObserver=new tz(this,function(e,t,n,r){return function(e,t,n,o,r){if(t<0){var i,s,a,l,c,d,u=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,f=eO(e,u);if(f&&!e.state.selection.eq(f)){if(F&&K&&13===e.input.lastKeyCode&&Date.now()-100s;f--){var h=i.childNodes[f-1],v=h.pmViewDesc;if("BR"==h.nodeName&&!v){a=f;break}if(!v||v.size)break}var m=e.state.doc,g=e.someProp("domParser")||p.DOMParser.fromSchema(e.state.schema),y=m.resolve(l),b=null,k=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:s,to:a,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:o,ruleFromNode:tq,context:y});if(o&&null!=o[0].pos){var w=o[0].pos,S=o[1]&&o[1].pos;null==S&&(S=w),b={anchor:w+l,head:S+l}}return{doc:k,sel:b,from:l,to:c}}(e,t,n),k=e.state.doc,w=k.slice(b.from,b.to);8===e.input.lastKeyCode&&Date.now()-100=a?i-o:0;i-=d,l=i+(l-a),a=i}else if(l=l?i-o:0;i-=u,a=i+(a-l),l=i}return{start:i,endA:a,endB:l}}(w.content,b.doc.content,b.from,i,s);if((L&&e.input.lastIOSEnter>Date.now()-225||K)&&r.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName||"LI"==e.nodeName})&&(!S||S.endA>=S.endB)&&e.someProp("handleKeyDown",function(t){return t(e,O(13,"Enter"))})){e.input.lastIOSEnter=0;return}if(!S){if(o&&y instanceof h.TextSelection&&!y.empty&&y.$head.sameParent(y.$anchor)&&!e.composing&&!(b.sel&&b.sel.anchor!=b.sel.head))S={start:y.from,endA:y.to,endB:y.to};else{if(b.sel){var D=tK(e,e.state.doc,b.sel);D&&!D.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(D))}return}}if(F&&e.cursorWrapper&&b.sel&&b.sel.anchor==e.cursorWrapper.deco.from&&b.sel.head==b.sel.anchor){var C=S.endB-S.start;b.sel={anchor:b.sel.anchor+C,head:b.sel.anchor+C}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&S.start<=e.state.selection.from+2&&e.state.selection.from>=b.from?S.start=e.state.selection.from:S.endA=e.state.selection.to-2&&e.state.selection.to<=b.to&&(S.endB+=e.state.selection.to-S.endA,S.endA=e.state.selection.to)),A&&V<=11&&S.endB==S.start+1&&S.endA==S.start&&S.start>b.from&&" \xa0"==b.doc.textBetween(S.start-b.from-1,S.start-b.from+1)&&(S.start--,S.endA--,S.endB--);var M=b.doc.resolveNoCache(S.start-b.from),x=b.doc.resolveNoCache(S.endB-b.from),T=k.resolve(S.start),E=M.sameParent(x)&&M.parent.inlineContent&&T.end()>=S.endA;if((L&&e.input.lastIOSEnter>Date.now()-225&&(!E||r.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))||!E&&M.posS.start&&function(e,t,n,o,r){if(!o.parent.isTextblock||n-t<=r.pos-o.pos||t_(o,!0,!1)n||t_(s,!0,!1)i.scrollToSelection?"to selection":"preserve":"reset",h=s||!this.docView.matchesNode(e.doc,u,d);(h||!e.selection.eq(i.selection))&&(a=!0);var p="preserve"==f&&a&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,o=e.dom.getBoundingClientRect(),r=Math.max(0,o.top),i=(o.left+o.right)/2,s=r+1;s=r-20){t=a,n=l.top;break}}}return{refDOM:t,refTop:n,stack:j(e.dom)}}(this);if(a){this.domObserver.stop();var v,m,g,y,b,w=h&&(A||F)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&(v=i.selection,m=e.selection,g=Math.min(v.$anchor.sharedDepth(v.head),m.$anchor.sharedDepth(m.head)),v.$anchor.start(g)!=m.$anchor.start(g));if(h){var S=F?this.trackWrites=this.domSelectionRange().focusNode:null;(s||!this.docView.update(e.doc,u,d,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=eu(e.doc,u,d,this.dom,this)),S&&!this.trackWrites&&(w=!0)}w||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(y=this.docView.domFromPos(this.state.selection.anchor,0),b=this.domSelectionRange(),k(y.node,y.offset,b.anchorNode,b.anchorOffset)))?eM(this,w):(eA(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}(this.updatePluginViews(i),"reset"==f)?this.dom.scrollTop=0:"to selection"==f?this.scrollToSelection():p&&(n=p.refDOM,o=p.refTop,G(p.stack,0==(r=n?n.getBoundingClientRect().top:0)?0:r-o))}},{key:"scrollToSelection",value:function(){var e=this,t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",function(t){return t(e)}));else if(this.state.selection instanceof h.NodeSelection){var n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&H(this,n.getBoundingClientRect(),t)}else H(this,this.coordsAtPos(this.state.selection.head,1),t)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;tt.top&&r++}n==e.dom&&r==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?f=e.state.doc.content.size:(0==r||1!=n.nodeType||"BR"!=n.childNodes[r-1].nodeName)&&(f=function(e,t,n,o){for(var r=-1,i=t;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)){var a=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&(a.left>o.left||a.top>o.top?r=s.posBefore:(a.right-1?r:e.docView.posFromDOM(t,n,-1)}(e,n,r,t))}null==f&&(f=function(e,t,n){var o=function e(t,n){for(var o,r,i=2e8,s=0,a=n.top,l=n.top,c=t.firstChild,d=0;c;c=c.nextSibling,d++){var u=void 0;if(1==c.nodeType)u=c.getClientRects();else{if(3!=c.nodeType)continue;u=b(c).getClientRects()}for(var f=0;f=l){a=Math.max(h.bottom,a),l=Math.min(h.top,l);var p=h.left>n.left?h.left-n.left:h.right=(h.left+h.right)/2?1:0));continue}}!o&&(n.left>=h.right&&n.top>=h.top||n.left>=h.left&&n.top>=h.bottom)&&(s=d+1)}}return o&&3==o.nodeType?function(e,t){for(var n=e.nodeValue.length,o=document.createRange(),r=0;r=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(o,r):!o||i&&1==o.nodeType?{node:t,offset:s}:e(o,r)}(t,n),r=o.node,i=o.offset,s=-1;if(1==r.nodeType&&!r.firstChild){var a=r.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,s)}(e,a,t));var v=e.docView.nearestDesc(a,!0);return{pos:f,inside:v?v.posAtStart-v.border:-1}}(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Q(this,e,t)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=this.docView.posFromDOM(e,t,n);if(null==o)throw RangeError("DOM position not inside the editor");return o}},{key:"endOfTextblock",value:function(e,t){var n,o,r,i,s;return n=this,o=t||this.state,r=e,eo==o&&er==r?ei:(eo=o,er=r,ei="up"==r||"down"==r?(i=o.selection,s="up"==r?i.$from:i.$to,et(n,o,function(){for(var e=n.docView.domFromPos(s.pos,"up"==r?-1:1).node;;){var t=n.docView.nearestDesc(e,!0);if(!t)break;if(t.node.isBlock){e=t.contentDOM||t.dom;break}e=t.dom.parentNode}for(var o=Q(n,s.pos,1),i=e.firstChild;i;i=i.nextSibling){var a=void 0;if(1==i.nodeType)a=i.getClientRects();else{if(3!=i.nodeType)continue;a=b(i,0,i.nodeValue.length).getClientRects()}for(var l=0;lc.top+1&&("up"==r?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})):function(e,t,n){var o=t.selection.$head;if(!o.parent.isTextblock)return!1;var r=o.parentOffset,i=r==o.parent.content.size,s=e.domSelection();return en.test(o.parent.textContent)&&s.modify?et(e,t,function(){var t=e.domSelectionRange(),r=t.focusNode,i=t.focusOffset,a=t.anchorNode,l=t.anchorOffset,c=s.caretBidiLevel;s.modify("move",n,"character");var d=o.depth?e.docView.domAfterPos(o.before()):e.dom,u=e.domSelectionRange(),f=u.focusNode,h=u.focusOffset,p=f&&!d.contains(1==f.nodeType?f:f.parentNode)||r==f&&i==h;try{s.collapse(a,l),r&&(r!=a||i!=l)&&s.extend&&s.extend(r,i)}catch(e){}return null!=c&&(s.caretBidiLevel=c),p}):"left"==n||"backward"==n?!r:i}(n,o,r))}},{key:"pasteHTML",value:function(e,t){return tf(this,"",e,!1,t||new ClipboardEvent("paste"))}},{key:"pasteText",value:function(e,t){return tf(this,e,null,!0,t||new ClipboardEvent("paste"))}},{key:"destroy",value:function(){this.docView&&(function(e){for(var t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],tV(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(e){te(this,e)||!e5[e.type]||!this.editable&&e.type in e8||e5[e.type](this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelectionRange",value:function(){return I&&11===this.root.nodeType&&function(e){for(var t=e.activeElement;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){function t(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",t,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",t,!0);var n,o=n.startContainer,r=n.startOffset,i=n.endContainer,s=n.endOffset,a=e.domAtPos(e.state.selection.anchor);if(k(a.node,a.offset,i,s)){var l=[i,s,o,r];o=l[0],r=l[1],i=l[2],s=l[3]}return{anchorNode:o,anchorOffset:r,focusNode:i,focusOffset:s}}(this):this.domSelection()}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),e}();function tW(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var o in n)"class"==o&&(t.class+=" "+n[o]),"style"==o?t.style=(t.style?t.style+";":"")+n[o]:t[o]||"contenteditable"==o||"nodeName"==o||(t[o]=String(n[o]))}),[tk.node(0,e.state.doc.content.size,t)]}function tH(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:tk.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function tj(e){return!e.someProp("editable",function(t){return!1===t(e.state)})}function tG(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function tU(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}t.Decoration=tk,t.DecorationSet=tD,t.EditorView=t$,t.__endComposition=td,t.__parseFromClipboard=eY,t.__serializeForClipboard=eX}}]); //# sourceMappingURL=d08a6a05-914359ca5fbbe6e8.js.map