From 9c46d0e9b8f4f8df593f60bedf8272290d110e8b Mon Sep 17 00:00:00 2001 From: Christoph Schweppe Date: Sat, 15 Aug 2020 19:36:30 +0200 Subject: [PATCH] Fix read part --- resources/dist/tiptap.js | 2 +- resources/src/components/Formfield/Read.vue | 18 ++++++++++++++++-- resources/src/components/TipTap.vue | 4 +--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/resources/dist/tiptap.js b/resources/dist/tiptap.js index 5955f8f..0fae72c 100644 --- a/resources/dist/tiptap.js +++ b/resources/dist/tiptap.js @@ -1,2 +1,2 @@ /*! For license information please see tiptap.js.LICENSE.txt */ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=14)}([function(e,t,n){"use strict";function r(e){this.content=e}n.r(t),n.d(t,"ContentMatch",(function(){return D})),n.d(t,"DOMParser",(function(){return ee})),n.d(t,"DOMSerializer",(function(){return pe})),n.d(t,"Fragment",(function(){return i})),n.d(t,"Mark",(function(){return u})),n.d(t,"MarkType",(function(){return Z})),n.d(t,"Node",(function(){return N})),n.d(t,"NodeRange",(function(){return O})),n.d(t,"NodeType",(function(){return K})),n.d(t,"ReplaceError",(function(){return p})),n.d(t,"ResolvedPos",(function(){return x})),n.d(t,"Schema",(function(){return Y})),n.d(t,"Slice",(function(){return f})),r.prototype={constructor:r,find:function(e){for(var t=0;t>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};var o=r;var i=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;ne&&!1!==n(a,r+s,o,i)&&a.content.size){var l=s+1;a.nodesBetween(Math.max(0,e-l),Math.min(a.content.size,t-l),n,r+l)}s=c}},i.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},i.prototype.textBetween=function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(s,a){s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},i.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);oe)for(var o=0,s=0;se&&((st)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),n.push(a),r+=a.nodeSize),s=c}return new i(n,r)},i.prototype.cutByIndex=function(e,t){return e==t?i.empty:0==e&&t==this.content.length?this:new i(this.content.slice(e,t))},i.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new i(r,o)},i.prototype.addToStart=function(e){return new i([e].concat(this.content),this.size+e.nodeSize)},i.prototype.addToEnd=function(e){return new i(this.content.concat(e),this.size+e.nodeSize)},i.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;tthis.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?c(n+1,o):c(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},i.fromJSON=function(e,t){if(!t)return i.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(t.map(e.nodeFromJSON))},i.fromArray=function(e){if(!e.length)return i.empty;for(var t,n=0,r=0;rthis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t},u.prototype.removeFromSet=function(e){for(var t=0;te.depth)throw new p("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new p("Inconsistent open depths");return function e(t,n,r,o){var s=t.index(o),a=t.node(o);if(s==n.index(o)&&o=0;o--)r=t.node(o).copy(i.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t),u=l.start,p=l.end;return b(a,function e(t,n,r,o,s){var a=t.depth>s&&m(t,n,s+1),c=o.depth>s&&m(r,o,s+1),l=[];y(null,t,s,l),a&&c&&n.index(s)==r.index(s)?(v(a,c),g(b(a,e(t,n,r,o,s+1)),l)):(a&&g(b(a,w(t,n,s+1)),l),y(n,r,s,l),c&&g(b(c,w(r,o,s+1)),l));return y(o,null,s,l),new i(l)}(t,u,p,n,o))}var f=t.parent,d=f.content;return b(f,d.cut(0,t.parentOffset).append(r.content).append(d.cut(n.parentOffset)))}return b(a,w(t,n,o))}(e,t,n,0)}function v(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function m(e,t,n){var r=e.node(n);return v(r,t.node(n)),r}function g(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function y(e,t,n,r){var o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(g(e.nodeAfter,r),i++));for(var a=i;an)&&g(b(m(e,t,n+1),w(e,t,n+1)),r);return y(t,null,n,r),new i(r)}d.size.get=function(){return this.content.size-this.openStart-this.openEnd},f.prototype.insertAt=function(e,t){var n=function e(t,n,r,o){var i=t.findIndex(n),s=i.index,a=i.offset,c=t.maybeChild(s);if(a==n||c.isText)return o&&!o.canReplace(s,s,r)?null:t.cut(0,n).append(r).append(t.cut(n));var l=e(c.content,n-a-1,r);return l&&t.replaceChild(s,c.copy(l))}(this.content,e+this.openStart,t,null);return n&&new f(n,this.openStart,this.openEnd)},f.prototype.removeBetween=function(e,t){return new f(function e(t,n,r){var o=t.findIndex(n),i=o.index,s=o.offset,a=t.maybeChild(i),c=t.findIndex(r),l=c.index,u=c.offset;if(s==n||a.isText){if(u!=r&&!t.child(l).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw new RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(e(a.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},f.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},f.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},f.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},f.fromJSON=function(e,t){if(!t)return f.empty;var n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new f(i.fromJSON(e,t.content),n,r)},f.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,r=0,o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new f(e,n,r)},Object.defineProperties(f.prototype,d),f.empty=new f(i.empty,0,0);var x=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},S={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};x.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},S.parent.get=function(){return this.node(this.depth)},S.doc.get=function(){return this.node(0)},x.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},x.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},x.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},x.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},x.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},x.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},x.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},S.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},S.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r},S.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},x.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},x.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new O(this,e,n)},x.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},x.prototype.max=function(e){return e.pos>this.pos?e:this},x.prototype.min=function(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],r=0,o=t,i=e;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,l=o-c;if(n.push(i,a,r+c),!l)break;if((i=i.child(a)).isText)break;o=l-1,r+=c+1}return new x(t,n,o)},x.resolveCached=function(e,t){for(var n=0;ne&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r},T.isBlock.get=function(){return this.type.isBlock},T.isTextblock.get=function(){return this.type.isTextblock},T.inlineContent.get=function(){return this.type.inlineContent},T.isInline.get=function(){return this.type.isInline},T.isText.get=function(){return this.type.isText},T.isLeaf.get=function(){return this.type.isLeaf},T.isAtom.get=function(){return this.type.isAtom},N.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),E(this.marks,e)},N.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},N.prototype.canReplace=function(e,t,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var s=this.contentMatchAt(e).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var c=r;c=0;n--)t=e[n].type.name+"("+t+")";return t}var D=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},R={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};D.parse=function(e,t){var n=new I(e,t);if(null==n.next)return D.empty;var r=F(n);n.next&&n.err("Unexpected trailing text");var o=function(e){var t=Object.create(null);return function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];H(e,r).forEach((function(e){s||o.push(n,s=[]),-1==s.indexOf(e)&&s.push(e)}))}}))}));for(var i=t[r.join(",")]=new D(r.indexOf(e.length-1)>-1),s=0;s>1},D.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},D.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var r=1;r"+e.indexOf(t.next[o+1]);return r})).join("\n")},Object.defineProperties(D.prototype,R),D.empty=new D(!0);var I=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.unshift()},P={next:{configurable:!0}};function F(e){var t=[];do{t.push(j(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function j(e){var t=[];do{t.push(z(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function z(e){for(var t=function(e){if(e.eat("(")){var t=F(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=L(e,t)}return t}function B(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function L(e,t){var n=B(e),r=n;return e.eat(",")&&(r="}"!=e.next?B(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function V(e,t){return t-e}function H(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i-1},K.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t-1};var Y=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=o.from(e.nodes),this.spec.marks=o.from(e.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=Z.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=D.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?Q(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=null==u?[l]:""==u?[]:Q(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Q(e,t){for(var n=[],r=0;r-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}Y.prototype.node=function(e,t,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof K))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)},Y.prototype.text=function(e,t){var n=this.nodes.text;return new $(n,n.defaultAttrs,e,u.setFrom(t))},Y.prototype.mark=function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)},Y.prototype.nodeFromJSON=function(e){return N.fromJSON(this,e)},Y.prototype.markFromJSON=function(e){return u.fromJSON(this,e)},Y.prototype.nodeType=function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t};var ee=function(e,t){var n=this;this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((function(e){e.tag?n.tags.push(e):e.style&&n.styles.push(e)})),this.normalizeLists=!this.tags.some((function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)}))};ee.prototype.parse=function(e,t){void 0===t&&(t={});var n=new se(this,t,!1);return n.addAll(e,null,t.from,t.to),n.finish()},ee.prototype.parseSlice=function(e,t){void 0===t&&(t={});var n=new se(this,t,!0);return n.addAll(e,null,t.from,t.to),f.maxOpen(n.finish())},ee.prototype.matchTag=function(e,t){for(var n=0;ne.length&&(61!=o.style.charCodeAt(e.length)||o.style.slice(e.length+1)!=t))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},ee.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var s=0;sthis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},se.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},se.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},ae.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e},se.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(e,a){for(;e>=0;e--){var c=n[e];if(""==c){if(e==n.length-1||0==e)continue;for(;a>=i;a--)if(s(e-1,a))return!0;return!1}var l=a>0||0==a&&o?t.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!l||l.name!=c&&-1==l.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},se.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},se.prototype.addPendingMark=function(e){this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},se.prototype.removePendingMark=function(e,t){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1?r.pendingMarks=e.removeFromSet(r.pendingMarks):r.activeMarks=e.removeFromSet(r.activeMarks),r==t)break}},Object.defineProperties(se.prototype,ae);var pe=function(e,t){this.nodes=e||{},this.marks=t||{}};function fe(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function de(e){return e.document||window.document}pe.prototype.serializeFragment=function(e,t,n){var r=this;void 0===t&&(t={}),n||(n=de(t).createDocumentFragment());var o=n,i=null;return e.forEach((function(e){if(i||e.marks.length){i||(i=[]);for(var n=0,s=0;n=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},pe.prototype.serializeMark=function(e,t,n){void 0===n&&(n={});var r=this.marks[e.type.name];return r&&pe.renderSpec(de(n),r(e,t))},pe.renderSpec=function(e,t,n){if(void 0===n&&(n=null),"string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};var r=t[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?e.createElementNS(n,r):e.createElement(r),a=t[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var l in c=2,a)if(null!=a[l]){var u=l.indexOf(" ");u>0?s.setAttributeNS(l.slice(0,u),l.slice(u+1),a[l]):s.setAttribute(l,a[l])}for(var p=c;pc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var d=pe.renderSpec(e,f,n),h=d.dom,v=d.contentDOM;if(s.appendChild(h),v){if(i)throw new RangeError("Multiple content holes");i=v}}return{dom:s,contentDOM:i}},pe.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new pe(this.nodesFromSchema(e),this.marksFromSchema(e)))},pe.nodesFromSchema=function(e){var t=fe(e.nodes);return t.text||(t.text=function(e){return e.text}),t},pe.marksFromSchema=function(e){return fe(e.marks)}},function(e,t,n){"use strict";n.r(t),n.d(t,"AllSelection",(function(){return d})),n.d(t,"EditorState",(function(){return S})),n.d(t,"NodeSelection",(function(){return p})),n.d(t,"Plugin",(function(){return _})),n.d(t,"PluginKey",(function(){return A})),n.d(t,"Selection",(function(){return s})),n.d(t,"SelectionRange",(function(){return c})),n.d(t,"TextSelection",(function(){return l})),n.d(t,"Transaction",(function(){return g}));var r=n(0),o=n(2),i=Object.create(null),s=function(e,t,n){this.ranges=n||[new c(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},a={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};a.anchor.get=function(){return this.$anchor.pos},a.head.get=function(){return this.$head.pos},a.from.get=function(){return this.$from.pos},a.to.get=function(){return this.$to.pos},a.$from.get=function(){return this.ranges[0].$from},a.$to.get=function(){return this.ranges[0].$to},a.empty.get=function(){for(var e=this.ranges,t=0;t=0;o--){var i=t<0?v(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):v(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}},s.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new d(e.node(0))},s.atStart=function(e){return v(e,e,0,0,1)||new d(e)},s.atEnd=function(e){return v(e,e,e.content.size,e.childCount,-1)||new d(e)},s.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=i[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},s.jsonID=function(e,t){if(e in i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t},s.prototype.getBookmark=function(){return l.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(s.prototype,a),s.prototype.visible=!0;var c=function(e,t){this.$from=e,this.$to=t},l=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return e.near(o);var i=n.resolve(r.map(this.anchor));return new t(i.parent.inlineContent?i:o,o)},t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Slice.empty),e.prototype.replace.call(this,t,n),n==r.Slice.empty){var o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new u(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))},t.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=e.findFrom(r,o,!0)||e.findFrom(r,-o,!0);if(!s)return e.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(e.findFrom(n,-o,!0)||e.findFrom(n,o,!0)).$anchor).pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&p.isSelectable(a))return p.create(e,n-(o<0?a.nodeSize:0))}else{var c=v(e,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function m(e,t,n){var r=e.steps.length-1;if(!(r0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return r.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.Mark.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(o.e);function y(e,t){return t&&e?e.bind(t):e}var b=function(e,t,n){this.name=e,this.init=y(t.init,n),this.apply=y(t.apply,n)},w=[new b("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new b("selection",{init:function(e,t){return e.selection||s.atStart(t.doc)},apply:function(e){return e.selection}}),new b("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new b("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],x=function(e,t){var n=this;this.schema=e,this.fields=w.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new b(e.key,e.spec.state,e))}))},S=function(e){this.config=e},k={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};k.schema.get=function(){return this.config.schema},k.plugins.get=function(){return this.config.plugins},S.prototype.apply=function(e){return this.applyTransaction(e).state},S.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n-1&&C.splice(t,1)},Object.defineProperties(S.prototype,k);var C=[];var _=function(e){this.props={},e.props&&function e(t,n,r){for(var o in t){var i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:M("plugin")};_.prototype.getState=function(e){return e[this.key]};var O=Object.create(null);function M(e){return e in O?e+"$"+ ++O[e]:(O[e]=0,e+"$")}var A=function(e){void 0===e&&(e="key"),this.key=M(e)};A.prototype.get=function(e){return e.config.pluginsByKey[this.key]},A.prototype.getState=function(e){return e[this.key]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return C})),n.d(t,"g",(function(){return k})),n.d(t,"h",(function(){return M})),n.d(t,"i",(function(){return x})),n.d(t,"j",(function(){return O})),n.d(t,"k",(function(){return w}));var r=n(0),o=Math.pow(2,16);function i(e){return 65535&e}var s=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},a=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};a.prototype.recover=function(e){var t=0,n=i(e);if(!this.inverted)for(var r=0;re)break;var u=this.ranges[c+i],p=this.ranges[c+a],f=l+u;if(e<=f){var d=l+r+((u?e==l?-1:e==f?1:t:t)<0?0:p);if(n)return d;var h=e==(t<0?l:f)?null:c/3+(e-l)*o;return new s(d,t<0?e!=l:e!=f,h)}r+=p-u}return n?e+r:new s(e+r)},a.prototype.touches=function(e,t){for(var n=0,r=i(t),o=this.inverted?2:1,s=this.inverted?1:2,a=0;ae)break;var l=this.ranges[a+o];if(e<=c+l&&a==3*r)return!0;n+=this.ranges[a+s]-l}return!1},a.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},c.prototype.invert=function(){var e=new c;return e.appendMappingInverted(this),e},c.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;no&&a0},u.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(u.prototype,p);var d=Object.create(null),h=function(){};h.prototype.apply=function(e){return f()},h.prototype.getMap=function(){return a.empty},h.prototype.invert=function(e){return f()},h.prototype.map=function(e){return f()},h.prototype.merge=function(e){return null},h.prototype.toJSON=function(){return f()},h.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=d[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},h.jsonID=function(e,t){if(e in d)throw new RangeError("Duplicate use of step JSON ID "+e);return d[e]=t,t.prototype.jsonID=e,t};var v=function(e,t){this.doc=e,this.failed=t};v.ok=function(e){return new v(e,null)},v.fail=function(e){return new v(null,e)},v.fromReplace=function(e,t,n,o){try{return v.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.ReplaceError)return v.fail(e.message);throw e}};var m=function(e){function t(t,n,r,o){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&y(e,this.from,this.to)?v.fail("Structure replace would overwrite content"):v.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new a([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure!=this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var o=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),o,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,r.Slice.fromJSON(e,n.slice),!!n.structure)},t}(h);h.jsonID("replace",m);var g=function(e){function t(t,n,r,o,i,s,a){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(y(e,this.from,this.gapFrom)||y(e,this.gapTo,this.to)))return v.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return v.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?v.fromReplace(e,this.from,this.to,n):v.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new a([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deleted&&r.deleted||or.pos?null:new t(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,r.Slice.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(h);function y(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function b(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function w(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(ni;a--,c--){var l=o.node(a),u=o.index(a);if(l.type.spec.isolating)return!1;var p=l.content.cutByIndex(u,l.childCount),f=r&&r[c]||l;if(f!=l&&(p=p.replaceChild(0,f.type.create(f.attrs))),!l.canReplace(u+1,l.childCount)||!f.type.validContent(p))return!1}var d=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(d,d,h?h.type:o.node(i+1).type)}function C(e,t){var n=e.resolve(t),r=n.index();return _(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function _(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}function O(e,t,n){void 0===n&&(n=-1);for(var r=e.resolve(t),o=r.depth;;o--){var i=void 0,s=void 0,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&_(i,s)&&r.node(o).canReplace(a,a+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function M(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(c>0?1:0);if(1==s?r.node(a).canReplace(l,l,o):r.node(a).contentMatchAt(l).findWrapping(o.firstChild.type))return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function A(e,t,n){for(var o=[],i=0;it;f--)d||n.index(f)>0?(d=!0,u=r.Fragment.from(n.node(f).copy(u)),p++):c--;for(var h=r.Fragment.empty,v=0,m=i,y=!1;m>t;m--)y||o.after(m+1)=0;o--)n=r.Fragment.from(t[o].type.create(t[o].attrs,n));var i=e.start,s=e.end;return this.step(new g(i,s,i,s,new r.Slice(n,0,0),t.length,!0))},u.prototype.setBlockType=function(e,t,n,o){var i=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,o)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(s).map(t),n)){i.clearIncompatible(i.mapping.slice(s).map(t,1),n);var a=i.mapping.slice(s),c=a.map(t,1),l=a.map(t+e.nodeSize,1);return i.step(new g(c,l,c+1,l-1,new r.Slice(r.Fragment.from(n.create(o,null,e.marks)),0,0),1,!0)),!1}})),this},u.prototype.setNodeMarkup=function(e,t,n,o){var i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);var s=t.create(n,null,o||i.marks);if(i.isLeaf)return this.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new g(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new r.Slice(r.Fragment.from(s),0,0),1,!0))},u.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var o=this.doc.resolve(e),i=r.Fragment.empty,s=r.Fragment.empty,a=o.depth,c=o.depth-t,l=t-1;a>c;a--,l--){i=r.Fragment.from(o.node(a).copy(i));var u=n&&n[l];s=r.Fragment.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}return this.step(new m(e,e,new r.Slice(i.append(s),t,t),!0))},u.prototype.join=function(e,t){void 0===t&&(t=1);var n=new m(e-t,e+t,r.Slice.empty,!0);return this.step(n)};var N=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),s=new r.Slice(A(n.content,(function(e,n){return n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),i),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,s)},t.prototype.invert=function(){return new T(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(h);h.jsonID("addMark",N);var T=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=new r.Slice(A(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,o)},t.prototype.invert=function(){return new N(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(h);function $(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}h.jsonID("removeMark",T),u.prototype.addMark=function(e,t,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(e,t,(function(r,c,l){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&l.type.allowsMarkType(n.type)){for(var p=Math.max(c,e),f=Math.min(c+r.nodeSize,t),d=n.addToSet(u),h=0;h=0;d--)this.step(i[d]);return this},u.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=r.Slice.empty);var o=function(e,t,n,o){if(void 0===n&&(n=t),void 0===o&&(o=r.Slice.empty),t==n&&!o.size)return null;var i=e.resolve(t),s=e.resolve(n);return $(i,s,o)?new m(t,n,o):new E(i,s,o).fit()}(this.doc,e,t,n);return o&&this.step(o),this},u.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new r.Slice(r.Fragment.from(n),0,0))},u.prototype.delete=function(e,t){return this.replace(e,t,r.Slice.empty)},u.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var E=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var o=0;o<=e.depth;o++){var i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}this.placed=r.Fragment.empty;for(var s=e.depth;s>0;s--)this.placed=r.Fragment.from(e.node(s).copy(this.placed))},D={depth:{configurable:!0}};function R(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(R(e.firstChild.content,t-1,n)))}function I(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(I(e.lastChild.content,t-1,n)))}function P(e,t){for(var n=0;n1&&(o=o.replaceChild(0,F(o.firstChild,t-1,1==o.childCount?n-1:0))),t>0&&(o=e.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.Fragment.empty,!0)))),e.copy(o)}function j(e,t,n,r,o){var i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(var r=n;ro){var a=i.contentMatchAt(0),c=a.fillBefore(e).append(e);e=c.append(a.matchFragment(c).fillBefore(r.Fragment.empty,!0))}return e}function B(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(ot.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;o==t.start(r)&&n.push(r)}return n}D.depth.get=function(){return this.frontier.length-1},E.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(t<0?this.$to:o.doc.resolve(t));if(!i)return null;for(var s=this.placed,a=o.depth,c=i.depth;a&&c&&1==s.childCount;)s=s.firstChild.content,a--,c--;var l=new r.Slice(s,a,c);return t>-1?new g(o.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||o.pos!=this.$to.pos?new m(o.pos,i.pos,l):void 0},E.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,o=(t?(n=P(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,i=this.depth;i>=0;i--){var s=this.frontier[i],a=s.type,c=s.match,l=void 0,u=void 0;if(1==e&&(o?c.matchType(o.type)||(u=c.fillBefore(r.Fragment.from(o),!1)):a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:i,parent:n,inject:u};if(2==e&&o&&(l=c.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:i,parent:n,wrap:l};if(n&&c.matchType(n.type))break}},E.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,o=e.openEnd,i=P(t,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new r.Slice(t,n+1,Math.max(o,i.size+n>=t.size-o?n+1:0)),!0)},E.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,o=e.openEnd,i=P(t,n);if(i.childCount<=1&&n>0){var s=t.size-n<=n+i.size;this.unplaced=new r.Slice(R(t,n-1,1),n-1,s?n-1:o)}else this.unplaced=new r.Slice(R(t,n,1),n,o)},E.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,o=e.parent,i=e.inject,s=e.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a1||0==u||y.content.size)&&(h=b,f.push(F(y.mark(v.allowedMarks(y.marks)),1==p?u:0,p==l.childCount?g:-1)))}var w=p==l.childCount;w||(g=-1),this.placed=I(this.placed,n,r.Fragment.from(f)),this.frontier[n].match=h,w&&g<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,S=l;x1&&r==this.$to.end(--n);)++r;return r},E.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t=0;a--){var c=this.frontier[a],l=c.match,u=j(e,a,c.type,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}},E.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=I(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e},E.prototype.openFrontierNode=function(e,t,n){var o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=I(this.placed,this.depth,r.Fragment.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},E.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(r.Fragment.empty,!0);e.childCount&&(this.placed=I(this.placed,this.frontier.length,e))},Object.defineProperties(E.prototype,D),u.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var o=this.doc.resolve(e),i=this.doc.resolve(t);if($(o,i,n))return this.step(new m(e,t,n));var s=B(o,this.doc.resolve(t));0==s[s.length-1]&&s.pop();var a=-(o.depth+1);s.unshift(a);for(var c=o.depth,l=o.pos-1;c>0;c--,l--){var u=o.node(c).type.spec;if(u.defining||u.isolating)break;s.indexOf(c)>-1?a=c:o.before(c)==l&&s.splice(1,0,-c)}for(var p=s.indexOf(a),f=[],d=n.openStart,h=n.content,v=0;;v++){var g=h.firstChild;if(f.push(g),v==n.openStart)break;h=g.content}d>0&&f[d-1].type.spec.defining&&o.node(p).type!=f[d-1].type?d-=1:d>=2&&f[d-1].isTextblock&&f[d-2].type.spec.defining&&o.node(p).type!=f[d-2].type&&(d-=2);for(var y=n.openStart;y>=0;y--){var b=(y+d+1)%(n.openStart+1),w=f[b];if(w)for(var x=0;x=0&&(this.replace(e,t,n),!(this.steps.length>O));M--){var A=s[M];M<0||(e=o.before(A),t=i.after(A))}return this},u.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(e-n.start(c)==n.depth-c&&t>n.end(c)&&r.end(c)-t!=r.depth-c)return this.delete(n.before(c),t);return this.delete(e,t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"CellSelection",(function(){return R})),n.d(t,"TableMap",(function(){return h})),n.d(t,"TableView",(function(){return Oe})),n.d(t,"__clipCells",(function(){return z})),n.d(t,"__insertCells",(function(){return V})),n.d(t,"__pastedCells",(function(){return F})),n.d(t,"addColSpan",(function(){return E})),n.d(t,"addColumn",(function(){return re})),n.d(t,"addColumnAfter",(function(){return ie})),n.d(t,"addColumnBefore",(function(){return oe})),n.d(t,"addRow",(function(){return le})),n.d(t,"addRowAfter",(function(){return pe})),n.d(t,"addRowBefore",(function(){return ue})),n.d(t,"cellAround",(function(){return x})),n.d(t,"colCount",(function(){return A})),n.d(t,"columnIsHeader",(function(){return D})),n.d(t,"columnResizing",(function(){return Ne})),n.d(t,"columnResizingPluginKey",(function(){return Ae})),n.d(t,"deleteColumn",(function(){return ae})),n.d(t,"deleteRow",(function(){return de})),n.d(t,"deleteTable",(function(){return _e})),n.d(t,"findCell",(function(){return M})),n.d(t,"fixTables",(function(){return te})),n.d(t,"fixTablesKey",(function(){return ee})),n.d(t,"goToNextCell",(function(){return Ce})),n.d(t,"handlePaste",(function(){return G})),n.d(t,"inSameTable",(function(){return O})),n.d(t,"isInTable",(function(){return S})),n.d(t,"mergeCells",(function(){return ve})),n.d(t,"moveCellForward",(function(){return _})),n.d(t,"nextCell",(function(){return N})),n.d(t,"pointsAtCell",(function(){return C})),n.d(t,"removeColSpan",(function(){return $})),n.d(t,"removeColumn",(function(){return se})),n.d(t,"removeRow",(function(){return fe})),n.d(t,"rowIsHeader",(function(){return ce})),n.d(t,"selectedRect",(function(){return ne})),n.d(t,"selectionCell",(function(){return k})),n.d(t,"setAttr",(function(){return T})),n.d(t,"setCellAttr",(function(){return ye})),n.d(t,"splitCell",(function(){return me})),n.d(t,"splitCellWithType",(function(){return ge})),n.d(t,"tableEditing",(function(){return Ie})),n.d(t,"tableEditingKey",(function(){return w})),n.d(t,"tableNodeTypes",(function(){return b})),n.d(t,"tableNodes",(function(){return y})),n.d(t,"toggleHeader",(function(){return we})),n.d(t,"toggleHeaderCell",(function(){return ke})),n.d(t,"toggleHeaderColumn",(function(){return Se})),n.d(t,"toggleHeaderRow",(function(){return xe})),n.d(t,"updateColumnsOnResize",(function(){return Me}));var r,o,i=n(1),s=n(0),a=n(6),c=n(4),l=n(2);if("undefined"!=typeof WeakMap){var u=new WeakMap;r=function(e){return u.get(e)},o=function(e,t){return u.set(e,t),t}}else{var p=[],f=0;r=function(e){for(var t=0;tr&&(i+=l.attrs.colspan)}for(var u=0;u1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[],a=0,c=t*n;a=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-w});break}for(var x=o+w*t,S=0;S0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function S(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function k(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:x(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var s=o.type.spec.tableRole;if("cell"==s||"header_cell"==s)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function C(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function _(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function O(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function M(e){return h.get(e.node(-1)).findCell(e.pos-e.start(-1))}function A(e){return h.get(e.node(-1)).colCount(e.pos-e.start(-1))}function N(e,t,n){var r=e.start(-1),o=h.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function T(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function $(e,t,n){void 0===n&&(n=1);var r=T(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((function(e){return e>0}))||(r.colwidth=null)),r}function E(e,t,n){void 0===n&&(n=1);var r=T(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o0||m>0){var g=d.attrs;v>0&&(g=$(g,0,v)),m>0&&(g=$(g,g.colspan-m,m)),d=f.leftr.bottom){var y=T(d.attrs,"rowspan",Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top));d=f.top0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.top<=s.top?(i.top>0&&(e=a.resolve(o+r.map[i.left])),s.bottom0&&(n=a.resolve(o+r.map[s.left])),i.bottom0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.left<=s.left?(i.left>0&&(e=a.resolve(o+r.map[i.top*r.width])),s.right0&&(n=a.resolve(o+r.map[s.top*r.width])),i.right0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,c=[];if("row"==i)for(var l=0;l=0;i--)for(var a=o.child(i).attrs,c=a.rowspan,l=a.colspan,u=r;u=t.length&&t.push(s.Fragment.empty),n[d]t&&(h=h.type.create($(h.attrs,h.attrs.colspan,f+h.attrs.colspan-t),h.content)),p.push(h),f+=h.attrs.colspan;for(var v=1;vn&&(S=S.type.create(T(S.attrs,"rowspan",Math.max(1,n-S.attrs.rowspan)),S.content)),b.push(S)}m.push(s.Fragment.from(b))}i=m,o=n}return{width:r,height:o,rows:i}}function B(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;for(var c=!1,l=o;lt.width)for(var p=0,f=0;pt.height){for(var g=[],y=0,w=(t.height-1)*t.width;y=t.width)&&n.nodeAt(t.map[w+y]).type==u.header_cell;g.push(x?l||(l=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}for(var S=u.row.create(null,s.Fragment.from(g)),k=[],C=t.height;C=0;o--){var s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if("cell"==s.type.spec.tableRole||"header_cell"==s.type.spec.tableRole){var a=r.before(o),c="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?a:null}}return null}function Y(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Q(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?x(e.state.doc.resolve(n.pos)):null}var ee=new i.PluginKey("fix-tables");function te(e,t){var n,r=function(t,r){"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){var o=h.get(t);if(!o.problems)return r;r||(r=e.tr);for(var i,s,a=[],c=0;c0){var k="cell";w.firstChild&&(k=w.firstChild.type.spec.tableRole);for(var C=[],_=0;_0?-1:0;D(r,i,n+s)&&(s=0==n||n==r.width?null:0);for(var a=0;a0&&n0&&r.map[c-1]==l||n0?-1:0;ce(r,i,n+l)&&(l=0==n||n==r.height?null:0);for(var u=0,p=r.width*n;u0&&n0&&f==r.map[p-r.width]){var d=o.nodeAt(f).attrs;e.setNodeMarkup(e.mapping.slice(l).map(f+i),null,T(d,"rowspan",d.rowspan-1)),u+=d.colspan-1}else if(n0&&o[s]==o[s-1]||t.right0&&o[i]==o[i-n]||t.bottom0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;o=x(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(n){var s=r.attrs,a=[],c=s.colwidth;s.rowspan>1&&(s=T(s,"rowspan",1)),s.colspan>1&&(s=T(s,"colspan",1));for(var l,u=ne(t),p=t.tr,f=0;f=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()0;r--){if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}var Oe=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Me(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function Me(e,t,n,r,o,i){for(var s=0,a=!0,c=t.firstChild,l=e.firstChild,u=0,p=0;u-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,r,o){var i=Ae.getState(e.state);if(!i.dragging){var s=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),a=-1;if(s){var c=s.getBoundingClientRect(),l=c.left,u=c.right;t.clientX-l<=n?a=$e(e,t,"left"):u-t.clientX<=n&&(a=$e(e,t,"right"))}if(a!=i.activeHandle){if(!o&&-1!==a){var p=e.state.doc.resolve(a),f=p.node(-1),d=h.get(f),v=p.start(-1);if(d.colCount(p.pos-v)+p.nodeAfter.attrs.colspan-1==d.width-1)return}De(e,a)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=Ae.getState(e.state);t.activeHandle>-1&&!t.dragging&&De(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var r=Ae.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var s=e.domAtPos(t),a=s.node.childNodes[s.offset].offsetWidth,c=r;if(o)for(var l=0;l-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),i=h.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan,l=0;l=0&&!(t.after(i+1)=0&&!(n.before(s+1)>n.start(s));s--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(s)?r=i.TextSelection.create(a,s.from):s instanceof i.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var s=r.node(i);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){t=s;break}}for(var a=o.depth;a>0;a--){var c=o.node(a);if("cell"===c.type.spec.tableRole||"header_cell"===c.type.spec.tableRole){n=c;break}}return t!==n&&0===o.parentOffset}(s)&&(r=i.TextSelection.create(a,s.$from.start(),s.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,te(r,n),t)}})}Te.prototype.apply=function(e){var t=this,n=e.getMeta(Ae);if(n&&null!=n.setHandle)return new Te(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Te(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var r=e.mapping.map(t.activeHandle,-1);C(e.doc.resolve(r))||(r=null),t=new Te(r,t.dragging)}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return xt})),n.d(t,"b",(function(){return _t})),n.d(t,"c",(function(){return Pt}));var r=n(1),o=n(0),i=n(2),s={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var a=/Edge\/(\d+)/.exec(navigator.userAgent),c=/MSIE \d/.test(navigator.userAgent),l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);s.mac=/Mac/.test(navigator.platform);var u=s.ie=!!(c||l||a);s.ie_version=c?document.documentMode||6:l?+l[1]:a?+a[1]:null,s.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),s.gecko_version=s.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var p=!u&&/Chrome\/(\d+)/.exec(navigator.userAgent);s.chrome=!!p,s.chrome_version=p&&+p[1],s.ios=!u&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),s.android=/Android \d/.test(navigator.userAgent),s.webkit="webkitFontSmoothing"in document.documentElement.style,s.safari=/Apple Computer/.test(navigator.vendor),s.webkit_version=s.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var f=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},d=function(e){var t=e.parentNode;return t&&11==t.nodeType?t.host:t},h=function(e,t,n){var r=document.createRange();return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},v=function(e,t,n,r){return n&&(g(e,t,n,r,-1)||g(e,t,n,r,1))},m=/^(img|br|input|textarea|hr)$/i;function g(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:y(e))){var i=e.parentNode;if(1!=i.nodeType||b(e)||m.test(e.nodeName)||"false"==e.contentEditable)return!1;t=f(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?y(e):0}}}function y(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function b(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var w=function(e){var t=e.isCollapsed;return t&&s.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function x(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function S(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function k(e,t){return"number"==typeof e?e:e[t]}function C(e){var t=e.getBoundingClientRect();return{left:t.left,right:t.left+e.clientWidth,top:t.top,bottom:t.top+e.clientHeight}}function _(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=n||e.dom;s;s=d(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?S(i):C(s),l=0,u=0;if(t.topc.bottom-k(r,"bottom")&&(u=t.bottom-c.bottom+k(o,"bottom")),t.leftc.right-k(r,"right")&&(l=t.right-c.right+k(o,"right")),l||u)if(a)i.defaultView.scrollBy(l,u);else{var p=s.scrollLeft,f=s.scrollTop;u&&(s.scrollTop+=u),l&&(s.scrollLeft+=l);var h=s.scrollLeft-p,v=s.scrollTop-f;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(a)break}}function O(e){for(var t=[],n=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=n);e=d(e));return t}function M(e,t){for(var n=0;n=a){s=Math.max(f.bottom,s),a=Math.min(f.top,a);var d=f.left>t.left?f.left-t.left:f.right=(f.left+f.right)/2?1:0));continue}}!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(i=l+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:N(n,r)}function T(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function $(e,t){var n,r,o,i,a=e.root;if(a.caretPositionFromPoint)try{var c=a.caretPositionFromPoint(t.left,t.top);c&&(o=(n=c).offsetNode,i=n.offset)}catch(e){}if(!o&&a.caretRangeFromPoint){var l=a.caretRangeFromPoint(t.left,t.top);l&&(o=(r=l).startContainer,i=r.startOffset)}var u,p=a.elementFromPoint(t.left,t.top+1);if(!p||!e.dom.contains(1!=p.nodeType?p.parentNode:p)){var f=e.dom.getBoundingClientRect();if(!T(t,f))return null;if(!(p=function e(t,n,r){var o=t.childNodes.length;if(o&&r.topt.top&&i++}o==e.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&t.top>o.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(u=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right-1?o:e.docView.posFromDOM(t,n)}(e,o,i,t))}null==u&&(u=function(e,t,n){var r=N(t,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}(e,p,t));var v=e.docView.nearestDesc(p,!0);return{pos:u,inside:v?v.posAtStart-v.border:-1}}function E(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}function D(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset;if(3==r.nodeType&&(s.webkit||s.gecko)){var i=E(h(r,o,o),0);if(s.gecko&&o&&/\s/.test(r.nodeValue[o-1])&&o0&&ol.top&&("up"==n?l.bottomi.bottom-1))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return P.test(r.parent.textContent)&&a.modify?I(e,t,(function(){var t=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(e,t,n))}var L=function(e,t,n,r){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},V={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0}};L.prototype.matchesWidget=function(){return!1},L.prototype.matchesMark=function(){return!1},L.prototype.matchesNode=function(){return!1},L.prototype.matchesHack=function(){return!1},V.beforePosition.get=function(){return!1},L.prototype.parseRule=function(){return null},L.prototype.stopEvent=function(){return!1},V.size.get=function(){for(var e=0,t=0;t0:a)?this.posAtEnd:this.posAtStart},L.prototype.nearestDesc=function(e,t){for(var n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==e.nodeType?e:e.parentNode):o.nodeDOM==e))return o;n=!1}}},L.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},L.prototype.posFromDOM=function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1},L.prototype.descAt=function(e){for(var t=0,n=0;t=l&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,l);e=i;for(var u=s;u>0;u--){var p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=f(p.dom)+1;break}e-=p.size}-1==r&&(r=0)}if(r>-1&&(c>t||s==this.children.length-1)){t=c;for(var d=s+1;da&&it){var h=u;u=p,p=h}var m=document.createRange();m.setEnd(p.node,p.offset),m.setStart(u.node,u.offset),f.removeAllRanges(),f.addRange(m)}}},L.prototype.ignoreMutation=function(e){return!this.contentDOM&&"selection"!=e.type},V.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},L.prototype.markDirty=function(e,t){for(var n=0,r=0;r=n:en){var s=n+o.border,a=i-o.border;if(e>=s&&t<=a)return this.dirty=e==n||t==i?2:1,void(e!=s||t!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-s,t-s):o.dirty=3);o.dirty=3}n=i}this.dirty=2},L.prototype.markParentsDirty=function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty0&&(i=ce(i,0,e,r));for(var a=0;ai;)l.push(o[c++]);var y=i+v.nodeSize;if(v.isText){var b=y;c=0&&!a&&c.syncToMarks(s==n.node.childCount?o.Mark.none:n.node.child(s).marks,r,e),c.placeWidget(t,e,i)}),(function(t,n,o,s){c.syncToMarks(t.marks,r,e),c.findNodeMatch(t,n,o,s)||c.updateNextNode(t,n,o,e,s)||c.addNode(t,n,o,e,i),i+=t.nodeSize})),c.syncToMarks(H,r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),function e(t,n,r){for(var o=t.firstChild,i=!1,s=0;st+this.node.content.size)){var s=e.root.getSelection(),a=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];e=e.childNodes[t-1],t=y(e)}else{if(!(1==e.nodeType&&t=n){var u=c.lastIndexOf(t,r-a);if(u>=0&&u+t.length+a>=n)return a+u}}}return-1}(this.node.content,c,o-t,i-t);return l<0?null:{node:a,pos:l,text:c}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,r=t.pos,o=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=null)}var s=new U(this,i,n,o);e.compositionNodes.push(s),this.children=ce(this.children,r,r+o.length,e,s)}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)},t.prototype.updateInner=function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!oe(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=te(this.dom,this.nodeDOM,ee(this.outerDeco,this.node,t),ee(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},Object.defineProperties(t.prototype,n),t}(L);function q(e,t,n,r,o){return re(r,t,e),new K(null,e,t,n,r,r,r,o,0)}var G=function(e){function t(t,n,r,o,i,s,a){e.call(this,t,n,r,o,i,null,s,a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}},t.prototype.update=function(e,t,n,r){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,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,r)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type&&"selection"!=e.type},t.prototype.slice=function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},t}(K),X=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(){return 0==this.dirty},t}(L),Z=function(e){function t(t,n,r,o,i,s,a,c,l,u){e.call(this,t,n,r,o,i,s,a,l,u),this.spec=c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(t,n);return i&&this.updateInner(t,n,r,o),i}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,r,o)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):e.prototype.setSelection.call(this,t,n,r,o)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(K);function Y(e){e&&(this.nodeName=e)}Y.prototype=Object.create(null);var Q=[new Y];function ee(e,t,n){if(0==e.length)return Q;for(var r=n?Q[0]:new Y,o=[r],i=0;i0&&o>=0;o--){var i=t[o],s=i.node;if(s){if(s!=e.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(e.node.content,e.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function ae(e,t){return e.type.side-t.type.side}function ce(e,t,n,r,o){for(var i=[],s=0,a=0;s=n||u<=t?i.push(c):(ln&&i.push(c.slice(n-l,c.size,r)))}return i}function le(e,t){var n=e.selection,o=n.$anchor,i=n.$head,s=t>0?o.max(i):o.min(i),a=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return a&&r.Selection.findFrom(a,t)}function ue(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function pe(e,t,n){var o=e.state.selection;if(!(o instanceof r.TextSelection)){if(o instanceof r.NodeSelection&&o.node.isInline)return ue(e,new r.TextSelection(t>0?o.$to:o.$from));var i=le(e.state,t);return!!i&&ue(e,i)}if(!o.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var a=le(e.state,t);return!!(a&&a instanceof r.NodeSelection)&&ue(e,a)}if(!(s.mac&&n.indexOf("m")>-1)){var c,l=o.$head,u=l.textOffset?null:t<0?l.nodeBefore:l.nodeAfter;if(!u||u.isText)return!1;var p=t<0?l.pos-u.nodeSize:l.pos;return!!(u.isAtom||(c=e.docView.descAt(p))&&!c.contentDOM)&&(r.NodeSelection.isSelectable(u)?ue(e,new r.NodeSelection(t<0?e.state.doc.resolve(l.pos-u.nodeSize):l)):!!s.webkit&&ue(e,new r.TextSelection(e.state.doc.resolve(t<0?p:p+u.nodeSize))))}}function fe(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function de(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function he(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(s.gecko&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var c=n.childNodes[r-1];if(de(c))o=n,i=--r;else{if(3!=c.nodeType)break;r=(n=c).nodeValue.length}}else{if(me(n))break;for(var l=n.previousSibling;l&&de(l);)o=n.parentNode,i=f(l),l=l.previousSibling;if(l)r=fe(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?ge(e,t,n,r):o&&ge(e,t,o,i)}}function ve(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,s=fe(n);;)if(r-1)return!1;if(s.mac&&n.indexOf("m")>-1)return!1;var i=o.$from,a=o.$to;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var c=le(e.state,t);if(c&&c instanceof r.NodeSelection)return ue(e,c)}if(!i.parent.inlineContent){var l=r.Selection.findFrom(t<0?i:a,t);return!l||ue(e,l)}return!1}function be(e,t){if(!(e.state.selection instanceof r.TextSelection))return!0;var n=e.state.selection,o=n.$head,i=n.$anchor,s=n.empty;if(!o.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!o.textOffset&&(t<0?o.nodeBefore:o.nodeAfter);if(a&&!a.isText){var c=e.state.tr;return t<0?c.delete(o.pos-a.nodeSize,o.pos):c.delete(o.pos,o.pos+a.nodeSize),e.dispatch(c),!0}return!1}function we(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function xe(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||s.mac&&72==n&&"c"==r?be(e,-1)||he(e):46==n||s.mac&&68==n&&"c"==r?be(e,1)||ve(e):13==n||27==n||(37==n?pe(e,-1,r)||he(e):39==n?pe(e,1,r)||ve(e):38==n?ye(e,-1,r)||he(e):40==n?function(e){if(s.chrome&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;we(e,o,!0),setTimeout((function(){return we(e,o,!1)}),20)}}}(e)||ye(e,1,r)||ve(e):r==(s.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function Se(e,t){var n=e.root.getSelection(),o=e.state.doc;if(!n.focusNode)return null;var i=e.docView.nearestDesc(n.focusNode),s=i&&0==i.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var c,l,u=o.resolve(a);if(w(n)){for(c=u;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&r.NodeSelection.isSelectable(i.node)&&i.parent&&(!i.node.isInline||!function(e,t,n){for(var r=0==t,o=t==y(e);r||o;){if(e==n)return!0;var i=f(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==y(e)}}(n.focusNode,n.focusOffset,i.dom))){var p=i.posBefore;l=new r.NodeSelection(a==p?u:o.resolve(p))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;c=o.resolve(d)}l||(l=Te(e,c,u,"pointer"==t||e.state.selection.head=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},se.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(o,e.length);r-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=W.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},se.prototype.findNodeMatch=function(e,t,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),s=this.top.children;if(i&&i.matchesNode(e,t,n))o=s.indexOf(i);else for(var a=this.index,c=Math.min(s.length,a+5);a-1&&a+this.preMatchOffset!=o)return!1;var c=s.dom;if(!(this.lock&&(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&oe(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},se.prototype.addNode=function(e,t,n,r,o){this.top.children.splice(this.index++,0,K.create(this.top,e,t,n,r,o)),this.changed=!0},se.prototype.placeWidget=function(e,t,n){var r=this.indexDate.now()-50?e.lastSelectionOrigin:null,l=Se(e,c);if(l&&!e.state.selection.eq(l)){var u=e.state.tr.setSelection(l);"pointer"==c?u.setMeta("pointer",!0):"key"==c&&u.scrollIntoView(),e.dispatch(u)}}else{var p=e.state.doc.resolve(t),f=p.sharedDepth(n);t=p.before(f+1),n=e.state.doc.resolve(n).after(f+1);var d,h,v=e.state.selection,m=function(e,t,n){var r=e.docView.parseRange(t,n),i=r.node,a=r.fromOffset,c=r.toOffset,l=r.from,u=r.to,p=e.root.getSelection(),f=null,d=p.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(f=[{node:d,offset:p.anchorOffset}],w(p)||f.push({node:p.focusNode,offset:p.focusOffset})),s.chrome&&8===e.lastKeyCode)for(var h=c;h>a;h--){var v=i.childNodes[h-1],m=v.pmViewDesc;if("BR"==v.nodeType&&!m){c=h;break}if(!m||m.size)break}var g=e.state.doc,y=e.someProp("domParser")||o.DOMParser.fromSchema(e.state.schema),b=g.resolve(l),x=null,S=y.parse(i,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:a,to:c,preserveWhitespace:!b.parent.type.spec.code||"full",editableContent:!0,findPositions:f,ruleFromNode:Ee,context:b});if(f&&null!=f[0].pos){var k=f[0].pos,C=f[1]&&f[1].pos;null==C&&(C=k),x={anchor:k+l,head:C+l}}return{doc:S,sel:x,from:l,to:u}}(e,t,n),g=e.state.doc,y=g.slice(m.from,m.to);8===e.lastKeyCode&&Date.now()-100=a?i-r:0)+(c-a),a=i}else if(c=c?i-r:0)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,m.doc.content,m.from,d,h);if(!b){if(!(i&&v instanceof r.TextSelection&&!v.empty&&v.$head.sameParent(v.$anchor))||e.composing||m.sel&&m.sel.anchor!=m.sel.head){if(m.sel){var S=Re(e,e.state.doc,m.sel);S&&!S.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(S))}return}b={start:v.from,endA:v.to,endB:v.to}}e.domChangeCount++,e.state.selection.frome.state.selection.from&&b.start<=e.state.selection.from+2?b.start=e.state.selection.from:b.endA=e.state.selection.to-2&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),s.ie&&s.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>m.from&&"  "==m.doc.textBetween(b.start-m.from-1,b.start-m.from+1)&&(b.start--,b.endA--,b.endB--);var k,C=m.doc.resolveNoCache(b.start-m.from),_=m.doc.resolveNoCache(b.endB-m.from),O=C.sameParent(_)&&C.parent.inlineContent;if((s.ios&&e.lastIOSEnter>Date.now()-225&&(!O||a.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!O&&C.posb.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||Ie(r,!0,!1)n||Ie(s,!0,!1)t.content.size?null:Te(e,t.resolve(n.anchor),t.resolve(n.head))}function Ie(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Pe(e,t){for(var n=[],r=t.content,i=t.openStart,s=t.openEnd;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;var a=r.firstChild;n.push(a.type.name,a.type.hasRequiredAttrs()?a.attrs:null),r=a.content}var c=e.someProp("clipboardSerializer")||o.DOMSerializer.fromSchema(e.state.schema),l=Ve(),u=l.createElement("div");u.appendChild(c.serializeFragment(r,{document:l}));for(var p,f=u.firstChild;f&&1==f.nodeType&&(p=Be[f.nodeName.toLowerCase()]);){for(var d=p.length-1;d>=0;d--){for(var h=l.createElement(p[d]);u.firstChild;)h.appendChild(u.firstChild);u.appendChild(h)}f=u.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice",i+" "+s+" "+JSON.stringify(n)),{dom:u,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function Fe(e,t,n,r,i){var s,a,c=i.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||c||!n);if(l){if(e.someProp("transformPastedText",(function(e){t=e(t,c||r)})),c)return new o.Slice(o.Fragment.from(e.state.schema.text(t)),0,0);var u=e.someProp("clipboardTextParser",(function(e){return e(t,i,r)}));u?a=u:(s=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach((function(e){s.appendChild(document.createElement("p")).textContent=e})))}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),s=function(e){var t=/(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Ve().createElement("div"),o=/(?:]*>)*<([a-z][^>\s]+)/i.exec(e),i=0;(n=o&&Be[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return""})).reverse().join(""),i=n.length);r.innerHTML=e;for(var s=0;s=0;c-=2){var l=r.nodes[n[c]];if(!l||l.hasRequiredAttrs())break;i=o.Fragment.from(l.create(n[c+1],i)),s++,a++}return new o.Slice(i,s,a)}(function(e,t,n){t=0;r--){var i=n(r);if(i)return i.v}return e}(a.content,i),!1),e.someProp("transformPasted",(function(e){a=e(a)})),a}function je(e,t,n){void 0===n&&(n=0);for(var r=t.length-1;r>=n;r--)e=t[r].create(null,o.Fragment.from(e));return e}function ze(e,t,n,r,i,s){var a=t<0?e.firstChild:e.lastChild,c=a.content;return i=n&&(c=t<0?a.contentMatchAt(0).fillBefore(c,e.childCount>1||s<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(o.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(c))}var Be={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Le=null;function Ve(){return Le||(Le=document.implementation.createHTMLDocument("title"))}var He={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Je=s.ie&&s.ie_version<=11,Ue=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Ue.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},Ue.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var We=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;te.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new Ue,Je&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};We.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))},We.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},We.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,He),Je&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},We.prototype.stop=function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&$e(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var c=0;c1){var u=a.filter((function(e){return"BR"==e.nodeName}));if(2==u.length){var p=u[0],f=u[1];p.parentNode&&p.parentNode.parentNode==f.parentNode?f.remove():p.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(Ke)return;Ke=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&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.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ke(this.view))}},We.prototype.registerMutation=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")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){var r=e.previousSibling,o=e.nextSibling;if(s.ie&&s.ie_version<=11&&e.addedNodes.length)for(var i=0;ii.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function tt(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function nt(e,t,n,o,i){return et(e,"handleClickOn",t,n,o)||e.someProp("handleClick",(function(n){return n(e,t,o)}))||(i?function(e,t){if(-1==t)return!1;var n,o,i=e.state.selection;i instanceof r.NodeSelection&&(n=i.node);for(var s=e.state.doc.resolve(t),a=s.depth+1;a>0;a--){var c=a>s.depth?s.nodeAfter:s.node(a);if(r.NodeSelection.isSelectable(c)){o=n&&i.$from.depth>0&&a>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(a);break}}return null!=o&&(tt(e,r.NodeSelection.create(e.state.doc,o),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),o=n.nodeAfter;return!!(o&&o.isAtom&&r.NodeSelection.isSelectable(o))&&(tt(e,new r.NodeSelection(n),"pointer"),!0)}(e,n))}function rt(e,t,n,r){return et(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function ot(e,t,n,o){return et(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",(function(n){return n(e,t,o)}))||function(e,t){var n=e.state.doc;if(-1==t)return!!n.inlineContent&&(tt(e,r.TextSelection.create(n,0,n.content.size),"pointer"),!0);for(var o=n.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)tt(e,r.TextSelection.create(n,a+1,a+1+s.content.size),"pointer");else{if(!r.NodeSelection.isSelectable(s))continue;tt(e,r.NodeSelection.create(n,a),"pointer")}return!0}}(e,n)}function it(e){return pt(e)}Ge.keydown=function(e,t){if(e.shiftKey=16==t.keyCode||t.shiftKey,!ct(e,t))if(e.domObserver.forceFlush(),e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),!s.ios||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",(function(n){return n(e,t)}))||xe(e,t)?t.preventDefault():Xe(e,"key");else{var n=Date.now();e.lastIOSEnter=n,e.lastIOSEnterFallbackTimeout=setTimeout((function(){e.lastIOSEnter==n&&(e.someProp("handleKeyDown",(function(t){return t(e,x(13,"Enter"))})),e.lastIOSEnter=0)}),200)}},Ge.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},Ge.keypress=function(e,t){if(!(ct(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||s.mac&&t.metaKey))if(e.someProp("handleKeyPress",(function(n){return n(e,t)})))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof r.TextSelection&&n.$from.sameParent(n.$to))){var o=String.fromCharCode(t.charCode);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 st=s.mac?"metaKey":"ctrlKey";qe.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=it(e),r=Date.now(),o="singleClick";r-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.lastClick)&&!t[st]&&("singleClick"==e.lastClick.type?o="doubleClick":"doubleClick"==e.lastClick.type&&(o="tripleClick")),e.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(Qe(t));i&&("singleClick"==o?e.mouseDown=new at(e,i,t,n):("doubleClick"==o?rt:ot)(e,i.pos,i.inside,t)?t.preventDefault():Xe(e,"pointer"))};var at=function(e,t,n,o){var i,a,c=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=o,this.selectNode=n[st],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{var l=e.state.doc.resolve(t.pos);i=l.parent,a=l.depth?l.before():0}this.mightDrag=null;var u=o?null:n.target,p=u?e.docView.nearestDesc(u,!0):null;this.target=p?p.dom:null,(i.type.spec.draggable&&!1!==i.type.spec.selectable||e.state.selection instanceof r.NodeSelection&&a==e.state.selection.from)&&(this.mightDrag={node:i,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&s.gecko&&!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(){return c.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Xe(e,"pointer")};function ct(e,t){return!!e.composing||!!(s.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}at.prototype.done=function(){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.view.mouseDown=null},at.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Qe(e))),this.allowDefault||!t?Xe(this.view,"pointer"):nt(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():this.flushed||s.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||s.chrome&&!(this.view.state.selection instanceof r.TextSelection)&&(t.pos==this.view.state.selection.from||t.pos==this.view.state.selection.to)?(tt(this.view,r.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Xe(this.view,"pointer")}},at.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Xe(this.view,"pointer")},qe.touchdown=function(e){it(e),Xe(e,"pointer")},qe.contextmenu=function(e){return it(e)};var lt=s.android?5e3:-1;function ut(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout((function(){return pt(e)}),t))}function pt(e,t){for(e.domObserver.forceFlush(),e.composing=!1;e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty();if(t||e.docView.dirty){var n=Se(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}Ge.compositionstart=Ge.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(),pt(e,!0),e.markCursor=null;else if(pt(e),s.gecko&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.composing=!0}ut(e,lt)},Ge.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,ut(e,20))};var ft=s.ie&&s.ie_version<15||s.ios&&s.webkit_version<604;function dt(e,t,n,r){var i=Fe(e,t,n,e.shiftKey,e.state.selection.$from);if(!e.someProp("handlePaste",(function(t){return t(e,r,i||o.Slice.empty)}))&&i){var s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),a=s?e.state.tr.replaceSelectionWith(s,e.shiftKey):e.state.tr.replaceSelection(i);e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"))}}qe.copy=Ge.cut=function(e,t){var n=e.state.selection,r="cut"==t.type;if(!n.empty){var o=ft?null:t.clipboardData,i=Pe(e,n.content()),s=i.dom,a=i.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.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 r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Ge.paste=function(e,t){var n=ft?null:t.clipboardData,r=n&&n.getData("text/html"),o=n&&n.getData("text/plain");n&&(r||o||n.files.length)?(dt(e,o,r,t),t.preventDefault()):function(e,t){if(e.dom.parentNode){var n=e.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?dt(e,r.value,null,t):dt(e,r.textContent,r.innerHTML,t)}),50)}}(e,t)};var ht=function(e,t){this.slice=e,this.move=t},vt=s.mac?"altKey":"ctrlKey";for(var mt in qe.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(Qe(t));if(i&&i.pos>=o.from&&i.pos<=(o instanceof r.NodeSelection?o.to-1:o.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var s=e.docView.nearestDesc(t.target,!0);if(!s||!s.node.type.spec.draggable||s==e.docView)return;e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,s.posBefore)))}var a=e.state.selection.content(),c=Pe(e,a),l=c.dom,u=c.text;t.dataTransfer.clearData(),t.dataTransfer.setData(ft?"Text":"text/html",l.innerHTML),ft||t.dataTransfer.setData("text/plain",u),e.dragging=new ht(a,!t[vt])}},qe.dragend=function(e){window.setTimeout((function(){return e.dragging=null}),50)},Ge.dragover=Ge.dragenter=function(e,t){return t.preventDefault()},Ge.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var s=e.posAtCoords(Qe(t));if(s){var a=e.state.doc.resolve(s.pos);if(a){var c=n&&n.slice||Fe(e,t.dataTransfer.getData(ft?"Text":"text/plain"),ft?null:t.dataTransfer.getData("text/html"),!1,a);if(e.someProp("handleDrop",(function(r){return r(e,t,c||o.Slice.empty,n&&n.move)})))t.preventDefault();else if(c){t.preventDefault();var l=c?Object(i.h)(e.state.doc,a.pos,c):a.pos;null==l&&(l=a.pos);var u=e.state.tr;n&&n.move&&u.deleteSelection();var p=u.mapping.map(l),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,d=u.doc;if(f?u.replaceRangeWith(p,p,c.content.firstChild):u.replaceRange(p,p,c),!u.doc.eq(d)){var h=u.doc.resolve(p);f&&r.NodeSelection.isSelectable(c.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(c.content.firstChild)?u.setSelection(new r.NodeSelection(h)):u.setSelection(Te(e,h,u.doc.resolve(u.mapping.map(l)))),e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}}}}}},qe.focus=function(e){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.root.getSelection())&&ke(e)}),20))},qe.blur=function(e){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),e.domObserver.currentSelection.set({}),e.focused=!1)},qe.beforeinput=function(e,t){if(s.chrome&&s.android&&"deleteContentBackward"==t.inputType){var n=e.domChangeCount;setTimeout((function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,x(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)}},Ge)qe[mt]=Ge[mt];function gt(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var yt=function(e,t){this.spec=t||Ct,this.side=this.spec.side||0,this.toDOM=e};yt.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new xt(i-n,i-n,this)},yt.prototype.valid=function(){return!0},yt.prototype.eq=function(e){return this==e||e instanceof yt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&>(this.spec,e.spec))};var bt=function(e,t){this.spec=t||Ct,this.attrs=e};bt.prototype.map=function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new xt(o,i,this)},bt.prototype.valid=function(e,t){return t.from=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;ae){var c=this.children[a]+1;this.children[a+2].findInner(e-c,t-c,n,r+c,o)}},_t.prototype.map=function(e,t,n){return this==Ot||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Ct)},_t.prototype.mapInner=function(e,t,n,r,o){for(var i,s=0;sc+i||(t>=a[s]+i?a[s+1]=-1:n>=o&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l))}},l=0;l=r.content.size){u=!0;continue}var h=n.map(e[p+1]+i,-1)-o,v=r.content.findIndex(d),m=v.index,g=v.offset,y=r.maybeChild(m);if(y&&g==d&&g+y.nodeSize==h){var b=a[p+2].mapInner(n,y,f+1,a[p]+i+1,s);b!=Ot?(a[p]=d,a[p+1]=h,a[p+2]=b):(a[p+1]=-2,u=!0)}else u=!0}if(u){var w=$t(function(e,t,n,r,o,i,s){function a(e,t){for(var i=0;is&&l.to=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,s=i+t.content.size,a=0;ai&&c.type instanceof bt){var l=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;ln&&s.to0;)t++;e.splice(t,0,n)}function It(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=Ot&&t.push(r)})),e.cursorWrapper&&t.push(_t.create(e.state.doc,[e.cursorWrapper.deco])),Mt.from(t)}Mt.prototype.forChild=function(e,t){if(t.isLeaf)return _t.empty;for(var n=[],r=0;ro.scrollToSelection?"to selection":"preserve",k=i||!this.docView.matchesNode(e.doc,x,w),C=k||!e.selection.eq(o.selection),A="preserve"==S&&C&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s=o-20){t=a,n=c.top;break}}}return{refDOM:t,refTop:n,stack:O(e.dom)}}(this);if(C){this.domObserver.stop();var N=k&&(s.ie||s.chrome)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(p=o.selection,f=e.selection,d=Math.min(p.$anchor.sharedDepth(p.head),f.$anchor.sharedDepth(f.head)),p.$anchor.start(d)!=f.$anchor.start(d));if(k){var T=s.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!i&&this.docView.update(e.doc,x,w,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=q(e.doc,x,w,this.dom,this)),T&&!this.trackWrites&&(N=!0)}N||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(c=this,l=c.docView.domFromPos(c.state.selection.anchor),u=c.root.getSelection(),v(l.node,l.offset,u.anchorNode,u.anchorOffset)))?ke(this,N):(Ae(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),"reset"==S)this.dom.scrollTop=0;else if("to selection"==S){var $=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(e){return e(n)}))||(e.selection instanceof r.NodeSelection?_(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),$):_(this,this.coordsAtPos(e.selection.head),$))}else A&&(m=(h=A).refDOM,g=h.refTop,y=h.stack,b=m?m.getBoundingClientRect().top:0,M(y,0==b?0:b-g))},Pt.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},Pt.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins)for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var o=r.Selection.findFrom(n.doc.resolve(e),t,!0);return o?n.setSelection(o):n}},l=function(e){return e.type&&e.type.spec.selectable},u=function(e,t,n){return function(e){return l(e)&&e.type.isLeaf}(e)?n.setSelection(new r.NodeSelection(n.doc.resolve(t))):c(t)(n)},p=function(e,t,n){return function(r){var o="number"==typeof t,i=r.selection.$from,c=o?r.doc.resolve(t):f(r.selection)?r.doc.resolve(i.pos+1):i,p=c.parent;if(f(r.selection)&&n&&r!==(r=a(e)(r)))return r;if(w(p)&&r!==(r=s(p.type,e)(r))){var d=l(e)?c.before(c.depth):c.pos;return u(e,d,r)}if(b(c,e)){r.insert(c.pos,e);var v=o?c.pos:l(e)?r.selection.$anchor.pos-1:r.selection.$anchor.pos;return h(u(e,v,r))}for(var m=c.depth;m>0;m--){var g=c.after(m),y=r.doc.resolve(g);if(b(y,e))return r.insert(g,e),h(u(e,g,r))}return r}},f=function(e){return e instanceof r.NodeSelection},d=function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e},h=function(e){return Object.assign(Object.create(e),e).setTime(Date.now())},v=function(e,t){return function(n){var r=n.doc.nodeAt(e),o=n.doc.resolve(e);if(m(o,t)){var i=(n=n.replaceWith(e,e+r.nodeSize,t)).selection.$from.pos-1;return n=c(Math.max(i,0),-1)(n),n=c(n.selection.$from.start())(n),h(n)}return n}},m=function(e,t){var n=e.node(e.depth);return n&&n.type.validContent(t instanceof o.Fragment?t:o.Fragment.from(t))},g=function(e){return function(t){var n=t.doc.nodeAt(e);return h(t.delete(e,e+n.nodeSize))}},y=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;var t={};return Object.keys(e.nodes).forEach((function(n){var r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)})),e.cached.tableNodeTypes=t,t},b=function(e,t){var n=e.index();return t instanceof o.Fragment?e.parent.canReplace(n,n,t):t instanceof o.Node&&e.parent.canReplaceWith(n,n,t.type)},w=function(e){return!e||"paragraph"===e.type.name&&2===e.nodeSize},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t?e.createChecked(null,t):e.createAndFill()},S=function(e){return function(t){for(var n=i.TableMap.get(t.$anchorCell.node(-1)),r=t.$anchorCell.start(-1),o=n.cellsInRect(e),s=n.cellsInRect(n.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r)),a=0,c=o.length;an[0]?-1:1,i=e.splice(t[0],t.length),s=i.length%2==0?1:0,a=void 0;return a=-1===r&&1===o?n[0]-1:1===r&&-1===o?n[n.length-1]-s+1:-1===o?n[0]:n[n.length-1]-s,e.splice.apply(e,[a,0].concat(i)),e},M=function(e,t,n,r){var o="Target position is invalid, you can't move the "+r+" "+e+" to "+t+", the target can't be split. You could use tryToFit option.";if(1===(e>t?-1:1)){if(-1!==n.slice(0,n.length-1).indexOf(t))throw new Error(o)}else if(-1!==n.slice(1).indexOf(t))throw new Error(o);return!0},A=function(e){return function(t){var n=t.$from;return N(n,e)}},N=function(e,t){for(var n=e.depth;n>0;n--){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}},T=function(e,t){return function(n){var r=A(e)(n);if(r)return R(r.pos,t)}},$=function(e){return function(t){return!!A(e)(t)}},E=function(e){return function(t){return A((function(t){return d(e,t)}))(t)}},D=function(e){var t=e.$from.nodeBefore,n=r.Selection.findFrom(e.$from,-1);if(n&&t){var o=E(t.type)(n);return o?o.pos:n.$from.pos}},R=function(e,t){var n=t(e),r=n.node.childNodes[n.offset];return n.node.nodeType===Node.TEXT_NODE?n.node.parentNode:r&&r.nodeType!==Node.TEXT_NODE?r:n.node},I=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');var n=[];return e.descendants((function(e,r){if(n.push({node:e,pos:r}),!t)return!1})),n},P=function(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return I(e,n).filter((function(e){return t(e.node)}))},F=function(e,t,n){return P(e,(function(e){return e.type===t}),n)};var j=function(e){return A((function(e){return e.type.spec.tableRole&&"table"===e.type.spec.tableRole}))(e)},z=function(e){return e instanceof i.CellSelection},B=function(e){if(z(e)){var t=i.TableMap.get(e.$anchorCell.node(-1));return S({left:0,right:t.width,top:0,bottom:t.height})(e)}return!1},L=function(e){return function(t){var n=j(t);if(n){var r=i.TableMap.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((function(e,t){if(t>=0&&t<=r.width-1){var o=r.cellsInRect({left:t,right:t+1,top:0,bottom:r.height});return e.concat(o.map((function(e){var t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}})))}}),[])}}},V=function(e){return function(t){var n=j(t);if(n){var r=i.TableMap.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((function(e,t){if(t>=0&&t<=r.height-1){var o=r.cellsInRect({left:0,right:r.width,top:t,bottom:t+1});return e.concat(o.map((function(e){var t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}})))}}),[])}}},H=function(e){return function(t,n){return function(r){var o=j(r.selection),s="row"===e;if(o){var a=i.TableMap.get(o.node);if(t>=0&&t<(s?a.height:a.width)){var c=s?0:t,l=s?t:0,u=s?a.width:t+1,p=s?t+1:a.height;if(n){var f=Z(r.selection.$from);if(!f)return r;var d=a.findCell(f.pos-o.start);s?(l=Math.min(l,d.top),p=Math.max(p,d.bottom)):(c=Math.min(c,d.left),u=Math.max(u,d.right))}var v=a.cellsInRect({left:c,top:l,right:s?u:c+1,bottom:s?l+1:p}),m=p-l==1?v:a.cellsInRect({left:s?c:u-1,top:s?p-1:l,right:u,bottom:p}),g=o.start+v[0],y=o.start+m[m.length-1],b=r.doc.resolve(g),w=r.doc.resolve(y);return h(r.setSelection(new i.CellSelection(w,b)))}}return r}}},J=H("column"),U=H("row"),W=function(e){return function(t){var n=j(t.selection);if(n){var r=i.TableMap.get(n.node);if(e>=0&&e<=r.height){for(var o=n.node,s=y(o.type.schema),a=n.start,c=0;c1&&n+o>e}))(t);d.push.apply(d,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=0;v--)h(v);d.length&&d.forEach((function(e){t=X(e,{rowspan:e.node.attrs.rowspan+1})(t)}))}return p(s.row.create(l.attrs,u),a)(t)}}return t}},K=function(e){return function(t){var n=j(t.selection);if(n){var r=i.TableMap.get(n.node);if(0===e&&1===r.width)return G(t);if(e>=0&&e<=r.width)return i.removeColumn(t,{map:r,tableStart:n.start,table:n.node},e),h(t)}return t}},q=function(e){return function(t){var n=j(t.selection);if(n){var r=i.TableMap.get(n.node);if(0===e&&1===r.height)return G(t);if(e>=0&&e<=r.height)return i.removeRow(t,{map:r,tableStart:n.start,table:n.node},e),h(t)}return t}},G=function(e){for(var t=e.selection.$from,n=t.depth;n>0;n--){if("table"===t.node(n).type.spec.tableRole)return h(e.delete(t.before(n),t.after(n)))}return e},X=function(e,t){return function(n){return e?(n.setNodeMarkup(e.pos,null,Object.assign({},e.node.attrs,t)),h(n)):n}},Z=function(e){return N(e,(function(e){return e.type.spec.tableRole&&/cell/i.test(e.type.spec.tableRole)}))},Y=function(e){var t=Z(e);if(t){var n=function(e){return N(e,(function(e){return e.type.spec.tableRole&&/table/i.test(e.type.spec.tableRole)}))}(e),r=i.TableMap.get(n.node),o=t.pos-n.start;return r.rectBetween(o,o)}},Q=function(e,t){return function(n){var r=[],o=V(e)(n.selection);if(o)for(var i=o.length-1;i>=0;i--)t(o[i],n)&&r.push(o[i]);return r}},ee=function(e){return function(t){for(var n=e,r=e,o=function(e){var o=L(e)(t.selection);o&&o.forEach((function(t){var o=t.node.attrs.colspan+e-1;o>=n&&(n=e),o>r&&(r=o)}))},i=e;i>=0;i--)o(i);var s=function(e){var n=L(e)(t.selection);n&&n.forEach((function(t){var n=t.node.attrs.colspan+e-1;t.node.attrs.colspan>1&&n>r&&(r=n)}))};for(i=e;i<=r;i++)s(i);var a=[];for(i=n;i<=r;i++){var c=L(i)(t.selection);c&&c.length&&a.push(i)}n=a[0],r=a[a.length-1];for(var l=L(n)(t.selection),u=V(0)(t.selection),p=t.doc.resolve(l[l.length-1].pos),f=void 0,d=r;d>=n;d--){var h=L(d)(t.selection);if(h&&h.length){for(var v=u.length-1;v>=0;v--)if(u[v].pos===h[0].pos){f=h[0];break}if(f)break}}return{$anchor:p,$head:t.doc.resolve(f.pos),indexes:a}}},te=function(e){return function(t){for(var n=e,r=e,o=function(e){V(e)(t.selection).forEach((function(t){var o=t.node.attrs.rowspan+e-1;o>=n&&(n=e),o>r&&(r=o)}))},i=e;i>=0;i--)o(i);var s=function(e){V(e)(t.selection).forEach((function(t){var n=t.node.attrs.rowspan+e-1;t.node.attrs.rowspan>1&&n>r&&(r=n)}))};for(i=e;i<=r;i++)s(i);var a=[];for(i=n;i<=r;i++){var c=V(i)(t.selection);c&&c.length&&a.push(i)}n=a[0],r=a[a.length-1];for(var l=V(n)(t.selection),u=L(0)(t.selection),p=t.doc.resolve(l[l.length-1].pos),f=void 0,d=r;d>=n;d--){var h=V(d)(t.selection);if(h&&h.length){for(var v=u.length-1;v>=0;v--)if(u[v].pos===h[0].pos){f=h[0];break}if(f)break}}return{$anchor:p,$head:t.doc.resolve(f.pos),indexes:a}}};t.isNodeSelection=f,t.canInsert=b,t.convertTableNodeToArrayOfRows=C,t.convertArrayOfRowsToTableNode=_,t.findParentNode=A,t.findParentNodeClosestToPos=N,t.findParentDomRef=T,t.hasParentNode=$,t.findParentNodeOfType=E,t.findParentNodeOfTypeClosestToPos=function(e,t){return N(e,(function(e){return d(t,e)}))},t.hasParentNodeOfType=function(e){return function(t){return $((function(t){return d(e,t)}))(t)}},t.findParentDomRefOfType=function(e,t){return function(n){return T((function(t){return d(e,t)}),t)(n)}},t.findSelectedNodeOfType=function(e){return function(t){if(f(t)){var n=t.node,r=t.$from;if(d(e,n))return{node:n,pos:r.pos,depth:r.depth}}}},t.findPositionOfNodeBefore=D,t.findDomRefAtPos=R,t.flatten=I,t.findChildren=P,t.findTextNodes=function(e,t){return P(e,(function(e){return e.isText}),t)},t.findInlineNodes=function(e,t){return P(e,(function(e){return e.isInline}),t)},t.findBlockNodes=function(e,t){return P(e,(function(e){return e.isBlock}),t)},t.findChildrenByAttr=function(e,t,n){return P(e,(function(e){return!!t(e.attrs)}),n)},t.findChildrenByType=F,t.findChildrenByMark=function(e,t,n){return P(e,(function(e){return t.isInSet(e.marks)}),n)},t.contains=function(e,t){return!!F(e,t).length},t.findTable=j,t.isCellSelection=z,t.getSelectionRect=function(e){if(z(e)){var t=e.$anchorCell.start(-1);return i.TableMap.get(e.$anchorCell.node(-1)).rectBetween(e.$anchorCell.pos-t,e.$headCell.pos-t)}},t.isColumnSelected=function(e){return function(t){if(z(t)){var n=i.TableMap.get(t.$anchorCell.node(-1));return S({left:e,right:e+1,top:0,bottom:n.height})(t)}return!1}},t.isRowSelected=function(e){return function(t){if(z(t)){var n=i.TableMap.get(t.$anchorCell.node(-1));return S({left:0,right:n.width,top:e,bottom:e+1})(t)}return!1}},t.isTableSelected=B,t.getCellsInColumn=L,t.getCellsInRow=V,t.getCellsInTable=function(e){var t=j(e);if(t){var n=i.TableMap.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map((function(e){var n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}}))}},t.selectColumn=J,t.selectRow=U,t.selectTable=function(e){var t=j(e.selection);if(t){var n=i.TableMap.get(t.node).map;if(n&&n.length){var r=t.start+n[0],o=t.start+n[n.length-1],s=e.doc.resolve(r),a=e.doc.resolve(o);return h(e.setSelection(new i.CellSelection(a,s)))}}return e},t.emptyCell=function(e,t){return function(n){if(e){var r=y(t).cell.createAndFill().content;if(!e.node.content.eq(r))return n.replaceWith(e.pos+1,e.pos+e.node.nodeSize,r),h(n)}return n}},t.addColumnAt=function(e){return function(t){var n=j(t.selection);if(n){var r=i.TableMap.get(n.node);if(e>=0&&e<=r.width)return h(i.addColumn(t,{map:r,tableStart:n.start,table:n.node},e))}return t}},t.moveRow=function(e,t,n){return function(r){var o=Object.assign({tryToFit:!1,direction:0},n),i=j(r.selection);if(!i)return r;var s=te(e)(r).indexes,a=te(t)(r).indexes;if(s.indexOf(t)>-1)return r;!o.tryToFit&&a.length>1&&M(e,t,a,"row");var c=function(e,t,n,r){var o=C(e.node);return o=O(o,t,n,r),_(e.node,o)}(i,s,a,o.direction);return h(r).replaceWith(i.pos,i.pos+i.node.nodeSize,c)}},t.moveColumn=function(e,t,n){return function(r){var o=Object.assign({tryToFit:!1,direction:0},n),i=j(r.selection);if(!i)return r;var s=ee(e)(r).indexes,a=ee(t)(r).indexes;if(s.indexOf(t)>-1)return r;!o.tryToFit&&a.length>1&&M(e,t,a,"column");var c=function(e,t,n,r){var o=k(C(e.node));return o=O(o,t,n,r),o=k(o),_(e.node,o)}(i,s,a,o.direction);return h(r).replaceWith(i.pos,i.pos+i.node.nodeSize,c)}},t.addRowAt=function(e,t){return function(n){var r=j(n.selection);if(r){var o=i.TableMap.get(r.node),s=e-1;if(t&&s>=0)return h(W(s)(n));if(e>=0&&e<=o.height)return h(i.addRow(n,{map:o,tableStart:r.start,table:r.node},e))}return n}},t.cloneRowAt=W,t.removeColumnAt=K,t.removeRowAt=q,t.removeTable=G,t.removeSelectedColumns=function(e){var t=e.selection;if(B(t))return G(e);if(z(t)){var n=j(t);if(n){var r=i.TableMap.get(n.node),o=r.rectBetween(t.$anchorCell.pos-n.start,t.$headCell.pos-n.start);if(0==o.left&&o.right==r.width)return!1;for(var s=Object.assign({},o,{map:r,table:n.node,tableStart:n.start}),a=s.right-1;i.removeColumn(e,s,a),a!==s.left;a--)s.table=s.tableStart?e.doc.nodeAt(s.tableStart-1):e.doc,s.map=i.TableMap.get(s.table);return h(e)}}return e},t.removeSelectedRows=function(e){var t=e.selection;if(B(t))return G(e);if(z(t)){var n=j(t);if(n){var r=i.TableMap.get(n.node),o=r.rectBetween(t.$anchorCell.pos-n.start,t.$headCell.pos-n.start);if(0==o.top&&o.bottom==r.height)return!1;for(var s=Object.assign({},o,{map:r,table:n.node,tableStart:n.start}),a=s.bottom-1;i.removeRow(e,s,a),a!==s.top;a--)s.table=s.tableStart?e.doc.nodeAt(s.tableStart-1):e.doc,s.map=i.TableMap.get(s.table);return h(e)}}return e},t.removeColumnClosestToPos=function(e){return function(t){var n=Y(e);return n?K(n.left)(c(e.pos)(t)):t}},t.removeRowClosestToPos=function(e){return function(t){var n=Y(e);return n?q(n.top)(c(e.pos)(t)):t}},t.forEachCellInColumn=function(e,t,n){return function(o){var i=L(e)(o.selection);if(i){for(var s=i.length-1;s>=0;s--)o=t(i[s],o);if(n){var a=o.doc.resolve(o.mapping.map(i[i.length-1].pos));o.setSelection(r.Selection.near(a))}return h(o)}return o}},t.forEachCellInRow=function(e,t,n){return function(o){var i=V(e)(o.selection);if(i){for(var s=i.length-1;s>=0;s--)o=t(i[s],o);if(n){var a=o.doc.resolve(o.mapping.map(i[i.length-1].pos));o.setSelection(r.Selection.near(a))}}return o}},t.setCellAttrs=X,t.createTable=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=y(e),s=i.cell,a=i.header_cell,c=i.row,l=i.table,u=[],p=[],f=0;f",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),a="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),c="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),u=i&&(c||+i[1]<57)||a&&c,p=0;p<10;p++)r[48+p]=r[96+p]=String(p);for(p=1;p<=24;p++)r[p+111]="F"+p;for(p=65;p<=90;p++)r[p]=String.fromCharCode(p+32),o[p]=String.fromCharCode(p);for(var f in r)o.hasOwnProperty(f)||(o[f]=r[f]);var d=n(1),h="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function v(e){var t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a127)&&(i=r[n.keyCode])&&i!=a){var f=t[m(i,n,!0)];if(f&&f(e.state,e.dispatch,e))return!0}else if(c&&n.shiftKey){var d=t[m(a,n,!0)];if(d&&d(e.state,e.dispatch,e))return!0}return!1}}},function(e,t,n){e.exports=n(15)},function(e,t,n){var r=n(23);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(13)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){var r=n(26);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(13)(r,o);r.locals&&(e.exports=r.locals)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(19),o=n(20);t.highlight=i,t.highlightAuto=function(e,t){var n,s,a,c,l=t||{},u=l.subset||r.listLanguages(),p=l.prefix,f=u.length,d=-1;null==p&&(p="hljs-");if("string"!=typeof e)throw o("Expected `string` for value, got `%s`",e);s={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++ds.relevance&&(s=a),a.relevance>n.relevance&&(s=n,n=a));s.language&&(n.secondBest=s);return n},t.registerLanguage=function(e,t){r.registerLanguage(e,t)},t.listLanguages=function(){return r.listLanguages()},t.registerAlias=function(e,t){var n,o=e;t&&((o={})[e]=t);for(n in o)r.registerAliases(o[n],{languageName:n})},s.prototype.addText=function(e){var t,n,r=this.stack;if(""===e)return;t=r[r.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},s.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},s.prototype.addSublanguage=function(e,t){var n=this.stack,r=n[n.length-1],o=e.rootNode.children,i=t?{type:"element",tagName:"span",properties:{className:[t]},children:o}:o;r.children=r.children.concat(i)},s.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,r=t[t.length-1],o={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(o),t.push(o)},s.prototype.closeNode=function(){this.stack.pop()},s.prototype.closeAllNodes=a,s.prototype.finalize=a,s.prototype.toHTML=function(){return""};function i(e,t,n){var i,a=r.configure({}),c=(n||{}).prefix;if("string"!=typeof e)throw o("Expected `string` for name, got `%s`",e);if(!r.getLanguage(e))throw o("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw o("Expected `string` for value, got `%s`",t);if(null==c&&(c="hljs-"),r.configure({__emitter:s,classPrefix:c}),i=r.highlight(e,t,!0),r.configure(a),i.errorRaised)throw i.errorRaised;return{relevance:i.relevance,language:i.language,value:i.emitter.rootNode.children}}function s(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function a(){}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),i=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(i).concat([o]).join("\n")}var s;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o=0&&p.splice(t,1)}function g(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return y(t,e.attrs),v(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var s=u++;n=l||(l=g(t)),r=S.bind(null,n,s,!1),o=S.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),v(e,t),t}(t),r=C.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=k.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return d(n,t),function(e){for(var r=[],o=0;o=0&&Math.floor(t)===t&&isFinite(e)}function f(e){return i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function d(e){return null==e?"":Array.isArray(e)||u(e)&&e.toString===l?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function v(e,t){for(var n=Object.create(null),r=e.split(","),o=0;o-1)return e.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function w(e,t){return b.call(e,t)}function x(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var S=/-(\w)/g,k=x((function(e){return e.replace(S,(function(e,t){return t?t.toUpperCase():""}))})),C=x((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),_=/\B([A-Z])/g,O=x((function(e){return e.replace(_,"-$1").toLowerCase()})),M=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function A(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function N(e,t){for(var n in t)e[n]=t[n];return e}function T(e){for(var t={},n=0;n0,Y=G&&G.indexOf("edge/")>0,Q=(G&&G.indexOf("android"),G&&/iphone|ipad|ipod|ios/.test(G)||"ios"===q),ee=(G&&/chrome\/\d+/.test(G),G&&/phantomjs/.test(G),G&&G.match(/firefox\/(\d+)/)),te={}.watch,ne=!1;if(W)try{var re={};Object.defineProperty(re,"passive",{get:function(){ne=!0}}),window.addEventListener("test-passive",null,re)}catch(r){}var oe=function(){return void 0===H&&(H=!W&&!K&&void 0!==t&&t.process&&"server"===t.process.env.VUE_ENV),H},ie=W&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return"function"==typeof e&&/native code/.test(e.toString())}var ae,ce="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);ae="undefined"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var le=$,ue=0,pe=function(){this.id=ue++,this.subs=[]};pe.prototype.addSub=function(e){this.subs.push(e)},pe.prototype.removeSub=function(e){y(this.subs,e)},pe.prototype.depend=function(){pe.target&&pe.target.addDep(this)},pe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(i&&!w(o,"default"))s=!1;else if(""===s||s===O(e)){var c=Le(String,o.type);(c<0||a0&&(ut((c=e(c,(n||"")+"_"+r))[0])&&ut(u)&&(p[l]=ye(u.text+c[0].text),c.shift()),p.push.apply(p,c)):a(c)?ut(u)?p[l]=ye(u.text+c):""!==c&&p.push(ye(c)):ut(c)&&ut(u)?p[l]=ye(u.text+c.text):(s(t._isVList)&&i(c.tag)&&o(c.key)&&i(n)&&(c.key="__vlist"+n+"_"+r+"__"),p.push(c)));return p}(e):void 0}function ut(e){return i(e)&&i(e.text)&&!1===e.isComment}function pt(e,t){if(e){for(var n=Object.create(null),r=ce?Reflect.ownKeys(e):Object.keys(e),o=0;o0,s=e?!!e.$stable:!i,a=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&n&&n!==r&&a===n.$key&&!i&&!n.$hasNormal)return n;for(var c in o={},e)e[c]&&"$"!==c[0]&&(o[c]=vt(t,c,e[c]))}else o={};for(var l in t)l in o||(o[l]=mt(t,l));return e&&Object.isExtensible(e)&&(e._normalized=o),V(o,"$stable",s),V(o,"$key",a),V(o,"$hasNormal",i),o}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:lt(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function mt(e,t){return function(){return e[t]}}function gt(e,t){var n,r,o,s,a;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,o=e.length;rdocument.createEvent("Event").timeStamp&&(cn=function(){return ln.now()})}function un(){var e,t;for(an=cn(),on=!0,en.sort((function(e,t){return e.id-t.id})),sn=0;snsn&&en[n].id>e.id;)n--;en.splice(n+1,0,e)}else en.push(e);rn||(rn=!0,tt(un))}}(this)},fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||c(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Ve(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:$,set:$};function hn(e,t,n){dn.get=function(){return this[t][n]},dn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,dn)}var vn={lazy:!0};function mn(e,t,n){var r=!oe();"function"==typeof n?(dn.get=r?gn(t):yn(n),dn.set=$):(dn.get=n.get?r&&!1!==n.cache?gn(t):yn(n.get):$,dn.set=n.set||$),Object.defineProperty(e,t,dn)}function gn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),pe.target&&t.depend(),t.value}}function yn(e){return function(){return e.call(this,this)}}function bn(e,t,n,r){return u(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var wn=0;function xn(e){var t=e.options;if(e.super){var n=xn(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var o in n)n[o]!==r[o]&&(t||(t={}),t[o]=n[o]);return t}(e);r&&N(e.extendOptions,r),(t=e.options=Pe(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Sn(e){this._init(e)}function kn(e){return e&&(e.Ctor.options.name||e.tag)}function Cn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===l.call(n)&&e.test(t));var n}function _n(e,t){var n=e.cache,r=e.keys,o=e._vnode;for(var i in n){var s=n[i];if(s){var a=kn(s.componentOptions);a&&!t(a)&&On(n,i,r,o)}}}function On(e,t,n,r){var o=e[t];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),e[t]=null,y(n,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=wn++,t._isVue=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Pe(xn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&qt(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,o=n&&n.context;e.$slots=ft(t._renderChildren,o),e.$scopedSlots=r,e._c=function(t,n,r,o){return zt(e,t,n,r,o,!1)},e.$createElement=function(t,n,r,o){return zt(e,t,n,r,o,!0)};var i=n&&n.data;Me(e,"$attrs",i&&i.attrs||r,null,!0),Me(e,"$listeners",t._parentListeners||r,null,!0)}(t),Qt(t,"beforeCreate"),function(e){var t=pt(e.$options.inject,e);t&&(Ce(!1),Object.keys(t).forEach((function(n){Me(e,n,t[n])})),Ce(!0))}(t),function(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},o=e.$options._propKeys=[];e.$parent&&Ce(!1);var i=function(i){o.push(i);var s=je(i,t,n,e);Me(r,i,s),i in e||hn(e,"_props",i)};for(var s in t)i(s);Ce(!0)}(e,t.props),t.methods&&function(e,t){for(var n in e.$options.props,t)e[n]="function"!=typeof t[n]?$:M(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;u(t=e._data="function"==typeof t?function(e,t){de();try{return e.call(t,t)}catch(e){return Ve(e,t,"data()"),{}}finally{he()}}(t,e):t||{})||(t={});for(var n,r=Object.keys(t),o=e.$options.props,i=(e.$options.methods,r.length);i--;){var s=r[i];o&&w(o,s)||(void 0,36!==(n=(s+"").charCodeAt(0))&&95!==n&&hn(e,"_data",s))}Oe(t,!0)}(e):Oe(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=oe();for(var o in t){var i=t[o],s="function"==typeof i?i:i.get;r||(n[o]=new fn(e,s||$,$,vn)),o in e||mn(e,o,i)}}(e,t.computed),t.watch&&t.watch!==te&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var o=0;o1?A(t):t;for(var n=A(arguments,1),r='event handler for "'+e+'"',o=0,i=t.length;oparseInt(this.max)&&On(s,a[0],a,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return B}};Object.defineProperty(e,"config",t),e.util={warn:le,extend:N,mergeOptions:Pe,defineReactive:Me},e.set=Ae,e.delete=Ne,e.nextTick=tt,e.observable=function(e){return Oe(e),e},e.options=Object.create(null),j.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,N(e.options.components,An),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=A(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Pe(this.options,e),this}}(e),function(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,o=e._Ctor||(e._Ctor={});if(o[r])return o[r];var i=e.name||n.options.name,s=function(e){this._init(e)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=t++,s.options=Pe(n.options,e),s.super=n,s.options.props&&function(e){var t=e.options.props;for(var n in t)hn(e.prototype,"_props",n)}(s),s.options.computed&&function(e){var t=e.options.computed;for(var n in t)mn(e.prototype,n,t[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,j.forEach((function(e){s[e]=n[e]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=e,s.sealedOptions=N({},s.options),o[r]=s,s}}(e),function(e){j.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&u(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Sn),Object.defineProperty(Sn.prototype,"$isServer",{get:oe}),Object.defineProperty(Sn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Sn,"FunctionalRenderContext",{value:Et}),Sn.version="2.6.11";var Nn=v("style,class"),Tn=v("input,textarea,option,select,progress"),$n=function(e,t,n){return"value"===n&&Tn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},En=v("contenteditable,draggable,spellcheck"),Dn=v("events,caret,typing,plaintext-only"),Rn=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),In="http://www.w3.org/1999/xlink",Pn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Fn=function(e){return Pn(e)?e.slice(6,e.length):""},jn=function(e){return null==e||!1===e};function zn(e,t){return{staticClass:Bn(e.staticClass,t.staticClass),class:i(e.class)?[e.class,t.class]:t.class}}function Bn(e,t){return e?t?e+" "+t:e:t||""}function Ln(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,o=e.length;r-1?fr(e,t,n):Rn(t)?jn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):En(t)?e.setAttribute(t,function(e,t){return jn(t)||"false"===t?"false":"contenteditable"===e&&Dn(t)?t:"true"}(t,n)):Pn(t)?jn(n)?e.removeAttributeNS(In,Fn(t)):e.setAttributeNS(In,t,n):fr(e,t,n)}function fr(e,t,n){if(jn(n))e.removeAttribute(t);else{if(X&&!Z&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var dr={create:ur,update:ur};function hr(e,t){var n=t.elm,r=t.data,s=e.data;if(!(o(r.staticClass)&&o(r.class)&&(o(s)||o(s.staticClass)&&o(s.class)))){var a=function(e){for(var t=e.data,n=e,r=e;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=zn(r.data,t));for(;i(n=n.parent);)n&&n.data&&(t=zn(t,n.data));return function(e,t){return i(e)||i(t)?Bn(e,Ln(t)):""}(t.staticClass,t.class)}(t),c=n._transitionClasses;i(c)&&(a=Bn(a,Ln(c))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}var vr,mr,gr,yr,br,wr,xr={create:hr,update:hr},Sr=/[\w).+\-_$\]]/;function kr(e){var t,n,r,o,i,s=!1,a=!1,c=!1,l=!1,u=0,p=0,f=0,d=0;for(r=0;r=0&&" "===(v=e.charAt(h));h--);v&&Sr.test(v)||(l=!0)}}else void 0===o?(d=r+1,o=e.slice(0,r).trim()):m();function m(){(i||(i=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===o?o=e.slice(0,r).trim():0!==d&&m(),i)for(r=0;r-1?{exp:e.slice(0,yr),key:'"'+e.slice(yr+1)+'"'}:{exp:e,key:null};for(mr=e,yr=br=wr=0;!Br();)Lr(gr=zr())?Hr(gr):91===gr&&Vr(gr);return{exp:e.slice(0,br),key:e.slice(br+1,wr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function zr(){return mr.charCodeAt(++yr)}function Br(){return yr>=vr}function Lr(e){return 34===e||39===e}function Vr(e){var t=1;for(br=yr;!Br();)if(Lr(e=zr()))Hr(e);else if(91===e&&t++,93===e&&t--,0===t){wr=yr;break}}function Hr(e){for(var t=e;!Br()&&(e=zr())!==t;);}var Jr,Ur="__r";function Wr(e,t,n){var r=Jr;return function o(){null!==t.apply(null,arguments)&&Gr(e,o,n,r)}}var Kr=Ke&&!(ee&&Number(ee[1])<=53);function qr(e,t,n,r){if(Kr){var o=an,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=o||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Jr.addEventListener(e,t,ne?{capture:n,passive:r}:n)}function Gr(e,t,n,r){(r||Jr).removeEventListener(e,t._wrapper||t,n)}function Xr(e,t){if(!o(e.data.on)||!o(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Jr=t.elm,function(e){if(i(e.__r)){var t=X?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}i(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),st(n,r,qr,Gr,Wr,t.context),Jr=void 0}}var Zr,Yr={create:Xr,update:Xr};function Qr(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var n,r,s=t.elm,a=e.data.domProps||{},c=t.data.domProps||{};for(n in i(c.__ob__)&&(c=t.data.domProps=N({},c)),a)n in c||(s[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n&&"PROGRESS"!==s.tagName){s._value=r;var l=o(r)?"":String(r);eo(s,l)&&(s.value=l)}else if("innerHTML"===n&&Jn(s.tagName)&&o(s.innerHTML)){(Zr=Zr||document.createElement("div")).innerHTML=""+r+"";for(var u=Zr.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}else if(r!==a[n])try{s[n]=r}catch(e){}}}}function eo(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(i(r)){if(r.number)return h(n)!==h(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var to={create:Qr,update:Qr},no=x((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function ro(e){var t=oo(e.style);return e.staticStyle?N(e.staticStyle,t):t}function oo(e){return Array.isArray(e)?T(e):"string"==typeof e?no(e):e}var io,so=/^--/,ao=/\s*!important$/,co=function(e,t,n){if(so.test(t))e.style.setProperty(t,n);else if(ao.test(n))e.style.setProperty(O(t),n.replace(ao,""),"important");else{var r=uo(t);if(Array.isArray(n))for(var o=0,i=n.length;o-1?t.split(ho).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function mo(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(ho).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function go(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&N(t,yo(e.name||"v")),N(t,e),t}return"string"==typeof e?yo(e):void 0}}var yo=x((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),bo=W&&!Z,wo="transition",xo="animation",So="transition",ko="transitionend",Co="animation",_o="animationend";bo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(So="WebkitTransition",ko="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Co="WebkitAnimation",_o="webkitAnimationEnd"));var Oo=W?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Mo(e){Oo((function(){Oo(e)}))}function Ao(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),vo(e,t))}function No(e,t){e._transitionClasses&&y(e._transitionClasses,t),mo(e,t)}function To(e,t,n){var r=Eo(e,t),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a=o===wo?ko:_o,c=0,l=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++c>=s&&l()};setTimeout((function(){c0&&(n=wo,u=s,p=i.length):t===xo?l>0&&(n=xo,u=l,p=c.length):p=(n=(u=Math.max(s,l))>0?s>l?wo:xo:null)?n===wo?i.length:c.length:0,{type:n,timeout:u,propCount:p,hasTransform:n===wo&&$o.test(r[So+"Property"])}}function Do(e,t){for(;e.length1}function zo(e,t){!0!==t.data.show&&Io(t)}var Bo=function(e){var t,n,r={},c=e.modules,l=e.nodeOps;for(t=0;th?b(e,o(n[g+1])?null:n[g+1].elm,n,d,g,r):d>g&&x(t,f,h)}(f,v,g,n,u):i(g)?(i(e.text)&&l.setTextContent(f,""),b(f,null,g,0,g.length-1,n)):i(v)?x(v,0,v.length-1):i(e.text)&&l.setTextContent(f,""):e.text!==t.text&&l.setTextContent(f,t.text),i(h)&&i(d=h.hook)&&i(d=d.postpatch)&&d(e,t)}}}function _(e,t,n){if(s(n)&&i(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,s.selected!==i&&(s.selected=i);else if(R(Uo(s),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));o||(e.selectedIndex=-1)}}function Jo(e,t){return t.every((function(t){return!R(t,e)}))}function Uo(e){return"_value"in e?e._value:e.value}function Wo(e){e.target.composing=!0}function Ko(e){e.target.composing&&(e.target.composing=!1,qo(e.target,"input"))}function qo(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Go(e){return!e.componentInstance||e.data&&e.data.transition?e:Go(e.componentInstance._vnode)}var Xo={model:Lo,show:{bind:function(e,t,n){var r=t.value,o=(n=Go(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&o?(n.data.show=!0,Io(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Go(n)).data&&n.data.transition?(n.data.show=!0,r?Io(n,(function(){e.style.display=e.__vOriginalDisplay})):Po(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,o){o||(e.style.display=e.__vOriginalDisplay)}}},Zo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Yo(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Yo(Jt(t.children)):e}function Qo(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var o=n._parentListeners;for(var i in o)t[k(i)]=o[i];return t}function ei(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ti=function(e){return e.tag||Ht(e)},ni=function(e){return"show"===e.name},ri={name:"transition",props:Zo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ti)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var i=Yo(o);if(!i)return o;if(this._leaving)return ei(e,o);var s="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?s+"comment":s+i.tag:a(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var c=(i.data||(i.data={})).transition=Qo(this),l=this._vnode,u=Yo(l);if(i.data.directives&&i.data.directives.some(ni)&&(i.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,u)&&!Ht(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var p=u.data.transition=N({},c);if("out-in"===r)return this._leaving=!0,at(p,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),ei(e,o);if("in-out"===r){if(Ht(i))return l;var f,d=function(){f()};at(c,"afterEnter",d),at(c,"enterCancelled",d),at(p,"delayLeave",(function(e){f=e}))}}return o}}},oi=N({tag:String,moveClass:String},Zo);function ii(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function si(e){e.data.newPos=e.elm.getBoundingClientRect()}function ai(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,o=t.top-n.top;if(r||o){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+o+"px)",i.transitionDuration="0s"}}delete oi.mode;var ci={Transition:ri,TransitionGroup:{props:oi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var o=Xt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,o(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=Qo(this),a=0;a-1?Kn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Kn[e]=/HTMLUnknownElement/.test(t.toString())},N(Sn.options.directives,Xo),N(Sn.options.components,ci),Sn.prototype.__patch__=W?Bo:$,Sn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ge),Qt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new fn(e,r,$,{before:function(){e._isMounted&&!e._isDestroyed&&Qt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Qt(e,"mounted")),e}(this,e=e&&W?Gn(e):void 0,t)},W&&setTimeout((function(){B.devtools&&ie&&ie.emit("init",Sn)}),0);var li,ui=/\{\{((?:.|\r?\n)+?)\}\}/g,pi=/[-.*+?^${}()|[\]\/\\]/g,fi=x((function(e){var t=e[0].replace(pi,"\\$&"),n=e[1].replace(pi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")})),di={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Rr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Dr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},hi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Rr(e,"style");n&&(e.staticStyle=JSON.stringify(no(n)));var r=Dr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},vi=v("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),mi=v("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),gi=v("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),yi=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,bi=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,wi="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+L.source+"]*",xi="((?:"+wi+"\\:)?"+wi+")",Si=new RegExp("^<"+xi),ki=/^\s*(\/?)>/,Ci=new RegExp("^<\\/"+xi+"[^>]*>"),_i=/^]+>/i,Oi=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},$i=/&(?:lt|gt|quot|amp|#39);/g,Ei=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Di=v("pre,textarea",!0),Ri=function(e,t){return e&&Di(e)&&"\n"===t[0]};function Ii(e,t){var n=t?Ei:$i;return e.replace(n,(function(e){return Ti[e]}))}var Pi,Fi,ji,zi,Bi,Li,Vi,Hi,Ji=/^@|^v-on:/,Ui=/^v-|^@|^:|^#/,Wi=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Ki=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,qi=/^\(|\)$/g,Gi=/^\[.*\]$/,Xi=/:(.*)$/,Zi=/^:|^\.|^v-bind:/,Yi=/\.[^.\]]+(?=[^\]]*$)/g,Qi=/^v-slot(:|$)|^#/,es=/[\r\n]/,ts=/\s+/g,ns=x((function(e){return(li=li||document.createElement("div")).innerHTML=e,li.textContent})),rs="_empty_";function os(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:us(t),rawAttrsMap:{},parent:n,children:[]}}function is(e,t){var n,r;(r=Dr(n=e,"key"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Dr(e,"ref");t&&(e.ref=t,e.refInFor=function(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;"template"===e.tag?(t=Rr(e,"scope"),e.slotScope=t||Rr(e,"slot-scope")):(t=Rr(e,"slot-scope"))&&(e.slotScope=t);var n=Dr(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||Ar(e,"slot",n,function(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}(e,"slot"))),"template"===e.tag){var r=Ir(e,Qi);if(r){var o=cs(r),i=o.name,s=o.dynamic;e.slotTarget=i,e.slotTargetDynamic=s,e.slotScope=r.value||rs}}else{var a=Ir(e,Qi);if(a){var c=e.scopedSlots||(e.scopedSlots={}),l=cs(a),u=l.name,p=l.dynamic,f=c[u]=os("template",[],e);f.slotTarget=u,f.slotTargetDynamic=p,f.children=e.children.filter((function(e){if(!e.slotScope)return e.parent=f,!0})),f.slotScope=a.value||rs,e.children=[],e.plain=!1}}}(e),function(e){"slot"===e.tag&&(e.slotName=Dr(e,"name"))}(e),function(e){var t;(t=Dr(e,"is"))&&(e.component=t),null!=Rr(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var o=0;o-1"+("true"===i?":("+t+")":":_q("+t+","+i+")")),Er(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+o+")":o)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+jr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+jr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+jr(t,"$$c")+"}",null,!0)}(e,r,o);else if("input"===i&&"radio"===s)!function(e,t,n){var r=n&&n.number,o=Dr(e,"value")||"null";Mr(e,"checked","_q("+t+","+(o=r?"_n("+o+")":o)+")"),Er(e,"change",jr(t,o),null,!0)}(e,r,o);else if("input"===i||"textarea"===i)!function(e,t,n){var r=e.attrsMap.type,o=n||{},i=o.lazy,s=o.number,a=o.trim,c=!i&&"range"!==r,l=i?"change":"range"===r?Ur:"input",u="$event.target.value";a&&(u="$event.target.value.trim()"),s&&(u="_n("+u+")");var p=jr(t,u);c&&(p="if($event.target.composing)return;"+p),Mr(e,"value","("+t+")"),Er(e,l,p,null,!0),(a||s)&&Er(e,"blur","$forceUpdate()")}(e,r,o);else if(!B.isReservedTag(i))return Fr(e,r,o),!1;return!0},text:function(e,t){t.value&&Mr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Mr(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:vi,mustUseProp:$n,canBeLeftOpenTag:mi,isReservedTag:Un,getTagNamespace:Wn,staticKeys:function(e){return e.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(",")}(ms)},ys=x((function(e){return v("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));var bs=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,ws=/\([^)]*?\);*$/,xs=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ss={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ks={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Cs=function(e){return"if("+e+")return null;"},_s={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Cs("$event.target !== $event.currentTarget"),ctrl:Cs("!$event.ctrlKey"),shift:Cs("!$event.shiftKey"),alt:Cs("!$event.altKey"),meta:Cs("!$event.metaKey"),left:Cs("'button' in $event && $event.button !== 0"),middle:Cs("'button' in $event && $event.button !== 1"),right:Cs("'button' in $event && $event.button !== 2")};function Os(e,t){var n=t?"nativeOn:":"on:",r="",o="";for(var i in e){var s=Ms(e[i]);e[i]&&e[i].dynamic?o+=i+","+s+",":r+='"'+i+'":'+s+","}return r="{"+r.slice(0,-1)+"}",o?n+"_d("+r+",["+o.slice(0,-1)+"])":n+r}function Ms(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return Ms(e)})).join(",")+"]";var t=xs.test(e.value),n=bs.test(e.value),r=xs.test(e.value.replace(ws,""));if(e.modifiers){var o="",i="",s=[];for(var a in e.modifiers)if(_s[a])i+=_s[a],Ss[a]&&s.push(a);else if("exact"===a){var c=e.modifiers;i+=Cs(["ctrl","shift","alt","meta"].filter((function(e){return!c[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else s.push(a);return s.length&&(o+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(As).join("&&")+")return null;"}(s)),i&&(o+=i),"function($event){"+o+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function As(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ss[e],r=ks[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ns={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:$},Ts=function(e){this.options=e,this.warn=e.warn||_r,this.transforms=Or(e.modules,"transformCode"),this.dataGenFns=Or(e.modules,"genData"),this.directives=N(N({},Ns),e.directives);var t=e.isReservedTag||E;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function $s(e,t){var n=new Ts(t);return{render:"with(this){return "+(e?Es(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Es(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ds(e,t);if(e.once&&!e.onceProcessed)return Rs(e,t);if(e.for&&!e.forProcessed)return Ps(e,t);if(e.if&&!e.ifProcessed)return Is(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Bs(e,t),o="_t("+n+(r?","+r:""),i=e.attrs||e.dynamicAttrs?Hs((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:k(e.name),value:e.value,dynamic:e.dynamic}}))):null,s=e.attrsMap["v-bind"];return!i&&!s||r||(o+=",null"),i&&(o+=","+i),s&&(o+=(i?"":",null")+","+s),o+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Bs(t,n,!0);return"_c("+e+","+Fs(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Fs(e,t));var o=e.inlineTemplate?null:Bs(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(o?","+o:"")+")"}for(var i=0;i>>0}(s):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var i=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=$s(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);i&&(n+=i+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Hs(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function js(e){return 1===e.type&&("slot"===e.tag||e.children.some(js))}function zs(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Is(e,t,zs,"null");if(e.for&&!e.forProcessed)return Ps(e,t,zs);var r=e.slotScope===rs?"":String(e.slotScope),o="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Bs(e,t)||"undefined")+":undefined":Bs(e,t)||"undefined":Es(e,t))+"}",i=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+o+i+"}"}function Bs(e,t,n,r,o){var i=e.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?t.maybeComponent(s)?",1":",0":"";return""+(r||Es)(s,t)+a}var c=n?function(e,t){for(var n=0,r=0;r]*>)","i")),f=e.replace(p,(function(e,n,r){return l=r.length,Ai(u)||"noscript"===u||(n=n.replace(//g,"$1").replace(//g,"$1")),Ri(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));c+=e.length-f.length,e=f,O(u,c-l,c)}else{var d=e.indexOf("<");if(0===d){if(Oi.test(e)){var h=e.indexOf("--\x3e");if(h>=0){t.shouldKeepComment&&t.comment(e.substring(4,h),c,c+h+3),k(h+3);continue}}if(Mi.test(e)){var v=e.indexOf("]>");if(v>=0){k(v+2);continue}}var m=e.match(_i);if(m){k(m[0].length);continue}var g=e.match(Ci);if(g){var y=c;k(g[0].length),O(g[1],y,c);continue}var b=C();if(b){_(b),Ri(b.tagName,e)&&k(1);continue}}var w=void 0,x=void 0,S=void 0;if(d>=0){for(x=e.slice(d);!(Ci.test(x)||Si.test(x)||Oi.test(x)||Mi.test(x)||(S=x.indexOf("<",1))<0);)d+=S,x=e.slice(d);w=e.substring(0,d)}d<0&&(w=e),w&&k(w.length),t.chars&&w&&t.chars(w,c-w.length,c)}if(e===n){t.chars&&t.chars(e);break}}function k(t){c+=t,e=e.substring(t)}function C(){var t=e.match(Si);if(t){var n,r,o={tagName:t[1],attrs:[],start:c};for(k(t[0].length);!(n=e.match(ki))&&(r=e.match(bi)||e.match(yi));)r.start=c,k(r[0].length),r.end=c,o.attrs.push(r);if(n)return o.unarySlash=n[1],k(n[0].length),o.end=c,o}}function _(e){var n=e.tagName,c=e.unarySlash;i&&("p"===r&&gi(n)&&O(r),a(n)&&r===n&&O(n));for(var l=s(n)||!!c,u=e.attrs.length,p=new Array(u),f=0;f=0&&o[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var l=o.length-1;l>=s;l--)t.end&&t.end(o[l].tag,n,i);o.length=s,r=s&&o[s-1].tag}else"br"===a?t.start&&t.start(e,[],!0,n,i):"p"===a&&(t.start&&t.start(e,[],!1,n,i),t.end&&t.end(e,n,i))}O()}(e,{warn:Pi,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,i,s,u,p){var f=r&&r.ns||Hi(e);X&&"svg"===f&&(i=function(e){for(var t=[],n=0;nc&&(a.push(i=e.slice(c,o)),s.push(JSON.stringify(i)));var l=kr(r[1].trim());s.push("_s("+l+")"),a.push({"@binding":l}),c=o+r[0].length}return c':'
',qs.innerHTML.indexOf(" ")>0}var Ys=!!W&&Zs(!1),Qs=!!W&&Zs(!0),ea=x((function(e){var t=Gn(e);return t&&t.innerHTML})),ta=Sn.prototype.$mount;Sn.prototype.$mount=function(e,t){if((e=e&&Gn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ea(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var o=Xs(r,{outputSourceRange:!1,shouldDecodeNewlines:Ys,shouldDecodeNewlinesForHref:Qs,delimiters:n.delimiters,comments:n.comments},this),i=o.render,s=o.staticRenderFns;n.render=i,n.staticRenderFns=s}}return ta.call(this,e,t)},Sn.compile=Xs,e.exports=Sn}).call(this,n(10),n(16).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(17),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(10))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,s,a,c=1,l={},u=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(o=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e,...t){var n={};for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}function s(e){return e.nodeName.toLowerCase()}var a=Object.freeze({__proto__:null,escapeHTML:o,inherit:i,nodeStream:function(e){var t=[];return function e(n,r){for(var o=n.firstChild;o;o=o.nextSibling)3===o.nodeType?r+=o.nodeValue.length:1===o.nodeType&&(t.push({event:"start",offset:r,node:o}),r=e(o,r),s(o).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:o}));return r}(e,0),t},mergeStreams:function(e,t,n){var r=0,i="",a=[];function c(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function u(e){i+=""}function p(e){("start"===e.event?l:u)(e.node)}for(;e.length||t.length;){var f=c();if(i+=o(n.substring(r,f[0].offset)),r=f[0].offset,f===e){a.reverse().forEach(u);do{p(f.splice(0,1)[0]),f=c()}while(f===e&&f.length&&f[0].offset===r);a.reverse().forEach(l)}else"start"===f[0].event?a.push(f[0].node):a.pop(),p(f.splice(0,1)[0])}return i+o(n.substr(r))}});const c=e=>!!e.kind;class l{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=o(e)}openNode(e){if(!c(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){c(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class u{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{u._collapse(e)}))}}class p extends u{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function f(e){return e?"string"==typeof e?e:e.source:null}const d="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",h={begin:"\\\\[\\s\\S]",relevance:0},v={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[h]},m={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[h]},g={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},y=function(e,t,n={}){var r=i({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(g),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},b=y("//","$"),w=y("/\\*","\\*/"),x=y("#","$"),S={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},k={className:"number",begin:d,relevance:0},C={className:"number",begin:"\\b(0b[01]+)",relevance:0},_={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},O={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[h,{begin:/\[/,end:/\]/,relevance:0,contains:[h]}]}]},M={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},A={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},N={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var T=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:d,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>f(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),i({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:h,APOS_STRING_MODE:v,QUOTE_STRING_MODE:m,PHRASAL_WORDS_MODE:g,COMMENT:y,C_LINE_COMMENT_MODE:b,C_BLOCK_COMMENT_MODE:w,HASH_COMMENT_MODE:x,NUMBER_MODE:S,C_NUMBER_MODE:k,BINARY_NUMBER_MODE:C,CSS_NUMBER_MODE:_,REGEXP_MODE:O,TITLE_MODE:M,UNDERSCORE_TITLE_MODE:A,METHOD_GUARD:N,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}}),$="of and for in not or if then".split(" ");function E(e){function t(t,n){return new RegExp(f(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=t(function(e,t="|"){for(var n=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,o="",i=0;i0&&(o+=t),o+="(";a.length>0;){var c=n.exec(a);if(null==c){o+=a;break}o+=a.substring(0,c.index),a=a.substring(c.index+c[0].length),"\\"===c[0][0]&&c[1]?o+="\\"+String(Number(c[1])+s):(o+=c[0],"("===c[0]&&r++)}o+=")"}return o}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;const n=t.exec(e);return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),n}}function o(e,t){const n=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==n&&"."!==r||t.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return function n(s,a){const c=s;if(s.compiled)return c;s.compiled=!0,s.__beforeBegin=null,s.keywords=s.keywords||s.beginKeywords;let l=null;if("object"==typeof s.keywords&&(l=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=function(e,t){var n={};"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(t){r(t,e[t])}));return n;function r(e,r){t&&(r=r.toLowerCase()),r.split(" ").forEach((function(t){var r=t.split("|");n[r[0]]=[e,D(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemes&&l)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return c.keywordPatternRe=t(s.lexemes||l||/\w+/,!0),a&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__beforeBegin=o),s.begin||(s.begin=/\B|\b/),c.beginRe=t(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(c.endRe=t(s.end)),c.terminator_end=f(s.end)||"",s.endsWithParent&&a.terminator_end&&(c.terminator_end+=(s.end?"|":"")+a.terminator_end)),s.illegal&&(c.illegalRe=t(s.illegal)),void 0===s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(t){return i(e,{variants:null},t)})));if(e.cached_variants)return e.cached_variants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return i(e,{starts:e.starts?i(e.starts):null});if(Object.isFrozen(e))return i(e);return e}("self"===e?s:e)}))),s.contains.forEach((function(e){n(e,c)})),s.starts&&n(s.starts,a),c.matcher=function(e){const t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&t.addRule(e.terminator_end,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(c),c}(e)}function D(e,t){return t?Number(t):function(e){return $.includes(e.toLowerCase())}(e)?0:1}const R=o,I=i,{nodeStream:P,mergeStreams:F}=a,j=Symbol("nomatch");var z=function(e){var t=[],o=Object.create(null),i=Object.create(null),s=[],a=!0,c=/(^(<[^>]+>|\t|)+|\n)/gm,l="Could not find the language '{}', did you forget to load/include a language module?";const u={disableAutodetect:!0,name:"Plain text",contains:[]};var f={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:p};function d(e){return f.noHighlightRe.test(e)}function h(e,t,n,r){var o={code:t,language:e};k("before:highlight",o);var i=o.result?o.result:v(o.language,o.code,n,r);return i.code=o.code,k("after:highlight",i),i}function v(e,t,n,i){var s=t;function c(e,t){var n=x.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function u(){null!=C.subLanguage?function(){if(""!==M){var e=null;if("string"==typeof C.subLanguage){if(!o[C.subLanguage])return void O.addText(M);e=v(C.subLanguage,M,!0,_[C.subLanguage]),_[C.subLanguage]=e.top}else e=m(M,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(A+=e.relevance),O.addSublanguage(e.emitter,e.language)}}():function(){if(!C.keywords)return void O.addText(M);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(M),n="";for(;t;){n+=M.substring(e,t.index);const r=c(C,t);if(r){const[e,o]=r;O.addText(n),n="",A+=o,O.addKeyword(t[0],e)}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(M)}n+=M.substr(e),O.addText(n)}(),M=""}function p(e){return e.className&&O.openNode(e.className),C=Object.create(e,{parent:{value:C}})}function d(e){return 0===C.matcher.regexIndex?(M+=e[0],1):($=!0,0)}function h(e){var t=e[0],n=e.rule;const o=new r(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,o),o.ignore))return d(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?M+=t:(n.excludeBegin&&(M+=t),u(),n.returnBegin||n.excludeBegin||(M=t)),p(n),n.returnBegin?0:t.length}function g(e){var t=e[0],n=s.substr(e.index),o=function e(t,n,o){let i=function(e,t){var n=e&&e.exec(t);return n&&0===n.index}(t.endRe,o);if(i){if(t["on:end"]){const e=new r(t);t["on:end"](n,e),e.ignore&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,o)}(C,e,n);if(!o)return j;var i=C;i.skip?M+=t:(i.returnEnd||i.excludeEnd||(M+=t),u(),i.excludeEnd&&(M=t));do{C.className&&O.closeNode(),C.skip||C.subLanguage||(A+=C.relevance),C=C.parent}while(C!==o.parent);return o.starts&&(o.endSameAsBegin&&(o.starts.endRe=o.endRe),p(o.starts)),i.returnEnd?0:t.length}var y={};function b(t,r){var o=r&&r[0];if(M+=t,null==o)return u(),0;if("begin"===y.type&&"end"===r.type&&y.index===r.index&&""===o){if(M+=s.slice(r.index,r.index+1),!a){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=y.rule,t}return 1}if(y=r,"begin"===r.type)return h(r);if("illegal"===r.type&&!n){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(C.className||"")+'"');throw e.mode=C,e}if("end"===r.type){var i=g(r);if(i!==j)return i}if("illegal"===r.type&&""===o)return 1;if(T>1e5&&T>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return M+=o,o.length}var x=w(e);if(!x)throw console.error(l.replace("{}",e)),new Error('Unknown language: "'+e+'"');var S=E(x),k="",C=i||S,_={},O=new f.__emitter(f);!function(){for(var e=[],t=C;t!==x;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>O.openNode(e))}();var M="",A=0,N=0,T=0,$=!1;try{for(C.matcher.considerAll();;){T++,$?$=!1:(C.matcher.lastIndex=N,C.matcher.considerAll());const e=C.matcher.exec(s);if(!e)break;const t=b(s.substring(N,e.index),e);N=e.index+t}return b(s.substr(N)),O.closeAllNodes(),O.finalize(),k=O.toHTML(),{relevance:A,value:k,language:e,illegal:!1,emitter:O,top:C}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:s.slice(N-100,N+100),mode:t.mode},sofar:k,relevance:0,value:R(s),emitter:O};if(a)return{illegal:!1,relevance:0,value:R(s),emitter:O,language:e,top:C,errorRaised:t};throw t}}function m(e,t){t=t||f.languages||Object.keys(o);var n=function(e){const t={relevance:0,emitter:new f.__emitter(f),value:R(e),illegal:!1,top:u};return t.emitter.addText(e),t}(e),r=n;return t.filter(w).filter(S).forEach((function(t){var o=v(t,e,!1);o.language=t,o.relevance>r.relevance&&(r=o),o.relevance>n.relevance&&(r=n,n=o)})),r.language&&(n.second_best=r),n}function g(e){return f.tabReplace||f.useBR?e.replace(c,e=>"\n"===e?f.useBR?"
":e:f.tabReplace?e.replace(/\t/g,f.tabReplace):e):e}function y(e){let t=null;const n=function(e){var t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=f.languageDetectRe.exec(t);if(n){var r=w(n[1]);return r||(console.warn(l.replace("{}",n[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>d(e)||w(e))}(e);if(d(n))return;k("before:highlightBlock",{block:e,language:n}),f.useBR?(t=document.createElement("div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;const r=t.textContent,o=n?h(n,r,!0):m(r),s=P(t);if(s.length){const e=document.createElement("div");e.innerHTML=o.value,o.value=F(s,P(e),r)}o.value=g(o.value),k("after:highlightBlock",{block:e,result:o}),e.innerHTML=o.value,e.className=function(e,t,n){var r=t?i[t]:n,o=[e.trim()];return e.match(/\bhljs\b/)||o.push("hljs"),e.includes(r)||o.push(r),o.join(" ").trim()}(e.className,n,o.language),e.result={language:o.language,re:o.relevance,relavance:o.relevance},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.relevance,relavance:o.second_best.relevance})}const b=()=>{if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");t.forEach.call(e,y)}};function w(e){return e=(e||"").toLowerCase(),o[e]||o[i[e]]}function x(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e]=t})}function S(e){var t=w(e);return t&&!t.disableAutodetect}function k(e,t){var n=e;s.forEach((function(e){e[n]&&e[n](t)}))}Object.assign(e,{highlight:h,highlightAuto:m,fixMarkup:g,highlightBlock:y,configure:function(e){f=I(f,e)},initHighlighting:b,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",b,!1)},registerLanguage:function(t,n){var r=null;try{r=n(e)}catch(e){if(console.error("Language definition for '{}' could not be registered.".replace("{}",t)),!a)throw e;console.error(e),r=u}r.name||(r.name=t),o[t]=r,r.rawDefinition=n.bind(null,e),r.aliases&&x(r.aliases,{languageName:t})},listLanguages:function(){return Object.keys(o)},getLanguage:w,registerAliases:x,requireLanguage:function(e){var t=w(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:S,inherit:I,addPlugin:function(e){s.push(e)}}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="10.1.2";for(const e in T)"object"==typeof T[e]&&n(T[e]);return Object.assign(e,T),e}({});e.exports=z},function(e,t,n){"use strict";var r=n(21),o=i(Error);function i(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=r.apply(null,arguments)),new e(t)}}e.exports=o,o.eval=i(EvalError),o.range=i(RangeError),o.reference=i(ReferenceError),o.syntax=i(SyntaxError),o.type=i(TypeError),o.uri=i(URIError),o.create=i},function(e,t,n){!function(){var t;function n(e){for(var t,n,r,o,i=1,s=[].slice.call(arguments),a=0,c=e.length,l="",u=!1,p=!1,f=function(){return s[i++]},d=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a p:first-child {\n display: inline;\n}",""])},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(4),i=n(0),s=n(2);var a=function(e,t){var n=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var r=function(e){return n[t](e)};return e.dom.addEventListener(t,r),{name:t,handler:r}}))};a.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))},a.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&this.updateOverlay()},a.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},a.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){var s=this.editorView.coordsAtPos(this.cursorPos);e={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var c=!a||a==document.body&&"static"==getComputedStyle(a).position?{left:-pageXOffset,top:-pageYOffset}:a.getBoundingClientRect();this.element.style.left=e.left-c.left+"px",this.element.style.top=e.top-c.top+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},a.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},a.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var n=t.pos;this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Object(s.h)(this.editorView.state.doc,n,this.editorView.dragging.slice))&&(n=t.pos),this.setCursor(n),this.scheduleRemoval(5e3)}}},a.prototype.dragend=function(){this.scheduleRemoval(20)},a.prototype.drop=function(){this.scheduleRemoval(20)},a.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};var c=n(6),l=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return t.valid(o)?new t(o):e.near(o)},t.prototype.content=function(){return i.Slice.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new u(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t);if(0!=n)for(var r=e.node(t).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock},t.findFrom=function(e,n,o){e:for(;;){if(!o&&t.valid(e))return e;for(var i=e.pos,s=null,a=e.depth;;a--){var c=e.node(a);if(n>0?e.indexAfter(a)0){s=c.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;i+=n;var l=e.doc.resolve(i);if(t.valid(l))return l}for(;;){var u=n>0?s.firstChild:s.lastChild;if(!u){if(s.isAtom&&!s.isText&&!r.NodeSelection.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),o=!1;continue e}break}s=u,i+=n;var p=e.doc.resolve(i);if(t.valid(p))return p}return null}},t}(r.Selection);l.prototype.visible=!1,r.Selection.jsonID("gapcursor",l);var u=function(e){this.pos=e};u.prototype.map=function(e){return new u(e.map(this.pos))},u.prototype.resolve=function(e){var t=e.resolve(this.pos);return l.valid(t)?new l(t):r.Selection.near(t)};var p=Object(c.a)({ArrowLeft:f("horiz",-1),ArrowRight:f("horiz",1),ArrowUp:f("vert",-1),ArrowDown:f("vert",1)});function f(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,o,i){var s=e.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof r.TextSelection){if(!i.endOfTextblock(n)||0==a.depth)return!1;c=!1,a=e.doc.resolve(t>0?a.after():a.before())}var u=l.findFrom(a,t,c);return!!u&&(o&&o(e.tr.setSelection(new l(u))),!0)}}function d(e,t,n){if(!e.editable)return!1;var o=e.state.doc.resolve(t);if(!l.valid(o))return!1;var i=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&r.NodeSelection.isSelectable(e.state.doc.nodeAt(i)))&&(e.dispatch(e.state.tr.setSelection(new l(o))),!0)}function h(e){if(!(e.selection instanceof l))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",o.b.create(e.doc,[o.a.widget(e.selection.head,t,{key:"gapcursor"})])}function v(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function m(e,t){for(;e;e="start"==t?e.firstChild:e.lastChild)if(e.isTextblock)return!0;return!1}function g(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function y(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1=0;f--)p=i.Fragment.from(o[f].create(null,p));p=i.Fragment.from(c.copy(p));var d=e.tr.step(new s.b(t.pos-1,u,t.pos,u,new i.Slice(p,1,0),o.length,!0)),h=u+2*o.length;Object(s.f)(d.doc,h)&&d.join(h),n(d.scrollIntoView())}return!0}var v=r.Selection.findFrom(t,1),m=v&&v.$from.blockRange(v.$to),g=m&&Object(s.k)(m);return null!=g&&g>=t.depth&&(n&&n(e.tr.lift(m,g).scrollIntoView()),!0)}function k(e,t){return function(n,r){var o=n.selection,i=o.from,s=o.to,a=!1;return n.doc.nodesBetween(i,s,(function(r,o){if(a)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,e)}})),!!a&&(r&&r(n.tr.setBlockType(i,s,e,t).scrollIntoView()),!0)}}function C(e,t){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,s=o.$to,a=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,(function(e){if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o0))return!1;var i=g(o);if(!i){var a=o.blockRange(),c=a&&Object(s.k)(a);return null!=c&&(t&&t(e.tr.lift(a,c).scrollIntoView()),!0)}var l=i.nodeBefore;if(!l.type.spec.isolating&&S(e,i,t))return!0;if(0==o.parent.content.size&&(m(l,"end")||r.NodeSelection.isSelectable(l))){if(t){var u=e.tr.deleteRange(o.before(),o.after());u.setSelection(m(l,"end")?r.Selection.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):r.NodeSelection.create(u.doc,i.pos-l.nodeSize)),t(u.scrollIntoView())}return!0}return!(!l.isAtom||i.depth!=o.depth-1)&&(t&&t(e.tr.delete(i.pos-l.nodeSize,i.pos).scrollIntoView()),!0)}),(function(e,t,n){var o=e.selection,i=o.$head,s=i;if(!o.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;s=g(i)}var a=s&&s.nodeBefore;return!(!a||!r.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(r.NodeSelection.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)})),M=_(v,(function(e,t,n){var o=e.selection.$cursor;if(!o||(n?!n.endOfTextblock("forward",e):o.parentOffset1&&n.after()!=n.end(-1)){var r=n.before();if(Object(s.g)(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Object(s.k)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)}),x),"Mod-Enter":w,Backspace:O,"Mod-Backspace":O,Delete:M,"Mod-Delete":M,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new r.AllSelection(e.doc))),!0}},N={"Ctrl-h":A.Backspace,"Alt-Backspace":A["Mod-Backspace"],"Ctrl-d":A.Delete,"Ctrl-Alt-Backspace":A["Mod-Delete"],"Alt-Delete":A["Mod-Delete"],"Alt-d":A["Mod-Delete"]};for(var T in A)N[T]=A[T];var $=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?N:A,E=function(e,t){var n;this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,o){var i=n;if(t[1]){var s=t[0].lastIndexOf(t[1]);i+=t[0].slice(s+t[1].length);var a=(r+=s)-o;a>0&&(i=t[0].slice(s-a,s)+i,r=o)}return e.tr.insertText(i,r,o)}):t};function D(e,t,n,r,o,i){if(e.composing)return!1;var s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,l=0;l=0;c--)s.step(a.steps[c].invert(a.docs[c]));var l=s.doc.resolve(i.from).marks();t(s.replaceWith(i.from,i.to,e.schema.text(i.text,l)))}return!0}}return!1}new E(/--$/,"—"),new E(/\.\.\.$/,"…"),new E(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new E(/"$/,"”"),new E(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new E(/'$/,"’");function I(e,t,n,r){return new E(e,(function(e,o,i,a){var c=n instanceof Function?n(o):n,l=e.tr.delete(i,a),u=l.doc.resolve(i).blockRange(),p=u&&Object(s.i)(u,t,c);if(!p)return null;l.wrap(u,p);var f=l.doc.resolve(i-1).nodeBefore;return f&&f.type==t&&Object(s.f)(l.doc,i-1)&&(!r||r(o,f))&&l.join(i-1),l}))}function P(e,t,n){return new E(e,(function(e,r,o,i){var s=e.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,a):null}))}var F=n(5);function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e||!t)return!1;var n=e.parent.childAfter(e.parentOffset);if(!n.node)return!1;var r=n.node.marks.find((function(e){return e.type===t}));if(!r)return!1;for(var o=e.index(),i=e.start()+n.offset,s=o+1,a=i+n.node.nodeSize;o>0&&r.isInSet(e.parent.child(o-1).marks);)o-=1,i-=e.parent.child(o).nodeSize;for(;s2&&void 0!==arguments[2]?arguments[2]:{},r=function(e){return e.type===t},o=Object(F.findSelectedNodeOfType)(t)(e.selection)||Object(F.findParentNode)(r)(e.selection);return Object.keys(n).length&&o?o.node.hasMarkup(t,B(B({},o.node.attrs),n)):!!o}var K=n(7),q=n.n(K);function G(e,t){return function(n,r){var o=n.selection,a=o.$from,c=o.$to,l=a.blockRange(c),u=!1,p=l;if(!l)return!1;if(l.depth>=2&&a.node(l.depth-1).type.compatibleContent(e)&&0==l.startIndex){if(0==a.index(l.depth-1))return!1;var f=n.doc.resolve(l.start-2);p=new i.NodeRange(f,f,l.depth),l.endIndex=0;c--)a=i.Fragment.from(n[c].type.create(n[c].attrs,a));e.step(new s.b(t.start-(r?2:0),t.end,t.start,t.end,new i.Slice(a,0,0),n.length,!0));for(var l=0,u=0;ul;c--)a-=o.child(c).nodeSize,r.delete(a-1,a+1);var u=r.doc.resolve(n.start),p=u.nodeAfter,f=0==n.startIndex,d=n.endIndex==o.childCount,h=u.node(-1),v=u.index(-1);if(!h.canReplace(v+(f?0:1),v+1,p.content.append(d?i.Fragment.empty:i.Fragment.from(o))))return!1;var m=u.pos,g=m+p.nodeSize;return r.step(new s.b(m-(f?1:0),g+(d?1:0),m+1,g-1,new i.Slice((f?i.Fragment.empty:i.Fragment.from(o.copy(i.Fragment.empty))).append(d?i.Fragment.empty:i.Fragment.from(o.copy(i.Fragment.empty))),f?0:1,d?0:1),f?0:1)),t(r.scrollIntoView()),!0}(t,n,c)))}}function Z(e){return function(t,n){var r=t.selection,o=r.$from,a=r.$to,c=o.blockRange(a,(function(t){return t.childCount&&t.firstChild.type==e}));if(!c)return!1;var l=c.startIndex;if(0==l)return!1;var u=c.parent,p=u.child(l-1);if(p.type!=e)return!1;if(n){var f=p.lastChild&&p.lastChild.type==u.type,d=i.Fragment.from(f?e.create():null),h=new i.Slice(i.Fragment.from(e.create(null,i.Fragment.from(u.type.create(null,d)))),f?3:1,0),v=c.start,m=c.end;n(t.tr.step(new s.b(v-(f?3:1),m,v,m,h,1,!0)).scrollIntoView())}return!0}}function Y(e,t,n){return new E(e,(e,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=e,c=r.length-1;let l=i,u=o;if(r[c]){const n=o+r[0].indexOf(r[c-1]),s=n+r[c-1].length-1,p=n+r[c-1].lastIndexOf(r[c]),f=p+r[c].length;if(function(e,t,n){let r=[];return n.doc.nodesBetween(e,t,(e,t)=>{r=[...r,...e.marks.map(n=>({start:t,end:t+e.nodeSize,mark:n}))]}),r}(o,i,e).filter(e=>{const{excluded:n}=e.mark.type;return n.find(e=>e.name===t.name)}).filter(e=>e.end>n).length)return!1;fn&&a.delete(n,p),u=n,l=u+r[c].length}return a.addMark(u,l,t.create(s)),a.removeStoredMark(t),a})}function Q(e,t,n){return new E(e,(e,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=e;return r[0]&&a.replaceWith(o-1,i,t.create(s)),a})}function ee(e,t,n){const o=(r,s)=>{const a=[];return r.forEach(r=>{if(r.isText){const{text:o,marks:i}=r;let c,l=0;const u=!!i.filter(e=>"link"===e.type.name)[0];for(;!u&&null!==(c=e.exec(o));)if(s&&s.type.allowsMarkType(t)&&c[1]){const e=c.index,o=e+c[0].length,i=e+c[0].indexOf(c[1]),s=i+c[1].length,u=n instanceof Function?n(c):n;e>0&&a.push(r.cut(l,e)),a.push(r.cut(i,s).mark(t.create(u).addToSet(r.marks))),l=o}lnew i.Slice(o(e.content),e.openStart,e.openEnd)}})}function te(e,t,n={}){return(r,o,i)=>W(r,e,n)?k(t)(r,o,i):k(e,n)(r,o,i)}function ne(e,t){return e.type===t.nodes.bullet_list||e.type===t.nodes.ordered_list||e.type===t.nodes.todo_list}function re(e,t){return(n,r,o)=>{const{schema:i,selection:s}=n,{$from:a,$to:c}=s,l=a.blockRange(c);if(!l)return!1;const u=Object(F.findParentNode)(e=>ne(e,i))(s);if(l.depth>=1&&u&&l.depth-u.depth<=1){if(u.node.type===e)return X(t)(n,r,o);if(ne(u.node,i)&&e.validContent(u.node.content)){const{tr:t}=n;return t.setNodeMarkup(u.pos,e),r&&r(t),!1}}return G(e)(n,r,o)}}class oe{constructor(e,{editor:t,extension:n,parent:r,node:o,view:i,decorations:s,getPos:a}){this.component=e,this.editor=t,this.extension=n,this.parent=r,this.node=o,this.view=i,this.decorations=s,this.isNode=!!this.node.marks,this.isMark=!this.isNode,this.getPos=this.isMark?this.getMarkPos:a,this.captureEvents=!0,this.dom=this.createDOM(),this.contentDOM=this.vm.$refs.content}createDOM(){const e=q.a.extend(this.component),t={editor:this.editor,node:this.node,view:this.view,getPos:()=>this.getPos(),decorations:this.decorations,selected:!1,options:this.extension.options,updateAttrs:e=>this.updateAttrs(e)};return"function"==typeof this.extension.setSelection&&(this.setSelection=this.extension.setSelection),"function"==typeof this.extension.update&&(this.update=this.extension.update),this.vm=new e({parent:this.parent,propsData:t}).$mount(),this.vm.$el}update(e,t){return e.type===this.node.type&&(e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,this.updateComponentProps({node:e,decorations:t})),!0)}updateComponentProps(e){if(!this.vm._props)return;const t=q.a.config.silent;q.a.config.silent=!0,Object.entries(e).forEach(([e,t])=>{this.vm._props[e]=t}),q.a.config.silent=t}updateAttrs(e){if(!this.view.editable)return;const{state:t}=this.view,{type:n}=this.node,r=this.getPos(),o={...this.node.attrs,...e},i=this.isMark?t.tr.removeMark(r.from,r.to,n).addMark(r.from,r.to,n.create(o)):t.tr.setNodeMarkup(r,null,o);this.view.dispatch(i)}ignoreMutation(e){return"selection"!==e.type&&(!this.contentDOM||!this.contentDOM.contains(e.target))}stopEvent(e){if("function"==typeof this.extension.stopEvent)return this.extension.stopEvent(e);const t=!!this.extension.schema.draggable;if(t&&"mousedown"===e.type){const t=e.target.closest&&e.target.closest("[data-drag-handle]");t&&(this.dom===t||this.dom.contains(t))&&(this.captureEvents=!1,document.addEventListener("dragend",()=>{this.captureEvents=!0},{once:!0}))}const n="copy"===e.type,r="paste"===e.type,o="cut"===e.type,i=e.type.startsWith("drag")||"drop"===e.type;return!(t&&i||n||r||o)&&this.captureEvents}selectNode(){this.updateComponentProps({selected:!0})}deselectNode(){this.updateComponentProps({selected:!1})}getMarkPos(){const e=this.view.posAtDOM(this.dom);return U(this.view.state.doc.resolve(e),this.node.type)}destroy(){this.vm.$destroy()}}class ie{constructor(e={}){this.options={...this.defaultOptions,...e}}init(){return null}bindEditor(e=null){this.editor=e}get name(){return null}get type(){return"extension"}get defaultOptions(){return{}}get plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class se{constructor(e=[],t){e.forEach(e=>{e.bindEditor(t),e.init()}),this.extensions=e}get nodes(){return this.extensions.filter(e=>"node"===e.type).reduce((e,{name:t,schema:n})=>({...e,[t]:n}),{})}get options(){const{view:e}=this;return this.extensions.reduce((t,n)=>({...t,[n.name]:new Proxy(n.options,{set(t,n,r){const o=t[n]!==r;return Object.assign(t,{[n]:r}),o&&e.updateState(e.state),!0}})}),{})}get marks(){return this.extensions.filter(e=>"mark"===e.type).reduce((e,{name:t,schema:n})=>({...e,[t]:n}),{})}get plugins(){return this.extensions.filter(e=>e.plugins).reduce((e,{plugins:t})=>[...e,...t],[])}keymaps({schema:e}){return[...this.extensions.filter(e=>["extension"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({schema:e})),...this.extensions.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({type:e["".concat(t.type,"s")][t.name],schema:e}))].map(e=>Object(c.b)(e))}inputRules({schema:e,excludedExtensions:t}){if(!(t instanceof Array)&&t)return[];const n=t instanceof Array?this.extensions.filter(e=>!t.includes(e.name)):this.extensions;return[...n.filter(e=>["extension"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({schema:e})),...n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({type:e["".concat(t.type,"s")][t.name],schema:e}))].reduce((e,t)=>[...e,...t],[])}pasteRules({schema:e,excludedExtensions:t}){if(!(t instanceof Array)&&t)return[];const n=t instanceof Array?this.extensions.filter(e=>!t.includes(e.name)):this.extensions;return[...n.filter(e=>["extension"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({schema:e})),...n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({type:e["".concat(t.type,"s")][t.name],schema:e}))].reduce((e,t)=>[...e,...t],[])}commands({schema:e,view:t}){return this.extensions.filter(e=>e.commands).reduce((n,r)=>{const{name:o,type:i}=r,s={},a=r.commands({schema:e,...["node","mark"].includes(i)?{type:e["".concat(i,"s")][o]}:{}}),c=(e,n)=>!!t.editable&&(t.focus(),e(n)(t.state,t.dispatch,t)),l=(e,t)=>{Array.isArray(t)?s[e]=e=>t.forEach(t=>c(t,e)):"function"==typeof t&&(s[e]=e=>c(t,e))};return"object"==typeof a?Object.entries(a).forEach(([e,t])=>{l(e,t)}):l(o,a),{...n,...s}},{})}}class ae extends ie{constructor(e={}){super(e)}get type(){return"mark"}get view(){return null}get schema(){return null}command(){return()=>{}}}function ce(e=0,t=0,n=0){return Math.min(Math.max(parseInt(e,10),t),n)}class le extends ie{constructor(e={}){super(e)}get type(){return"node"}get view(){return null}get schema(){return null}command(){return()=>{}}}class ue extends le{get name(){return"doc"}get schema(){return{content:"block+"}}}class pe extends le{get name(){return"paragraph"}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}commands({type:e}){return()=>k(e)}}class fe extends le{get name(){return"text"}get schema(){return{group:"inline"}}}class de extends class{on(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}emit(e,...t){this._callbacks=this._callbacks||{};const n=this._callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){if(arguments.length){const n=this._callbacks?this._callbacks[e]:null;n&&(t?this._callbacks[e]=n.filter(e=>e!==t):delete this._callbacks[e])}else this._callbacks={};return this}}{constructor(e={}){super(),this.defaultOptions={editorProps:{},editable:!0,autoFocus:null,extensions:[],content:"",topNode:"doc",emptyDocument:{type:"doc",content:[{type:"paragraph"}]},useBuiltInExtensions:!0,disableInputRules:!1,disablePasteRules:!1,dropCursor:{},enableDropCursor:!0,enableGapCursor:!0,parseOptions:{},injectCSS:!0,onInit:()=>{},onTransaction:()=>{},onUpdate:()=>{},onFocus:()=>{},onBlur:()=>{},onPaste:()=>{},onDrop:()=>{}},this.events=["init","transaction","update","focus","blur","paste","drop"],this.init(e)}init(e={}){this.setOptions({...this.defaultOptions,...e}),this.focused=!1,this.selection={from:0,to:0},this.element=document.createElement("div"),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.plugins=this.createPlugins(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),this.options.injectCSS&&function(e){{const t=document.createElement("style");t.type="text/css",t.textContent=e;const{head:n}=document,{firstChild:r}=n;r?n.insertBefore(t,r):n.appendChild(t)}}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n'),null!==this.options.autoFocus&&this.focus(this.options.autoFocus),this.events.forEach(e=>{var t;this.on(e,this.options[(t="on ".concat(e),t.replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,""))]||(()=>{}))}),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view}setOptions(e){this.options={...this.options,...e},this.view&&this.state&&this.view.updateState(this.state)}get builtInExtensions(){return this.options.useBuiltInExtensions?[new ue,new fe,new pe]:[]}get state(){return this.view?this.view.state:null}createExtensions(){return new se([...this.builtInExtensions,...this.options.extensions],this)}createPlugins(){return this.extensions.plugins}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createNodes(){return this.extensions.nodes}createMarks(){return this.extensions.marks}createSchema(){return new i.Schema({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return r.EditorState.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,(t={rules:this.inputRules},n=t.rules,o=new r.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,t,r,i){return D(e,t,r,i,n,o)},handleDOMEvents:{compositionend:function(e){setTimeout((function(){var t=e.state.selection.$cursor;t&&D(e,t.pos,t.pos,"",n,o)}))}}},isInputRules:!0}),o),...this.pasteRules,...this.keymaps,Object(c.b)({Backspace:R}),Object(c.b)($),...this.options.enableDropCursor?[(e=this.options.dropCursor,void 0===e&&(e={}),new r.Plugin({view:function(t){return new a(t,e)}}))]:[],...this.options.enableGapCursor?[new r.Plugin({props:{decorations:h,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&l.valid(n))return new l(n)},handleClick:d,handleKeyDown:p}})]:[],new r.Plugin({key:new r.PluginKey("editable"),props:{editable:()=>this.options.editable}}),new r.Plugin({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,t)=>{this.focused=!0,this.emit("focus",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!0);this.view.dispatch(n)},blur:(e,t)=>{this.focused=!1,this.emit("blur",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!1);this.view.dispatch(n)}}}}),new r.Plugin({props:this.options.editorProps})]});var e,t,n,o}createDocument(e,t=this.options.parseOptions){if(null===e)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof e)try{return this.schema.nodeFromJSON(e)}catch(t){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",t),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof e){const n="
".concat(e,"
"),r=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return i.DOMParser.fromSchema(this.schema).parse(r,t)}return!1}createView(){return new o.c(this.element,{state:this.createState(),handlePaste:(...e)=>{this.emit("paste",...e)},handleDrop:(...e)=>{this.emit("drop",...e)},dispatchTransaction:this.dispatchTransaction.bind(this)})}setParentComponent(e=null){e&&this.view.setProps({nodeViews:this.initNodeViews({parent:e,extensions:[...this.builtInExtensions,...this.options.extensions]})})}initNodeViews({parent:e,extensions:t}){return t.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.view).reduce((t,n)=>({...t,[n.name]:(t,r,o,i)=>{const s=n.view;return new oe(s,{editor:this,extension:n,parent:e,node:t,view:r,getPos:o,decorations:i})}}),{})}dispatchTransaction(e){const t=this.state.apply(e);this.view.updateState(t),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks(),this.emit("transaction",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emitUpdate(e)}emitUpdate(e){this.emit("update",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e})}resolveSelection(e=null){if(this.selection&&null===e)return this.selection;if("start"===e||!0===e)return{from:0,to:0};if("end"===e){const{doc:e}=this.state;return{from:e.content.size,to:e.content.size}}return{from:e,to:e}}focus(e=null){if(this.view.focused&&null===e||!1===e)return;const{from:t,to:n}=this.resolveSelection(e);this.setSelection(t,n),setTimeout(()=>this.view.focus(),10)}setSelection(e=0,t=0){const{doc:n,tr:o}=this.state,i=ce(e,0,n.content.size),s=ce(t,0,n.content.size),a=r.TextSelection.create(n,i,s),c=o.setSelection(a);this.view.dispatch(c)}blur(){this.view.dom.blur()}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.extensions.nodes,marks:this.extensions.marks}))}getHTML(){const e=document.createElement("div"),t=i.DOMSerializer.fromSchema(this.schema).serializeFragment(this.state.doc.content);return e.appendChild(t),e.innerHTML}getJSON(){return this.state.doc.toJSON()}setContent(e={},t=!1,n){const{doc:o,tr:i}=this.state,s=this.createDocument(e,n),a=r.TextSelection.create(o,0,o.content.size),c=i.setSelection(a).replaceSelectionWith(s,!1).setMeta("preventUpdate",!t);this.view.dispatch(c)}clearContent(e=!1){this.setContent(this.options.emptyDocument,e)}setActiveNodesAndMarks(){this.activeMarks=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:(e={})=>{return t=this.state,r=n,o=t.selection,i=o.from,s=o.$from,a=o.to,o.empty?!!r.isInSet(t.storedMarks||s.marks()):!!t.doc.rangeHasMark(i,a,r);var t,r,o,i,s,a}}),{}),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:H(this.state,n)}),{}),this.activeNodes=Object.entries(this.schema.nodes).reduce((e,[t,n])=>({...e,[t]:(e={})=>W(this.state,n,e)}),{})}getMarkAttrs(e=null){return this.activeMarkAttrs[e]}getNodeAttrs(e=null){return{...J(this.state,this.schema.nodes[e])}}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce((e,[t,n])=>({...e,[t]:(e={})=>n(e)}),{})}registerPlugin(e=null,t){const n="function"==typeof t?t(e,this.state.plugins):[e,...this.state.plugins],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e=null){if(!e||!this.view.docView)return;const t=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith("".concat(e,"$")))});this.view.updateState(t)}destroy(){this.view&&this.view.destroy()}}var he={props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(e){e&&e.element&&this.$nextTick(()=>{this.$el.appendChild(e.element.firstChild),e.setParentComponent(this)})}}},render:e=>e("div"),beforeDestroy(){this.editor.element=this.$el}};class ve{constructor({options:e}){this.options=e,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.blurHandler=()=>{this.preventHide?this.preventHide=!1:this.options.editor.emit("menubar:focusUpdate",!1)},this.options.editor.on("blur",this.blurHandler)}handleClick(){this.preventHide=!0}destroy(){this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("blur",this.blurHandler)}}var me={props:{editor:{default:null,type:Object}},data:()=>({focused:!1}),watch:{editor:{immediate:!0,handler(e){e&&this.$nextTick(()=>{var t;e.registerPlugin((t={editor:e,element:this.$el},new r.Plugin({key:new r.PluginKey("menu_bar"),view:e=>new ve({editorView:e,options:t})}))),this.focused=e.focused,e.on("focus",()=>{this.focused=!0}),e.on("menubar:focusUpdate",e=>{this.focused=e})})}}},render(){return this.editor?this.$scopedSlots.default({focused:this.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getMarkAttrs.bind(this.editor),getNodeAttrs:this.editor.getNodeAttrs.bind(this.editor)}):null}};function ge(e,t,n){const r=document.createRange();return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r}function ye(e,t){const n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}function be(e,t,n=!1){const{node:r,offset:o}=e.docView.domFromPos(t);let i,s;if(3===r.nodeType)n&&o!1,...e},this.editorView=t,this.isActive=!1,this.left=0,this.bottom=0,this.top=0,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.focusHandler=({view:e})=>{this.update(e)},this.options.editor.on("focus",this.focusHandler),this.blurHandler=({event:e})=>{this.preventHide?this.preventHide=!1:this.hide(e)},this.options.editor.on("blur",this.blurHandler)}handleClick(){this.preventHide=!0}update(e,t){const{state:n}=e;if(e.composing)return;if(t&&t.doc.eq(n.doc)&&t.selection.eq(n.selection))return;if(n.selection.empty)return void this.hide();const{from:r,to:o}=n.selection,i=be(e,r),s=be(e,o,!0),a=this.options.element.offsetParent;if(!a)return void this.hide();const c=a.getBoundingClientRect(),l=this.options.element.getBoundingClientRect(),u=(i.left+s.left)/2-c.left;this.left=Math.round(this.options.keepInBounds?Math.min(c.width-l.width/2,Math.max(u,l.width/2)):u),this.bottom=Math.round(c.bottom-i.top),this.top=Math.round(s.bottom-c.top),this.isActive=!0,this.sendUpdate()}sendUpdate(){this.options.onUpdate({isActive:this.isActive,left:this.left,bottom:this.bottom,top:this.top})}hide(e){e&&e.relatedTarget&&this.options.element.parentNode&&this.options.element.parentNode.contains(e.relatedTarget)||(this.isActive=!1,this.sendUpdate())}destroy(){this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("focus",this.focusHandler),this.options.editor.off("blur",this.blurHandler)}}Boolean;n(11);var xe=n(3);new r.PluginKey("collab");var Se=function(){};Se.prototype.append=function(e){return e.length?(e=Se.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Se.prototype.prepend=function(e){return e.length?Se.from(e).append(this):this},Se.prototype.appendInner=function(e){return new Ce(this,e)},Se.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Se.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Se.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Se.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Se.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Se.from=function(e){return e instanceof Se?e:e&&e.length?new ke(e):Se.empty};var ke=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Se);Se.empty=new ke([]);var Ce=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return eo&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Se),_e=Se,Oe=function(e,t){this.items=e,this.eventCount=t};Oe.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=e.tr,l=[],u=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void u.push(e);if(r){u.push(new Me(e.map));var p,f=e.step.map(r.slice(o));f&&c.maybeStep(f).doc&&(p=c.mapping.maps[c.mapping.maps.length-1],l.push(new Me(p,null,null,l.length+u.length))),o--,p&&r.appendMap(p,o)}else c.maybeStep(e.step);return e.selection?(s=r?e.selection.map(r.slice(o)):e.selection,a=new Oe(n.items.slice(0,i).append(u.reverse().concat(l)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},Oe.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;cNe&&(d=v,(f=s).forEach((function(e,t){if(e.selection&&0==d--)return h=t,!1})),s=f.slice(h),i-=v),new Oe(s.append(o),i)},Oe.prototype.remapping=function(e,t){var n=new s.a;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)}),e,t),n},Oe.prototype.addMaps=function(e){return 0==this.eventCount?this:new Oe(this.items.append(e.map((function(e){return new Me(e)}))),this.eventCount)},Oe.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((function(e){e.selection&&s--}),r);var a=t;this.items.forEach((function(t){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(t.step){var l=e.steps[r].invert(e.docs[r]),u=t.selection&&t.selection.map(o.slice(a+1,r));u&&s++,n.push(new Me(c,l,u))}else n.push(new Me(c))}}),r);for(var c=[],l=t;l500&&(p=p.compress(this.items.length-n.length)),p},Oe.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Oe.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=e)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(t.slice(n)),c=a&&a.getMap();if(n--,c&&t.appendMap(c,n),a){var l=i.selection&&i.selection.map(t.slice(n));l&&o++;var u,p=new Me(c.invert(),a,l),f=r.length-1;(u=r.length&&r[f].merge(p))?r[f]=u:r.push(p)}}else i.map&&n--}),this.items.length,0),new Oe(_e.from(r.reverse()),o)},Oe.empty=new Oe(_e.empty,0);var Me=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};Me.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new Me(t.getMap().invert(),t,this.selection)}};var Ae=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},Ne=20;function Te(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function $e(e,t){if(!e)return null;for(var n=[],r=0;r=t[o]&&(n=!0)})),n}(n,e.prevRanges)),c=s?$e(e.prevRanges,n.mapping):Te(n.mapping.maps[n.steps.length-1]);return new Ae(e.done.addTransform(n,a?t.selection.getBookmark():null,r,Ie(t)),Oe.empty,c,n.time)}(n,r,t,e)}},config:e})}function ze(e,t){var n=Pe.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Ee(n,e,t,!1),!0)}function Be(e,t){var n=Pe.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Ee(n,e,t,!0),!0)}function Le(e){var t=Pe.getState(e);return t?t.done.eventCount:0}function Ve(e){var t=Pe.getState(e);return t?t.undone.eventCount:0}class He extends le{get name(){return"bullet_list"}get schema(){return{content:"list_item+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}commands({type:e,schema:t}){return()=>re(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-8":re(e,t.nodes.list_item)}}inputRules({type:e}){return[I(/^\s*([-+*])\s$/,e)]}}class Je extends le{get name(){return"heading"}get defaultOptions(){return{levels:[1,2,3,4,5,6]}}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map(e=>({tag:"h".concat(e),attrs:{level:e}})),toDOM:e=>["h".concat(e.attrs.level),0]}}commands({type:e,schema:t}){return n=>te(e,t.nodes.paragraph,n)}keys({type:e}){return this.options.levels.reduce((t,n)=>({...t,["Shift-Ctrl-".concat(n)]:k(e,{level:n})}),{})}inputRules({type:e}){return this.options.levels.map(t=>P(new RegExp("^(#{1,".concat(t,"})\\s$")),e,()=>({level:t})))}}class Ue extends le{get name(){return"horizontal_rule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}commands({type:e}){return()=>(t,n)=>n(t.tr.replaceSelectionWith(e.create()))}inputRules({type:e}){return[Q(/^(?:---|___\s|\*\*\*\s)$/,e)]}}class We extends le{get name(){return"list_item"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}keys({type:e}){return{Enter:(t=e,function(e,n){var r=e.selection,o=r.$from,a=r.$to,c=r.node;if(c&&c.isBlock||o.depth<2||!o.sameParent(a))return!1;var l=o.node(-1);if(l.type!=t)return!1;if(0==o.parent.content.size&&o.node(-1).childCount==o.indexAfter(-1)){if(2==o.depth||o.node(-3).type!=t||o.index(-2)!=o.node(-2).childCount-1)return!1;if(n){for(var u=i.Fragment.empty,p=o.index(-1)>0,f=o.depth-(p?1:2);f>=o.depth-3;f--)u=i.Fragment.from(o.node(f).copy(u));u=u.append(i.Fragment.from(t.createAndFill()));var d=e.tr.replace(o.before(p?null:-1),o.after(-3),new i.Slice(u,p?3:2,2));d.setSelection(e.selection.constructor.near(d.doc.resolve(o.pos+(p?3:2)))),n(d.scrollIntoView())}return!0}var h=a.pos==o.end()?l.contentMatchAt(0).defaultType:null,v=e.tr.delete(o.pos,a.pos),m=h&&[null,{type:h}];return!!Object(s.g)(v.doc,o.pos,2,m)&&(n&&n(v.split(o.pos,2,m).scrollIntoView()),!0)}),Tab:Z(e),"Shift-Tab":X(e)};var t}}class Ke extends le{get name(){return"ordered_list"}get schema(){return{attrs:{order:{default:1}},content:"list_item+",group:"block",parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1===e.attrs.order?["ol",0]:["ol",{start:e.attrs.order},0]}}commands({type:e,schema:t}){return()=>re(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-9":re(e,t.nodes.list_item)}}inputRules({type:e}){return[I(/^(\d+)\.\s$/,e,e=>({order:+e[1]}),(e,t)=>t.childCount+t.attrs.order===+e[1])]}}Object(xe.tableNodes)({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:e=>e.style.backgroundColor||null,setDOMAttr(e,t){if(e){const n={style:"".concat(t.style||"","background-color: ").concat(e,";")};Object.assign(t,n)}}}}});class qe extends ae{get name(){return"bold"}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:()=>["strong",0]}}keys({type:e}){return{"Mod-b":C(e)}}commands({type:e}){return()=>C(e)}inputRules({type:e}){return[Y(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e)]}pasteRules({type:e}){return[ee(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,e)]}}class Ge extends ae{get name(){return"code"}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}keys({type:e}){return{"Mod-`":C(e)}}commands({type:e}){return()=>C(e)}inputRules({type:e}){return[Y(/(?:`)([^`]+)(?:`)$/,e)]}pasteRules({type:e}){return[ee(/(?:`)([^`]+)(?:`)/g,e)]}}class Xe extends ae{get name(){return"italic"}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}keys({type:e}){return{"Mod-i":C(e)}}commands({type:e}){return()=>C(e)}inputRules({type:e}){return[Y(/(?:^|[^_])(_([^_]+)_)$/,e),Y(/(?:^|[^*])(\*([^*]+)\*)$/,e)]}pasteRules({type:e}){return[ee(/_([^_]+)_/g,e),ee(/\*([^*]+)\*/g,e)]}}class Ze extends ae{get name(){return"strike"}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:()=>["s",0]}}keys({type:e}){return{"Mod-d":C(e)}}commands({type:e}){return()=>C(e)}inputRules({type:e}){return[Y(/~([^~]+)~$/,e)]}pasteRules({type:e}){return[ee(/~([^~]+)~/g,e)]}}class Ye extends ae{get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:e=>"underline"===e}],toDOM:()=>["u",0]}}keys({type:e}){return{"Mod-u":C(e)}}commands({type:e}){return()=>C(e)}}class Qe extends ie{get name(){return"history"}get defaultOptions(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":ze,"Mod-y":Be,"Shift-Mod-z":Be,"Mod-я":ze,"Shift-Mod-я":Be}}get plugins(){return[je({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}commands(){return{undo:()=>ze,redo:()=>Be,undoDepth:()=>Le,redoDepth:()=>Ve}}}var et={props:{value:{type:String,default:""},ul:{type:Boolean,default:!0},heading:{type:Boolean,default:!0},hr:{type:Boolean,default:!0},ol:{type:Boolean,default:!0},bold:{type:Boolean,default:!0},code:{type:Boolean,default:!0},italic:{type:Boolean,default:!0},strike:{type:Boolean,default:!0},underline:{type:Boolean,default:!0},history:{type:Boolean,default:!0},asJson:{type:Boolean,default:!1}},components:{EditorContent:he,EditorMenuBar:me},data:function(){var e=this;return{editor:new de({extensions:[new He,new Je({levels:[1,2,3]}),new Ue,new We,new Ke,new qe,new Ge,new Xe,new Ze,new Ye,new Qe],content:e.value,onUpdate:function(t){var n=t.getHTML,r=t.getJSON;e.asJson?e.$emit("input",r()):e.$emit("input",n())},parseOptions:{preserveWhitespace:!0}})}},watch:{value:function(e){this.editor.setContent(e)}},beforeDestroy:function(){this.editor.destroy()}};n(22),n(25);function tt(e,t,n,r,o,i,s,a){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),s?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=c):o&&(c=a?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return{exports:e,options:l}}var nt=tt(et,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tiptap input cursor-text",on:{click:function(t){return e.editor.focus()}}},[n("editor-menu-bar",{attrs:{editor:e.editor},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.commands,o=t.isActive;return[n("div",{staticClass:"button-group"},[e.bold?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.bold"),expression:"__('voyager::tiptap.bold')"}],staticClass:"button font-bold small icon-only",class:[o.bold()?"accent":null],on:{click:r.bold}},[e._v("\n B\n ")]):e._e(),e._v(" "),e.italic?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.italic"),expression:"__('voyager::tiptap.italic')"}],staticClass:"button italic small icon-only",class:[o.italic()?"accent":null],on:{click:r.italic}},[e._v("\n I\n ")]):e._e(),e._v(" "),e.strike?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.strike"),expression:"__('voyager::tiptap.strike')"}],staticClass:"button line-through small icon-only",class:[o.strike()?"accent":null],on:{click:r.strike}},[e._v("\n S\n ")]):e._e(),e._v(" "),e.underline?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.underline"),expression:"__('voyager::tiptap.underline')"}],staticClass:"button underline small icon-only",class:[o.underline()?"accent":null],on:{click:r.underline}},[e._v("\n U\n ")]):e._e(),e._v(" "),e.code?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.code"),expression:"__('voyager::tiptap.code')"}],staticClass:"button small icon-only",class:[o.code()?"accent":null],on:{click:r.code}},[n("icon",{attrs:{icon:"code",size:5}})],1):e._e(),e._v(" "),n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.paragraph"),expression:"__('voyager::tiptap.paragraph')"}],staticClass:"button small icon-only",class:[o.paragraph()?"accent":null],on:{click:r.paragraph}},[e._v("\n P\n ")]),e._v(" "),e.ul?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.bullet_list"),expression:"__('voyager::tiptap.bullet_list')"}],staticClass:"button small icon-only",class:[o.bullet_list()?"accent":null],on:{click:r.bullet_list}},[e._v("\n UL\n ")]):e._e(),e._v(" "),e.ol?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.ordered_list"),expression:"__('voyager::tiptap.ordered_list')"}],staticClass:"button small icon-only",class:[o.ordered_list()?"accent":null],on:{click:r.ordered_list}},[e._v("\n OL\n ")]):e._e(),e._v(" "),e.hr?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.horizontal_rule"),expression:"__('voyager::tiptap.horizontal_rule')"}],staticClass:"button small icon-only",class:[o.horizontal_rule()?"accent":null],on:{click:r.horizontal_rule}},[e._v("\n HR\n ")]):e._e(),e._v(" "),e.heading?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.heading_1"),expression:"__('voyager::tiptap.heading_1')"}],staticClass:"button small icon-only",class:[o.heading({level:1})?"accent":null],on:{click:function(e){return r.heading({level:1})}}},[e._v("\n H1\n ")]):e._e(),e._v(" "),e.heading?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.heading_2"),expression:"__('voyager::tiptap.heading_2')"}],staticClass:"button small icon-only",class:[o.heading({level:2})?"accent":null],on:{click:function(e){return r.heading({level:2})}}},[e._v("\n H2\n ")]):e._e(),e._v(" "),e.heading?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.heading_3"),expression:"__('voyager::tiptap.heading_3')"}],staticClass:"button small icon-only",class:[o.heading({level:3})?"accent":null],on:{click:function(e){return r.heading({level:3})}}},[e._v("\n H3\n ")]):e._e(),e._v(" "),e.history?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.undo"),expression:"__('voyager::tiptap.undo')"}],staticClass:"button small icon-only",on:{click:r.undo}},[e._v("\n <\n ")]):e._e(),e._v(" "),e.history?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.redo"),expression:"__('voyager::tiptap.redo')"}],staticClass:"button small icon-only",on:{click:r.redo}},[e._v("\n >\n ")]):e._e()])]}}])}),e._v(" "),n("editor-content",{staticClass:"content mt-2",attrs:{spellcheck:"false",editor:e.editor}})],1)}),[],!1,null,"2703cc05",null).exports,rt=tt({props:["show","options","value","translatable"]},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["query"==e.show?e._t("default"):n("div",[e.options.display_length>0?n("span",[e._v("\n "+e._s(e.value.slice(0,e.options.display_length))+"\n ")]):n("span",[e._v("\n "+e._s(e.value)+"\n ")])])],2)}),[],!1,null,null,null).exports,ot=tt({props:["options","value"]},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("tiptap",{attrs:{"as-json":e.options.as_json,ul:e.options.ul,heading:e.options.heading,hr:e.options.hr,ol:e.options.ol,bold:e.options.bold,code:e.options.code,italic:e.options.italic,strike:e.options.strike,underline:e.options.underline,history:e.options.history,value:e.value},on:{input:function(t){return e.$emit("input",t)}}})],1)}),[],!1,null,null,null).exports,it=tt({props:["options","data","translatable"]},(function(){var e=this.$createElement;return(this._self._c||e)("div",{domProps:{innerHTML:this._s(this.translate(this.data,!this.translatable))}})}),[],!1,null,null,null).exports,st=tt({props:["options","column","show"]},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["list-options"==e.show?n("div",[n("label",{staticClass:"label",attrs:{for:"length"}},[e._v(e._s(e.__("voyager::generic.display_length")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.display_length,expression:"options.display_length"}],staticClass:"input w-full",attrs:{type:"text",id:"length"},domProps:{value:e.options.display_length},on:{input:function(t){t.target.composing||e.$set(e.options,"display_length",t.target.value)}}})]):"view-options"==e.show?n("div",[n("label",{staticClass:"label mt-4"},[e._v("Store JSON")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.as_json,expression:"options.as_json"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.as_json)?e._i(e.options.as_json,null)>-1:e.options.as_json},on:{change:function(t){var n=e.options.as_json,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"as_json",n.concat([null])):i>-1&&e.$set(e.options,"as_json",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"as_json",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Unordered List")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.ul,expression:"options.ul"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.ul)?e._i(e.options.ul,null)>-1:e.options.ul},on:{change:function(t){var n=e.options.ul,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"ul",n.concat([null])):i>-1&&e.$set(e.options,"ul",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"ul",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Heading")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.heading,expression:"options.heading"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.heading)?e._i(e.options.heading,null)>-1:e.options.heading},on:{change:function(t){var n=e.options.heading,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"heading",n.concat([null])):i>-1&&e.$set(e.options,"heading",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"heading",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Horizontal Rule")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.hr,expression:"options.hr"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.hr)?e._i(e.options.hr,null)>-1:e.options.hr},on:{change:function(t){var n=e.options.hr,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"hr",n.concat([null])):i>-1&&e.$set(e.options,"hr",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"hr",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Ordered List")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.ol,expression:"options.ol"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.ol)?e._i(e.options.ol,null)>-1:e.options.ol},on:{change:function(t){var n=e.options.ol,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"ol",n.concat([null])):i>-1&&e.$set(e.options,"ol",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"ol",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Bold")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.bold,expression:"options.bold"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.bold)?e._i(e.options.bold,null)>-1:e.options.bold},on:{change:function(t){var n=e.options.bold,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"bold",n.concat([null])):i>-1&&e.$set(e.options,"bold",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"bold",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Code")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.code,expression:"options.code"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.code)?e._i(e.options.code,null)>-1:e.options.code},on:{change:function(t){var n=e.options.code,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"code",n.concat([null])):i>-1&&e.$set(e.options,"code",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"code",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Italic")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.italic,expression:"options.italic"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.italic)?e._i(e.options.italic,null)>-1:e.options.italic},on:{change:function(t){var n=e.options.italic,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"italic",n.concat([null])):i>-1&&e.$set(e.options,"italic",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"italic",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Strike")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.strike,expression:"options.strike"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.strike)?e._i(e.options.strike,null)>-1:e.options.strike},on:{change:function(t){var n=e.options.strike,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"strike",n.concat([null])):i>-1&&e.$set(e.options,"strike",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"strike",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Underline")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.underline,expression:"options.underline"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.underline)?e._i(e.options.underline,null)>-1:e.options.underline},on:{change:function(t){var n=e.options.underline,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"underline",n.concat([null])):i>-1&&e.$set(e.options,"underline",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"underline",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("History")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.history,expression:"options.history"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.history)?e._i(e.options.history,null)>-1:e.options.history},on:{change:function(t){var n=e.options.history,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"history",n.concat([null])):i>-1&&e.$set(e.options,"history",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"history",o)}}})]):"view"==e.show?n("div",[n("tiptap",{attrs:{"as-json":e.options.as_json,ul:e.options.ul,heading:e.options.heading,hr:e.options.hr,ol:e.options.ol,bold:e.options.bold,code:e.options.code,italic:e.options.italic,strike:e.options.strike,underline:e.options.underline,history:e.options.history}})],1):e._e()])}),[],!1,null,null,null).exports;Vue.component("tiptap",nt),Vue.component("formfield-tiptap-browse",rt),Vue.component("formfield-tiptap-edit-add",ot),Vue.component("formfield-tiptap-read",it),Vue.component("formfield-tiptap-builder",st)}]); \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=14)}([function(e,t,n){"use strict";function r(e){this.content=e}n.r(t),n.d(t,"ContentMatch",(function(){return D})),n.d(t,"DOMParser",(function(){return ee})),n.d(t,"DOMSerializer",(function(){return pe})),n.d(t,"Fragment",(function(){return i})),n.d(t,"Mark",(function(){return u})),n.d(t,"MarkType",(function(){return Z})),n.d(t,"Node",(function(){return N})),n.d(t,"NodeRange",(function(){return O})),n.d(t,"NodeType",(function(){return K})),n.d(t,"ReplaceError",(function(){return p})),n.d(t,"ResolvedPos",(function(){return x})),n.d(t,"Schema",(function(){return Y})),n.d(t,"Slice",(function(){return f})),r.prototype={constructor:r,find:function(e){for(var t=0;t>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};var o=r;var i=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;ne&&!1!==n(a,r+s,o,i)&&a.content.size){var l=s+1;a.nodesBetween(Math.max(0,e-l),Math.min(a.content.size,t-l),n,r+l)}s=c}},i.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},i.prototype.textBetween=function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(s,a){s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},i.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);oe)for(var o=0,s=0;se&&((st)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),n.push(a),r+=a.nodeSize),s=c}return new i(n,r)},i.prototype.cutByIndex=function(e,t){return e==t?i.empty:0==e&&t==this.content.length?this:new i(this.content.slice(e,t))},i.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new i(r,o)},i.prototype.addToStart=function(e){return new i([e].concat(this.content),this.size+e.nodeSize)},i.prototype.addToEnd=function(e){return new i(this.content.concat(e),this.size+e.nodeSize)},i.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;tthis.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?c(n+1,o):c(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},i.fromJSON=function(e,t){if(!t)return i.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(t.map(e.nodeFromJSON))},i.fromArray=function(e){if(!e.length)return i.empty;for(var t,n=0,r=0;rthis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t},u.prototype.removeFromSet=function(e){for(var t=0;te.depth)throw new p("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new p("Inconsistent open depths");return function e(t,n,r,o){var s=t.index(o),a=t.node(o);if(s==n.index(o)&&o=0;o--)r=t.node(o).copy(i.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t),u=l.start,p=l.end;return b(a,function e(t,n,r,o,s){var a=t.depth>s&&m(t,n,s+1),c=o.depth>s&&m(r,o,s+1),l=[];y(null,t,s,l),a&&c&&n.index(s)==r.index(s)?(v(a,c),g(b(a,e(t,n,r,o,s+1)),l)):(a&&g(b(a,w(t,n,s+1)),l),y(n,r,s,l),c&&g(b(c,w(r,o,s+1)),l));return y(o,null,s,l),new i(l)}(t,u,p,n,o))}var f=t.parent,d=f.content;return b(f,d.cut(0,t.parentOffset).append(r.content).append(d.cut(n.parentOffset)))}return b(a,w(t,n,o))}(e,t,n,0)}function v(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function m(e,t,n){var r=e.node(n);return v(r,t.node(n)),r}function g(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function y(e,t,n,r){var o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(g(e.nodeAfter,r),i++));for(var a=i;an)&&g(b(m(e,t,n+1),w(e,t,n+1)),r);return y(t,null,n,r),new i(r)}d.size.get=function(){return this.content.size-this.openStart-this.openEnd},f.prototype.insertAt=function(e,t){var n=function e(t,n,r,o){var i=t.findIndex(n),s=i.index,a=i.offset,c=t.maybeChild(s);if(a==n||c.isText)return o&&!o.canReplace(s,s,r)?null:t.cut(0,n).append(r).append(t.cut(n));var l=e(c.content,n-a-1,r);return l&&t.replaceChild(s,c.copy(l))}(this.content,e+this.openStart,t,null);return n&&new f(n,this.openStart,this.openEnd)},f.prototype.removeBetween=function(e,t){return new f(function e(t,n,r){var o=t.findIndex(n),i=o.index,s=o.offset,a=t.maybeChild(i),c=t.findIndex(r),l=c.index,u=c.offset;if(s==n||a.isText){if(u!=r&&!t.child(l).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw new RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(e(a.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},f.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},f.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},f.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},f.fromJSON=function(e,t){if(!t)return f.empty;var n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new f(i.fromJSON(e,t.content),n,r)},f.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,r=0,o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new f(e,n,r)},Object.defineProperties(f.prototype,d),f.empty=new f(i.empty,0,0);var x=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},S={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};x.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},S.parent.get=function(){return this.node(this.depth)},S.doc.get=function(){return this.node(0)},x.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},x.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},x.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},x.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},x.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},x.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},x.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},S.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},S.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r},S.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},x.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},x.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new O(this,e,n)},x.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},x.prototype.max=function(e){return e.pos>this.pos?e:this},x.prototype.min=function(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],r=0,o=t,i=e;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,l=o-c;if(n.push(i,a,r+c),!l)break;if((i=i.child(a)).isText)break;o=l-1,r+=c+1}return new x(t,n,o)},x.resolveCached=function(e,t){for(var n=0;ne&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r},T.isBlock.get=function(){return this.type.isBlock},T.isTextblock.get=function(){return this.type.isTextblock},T.inlineContent.get=function(){return this.type.inlineContent},T.isInline.get=function(){return this.type.isInline},T.isText.get=function(){return this.type.isText},T.isLeaf.get=function(){return this.type.isLeaf},T.isAtom.get=function(){return this.type.isAtom},N.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),E(this.marks,e)},N.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},N.prototype.canReplace=function(e,t,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var s=this.contentMatchAt(e).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var c=r;c=0;n--)t=e[n].type.name+"("+t+")";return t}var D=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},R={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};D.parse=function(e,t){var n=new I(e,t);if(null==n.next)return D.empty;var r=F(n);n.next&&n.err("Unexpected trailing text");var o=function(e){var t=Object.create(null);return function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];H(e,r).forEach((function(e){s||o.push(n,s=[]),-1==s.indexOf(e)&&s.push(e)}))}}))}));for(var i=t[r.join(",")]=new D(r.indexOf(e.length-1)>-1),s=0;s>1},D.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},D.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var r=1;r"+e.indexOf(t.next[o+1]);return r})).join("\n")},Object.defineProperties(D.prototype,R),D.empty=new D(!0);var I=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.unshift()},P={next:{configurable:!0}};function F(e){var t=[];do{t.push(j(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function j(e){var t=[];do{t.push(z(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function z(e){for(var t=function(e){if(e.eat("(")){var t=F(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=L(e,t)}return t}function B(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function L(e,t){var n=B(e),r=n;return e.eat(",")&&(r="}"!=e.next?B(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function V(e,t){return t-e}function H(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i-1},K.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t-1};var Y=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=o.from(e.nodes),this.spec.marks=o.from(e.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=Z.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=D.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?Q(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=null==u?[l]:""==u?[]:Q(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Q(e,t){for(var n=[],r=0;r-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}Y.prototype.node=function(e,t,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof K))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)},Y.prototype.text=function(e,t){var n=this.nodes.text;return new $(n,n.defaultAttrs,e,u.setFrom(t))},Y.prototype.mark=function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)},Y.prototype.nodeFromJSON=function(e){return N.fromJSON(this,e)},Y.prototype.markFromJSON=function(e){return u.fromJSON(this,e)},Y.prototype.nodeType=function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t};var ee=function(e,t){var n=this;this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((function(e){e.tag?n.tags.push(e):e.style&&n.styles.push(e)})),this.normalizeLists=!this.tags.some((function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)}))};ee.prototype.parse=function(e,t){void 0===t&&(t={});var n=new se(this,t,!1);return n.addAll(e,null,t.from,t.to),n.finish()},ee.prototype.parseSlice=function(e,t){void 0===t&&(t={});var n=new se(this,t,!0);return n.addAll(e,null,t.from,t.to),f.maxOpen(n.finish())},ee.prototype.matchTag=function(e,t){for(var n=0;ne.length&&(61!=o.style.charCodeAt(e.length)||o.style.slice(e.length+1)!=t))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},ee.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var s=0;sthis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},se.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},se.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},ae.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e},se.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(e,a){for(;e>=0;e--){var c=n[e];if(""==c){if(e==n.length-1||0==e)continue;for(;a>=i;a--)if(s(e-1,a))return!0;return!1}var l=a>0||0==a&&o?t.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!l||l.name!=c&&-1==l.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},se.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},se.prototype.addPendingMark=function(e){this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},se.prototype.removePendingMark=function(e,t){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1?r.pendingMarks=e.removeFromSet(r.pendingMarks):r.activeMarks=e.removeFromSet(r.activeMarks),r==t)break}},Object.defineProperties(se.prototype,ae);var pe=function(e,t){this.nodes=e||{},this.marks=t||{}};function fe(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function de(e){return e.document||window.document}pe.prototype.serializeFragment=function(e,t,n){var r=this;void 0===t&&(t={}),n||(n=de(t).createDocumentFragment());var o=n,i=null;return e.forEach((function(e){if(i||e.marks.length){i||(i=[]);for(var n=0,s=0;n=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},pe.prototype.serializeMark=function(e,t,n){void 0===n&&(n={});var r=this.marks[e.type.name];return r&&pe.renderSpec(de(n),r(e,t))},pe.renderSpec=function(e,t,n){if(void 0===n&&(n=null),"string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};var r=t[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?e.createElementNS(n,r):e.createElement(r),a=t[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var l in c=2,a)if(null!=a[l]){var u=l.indexOf(" ");u>0?s.setAttributeNS(l.slice(0,u),l.slice(u+1),a[l]):s.setAttribute(l,a[l])}for(var p=c;pc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var d=pe.renderSpec(e,f,n),h=d.dom,v=d.contentDOM;if(s.appendChild(h),v){if(i)throw new RangeError("Multiple content holes");i=v}}return{dom:s,contentDOM:i}},pe.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new pe(this.nodesFromSchema(e),this.marksFromSchema(e)))},pe.nodesFromSchema=function(e){var t=fe(e.nodes);return t.text||(t.text=function(e){return e.text}),t},pe.marksFromSchema=function(e){return fe(e.marks)}},function(e,t,n){"use strict";n.r(t),n.d(t,"AllSelection",(function(){return d})),n.d(t,"EditorState",(function(){return S})),n.d(t,"NodeSelection",(function(){return p})),n.d(t,"Plugin",(function(){return _})),n.d(t,"PluginKey",(function(){return A})),n.d(t,"Selection",(function(){return s})),n.d(t,"SelectionRange",(function(){return c})),n.d(t,"TextSelection",(function(){return l})),n.d(t,"Transaction",(function(){return g}));var r=n(0),o=n(2),i=Object.create(null),s=function(e,t,n){this.ranges=n||[new c(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},a={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};a.anchor.get=function(){return this.$anchor.pos},a.head.get=function(){return this.$head.pos},a.from.get=function(){return this.$from.pos},a.to.get=function(){return this.$to.pos},a.$from.get=function(){return this.ranges[0].$from},a.$to.get=function(){return this.ranges[0].$to},a.empty.get=function(){for(var e=this.ranges,t=0;t=0;o--){var i=t<0?v(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):v(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}},s.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new d(e.node(0))},s.atStart=function(e){return v(e,e,0,0,1)||new d(e)},s.atEnd=function(e){return v(e,e,e.content.size,e.childCount,-1)||new d(e)},s.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=i[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},s.jsonID=function(e,t){if(e in i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t},s.prototype.getBookmark=function(){return l.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(s.prototype,a),s.prototype.visible=!0;var c=function(e,t){this.$from=e,this.$to=t},l=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return e.near(o);var i=n.resolve(r.map(this.anchor));return new t(i.parent.inlineContent?i:o,o)},t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Slice.empty),e.prototype.replace.call(this,t,n),n==r.Slice.empty){var o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new u(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))},t.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=e.findFrom(r,o,!0)||e.findFrom(r,-o,!0);if(!s)return e.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(e.findFrom(n,-o,!0)||e.findFrom(n,o,!0)).$anchor).pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&p.isSelectable(a))return p.create(e,n-(o<0?a.nodeSize:0))}else{var c=v(e,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function m(e,t,n){var r=e.steps.length-1;if(!(r0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return r.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.Mark.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(o.e);function y(e,t){return t&&e?e.bind(t):e}var b=function(e,t,n){this.name=e,this.init=y(t.init,n),this.apply=y(t.apply,n)},w=[new b("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new b("selection",{init:function(e,t){return e.selection||s.atStart(t.doc)},apply:function(e){return e.selection}}),new b("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new b("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],x=function(e,t){var n=this;this.schema=e,this.fields=w.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new b(e.key,e.spec.state,e))}))},S=function(e){this.config=e},k={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};k.schema.get=function(){return this.config.schema},k.plugins.get=function(){return this.config.plugins},S.prototype.apply=function(e){return this.applyTransaction(e).state},S.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n-1&&C.splice(t,1)},Object.defineProperties(S.prototype,k);var C=[];var _=function(e){this.props={},e.props&&function e(t,n,r){for(var o in t){var i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:M("plugin")};_.prototype.getState=function(e){return e[this.key]};var O=Object.create(null);function M(e){return e in O?e+"$"+ ++O[e]:(O[e]=0,e+"$")}var A=function(e){void 0===e&&(e="key"),this.key=M(e)};A.prototype.get=function(e){return e.config.pluginsByKey[this.key]},A.prototype.getState=function(e){return e[this.key]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return C})),n.d(t,"g",(function(){return k})),n.d(t,"h",(function(){return M})),n.d(t,"i",(function(){return x})),n.d(t,"j",(function(){return O})),n.d(t,"k",(function(){return w}));var r=n(0),o=Math.pow(2,16);function i(e){return 65535&e}var s=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},a=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};a.prototype.recover=function(e){var t=0,n=i(e);if(!this.inverted)for(var r=0;re)break;var u=this.ranges[c+i],p=this.ranges[c+a],f=l+u;if(e<=f){var d=l+r+((u?e==l?-1:e==f?1:t:t)<0?0:p);if(n)return d;var h=e==(t<0?l:f)?null:c/3+(e-l)*o;return new s(d,t<0?e!=l:e!=f,h)}r+=p-u}return n?e+r:new s(e+r)},a.prototype.touches=function(e,t){for(var n=0,r=i(t),o=this.inverted?2:1,s=this.inverted?1:2,a=0;ae)break;var l=this.ranges[a+o];if(e<=c+l&&a==3*r)return!0;n+=this.ranges[a+s]-l}return!1},a.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},c.prototype.invert=function(){var e=new c;return e.appendMappingInverted(this),e},c.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;no&&a0},u.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(u.prototype,p);var d=Object.create(null),h=function(){};h.prototype.apply=function(e){return f()},h.prototype.getMap=function(){return a.empty},h.prototype.invert=function(e){return f()},h.prototype.map=function(e){return f()},h.prototype.merge=function(e){return null},h.prototype.toJSON=function(){return f()},h.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=d[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},h.jsonID=function(e,t){if(e in d)throw new RangeError("Duplicate use of step JSON ID "+e);return d[e]=t,t.prototype.jsonID=e,t};var v=function(e,t){this.doc=e,this.failed=t};v.ok=function(e){return new v(e,null)},v.fail=function(e){return new v(null,e)},v.fromReplace=function(e,t,n,o){try{return v.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.ReplaceError)return v.fail(e.message);throw e}};var m=function(e){function t(t,n,r,o){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&y(e,this.from,this.to)?v.fail("Structure replace would overwrite content"):v.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new a([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure!=this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var o=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),o,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,r.Slice.fromJSON(e,n.slice),!!n.structure)},t}(h);h.jsonID("replace",m);var g=function(e){function t(t,n,r,o,i,s,a){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(y(e,this.from,this.gapFrom)||y(e,this.gapTo,this.to)))return v.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return v.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?v.fromReplace(e,this.from,this.to,n):v.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new a([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deleted&&r.deleted||or.pos?null:new t(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,r.Slice.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(h);function y(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function b(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function w(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(ni;a--,c--){var l=o.node(a),u=o.index(a);if(l.type.spec.isolating)return!1;var p=l.content.cutByIndex(u,l.childCount),f=r&&r[c]||l;if(f!=l&&(p=p.replaceChild(0,f.type.create(f.attrs))),!l.canReplace(u+1,l.childCount)||!f.type.validContent(p))return!1}var d=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(d,d,h?h.type:o.node(i+1).type)}function C(e,t){var n=e.resolve(t),r=n.index();return _(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function _(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}function O(e,t,n){void 0===n&&(n=-1);for(var r=e.resolve(t),o=r.depth;;o--){var i=void 0,s=void 0,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&_(i,s)&&r.node(o).canReplace(a,a+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function M(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(c>0?1:0);if(1==s?r.node(a).canReplace(l,l,o):r.node(a).contentMatchAt(l).findWrapping(o.firstChild.type))return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function A(e,t,n){for(var o=[],i=0;it;f--)d||n.index(f)>0?(d=!0,u=r.Fragment.from(n.node(f).copy(u)),p++):c--;for(var h=r.Fragment.empty,v=0,m=i,y=!1;m>t;m--)y||o.after(m+1)=0;o--)n=r.Fragment.from(t[o].type.create(t[o].attrs,n));var i=e.start,s=e.end;return this.step(new g(i,s,i,s,new r.Slice(n,0,0),t.length,!0))},u.prototype.setBlockType=function(e,t,n,o){var i=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,o)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(s).map(t),n)){i.clearIncompatible(i.mapping.slice(s).map(t,1),n);var a=i.mapping.slice(s),c=a.map(t,1),l=a.map(t+e.nodeSize,1);return i.step(new g(c,l,c+1,l-1,new r.Slice(r.Fragment.from(n.create(o,null,e.marks)),0,0),1,!0)),!1}})),this},u.prototype.setNodeMarkup=function(e,t,n,o){var i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);var s=t.create(n,null,o||i.marks);if(i.isLeaf)return this.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new g(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new r.Slice(r.Fragment.from(s),0,0),1,!0))},u.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var o=this.doc.resolve(e),i=r.Fragment.empty,s=r.Fragment.empty,a=o.depth,c=o.depth-t,l=t-1;a>c;a--,l--){i=r.Fragment.from(o.node(a).copy(i));var u=n&&n[l];s=r.Fragment.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}return this.step(new m(e,e,new r.Slice(i.append(s),t,t),!0))},u.prototype.join=function(e,t){void 0===t&&(t=1);var n=new m(e-t,e+t,r.Slice.empty,!0);return this.step(n)};var N=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),s=new r.Slice(A(n.content,(function(e,n){return n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),i),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,s)},t.prototype.invert=function(){return new T(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(h);h.jsonID("addMark",N);var T=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=new r.Slice(A(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,o)},t.prototype.invert=function(){return new N(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(h);function $(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}h.jsonID("removeMark",T),u.prototype.addMark=function(e,t,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(e,t,(function(r,c,l){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&l.type.allowsMarkType(n.type)){for(var p=Math.max(c,e),f=Math.min(c+r.nodeSize,t),d=n.addToSet(u),h=0;h=0;d--)this.step(i[d]);return this},u.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=r.Slice.empty);var o=function(e,t,n,o){if(void 0===n&&(n=t),void 0===o&&(o=r.Slice.empty),t==n&&!o.size)return null;var i=e.resolve(t),s=e.resolve(n);return $(i,s,o)?new m(t,n,o):new E(i,s,o).fit()}(this.doc,e,t,n);return o&&this.step(o),this},u.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new r.Slice(r.Fragment.from(n),0,0))},u.prototype.delete=function(e,t){return this.replace(e,t,r.Slice.empty)},u.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var E=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var o=0;o<=e.depth;o++){var i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}this.placed=r.Fragment.empty;for(var s=e.depth;s>0;s--)this.placed=r.Fragment.from(e.node(s).copy(this.placed))},D={depth:{configurable:!0}};function R(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(R(e.firstChild.content,t-1,n)))}function I(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(I(e.lastChild.content,t-1,n)))}function P(e,t){for(var n=0;n1&&(o=o.replaceChild(0,F(o.firstChild,t-1,1==o.childCount?n-1:0))),t>0&&(o=e.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.Fragment.empty,!0)))),e.copy(o)}function j(e,t,n,r,o){var i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(var r=n;ro){var a=i.contentMatchAt(0),c=a.fillBefore(e).append(e);e=c.append(a.matchFragment(c).fillBefore(r.Fragment.empty,!0))}return e}function B(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(ot.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;o==t.start(r)&&n.push(r)}return n}D.depth.get=function(){return this.frontier.length-1},E.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(t<0?this.$to:o.doc.resolve(t));if(!i)return null;for(var s=this.placed,a=o.depth,c=i.depth;a&&c&&1==s.childCount;)s=s.firstChild.content,a--,c--;var l=new r.Slice(s,a,c);return t>-1?new g(o.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||o.pos!=this.$to.pos?new m(o.pos,i.pos,l):void 0},E.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,o=(t?(n=P(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,i=this.depth;i>=0;i--){var s=this.frontier[i],a=s.type,c=s.match,l=void 0,u=void 0;if(1==e&&(o?c.matchType(o.type)||(u=c.fillBefore(r.Fragment.from(o),!1)):a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:i,parent:n,inject:u};if(2==e&&o&&(l=c.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:i,parent:n,wrap:l};if(n&&c.matchType(n.type))break}},E.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,o=e.openEnd,i=P(t,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new r.Slice(t,n+1,Math.max(o,i.size+n>=t.size-o?n+1:0)),!0)},E.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,o=e.openEnd,i=P(t,n);if(i.childCount<=1&&n>0){var s=t.size-n<=n+i.size;this.unplaced=new r.Slice(R(t,n-1,1),n-1,s?n-1:o)}else this.unplaced=new r.Slice(R(t,n,1),n,o)},E.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,o=e.parent,i=e.inject,s=e.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a1||0==u||y.content.size)&&(h=b,f.push(F(y.mark(v.allowedMarks(y.marks)),1==p?u:0,p==l.childCount?g:-1)))}var w=p==l.childCount;w||(g=-1),this.placed=I(this.placed,n,r.Fragment.from(f)),this.frontier[n].match=h,w&&g<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,S=l;x1&&r==this.$to.end(--n);)++r;return r},E.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t=0;a--){var c=this.frontier[a],l=c.match,u=j(e,a,c.type,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}},E.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=I(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e},E.prototype.openFrontierNode=function(e,t,n){var o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=I(this.placed,this.depth,r.Fragment.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},E.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(r.Fragment.empty,!0);e.childCount&&(this.placed=I(this.placed,this.frontier.length,e))},Object.defineProperties(E.prototype,D),u.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var o=this.doc.resolve(e),i=this.doc.resolve(t);if($(o,i,n))return this.step(new m(e,t,n));var s=B(o,this.doc.resolve(t));0==s[s.length-1]&&s.pop();var a=-(o.depth+1);s.unshift(a);for(var c=o.depth,l=o.pos-1;c>0;c--,l--){var u=o.node(c).type.spec;if(u.defining||u.isolating)break;s.indexOf(c)>-1?a=c:o.before(c)==l&&s.splice(1,0,-c)}for(var p=s.indexOf(a),f=[],d=n.openStart,h=n.content,v=0;;v++){var g=h.firstChild;if(f.push(g),v==n.openStart)break;h=g.content}d>0&&f[d-1].type.spec.defining&&o.node(p).type!=f[d-1].type?d-=1:d>=2&&f[d-1].isTextblock&&f[d-2].type.spec.defining&&o.node(p).type!=f[d-2].type&&(d-=2);for(var y=n.openStart;y>=0;y--){var b=(y+d+1)%(n.openStart+1),w=f[b];if(w)for(var x=0;x=0&&(this.replace(e,t,n),!(this.steps.length>O));M--){var A=s[M];M<0||(e=o.before(A),t=i.after(A))}return this},u.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(e-n.start(c)==n.depth-c&&t>n.end(c)&&r.end(c)-t!=r.depth-c)return this.delete(n.before(c),t);return this.delete(e,t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"CellSelection",(function(){return R})),n.d(t,"TableMap",(function(){return h})),n.d(t,"TableView",(function(){return Oe})),n.d(t,"__clipCells",(function(){return z})),n.d(t,"__insertCells",(function(){return V})),n.d(t,"__pastedCells",(function(){return F})),n.d(t,"addColSpan",(function(){return E})),n.d(t,"addColumn",(function(){return re})),n.d(t,"addColumnAfter",(function(){return ie})),n.d(t,"addColumnBefore",(function(){return oe})),n.d(t,"addRow",(function(){return le})),n.d(t,"addRowAfter",(function(){return pe})),n.d(t,"addRowBefore",(function(){return ue})),n.d(t,"cellAround",(function(){return x})),n.d(t,"colCount",(function(){return A})),n.d(t,"columnIsHeader",(function(){return D})),n.d(t,"columnResizing",(function(){return Ne})),n.d(t,"columnResizingPluginKey",(function(){return Ae})),n.d(t,"deleteColumn",(function(){return ae})),n.d(t,"deleteRow",(function(){return de})),n.d(t,"deleteTable",(function(){return _e})),n.d(t,"findCell",(function(){return M})),n.d(t,"fixTables",(function(){return te})),n.d(t,"fixTablesKey",(function(){return ee})),n.d(t,"goToNextCell",(function(){return Ce})),n.d(t,"handlePaste",(function(){return G})),n.d(t,"inSameTable",(function(){return O})),n.d(t,"isInTable",(function(){return S})),n.d(t,"mergeCells",(function(){return ve})),n.d(t,"moveCellForward",(function(){return _})),n.d(t,"nextCell",(function(){return N})),n.d(t,"pointsAtCell",(function(){return C})),n.d(t,"removeColSpan",(function(){return $})),n.d(t,"removeColumn",(function(){return se})),n.d(t,"removeRow",(function(){return fe})),n.d(t,"rowIsHeader",(function(){return ce})),n.d(t,"selectedRect",(function(){return ne})),n.d(t,"selectionCell",(function(){return k})),n.d(t,"setAttr",(function(){return T})),n.d(t,"setCellAttr",(function(){return ye})),n.d(t,"splitCell",(function(){return me})),n.d(t,"splitCellWithType",(function(){return ge})),n.d(t,"tableEditing",(function(){return Ie})),n.d(t,"tableEditingKey",(function(){return w})),n.d(t,"tableNodeTypes",(function(){return b})),n.d(t,"tableNodes",(function(){return y})),n.d(t,"toggleHeader",(function(){return we})),n.d(t,"toggleHeaderCell",(function(){return ke})),n.d(t,"toggleHeaderColumn",(function(){return Se})),n.d(t,"toggleHeaderRow",(function(){return xe})),n.d(t,"updateColumnsOnResize",(function(){return Me}));var r,o,i=n(1),s=n(0),a=n(6),c=n(4),l=n(2);if("undefined"!=typeof WeakMap){var u=new WeakMap;r=function(e){return u.get(e)},o=function(e,t){return u.set(e,t),t}}else{var p=[],f=0;r=function(e){for(var t=0;tr&&(i+=l.attrs.colspan)}for(var u=0;u1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[],a=0,c=t*n;a=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-w});break}for(var x=o+w*t,S=0;S0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function S(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function k(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:x(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var s=o.type.spec.tableRole;if("cell"==s||"header_cell"==s)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function C(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function _(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function O(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function M(e){return h.get(e.node(-1)).findCell(e.pos-e.start(-1))}function A(e){return h.get(e.node(-1)).colCount(e.pos-e.start(-1))}function N(e,t,n){var r=e.start(-1),o=h.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function T(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function $(e,t,n){void 0===n&&(n=1);var r=T(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((function(e){return e>0}))||(r.colwidth=null)),r}function E(e,t,n){void 0===n&&(n=1);var r=T(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o0||m>0){var g=d.attrs;v>0&&(g=$(g,0,v)),m>0&&(g=$(g,g.colspan-m,m)),d=f.leftr.bottom){var y=T(d.attrs,"rowspan",Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top));d=f.top0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.top<=s.top?(i.top>0&&(e=a.resolve(o+r.map[i.left])),s.bottom0&&(n=a.resolve(o+r.map[s.left])),i.bottom0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),s=r.findCell(n.pos-o),a=e.node(0);return i.left<=s.left?(i.left>0&&(e=a.resolve(o+r.map[i.top*r.width])),s.right0&&(n=a.resolve(o+r.map[s.top*r.width])),i.right0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,c=[];if("row"==i)for(var l=0;l=0;i--)for(var a=o.child(i).attrs,c=a.rowspan,l=a.colspan,u=r;u=t.length&&t.push(s.Fragment.empty),n[d]t&&(h=h.type.create($(h.attrs,h.attrs.colspan,f+h.attrs.colspan-t),h.content)),p.push(h),f+=h.attrs.colspan;for(var v=1;vn&&(S=S.type.create(T(S.attrs,"rowspan",Math.max(1,n-S.attrs.rowspan)),S.content)),b.push(S)}m.push(s.Fragment.from(b))}i=m,o=n}return{width:r,height:o,rows:i}}function B(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;for(var c=!1,l=o;lt.width)for(var p=0,f=0;pt.height){for(var g=[],y=0,w=(t.height-1)*t.width;y=t.width)&&n.nodeAt(t.map[w+y]).type==u.header_cell;g.push(x?l||(l=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}for(var S=u.row.create(null,s.Fragment.from(g)),k=[],C=t.height;C=0;o--){var s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if("cell"==s.type.spec.tableRole||"header_cell"==s.type.spec.tableRole){var a=r.before(o),c="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?a:null}}return null}function Y(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Q(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?x(e.state.doc.resolve(n.pos)):null}var ee=new i.PluginKey("fix-tables");function te(e,t){var n,r=function(t,r){"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){var o=h.get(t);if(!o.problems)return r;r||(r=e.tr);for(var i,s,a=[],c=0;c0){var k="cell";w.firstChild&&(k=w.firstChild.type.spec.tableRole);for(var C=[],_=0;_0?-1:0;D(r,i,n+s)&&(s=0==n||n==r.width?null:0);for(var a=0;a0&&n0&&r.map[c-1]==l||n0?-1:0;ce(r,i,n+l)&&(l=0==n||n==r.height?null:0);for(var u=0,p=r.width*n;u0&&n0&&f==r.map[p-r.width]){var d=o.nodeAt(f).attrs;e.setNodeMarkup(e.mapping.slice(l).map(f+i),null,T(d,"rowspan",d.rowspan-1)),u+=d.colspan-1}else if(n0&&o[s]==o[s-1]||t.right0&&o[i]==o[i-n]||t.bottom0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;o=x(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(n){var s=r.attrs,a=[],c=s.colwidth;s.rowspan>1&&(s=T(s,"rowspan",1)),s.colspan>1&&(s=T(s,"colspan",1));for(var l,u=ne(t),p=t.tr,f=0;f=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()0;r--){if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}var Oe=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Me(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function Me(e,t,n,r,o,i){for(var s=0,a=!0,c=t.firstChild,l=e.firstChild,u=0,p=0;u-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,r,o){var i=Ae.getState(e.state);if(!i.dragging){var s=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),a=-1;if(s){var c=s.getBoundingClientRect(),l=c.left,u=c.right;t.clientX-l<=n?a=$e(e,t,"left"):u-t.clientX<=n&&(a=$e(e,t,"right"))}if(a!=i.activeHandle){if(!o&&-1!==a){var p=e.state.doc.resolve(a),f=p.node(-1),d=h.get(f),v=p.start(-1);if(d.colCount(p.pos-v)+p.nodeAfter.attrs.colspan-1==d.width-1)return}De(e,a)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=Ae.getState(e.state);t.activeHandle>-1&&!t.dragging&&De(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var r=Ae.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var s=e.domAtPos(t),a=s.node.childNodes[s.offset].offsetWidth,c=r;if(o)for(var l=0;l-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),i=h.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan,l=0;l=0&&!(t.after(i+1)=0&&!(n.before(s+1)>n.start(s));s--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(s)?r=i.TextSelection.create(a,s.from):s instanceof i.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var s=r.node(i);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){t=s;break}}for(var a=o.depth;a>0;a--){var c=o.node(a);if("cell"===c.type.spec.tableRole||"header_cell"===c.type.spec.tableRole){n=c;break}}return t!==n&&0===o.parentOffset}(s)&&(r=i.TextSelection.create(a,s.$from.start(),s.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,te(r,n),t)}})}Te.prototype.apply=function(e){var t=this,n=e.getMeta(Ae);if(n&&null!=n.setHandle)return new Te(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Te(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var r=e.mapping.map(t.activeHandle,-1);C(e.doc.resolve(r))||(r=null),t=new Te(r,t.dragging)}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return xt})),n.d(t,"b",(function(){return _t})),n.d(t,"c",(function(){return Pt}));var r=n(1),o=n(0),i=n(2),s={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var a=/Edge\/(\d+)/.exec(navigator.userAgent),c=/MSIE \d/.test(navigator.userAgent),l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);s.mac=/Mac/.test(navigator.platform);var u=s.ie=!!(c||l||a);s.ie_version=c?document.documentMode||6:l?+l[1]:a?+a[1]:null,s.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),s.gecko_version=s.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var p=!u&&/Chrome\/(\d+)/.exec(navigator.userAgent);s.chrome=!!p,s.chrome_version=p&&+p[1],s.ios=!u&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),s.android=/Android \d/.test(navigator.userAgent),s.webkit="webkitFontSmoothing"in document.documentElement.style,s.safari=/Apple Computer/.test(navigator.vendor),s.webkit_version=s.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var f=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},d=function(e){var t=e.parentNode;return t&&11==t.nodeType?t.host:t},h=function(e,t,n){var r=document.createRange();return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},v=function(e,t,n,r){return n&&(g(e,t,n,r,-1)||g(e,t,n,r,1))},m=/^(img|br|input|textarea|hr)$/i;function g(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:y(e))){var i=e.parentNode;if(1!=i.nodeType||b(e)||m.test(e.nodeName)||"false"==e.contentEditable)return!1;t=f(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?y(e):0}}}function y(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function b(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var w=function(e){var t=e.isCollapsed;return t&&s.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function x(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function S(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function k(e,t){return"number"==typeof e?e:e[t]}function C(e){var t=e.getBoundingClientRect();return{left:t.left,right:t.left+e.clientWidth,top:t.top,bottom:t.top+e.clientHeight}}function _(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=n||e.dom;s;s=d(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?S(i):C(s),l=0,u=0;if(t.topc.bottom-k(r,"bottom")&&(u=t.bottom-c.bottom+k(o,"bottom")),t.leftc.right-k(r,"right")&&(l=t.right-c.right+k(o,"right")),l||u)if(a)i.defaultView.scrollBy(l,u);else{var p=s.scrollLeft,f=s.scrollTop;u&&(s.scrollTop+=u),l&&(s.scrollLeft+=l);var h=s.scrollLeft-p,v=s.scrollTop-f;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(a)break}}function O(e){for(var t=[],n=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=n);e=d(e));return t}function M(e,t){for(var n=0;n=a){s=Math.max(f.bottom,s),a=Math.min(f.top,a);var d=f.left>t.left?f.left-t.left:f.right=(f.left+f.right)/2?1:0));continue}}!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(i=l+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:N(n,r)}function T(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function $(e,t){var n,r,o,i,a=e.root;if(a.caretPositionFromPoint)try{var c=a.caretPositionFromPoint(t.left,t.top);c&&(o=(n=c).offsetNode,i=n.offset)}catch(e){}if(!o&&a.caretRangeFromPoint){var l=a.caretRangeFromPoint(t.left,t.top);l&&(o=(r=l).startContainer,i=r.startOffset)}var u,p=a.elementFromPoint(t.left,t.top+1);if(!p||!e.dom.contains(1!=p.nodeType?p.parentNode:p)){var f=e.dom.getBoundingClientRect();if(!T(t,f))return null;if(!(p=function e(t,n,r){var o=t.childNodes.length;if(o&&r.topt.top&&i++}o==e.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&t.top>o.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(u=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right-1?o:e.docView.posFromDOM(t,n)}(e,o,i,t))}null==u&&(u=function(e,t,n){var r=N(t,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}(e,p,t));var v=e.docView.nearestDesc(p,!0);return{pos:u,inside:v?v.posAtStart-v.border:-1}}function E(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}function D(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset;if(3==r.nodeType&&(s.webkit||s.gecko)){var i=E(h(r,o,o),0);if(s.gecko&&o&&/\s/.test(r.nodeValue[o-1])&&o0&&ol.top&&("up"==n?l.bottomi.bottom-1))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return P.test(r.parent.textContent)&&a.modify?I(e,t,(function(){var t=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(e,t,n))}var L=function(e,t,n,r){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},V={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0}};L.prototype.matchesWidget=function(){return!1},L.prototype.matchesMark=function(){return!1},L.prototype.matchesNode=function(){return!1},L.prototype.matchesHack=function(){return!1},V.beforePosition.get=function(){return!1},L.prototype.parseRule=function(){return null},L.prototype.stopEvent=function(){return!1},V.size.get=function(){for(var e=0,t=0;t0:a)?this.posAtEnd:this.posAtStart},L.prototype.nearestDesc=function(e,t){for(var n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==e.nodeType?e:e.parentNode):o.nodeDOM==e))return o;n=!1}}},L.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},L.prototype.posFromDOM=function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1},L.prototype.descAt=function(e){for(var t=0,n=0;t=l&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,l);e=i;for(var u=s;u>0;u--){var p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=f(p.dom)+1;break}e-=p.size}-1==r&&(r=0)}if(r>-1&&(c>t||s==this.children.length-1)){t=c;for(var d=s+1;da&&it){var h=u;u=p,p=h}var m=document.createRange();m.setEnd(p.node,p.offset),m.setStart(u.node,u.offset),f.removeAllRanges(),f.addRange(m)}}},L.prototype.ignoreMutation=function(e){return!this.contentDOM&&"selection"!=e.type},V.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},L.prototype.markDirty=function(e,t){for(var n=0,r=0;r=n:en){var s=n+o.border,a=i-o.border;if(e>=s&&t<=a)return this.dirty=e==n||t==i?2:1,void(e!=s||t!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-s,t-s):o.dirty=3);o.dirty=3}n=i}this.dirty=2},L.prototype.markParentsDirty=function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty0&&(i=ce(i,0,e,r));for(var a=0;ai;)l.push(o[c++]);var y=i+v.nodeSize;if(v.isText){var b=y;c=0&&!a&&c.syncToMarks(s==n.node.childCount?o.Mark.none:n.node.child(s).marks,r,e),c.placeWidget(t,e,i)}),(function(t,n,o,s){c.syncToMarks(t.marks,r,e),c.findNodeMatch(t,n,o,s)||c.updateNextNode(t,n,o,e,s)||c.addNode(t,n,o,e,i),i+=t.nodeSize})),c.syncToMarks(H,r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),function e(t,n,r){for(var o=t.firstChild,i=!1,s=0;st+this.node.content.size)){var s=e.root.getSelection(),a=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];e=e.childNodes[t-1],t=y(e)}else{if(!(1==e.nodeType&&t=n){var u=c.lastIndexOf(t,r-a);if(u>=0&&u+t.length+a>=n)return a+u}}}return-1}(this.node.content,c,o-t,i-t);return l<0?null:{node:a,pos:l,text:c}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,r=t.pos,o=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=null)}var s=new U(this,i,n,o);e.compositionNodes.push(s),this.children=ce(this.children,r,r+o.length,e,s)}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)},t.prototype.updateInner=function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!oe(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=te(this.dom,this.nodeDOM,ee(this.outerDeco,this.node,t),ee(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},Object.defineProperties(t.prototype,n),t}(L);function q(e,t,n,r,o){return re(r,t,e),new K(null,e,t,n,r,r,r,o,0)}var G=function(e){function t(t,n,r,o,i,s,a){e.call(this,t,n,r,o,i,null,s,a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}},t.prototype.update=function(e,t,n,r){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,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,r)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type&&"selection"!=e.type},t.prototype.slice=function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},t}(K),X=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(){return 0==this.dirty},t}(L),Z=function(e){function t(t,n,r,o,i,s,a,c,l,u){e.call(this,t,n,r,o,i,s,a,l,u),this.spec=c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(t,n);return i&&this.updateInner(t,n,r,o),i}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,r,o)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):e.prototype.setSelection.call(this,t,n,r,o)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(K);function Y(e){e&&(this.nodeName=e)}Y.prototype=Object.create(null);var Q=[new Y];function ee(e,t,n){if(0==e.length)return Q;for(var r=n?Q[0]:new Y,o=[r],i=0;i0&&o>=0;o--){var i=t[o],s=i.node;if(s){if(s!=e.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(e.node.content,e.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function ae(e,t){return e.type.side-t.type.side}function ce(e,t,n,r,o){for(var i=[],s=0,a=0;s=n||u<=t?i.push(c):(ln&&i.push(c.slice(n-l,c.size,r)))}return i}function le(e,t){var n=e.selection,o=n.$anchor,i=n.$head,s=t>0?o.max(i):o.min(i),a=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return a&&r.Selection.findFrom(a,t)}function ue(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function pe(e,t,n){var o=e.state.selection;if(!(o instanceof r.TextSelection)){if(o instanceof r.NodeSelection&&o.node.isInline)return ue(e,new r.TextSelection(t>0?o.$to:o.$from));var i=le(e.state,t);return!!i&&ue(e,i)}if(!o.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var a=le(e.state,t);return!!(a&&a instanceof r.NodeSelection)&&ue(e,a)}if(!(s.mac&&n.indexOf("m")>-1)){var c,l=o.$head,u=l.textOffset?null:t<0?l.nodeBefore:l.nodeAfter;if(!u||u.isText)return!1;var p=t<0?l.pos-u.nodeSize:l.pos;return!!(u.isAtom||(c=e.docView.descAt(p))&&!c.contentDOM)&&(r.NodeSelection.isSelectable(u)?ue(e,new r.NodeSelection(t<0?e.state.doc.resolve(l.pos-u.nodeSize):l)):!!s.webkit&&ue(e,new r.TextSelection(e.state.doc.resolve(t<0?p:p+u.nodeSize))))}}function fe(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function de(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function he(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(s.gecko&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var c=n.childNodes[r-1];if(de(c))o=n,i=--r;else{if(3!=c.nodeType)break;r=(n=c).nodeValue.length}}else{if(me(n))break;for(var l=n.previousSibling;l&&de(l);)o=n.parentNode,i=f(l),l=l.previousSibling;if(l)r=fe(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?ge(e,t,n,r):o&&ge(e,t,o,i)}}function ve(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,s=fe(n);;)if(r-1)return!1;if(s.mac&&n.indexOf("m")>-1)return!1;var i=o.$from,a=o.$to;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var c=le(e.state,t);if(c&&c instanceof r.NodeSelection)return ue(e,c)}if(!i.parent.inlineContent){var l=r.Selection.findFrom(t<0?i:a,t);return!l||ue(e,l)}return!1}function be(e,t){if(!(e.state.selection instanceof r.TextSelection))return!0;var n=e.state.selection,o=n.$head,i=n.$anchor,s=n.empty;if(!o.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!o.textOffset&&(t<0?o.nodeBefore:o.nodeAfter);if(a&&!a.isText){var c=e.state.tr;return t<0?c.delete(o.pos-a.nodeSize,o.pos):c.delete(o.pos,o.pos+a.nodeSize),e.dispatch(c),!0}return!1}function we(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function xe(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||s.mac&&72==n&&"c"==r?be(e,-1)||he(e):46==n||s.mac&&68==n&&"c"==r?be(e,1)||ve(e):13==n||27==n||(37==n?pe(e,-1,r)||he(e):39==n?pe(e,1,r)||ve(e):38==n?ye(e,-1,r)||he(e):40==n?function(e){if(s.chrome&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;we(e,o,!0),setTimeout((function(){return we(e,o,!1)}),20)}}}(e)||ye(e,1,r)||ve(e):r==(s.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function Se(e,t){var n=e.root.getSelection(),o=e.state.doc;if(!n.focusNode)return null;var i=e.docView.nearestDesc(n.focusNode),s=i&&0==i.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var c,l,u=o.resolve(a);if(w(n)){for(c=u;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&r.NodeSelection.isSelectable(i.node)&&i.parent&&(!i.node.isInline||!function(e,t,n){for(var r=0==t,o=t==y(e);r||o;){if(e==n)return!0;var i=f(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==y(e)}}(n.focusNode,n.focusOffset,i.dom))){var p=i.posBefore;l=new r.NodeSelection(a==p?u:o.resolve(p))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;c=o.resolve(d)}l||(l=Te(e,c,u,"pointer"==t||e.state.selection.head=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},se.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(o,e.length);r-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=W.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},se.prototype.findNodeMatch=function(e,t,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),s=this.top.children;if(i&&i.matchesNode(e,t,n))o=s.indexOf(i);else for(var a=this.index,c=Math.min(s.length,a+5);a-1&&a+this.preMatchOffset!=o)return!1;var c=s.dom;if(!(this.lock&&(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&oe(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,i),s.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},se.prototype.addNode=function(e,t,n,r,o){this.top.children.splice(this.index++,0,K.create(this.top,e,t,n,r,o)),this.changed=!0},se.prototype.placeWidget=function(e,t,n){var r=this.indexDate.now()-50?e.lastSelectionOrigin:null,l=Se(e,c);if(l&&!e.state.selection.eq(l)){var u=e.state.tr.setSelection(l);"pointer"==c?u.setMeta("pointer",!0):"key"==c&&u.scrollIntoView(),e.dispatch(u)}}else{var p=e.state.doc.resolve(t),f=p.sharedDepth(n);t=p.before(f+1),n=e.state.doc.resolve(n).after(f+1);var d,h,v=e.state.selection,m=function(e,t,n){var r=e.docView.parseRange(t,n),i=r.node,a=r.fromOffset,c=r.toOffset,l=r.from,u=r.to,p=e.root.getSelection(),f=null,d=p.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(f=[{node:d,offset:p.anchorOffset}],w(p)||f.push({node:p.focusNode,offset:p.focusOffset})),s.chrome&&8===e.lastKeyCode)for(var h=c;h>a;h--){var v=i.childNodes[h-1],m=v.pmViewDesc;if("BR"==v.nodeType&&!m){c=h;break}if(!m||m.size)break}var g=e.state.doc,y=e.someProp("domParser")||o.DOMParser.fromSchema(e.state.schema),b=g.resolve(l),x=null,S=y.parse(i,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:a,to:c,preserveWhitespace:!b.parent.type.spec.code||"full",editableContent:!0,findPositions:f,ruleFromNode:Ee,context:b});if(f&&null!=f[0].pos){var k=f[0].pos,C=f[1]&&f[1].pos;null==C&&(C=k),x={anchor:k+l,head:C+l}}return{doc:S,sel:x,from:l,to:u}}(e,t,n),g=e.state.doc,y=g.slice(m.from,m.to);8===e.lastKeyCode&&Date.now()-100=a?i-r:0)+(c-a),a=i}else if(c=c?i-r:0)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,m.doc.content,m.from,d,h);if(!b){if(!(i&&v instanceof r.TextSelection&&!v.empty&&v.$head.sameParent(v.$anchor))||e.composing||m.sel&&m.sel.anchor!=m.sel.head){if(m.sel){var S=Re(e,e.state.doc,m.sel);S&&!S.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(S))}return}b={start:v.from,endA:v.to,endB:v.to}}e.domChangeCount++,e.state.selection.frome.state.selection.from&&b.start<=e.state.selection.from+2?b.start=e.state.selection.from:b.endA=e.state.selection.to-2&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),s.ie&&s.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>m.from&&"  "==m.doc.textBetween(b.start-m.from-1,b.start-m.from+1)&&(b.start--,b.endA--,b.endB--);var k,C=m.doc.resolveNoCache(b.start-m.from),_=m.doc.resolveNoCache(b.endB-m.from),O=C.sameParent(_)&&C.parent.inlineContent;if((s.ios&&e.lastIOSEnter>Date.now()-225&&(!O||a.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!O&&C.posb.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||Ie(r,!0,!1)n||Ie(s,!0,!1)t.content.size?null:Te(e,t.resolve(n.anchor),t.resolve(n.head))}function Ie(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Pe(e,t){for(var n=[],r=t.content,i=t.openStart,s=t.openEnd;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;var a=r.firstChild;n.push(a.type.name,a.type.hasRequiredAttrs()?a.attrs:null),r=a.content}var c=e.someProp("clipboardSerializer")||o.DOMSerializer.fromSchema(e.state.schema),l=Ve(),u=l.createElement("div");u.appendChild(c.serializeFragment(r,{document:l}));for(var p,f=u.firstChild;f&&1==f.nodeType&&(p=Be[f.nodeName.toLowerCase()]);){for(var d=p.length-1;d>=0;d--){for(var h=l.createElement(p[d]);u.firstChild;)h.appendChild(u.firstChild);u.appendChild(h)}f=u.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice",i+" "+s+" "+JSON.stringify(n)),{dom:u,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function Fe(e,t,n,r,i){var s,a,c=i.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||c||!n);if(l){if(e.someProp("transformPastedText",(function(e){t=e(t,c||r)})),c)return new o.Slice(o.Fragment.from(e.state.schema.text(t)),0,0);var u=e.someProp("clipboardTextParser",(function(e){return e(t,i,r)}));u?a=u:(s=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach((function(e){s.appendChild(document.createElement("p")).textContent=e})))}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),s=function(e){var t=/(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Ve().createElement("div"),o=/(?:]*>)*<([a-z][^>\s]+)/i.exec(e),i=0;(n=o&&Be[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return""})).reverse().join(""),i=n.length);r.innerHTML=e;for(var s=0;s=0;c-=2){var l=r.nodes[n[c]];if(!l||l.hasRequiredAttrs())break;i=o.Fragment.from(l.create(n[c+1],i)),s++,a++}return new o.Slice(i,s,a)}(function(e,t,n){t=0;r--){var i=n(r);if(i)return i.v}return e}(a.content,i),!1),e.someProp("transformPasted",(function(e){a=e(a)})),a}function je(e,t,n){void 0===n&&(n=0);for(var r=t.length-1;r>=n;r--)e=t[r].create(null,o.Fragment.from(e));return e}function ze(e,t,n,r,i,s){var a=t<0?e.firstChild:e.lastChild,c=a.content;return i=n&&(c=t<0?a.contentMatchAt(0).fillBefore(c,e.childCount>1||s<=i).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(o.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(c))}var Be={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Le=null;function Ve(){return Le||(Le=document.implementation.createHTMLDocument("title"))}var He={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Je=s.ie&&s.ie_version<=11,Ue=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Ue.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},Ue.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var We=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;te.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new Ue,Je&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};We.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))},We.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},We.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,He),Je&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},We.prototype.stop=function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&$e(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var c=0;c1){var u=a.filter((function(e){return"BR"==e.nodeName}));if(2==u.length){var p=u[0],f=u[1];p.parentNode&&p.parentNode.parentNode==f.parentNode?f.remove():p.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(Ke)return;Ke=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&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.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ke(this.view))}},We.prototype.registerMutation=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")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){var r=e.previousSibling,o=e.nextSibling;if(s.ie&&s.ie_version<=11&&e.addedNodes.length)for(var i=0;ii.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function tt(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function nt(e,t,n,o,i){return et(e,"handleClickOn",t,n,o)||e.someProp("handleClick",(function(n){return n(e,t,o)}))||(i?function(e,t){if(-1==t)return!1;var n,o,i=e.state.selection;i instanceof r.NodeSelection&&(n=i.node);for(var s=e.state.doc.resolve(t),a=s.depth+1;a>0;a--){var c=a>s.depth?s.nodeAfter:s.node(a);if(r.NodeSelection.isSelectable(c)){o=n&&i.$from.depth>0&&a>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(a);break}}return null!=o&&(tt(e,r.NodeSelection.create(e.state.doc,o),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),o=n.nodeAfter;return!!(o&&o.isAtom&&r.NodeSelection.isSelectable(o))&&(tt(e,new r.NodeSelection(n),"pointer"),!0)}(e,n))}function rt(e,t,n,r){return et(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function ot(e,t,n,o){return et(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",(function(n){return n(e,t,o)}))||function(e,t){var n=e.state.doc;if(-1==t)return!!n.inlineContent&&(tt(e,r.TextSelection.create(n,0,n.content.size),"pointer"),!0);for(var o=n.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)tt(e,r.TextSelection.create(n,a+1,a+1+s.content.size),"pointer");else{if(!r.NodeSelection.isSelectable(s))continue;tt(e,r.NodeSelection.create(n,a),"pointer")}return!0}}(e,n)}function it(e){return pt(e)}Ge.keydown=function(e,t){if(e.shiftKey=16==t.keyCode||t.shiftKey,!ct(e,t))if(e.domObserver.forceFlush(),e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),!s.ios||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",(function(n){return n(e,t)}))||xe(e,t)?t.preventDefault():Xe(e,"key");else{var n=Date.now();e.lastIOSEnter=n,e.lastIOSEnterFallbackTimeout=setTimeout((function(){e.lastIOSEnter==n&&(e.someProp("handleKeyDown",(function(t){return t(e,x(13,"Enter"))})),e.lastIOSEnter=0)}),200)}},Ge.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},Ge.keypress=function(e,t){if(!(ct(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||s.mac&&t.metaKey))if(e.someProp("handleKeyPress",(function(n){return n(e,t)})))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof r.TextSelection&&n.$from.sameParent(n.$to))){var o=String.fromCharCode(t.charCode);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 st=s.mac?"metaKey":"ctrlKey";qe.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=it(e),r=Date.now(),o="singleClick";r-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.lastClick)&&!t[st]&&("singleClick"==e.lastClick.type?o="doubleClick":"doubleClick"==e.lastClick.type&&(o="tripleClick")),e.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(Qe(t));i&&("singleClick"==o?e.mouseDown=new at(e,i,t,n):("doubleClick"==o?rt:ot)(e,i.pos,i.inside,t)?t.preventDefault():Xe(e,"pointer"))};var at=function(e,t,n,o){var i,a,c=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=o,this.selectNode=n[st],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{var l=e.state.doc.resolve(t.pos);i=l.parent,a=l.depth?l.before():0}this.mightDrag=null;var u=o?null:n.target,p=u?e.docView.nearestDesc(u,!0):null;this.target=p?p.dom:null,(i.type.spec.draggable&&!1!==i.type.spec.selectable||e.state.selection instanceof r.NodeSelection&&a==e.state.selection.from)&&(this.mightDrag={node:i,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&s.gecko&&!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(){return c.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Xe(e,"pointer")};function ct(e,t){return!!e.composing||!!(s.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}at.prototype.done=function(){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.view.mouseDown=null},at.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Qe(e))),this.allowDefault||!t?Xe(this.view,"pointer"):nt(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():this.flushed||s.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||s.chrome&&!(this.view.state.selection instanceof r.TextSelection)&&(t.pos==this.view.state.selection.from||t.pos==this.view.state.selection.to)?(tt(this.view,r.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Xe(this.view,"pointer")}},at.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Xe(this.view,"pointer")},qe.touchdown=function(e){it(e),Xe(e,"pointer")},qe.contextmenu=function(e){return it(e)};var lt=s.android?5e3:-1;function ut(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout((function(){return pt(e)}),t))}function pt(e,t){for(e.domObserver.forceFlush(),e.composing=!1;e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty();if(t||e.docView.dirty){var n=Se(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}Ge.compositionstart=Ge.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(),pt(e,!0),e.markCursor=null;else if(pt(e),s.gecko&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.composing=!0}ut(e,lt)},Ge.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,ut(e,20))};var ft=s.ie&&s.ie_version<15||s.ios&&s.webkit_version<604;function dt(e,t,n,r){var i=Fe(e,t,n,e.shiftKey,e.state.selection.$from);if(!e.someProp("handlePaste",(function(t){return t(e,r,i||o.Slice.empty)}))&&i){var s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),a=s?e.state.tr.replaceSelectionWith(s,e.shiftKey):e.state.tr.replaceSelection(i);e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"))}}qe.copy=Ge.cut=function(e,t){var n=e.state.selection,r="cut"==t.type;if(!n.empty){var o=ft?null:t.clipboardData,i=Pe(e,n.content()),s=i.dom,a=i.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.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 r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Ge.paste=function(e,t){var n=ft?null:t.clipboardData,r=n&&n.getData("text/html"),o=n&&n.getData("text/plain");n&&(r||o||n.files.length)?(dt(e,o,r,t),t.preventDefault()):function(e,t){if(e.dom.parentNode){var n=e.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?dt(e,r.value,null,t):dt(e,r.textContent,r.innerHTML,t)}),50)}}(e,t)};var ht=function(e,t){this.slice=e,this.move=t},vt=s.mac?"altKey":"ctrlKey";for(var mt in qe.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(Qe(t));if(i&&i.pos>=o.from&&i.pos<=(o instanceof r.NodeSelection?o.to-1:o.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var s=e.docView.nearestDesc(t.target,!0);if(!s||!s.node.type.spec.draggable||s==e.docView)return;e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,s.posBefore)))}var a=e.state.selection.content(),c=Pe(e,a),l=c.dom,u=c.text;t.dataTransfer.clearData(),t.dataTransfer.setData(ft?"Text":"text/html",l.innerHTML),ft||t.dataTransfer.setData("text/plain",u),e.dragging=new ht(a,!t[vt])}},qe.dragend=function(e){window.setTimeout((function(){return e.dragging=null}),50)},Ge.dragover=Ge.dragenter=function(e,t){return t.preventDefault()},Ge.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var s=e.posAtCoords(Qe(t));if(s){var a=e.state.doc.resolve(s.pos);if(a){var c=n&&n.slice||Fe(e,t.dataTransfer.getData(ft?"Text":"text/plain"),ft?null:t.dataTransfer.getData("text/html"),!1,a);if(e.someProp("handleDrop",(function(r){return r(e,t,c||o.Slice.empty,n&&n.move)})))t.preventDefault();else if(c){t.preventDefault();var l=c?Object(i.h)(e.state.doc,a.pos,c):a.pos;null==l&&(l=a.pos);var u=e.state.tr;n&&n.move&&u.deleteSelection();var p=u.mapping.map(l),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,d=u.doc;if(f?u.replaceRangeWith(p,p,c.content.firstChild):u.replaceRange(p,p,c),!u.doc.eq(d)){var h=u.doc.resolve(p);f&&r.NodeSelection.isSelectable(c.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(c.content.firstChild)?u.setSelection(new r.NodeSelection(h)):u.setSelection(Te(e,h,u.doc.resolve(u.mapping.map(l)))),e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}}}}}},qe.focus=function(e){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.root.getSelection())&&ke(e)}),20))},qe.blur=function(e){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),e.domObserver.currentSelection.set({}),e.focused=!1)},qe.beforeinput=function(e,t){if(s.chrome&&s.android&&"deleteContentBackward"==t.inputType){var n=e.domChangeCount;setTimeout((function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,x(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)}},Ge)qe[mt]=Ge[mt];function gt(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var yt=function(e,t){this.spec=t||Ct,this.side=this.spec.side||0,this.toDOM=e};yt.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new xt(i-n,i-n,this)},yt.prototype.valid=function(){return!0},yt.prototype.eq=function(e){return this==e||e instanceof yt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&>(this.spec,e.spec))};var bt=function(e,t){this.spec=t||Ct,this.attrs=e};bt.prototype.map=function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new xt(o,i,this)},bt.prototype.valid=function(e,t){return t.from=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;ae){var c=this.children[a]+1;this.children[a+2].findInner(e-c,t-c,n,r+c,o)}},_t.prototype.map=function(e,t,n){return this==Ot||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Ct)},_t.prototype.mapInner=function(e,t,n,r,o){for(var i,s=0;sc+i||(t>=a[s]+i?a[s+1]=-1:n>=o&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l))}},l=0;l=r.content.size){u=!0;continue}var h=n.map(e[p+1]+i,-1)-o,v=r.content.findIndex(d),m=v.index,g=v.offset,y=r.maybeChild(m);if(y&&g==d&&g+y.nodeSize==h){var b=a[p+2].mapInner(n,y,f+1,a[p]+i+1,s);b!=Ot?(a[p]=d,a[p+1]=h,a[p+2]=b):(a[p+1]=-2,u=!0)}else u=!0}if(u){var w=$t(function(e,t,n,r,o,i,s){function a(e,t){for(var i=0;is&&l.to=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,s=i+t.content.size,a=0;ai&&c.type instanceof bt){var l=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;ln&&s.to0;)t++;e.splice(t,0,n)}function It(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=Ot&&t.push(r)})),e.cursorWrapper&&t.push(_t.create(e.state.doc,[e.cursorWrapper.deco])),Mt.from(t)}Mt.prototype.forChild=function(e,t){if(t.isLeaf)return _t.empty;for(var n=[],r=0;ro.scrollToSelection?"to selection":"preserve",k=i||!this.docView.matchesNode(e.doc,x,w),C=k||!e.selection.eq(o.selection),A="preserve"==S&&C&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s=o-20){t=a,n=c.top;break}}}return{refDOM:t,refTop:n,stack:O(e.dom)}}(this);if(C){this.domObserver.stop();var N=k&&(s.ie||s.chrome)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(p=o.selection,f=e.selection,d=Math.min(p.$anchor.sharedDepth(p.head),f.$anchor.sharedDepth(f.head)),p.$anchor.start(d)!=f.$anchor.start(d));if(k){var T=s.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!i&&this.docView.update(e.doc,x,w,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=q(e.doc,x,w,this.dom,this)),T&&!this.trackWrites&&(N=!0)}N||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(c=this,l=c.docView.domFromPos(c.state.selection.anchor),u=c.root.getSelection(),v(l.node,l.offset,u.anchorNode,u.anchorOffset)))?ke(this,N):(Ae(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),"reset"==S)this.dom.scrollTop=0;else if("to selection"==S){var $=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(e){return e(n)}))||(e.selection instanceof r.NodeSelection?_(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),$):_(this,this.coordsAtPos(e.selection.head),$))}else A&&(m=(h=A).refDOM,g=h.refTop,y=h.stack,b=m?m.getBoundingClientRect().top:0,M(y,0==b?0:b-g))},Pt.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},Pt.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins)for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var o=r.Selection.findFrom(n.doc.resolve(e),t,!0);return o?n.setSelection(o):n}},l=function(e){return e.type&&e.type.spec.selectable},u=function(e,t,n){return function(e){return l(e)&&e.type.isLeaf}(e)?n.setSelection(new r.NodeSelection(n.doc.resolve(t))):c(t)(n)},p=function(e,t,n){return function(r){var o="number"==typeof t,i=r.selection.$from,c=o?r.doc.resolve(t):f(r.selection)?r.doc.resolve(i.pos+1):i,p=c.parent;if(f(r.selection)&&n&&r!==(r=a(e)(r)))return r;if(w(p)&&r!==(r=s(p.type,e)(r))){var d=l(e)?c.before(c.depth):c.pos;return u(e,d,r)}if(b(c,e)){r.insert(c.pos,e);var v=o?c.pos:l(e)?r.selection.$anchor.pos-1:r.selection.$anchor.pos;return h(u(e,v,r))}for(var m=c.depth;m>0;m--){var g=c.after(m),y=r.doc.resolve(g);if(b(y,e))return r.insert(g,e),h(u(e,g,r))}return r}},f=function(e){return e instanceof r.NodeSelection},d=function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e},h=function(e){return Object.assign(Object.create(e),e).setTime(Date.now())},v=function(e,t){return function(n){var r=n.doc.nodeAt(e),o=n.doc.resolve(e);if(m(o,t)){var i=(n=n.replaceWith(e,e+r.nodeSize,t)).selection.$from.pos-1;return n=c(Math.max(i,0),-1)(n),n=c(n.selection.$from.start())(n),h(n)}return n}},m=function(e,t){var n=e.node(e.depth);return n&&n.type.validContent(t instanceof o.Fragment?t:o.Fragment.from(t))},g=function(e){return function(t){var n=t.doc.nodeAt(e);return h(t.delete(e,e+n.nodeSize))}},y=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;var t={};return Object.keys(e.nodes).forEach((function(n){var r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)})),e.cached.tableNodeTypes=t,t},b=function(e,t){var n=e.index();return t instanceof o.Fragment?e.parent.canReplace(n,n,t):t instanceof o.Node&&e.parent.canReplaceWith(n,n,t.type)},w=function(e){return!e||"paragraph"===e.type.name&&2===e.nodeSize},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t?e.createChecked(null,t):e.createAndFill()},S=function(e){return function(t){for(var n=i.TableMap.get(t.$anchorCell.node(-1)),r=t.$anchorCell.start(-1),o=n.cellsInRect(e),s=n.cellsInRect(n.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r)),a=0,c=o.length;an[0]?-1:1,i=e.splice(t[0],t.length),s=i.length%2==0?1:0,a=void 0;return a=-1===r&&1===o?n[0]-1:1===r&&-1===o?n[n.length-1]-s+1:-1===o?n[0]:n[n.length-1]-s,e.splice.apply(e,[a,0].concat(i)),e},M=function(e,t,n,r){var o="Target position is invalid, you can't move the "+r+" "+e+" to "+t+", the target can't be split. You could use tryToFit option.";if(1===(e>t?-1:1)){if(-1!==n.slice(0,n.length-1).indexOf(t))throw new Error(o)}else if(-1!==n.slice(1).indexOf(t))throw new Error(o);return!0},A=function(e){return function(t){var n=t.$from;return N(n,e)}},N=function(e,t){for(var n=e.depth;n>0;n--){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}},T=function(e,t){return function(n){var r=A(e)(n);if(r)return R(r.pos,t)}},$=function(e){return function(t){return!!A(e)(t)}},E=function(e){return function(t){return A((function(t){return d(e,t)}))(t)}},D=function(e){var t=e.$from.nodeBefore,n=r.Selection.findFrom(e.$from,-1);if(n&&t){var o=E(t.type)(n);return o?o.pos:n.$from.pos}},R=function(e,t){var n=t(e),r=n.node.childNodes[n.offset];return n.node.nodeType===Node.TEXT_NODE?n.node.parentNode:r&&r.nodeType!==Node.TEXT_NODE?r:n.node},I=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');var n=[];return e.descendants((function(e,r){if(n.push({node:e,pos:r}),!t)return!1})),n},P=function(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return I(e,n).filter((function(e){return t(e.node)}))},F=function(e,t,n){return P(e,(function(e){return e.type===t}),n)};var j=function(e){return A((function(e){return e.type.spec.tableRole&&"table"===e.type.spec.tableRole}))(e)},z=function(e){return e instanceof i.CellSelection},B=function(e){if(z(e)){var t=i.TableMap.get(e.$anchorCell.node(-1));return S({left:0,right:t.width,top:0,bottom:t.height})(e)}return!1},L=function(e){return function(t){var n=j(t);if(n){var r=i.TableMap.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((function(e,t){if(t>=0&&t<=r.width-1){var o=r.cellsInRect({left:t,right:t+1,top:0,bottom:r.height});return e.concat(o.map((function(e){var t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}})))}}),[])}}},V=function(e){return function(t){var n=j(t);if(n){var r=i.TableMap.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((function(e,t){if(t>=0&&t<=r.height-1){var o=r.cellsInRect({left:0,right:r.width,top:t,bottom:t+1});return e.concat(o.map((function(e){var t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}})))}}),[])}}},H=function(e){return function(t,n){return function(r){var o=j(r.selection),s="row"===e;if(o){var a=i.TableMap.get(o.node);if(t>=0&&t<(s?a.height:a.width)){var c=s?0:t,l=s?t:0,u=s?a.width:t+1,p=s?t+1:a.height;if(n){var f=Z(r.selection.$from);if(!f)return r;var d=a.findCell(f.pos-o.start);s?(l=Math.min(l,d.top),p=Math.max(p,d.bottom)):(c=Math.min(c,d.left),u=Math.max(u,d.right))}var v=a.cellsInRect({left:c,top:l,right:s?u:c+1,bottom:s?l+1:p}),m=p-l==1?v:a.cellsInRect({left:s?c:u-1,top:s?p-1:l,right:u,bottom:p}),g=o.start+v[0],y=o.start+m[m.length-1],b=r.doc.resolve(g),w=r.doc.resolve(y);return h(r.setSelection(new i.CellSelection(w,b)))}}return r}}},J=H("column"),U=H("row"),W=function(e){return function(t){var n=j(t.selection);if(n){var r=i.TableMap.get(n.node);if(e>=0&&e<=r.height){for(var o=n.node,s=y(o.type.schema),a=n.start,c=0;c1&&n+o>e}))(t);d.push.apply(d,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=0;v--)h(v);d.length&&d.forEach((function(e){t=X(e,{rowspan:e.node.attrs.rowspan+1})(t)}))}return p(s.row.create(l.attrs,u),a)(t)}}return t}},K=function(e){return function(t){var n=j(t.selection);if(n){var r=i.TableMap.get(n.node);if(0===e&&1===r.width)return G(t);if(e>=0&&e<=r.width)return i.removeColumn(t,{map:r,tableStart:n.start,table:n.node},e),h(t)}return t}},q=function(e){return function(t){var n=j(t.selection);if(n){var r=i.TableMap.get(n.node);if(0===e&&1===r.height)return G(t);if(e>=0&&e<=r.height)return i.removeRow(t,{map:r,tableStart:n.start,table:n.node},e),h(t)}return t}},G=function(e){for(var t=e.selection.$from,n=t.depth;n>0;n--){if("table"===t.node(n).type.spec.tableRole)return h(e.delete(t.before(n),t.after(n)))}return e},X=function(e,t){return function(n){return e?(n.setNodeMarkup(e.pos,null,Object.assign({},e.node.attrs,t)),h(n)):n}},Z=function(e){return N(e,(function(e){return e.type.spec.tableRole&&/cell/i.test(e.type.spec.tableRole)}))},Y=function(e){var t=Z(e);if(t){var n=function(e){return N(e,(function(e){return e.type.spec.tableRole&&/table/i.test(e.type.spec.tableRole)}))}(e),r=i.TableMap.get(n.node),o=t.pos-n.start;return r.rectBetween(o,o)}},Q=function(e,t){return function(n){var r=[],o=V(e)(n.selection);if(o)for(var i=o.length-1;i>=0;i--)t(o[i],n)&&r.push(o[i]);return r}},ee=function(e){return function(t){for(var n=e,r=e,o=function(e){var o=L(e)(t.selection);o&&o.forEach((function(t){var o=t.node.attrs.colspan+e-1;o>=n&&(n=e),o>r&&(r=o)}))},i=e;i>=0;i--)o(i);var s=function(e){var n=L(e)(t.selection);n&&n.forEach((function(t){var n=t.node.attrs.colspan+e-1;t.node.attrs.colspan>1&&n>r&&(r=n)}))};for(i=e;i<=r;i++)s(i);var a=[];for(i=n;i<=r;i++){var c=L(i)(t.selection);c&&c.length&&a.push(i)}n=a[0],r=a[a.length-1];for(var l=L(n)(t.selection),u=V(0)(t.selection),p=t.doc.resolve(l[l.length-1].pos),f=void 0,d=r;d>=n;d--){var h=L(d)(t.selection);if(h&&h.length){for(var v=u.length-1;v>=0;v--)if(u[v].pos===h[0].pos){f=h[0];break}if(f)break}}return{$anchor:p,$head:t.doc.resolve(f.pos),indexes:a}}},te=function(e){return function(t){for(var n=e,r=e,o=function(e){V(e)(t.selection).forEach((function(t){var o=t.node.attrs.rowspan+e-1;o>=n&&(n=e),o>r&&(r=o)}))},i=e;i>=0;i--)o(i);var s=function(e){V(e)(t.selection).forEach((function(t){var n=t.node.attrs.rowspan+e-1;t.node.attrs.rowspan>1&&n>r&&(r=n)}))};for(i=e;i<=r;i++)s(i);var a=[];for(i=n;i<=r;i++){var c=V(i)(t.selection);c&&c.length&&a.push(i)}n=a[0],r=a[a.length-1];for(var l=V(n)(t.selection),u=L(0)(t.selection),p=t.doc.resolve(l[l.length-1].pos),f=void 0,d=r;d>=n;d--){var h=V(d)(t.selection);if(h&&h.length){for(var v=u.length-1;v>=0;v--)if(u[v].pos===h[0].pos){f=h[0];break}if(f)break}}return{$anchor:p,$head:t.doc.resolve(f.pos),indexes:a}}};t.isNodeSelection=f,t.canInsert=b,t.convertTableNodeToArrayOfRows=C,t.convertArrayOfRowsToTableNode=_,t.findParentNode=A,t.findParentNodeClosestToPos=N,t.findParentDomRef=T,t.hasParentNode=$,t.findParentNodeOfType=E,t.findParentNodeOfTypeClosestToPos=function(e,t){return N(e,(function(e){return d(t,e)}))},t.hasParentNodeOfType=function(e){return function(t){return $((function(t){return d(e,t)}))(t)}},t.findParentDomRefOfType=function(e,t){return function(n){return T((function(t){return d(e,t)}),t)(n)}},t.findSelectedNodeOfType=function(e){return function(t){if(f(t)){var n=t.node,r=t.$from;if(d(e,n))return{node:n,pos:r.pos,depth:r.depth}}}},t.findPositionOfNodeBefore=D,t.findDomRefAtPos=R,t.flatten=I,t.findChildren=P,t.findTextNodes=function(e,t){return P(e,(function(e){return e.isText}),t)},t.findInlineNodes=function(e,t){return P(e,(function(e){return e.isInline}),t)},t.findBlockNodes=function(e,t){return P(e,(function(e){return e.isBlock}),t)},t.findChildrenByAttr=function(e,t,n){return P(e,(function(e){return!!t(e.attrs)}),n)},t.findChildrenByType=F,t.findChildrenByMark=function(e,t,n){return P(e,(function(e){return t.isInSet(e.marks)}),n)},t.contains=function(e,t){return!!F(e,t).length},t.findTable=j,t.isCellSelection=z,t.getSelectionRect=function(e){if(z(e)){var t=e.$anchorCell.start(-1);return i.TableMap.get(e.$anchorCell.node(-1)).rectBetween(e.$anchorCell.pos-t,e.$headCell.pos-t)}},t.isColumnSelected=function(e){return function(t){if(z(t)){var n=i.TableMap.get(t.$anchorCell.node(-1));return S({left:e,right:e+1,top:0,bottom:n.height})(t)}return!1}},t.isRowSelected=function(e){return function(t){if(z(t)){var n=i.TableMap.get(t.$anchorCell.node(-1));return S({left:0,right:n.width,top:e,bottom:e+1})(t)}return!1}},t.isTableSelected=B,t.getCellsInColumn=L,t.getCellsInRow=V,t.getCellsInTable=function(e){var t=j(e);if(t){var n=i.TableMap.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map((function(e){var n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}}))}},t.selectColumn=J,t.selectRow=U,t.selectTable=function(e){var t=j(e.selection);if(t){var n=i.TableMap.get(t.node).map;if(n&&n.length){var r=t.start+n[0],o=t.start+n[n.length-1],s=e.doc.resolve(r),a=e.doc.resolve(o);return h(e.setSelection(new i.CellSelection(a,s)))}}return e},t.emptyCell=function(e,t){return function(n){if(e){var r=y(t).cell.createAndFill().content;if(!e.node.content.eq(r))return n.replaceWith(e.pos+1,e.pos+e.node.nodeSize,r),h(n)}return n}},t.addColumnAt=function(e){return function(t){var n=j(t.selection);if(n){var r=i.TableMap.get(n.node);if(e>=0&&e<=r.width)return h(i.addColumn(t,{map:r,tableStart:n.start,table:n.node},e))}return t}},t.moveRow=function(e,t,n){return function(r){var o=Object.assign({tryToFit:!1,direction:0},n),i=j(r.selection);if(!i)return r;var s=te(e)(r).indexes,a=te(t)(r).indexes;if(s.indexOf(t)>-1)return r;!o.tryToFit&&a.length>1&&M(e,t,a,"row");var c=function(e,t,n,r){var o=C(e.node);return o=O(o,t,n,r),_(e.node,o)}(i,s,a,o.direction);return h(r).replaceWith(i.pos,i.pos+i.node.nodeSize,c)}},t.moveColumn=function(e,t,n){return function(r){var o=Object.assign({tryToFit:!1,direction:0},n),i=j(r.selection);if(!i)return r;var s=ee(e)(r).indexes,a=ee(t)(r).indexes;if(s.indexOf(t)>-1)return r;!o.tryToFit&&a.length>1&&M(e,t,a,"column");var c=function(e,t,n,r){var o=k(C(e.node));return o=O(o,t,n,r),o=k(o),_(e.node,o)}(i,s,a,o.direction);return h(r).replaceWith(i.pos,i.pos+i.node.nodeSize,c)}},t.addRowAt=function(e,t){return function(n){var r=j(n.selection);if(r){var o=i.TableMap.get(r.node),s=e-1;if(t&&s>=0)return h(W(s)(n));if(e>=0&&e<=o.height)return h(i.addRow(n,{map:o,tableStart:r.start,table:r.node},e))}return n}},t.cloneRowAt=W,t.removeColumnAt=K,t.removeRowAt=q,t.removeTable=G,t.removeSelectedColumns=function(e){var t=e.selection;if(B(t))return G(e);if(z(t)){var n=j(t);if(n){var r=i.TableMap.get(n.node),o=r.rectBetween(t.$anchorCell.pos-n.start,t.$headCell.pos-n.start);if(0==o.left&&o.right==r.width)return!1;for(var s=Object.assign({},o,{map:r,table:n.node,tableStart:n.start}),a=s.right-1;i.removeColumn(e,s,a),a!==s.left;a--)s.table=s.tableStart?e.doc.nodeAt(s.tableStart-1):e.doc,s.map=i.TableMap.get(s.table);return h(e)}}return e},t.removeSelectedRows=function(e){var t=e.selection;if(B(t))return G(e);if(z(t)){var n=j(t);if(n){var r=i.TableMap.get(n.node),o=r.rectBetween(t.$anchorCell.pos-n.start,t.$headCell.pos-n.start);if(0==o.top&&o.bottom==r.height)return!1;for(var s=Object.assign({},o,{map:r,table:n.node,tableStart:n.start}),a=s.bottom-1;i.removeRow(e,s,a),a!==s.top;a--)s.table=s.tableStart?e.doc.nodeAt(s.tableStart-1):e.doc,s.map=i.TableMap.get(s.table);return h(e)}}return e},t.removeColumnClosestToPos=function(e){return function(t){var n=Y(e);return n?K(n.left)(c(e.pos)(t)):t}},t.removeRowClosestToPos=function(e){return function(t){var n=Y(e);return n?q(n.top)(c(e.pos)(t)):t}},t.forEachCellInColumn=function(e,t,n){return function(o){var i=L(e)(o.selection);if(i){for(var s=i.length-1;s>=0;s--)o=t(i[s],o);if(n){var a=o.doc.resolve(o.mapping.map(i[i.length-1].pos));o.setSelection(r.Selection.near(a))}return h(o)}return o}},t.forEachCellInRow=function(e,t,n){return function(o){var i=V(e)(o.selection);if(i){for(var s=i.length-1;s>=0;s--)o=t(i[s],o);if(n){var a=o.doc.resolve(o.mapping.map(i[i.length-1].pos));o.setSelection(r.Selection.near(a))}}return o}},t.setCellAttrs=X,t.createTable=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=y(e),s=i.cell,a=i.header_cell,c=i.row,l=i.table,u=[],p=[],f=0;f",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),a="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),c="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),u=i&&(c||+i[1]<57)||a&&c,p=0;p<10;p++)r[48+p]=r[96+p]=String(p);for(p=1;p<=24;p++)r[p+111]="F"+p;for(p=65;p<=90;p++)r[p]=String.fromCharCode(p+32),o[p]=String.fromCharCode(p);for(var f in r)o.hasOwnProperty(f)||(o[f]=r[f]);var d=n(1),h="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function v(e){var t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a127)&&(i=r[n.keyCode])&&i!=a){var f=t[m(i,n,!0)];if(f&&f(e.state,e.dispatch,e))return!0}else if(c&&n.shiftKey){var d=t[m(a,n,!0)];if(d&&d(e.state,e.dispatch,e))return!0}return!1}}},function(e,t,n){e.exports=n(15)},function(e,t,n){var r=n(23);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(13)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){var r=n(26);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(13)(r,o);r.locals&&(e.exports=r.locals)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(19),o=n(20);t.highlight=i,t.highlightAuto=function(e,t){var n,s,a,c,l=t||{},u=l.subset||r.listLanguages(),p=l.prefix,f=u.length,d=-1;null==p&&(p="hljs-");if("string"!=typeof e)throw o("Expected `string` for value, got `%s`",e);s={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++ds.relevance&&(s=a),a.relevance>n.relevance&&(s=n,n=a));s.language&&(n.secondBest=s);return n},t.registerLanguage=function(e,t){r.registerLanguage(e,t)},t.listLanguages=function(){return r.listLanguages()},t.registerAlias=function(e,t){var n,o=e;t&&((o={})[e]=t);for(n in o)r.registerAliases(o[n],{languageName:n})},s.prototype.addText=function(e){var t,n,r=this.stack;if(""===e)return;t=r[r.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},s.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},s.prototype.addSublanguage=function(e,t){var n=this.stack,r=n[n.length-1],o=e.rootNode.children,i=t?{type:"element",tagName:"span",properties:{className:[t]},children:o}:o;r.children=r.children.concat(i)},s.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,r=t[t.length-1],o={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(o),t.push(o)},s.prototype.closeNode=function(){this.stack.pop()},s.prototype.closeAllNodes=a,s.prototype.finalize=a,s.prototype.toHTML=function(){return""};function i(e,t,n){var i,a=r.configure({}),c=(n||{}).prefix;if("string"!=typeof e)throw o("Expected `string` for name, got `%s`",e);if(!r.getLanguage(e))throw o("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw o("Expected `string` for value, got `%s`",t);if(null==c&&(c="hljs-"),r.configure({__emitter:s,classPrefix:c}),i=r.highlight(e,t,!0),r.configure(a),i.errorRaised)throw i.errorRaised;return{relevance:i.relevance,language:i.language,value:i.emitter.rootNode.children}}function s(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function a(){}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),i=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(i).concat([o]).join("\n")}var s;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o=0&&p.splice(t,1)}function g(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return y(t,e.attrs),v(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var s=u++;n=l||(l=g(t)),r=S.bind(null,n,s,!1),o=S.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),v(e,t),t}(t),r=C.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=k.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return d(n,t),function(e){for(var r=[],o=0;o=0&&Math.floor(t)===t&&isFinite(e)}function f(e){return i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function d(e){return null==e?"":Array.isArray(e)||u(e)&&e.toString===l?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function v(e,t){for(var n=Object.create(null),r=e.split(","),o=0;o-1)return e.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function w(e,t){return b.call(e,t)}function x(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var S=/-(\w)/g,k=x((function(e){return e.replace(S,(function(e,t){return t?t.toUpperCase():""}))})),C=x((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),_=/\B([A-Z])/g,O=x((function(e){return e.replace(_,"-$1").toLowerCase()})),M=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function A(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function N(e,t){for(var n in t)e[n]=t[n];return e}function T(e){for(var t={},n=0;n0,Y=G&&G.indexOf("edge/")>0,Q=(G&&G.indexOf("android"),G&&/iphone|ipad|ipod|ios/.test(G)||"ios"===q),ee=(G&&/chrome\/\d+/.test(G),G&&/phantomjs/.test(G),G&&G.match(/firefox\/(\d+)/)),te={}.watch,ne=!1;if(W)try{var re={};Object.defineProperty(re,"passive",{get:function(){ne=!0}}),window.addEventListener("test-passive",null,re)}catch(r){}var oe=function(){return void 0===H&&(H=!W&&!K&&void 0!==t&&t.process&&"server"===t.process.env.VUE_ENV),H},ie=W&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return"function"==typeof e&&/native code/.test(e.toString())}var ae,ce="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);ae="undefined"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var le=$,ue=0,pe=function(){this.id=ue++,this.subs=[]};pe.prototype.addSub=function(e){this.subs.push(e)},pe.prototype.removeSub=function(e){y(this.subs,e)},pe.prototype.depend=function(){pe.target&&pe.target.addDep(this)},pe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(i&&!w(o,"default"))s=!1;else if(""===s||s===O(e)){var c=Le(String,o.type);(c<0||a0&&(ut((c=e(c,(n||"")+"_"+r))[0])&&ut(u)&&(p[l]=ye(u.text+c[0].text),c.shift()),p.push.apply(p,c)):a(c)?ut(u)?p[l]=ye(u.text+c):""!==c&&p.push(ye(c)):ut(c)&&ut(u)?p[l]=ye(u.text+c.text):(s(t._isVList)&&i(c.tag)&&o(c.key)&&i(n)&&(c.key="__vlist"+n+"_"+r+"__"),p.push(c)));return p}(e):void 0}function ut(e){return i(e)&&i(e.text)&&!1===e.isComment}function pt(e,t){if(e){for(var n=Object.create(null),r=ce?Reflect.ownKeys(e):Object.keys(e),o=0;o0,s=e?!!e.$stable:!i,a=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&n&&n!==r&&a===n.$key&&!i&&!n.$hasNormal)return n;for(var c in o={},e)e[c]&&"$"!==c[0]&&(o[c]=vt(t,c,e[c]))}else o={};for(var l in t)l in o||(o[l]=mt(t,l));return e&&Object.isExtensible(e)&&(e._normalized=o),V(o,"$stable",s),V(o,"$key",a),V(o,"$hasNormal",i),o}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:lt(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function mt(e,t){return function(){return e[t]}}function gt(e,t){var n,r,o,s,a;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,o=e.length;rdocument.createEvent("Event").timeStamp&&(cn=function(){return ln.now()})}function un(){var e,t;for(an=cn(),on=!0,en.sort((function(e,t){return e.id-t.id})),sn=0;snsn&&en[n].id>e.id;)n--;en.splice(n+1,0,e)}else en.push(e);rn||(rn=!0,tt(un))}}(this)},fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||c(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Ve(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:$,set:$};function hn(e,t,n){dn.get=function(){return this[t][n]},dn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,dn)}var vn={lazy:!0};function mn(e,t,n){var r=!oe();"function"==typeof n?(dn.get=r?gn(t):yn(n),dn.set=$):(dn.get=n.get?r&&!1!==n.cache?gn(t):yn(n.get):$,dn.set=n.set||$),Object.defineProperty(e,t,dn)}function gn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),pe.target&&t.depend(),t.value}}function yn(e){return function(){return e.call(this,this)}}function bn(e,t,n,r){return u(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var wn=0;function xn(e){var t=e.options;if(e.super){var n=xn(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var o in n)n[o]!==r[o]&&(t||(t={}),t[o]=n[o]);return t}(e);r&&N(e.extendOptions,r),(t=e.options=Pe(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Sn(e){this._init(e)}function kn(e){return e&&(e.Ctor.options.name||e.tag)}function Cn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===l.call(n)&&e.test(t));var n}function _n(e,t){var n=e.cache,r=e.keys,o=e._vnode;for(var i in n){var s=n[i];if(s){var a=kn(s.componentOptions);a&&!t(a)&&On(n,i,r,o)}}}function On(e,t,n,r){var o=e[t];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),e[t]=null,y(n,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=wn++,t._isVue=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Pe(xn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&qt(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,o=n&&n.context;e.$slots=ft(t._renderChildren,o),e.$scopedSlots=r,e._c=function(t,n,r,o){return zt(e,t,n,r,o,!1)},e.$createElement=function(t,n,r,o){return zt(e,t,n,r,o,!0)};var i=n&&n.data;Me(e,"$attrs",i&&i.attrs||r,null,!0),Me(e,"$listeners",t._parentListeners||r,null,!0)}(t),Qt(t,"beforeCreate"),function(e){var t=pt(e.$options.inject,e);t&&(Ce(!1),Object.keys(t).forEach((function(n){Me(e,n,t[n])})),Ce(!0))}(t),function(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},o=e.$options._propKeys=[];e.$parent&&Ce(!1);var i=function(i){o.push(i);var s=je(i,t,n,e);Me(r,i,s),i in e||hn(e,"_props",i)};for(var s in t)i(s);Ce(!0)}(e,t.props),t.methods&&function(e,t){for(var n in e.$options.props,t)e[n]="function"!=typeof t[n]?$:M(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;u(t=e._data="function"==typeof t?function(e,t){de();try{return e.call(t,t)}catch(e){return Ve(e,t,"data()"),{}}finally{he()}}(t,e):t||{})||(t={});for(var n,r=Object.keys(t),o=e.$options.props,i=(e.$options.methods,r.length);i--;){var s=r[i];o&&w(o,s)||(void 0,36!==(n=(s+"").charCodeAt(0))&&95!==n&&hn(e,"_data",s))}Oe(t,!0)}(e):Oe(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=oe();for(var o in t){var i=t[o],s="function"==typeof i?i:i.get;r||(n[o]=new fn(e,s||$,$,vn)),o in e||mn(e,o,i)}}(e,t.computed),t.watch&&t.watch!==te&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var o=0;o1?A(t):t;for(var n=A(arguments,1),r='event handler for "'+e+'"',o=0,i=t.length;oparseInt(this.max)&&On(s,a[0],a,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return B}};Object.defineProperty(e,"config",t),e.util={warn:le,extend:N,mergeOptions:Pe,defineReactive:Me},e.set=Ae,e.delete=Ne,e.nextTick=tt,e.observable=function(e){return Oe(e),e},e.options=Object.create(null),j.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,N(e.options.components,An),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=A(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Pe(this.options,e),this}}(e),function(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,o=e._Ctor||(e._Ctor={});if(o[r])return o[r];var i=e.name||n.options.name,s=function(e){this._init(e)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=t++,s.options=Pe(n.options,e),s.super=n,s.options.props&&function(e){var t=e.options.props;for(var n in t)hn(e.prototype,"_props",n)}(s),s.options.computed&&function(e){var t=e.options.computed;for(var n in t)mn(e.prototype,n,t[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,j.forEach((function(e){s[e]=n[e]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=e,s.sealedOptions=N({},s.options),o[r]=s,s}}(e),function(e){j.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&u(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Sn),Object.defineProperty(Sn.prototype,"$isServer",{get:oe}),Object.defineProperty(Sn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Sn,"FunctionalRenderContext",{value:Et}),Sn.version="2.6.11";var Nn=v("style,class"),Tn=v("input,textarea,option,select,progress"),$n=function(e,t,n){return"value"===n&&Tn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},En=v("contenteditable,draggable,spellcheck"),Dn=v("events,caret,typing,plaintext-only"),Rn=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),In="http://www.w3.org/1999/xlink",Pn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Fn=function(e){return Pn(e)?e.slice(6,e.length):""},jn=function(e){return null==e||!1===e};function zn(e,t){return{staticClass:Bn(e.staticClass,t.staticClass),class:i(e.class)?[e.class,t.class]:t.class}}function Bn(e,t){return e?t?e+" "+t:e:t||""}function Ln(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,o=e.length;r-1?fr(e,t,n):Rn(t)?jn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):En(t)?e.setAttribute(t,function(e,t){return jn(t)||"false"===t?"false":"contenteditable"===e&&Dn(t)?t:"true"}(t,n)):Pn(t)?jn(n)?e.removeAttributeNS(In,Fn(t)):e.setAttributeNS(In,t,n):fr(e,t,n)}function fr(e,t,n){if(jn(n))e.removeAttribute(t);else{if(X&&!Z&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var dr={create:ur,update:ur};function hr(e,t){var n=t.elm,r=t.data,s=e.data;if(!(o(r.staticClass)&&o(r.class)&&(o(s)||o(s.staticClass)&&o(s.class)))){var a=function(e){for(var t=e.data,n=e,r=e;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=zn(r.data,t));for(;i(n=n.parent);)n&&n.data&&(t=zn(t,n.data));return function(e,t){return i(e)||i(t)?Bn(e,Ln(t)):""}(t.staticClass,t.class)}(t),c=n._transitionClasses;i(c)&&(a=Bn(a,Ln(c))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}var vr,mr,gr,yr,br,wr,xr={create:hr,update:hr},Sr=/[\w).+\-_$\]]/;function kr(e){var t,n,r,o,i,s=!1,a=!1,c=!1,l=!1,u=0,p=0,f=0,d=0;for(r=0;r=0&&" "===(v=e.charAt(h));h--);v&&Sr.test(v)||(l=!0)}}else void 0===o?(d=r+1,o=e.slice(0,r).trim()):m();function m(){(i||(i=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===o?o=e.slice(0,r).trim():0!==d&&m(),i)for(r=0;r-1?{exp:e.slice(0,yr),key:'"'+e.slice(yr+1)+'"'}:{exp:e,key:null};for(mr=e,yr=br=wr=0;!Br();)Lr(gr=zr())?Hr(gr):91===gr&&Vr(gr);return{exp:e.slice(0,br),key:e.slice(br+1,wr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function zr(){return mr.charCodeAt(++yr)}function Br(){return yr>=vr}function Lr(e){return 34===e||39===e}function Vr(e){var t=1;for(br=yr;!Br();)if(Lr(e=zr()))Hr(e);else if(91===e&&t++,93===e&&t--,0===t){wr=yr;break}}function Hr(e){for(var t=e;!Br()&&(e=zr())!==t;);}var Jr,Ur="__r";function Wr(e,t,n){var r=Jr;return function o(){null!==t.apply(null,arguments)&&Gr(e,o,n,r)}}var Kr=Ke&&!(ee&&Number(ee[1])<=53);function qr(e,t,n,r){if(Kr){var o=an,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=o||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Jr.addEventListener(e,t,ne?{capture:n,passive:r}:n)}function Gr(e,t,n,r){(r||Jr).removeEventListener(e,t._wrapper||t,n)}function Xr(e,t){if(!o(e.data.on)||!o(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Jr=t.elm,function(e){if(i(e.__r)){var t=X?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}i(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),st(n,r,qr,Gr,Wr,t.context),Jr=void 0}}var Zr,Yr={create:Xr,update:Xr};function Qr(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var n,r,s=t.elm,a=e.data.domProps||{},c=t.data.domProps||{};for(n in i(c.__ob__)&&(c=t.data.domProps=N({},c)),a)n in c||(s[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n&&"PROGRESS"!==s.tagName){s._value=r;var l=o(r)?"":String(r);eo(s,l)&&(s.value=l)}else if("innerHTML"===n&&Jn(s.tagName)&&o(s.innerHTML)){(Zr=Zr||document.createElement("div")).innerHTML=""+r+"";for(var u=Zr.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}else if(r!==a[n])try{s[n]=r}catch(e){}}}}function eo(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(i(r)){if(r.number)return h(n)!==h(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var to={create:Qr,update:Qr},no=x((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function ro(e){var t=oo(e.style);return e.staticStyle?N(e.staticStyle,t):t}function oo(e){return Array.isArray(e)?T(e):"string"==typeof e?no(e):e}var io,so=/^--/,ao=/\s*!important$/,co=function(e,t,n){if(so.test(t))e.style.setProperty(t,n);else if(ao.test(n))e.style.setProperty(O(t),n.replace(ao,""),"important");else{var r=uo(t);if(Array.isArray(n))for(var o=0,i=n.length;o-1?t.split(ho).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function mo(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(ho).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function go(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&N(t,yo(e.name||"v")),N(t,e),t}return"string"==typeof e?yo(e):void 0}}var yo=x((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),bo=W&&!Z,wo="transition",xo="animation",So="transition",ko="transitionend",Co="animation",_o="animationend";bo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(So="WebkitTransition",ko="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Co="WebkitAnimation",_o="webkitAnimationEnd"));var Oo=W?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Mo(e){Oo((function(){Oo(e)}))}function Ao(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),vo(e,t))}function No(e,t){e._transitionClasses&&y(e._transitionClasses,t),mo(e,t)}function To(e,t,n){var r=Eo(e,t),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a=o===wo?ko:_o,c=0,l=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++c>=s&&l()};setTimeout((function(){c0&&(n=wo,u=s,p=i.length):t===xo?l>0&&(n=xo,u=l,p=c.length):p=(n=(u=Math.max(s,l))>0?s>l?wo:xo:null)?n===wo?i.length:c.length:0,{type:n,timeout:u,propCount:p,hasTransform:n===wo&&$o.test(r[So+"Property"])}}function Do(e,t){for(;e.length1}function zo(e,t){!0!==t.data.show&&Io(t)}var Bo=function(e){var t,n,r={},c=e.modules,l=e.nodeOps;for(t=0;th?b(e,o(n[g+1])?null:n[g+1].elm,n,d,g,r):d>g&&x(t,f,h)}(f,v,g,n,u):i(g)?(i(e.text)&&l.setTextContent(f,""),b(f,null,g,0,g.length-1,n)):i(v)?x(v,0,v.length-1):i(e.text)&&l.setTextContent(f,""):e.text!==t.text&&l.setTextContent(f,t.text),i(h)&&i(d=h.hook)&&i(d=d.postpatch)&&d(e,t)}}}function _(e,t,n){if(s(n)&&i(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,s.selected!==i&&(s.selected=i);else if(R(Uo(s),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));o||(e.selectedIndex=-1)}}function Jo(e,t){return t.every((function(t){return!R(t,e)}))}function Uo(e){return"_value"in e?e._value:e.value}function Wo(e){e.target.composing=!0}function Ko(e){e.target.composing&&(e.target.composing=!1,qo(e.target,"input"))}function qo(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Go(e){return!e.componentInstance||e.data&&e.data.transition?e:Go(e.componentInstance._vnode)}var Xo={model:Lo,show:{bind:function(e,t,n){var r=t.value,o=(n=Go(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&o?(n.data.show=!0,Io(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Go(n)).data&&n.data.transition?(n.data.show=!0,r?Io(n,(function(){e.style.display=e.__vOriginalDisplay})):Po(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,o){o||(e.style.display=e.__vOriginalDisplay)}}},Zo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Yo(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Yo(Jt(t.children)):e}function Qo(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var o=n._parentListeners;for(var i in o)t[k(i)]=o[i];return t}function ei(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ti=function(e){return e.tag||Ht(e)},ni=function(e){return"show"===e.name},ri={name:"transition",props:Zo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ti)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var i=Yo(o);if(!i)return o;if(this._leaving)return ei(e,o);var s="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?s+"comment":s+i.tag:a(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var c=(i.data||(i.data={})).transition=Qo(this),l=this._vnode,u=Yo(l);if(i.data.directives&&i.data.directives.some(ni)&&(i.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,u)&&!Ht(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var p=u.data.transition=N({},c);if("out-in"===r)return this._leaving=!0,at(p,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),ei(e,o);if("in-out"===r){if(Ht(i))return l;var f,d=function(){f()};at(c,"afterEnter",d),at(c,"enterCancelled",d),at(p,"delayLeave",(function(e){f=e}))}}return o}}},oi=N({tag:String,moveClass:String},Zo);function ii(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function si(e){e.data.newPos=e.elm.getBoundingClientRect()}function ai(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,o=t.top-n.top;if(r||o){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+o+"px)",i.transitionDuration="0s"}}delete oi.mode;var ci={Transition:ri,TransitionGroup:{props:oi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var o=Xt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,o(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=Qo(this),a=0;a-1?Kn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Kn[e]=/HTMLUnknownElement/.test(t.toString())},N(Sn.options.directives,Xo),N(Sn.options.components,ci),Sn.prototype.__patch__=W?Bo:$,Sn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ge),Qt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new fn(e,r,$,{before:function(){e._isMounted&&!e._isDestroyed&&Qt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Qt(e,"mounted")),e}(this,e=e&&W?Gn(e):void 0,t)},W&&setTimeout((function(){B.devtools&&ie&&ie.emit("init",Sn)}),0);var li,ui=/\{\{((?:.|\r?\n)+?)\}\}/g,pi=/[-.*+?^${}()|[\]\/\\]/g,fi=x((function(e){var t=e[0].replace(pi,"\\$&"),n=e[1].replace(pi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")})),di={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Rr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Dr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},hi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Rr(e,"style");n&&(e.staticStyle=JSON.stringify(no(n)));var r=Dr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},vi=v("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),mi=v("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),gi=v("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),yi=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,bi=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,wi="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+L.source+"]*",xi="((?:"+wi+"\\:)?"+wi+")",Si=new RegExp("^<"+xi),ki=/^\s*(\/?)>/,Ci=new RegExp("^<\\/"+xi+"[^>]*>"),_i=/^]+>/i,Oi=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},$i=/&(?:lt|gt|quot|amp|#39);/g,Ei=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Di=v("pre,textarea",!0),Ri=function(e,t){return e&&Di(e)&&"\n"===t[0]};function Ii(e,t){var n=t?Ei:$i;return e.replace(n,(function(e){return Ti[e]}))}var Pi,Fi,ji,zi,Bi,Li,Vi,Hi,Ji=/^@|^v-on:/,Ui=/^v-|^@|^:|^#/,Wi=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Ki=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,qi=/^\(|\)$/g,Gi=/^\[.*\]$/,Xi=/:(.*)$/,Zi=/^:|^\.|^v-bind:/,Yi=/\.[^.\]]+(?=[^\]]*$)/g,Qi=/^v-slot(:|$)|^#/,es=/[\r\n]/,ts=/\s+/g,ns=x((function(e){return(li=li||document.createElement("div")).innerHTML=e,li.textContent})),rs="_empty_";function os(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:us(t),rawAttrsMap:{},parent:n,children:[]}}function is(e,t){var n,r;(r=Dr(n=e,"key"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Dr(e,"ref");t&&(e.ref=t,e.refInFor=function(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;"template"===e.tag?(t=Rr(e,"scope"),e.slotScope=t||Rr(e,"slot-scope")):(t=Rr(e,"slot-scope"))&&(e.slotScope=t);var n=Dr(e,"slot");if(n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||Ar(e,"slot",n,function(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}(e,"slot"))),"template"===e.tag){var r=Ir(e,Qi);if(r){var o=cs(r),i=o.name,s=o.dynamic;e.slotTarget=i,e.slotTargetDynamic=s,e.slotScope=r.value||rs}}else{var a=Ir(e,Qi);if(a){var c=e.scopedSlots||(e.scopedSlots={}),l=cs(a),u=l.name,p=l.dynamic,f=c[u]=os("template",[],e);f.slotTarget=u,f.slotTargetDynamic=p,f.children=e.children.filter((function(e){if(!e.slotScope)return e.parent=f,!0})),f.slotScope=a.value||rs,e.children=[],e.plain=!1}}}(e),function(e){"slot"===e.tag&&(e.slotName=Dr(e,"name"))}(e),function(e){var t;(t=Dr(e,"is"))&&(e.component=t),null!=Rr(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var o=0;o-1"+("true"===i?":("+t+")":":_q("+t+","+i+")")),Er(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+o+")":o)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+jr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+jr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+jr(t,"$$c")+"}",null,!0)}(e,r,o);else if("input"===i&&"radio"===s)!function(e,t,n){var r=n&&n.number,o=Dr(e,"value")||"null";Mr(e,"checked","_q("+t+","+(o=r?"_n("+o+")":o)+")"),Er(e,"change",jr(t,o),null,!0)}(e,r,o);else if("input"===i||"textarea"===i)!function(e,t,n){var r=e.attrsMap.type,o=n||{},i=o.lazy,s=o.number,a=o.trim,c=!i&&"range"!==r,l=i?"change":"range"===r?Ur:"input",u="$event.target.value";a&&(u="$event.target.value.trim()"),s&&(u="_n("+u+")");var p=jr(t,u);c&&(p="if($event.target.composing)return;"+p),Mr(e,"value","("+t+")"),Er(e,l,p,null,!0),(a||s)&&Er(e,"blur","$forceUpdate()")}(e,r,o);else if(!B.isReservedTag(i))return Fr(e,r,o),!1;return!0},text:function(e,t){t.value&&Mr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Mr(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:vi,mustUseProp:$n,canBeLeftOpenTag:mi,isReservedTag:Un,getTagNamespace:Wn,staticKeys:function(e){return e.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(",")}(ms)},ys=x((function(e){return v("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));var bs=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,ws=/\([^)]*?\);*$/,xs=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ss={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ks={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Cs=function(e){return"if("+e+")return null;"},_s={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Cs("$event.target !== $event.currentTarget"),ctrl:Cs("!$event.ctrlKey"),shift:Cs("!$event.shiftKey"),alt:Cs("!$event.altKey"),meta:Cs("!$event.metaKey"),left:Cs("'button' in $event && $event.button !== 0"),middle:Cs("'button' in $event && $event.button !== 1"),right:Cs("'button' in $event && $event.button !== 2")};function Os(e,t){var n=t?"nativeOn:":"on:",r="",o="";for(var i in e){var s=Ms(e[i]);e[i]&&e[i].dynamic?o+=i+","+s+",":r+='"'+i+'":'+s+","}return r="{"+r.slice(0,-1)+"}",o?n+"_d("+r+",["+o.slice(0,-1)+"])":n+r}function Ms(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return Ms(e)})).join(",")+"]";var t=xs.test(e.value),n=bs.test(e.value),r=xs.test(e.value.replace(ws,""));if(e.modifiers){var o="",i="",s=[];for(var a in e.modifiers)if(_s[a])i+=_s[a],Ss[a]&&s.push(a);else if("exact"===a){var c=e.modifiers;i+=Cs(["ctrl","shift","alt","meta"].filter((function(e){return!c[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else s.push(a);return s.length&&(o+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(As).join("&&")+")return null;"}(s)),i&&(o+=i),"function($event){"+o+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function As(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ss[e],r=ks[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ns={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:$},Ts=function(e){this.options=e,this.warn=e.warn||_r,this.transforms=Or(e.modules,"transformCode"),this.dataGenFns=Or(e.modules,"genData"),this.directives=N(N({},Ns),e.directives);var t=e.isReservedTag||E;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function $s(e,t){var n=new Ts(t);return{render:"with(this){return "+(e?Es(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Es(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ds(e,t);if(e.once&&!e.onceProcessed)return Rs(e,t);if(e.for&&!e.forProcessed)return Ps(e,t);if(e.if&&!e.ifProcessed)return Is(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Bs(e,t),o="_t("+n+(r?","+r:""),i=e.attrs||e.dynamicAttrs?Hs((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:k(e.name),value:e.value,dynamic:e.dynamic}}))):null,s=e.attrsMap["v-bind"];return!i&&!s||r||(o+=",null"),i&&(o+=","+i),s&&(o+=(i?"":",null")+","+s),o+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Bs(t,n,!0);return"_c("+e+","+Fs(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Fs(e,t));var o=e.inlineTemplate?null:Bs(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(o?","+o:"")+")"}for(var i=0;i>>0}(s):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var i=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=$s(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);i&&(n+=i+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Hs(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function js(e){return 1===e.type&&("slot"===e.tag||e.children.some(js))}function zs(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Is(e,t,zs,"null");if(e.for&&!e.forProcessed)return Ps(e,t,zs);var r=e.slotScope===rs?"":String(e.slotScope),o="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Bs(e,t)||"undefined")+":undefined":Bs(e,t)||"undefined":Es(e,t))+"}",i=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+o+i+"}"}function Bs(e,t,n,r,o){var i=e.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?t.maybeComponent(s)?",1":",0":"";return""+(r||Es)(s,t)+a}var c=n?function(e,t){for(var n=0,r=0;r]*>)","i")),f=e.replace(p,(function(e,n,r){return l=r.length,Ai(u)||"noscript"===u||(n=n.replace(//g,"$1").replace(//g,"$1")),Ri(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));c+=e.length-f.length,e=f,O(u,c-l,c)}else{var d=e.indexOf("<");if(0===d){if(Oi.test(e)){var h=e.indexOf("--\x3e");if(h>=0){t.shouldKeepComment&&t.comment(e.substring(4,h),c,c+h+3),k(h+3);continue}}if(Mi.test(e)){var v=e.indexOf("]>");if(v>=0){k(v+2);continue}}var m=e.match(_i);if(m){k(m[0].length);continue}var g=e.match(Ci);if(g){var y=c;k(g[0].length),O(g[1],y,c);continue}var b=C();if(b){_(b),Ri(b.tagName,e)&&k(1);continue}}var w=void 0,x=void 0,S=void 0;if(d>=0){for(x=e.slice(d);!(Ci.test(x)||Si.test(x)||Oi.test(x)||Mi.test(x)||(S=x.indexOf("<",1))<0);)d+=S,x=e.slice(d);w=e.substring(0,d)}d<0&&(w=e),w&&k(w.length),t.chars&&w&&t.chars(w,c-w.length,c)}if(e===n){t.chars&&t.chars(e);break}}function k(t){c+=t,e=e.substring(t)}function C(){var t=e.match(Si);if(t){var n,r,o={tagName:t[1],attrs:[],start:c};for(k(t[0].length);!(n=e.match(ki))&&(r=e.match(bi)||e.match(yi));)r.start=c,k(r[0].length),r.end=c,o.attrs.push(r);if(n)return o.unarySlash=n[1],k(n[0].length),o.end=c,o}}function _(e){var n=e.tagName,c=e.unarySlash;i&&("p"===r&&gi(n)&&O(r),a(n)&&r===n&&O(n));for(var l=s(n)||!!c,u=e.attrs.length,p=new Array(u),f=0;f=0&&o[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var l=o.length-1;l>=s;l--)t.end&&t.end(o[l].tag,n,i);o.length=s,r=s&&o[s-1].tag}else"br"===a?t.start&&t.start(e,[],!0,n,i):"p"===a&&(t.start&&t.start(e,[],!1,n,i),t.end&&t.end(e,n,i))}O()}(e,{warn:Pi,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,i,s,u,p){var f=r&&r.ns||Hi(e);X&&"svg"===f&&(i=function(e){for(var t=[],n=0;nc&&(a.push(i=e.slice(c,o)),s.push(JSON.stringify(i)));var l=kr(r[1].trim());s.push("_s("+l+")"),a.push({"@binding":l}),c=o+r[0].length}return c':'
',qs.innerHTML.indexOf(" ")>0}var Ys=!!W&&Zs(!1),Qs=!!W&&Zs(!0),ea=x((function(e){var t=Gn(e);return t&&t.innerHTML})),ta=Sn.prototype.$mount;Sn.prototype.$mount=function(e,t){if((e=e&&Gn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ea(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var o=Xs(r,{outputSourceRange:!1,shouldDecodeNewlines:Ys,shouldDecodeNewlinesForHref:Qs,delimiters:n.delimiters,comments:n.comments},this),i=o.render,s=o.staticRenderFns;n.render=i,n.staticRenderFns=s}}return ta.call(this,e,t)},Sn.compile=Xs,e.exports=Sn}).call(this,n(10),n(16).setImmediate)},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(17),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(10))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,s,a,c=1,l={},u=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(o=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e,...t){var n={};for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}function s(e){return e.nodeName.toLowerCase()}var a=Object.freeze({__proto__:null,escapeHTML:o,inherit:i,nodeStream:function(e){var t=[];return function e(n,r){for(var o=n.firstChild;o;o=o.nextSibling)3===o.nodeType?r+=o.nodeValue.length:1===o.nodeType&&(t.push({event:"start",offset:r,node:o}),r=e(o,r),s(o).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:o}));return r}(e,0),t},mergeStreams:function(e,t,n){var r=0,i="",a=[];function c(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function u(e){i+=""}function p(e){("start"===e.event?l:u)(e.node)}for(;e.length||t.length;){var f=c();if(i+=o(n.substring(r,f[0].offset)),r=f[0].offset,f===e){a.reverse().forEach(u);do{p(f.splice(0,1)[0]),f=c()}while(f===e&&f.length&&f[0].offset===r);a.reverse().forEach(l)}else"start"===f[0].event?a.push(f[0].node):a.pop(),p(f.splice(0,1)[0])}return i+o(n.substr(r))}});const c=e=>!!e.kind;class l{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=o(e)}openNode(e){if(!c(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){c(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class u{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{u._collapse(e)}))}}class p extends u{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function f(e){return e?"string"==typeof e?e:e.source:null}const d="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",h={begin:"\\\\[\\s\\S]",relevance:0},v={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[h]},m={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[h]},g={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},y=function(e,t,n={}){var r=i({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(g),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},b=y("//","$"),w=y("/\\*","\\*/"),x=y("#","$"),S={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},k={className:"number",begin:d,relevance:0},C={className:"number",begin:"\\b(0b[01]+)",relevance:0},_={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},O={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[h,{begin:/\[/,end:/\]/,relevance:0,contains:[h]}]}]},M={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},A={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},N={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var T=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:d,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>f(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),i({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:h,APOS_STRING_MODE:v,QUOTE_STRING_MODE:m,PHRASAL_WORDS_MODE:g,COMMENT:y,C_LINE_COMMENT_MODE:b,C_BLOCK_COMMENT_MODE:w,HASH_COMMENT_MODE:x,NUMBER_MODE:S,C_NUMBER_MODE:k,BINARY_NUMBER_MODE:C,CSS_NUMBER_MODE:_,REGEXP_MODE:O,TITLE_MODE:M,UNDERSCORE_TITLE_MODE:A,METHOD_GUARD:N,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}}),$="of and for in not or if then".split(" ");function E(e){function t(t,n){return new RegExp(f(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=t(function(e,t="|"){for(var n=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,o="",i=0;i0&&(o+=t),o+="(";a.length>0;){var c=n.exec(a);if(null==c){o+=a;break}o+=a.substring(0,c.index),a=a.substring(c.index+c[0].length),"\\"===c[0][0]&&c[1]?o+="\\"+String(Number(c[1])+s):(o+=c[0],"("===c[0]&&r++)}o+=")"}return o}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;const n=t.exec(e);return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),n}}function o(e,t){const n=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==n&&"."!==r||t.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return function n(s,a){const c=s;if(s.compiled)return c;s.compiled=!0,s.__beforeBegin=null,s.keywords=s.keywords||s.beginKeywords;let l=null;if("object"==typeof s.keywords&&(l=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=function(e,t){var n={};"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(t){r(t,e[t])}));return n;function r(e,r){t&&(r=r.toLowerCase()),r.split(" ").forEach((function(t){var r=t.split("|");n[r[0]]=[e,D(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemes&&l)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return c.keywordPatternRe=t(s.lexemes||l||/\w+/,!0),a&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__beforeBegin=o),s.begin||(s.begin=/\B|\b/),c.beginRe=t(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(c.endRe=t(s.end)),c.terminator_end=f(s.end)||"",s.endsWithParent&&a.terminator_end&&(c.terminator_end+=(s.end?"|":"")+a.terminator_end)),s.illegal&&(c.illegalRe=t(s.illegal)),void 0===s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(t){return i(e,{variants:null},t)})));if(e.cached_variants)return e.cached_variants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return i(e,{starts:e.starts?i(e.starts):null});if(Object.isFrozen(e))return i(e);return e}("self"===e?s:e)}))),s.contains.forEach((function(e){n(e,c)})),s.starts&&n(s.starts,a),c.matcher=function(e){const t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&t.addRule(e.terminator_end,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(c),c}(e)}function D(e,t){return t?Number(t):function(e){return $.includes(e.toLowerCase())}(e)?0:1}const R=o,I=i,{nodeStream:P,mergeStreams:F}=a,j=Symbol("nomatch");var z=function(e){var t=[],o=Object.create(null),i=Object.create(null),s=[],a=!0,c=/(^(<[^>]+>|\t|)+|\n)/gm,l="Could not find the language '{}', did you forget to load/include a language module?";const u={disableAutodetect:!0,name:"Plain text",contains:[]};var f={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:p};function d(e){return f.noHighlightRe.test(e)}function h(e,t,n,r){var o={code:t,language:e};k("before:highlight",o);var i=o.result?o.result:v(o.language,o.code,n,r);return i.code=o.code,k("after:highlight",i),i}function v(e,t,n,i){var s=t;function c(e,t){var n=x.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function u(){null!=C.subLanguage?function(){if(""!==M){var e=null;if("string"==typeof C.subLanguage){if(!o[C.subLanguage])return void O.addText(M);e=v(C.subLanguage,M,!0,_[C.subLanguage]),_[C.subLanguage]=e.top}else e=m(M,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(A+=e.relevance),O.addSublanguage(e.emitter,e.language)}}():function(){if(!C.keywords)return void O.addText(M);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(M),n="";for(;t;){n+=M.substring(e,t.index);const r=c(C,t);if(r){const[e,o]=r;O.addText(n),n="",A+=o,O.addKeyword(t[0],e)}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(M)}n+=M.substr(e),O.addText(n)}(),M=""}function p(e){return e.className&&O.openNode(e.className),C=Object.create(e,{parent:{value:C}})}function d(e){return 0===C.matcher.regexIndex?(M+=e[0],1):($=!0,0)}function h(e){var t=e[0],n=e.rule;const o=new r(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,o),o.ignore))return d(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?M+=t:(n.excludeBegin&&(M+=t),u(),n.returnBegin||n.excludeBegin||(M=t)),p(n),n.returnBegin?0:t.length}function g(e){var t=e[0],n=s.substr(e.index),o=function e(t,n,o){let i=function(e,t){var n=e&&e.exec(t);return n&&0===n.index}(t.endRe,o);if(i){if(t["on:end"]){const e=new r(t);t["on:end"](n,e),e.ignore&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,o)}(C,e,n);if(!o)return j;var i=C;i.skip?M+=t:(i.returnEnd||i.excludeEnd||(M+=t),u(),i.excludeEnd&&(M=t));do{C.className&&O.closeNode(),C.skip||C.subLanguage||(A+=C.relevance),C=C.parent}while(C!==o.parent);return o.starts&&(o.endSameAsBegin&&(o.starts.endRe=o.endRe),p(o.starts)),i.returnEnd?0:t.length}var y={};function b(t,r){var o=r&&r[0];if(M+=t,null==o)return u(),0;if("begin"===y.type&&"end"===r.type&&y.index===r.index&&""===o){if(M+=s.slice(r.index,r.index+1),!a){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=y.rule,t}return 1}if(y=r,"begin"===r.type)return h(r);if("illegal"===r.type&&!n){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(C.className||"")+'"');throw e.mode=C,e}if("end"===r.type){var i=g(r);if(i!==j)return i}if("illegal"===r.type&&""===o)return 1;if(T>1e5&&T>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return M+=o,o.length}var x=w(e);if(!x)throw console.error(l.replace("{}",e)),new Error('Unknown language: "'+e+'"');var S=E(x),k="",C=i||S,_={},O=new f.__emitter(f);!function(){for(var e=[],t=C;t!==x;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>O.openNode(e))}();var M="",A=0,N=0,T=0,$=!1;try{for(C.matcher.considerAll();;){T++,$?$=!1:(C.matcher.lastIndex=N,C.matcher.considerAll());const e=C.matcher.exec(s);if(!e)break;const t=b(s.substring(N,e.index),e);N=e.index+t}return b(s.substr(N)),O.closeAllNodes(),O.finalize(),k=O.toHTML(),{relevance:A,value:k,language:e,illegal:!1,emitter:O,top:C}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:s.slice(N-100,N+100),mode:t.mode},sofar:k,relevance:0,value:R(s),emitter:O};if(a)return{illegal:!1,relevance:0,value:R(s),emitter:O,language:e,top:C,errorRaised:t};throw t}}function m(e,t){t=t||f.languages||Object.keys(o);var n=function(e){const t={relevance:0,emitter:new f.__emitter(f),value:R(e),illegal:!1,top:u};return t.emitter.addText(e),t}(e),r=n;return t.filter(w).filter(S).forEach((function(t){var o=v(t,e,!1);o.language=t,o.relevance>r.relevance&&(r=o),o.relevance>n.relevance&&(r=n,n=o)})),r.language&&(n.second_best=r),n}function g(e){return f.tabReplace||f.useBR?e.replace(c,e=>"\n"===e?f.useBR?"
":e:f.tabReplace?e.replace(/\t/g,f.tabReplace):e):e}function y(e){let t=null;const n=function(e){var t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=f.languageDetectRe.exec(t);if(n){var r=w(n[1]);return r||(console.warn(l.replace("{}",n[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>d(e)||w(e))}(e);if(d(n))return;k("before:highlightBlock",{block:e,language:n}),f.useBR?(t=document.createElement("div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;const r=t.textContent,o=n?h(n,r,!0):m(r),s=P(t);if(s.length){const e=document.createElement("div");e.innerHTML=o.value,o.value=F(s,P(e),r)}o.value=g(o.value),k("after:highlightBlock",{block:e,result:o}),e.innerHTML=o.value,e.className=function(e,t,n){var r=t?i[t]:n,o=[e.trim()];return e.match(/\bhljs\b/)||o.push("hljs"),e.includes(r)||o.push(r),o.join(" ").trim()}(e.className,n,o.language),e.result={language:o.language,re:o.relevance,relavance:o.relevance},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.relevance,relavance:o.second_best.relevance})}const b=()=>{if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");t.forEach.call(e,y)}};function w(e){return e=(e||"").toLowerCase(),o[e]||o[i[e]]}function x(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e]=t})}function S(e){var t=w(e);return t&&!t.disableAutodetect}function k(e,t){var n=e;s.forEach((function(e){e[n]&&e[n](t)}))}Object.assign(e,{highlight:h,highlightAuto:m,fixMarkup:g,highlightBlock:y,configure:function(e){f=I(f,e)},initHighlighting:b,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",b,!1)},registerLanguage:function(t,n){var r=null;try{r=n(e)}catch(e){if(console.error("Language definition for '{}' could not be registered.".replace("{}",t)),!a)throw e;console.error(e),r=u}r.name||(r.name=t),o[t]=r,r.rawDefinition=n.bind(null,e),r.aliases&&x(r.aliases,{languageName:t})},listLanguages:function(){return Object.keys(o)},getLanguage:w,registerAliases:x,requireLanguage:function(e){var t=w(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:S,inherit:I,addPlugin:function(e){s.push(e)}}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="10.1.2";for(const e in T)"object"==typeof T[e]&&n(T[e]);return Object.assign(e,T),e}({});e.exports=z},function(e,t,n){"use strict";var r=n(21),o=i(Error);function i(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=r.apply(null,arguments)),new e(t)}}e.exports=o,o.eval=i(EvalError),o.range=i(RangeError),o.reference=i(ReferenceError),o.syntax=i(SyntaxError),o.type=i(TypeError),o.uri=i(URIError),o.create=i},function(e,t,n){!function(){var t;function n(e){for(var t,n,r,o,i=1,s=[].slice.call(arguments),a=0,c=e.length,l="",u=!1,p=!1,f=function(){return s[i++]},d=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a p:first-child {\n display: inline;\n}",""])},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var o,i=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(e,t,n){"use strict";var r=n(9);n.n(r).a},function(e,t,n){(e.exports=n(12)(!1)).push([e.i,".tiptap {\n height: 100%;\n width: 100%;\n}\n.tiptap:focus {\n outline: none !important;\n}\n.tiptap li > p:first-child {\n display: inline;\n}",""])},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n(4),i=n(0),s=n(2);var a=function(e,t){var n=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var r=function(e){return n[t](e)};return e.dom.addEventListener(t,r),{name:t,handler:r}}))};a.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))},a.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&this.updateOverlay()},a.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},a.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){var s=this.editorView.coordsAtPos(this.cursorPos);e={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var c=!a||a==document.body&&"static"==getComputedStyle(a).position?{left:-pageXOffset,top:-pageYOffset}:a.getBoundingClientRect();this.element.style.left=e.left-c.left+"px",this.element.style.top=e.top-c.top+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},a.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},a.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY});if(t){var n=t.pos;this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Object(s.h)(this.editorView.state.doc,n,this.editorView.dragging.slice))&&(n=t.pos),this.setCursor(n),this.scheduleRemoval(5e3)}}},a.prototype.dragend=function(){this.scheduleRemoval(20)},a.prototype.drop=function(){this.scheduleRemoval(20)},a.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};var c=n(6),l=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return t.valid(o)?new t(o):e.near(o)},t.prototype.content=function(){return i.Slice.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new u(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t);if(0!=n)for(var r=e.node(t).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock},t.findFrom=function(e,n,o){e:for(;;){if(!o&&t.valid(e))return e;for(var i=e.pos,s=null,a=e.depth;;a--){var c=e.node(a);if(n>0?e.indexAfter(a)0){s=c.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;i+=n;var l=e.doc.resolve(i);if(t.valid(l))return l}for(;;){var u=n>0?s.firstChild:s.lastChild;if(!u){if(s.isAtom&&!s.isText&&!r.NodeSelection.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),o=!1;continue e}break}s=u,i+=n;var p=e.doc.resolve(i);if(t.valid(p))return p}return null}},t}(r.Selection);l.prototype.visible=!1,r.Selection.jsonID("gapcursor",l);var u=function(e){this.pos=e};u.prototype.map=function(e){return new u(e.map(this.pos))},u.prototype.resolve=function(e){var t=e.resolve(this.pos);return l.valid(t)?new l(t):r.Selection.near(t)};var p=Object(c.a)({ArrowLeft:f("horiz",-1),ArrowRight:f("horiz",1),ArrowUp:f("vert",-1),ArrowDown:f("vert",1)});function f(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,o,i){var s=e.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof r.TextSelection){if(!i.endOfTextblock(n)||0==a.depth)return!1;c=!1,a=e.doc.resolve(t>0?a.after():a.before())}var u=l.findFrom(a,t,c);return!!u&&(o&&o(e.tr.setSelection(new l(u))),!0)}}function d(e,t,n){if(!e.editable)return!1;var o=e.state.doc.resolve(t);if(!l.valid(o))return!1;var i=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&r.NodeSelection.isSelectable(e.state.doc.nodeAt(i)))&&(e.dispatch(e.state.tr.setSelection(new l(o))),!0)}function h(e){if(!(e.selection instanceof l))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",o.b.create(e.doc,[o.a.widget(e.selection.head,t,{key:"gapcursor"})])}function v(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function m(e,t){for(;e;e="start"==t?e.firstChild:e.lastChild)if(e.isTextblock)return!0;return!1}function g(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function y(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1=0;f--)p=i.Fragment.from(o[f].create(null,p));p=i.Fragment.from(c.copy(p));var d=e.tr.step(new s.b(t.pos-1,u,t.pos,u,new i.Slice(p,1,0),o.length,!0)),h=u+2*o.length;Object(s.f)(d.doc,h)&&d.join(h),n(d.scrollIntoView())}return!0}var v=r.Selection.findFrom(t,1),m=v&&v.$from.blockRange(v.$to),g=m&&Object(s.k)(m);return null!=g&&g>=t.depth&&(n&&n(e.tr.lift(m,g).scrollIntoView()),!0)}function k(e,t){return function(n,r){var o=n.selection,i=o.from,s=o.to,a=!1;return n.doc.nodesBetween(i,s,(function(r,o){if(a)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,e)}})),!!a&&(r&&r(n.tr.setBlockType(i,s,e,t).scrollIntoView()),!0)}}function C(e,t){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,s=o.$to,a=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,(function(e){if(a)return!1;a=e.inlineContent&&e.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o0))return!1;var i=g(o);if(!i){var a=o.blockRange(),c=a&&Object(s.k)(a);return null!=c&&(t&&t(e.tr.lift(a,c).scrollIntoView()),!0)}var l=i.nodeBefore;if(!l.type.spec.isolating&&S(e,i,t))return!0;if(0==o.parent.content.size&&(m(l,"end")||r.NodeSelection.isSelectable(l))){if(t){var u=e.tr.deleteRange(o.before(),o.after());u.setSelection(m(l,"end")?r.Selection.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):r.NodeSelection.create(u.doc,i.pos-l.nodeSize)),t(u.scrollIntoView())}return!0}return!(!l.isAtom||i.depth!=o.depth-1)&&(t&&t(e.tr.delete(i.pos-l.nodeSize,i.pos).scrollIntoView()),!0)}),(function(e,t,n){var o=e.selection,i=o.$head,s=i;if(!o.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;s=g(i)}var a=s&&s.nodeBefore;return!(!a||!r.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(r.NodeSelection.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)})),M=_(v,(function(e,t,n){var o=e.selection.$cursor;if(!o||(n?!n.endOfTextblock("forward",e):o.parentOffset1&&n.after()!=n.end(-1)){var r=n.before();if(Object(s.g)(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Object(s.k)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)}),x),"Mod-Enter":w,Backspace:O,"Mod-Backspace":O,Delete:M,"Mod-Delete":M,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new r.AllSelection(e.doc))),!0}},N={"Ctrl-h":A.Backspace,"Alt-Backspace":A["Mod-Backspace"],"Ctrl-d":A.Delete,"Ctrl-Alt-Backspace":A["Mod-Delete"],"Alt-Delete":A["Mod-Delete"],"Alt-d":A["Mod-Delete"]};for(var T in A)N[T]=A[T];var $=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?N:A,E=function(e,t){var n;this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,o){var i=n;if(t[1]){var s=t[0].lastIndexOf(t[1]);i+=t[0].slice(s+t[1].length);var a=(r+=s)-o;a>0&&(i=t[0].slice(s-a,s)+i,r=o)}return e.tr.insertText(i,r,o)}):t};function D(e,t,n,r,o,i){if(e.composing)return!1;var s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,l=0;l=0;c--)s.step(a.steps[c].invert(a.docs[c]));var l=s.doc.resolve(i.from).marks();t(s.replaceWith(i.from,i.to,e.schema.text(i.text,l)))}return!0}}return!1}new E(/--$/,"—"),new E(/\.\.\.$/,"…"),new E(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new E(/"$/,"”"),new E(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new E(/'$/,"’");function I(e,t,n,r){return new E(e,(function(e,o,i,a){var c=n instanceof Function?n(o):n,l=e.tr.delete(i,a),u=l.doc.resolve(i).blockRange(),p=u&&Object(s.i)(u,t,c);if(!p)return null;l.wrap(u,p);var f=l.doc.resolve(i-1).nodeBefore;return f&&f.type==t&&Object(s.f)(l.doc,i-1)&&(!r||r(o,f))&&l.join(i-1),l}))}function P(e,t,n){return new E(e,(function(e,r,o,i){var s=e.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,a):null}))}var F=n(5);function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e||!t)return!1;var n=e.parent.childAfter(e.parentOffset);if(!n.node)return!1;var r=n.node.marks.find((function(e){return e.type===t}));if(!r)return!1;for(var o=e.index(),i=e.start()+n.offset,s=o+1,a=i+n.node.nodeSize;o>0&&r.isInSet(e.parent.child(o-1).marks);)o-=1,i-=e.parent.child(o).nodeSize;for(;s2&&void 0!==arguments[2]?arguments[2]:{},r=function(e){return e.type===t},o=Object(F.findSelectedNodeOfType)(t)(e.selection)||Object(F.findParentNode)(r)(e.selection);return Object.keys(n).length&&o?o.node.hasMarkup(t,B(B({},o.node.attrs),n)):!!o}var K=n(7),q=n.n(K);function G(e,t){return function(n,r){var o=n.selection,a=o.$from,c=o.$to,l=a.blockRange(c),u=!1,p=l;if(!l)return!1;if(l.depth>=2&&a.node(l.depth-1).type.compatibleContent(e)&&0==l.startIndex){if(0==a.index(l.depth-1))return!1;var f=n.doc.resolve(l.start-2);p=new i.NodeRange(f,f,l.depth),l.endIndex=0;c--)a=i.Fragment.from(n[c].type.create(n[c].attrs,a));e.step(new s.b(t.start-(r?2:0),t.end,t.start,t.end,new i.Slice(a,0,0),n.length,!0));for(var l=0,u=0;ul;c--)a-=o.child(c).nodeSize,r.delete(a-1,a+1);var u=r.doc.resolve(n.start),p=u.nodeAfter,f=0==n.startIndex,d=n.endIndex==o.childCount,h=u.node(-1),v=u.index(-1);if(!h.canReplace(v+(f?0:1),v+1,p.content.append(d?i.Fragment.empty:i.Fragment.from(o))))return!1;var m=u.pos,g=m+p.nodeSize;return r.step(new s.b(m-(f?1:0),g+(d?1:0),m+1,g-1,new i.Slice((f?i.Fragment.empty:i.Fragment.from(o.copy(i.Fragment.empty))).append(d?i.Fragment.empty:i.Fragment.from(o.copy(i.Fragment.empty))),f?0:1,d?0:1),f?0:1)),t(r.scrollIntoView()),!0}(t,n,c)))}}function Z(e){return function(t,n){var r=t.selection,o=r.$from,a=r.$to,c=o.blockRange(a,(function(t){return t.childCount&&t.firstChild.type==e}));if(!c)return!1;var l=c.startIndex;if(0==l)return!1;var u=c.parent,p=u.child(l-1);if(p.type!=e)return!1;if(n){var f=p.lastChild&&p.lastChild.type==u.type,d=i.Fragment.from(f?e.create():null),h=new i.Slice(i.Fragment.from(e.create(null,i.Fragment.from(u.type.create(null,d)))),f?3:1,0),v=c.start,m=c.end;n(t.tr.step(new s.b(v-(f?3:1),m,v,m,h,1,!0)).scrollIntoView())}return!0}}function Y(e,t,n){return new E(e,(e,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=e,c=r.length-1;let l=i,u=o;if(r[c]){const n=o+r[0].indexOf(r[c-1]),s=n+r[c-1].length-1,p=n+r[c-1].lastIndexOf(r[c]),f=p+r[c].length;if(function(e,t,n){let r=[];return n.doc.nodesBetween(e,t,(e,t)=>{r=[...r,...e.marks.map(n=>({start:t,end:t+e.nodeSize,mark:n}))]}),r}(o,i,e).filter(e=>{const{excluded:n}=e.mark.type;return n.find(e=>e.name===t.name)}).filter(e=>e.end>n).length)return!1;fn&&a.delete(n,p),u=n,l=u+r[c].length}return a.addMark(u,l,t.create(s)),a.removeStoredMark(t),a})}function Q(e,t,n){return new E(e,(e,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=e;return r[0]&&a.replaceWith(o-1,i,t.create(s)),a})}function ee(e,t,n){const o=(r,s)=>{const a=[];return r.forEach(r=>{if(r.isText){const{text:o,marks:i}=r;let c,l=0;const u=!!i.filter(e=>"link"===e.type.name)[0];for(;!u&&null!==(c=e.exec(o));)if(s&&s.type.allowsMarkType(t)&&c[1]){const e=c.index,o=e+c[0].length,i=e+c[0].indexOf(c[1]),s=i+c[1].length,u=n instanceof Function?n(c):n;e>0&&a.push(r.cut(l,e)),a.push(r.cut(i,s).mark(t.create(u).addToSet(r.marks))),l=o}lnew i.Slice(o(e.content),e.openStart,e.openEnd)}})}function te(e,t,n={}){return(r,o,i)=>W(r,e,n)?k(t)(r,o,i):k(e,n)(r,o,i)}function ne(e,t){return e.type===t.nodes.bullet_list||e.type===t.nodes.ordered_list||e.type===t.nodes.todo_list}function re(e,t){return(n,r,o)=>{const{schema:i,selection:s}=n,{$from:a,$to:c}=s,l=a.blockRange(c);if(!l)return!1;const u=Object(F.findParentNode)(e=>ne(e,i))(s);if(l.depth>=1&&u&&l.depth-u.depth<=1){if(u.node.type===e)return X(t)(n,r,o);if(ne(u.node,i)&&e.validContent(u.node.content)){const{tr:t}=n;return t.setNodeMarkup(u.pos,e),r&&r(t),!1}}return G(e)(n,r,o)}}class oe{constructor(e,{editor:t,extension:n,parent:r,node:o,view:i,decorations:s,getPos:a}){this.component=e,this.editor=t,this.extension=n,this.parent=r,this.node=o,this.view=i,this.decorations=s,this.isNode=!!this.node.marks,this.isMark=!this.isNode,this.getPos=this.isMark?this.getMarkPos:a,this.captureEvents=!0,this.dom=this.createDOM(),this.contentDOM=this.vm.$refs.content}createDOM(){const e=q.a.extend(this.component),t={editor:this.editor,node:this.node,view:this.view,getPos:()=>this.getPos(),decorations:this.decorations,selected:!1,options:this.extension.options,updateAttrs:e=>this.updateAttrs(e)};return"function"==typeof this.extension.setSelection&&(this.setSelection=this.extension.setSelection),"function"==typeof this.extension.update&&(this.update=this.extension.update),this.vm=new e({parent:this.parent,propsData:t}).$mount(),this.vm.$el}update(e,t){return e.type===this.node.type&&(e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,this.updateComponentProps({node:e,decorations:t})),!0)}updateComponentProps(e){if(!this.vm._props)return;const t=q.a.config.silent;q.a.config.silent=!0,Object.entries(e).forEach(([e,t])=>{this.vm._props[e]=t}),q.a.config.silent=t}updateAttrs(e){if(!this.view.editable)return;const{state:t}=this.view,{type:n}=this.node,r=this.getPos(),o={...this.node.attrs,...e},i=this.isMark?t.tr.removeMark(r.from,r.to,n).addMark(r.from,r.to,n.create(o)):t.tr.setNodeMarkup(r,null,o);this.view.dispatch(i)}ignoreMutation(e){return"selection"!==e.type&&(!this.contentDOM||!this.contentDOM.contains(e.target))}stopEvent(e){if("function"==typeof this.extension.stopEvent)return this.extension.stopEvent(e);const t=!!this.extension.schema.draggable;if(t&&"mousedown"===e.type){const t=e.target.closest&&e.target.closest("[data-drag-handle]");t&&(this.dom===t||this.dom.contains(t))&&(this.captureEvents=!1,document.addEventListener("dragend",()=>{this.captureEvents=!0},{once:!0}))}const n="copy"===e.type,r="paste"===e.type,o="cut"===e.type,i=e.type.startsWith("drag")||"drop"===e.type;return!(t&&i||n||r||o)&&this.captureEvents}selectNode(){this.updateComponentProps({selected:!0})}deselectNode(){this.updateComponentProps({selected:!1})}getMarkPos(){const e=this.view.posAtDOM(this.dom);return U(this.view.state.doc.resolve(e),this.node.type)}destroy(){this.vm.$destroy()}}class ie{constructor(e={}){this.options={...this.defaultOptions,...e}}init(){return null}bindEditor(e=null){this.editor=e}get name(){return null}get type(){return"extension"}get defaultOptions(){return{}}get plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class se{constructor(e=[],t){e.forEach(e=>{e.bindEditor(t),e.init()}),this.extensions=e}get nodes(){return this.extensions.filter(e=>"node"===e.type).reduce((e,{name:t,schema:n})=>({...e,[t]:n}),{})}get options(){const{view:e}=this;return this.extensions.reduce((t,n)=>({...t,[n.name]:new Proxy(n.options,{set(t,n,r){const o=t[n]!==r;return Object.assign(t,{[n]:r}),o&&e.updateState(e.state),!0}})}),{})}get marks(){return this.extensions.filter(e=>"mark"===e.type).reduce((e,{name:t,schema:n})=>({...e,[t]:n}),{})}get plugins(){return this.extensions.filter(e=>e.plugins).reduce((e,{plugins:t})=>[...e,...t],[])}keymaps({schema:e}){return[...this.extensions.filter(e=>["extension"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({schema:e})),...this.extensions.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({type:e["".concat(t.type,"s")][t.name],schema:e}))].map(e=>Object(c.b)(e))}inputRules({schema:e,excludedExtensions:t}){if(!(t instanceof Array)&&t)return[];const n=t instanceof Array?this.extensions.filter(e=>!t.includes(e.name)):this.extensions;return[...n.filter(e=>["extension"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({schema:e})),...n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({type:e["".concat(t.type,"s")][t.name],schema:e}))].reduce((e,t)=>[...e,...t],[])}pasteRules({schema:e,excludedExtensions:t}){if(!(t instanceof Array)&&t)return[];const n=t instanceof Array?this.extensions.filter(e=>!t.includes(e.name)):this.extensions;return[...n.filter(e=>["extension"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({schema:e})),...n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({type:e["".concat(t.type,"s")][t.name],schema:e}))].reduce((e,t)=>[...e,...t],[])}commands({schema:e,view:t}){return this.extensions.filter(e=>e.commands).reduce((n,r)=>{const{name:o,type:i}=r,s={},a=r.commands({schema:e,...["node","mark"].includes(i)?{type:e["".concat(i,"s")][o]}:{}}),c=(e,n)=>!!t.editable&&(t.focus(),e(n)(t.state,t.dispatch,t)),l=(e,t)=>{Array.isArray(t)?s[e]=e=>t.forEach(t=>c(t,e)):"function"==typeof t&&(s[e]=e=>c(t,e))};return"object"==typeof a?Object.entries(a).forEach(([e,t])=>{l(e,t)}):l(o,a),{...n,...s}},{})}}class ae extends ie{constructor(e={}){super(e)}get type(){return"mark"}get view(){return null}get schema(){return null}command(){return()=>{}}}function ce(e=0,t=0,n=0){return Math.min(Math.max(parseInt(e,10),t),n)}class le extends ie{constructor(e={}){super(e)}get type(){return"node"}get view(){return null}get schema(){return null}command(){return()=>{}}}class ue extends le{get name(){return"doc"}get schema(){return{content:"block+"}}}class pe extends le{get name(){return"paragraph"}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}commands({type:e}){return()=>k(e)}}class fe extends le{get name(){return"text"}get schema(){return{group:"inline"}}}class de extends class{on(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}emit(e,...t){this._callbacks=this._callbacks||{};const n=this._callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){if(arguments.length){const n=this._callbacks?this._callbacks[e]:null;n&&(t?this._callbacks[e]=n.filter(e=>e!==t):delete this._callbacks[e])}else this._callbacks={};return this}}{constructor(e={}){super(),this.defaultOptions={editorProps:{},editable:!0,autoFocus:null,extensions:[],content:"",topNode:"doc",emptyDocument:{type:"doc",content:[{type:"paragraph"}]},useBuiltInExtensions:!0,disableInputRules:!1,disablePasteRules:!1,dropCursor:{},enableDropCursor:!0,enableGapCursor:!0,parseOptions:{},injectCSS:!0,onInit:()=>{},onTransaction:()=>{},onUpdate:()=>{},onFocus:()=>{},onBlur:()=>{},onPaste:()=>{},onDrop:()=>{}},this.events=["init","transaction","update","focus","blur","paste","drop"],this.init(e)}init(e={}){this.setOptions({...this.defaultOptions,...e}),this.focused=!1,this.selection={from:0,to:0},this.element=document.createElement("div"),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.plugins=this.createPlugins(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),this.options.injectCSS&&function(e){{const t=document.createElement("style");t.type="text/css",t.textContent=e;const{head:n}=document,{firstChild:r}=n;r?n.insertBefore(t,r):n.appendChild(t)}}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n'),null!==this.options.autoFocus&&this.focus(this.options.autoFocus),this.events.forEach(e=>{var t;this.on(e,this.options[(t="on ".concat(e),t.replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,""))]||(()=>{}))}),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view}setOptions(e){this.options={...this.options,...e},this.view&&this.state&&this.view.updateState(this.state)}get builtInExtensions(){return this.options.useBuiltInExtensions?[new ue,new fe,new pe]:[]}get state(){return this.view?this.view.state:null}createExtensions(){return new se([...this.builtInExtensions,...this.options.extensions],this)}createPlugins(){return this.extensions.plugins}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createNodes(){return this.extensions.nodes}createMarks(){return this.extensions.marks}createSchema(){return new i.Schema({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return r.EditorState.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,(t={rules:this.inputRules},n=t.rules,o=new r.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,t,r,i){return D(e,t,r,i,n,o)},handleDOMEvents:{compositionend:function(e){setTimeout((function(){var t=e.state.selection.$cursor;t&&D(e,t.pos,t.pos,"",n,o)}))}}},isInputRules:!0}),o),...this.pasteRules,...this.keymaps,Object(c.b)({Backspace:R}),Object(c.b)($),...this.options.enableDropCursor?[(e=this.options.dropCursor,void 0===e&&(e={}),new r.Plugin({view:function(t){return new a(t,e)}}))]:[],...this.options.enableGapCursor?[new r.Plugin({props:{decorations:h,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&l.valid(n))return new l(n)},handleClick:d,handleKeyDown:p}})]:[],new r.Plugin({key:new r.PluginKey("editable"),props:{editable:()=>this.options.editable}}),new r.Plugin({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,t)=>{this.focused=!0,this.emit("focus",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!0);this.view.dispatch(n)},blur:(e,t)=>{this.focused=!1,this.emit("blur",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!1);this.view.dispatch(n)}}}}),new r.Plugin({props:this.options.editorProps})]});var e,t,n,o}createDocument(e,t=this.options.parseOptions){if(null===e)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof e)try{return this.schema.nodeFromJSON(e)}catch(t){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",t),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof e){const n="
".concat(e,"
"),r=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return i.DOMParser.fromSchema(this.schema).parse(r,t)}return!1}createView(){return new o.c(this.element,{state:this.createState(),handlePaste:(...e)=>{this.emit("paste",...e)},handleDrop:(...e)=>{this.emit("drop",...e)},dispatchTransaction:this.dispatchTransaction.bind(this)})}setParentComponent(e=null){e&&this.view.setProps({nodeViews:this.initNodeViews({parent:e,extensions:[...this.builtInExtensions,...this.options.extensions]})})}initNodeViews({parent:e,extensions:t}){return t.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.view).reduce((t,n)=>({...t,[n.name]:(t,r,o,i)=>{const s=n.view;return new oe(s,{editor:this,extension:n,parent:e,node:t,view:r,getPos:o,decorations:i})}}),{})}dispatchTransaction(e){const t=this.state.apply(e);this.view.updateState(t),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks(),this.emit("transaction",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emitUpdate(e)}emitUpdate(e){this.emit("update",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e})}resolveSelection(e=null){if(this.selection&&null===e)return this.selection;if("start"===e||!0===e)return{from:0,to:0};if("end"===e){const{doc:e}=this.state;return{from:e.content.size,to:e.content.size}}return{from:e,to:e}}focus(e=null){if(this.view.focused&&null===e||!1===e)return;const{from:t,to:n}=this.resolveSelection(e);this.setSelection(t,n),setTimeout(()=>this.view.focus(),10)}setSelection(e=0,t=0){const{doc:n,tr:o}=this.state,i=ce(e,0,n.content.size),s=ce(t,0,n.content.size),a=r.TextSelection.create(n,i,s),c=o.setSelection(a);this.view.dispatch(c)}blur(){this.view.dom.blur()}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.extensions.nodes,marks:this.extensions.marks}))}getHTML(){const e=document.createElement("div"),t=i.DOMSerializer.fromSchema(this.schema).serializeFragment(this.state.doc.content);return e.appendChild(t),e.innerHTML}getJSON(){return this.state.doc.toJSON()}setContent(e={},t=!1,n){const{doc:o,tr:i}=this.state,s=this.createDocument(e,n),a=r.TextSelection.create(o,0,o.content.size),c=i.setSelection(a).replaceSelectionWith(s,!1).setMeta("preventUpdate",!t);this.view.dispatch(c)}clearContent(e=!1){this.setContent(this.options.emptyDocument,e)}setActiveNodesAndMarks(){this.activeMarks=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:(e={})=>{return t=this.state,r=n,o=t.selection,i=o.from,s=o.$from,a=o.to,o.empty?!!r.isInSet(t.storedMarks||s.marks()):!!t.doc.rangeHasMark(i,a,r);var t,r,o,i,s,a}}),{}),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:H(this.state,n)}),{}),this.activeNodes=Object.entries(this.schema.nodes).reduce((e,[t,n])=>({...e,[t]:(e={})=>W(this.state,n,e)}),{})}getMarkAttrs(e=null){return this.activeMarkAttrs[e]}getNodeAttrs(e=null){return{...J(this.state,this.schema.nodes[e])}}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce((e,[t,n])=>({...e,[t]:(e={})=>n(e)}),{})}registerPlugin(e=null,t){const n="function"==typeof t?t(e,this.state.plugins):[e,...this.state.plugins],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e=null){if(!e||!this.view.docView)return;const t=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith("".concat(e,"$")))});this.view.updateState(t)}destroy(){this.view&&this.view.destroy()}}var he={props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(e){e&&e.element&&this.$nextTick(()=>{this.$el.appendChild(e.element.firstChild),e.setParentComponent(this)})}}},render:e=>e("div"),beforeDestroy(){this.editor.element=this.$el}};class ve{constructor({options:e}){this.options=e,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.blurHandler=()=>{this.preventHide?this.preventHide=!1:this.options.editor.emit("menubar:focusUpdate",!1)},this.options.editor.on("blur",this.blurHandler)}handleClick(){this.preventHide=!0}destroy(){this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("blur",this.blurHandler)}}var me={props:{editor:{default:null,type:Object}},data:()=>({focused:!1}),watch:{editor:{immediate:!0,handler(e){e&&this.$nextTick(()=>{var t;e.registerPlugin((t={editor:e,element:this.$el},new r.Plugin({key:new r.PluginKey("menu_bar"),view:e=>new ve({editorView:e,options:t})}))),this.focused=e.focused,e.on("focus",()=>{this.focused=!0}),e.on("menubar:focusUpdate",e=>{this.focused=e})})}}},render(){return this.editor?this.$scopedSlots.default({focused:this.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getMarkAttrs.bind(this.editor),getNodeAttrs:this.editor.getNodeAttrs.bind(this.editor)}):null}};function ge(e,t,n){const r=document.createRange();return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r}function ye(e,t){const n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}function be(e,t,n=!1){const{node:r,offset:o}=e.docView.domFromPos(t);let i,s;if(3===r.nodeType)n&&o!1,...e},this.editorView=t,this.isActive=!1,this.left=0,this.bottom=0,this.top=0,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.focusHandler=({view:e})=>{this.update(e)},this.options.editor.on("focus",this.focusHandler),this.blurHandler=({event:e})=>{this.preventHide?this.preventHide=!1:this.hide(e)},this.options.editor.on("blur",this.blurHandler)}handleClick(){this.preventHide=!0}update(e,t){const{state:n}=e;if(e.composing)return;if(t&&t.doc.eq(n.doc)&&t.selection.eq(n.selection))return;if(n.selection.empty)return void this.hide();const{from:r,to:o}=n.selection,i=be(e,r),s=be(e,o,!0),a=this.options.element.offsetParent;if(!a)return void this.hide();const c=a.getBoundingClientRect(),l=this.options.element.getBoundingClientRect(),u=(i.left+s.left)/2-c.left;this.left=Math.round(this.options.keepInBounds?Math.min(c.width-l.width/2,Math.max(u,l.width/2)):u),this.bottom=Math.round(c.bottom-i.top),this.top=Math.round(s.bottom-c.top),this.isActive=!0,this.sendUpdate()}sendUpdate(){this.options.onUpdate({isActive:this.isActive,left:this.left,bottom:this.bottom,top:this.top})}hide(e){e&&e.relatedTarget&&this.options.element.parentNode&&this.options.element.parentNode.contains(e.relatedTarget)||(this.isActive=!1,this.sendUpdate())}destroy(){this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("focus",this.focusHandler),this.options.editor.off("blur",this.blurHandler)}}Boolean;n(11);var xe=n(3);new r.PluginKey("collab");var Se=function(){};Se.prototype.append=function(e){return e.length?(e=Se.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Se.prototype.prepend=function(e){return e.length?Se.from(e).append(this):this},Se.prototype.appendInner=function(e){return new Ce(this,e)},Se.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Se.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Se.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Se.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Se.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Se.from=function(e){return e instanceof Se?e:e&&e.length?new ke(e):Se.empty};var ke=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Se);Se.empty=new ke([]);var Ce=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return eo&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Se),_e=Se,Oe=function(e,t){this.items=e,this.eventCount=t};Oe.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=e.tr,l=[],u=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void u.push(e);if(r){u.push(new Me(e.map));var p,f=e.step.map(r.slice(o));f&&c.maybeStep(f).doc&&(p=c.mapping.maps[c.mapping.maps.length-1],l.push(new Me(p,null,null,l.length+u.length))),o--,p&&r.appendMap(p,o)}else c.maybeStep(e.step);return e.selection?(s=r?e.selection.map(r.slice(o)):e.selection,a=new Oe(n.items.slice(0,i).append(u.reverse().concat(l)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},Oe.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;cNe&&(d=v,(f=s).forEach((function(e,t){if(e.selection&&0==d--)return h=t,!1})),s=f.slice(h),i-=v),new Oe(s.append(o),i)},Oe.prototype.remapping=function(e,t){var n=new s.a;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)}),e,t),n},Oe.prototype.addMaps=function(e){return 0==this.eventCount?this:new Oe(this.items.append(e.map((function(e){return new Me(e)}))),this.eventCount)},Oe.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((function(e){e.selection&&s--}),r);var a=t;this.items.forEach((function(t){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(t.step){var l=e.steps[r].invert(e.docs[r]),u=t.selection&&t.selection.map(o.slice(a+1,r));u&&s++,n.push(new Me(c,l,u))}else n.push(new Me(c))}}),r);for(var c=[],l=t;l500&&(p=p.compress(this.items.length-n.length)),p},Oe.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Oe.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=e)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(t.slice(n)),c=a&&a.getMap();if(n--,c&&t.appendMap(c,n),a){var l=i.selection&&i.selection.map(t.slice(n));l&&o++;var u,p=new Me(c.invert(),a,l),f=r.length-1;(u=r.length&&r[f].merge(p))?r[f]=u:r.push(p)}}else i.map&&n--}),this.items.length,0),new Oe(_e.from(r.reverse()),o)},Oe.empty=new Oe(_e.empty,0);var Me=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};Me.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new Me(t.getMap().invert(),t,this.selection)}};var Ae=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},Ne=20;function Te(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function $e(e,t){if(!e)return null;for(var n=[],r=0;r=t[o]&&(n=!0)})),n}(n,e.prevRanges)),c=s?$e(e.prevRanges,n.mapping):Te(n.mapping.maps[n.steps.length-1]);return new Ae(e.done.addTransform(n,a?t.selection.getBookmark():null,r,Ie(t)),Oe.empty,c,n.time)}(n,r,t,e)}},config:e})}function ze(e,t){var n=Pe.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Ee(n,e,t,!1),!0)}function Be(e,t){var n=Pe.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Ee(n,e,t,!0),!0)}function Le(e){var t=Pe.getState(e);return t?t.done.eventCount:0}function Ve(e){var t=Pe.getState(e);return t?t.undone.eventCount:0}class He extends le{get name(){return"bullet_list"}get schema(){return{content:"list_item+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}commands({type:e,schema:t}){return()=>re(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-8":re(e,t.nodes.list_item)}}inputRules({type:e}){return[I(/^\s*([-+*])\s$/,e)]}}class Je extends le{get name(){return"heading"}get defaultOptions(){return{levels:[1,2,3,4,5,6]}}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map(e=>({tag:"h".concat(e),attrs:{level:e}})),toDOM:e=>["h".concat(e.attrs.level),0]}}commands({type:e,schema:t}){return n=>te(e,t.nodes.paragraph,n)}keys({type:e}){return this.options.levels.reduce((t,n)=>({...t,["Shift-Ctrl-".concat(n)]:k(e,{level:n})}),{})}inputRules({type:e}){return this.options.levels.map(t=>P(new RegExp("^(#{1,".concat(t,"})\\s$")),e,()=>({level:t})))}}class Ue extends le{get name(){return"horizontal_rule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}commands({type:e}){return()=>(t,n)=>n(t.tr.replaceSelectionWith(e.create()))}inputRules({type:e}){return[Q(/^(?:---|___\s|\*\*\*\s)$/,e)]}}class We extends le{get name(){return"list_item"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}keys({type:e}){return{Enter:(t=e,function(e,n){var r=e.selection,o=r.$from,a=r.$to,c=r.node;if(c&&c.isBlock||o.depth<2||!o.sameParent(a))return!1;var l=o.node(-1);if(l.type!=t)return!1;if(0==o.parent.content.size&&o.node(-1).childCount==o.indexAfter(-1)){if(2==o.depth||o.node(-3).type!=t||o.index(-2)!=o.node(-2).childCount-1)return!1;if(n){for(var u=i.Fragment.empty,p=o.index(-1)>0,f=o.depth-(p?1:2);f>=o.depth-3;f--)u=i.Fragment.from(o.node(f).copy(u));u=u.append(i.Fragment.from(t.createAndFill()));var d=e.tr.replace(o.before(p?null:-1),o.after(-3),new i.Slice(u,p?3:2,2));d.setSelection(e.selection.constructor.near(d.doc.resolve(o.pos+(p?3:2)))),n(d.scrollIntoView())}return!0}var h=a.pos==o.end()?l.contentMatchAt(0).defaultType:null,v=e.tr.delete(o.pos,a.pos),m=h&&[null,{type:h}];return!!Object(s.g)(v.doc,o.pos,2,m)&&(n&&n(v.split(o.pos,2,m).scrollIntoView()),!0)}),Tab:Z(e),"Shift-Tab":X(e)};var t}}class Ke extends le{get name(){return"ordered_list"}get schema(){return{attrs:{order:{default:1}},content:"list_item+",group:"block",parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1===e.attrs.order?["ol",0]:["ol",{start:e.attrs.order},0]}}commands({type:e,schema:t}){return()=>re(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-9":re(e,t.nodes.list_item)}}inputRules({type:e}){return[I(/^(\d+)\.\s$/,e,e=>({order:+e[1]}),(e,t)=>t.childCount+t.attrs.order===+e[1])]}}Object(xe.tableNodes)({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:e=>e.style.backgroundColor||null,setDOMAttr(e,t){if(e){const n={style:"".concat(t.style||"","background-color: ").concat(e,";")};Object.assign(t,n)}}}}});class qe extends ae{get name(){return"bold"}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:()=>["strong",0]}}keys({type:e}){return{"Mod-b":C(e)}}commands({type:e}){return()=>C(e)}inputRules({type:e}){return[Y(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e)]}pasteRules({type:e}){return[ee(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,e)]}}class Ge extends ae{get name(){return"code"}get schema(){return{excludes:"_",parseDOM:[{tag:"code"}],toDOM:()=>["code",0]}}keys({type:e}){return{"Mod-`":C(e)}}commands({type:e}){return()=>C(e)}inputRules({type:e}){return[Y(/(?:`)([^`]+)(?:`)$/,e)]}pasteRules({type:e}){return[ee(/(?:`)([^`]+)(?:`)/g,e)]}}class Xe extends ae{get name(){return"italic"}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}keys({type:e}){return{"Mod-i":C(e)}}commands({type:e}){return()=>C(e)}inputRules({type:e}){return[Y(/(?:^|[^_])(_([^_]+)_)$/,e),Y(/(?:^|[^*])(\*([^*]+)\*)$/,e)]}pasteRules({type:e}){return[ee(/_([^_]+)_/g,e),ee(/\*([^*]+)\*/g,e)]}}class Ze extends ae{get name(){return"strike"}get schema(){return{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:()=>["s",0]}}keys({type:e}){return{"Mod-d":C(e)}}commands({type:e}){return()=>C(e)}inputRules({type:e}){return[Y(/~([^~]+)~$/,e)]}pasteRules({type:e}){return[ee(/~([^~]+)~/g,e)]}}class Ye extends ae{get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:e=>"underline"===e}],toDOM:()=>["u",0]}}keys({type:e}){return{"Mod-u":C(e)}}commands({type:e}){return()=>C(e)}}class Qe extends ie{get name(){return"history"}get defaultOptions(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":ze,"Mod-y":Be,"Shift-Mod-z":Be,"Mod-я":ze,"Shift-Mod-я":Be}}get plugins(){return[je({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}commands(){return{undo:()=>ze,redo:()=>Be,undoDepth:()=>Le,redoDepth:()=>Ve}}}var et={props:{value:{type:String,default:""},ul:{type:Boolean,default:!0},heading:{type:Boolean,default:!0},hr:{type:Boolean,default:!0},ol:{type:Boolean,default:!0},bold:{type:Boolean,default:!0},code:{type:Boolean,default:!0},italic:{type:Boolean,default:!0},strike:{type:Boolean,default:!0},underline:{type:Boolean,default:!0},history:{type:Boolean,default:!0},asJson:{type:Boolean,default:!1}},components:{EditorContent:he,EditorMenuBar:me},data:function(){var e=this;return{editor:new de({extensions:[new He,new Je({levels:[1,2,3]}),new Ue,new We,new Ke,new qe,new Ge,new Xe,new Ze,new Ye,new Qe],content:e.value,onUpdate:function(t){var n=t.getHTML,r=t.getJSON;e.asJson?e.$emit("input",r()):e.$emit("input",n())},parseOptions:{preserveWhitespace:!0}})}},watch:{value:function(e){this.editor.setContent(e)}},beforeDestroy:function(){this.editor.destroy()}};n(22);function tt(e,t,n,r,o,i,s,a){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),s?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=c):o&&(c=a?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return{exports:e,options:l}}var nt=tt(et,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tiptap input cursor-text",on:{click:function(t){return e.editor.focus()}}},[n("editor-menu-bar",{attrs:{editor:e.editor},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.commands,o=t.isActive;return[n("div",{staticClass:"button-group"},[e.bold?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.bold"),expression:"__('voyager::tiptap.bold')"}],staticClass:"button font-bold small icon-only",class:[o.bold()?"accent":null],on:{click:r.bold}},[e._v("\n B\n ")]):e._e(),e._v(" "),e.italic?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.italic"),expression:"__('voyager::tiptap.italic')"}],staticClass:"button italic small icon-only",class:[o.italic()?"accent":null],on:{click:r.italic}},[e._v("\n I\n ")]):e._e(),e._v(" "),e.strike?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.strike"),expression:"__('voyager::tiptap.strike')"}],staticClass:"button line-through small icon-only",class:[o.strike()?"accent":null],on:{click:r.strike}},[e._v("\n S\n ")]):e._e(),e._v(" "),e.underline?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.underline"),expression:"__('voyager::tiptap.underline')"}],staticClass:"button underline small icon-only",class:[o.underline()?"accent":null],on:{click:r.underline}},[e._v("\n U\n ")]):e._e(),e._v(" "),e.code?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.code"),expression:"__('voyager::tiptap.code')"}],staticClass:"button small icon-only",class:[o.code()?"accent":null],on:{click:r.code}},[n("icon",{attrs:{icon:"code",size:5}})],1):e._e(),e._v(" "),n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.paragraph"),expression:"__('voyager::tiptap.paragraph')"}],staticClass:"button small icon-only",class:[o.paragraph()?"accent":null],on:{click:r.paragraph}},[e._v("\n P\n ")]),e._v(" "),e.ul?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.bullet_list"),expression:"__('voyager::tiptap.bullet_list')"}],staticClass:"button small icon-only",class:[o.bullet_list()?"accent":null],on:{click:r.bullet_list}},[e._v("\n UL\n ")]):e._e(),e._v(" "),e.ol?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.ordered_list"),expression:"__('voyager::tiptap.ordered_list')"}],staticClass:"button small icon-only",class:[o.ordered_list()?"accent":null],on:{click:r.ordered_list}},[e._v("\n OL\n ")]):e._e(),e._v(" "),e.hr?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.horizontal_rule"),expression:"__('voyager::tiptap.horizontal_rule')"}],staticClass:"button small icon-only",class:[o.horizontal_rule()?"accent":null],on:{click:r.horizontal_rule}},[e._v("\n HR\n ")]):e._e(),e._v(" "),e.heading?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.heading_1"),expression:"__('voyager::tiptap.heading_1')"}],staticClass:"button small icon-only",class:[o.heading({level:1})?"accent":null],on:{click:function(e){return r.heading({level:1})}}},[e._v("\n H1\n ")]):e._e(),e._v(" "),e.heading?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.heading_2"),expression:"__('voyager::tiptap.heading_2')"}],staticClass:"button small icon-only",class:[o.heading({level:2})?"accent":null],on:{click:function(e){return r.heading({level:2})}}},[e._v("\n H2\n ")]):e._e(),e._v(" "),e.heading?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.heading_3"),expression:"__('voyager::tiptap.heading_3')"}],staticClass:"button small icon-only",class:[o.heading({level:3})?"accent":null],on:{click:function(e){return r.heading({level:3})}}},[e._v("\n H3\n ")]):e._e(),e._v(" "),e.history?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.undo"),expression:"__('voyager::tiptap.undo')"}],staticClass:"button small icon-only",on:{click:r.undo}},[e._v("\n <\n ")]):e._e(),e._v(" "),e.history?n("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.__("voyager::tiptap.redo"),expression:"__('voyager::tiptap.redo')"}],staticClass:"button small icon-only",on:{click:r.redo}},[e._v("\n >\n ")]):e._e()])]}}])}),e._v(" "),n("editor-content",{staticClass:"content mt-2",attrs:{spellcheck:"false",editor:e.editor}})],1)}),[],!1,null,null,null).exports,rt=tt({props:["show","options","value","translatable"]},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["query"==e.show?e._t("default"):n("div",[e.options.display_length>0?n("span",[e._v("\n "+e._s(e.value.slice(0,e.options.display_length))+"\n ")]):n("span",[e._v("\n "+e._s(e.value)+"\n ")])])],2)}),[],!1,null,null,null).exports,ot=tt({props:["options","value"]},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("tiptap",{attrs:{"as-json":e.options.as_json,ul:e.options.ul,heading:e.options.heading,hr:e.options.hr,ol:e.options.ol,bold:e.options.bold,code:e.options.code,italic:e.options.italic,strike:e.options.strike,underline:e.options.underline,history:e.options.history,value:e.value},on:{input:function(t){return e.$emit("input",t)}}})],1)}),[],!1,null,null,null).exports,it={props:["options","data","translatable"]},st=(n(25),tt(it,(function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"tiptap",domProps:{innerHTML:this._s(this.translate(this.data,!this.translatable))}})}),[],!1,null,null,null).exports),at=tt({props:["options","column","show"]},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["list-options"==e.show?n("div",[n("label",{staticClass:"label",attrs:{for:"length"}},[e._v(e._s(e.__("voyager::generic.display_length")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.display_length,expression:"options.display_length"}],staticClass:"input w-full",attrs:{type:"text",id:"length"},domProps:{value:e.options.display_length},on:{input:function(t){t.target.composing||e.$set(e.options,"display_length",t.target.value)}}})]):"view-options"==e.show?n("div",[n("label",{staticClass:"label mt-4"},[e._v("Store JSON")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.as_json,expression:"options.as_json"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.as_json)?e._i(e.options.as_json,null)>-1:e.options.as_json},on:{change:function(t){var n=e.options.as_json,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"as_json",n.concat([null])):i>-1&&e.$set(e.options,"as_json",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"as_json",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Unordered List")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.ul,expression:"options.ul"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.ul)?e._i(e.options.ul,null)>-1:e.options.ul},on:{change:function(t){var n=e.options.ul,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"ul",n.concat([null])):i>-1&&e.$set(e.options,"ul",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"ul",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Heading")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.heading,expression:"options.heading"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.heading)?e._i(e.options.heading,null)>-1:e.options.heading},on:{change:function(t){var n=e.options.heading,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"heading",n.concat([null])):i>-1&&e.$set(e.options,"heading",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"heading",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Horizontal Rule")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.hr,expression:"options.hr"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.hr)?e._i(e.options.hr,null)>-1:e.options.hr},on:{change:function(t){var n=e.options.hr,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"hr",n.concat([null])):i>-1&&e.$set(e.options,"hr",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"hr",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Ordered List")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.ol,expression:"options.ol"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.ol)?e._i(e.options.ol,null)>-1:e.options.ol},on:{change:function(t){var n=e.options.ol,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"ol",n.concat([null])):i>-1&&e.$set(e.options,"ol",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"ol",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Bold")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.bold,expression:"options.bold"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.bold)?e._i(e.options.bold,null)>-1:e.options.bold},on:{change:function(t){var n=e.options.bold,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"bold",n.concat([null])):i>-1&&e.$set(e.options,"bold",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"bold",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Code")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.code,expression:"options.code"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.code)?e._i(e.options.code,null)>-1:e.options.code},on:{change:function(t){var n=e.options.code,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"code",n.concat([null])):i>-1&&e.$set(e.options,"code",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"code",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Italic")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.italic,expression:"options.italic"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.italic)?e._i(e.options.italic,null)>-1:e.options.italic},on:{change:function(t){var n=e.options.italic,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"italic",n.concat([null])):i>-1&&e.$set(e.options,"italic",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"italic",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Strike")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.strike,expression:"options.strike"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.strike)?e._i(e.options.strike,null)>-1:e.options.strike},on:{change:function(t){var n=e.options.strike,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"strike",n.concat([null])):i>-1&&e.$set(e.options,"strike",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"strike",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("Underline")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.underline,expression:"options.underline"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.underline)?e._i(e.options.underline,null)>-1:e.options.underline},on:{change:function(t){var n=e.options.underline,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"underline",n.concat([null])):i>-1&&e.$set(e.options,"underline",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"underline",o)}}}),e._v(" "),n("label",{staticClass:"label mt-4"},[e._v("History")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.options.history,expression:"options.history"}],staticClass:"input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.options.history)?e._i(e.options.history,null)>-1:e.options.history},on:{change:function(t){var n=e.options.history,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e._i(n,null);r.checked?i<0&&e.$set(e.options,"history",n.concat([null])):i>-1&&e.$set(e.options,"history",n.slice(0,i).concat(n.slice(i+1)))}else e.$set(e.options,"history",o)}}})]):"view"==e.show?n("div",[n("tiptap",{attrs:{"as-json":e.options.as_json,ul:e.options.ul,heading:e.options.heading,hr:e.options.hr,ol:e.options.ol,bold:e.options.bold,code:e.options.code,italic:e.options.italic,strike:e.options.strike,underline:e.options.underline,history:e.options.history}})],1):e._e()])}),[],!1,null,null,null).exports;Vue.component("tiptap",nt),Vue.component("formfield-tiptap-browse",rt),Vue.component("formfield-tiptap-edit-add",ot),Vue.component("formfield-tiptap-read",st),Vue.component("formfield-tiptap-builder",at)}]); \ No newline at end of file diff --git a/resources/src/components/Formfield/Read.vue b/resources/src/components/Formfield/Read.vue index 26f24a5..962fef7 100644 --- a/resources/src/components/Formfield/Read.vue +++ b/resources/src/components/Formfield/Read.vue @@ -1,5 +1,5 @@ @@ -7,4 +7,18 @@ export default { props: ['options', 'data', 'translatable'], }; - \ No newline at end of file + + + \ No newline at end of file diff --git a/resources/src/components/TipTap.vue b/resources/src/components/TipTap.vue index 32a861d..faf95bd 100644 --- a/resources/src/components/TipTap.vue +++ b/resources/src/components/TipTap.vue @@ -164,15 +164,13 @@ export default { }; - -