summaryrefslogtreecommitdiff
path: root/priv/static/adminfe/static/js/chunk-0e2d.04760e2c.js
blob: 713bc62753463e319c5625fccbcd38368f1ff989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0e2d"],{"+/fp":function(e,t){e.exports=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}},"49oK":function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return m});for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=s||o&&+o[1]<57,c=0;c<10;c++)r[48+c]=r[96+c]=String(c);for(c=1;c<=24;c++)r[c+111]="F"+c;for(c=65;c<=90;c++)r[c]=String.fromCharCode(c+32),i[c]=String.fromCharCode(c);for(var h in r)i.hasOwnProperty(h)||(i[h]=r[h]);var d=n("b/sn");const u="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function p(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let l=0;l<o.length-1;l++){let e=o[l];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);u?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function f(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function m(e){return new d.d({props:{handleKeyDown:g(e)}})}function g(e){let t=function(e){let t=Object.create(null);for(let n in e)t[p(n)]=e[n];return t}(e);return function(e,n){let o,s=function(e){var t=!(a&&(e.ctrlKey||e.altKey||e.metaKey)||l&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?i:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),c=1==s.length&&" "!=s,h=t[f(s,n,!c)];if(h&&h(e.state,e.dispatch,e))return!0;if(c&&(n.shiftKey||n.altKey||n.metaKey||s.charCodeAt(0)>127)&&(o=r[n.keyCode])&&o!=s){let r=t[f(o,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}else if(c&&n.shiftKey){let r=t[f(s,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}},"4MG8":function(e,t,n){const r=n("T9Ld"),i=n("66f7"),o=n("SbYC"),s=n("+/fp"),l=n("hyX7"),a=n("J7Ao"),{merge:c,checkSanitizeDeprecation:h,escape:d}=n("rUJ1"),{getDefaults:u,changeDefaults:p,defaults:f}=n("vbtb");function m(e,t,n){if(void 0===e||null===e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(n||"function"==typeof t){n||(n=t,t=null),t=c({},m.defaults,t||{}),h(t);const o=t.highlight;let s,l,a=0;try{s=r.lex(e,t)}catch(e){return n(e)}l=s.length;const d=function(e){if(e)return t.highlight=o,n(e);let r;try{r=i.parse(s,t)}catch(t){e=t}return t.highlight=o,e?n(e):n(null,r)};if(!o||o.length<3)return d();if(delete t.highlight,!l)return d();for(;a<s.length;a++)!function(e){"code"!==e.type?--l||d():o(e.text,e.lang,function(t,n){return t?d(t):null==n||n===e.text?--l||d():(e.text=n,e.escaped=!0,void(--l||d()))})}(s[a])}else try{return t=c({},m.defaults,t||{}),h(t),i.parse(r.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||m.defaults).silent)return"<p>An error occurred:</p><pre>"+d(e.message+"",!0)+"</pre>";throw e}}m.options=m.setOptions=function(e){return c(m.defaults,e),p(m.defaults),m},m.getDefaults=u,m.defaults=f,m.Parser=i,m.parser=i.parse,m.Renderer=o,m.TextRenderer=s,m.Lexer=r,m.lexer=r.lex,m.InlineLexer=l,m.inlineLexer=l.output,m.Slugger=a,m.parse=m,e.exports=m},"66f7":function(e,t,n){const r=n("SbYC"),i=n("J7Ao"),o=n("hyX7"),s=n("+/fp"),{defaults:l}=n("vbtb"),{merge:a,unescape:c}=n("rUJ1");e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||l,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new i}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new o(e.links,this.options),this.inlineText=new o(e.links,a({},this.options,{renderer:new s})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,c(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,i,o="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(o+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",i=0;i<n.length;i++)r+=this.renderer.tablecell(this.inline.output(n[i]),{header:!1,align:this.token.align[i]});e+=this.renderer.tablerow(r)}return this.renderer.table(o,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},"8j27":function(e,t,n){"use strict";n.d(t,"a",function(){return ne}),n.d(t,"b",function(){return ce}),n.d(t,"c",function(){return re}),n.d(t,"d",function(){return ie}),n.d(t,"e",function(){return oe}),n.d(t,"f",function(){return pe}),n.d(t,"g",function(){return se}),n.d(t,"h",function(){return he}),n.d(t,"i",function(){return de}),n.d(t,"j",function(){return le}),n.d(t,"k",function(){return ae}),n.d(t,"l",function(){return ue});var r=n("zUJn"),i=n("qd4/"),o=(n("POQ2"),n("cD+i"),n("oV9I")),s=n("MEpN"),l=n("b/sn"),a=n("49oK"),c=n("uSMm");let h,d;if("undefined"!=typeof WeakMap){let e=new WeakMap;h=(t=>e.get(t)),d=((t,n)=>(e.set(t,n),n))}else{let e=[],t=10,n=0;h=(t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]}),d=((r,i)=>(n==t&&(n=0),e[n++]=r,e[n++]=i))}class u{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class p{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,o=r+1,s=i+1;for(let e=1;o<this.width&&this.map[t+e]==n;e++)o++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return new u(r,i,o,s)}throw new RangeError("No cell with offset "+e+" found")}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")}nextCell(e,t,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?0==o:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:s,right:l,top:a,bottom:c}=this.findCell(t);return new u(Math.min(n,s),Math.min(i,a),Math.max(r,l),Math.max(o,c))}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,i==e.left&&i&&this.map[o-1]==s||r==e.top&&r&&this.map[o-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?o-1:this.map[n]}i=o}}static get(e){return h(e)||d(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),o=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(o+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);o+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=o:t!=o&&(t=Math.max(t,o))}return t}(e),n=e.childCount,r=[],i=0,o=null,s=[];for(let c=0,h=t*n;c<h;c++)r[c]=0;for(let c=0,h=0;c<n;c++){let l=e.child(c);h++;for(let e=0;;e++){for(;i<r.length&&0!=r[i];)i++;if(e==l.childCount)break;let a=l.child(e),{colspan:d,rowspan:u,colwidth:p}=a.attrs;for(let e=0;e<u;e++){if(e+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:h,n:u-e});break}let l=i+e*t;for(let e=0;e<d;e++){0==r[l+e]?r[l+e]=h:(o||(o=[])).push({type:"collision",row:c,pos:h,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=s[r];null==i||i!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):i==n&&s[r+1]++}}}i+=d,h+=a.nodeSize}let a=(c+1)*t,d=0;for(;i<a;)0==r[i++]&&d++;d&&(o||(o=[])).push({type:"missing",row:c,n:d}),h++}let l=new p(t,n,r,o),a=!1;for(let c=0;!a&&c<s.length;c+=2)null!=s[c]&&s[c+1]<n&&(a=!0);a&&function(e,t,n){e.problems||(e.problems=[]);for(let r=0,i={};r<e.map.length;r++){let o=e.map[r];if(i[o])continue;i[o]=!0;let s=n.nodeAt(o),l=null;for(let n=0;n<s.attrs.colspan;n++){let i=(r+n)%e.width,o=t[2*i];null==o||s.attrs.colwidth&&s.attrs.colwidth[n]==o||((l||(l=f(s.attrs)))[n]=o)}l&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:l})}}(l,s,e);return l}(e))}}function f(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function m(e,t){let n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(e=>Number(e)):null,i=Number(e.getAttribute("colspan")||1),o={colspan:i,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==i?r:null};for(let s in t){let n=t[s].getFromDOM,r=n&&n(e);null!=r&&(o[s]=r)}return o}function g(e,t){let n={};1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(let r in t){let i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function y(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}new l.e("selectingCells");function v(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function b(e){let t=e.selection.$head;for(let n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function w(e){let 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:v(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head)}function x(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function k(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function S(e,t,n){let r=e.start(-1),i=p.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==i?null:e.node(0).resolve(r+i)}function C(e,t,n){let r={};for(let i in e)r[i]=e[i];return r[t]=n,r}function O(e,t,n=1){let r=C(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}class M extends l.f{constructor(e,t=e){let n=e.node(-1),r=p.get(n),i=e.start(-1),o=r.rectBetween(e.pos-i,t.pos-i),s=e.node(0),a=r.cellsInRect(o).filter(e=>e!=t.pos-i);a.unshift(t.pos-i);let c=a.map(e=>{let t=n.nodeAt(e),r=e+i+1;return new l.g(s.resolve(r),s.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){let n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(x(n)&&x(r)&&k(n,r)){let e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?M.rowSelection(n,r):e&&this.isColSelection()?M.colSelection(n,r):new M(n,r)}return l.h.between(n,r)}content(){let e=this.$anchorCell.node(-1),t=p.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let a=r.top;a<r.bottom;a++){let n=[];for(let o=a*t.width+r.left,s=r.left;s<r.right;s++,o++){let s=t.map[o];if(!i[s]){i[s]=!0;let o=t.findCell(s),l=e.nodeAt(s),a=r.left-o.left,c=o.right-r.right;if(a>0||c>0){let e=l.attrs;a>0&&(e=O(e,0,a)),c>0&&(e=O(e,e.colspan-c,c)),l=o.left<r.left?l.type.createAndFill(e):l.type.create(e,l.content)}if(o.top<r.top||o.bottom>r.bottom){let e=C(l.attrs,"rowspan",Math.min(o.bottom,r.bottom)-Math.max(o.top,r.top));l=o.top<r.top?l.type.createAndFill(e):l.type.create(e,l.content)}n.push(l)}}o.push(e.child(a).copy(s.c.from(n)))}const l=this.isColSelection()&&this.isRowSelection()?e:o;return new s.j(s.c.from(l),1,1)}replace(e,t=s.j.empty){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:l}=r[o],a=e.mapping.slice(n);e.replace(a.map(i.pos),a.map(l.pos),o?s.j.empty:t)}let i=l.f.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new s.j(s.c.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=p.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let o=0;o<i.length;o++)e(t.nodeAt(i[o]),r+i[o])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){let n=p.get(e.node(-1)),r=e.start(-1),i=n.findCell(e.pos-r),o=n.findCell(t.pos-r),s=e.node(0);return i.top<=o.top?(i.top>0&&(e=s.resolve(r+n.map[i.left])),o.bottom<n.height&&(t=s.resolve(r+n.map[n.width*(n.height-1)+o.right-1]))):(o.top>0&&(t=s.resolve(r+n.map[o.left])),i.bottom<n.height&&(e=s.resolve(r+n.map[n.width*(n.height-1)+i.right-1]))),new M(e,t)}isRowSelection(){let e=p.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;let i=n+this.$anchorCell.nodeAfter.attrs.colspan,o=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,o)==e.width}eq(e){return e instanceof M&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){let n=p.get(e.node(-1)),r=e.start(-1),i=n.findCell(e.pos-r),o=n.findCell(t.pos-r),s=e.node(0);return i.left<=o.left?(i.left>0&&(e=s.resolve(r+n.map[i.top*n.width])),o.right<n.width&&(t=s.resolve(r+n.map[n.width*(o.top+1)-1]))):(o.left>0&&(t=s.resolve(r+n.map[o.top*n.width])),i.right<n.width&&(e=s.resolve(r+n.map[n.width*(i.top+1)-1]))),new M(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new M(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new M(e.resolve(t),e.resolve(n))}getBookmark(){return new N(this.$anchorCell.pos,this.$headCell.pos)}}M.prototype.visible=!1,l.f.jsonID("cell",M);class N{constructor(e,t){this.anchor=e,this.head=t}map(e){return new N(e.map(this.anchor),e.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&k(t,n)?new M(t,n):l.f.near(n,1)}}Object(a.a)({ArrowLeft:A("horiz",-1),ArrowRight:A("horiz",1),ArrowUp:A("vert",-1),ArrowDown:A("vert",1),"Shift-ArrowLeft":D("horiz",-1),"Shift-ArrowRight":D("horiz",1),"Shift-ArrowUp":D("vert",-1),"Shift-ArrowDown":D("vert",1),Backspace:T,"Mod-Backspace":T,Delete:T,"Mod-Delete":T});function E(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function A(e,t){return(n,r,i)=>{let o=n.selection;if(o instanceof M)return E(n,r,l.f.near(o.$headCell,t));if("horiz"!=e&&!o.empty)return!1;let s=R(i,e,t);if(null==s)return!1;if("horiz"==e)return E(n,r,l.f.near(n.doc.resolve(o.head+t),t));{let i,o=n.doc.resolve(s),a=S(o,e,t);return E(n,r,i=a?l.f.near(a,1):t<0?l.f.near(n.doc.resolve(o.before(-1)),-1):l.f.near(n.doc.resolve(o.after(-1)),1))}}}function D(e,t){return(n,r,i)=>{let o=n.selection;if(!(o instanceof M)){let r=R(i,e,t);if(null==r)return!1;o=new M(n.doc.resolve(r))}let s=S(o.$headCell,e,t);return!!s&&E(n,r,new M(o.$anchorCell,s))}}function T(e,t){let n=e.selection;if(!(n instanceof M))return!1;if(t){let r=e.tr,i=y(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.j(i,0,0))}),r.docChanged&&t(r)}return!0}function R(e,t,n){if(!(e.state.selection instanceof l.h))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){let o=r.before(i),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?o:null}}return null}new l.e("fix-tables");function I(e){let t,n=e.selection,r=w(e),i=r.node(-1),o=r.start(-1),s=p.get(i);return(t=n instanceof M?s.rectBetween(n.$anchorCell.pos-o,n.$headCell.pos-o):s.findCell(r.pos-o)).tableStart=o,t.map=s,t.table=i,t}function $(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let i=0;i<r.length;i++){const e=t.table.nodeAt(r[i]);if(e&&e.type!==n.header_cell)return!1}return!0}function z(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!b(t))return!1;if(n){let r=y(t.schema),i=I(t),o=t.tr,s=i.map.cellsInRect("column"==e?new u(i.left,0,i.right,i.map.height):"row"==e?new u(0,i.top,i.map.width,i.bottom):i),l=s.map(e=>i.table.nodeAt(e));for(let e=0;e<s.length;e++)l[e].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[e],r.cell,l[e].attrs);if(0==o.steps.length)for(let e=0;e<s.length;e++)o.setNodeMarkup(i.tableStart+s[e],r.header_cell,l[e].attrs);n(o)}return!0}}(e):function(t,n){if(!b(t))return!1;if(n){let r=y(t.schema),i=I(t),o=t.tr,s=$("row",i,r),l=$("column",i,r),a=("column"===e?s:"row"===e&&l)?1:0,c="column"==e?new u(0,a,1,i.map.height):"row"==e?new u(a,0,i.map.width,1):i,h="column"==e?l?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;i.map.cellsInRect(c).forEach(e=>{const t=e+i.tableStart,n=o.doc.nodeAt(t);n&&o.setNodeMarkup(t,h,n.attrs)}),n(o)}return!0}}z("row",{useDeprecatedLogic:!0}),z("column",{useDeprecatedLogic:!0}),z("cell",{useDeprecatedLogic:!0});new l.e("tableColumnResizing");new l.e("collab");var P=function(){};P.prototype.append=function(e){return e.length?(e=P.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},P.prototype.prepend=function(e){return e.length?P.from(e).append(this):this},P.prototype.appendInner=function(e){return new j(this,e)},P.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?P.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},P.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},P.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)},P.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},P.from=function(e){return e instanceof P?e:e&&e.length?new _(e):P.empty};var _=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 i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))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}(P);P.empty=new _([]);var j=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 e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=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}(P),B=P;const V=500;class L{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,l=e.tr,a=[],c=[];return this.items.forEach((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new F(e.map));let t,i=e.step.map(n.slice(r));i&&l.maybeStep(i).doc&&(t=l.mapping.maps[l.mapping.maps.length-1],a.push(new F(t,void 0,void 0,a.length+c.length))),r--,t&&n.appendMap(t,r)}else l.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new L(this.items.slice(0,i).append(c.reverse().concat(a)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:s,transform:l,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,l=!r&&s.length?s.get(s.length-1):null;for(let c=0;c<e.steps.length;c++){let n,a=e.steps[c].invert(e.docs[c]),h=new F(e.mapping.maps[c],a,t);(n=l&&l.merge(h))&&(h=n,c?i.pop():s=s.slice(0,s.length-1)),i.push(h),t&&(o++,t=void 0),r||(l=h)}let a=o-n.depth;return a>J&&(s=function(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&0==t--)return n=r,!1}),e.slice(n)}(s,a),o-=a),new L(s.append(i),o)}remapping(e,t){let n=new c.a;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new L(this.items.append(e.map(e=>new F(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let l=t;this.items.forEach(t=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(l+1,r));c&&s++,n.push(new F(a,o,c))}else n.push(new F(a))},r);let a=[];for(let d=t;d<o;d++)a.push(new F(i.maps[d]));let c=this.items.slice(0,r).append(a).append(n),h=new L(c,s);return h.emptyItemCount()>V&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=o.selection&&o.selection.map(t.slice(n));l&&i++;let a,c=new F(s.invert(),e,l),h=r.length-1;(a=r.length&&r[h].merge(c))?r[h]=a:r.push(c)}}else o.map&&n--},this.items.length,0),new L(B.from(r.reverse()),i)}}L.empty=new L(B.empty,0);class F{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new F(t.getMap().invert(),t,this.selection)}}}class q{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const J=20;function W(e){let t=[];return e.forEach((e,n,r,i)=>t.push(r,i)),t}function H(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function K(e,t,n,r){let i=Z(t),o=X.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,i);if(!s)return;let l=s.selection.resolve(s.transform.doc),a=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,i),c=new q(r?a:s.remaining,r?s.remaining:a,null,0);n(s.transform.setSelection(l).setMeta(X,{redo:r,historyState:c}).scrollIntoView())}let U=!1,G=null;function Z(e){let t=e.plugins;if(G!=t){U=!1,G=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){U=!0;break}}return U}const X=new l.e("history"),Y=new l.e("closeHistory");function Q(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new l.d({key:X,state:{init:()=>new q(L.empty,L.empty,null,0),apply:(t,n,r)=>(function(e,t,n,r){let i,o=n.getMeta(X);if(o)return o.historyState;n.getMeta(Y)&&(e=new q(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(X))return s.getMeta(X).redo?new q(e.done.addTransform(n,void 0,r,Z(t)),e.undone,W(n.mapping.maps[n.steps.length-1]),e.prevTime):new q(e.done,e.undone.addTransform(n,void 0,r,Z(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new q(e.done.rebased(n,i),e.undone.rebased(n,i),H(e.prevRanges,n.mapping),e.prevTime):new q(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),H(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),o=s?H(e.prevRanges,n.mapping):W(n.mapping.maps[n.steps.length-1]);return new q(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Z(t)),L.empty,o,n.time)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?ee:"historyRedo"==n?te:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const ee=(e,t)=>{let n=X.getState(e);return!(!n||0==n.done.eventCount)&&(t&&K(n,e,t,!1),!0)},te=(e,t)=>{let n=X.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&K(n,e,t,!0),!0)};
/*!
    * tiptap-extensions v1.35.1
    * (c) 2021 überdosis GbR (limited liability)
    * @license MIT
    */
class ne extends r.f{get name(){return"blockquote"}get schema(){return{content:"block*",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}commands({type:e}){return()=>Object(i.s)(e)}keys({type:e}){return{"Ctrl->":Object(i.s)(e)}}inputRules({type:e}){return[Object(i.u)(/^\s*>\s$/,e)]}}class re extends r.f{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()=>Object(i.q)(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-8":Object(i.q)(e,t.nodes.list_item)}}inputRules({type:e}){return[Object(i.u)(/^\s*([-+*])\s$/,e)]}}class ie extends r.f{get name(){return"code_block"}get schema(){return{content:"text*",marks:"",group:"block",code:!0,defining:!0,draggable:!1,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:()=>["pre",["code",0]]}}commands({type:e,schema:t}){return()=>Object(i.p)(e,t.nodes.paragraph)}keys({type:e}){return{"Shift-Ctrl-\\":Object(i.k)(e)}}inputRules({type:e}){return[Object(i.o)(/^```$/,e)]}}class oe extends r.f{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${e}`,attrs:{level:e}})),toDOM:e=>[`h${e.attrs.level}`,0]}}commands({type:e,schema:t}){return n=>Object(i.p)(e,t.nodes.paragraph,n)}keys({type:e}){return this.options.levels.reduce((t,n)=>({...t,...{[`Shift-Ctrl-${n}`]:Object(i.k)(e,{level:n})}}),{})}inputRules({type:e}){return this.options.levels.map(t=>Object(i.o)(new RegExp(`^(#{1,${t}})\\s$`),e,()=>({level:t})))}}class se extends r.f{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[Object(i.g)(/^(?:---|___\s|\*\*\*\s)$/,e)]}}class le extends r.f{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:Object(i.m)(e),Tab:Object(i.l)(e),"Shift-Tab":Object(i.d)(e)}}}class ae extends r.f{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()=>Object(i.q)(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-9":Object(i.q)(e,t.nodes.list_item)}}inputRules({type:e}){return[Object(i.u)(/^(\d+)\.\s$/,e,e=>({order:+e[1]}),(e,t)=>t.childCount+t.attrs.order===+e[1])]}}!function(e){let t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(let r in t)n[r]={default:t[r].default};e.tableGroup,e.cellContent,e.cellContent}({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:e=>e.style.backgroundColor||null,setDOMAttr(e,t){if(e){const n={style:`${t.style||""}background-color: ${e};`};Object.assign(t,n)}}}}});class ce extends r.e{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":Object(i.r)(e)}}commands({type:e}){return()=>Object(i.r)(e)}inputRules({type:e}){return[Object(i.e)(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e)]}pasteRules({type:e}){return[Object(i.f)(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,e)]}}class he extends r.e{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":Object(i.r)(e)}}commands({type:e}){return()=>Object(i.r)(e)}inputRules({type:e}){return[Object(i.e)(/(?:^|[^_])(_([^_]+)_)$/,e),Object(i.e)(/(?:^|[^*])(\*([^*]+)\*)$/,e)]}pasteRules({type:e}){return[Object(i.f)(/_([^_]+)_/g,e),Object(i.f)(/\*([^*]+)\*/g,e)]}}class de extends r.e{get name(){return"link"}get defaultOptions(){return{openOnClick:!0,target:null}}get schema(){return{attrs:{href:{default:null},target:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),target:e.getAttribute("target")})}],toDOM:e=>["a",{...e.attrs,rel:"noopener noreferrer nofollow",target:e.attrs.target||this.options.target},0]}}commands({type:e}){return t=>t.href?Object(i.t)(e,t):Object(i.i)(e)}pasteRules({type:e}){return[Object(i.h)(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,()!]*)/gi,e,e=>({href:e}))]}get plugins(){return this.options.openOnClick?[new r.g({props:{handleClick:(e,t,n)=>{const{schema:r}=e.state,i=Object(o.d)(e.state,r.marks.link);i.href&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(i.href,i.target))}}})]:[]}}class ue extends r.e{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":Object(i.r)(e)}}commands({type:e}){return()=>Object(i.r)(e)}}class pe extends r.d{get name(){return"history"}get defaultOptions(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":ee,"Mod-y":te,"Shift-Mod-z":te,"Mod-я":ee,"Shift-Mod-я":te}}get plugins(){return[Q({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}commands(){return{undo:()=>ee,redo:()=>te,undoDepth:()=>(function(e){let t=X.getState(e);return t?t.done.eventCount:0}),redoDepth:()=>(function(e){let t=X.getState(e);return t?t.undone.eventCount:0})}}}},Bz7v:function(e,t,n){"use strict";var r=n("Xb7u"),i=o(Error);function o(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=r.apply(null,arguments)),new e(t)}}e.exports=i,i.eval=o(EvalError),i.range=o(RangeError),i.reference=o(ReferenceError),i.syntax=o(SyntaxError),i.type=o(TypeError),i.uri=o(URIError),i.create=o},ECCn:function(e,t){function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];"object"!=typeof r||Object.isFrozen(r)||n(r)}),e}var r=n,i=n;r.default=i;class o{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function s(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function l(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}const a="</span>",c=e=>!!e.kind;class h{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=s(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+=a)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class d{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=>{d._collapse(e)}))}}class u extends d{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 h(this,this.options).value()}finalize(){return!0}}function p(e){return e?"string"==typeof e?e:e.source:null}const f=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const m="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",g={begin:"\\\\[\\s\\S]",relevance:0},y={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[g]},v={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[g]},b={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/},w=function(e,t,n={}){const r=l({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(b),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},x=w("//","$"),k=w("/\\*","\\*/"),S=w("#","$"),C={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},O={className:"number",begin:m,relevance:0},M={className:"number",begin:"\\b(0b[01]+)",relevance:0},N={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},E={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[g,{begin:/\[/,end:/\]/,relevance:0,contains:[g]}]}]},A={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},D={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},T={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var R=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:m,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>p(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),l({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:g,APOS_STRING_MODE:y,QUOTE_STRING_MODE:v,PHRASAL_WORDS_MODE:b,COMMENT:w,C_LINE_COMMENT_MODE:x,C_BLOCK_COMMENT_MODE:k,HASH_COMMENT_MODE:S,NUMBER_MODE:C,C_NUMBER_MODE:O,BINARY_NUMBER_MODE:M,CSS_NUMBER_MODE:N,REGEXP_MODE:E,TITLE_MODE:A,UNDERSCORE_TITLE_MODE:D,METHOD_GUARD:T,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()}})}});function I(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function $(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>p(e)).join("|")+")"}(...e.illegal))}const z=["of","and","for","in","not","or","if","then","parent","list","value"],P="keyword";function _(e,t,n=P){const r={};return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,_(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){const n=t.split("|");r[n[0]]=[e,function(e,t){if(t)return Number(t);return function(e){return z.includes(e.toLowerCase())}(e)?0:1}(n[0],n[1])]})}}function j(e,{plugins:t}){function n(t,n){return new RegExp(p(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class r{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=n(function(e,t="|"){let n=0;return e.map(e=>{const t=n+=1;let r=p(e),i="";for(;r.length>0;){const e=f.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}(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 i{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 r;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}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;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),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 e.classNameAliases=l(e.classNameAliases||{}),function t(r,o){const s=r;if(r.isCompiled)return s;[function(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}].forEach(e=>e(r,o)),e.compilerExtensions.forEach(e=>e(r,o)),r.__beforeBegin=null,[function(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))},$,function(e,t){void 0===e.relevance&&(e.relevance=1)}].forEach(e=>e(r,o)),r.isCompiled=!0;let a=null;if("object"==typeof r.keywords&&(a=r.keywords.$pattern,delete r.keywords.$pattern),r.keywords&&(r.keywords=_(r.keywords,e.case_insensitive)),r.lexemes&&a)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return a=a||r.lexemes||/\w+/,s.keywordPatternRe=n(a,!0),o&&(r.begin||(r.begin=/\B|\b/),s.beginRe=n(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(s.endRe=n(r.end)),s.terminatorEnd=p(r.end)||"",r.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),r.illegal&&(s.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map(function(e){return function(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return l(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e)?l(e,{starts:e.starts?l(e.starts):null}):Object.isFrozen(e)?l(e):e}("self"===e?r:e)})),r.contains.forEach(function(e){t(e,s)}),r.starts&&t(r.starts,o),s.matcher=function(e){const t=new i;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function B(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,s(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||function(e){return Boolean(e||""===e)}(this.autodetect)},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const V={"after:highlightElement":({el:e,result:t,text:n})=>{const r=F(e);if(!r.length)return;const i=document.createElement("div");i.innerHTML=t.value,t.value=function(e,t,n){let r=0,i="";const o=[];function l(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function a(e){i+="<"+L(e)+[].map.call(e.attributes,function(e){return" "+e.nodeName+'="'+s(e.value)+'"'}).join("")+">"}function c(e){i+="</"+L(e)+">"}function h(e){("start"===e.event?a:c)(e.node)}for(;e.length||t.length;){let t=l();if(i+=s(n.substring(r,t[0].offset)),r=t[0].offset,t===e){o.reverse().forEach(c);do{h(t.splice(0,1)[0]),t=l()}while(t===e&&t.length&&t[0].offset===r);o.reverse().forEach(a)}else"start"===t[0].event?o.push(t[0].node):o.pop(),h(t.splice(0,1)[0])}return i+s(n.substr(r))}(r,F(i),n)}};function L(e){return e.nodeName.toLowerCase()}function F(e){const t=[];return function e(n,r){for(let i=n.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:r,node:i}),r=e(i,r),L(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:i}));return r}(e,0),t}const q={},J=e=>{console.error(e)},W=(e,...t)=>{console.log(`WARN: ${e}`,...t)},H=(e,t)=>{q[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),q[`${e}/${t}`]=!0)},K=s,U=l,G=Symbol("nomatch");var Z=function(e){const t=Object.create(null),n=Object.create(null),i=[];let s=!0;const l=/(^(<[^>]+>|\t|)+|\n)/gm,a="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let h={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:u};function d(e){return h.noHighlightRe.test(e)}function p(e,t,n,r){let i="",o="";"object"==typeof t?(i=e,n=t.ignoreIllegals,o=t.language,r=void 0):(H("10.7.0","highlight(lang, code, ...args) has been deprecated."),H("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,i=t);const s={code:i,language:o};M("before:highlight",s);const l=s.result?s.result:f(s.language,s.code,n,r);return l.code=s.code,M("after:highlight",l),l}function f(e,n,r,l){function c(e,t){const n=w.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function d(){null!=C.subLanguage?function(){if(""===N)return;let e=null;if("string"==typeof C.subLanguage){if(!t[C.subLanguage])return void M.addText(N);e=f(C.subLanguage,N,!0,O[C.subLanguage]),O[C.subLanguage]=e.top}else e=m(N,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(E+=e.relevance),M.addSublanguage(e.emitter,e.language)}():function(){if(!C.keywords)return void M.addText(N);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);const r=c(C,t);if(r){const[e,i]=r;if(M.addText(n),n="",E+=i,e.startsWith("_"))n+=t[0];else{const n=w.classNameAliases[e]||e;M.addKeyword(t[0],n)}}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(N)}n+=N.substr(e),M.addText(n)}(),N=""}function u(e){return e.className&&M.openNode(w.classNameAliases[e.className]||e.className),C=Object.create(e,{parent:{value:C}})}function p(e){return 0===C.matcher.regexIndex?(N+=e[0],1):(T=!0,0)}function g(e){const t=e[0],n=e.rule,r=new o(n),i=[n.__beforeBegin,n["on:begin"]];for(const o of i)if(o&&(o(e,r),r.isMatchIgnored))return p(t);return n&&n.endSameAsBegin&&(n.endRe=function(e){return new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}(t)),n.skip?N+=t:(n.excludeBegin&&(N+=t),d(),n.returnBegin||n.excludeBegin||(N=t)),u(n),n.returnBegin?0:t.length}function y(e){const t=e[0],r=n.substr(e.index),i=function e(t,n,r){let i=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,r);if(i){if(t["on:end"]){const e=new o(t);t["on:end"](n,e),e.isMatchIgnored&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,r)}(C,e,r);if(!i)return G;const s=C;s.skip?N+=t:(s.returnEnd||s.excludeEnd||(N+=t),d(),s.excludeEnd&&(N=t));do{C.className&&M.closeNode(),C.skip||C.subLanguage||(E+=C.relevance),C=C.parent}while(C!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),u(i.starts)),s.returnEnd?0:t.length}let v={};function b(t,i){const o=i&&i[0];if(N+=t,null==o)return d(),0;if("begin"===v.type&&"end"===i.type&&v.index===i.index&&""===o){if(N+=n.slice(i.index,i.index+1),!s){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=i,"begin"===i.type)return g(i);if("illegal"===i.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(C.className||"<unnamed>")+'"');throw e.mode=C,e}if("end"===i.type){const e=y(i);if(e!==G)return e}if("illegal"===i.type&&""===o)return 1;if(D>1e5&&D>3*i.index)throw new Error("potential infinite loop, way more iterations than matches");return N+=o,o.length}const w=S(e);if(!w)throw J(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const x=j(w,{plugins:i});let k="",C=l||x;const O={},M=new h.__emitter(h);!function(){const e=[];for(let t=C;t!==w;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>M.openNode(e))}();let N="",E=0,A=0,D=0,T=!1;try{for(C.matcher.considerAll();;){D++,T?T=!1:C.matcher.considerAll(),C.matcher.lastIndex=A;const e=C.matcher.exec(n);if(!e)break;const t=b(n.substring(A,e.index),e);A=e.index+t}return b(n.substr(A)),M.closeAllNodes(),M.finalize(),k=M.toHTML(),{relevance:Math.floor(E),value:k,language:e,illegal:!1,emitter:M,top:C}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(A-100,A+100),mode:t.mode},sofar:k,relevance:0,value:K(n),emitter:M};if(s)return{illegal:!1,relevance:0,value:K(n),emitter:M,language:e,top:C,errorRaised:t};throw t}}function m(e,n){n=n||h.languages||Object.keys(t);const r=function(e){const t={relevance:0,emitter:new h.__emitter(h),value:K(e),illegal:!1,top:c};return t.emitter.addText(e),t}(e),i=n.filter(S).filter(O).map(t=>f(t,e,!1));i.unshift(r);const o=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(S(e.language).supersetOf===t.language)return 1;if(S(t.language).supersetOf===e.language)return-1}return 0}),[s,l]=o,a=s;return a.second_best=l,a}const g={"before:highlightElement":({el:e})=>{h.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{h.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},y=/^(<[^>]+>|\t)+/gm,v={"after:highlightElement":({result:e})=>{h.tabReplace&&(e.value=e.value.replace(y,e=>e.replace(/\t/g,h.tabReplace)))}};function b(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=h.languageDetectRe.exec(t);if(n){const t=S(n[1]);return t||(W(a.replace("{}",n[1])),W("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>d(e)||S(e))}(e);if(d(r))return;M("before:highlightElement",{el:e,language:r});const i=(t=e).textContent,o=r?p(i,{language:r,ignoreIllegals:!0}):m(i);M("after:highlightElement",{el:e,result:o,text:i}),e.innerHTML=o.value,function(e,t,r){const i=t?n[t]:r;e.classList.add("hljs"),i&&e.classList.add(i)}(e,r,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 w=()=>{w.called||(w.called=!0,H("10.6.0","initHighlighting() is deprecated.  Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(b))};let x=!1;function k(){"loading"!==document.readyState?document.querySelectorAll("pre code").forEach(b):x=!0}function S(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function C(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function O(e){const t=S(e);return t&&!t.disableAutodetect}function M(e,t){const n=e;i.forEach(function(e){e[n]&&e[n](t)})}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",function(){x&&k()},!1),Object.assign(e,{highlight:p,highlightAuto:m,highlightAll:k,fixMarkup:function(e){return H("10.2.0","fixMarkup will be removed entirely in v11.0"),H("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),function(e){return h.tabReplace||h.useBR?e.replace(l,e=>"\n"===e?h.useBR?"<br>":e:h.tabReplace?e.replace(/\t/g,h.tabReplace):e):e}(e)},highlightElement:b,highlightBlock:function(e){return H("10.7.0","highlightBlock will be removed entirely in v12.0"),H("10.7.0","Please use highlightElement now."),b(e)},configure:function(e){e.useBR&&(H("10.3.0","'useBR' will be removed entirely in v11.0"),H("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),h=U(h,e)},initHighlighting:w,initHighlightingOnLoad:function(){H("10.6.0","initHighlightingOnLoad() is deprecated.  Use highlightAll() instead."),x=!0},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if(J("Language definition for '{}' could not be registered.".replace("{}",n)),!s)throw e;J(e),i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&C(i.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:S,registerAliases:C,requireLanguage:function(e){H("10.4.0","requireLanguage will be removed entirely in v11."),H("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=S(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:O,inherit:U,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=(t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))})),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=(t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))}))}(e),i.push(e)},vuePlugin:B(e).VuePlugin}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString="10.7.3";for(const o in R)"object"==typeof R[o]&&r(R[o]);return Object.assign(e,R),e.addPlugin(g),e.addPlugin(V),e.addPlugin(v),e}({});e.exports=Z},J7Ao:function(e,t){e.exports=class{constructor(){this.seen={}}slug(e){let t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){const e=t;do{this.seen[e]++,t=e+"-"+this.seen[e]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t}}},MEpN:function(e,t,n){"use strict";function r(e){this.content=e}n.d(t,"a",function(){return ee}),n.d(t,"b",function(){return pe}),n.d(t,"c",function(){return o}),n.d(t,"d",function(){return h}),n.d(t,"e",function(){return X}),n.d(t,"f",function(){return A}),n.d(t,"g",function(){return M}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return Y}),n.d(t,"j",function(){return u}),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,o=i.find(e),s=i.content.slice();return-1==o?s.push(n||e,t):(s[o+1]=t,n&&(s[o]=n)),new r(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var i=this.remove(t),o=i.content.slice(),s=i.find(e);return o.splice(-1==s?o.length:s,0,t,n),new r(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>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 i=r;var o=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},s={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};o.prototype.nodesBetween=function(e,t,n,r,i){void 0===r&&(r=0);for(var o=0,s=0;s<t;o++){var l=this.content[o],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,i,o)&&l.content.size){var c=s+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),n,r+c)}s=a}},o.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},o.prototype.textBetween=function(e,t,n,r){var i="",o=!0;return this.nodesBetween(e,t,function(s,l){s.isText?(i+=s.text.slice(Math.max(e,l)-l,t-l),o=!n):s.isLeaf&&r?(i+=r,o=!n):!o&&s.isBlock&&(i+=n,o=!0)},0),i},o.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(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new o(r,this.size+e.size)},o.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],r=0;if(t>e)for(var i=0,s=0;s<t;i++){var l=this.content[i],a=s+l.nodeSize;a>e&&((s<e||a>t)&&(l=l.isText?l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),n.push(l),r+=l.nodeSize),s=a}return new o(n,r)},o.prototype.cutByIndex=function(e,t){return e==t?o.empty:0==e&&t==this.content.length?this:new o(this.content.slice(e,t))},o.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new o(r,i)},o.prototype.addToStart=function(e){return new o([e].concat(this.content),this.size+e.nodeSize)},o.prototype.addToEnd=function(e){return new o(this.content.concat(e),this.size+e.nodeSize)},o.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},s.firstChild.get=function(){return this.content.length?this.content[0]:null},s.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},s.childCount.get=function(){return this.content.length},o.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},o.prototype.maybeChild=function(e){return this.content[e]},o.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}},o.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,r){for(var i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;var o=t.child(i),s=n.child(i);if(o!=s){if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(var l=0;o.text[l]==s.text[l];l++)r++;return r}if(o.content.size||s.content.size){var a=e(o.content,s.content,r+1);if(null!=a)return a}r+=o.nodeSize}else r+=o.nodeSize}}(this,e,t)},o.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,r,i){for(var o=t.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};var l=t.child(--o),a=n.child(--s),c=l.nodeSize;if(l!=a){if(!l.sameMarkup(a))return{a:r,b:i};if(l.isText&&l.text!=a.text){for(var h=0,d=Math.min(l.text.length,a.text.length);h<d&&l.text[l.text.length-h-1]==a.text[a.text.length-h-1];)h++,r--,i--;return{a:r,b:i}}if(l.content.size||a.content.size){var u=e(l.content,a.content,r-1,i-1);if(u)return u}r-=c,i-=c}else r-=c,i-=c}}(this,e,t,n)},o.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return a(0,e);if(e==this.size)return a(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?a(n+1,i):a(n,r);r=i}},o.prototype.toString=function(){return"<"+this.toStringInner()+">"},o.prototype.toStringInner=function(){return this.content.join(", ")},o.prototype.toJSON=function(){return this.content.length?this.content.map(function(e){return e.toJSON()}):null},o.fromJSON=function(e,t){if(!t)return o.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new o(t.map(e.nodeFromJSON))},o.fromArray=function(e){if(!e.length)return o.empty;for(var t,n=0,r=0;r<e.length;r++){var i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new o(t||e,n)},o.from=function(e){if(!e)return o.empty;if(e instanceof o)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new o([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(o.prototype,s);var l={index:0,offset:0};function a(e,t){return l.index=e,l.offset=t,l}function c(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!c(e[r],t[r]))return!1}else{for(var i in e)if(!(i in t&&c(e[i],t[i])))return!1;for(var o in t)if(!(o in e))return!1}return!0}o.empty=new o([],0);var h=function(e,t){this.type=e,this.attrs=t};function d(e){var t=Error.call(this,e);return t.__proto__=d.prototype,t}h.prototype.addToSet=function(e){for(var t,n=!1,r=0;r<e.length;r++){var i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t},h.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},h.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},h.prototype.eq=function(e){return this==e||this.type==e.type&&c(this.attrs,e.attrs)},h.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},h.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},h.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},h.setFrom=function(e){if(!e||0==e.length)return h.none;if(e instanceof h)return[e];var t=e.slice();return t.sort(function(e,t){return e.type.rank-t.type.rank}),t},h.none=[],d.prototype=Object.create(Error.prototype),d.prototype.constructor=d,d.prototype.name="ReplaceError";var u=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},p={size:{configurable:!0}};function f(e,t,n){if(n.openStart>e.depth)throw new d("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new d("Inconsistent open depths");return function e(t,n,r,i){var s=t.index(i),l=t.node(i);if(s==n.index(i)&&i<t.depth-r.openStart){var a=e(t,n,r,i+1);return l.copy(l.content.replaceChild(s,a))}if(r.content.size){if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){var c=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),i=n-1;i>=0;i--)r=t.node(i).copy(o.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t),h=c.start,d=c.end;return b(l,function e(t,n,r,i,s){var l=t.depth>s&&g(t,n,s+1);var a=i.depth>s&&g(r,i,s+1);var c=[];v(null,t,s,c);l&&a&&n.index(s)==r.index(s)?(m(l,a),y(b(l,e(t,n,r,i,s+1)),c)):(l&&y(b(l,w(t,n,s+1)),c),v(n,r,s,c),a&&y(b(a,w(r,i,s+1)),c));v(i,null,s,c);return new o(c)}(t,h,d,n,i))}var u=t.parent,p=u.content;return b(u,p.cut(0,t.parentOffset).append(r.content).append(p.cut(n.parentOffset)))}return b(l,w(t,n,i))}(e,t,n,0)}function m(e,t){if(!t.type.compatibleContent(e.type))throw new d("Cannot join "+t.type.name+" onto "+e.type.name)}function g(e,t,n){var r=e.node(n);return m(r,t.node(n)),r}function y(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 v(e,t,n,r){var i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(y(e.nodeAfter,r),o++));for(var l=o;l<s;l++)y(i.child(l),r);t&&t.depth==n&&t.textOffset&&y(t.nodeBefore,r)}function b(e,t){if(!e.type.validContent(t))throw new d("Invalid content for node "+e.type.name);return e.copy(t)}function w(e,t,n){var r=[];(v(null,e,n,r),e.depth>n)&&y(b(g(e,t,n+1),w(e,t,n+1)),r);return v(t,null,n,r),new o(r)}p.size.get=function(){return this.content.size-this.openStart-this.openEnd},u.prototype.insertAt=function(e,t){var n=function e(t,n,r,i){var o=t.findIndex(n);var s=o.index;var l=o.offset;var a=t.maybeChild(s);if(l==n||a.isText)return i&&!i.canReplace(s,s,r)?null:t.cut(0,n).append(r).append(t.cut(n));var c=e(a.content,n-l-1,r);return c&&t.replaceChild(s,a.copy(c))}(this.content,e+this.openStart,t,null);return n&&new u(n,this.openStart,this.openEnd)},u.prototype.removeBetween=function(e,t){return new u(function e(t,n,r){var i=t.findIndex(n);var o=i.index;var s=i.offset;var l=t.maybeChild(o);var a=t.findIndex(r);var c=a.index;var h=a.offset;if(s==n||l.isText){if(h!=r&&!t.child(c).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(o!=c)throw new RangeError("Removing non-flat range");return t.replaceChild(o,l.copy(e(l.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},u.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},u.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},u.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},u.fromJSON=function(e,t){if(!t)return u.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 u(o.fromJSON(e,t.content),t.openStart||0,t.openEnd||0)},u.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,r=0,i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(var o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)r++;return new u(e,n,r)},Object.defineProperties(u.prototype,p),u.empty=new u(o.empty,0,0);var x=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},k={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},k.parent.get=function(){return this.node(this.depth)},k.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},k.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},k.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},k.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.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return h.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var i=n;n=r,r=i}for(var o=n.marks,s=0;s<o.length;s++)!1!==o[s].type.spec.inclusive||r&&o[s].isInSet(r.marks)||(o=o[s--].removeFromSet(o));return o},x.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n},x.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;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<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new M(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<this.pos?e:this},x.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},x.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],r=0,i=t,o=e;;){var s=o.content.findIndex(i),l=s.index,a=s.offset,c=i-a;if(n.push(o,l,r+a),!c)break;if((o=o.child(l)).isText)break;i=c-1,r+=a+1}return new x(t,n,i)},x.resolveCached=function(e,t){for(var n=0;n<S.length;n++){var r=S[n];if(r.pos==t&&r.doc==e)return r}var i=S[C]=x.resolve(e,t);return C=(C+1)%O,i},Object.defineProperties(x.prototype,k);var S=[],C=0,O=12,M=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},N={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};N.start.get=function(){return this.$from.before(this.depth+1)},N.end.get=function(){return this.$to.after(this.depth+1)},N.parent.get=function(){return this.$from.node(this.depth)},N.startIndex.get=function(){return this.$from.index(this.depth)},N.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(M.prototype,N);var E=Object.create(null),A=function(e,t,n,r){this.type=e,this.attrs=t,this.content=n||o.empty,this.marks=r||h.none},D={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};D.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},D.childCount.get=function(){return this.content.childCount},A.prototype.child=function(e){return this.content.child(e)},A.prototype.maybeChild=function(e){return this.content.maybeChild(e)},A.prototype.forEach=function(e){this.content.forEach(e)},A.prototype.nodesBetween=function(e,t,n,r){void 0===r&&(r=0),this.content.nodesBetween(e,t,n,r,this)},A.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},D.textContent.get=function(){return this.textBetween(0,this.content.size,"")},A.prototype.textBetween=function(e,t,n,r){return this.content.textBetween(e,t,n,r)},D.firstChild.get=function(){return this.content.firstChild},D.lastChild.get=function(){return this.content.lastChild},A.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},A.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},A.prototype.hasMarkup=function(e,t,n){return this.type==e&&c(this.attrs,t||e.defaultAttrs||E)&&h.sameSet(this.marks,n||h.none)},A.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},A.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},A.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},A.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return u.empty;var r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),l=r.node(o).content.cut(r.pos-s,i.pos-s);return new u(l,r.depth-o,i.depth-o)},A.prototype.replace=function(e,t,n){return f(this.resolve(e),this.resolve(t),n)},A.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,i=n.offset;if(!(t=t.maybeChild(r)))return null;if(i==e||t.isText)return t;e-=i+1}},A.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},A.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}},A.prototype.resolve=function(e){return x.resolveCached(this,e)},A.prototype.resolveNoCache=function(e){return x.resolve(this,e)},A.prototype.rangeHasMark=function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,function(e){return n.isInSet(e.marks)&&(r=!0),!r}),r},D.isBlock.get=function(){return this.type.isBlock},D.isTextblock.get=function(){return this.type.isTextblock},D.inlineContent.get=function(){return this.type.inlineContent},D.isInline.get=function(){return this.type.isInline},D.isText.get=function(){return this.type.isText},D.isLeaf.get=function(){return this.type.isLeaf},D.isAtom.get=function(){return this.type.isAtom},A.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()+")"),R(this.marks,e)},A.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},A.prototype.canReplace=function(e,t,n,r,i){void 0===n&&(n=o.empty),void 0===r&&(r=0),void 0===i&&(i=n.childCount);var s=this.contentMatchAt(e).matchFragment(n,r,i),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(var a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0},A.prototype.canReplaceWith=function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd},A.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},A.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));this.content.forEach(function(e){return e.check()})},A.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(function(e){return e.toJSON()})),e},A.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=o.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)},Object.defineProperties(A.prototype,D);var T=function(e){function t(t,n,r,i){if(e.call(this,t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return t.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):R(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},t.prototype.textBetween=function(e,t){return this.text.slice(e,t)},n.nodeSize.get=function(){return this.text.length},t.prototype.mark=function(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)},t.prototype.withText=function(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)},t.prototype.cut=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.text.length),0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))},t.prototype.eq=function(e){return this.sameMarkup(e)&&this.text==e.text},t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.text=this.text,t},Object.defineProperties(t.prototype,n),t}(A);function R(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var I=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},$={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};I.parse=function(e,t){var n=new z(e,t);if(null==n.next)return I.empty;var r=_(n);n.next&&n.err("Unexpected trailing text");var i=function(e){var t=Object.create(null);return function n(r){var i=[];r.forEach(function(t){e[t].forEach(function(t){var n=t.term,r=t.to;if(n){var o=i.indexOf(n),s=o>-1&&i[o+1];q(e,r).forEach(function(e){s||i.push(n,s=[]),-1==s.indexOf(e)&&s.push(e)})}})});var o=t[r.join(",")]=new I(r.indexOf(e.length-1)>-1);for(var s=0;s<i.length;s+=2){var l=i[s+1].sort(F);o.next.push(i[s],t[l.join(",")]||n(l))}return o}(q(e,0))}(function(e){var t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce(function(t,n){return t.concat(e(n,o))},[]);if("seq"==t.type)for(var s=0;;s++){var l=e(t.exprs[s],o);if(s==t.exprs.length-1)return l;i(l,o=n())}else{if("star"==t.type){var a=n();return r(o,a),i(e(t.expr,a),a),[r(a)]}if("plus"==t.type){var c=n();return i(e(t.expr,o),c),i(e(t.expr,c),c),[r(c)]}if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){for(var h=o,d=0;d<t.min;d++){var u=n();i(e(t.expr,h),u),h=u}if(-1==t.max)i(e(t.expr,h),h);else for(var p=t.min;p<t.max;p++){var f=n();r(h,f),i(e(t.expr,h),f),h=f}return[r(h)]}if("name"==t.type)return[r(o,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(function(e){return e.to=t})}}(r));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var i=r[n],o=!i.validEnd,s=[],l=0;l<i.next.length;l+=2){var a=i.next[l],c=i.next[l+1];s.push(a.name),!o||a.isText||a.hasRequiredAttrs()||(o=!1),-1==r.indexOf(c)&&r.push(c)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position")}}(i,n),i},I.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},I.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var r=this,i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r},$.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},$.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},I.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},I.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var r=[this];return function i(s,l){var a=s.matchFragment(e,n);if(a&&(!t||a.validEnd))return o.from(l.map(function(e){return e.createAndFill()}));for(var c=0;c<s.next.length;c+=2){var h=s.next[c],d=s.next[c+1];if(!h.isText&&!h.hasRequiredAttrs()&&-1==r.indexOf(d)){r.push(d);var u=i(d,l.concat(h));if(u)return u}}}(this,[])},I.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},I.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(e)){for(var o=[],s=r;s.type;s=s.via)o.push(s.type);return o.reverse()}for(var l=0;l<i.next.length;l+=2){var a=i.next[l];a.isLeaf||a.hasRequiredAttrs()||a.name in t||r.type&&!i.next[l+1].validEnd||(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}},$.edgeCount.get=function(){return this.next.length>>1},I.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]}},I.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var r=1;r<n.next.length;r+=2)-1==e.indexOf(n.next[r])&&t(n.next[r])}(this),e.map(function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",i=0;i<t.next.length;i+=2)r+=(i?", ":"")+t.next[i].name+"->"+e.indexOf(t.next[i+1]);return r}).join("\n")},Object.defineProperties(I.prototype,$),I.empty=new I(!0);var z=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 _(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(B(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function B(e){for(var t=function(e){if(e.eat("(")){var t=_(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 i=[];for(var o in n){var s=n[o];s.groups.indexOf(t)>-1&&i.push(s)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(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 V(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=V(e),r=n;return e.eat(",")&&(r="}"!=e.next?V(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function F(e,t){return t-e}function q(e,t){var n=[];return function t(r){var i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(var o=0;o<i.length;o++){var s=i[o],l=s.term,a=s.to;l||-1!=n.indexOf(a)||t(a)}}(t),n.sort(F)}function J(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function W(e,t){var n=Object.create(null);for(var r in e){var i=t&&t[r];if(void 0===i){var o=e[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}n[r]=i}return n}function H(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new G(e[n]);return t}P.next.get=function(){return this.tokens[this.pos]},z.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},z.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(z.prototype,P);var K=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=H(n.attrs),this.defaultAttrs=J(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},U={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};U.isInline.get=function(){return!this.isBlock},U.isTextblock.get=function(){return this.isBlock&&this.inlineContent},U.isLeaf.get=function(){return this.contentMatch==I.empty},U.isAtom.get=function(){return this.isLeaf||this.spec.atom},K.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},K.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},K.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,e)},K.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new A(this,this.computeAttrs(e),o.from(t),h.setFrom(n))},K.prototype.createChecked=function(e,t,n){if(t=o.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new A(this,this.computeAttrs(e),t,h.setFrom(n))},K.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=o.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var i=this.contentMatch.matchFragment(t).fillBefore(o.empty,!0);return i?new A(this,e,t.append(i),h.setFrom(n)):null},K.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},K.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},K.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},K.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:h.empty:e},K.compile=function(e,t){var n=Object.create(null);e.forEach(function(e,r){return n[e]=new K(e,t,r)});var r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(K.prototype,U);var G=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},Z={isRequired:{configurable:!0}};Z.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(G.prototype,Z);var X=function(e,t,n,r){this.name=e,this.schema=n,this.spec=r,this.attrs=H(r.attrs),this.rank=t,this.excluded=null;var i=J(this.attrs);this.instance=i&&new h(this,i)};X.prototype.create=function(e){return!e&&this.instance?this.instance:new h(this,W(this.attrs,e))},X.compile=function(e,t){var n=Object.create(null),r=0;return e.forEach(function(e,i){return n[e]=new X(e,r++,t,i)}),n},X.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e.slice(0,t).concat(e.slice(t+1));return e},X.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},X.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var Y=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=i.from(e.nodes),this.spec.marks=i.from(e.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=X.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 o=this.nodes[r],s=o.spec.content||"",l=o.spec.marks;o.contentMatch=n[s]||(n[s]=I.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet="_"==l?null:l?Q(this,l.split(" ")):""!=l&&o.inlineContent?null:[]}for(var a in this.marks){var c=this.marks[a],h=c.spec.excludes;c.excluded=null==h?[c]:""==h?[]:Q(this,h.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<t.length;r++){var i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(var l in e.marks){var a=e.marks[l];("_"==i||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=a)}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 T(n,n.defaultAttrs,e,h.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 A.fromJSON(this,e)},Y.prototype.markFromJSON=function(e){return h.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)})};ee.prototype.parse=function(e,t){void 0===t&&(t={});var n=new ae(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 ae(this,t,!0);return n.addAll(e,null,t.from,t.to),u.maxOpen(n.finish())},ee.prototype.matchTag=function(e,t){for(var n=0;n<this.tags.length;n++){var r=this.tags[n];if(he(e,r.tag)&&(void 0===r.namespace||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs){var i=r.getAttrs(e);if(!1===i)continue;r.attrs=i}return r}}},ee.prototype.matchStyle=function(e,t,n){for(var r=0;r<this.styles.length;r++){var i=this.styles[r];if(!(0!=i.style.indexOf(e)||i.context&&!n.matchesContext(i.context)||i.style.length>e.length&&(61!=i.style.charCodeAt(e.length)||i.style.slice(e.length+1)!=t))){if(i.getAttrs){var o=i.getAttrs(t);if(!1===o)continue;i.attrs=o}return i}}},ee.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var i=t[r];if((null==i.priority?50:i.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach(function(e){n(e=de(e)),e.mark=t})};for(var i in e.marks)r(i);var o=function(t){var r=e.nodes[s].spec.parseDOM;r&&r.forEach(function(e){n(e=de(e)),e.node=s})};for(var s in e.nodes)o();return t},ee.fromSchema=function(e){return e.cached.domParser||(e.cached.domParser=new ee(e,ee.schemaRules(e)))};var te={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},re={ol:!0,ul:!0},ie=1,oe=2;function se(e){return(e?ie:0)|("full"===e?oe:0)}var le=function(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.solid=i,this.match=o||(4&s?null:e.contentMatch),this.options=s,this.content=[],this.marks=n,this.activeMarks=h.none,this.pendingMarks=r};le.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(o.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},le.prototype.finish=function(e){if(!(this.options&ie)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var r=o.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(o.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r},le.prototype.applyPending=function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var r=n[t];(this.type?this.type.allowsMarkType(r.type):ue(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}};var ae=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n;var r,i=t.topNode,o=se(t.preserveWhitespace)|(n?4:0);r=i?new le(i.type,i.attrs,h.none,h.none,!0,t.topMatch||i.type.contentMatch,o):new le(n?null:e.schema.topNodeType,null,h.none,h.none,!0,null,o),this.nodes=[r],this.open=0,this.find=t.findPositions,this.needsBlock=!1},ce={top:{configurable:!0},currentPos:{configurable:!0}};function he(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function de(e){var t={};for(var n in e)t[n]=e[n];return t}function ue(e,t){var n=t.schema.nodes,r=function(r){var i=n[r];if(i.allowsMarkType(e)){var o=[],s=function(e){o.push(e);for(var n=0;n<e.edgeCount;n++){var r=e.edge(n),i=r.type,l=r.next;if(i==t)return!0;if(o.indexOf(l)<0&&s(l))return!0}};return s(i.contentMatch)?{v:!0}:void 0}};for(var i in n){var o=r(i);if(o)return o.v}}ce.top.get=function(){return this.nodes[this.open]},ae.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(var i=0;i<n.length;i++)this.addPendingMark(n[i]);if(this.addElement(e),null!=n)for(var o=0;o<n.length;o++)this.removePendingMark(n[o],r)}},ae.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if((n.type?n.type.inlineContent:n.content.length&&n.content[0].isInline)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&ie)n.options&oe||(t=t.replace(/\r?\n|\r/g," "));else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},ae.prototype.addElement=function(e){var t=e.nodeName.toLowerCase();re.hasOwnProperty(t)&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&re.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||this.parser.matchTag(e,this);if(n?n.ignore:ne.hasOwnProperty(t))this.findInside(e);else if(!n||n.skip){n&&n.skip.nodeType&&(e=n.skip);var r,i=this.top,o=this.needsBlock;if(te.hasOwnProperty(t))r=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(i),this.needsBlock=o}else this.addElementByRule(e,n)},ae.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},ae.prototype.readStyles=function(e){for(var t=h.none,n=0;n<e.length;n+=2){var r=this.parser.matchStyle(e[n],e[n+1],this);if(r){if(r.ignore)return null;t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t)}}return t},ae.prototype.addElementByRule=function(e,t){var n,r,i,o=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs))||this.leafFallback(e):n=this.enter(r,t.attrs,t.preserveWhitespace):(i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i));var s=this.top;if(r&&r.isLeaf)this.findInside(e);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(function(e){return o.insertNode(e)});else{var l=t.contentElement;"string"==typeof l?l=e.querySelector(l):"function"==typeof l&&(l=l(e)),l||(l=e),this.findAround(e,l,!0),this.addAll(l,n)}n&&(this.sync(s),this.open--),i&&this.removePendingMark(i,s)},ae.prototype.addAll=function(e,t,n,r){for(var i=n||0,o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o),t&&te.hasOwnProperty(o.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,i)},ae.prototype.findPlace=function(e){for(var t,n,r=this.open;r>=0;r--){var i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(var s=0;s<t.length;s++)this.enterInner(t[s],null,!1);return!0},ae.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,i=0;i<e.marks.length;i++)n.type&&!n.type.allowsMarkType(e.marks[i].type)||(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1},ae.prototype.enter=function(e,t,n){var r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r},ae.prototype.enterInner=function(e,t,n,r){this.closeExtra();var i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e,t);var o=null==r?-5&i.options:se(r);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new le(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++},ae.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},ae.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ae.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},ce.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},ae.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},ae.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},ae.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},ae.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},ae.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=function(e,l){for(;e>=0;e--){var a=n[e];if(""==a){if(e==n.length-1||0==e)continue;for(;l>=o;l--)if(s(e-1,l))return!0;return!1}var c=l>0||0==l&&i?t.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=a&&-1==c.groups.indexOf(a))return!1;l--}return!0};return s(n.length-1,this.open)},ae.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 i=this.parser.schema.nodes[r];if(i.isTextblock&&i.defaultAttrs)return i}},ae.prototype.addPendingMark=function(e){this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},ae.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(ae.prototype,ce);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 me(e){return e.document||window.document}pe.prototype.serializeFragment=function(e,t,n){var r=this;void 0===t&&(t={}),n||(n=me(t).createDocumentFragment());var i=n,o=null;return e.forEach(function(e){if(o||e.marks.length){o||(o=[]);for(var n=0,s=0;n<o.length&&s<e.marks.length;){var l=e.marks[s];if(r.marks[l.type.name]){if(!l.eq(o[n])||!1===l.type.spec.spanning)break;n+=2,s++}else s++}for(;n<o.length;)i=o.pop(),o.pop();for(;s<e.marks.length;){var a=e.marks[s++],c=r.serializeMark(a,e.isInline,t);c&&(o.push(a,i),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(r.serializeNode(e,t))}),n},pe.prototype.serializeNode=function(e,t){void 0===t&&(t={});var n=pe.renderSpec(me(t),this.nodes[e.type.name](e)),r=n.dom,i=n.contentDOM;if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");t.onContent?t.onContent(e,i,t):this.serializeFragment(e.content,t,i)}return r},pe.prototype.serializeNodeAndMarks=function(e,t){void 0===t&&(t={});for(var n=this.serializeNode(e,t),r=e.marks.length-1;r>=0;r--){var i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.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(me(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],i=r.indexOf(" ");i>0&&(n=r.slice(0,i),r=r.slice(i+1));var o=null,s=n?e.createElementNS(n,r):e.createElement(r),l=t[1],a=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l))for(var c in a=2,l)if(null!=l[c]){var h=c.indexOf(" ");h>0?s.setAttributeNS(c.slice(0,h),c.slice(h+1),l[c]):s.setAttribute(c,l[c])}for(var d=a;d<t.length;d++){var u=t[d];if(0===u){if(d<t.length-1||d>a)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var p=pe.renderSpec(e,u,n),f=p.dom,m=p.contentDOM;if(s.appendChild(f),m){if(o)throw new RangeError("Multiple content holes");o=m}}return{dom:s,contentDOM:o}},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)}},POQ2:function(e,t,n){"use strict";var r=n("ECCn"),i=n("Bz7v");t.highlight=s,t.highlightAuto=function(e,t){var n,l,a,c,h=t||{},d=h.subset||r.listLanguages(),u=h.prefix,p=d.length,f=-1;null!==u&&void 0!==u||(u=o);if("string"!=typeof e)throw i("Expected `string` for value, got `%s`",e);l={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++f<p;)c=d[f],r.getLanguage(c)&&((a=s(c,e,t)).language=c,a.relevance>l.relevance&&(l=a),a.relevance>n.relevance&&(l=n,n=a));l.language&&(n.secondBest=l);return n},t.registerLanguage=function(e,t){r.registerLanguage(e,t)},t.listLanguages=function(){return r.listLanguages()},t.registerAlias=function(e,t){var n,i=e;t&&((i={})[e]=t);for(n in i)r.registerAliases(i[n],{languageName:n})},l.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})},l.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},l.prototype.addSublanguage=function(e,t){var n=this.stack,r=n[n.length-1],i=e.rootNode.children,o=t?{type:"element",tagName:"span",properties:{className:[t]},children:i}:i;r.children=r.children.concat(o)},l.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,r=t[t.length-1],i={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(i),t.push(i)},l.prototype.closeNode=function(){this.stack.pop()},l.prototype.closeAllNodes=a,l.prototype.finalize=a,l.prototype.toHTML=function(){return""};var o="hljs-";function s(e,t,n){var s,a=r.configure({}),c=(n||{}).prefix;if("string"!=typeof e)throw i("Expected `string` for name, got `%s`",e);if(!r.getLanguage(e))throw i("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw i("Expected `string` for value, got `%s`",t);if(null!==c&&void 0!==c||(c=o),r.configure({__emitter:l,classPrefix:c}),s=r.highlight(t,{language:e,ignoreIllegals:!0}),r.configure(a||{}),s.errorRaised)throw s.errorRaised;return{relevance:s.relevance,language:s.language,value:s.emitter.rootNode.children}}function l(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function a(){}},RCw7:function(e,t,n){"use strict";n.d(t,"a",function(){return M}),n.d(t,"b",function(){return x}),n.d(t,"c",function(){return u}),n.d(t,"d",function(){return h}),n.d(t,"e",function(){return b}),n.d(t,"f",function(){return w}),n.d(t,"g",function(){return v});var r=n("uSMm"),i=n("MEpN"),o=n("b/sn");const s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function l(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function a(e){if(!e.parent.type.spec.isolating)for(let 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 c(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const h=(e,t)=>{let{$from:n,$to:i}=e.selection,o=n.blockRange(i),s=o&&Object(r.k)(o);return null!=s&&(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)};function d(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const u=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),l=d(i.contentMatchAt(s));if(!l||!i.canReplaceWith(s,s,l))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,l.createAndFill());i.setSelection(o.f.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},p=(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof o.c&&e.selection.node.isBlock)return!(!n.parentOffset||!Object(r.g)(e.doc,n.pos))&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){let s=i.parentOffset==i.parent.content.size,l=e.tr;(e.selection instanceof o.h||e.selection instanceof o.a)&&l.deleteSelection();let a=0==n.depth?null:d(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=s&&a?[{type:a}]:void 0,h=Object(r.g)(l.doc,l.mapping.map(n.pos),1,c);if(c||h||!Object(r.g)(l.doc,l.mapping.map(n.pos),1,a?[{type:a}]:void 0)||(a&&(c=[{type:a}]),h=!0),h&&(l.split(l.mapping.map(n.pos),1,c),!s&&!n.parentOffset&&n.parent.type!=a)){let e=l.mapping.map(n.before()),t=l.doc.resolve(e);a&&n.node(-1).canReplaceWith(t.index(),t.index()+1,a)&&l.setNodeMarkup(l.mapping.map(n.before()),a)}t(l.scrollIntoView())}return!0};function f(e,t,n){let s,a,c=t.nodeBefore,h=t.nodeAfter;if(c.type.spec.isolating||h.type.spec.isolating)return!1;if(function(e,t,n){let i=t.nodeBefore,o=t.nodeAfter,s=t.index();return!(!(i&&o&&i.type.compatibleContent(o.type))||(!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!o.isTextblock&&!Object(r.f)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,i.type,i.contentMatchAt(i.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let d=t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(a=c.contentMatchAt(c.childCount)).findWrapping(h.type))&&a.matchType(s[0]||h.type).validEnd){if(n){let o=t.pos+h.nodeSize,l=i.c.empty;for(let e=s.length-1;e>=0;e--)l=i.c.from(s[e].create(null,l));l=i.c.from(c.copy(l));let a=e.tr.step(new r.b(t.pos-1,o,t.pos,o,new i.j(l,1,0),s.length,!0)),d=o+2*s.length;Object(r.f)(a.doc,d)&&a.join(d),n(a.scrollIntoView())}return!0}let u=o.f.findFrom(t,1),p=u&&u.$from.blockRange(u.$to),f=p&&Object(r.k)(p);if(null!=f&&f>=t.depth)return n&&n(e.tr.lift(p,f).scrollIntoView()),!0;if(d&&l(h,"start",!0)&&l(c,"end")){let o=c,s=[];for(;s.push(o),!o.isTextblock;)o=o.lastChild;let l=h,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(o.canReplace(o.childCount,o.childCount,l.content)){if(n){let o=i.c.empty;for(let e=s.length-1;e>=0;e--)o=i.c.from(s[e].copy(o));n(e.tr.step(new r.b(t.pos-s.length,t.pos+h.nodeSize,t.pos+a,t.pos+h.nodeSize-a,new i.j(o,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function m(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(o.h.create(t.doc,e<0?i.start(s):i.end(s)))),!0)}}const g=m(-1),y=m(1);function v(e,t=null){return function(n,i){let{$from:o,$to:s}=n.selection,l=o.blockRange(s),a=l&&Object(r.i)(l,e,t);return!!a&&(i&&i(n.tr.wrap(l,a).scrollIntoView()),!0)}}function b(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,(r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}}),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function w(e,t=null){return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(e,t,n){for(let r=0;r<t.length;r++){let{$from:i,$to:o}=t[r],s=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,o.pos,e=>{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(o)e.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let i=!1,o=n.tr;for(let t=0;!i&&t<s.length;t++){let{$from:r,$to:o}=s[t];i=n.doc.rangeHasMark(r.pos,o.pos,e)}for(let n=0;n<s.length;n++){let{$from:r,$to:l}=s[n];if(i)o.removeMark(r.pos,l.pos,e);else{let n=r.pos,i=l.pos,s=r.nodeAfter,a=l.nodeBefore,c=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,h=a&&a.isText?/\s*$/.exec(a.text)[0].length:0;n+c<i&&(n+=c,i-=h),o.addMark(n,i,e.create(t))}}r(o.scrollIntoView())}return!0}}function x(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let k=x(s,(e,t,n)=>{let{$cursor:s}=e.selection;if(!s||(n?!n.endOfTextblock("backward",e):s.parentOffset>0))return!1;let c=a(s);if(!c){let n=s.blockRange(),i=n&&Object(r.k)(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let h=c.nodeBefore;if(!h.type.spec.isolating&&f(e,c,t))return!0;if(0==s.parent.content.size&&(l(h,"end")||o.c.isSelectable(h))){let n=Object(r.l)(e.doc,s.before(),s.after(),i.j.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(l(h,"end")?o.f.findFrom(r.doc.resolve(r.mapping.map(c.pos,-1)),-1):o.c.create(r.doc,c.pos-h.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!h.isAtom||c.depth!=s.depth-1||(t&&t(e.tr.delete(c.pos-h.nodeSize,c.pos).scrollIntoView()),0))},(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=a(r)}let l=s&&s.nodeBefore;return!(!l||!o.c.isSelectable(l)||(t&&t(e.tr.setSelection(o.c.create(e.doc,s.pos-l.nodeSize)).scrollIntoView()),0))}),S=x(s,(e,t,n)=>{let{$cursor:s}=e.selection;if(!s||(n?!n.endOfTextblock("forward",e):s.parentOffset<s.parent.content.size))return!1;let a=c(s);if(!a)return!1;let h=a.nodeAfter;if(f(e,a,t))return!0;if(0==s.parent.content.size&&(l(h,"start")||o.c.isSelectable(h))){let n=Object(r.l)(e.doc,s.before(),s.after(),i.j.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(l(h,"start")?o.f.findFrom(r.doc.resolve(r.mapping.map(a.pos)),1):o.c.create(r.doc,r.mapping.map(a.pos))),t(r.scrollIntoView())}return!0}}return!(!h.isAtom||a.depth!=s.depth-1||(t&&t(e.tr.delete(a.pos,a.pos+h.nodeSize).scrollIntoView()),0))},(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=c(r)}let l=s&&s.nodeAfter;return!(!l||!o.c.isSelectable(l)||(t&&t(e.tr.setSelection(o.c.create(e.doc,s.pos)).scrollIntoView()),0))});const C={Enter:x((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))},(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof o.a||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=d(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(n,s.createAndFill());l.setSelection(o.h.create(l.doc,n+1)),t(l.scrollIntoView())}return!0},(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Object(r.g)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&Object(r.k)(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},p),"Mod-Enter":u,Backspace:k,"Mod-Backspace":k,"Shift-Backspace":k,Delete:S,"Mod-Delete":S,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new o.a(e.doc))),!0)},O={"Ctrl-h":C.Backspace,"Alt-Backspace":C["Mod-Backspace"],"Ctrl-d":C.Delete,"Ctrl-Alt-Backspace":C["Mod-Delete"],"Alt-Delete":C["Mod-Delete"],"Alt-d":C["Mod-Delete"],"Ctrl-a":g,"Ctrl-e":y};for(let N in C)O[N]=C[N];const M=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?O:C},SbYC:function(e,t,n){const{defaults:r}=n("vbtb"),{cleanUrl:i,escape:o}=n("rUJ1");e.exports=class{constructor(e){this.options=e||r}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return r?'<pre><code class="'+this.options.langPrefix+o(r,!0)+'">'+(n?e:o(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:o(e,!0))+"</code></pre>"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=i(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+o(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"}image(e,t,n){if(null===(e=i(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"}text(e){return e}}},T9Ld:function(e,t,n){const{defaults:r}=n("vbtb"),{block:i}=n("e56X"),{rtrim:o,splitCells:s,escape:l}=n("rUJ1");e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=i.normal,this.options.pedantic?this.rules=i.pedantic:this.options.gfm&&(this.rules=i.gfm)}static get rules(){return i}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    "),this.token(e,!0)}token(e,t){let n,r,a,c,h,d,u,p,f,m,g,y,v,b,w,x;for(e=e.replace(/^ +$/gm,"");e;)if((a=this.rules.newline.exec(e))&&(e=e.substring(a[0].length),a[0].length>1&&this.tokens.push({type:"space"})),a=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(a[0].length),t&&"paragraph"===t.type?t.text+="\n"+a[0].trimRight():(a=a[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?a:o(a,"\n")}))}else if(a=this.rules.fences.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"code",lang:a[2]?a[2].trim():a[2],text:a[3]||""});else if(a=this.rules.heading.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"heading",depth:a[1].length,text:a[2]});else if((a=this.rules.nptable.exec(e))&&(d={type:"table",header:s(a[1].replace(/^ *| *\| *$/g,"")),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3]?a[3].replace(/\n$/,"").split("\n"):[]}).header.length===d.align.length){for(e=e.substring(a[0].length),g=0;g<d.align.length;g++)/^ *-+: *$/.test(d.align[g])?d.align[g]="right":/^ *:-+: *$/.test(d.align[g])?d.align[g]="center":/^ *:-+ *$/.test(d.align[g])?d.align[g]="left":d.align[g]=null;for(g=0;g<d.cells.length;g++)d.cells[g]=s(d.cells[g],d.header.length);this.tokens.push(d)}else if(a=this.rules.hr.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"hr"});else if(a=this.rules.blockquote.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"blockquote_start"}),a=a[0].replace(/^ *> ?/gm,""),this.token(a,t),this.tokens.push({type:"blockquote_end"});else if(a=this.rules.list.exec(e)){for(e=e.substring(a[0].length),u={type:"list_start",ordered:b=(c=a[2]).length>1,start:b?+c:"",loose:!1},this.tokens.push(u),p=[],n=!1,v=(a=a[0].match(this.rules.item)).length,g=0;g<v;g++)m=(d=a[g]).length,~(d=d.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(m-=d.length,d=this.options.pedantic?d.replace(/^ {1,4}/gm,""):d.replace(new RegExp("^ {1,"+m+"}","gm"),"")),g!==v-1&&(h=i.bullet.exec(a[g+1])[0],(c.length>1?1===h.length:h.length>1||this.options.smartLists&&h!==c)&&(e=a.slice(g+1).join("\n")+e,g=v-1)),r=n||/\n\n(?!\s*$)/.test(d),g!==v-1&&(n="\n"===d.charAt(d.length-1),r||(r=n)),r&&(u.loose=!0),x=void 0,(w=/^\[[ xX]\] /.test(d))&&(x=" "!==d[1],d=d.replace(/^\[[ xX]\] +/,"")),f={type:"list_item_start",task:w,checked:x,loose:r},p.push(f),this.tokens.push(f),this.token(d,!1),this.tokens.push({type:"list_item_end"});if(u.loose)for(v=p.length,g=0;g<v;g++)p[g].loose=!0;this.tokens.push({type:"list_end"})}else if(a=this.rules.html.exec(e))e=e.substring(a[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===a[1]||"script"===a[1]||"style"===a[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):l(a[0]):a[0]});else if(t&&(a=this.rules.def.exec(e)))e=e.substring(a[0].length),a[3]&&(a[3]=a[3].substring(1,a[3].length-1)),y=a[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[y]||(this.tokens.links[y]={href:a[2],title:a[3]});else if((a=this.rules.table.exec(e))&&(d={type:"table",header:s(a[1].replace(/^ *| *\| *$/g,"")),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3]?a[3].replace(/\n$/,"").split("\n"):[]}).header.length===d.align.length){for(e=e.substring(a[0].length),g=0;g<d.align.length;g++)/^ *-+: *$/.test(d.align[g])?d.align[g]="right":/^ *:-+: *$/.test(d.align[g])?d.align[g]="center":/^ *:-+ *$/.test(d.align[g])?d.align[g]="left":d.align[g]=null;for(g=0;g<d.cells.length;g++)d.cells[g]=s(d.cells[g].replace(/^ *\| *| *\| *$/g,""),d.header.length);this.tokens.push(d)}else if(a=this.rules.lheading.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"heading",depth:"="===a[2].charAt(0)?1:2,text:a[1]});else if(t&&(a=this.rules.paragraph.exec(e)))e=e.substring(a[0].length),this.tokens.push({type:"paragraph",text:"\n"===a[1].charAt(a[1].length-1)?a[1].slice(0,-1):a[1]});else if(a=this.rules.text.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"text",text:a[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},Xb7u:function(e,t,n){!function(){var t;function n(e){for(var t,n,r,i,o=1,s=[].slice.call(arguments),l=0,a=e.length,c="",h=!1,d=!1,u=function(){return s[o++]},p=function(){for(var n="";/\d/.test(e[l]);)n+=e[l++],t=e[l];return n.length>0?parseInt(n):null};l<a;++l)if(t=e[l],h)switch(h=!1,"."==t?(d=!1,t=e[++l]):"0"==t&&"."==e[l+1]?(d=!0,t=e[l+=2]):d=!0,i=p(),t){case"b":c+=parseInt(u(),10).toString(2);break;case"c":"string"==typeof(n=u())||n instanceof String?c+=n:c+=String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(u(),10);break;case"f":r=String(parseFloat(u()).toFixed(i||6)),c+=d?r:r.replace(/^0/,"");break;case"j":c+=JSON.stringify(u());break;case"o":c+="0"+parseInt(u(),10).toString(8);break;case"s":c+=u();break;case"x":c+="0x"+parseInt(u(),10).toString(16);break;case"X":c+="0x"+parseInt(u(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?h=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()},"b/sn":function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return M}),n.d(t,"c",function(){return u}),n.d(t,"d",function(){return N}),n.d(t,"e",function(){return D}),n.d(t,"f",function(){return s}),n.d(t,"g",function(){return l}),n.d(t,"h",function(){return h});var r=n("MEpN"),i=n("uSMm");const o=Object.create(null);class s{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new l(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=r.j.empty){let n=t.content.lastChild,i=null;for(let r=0;r<t.openEnd;r++)i=n,n=n.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:c}=s[l],h=e.mapping.slice(o);e.replaceRange(h.map(a.pos),h.map(c.pos),l?r.j.empty:t),0==l&&y(e,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],l=e.mapping.slice(n),a=l.map(o.pos),c=l.map(s.pos);i?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),y(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new h(e):g(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let i=e.depth-1;i>=0;i--){let r=t<0?g(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):g(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=o[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in o)throw new RangeError("Duplicate use of selection JSON ID "+e);return o[e]=t,t.prototype.jsonID=e,t}getBookmark(){return h.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class l{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function c(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class h extends s{constructor(e,t=e){c(e),c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new h(r.parent.inlineContent?r:n,n)}replace(e,t=r.j.empty){if(super.replace(e,t),t==r.j.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof h&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new d(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new h(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new h(e,t)}}s.jsonID("text",h);class d{constructor(e,t){this.anchor=e,this.head=t}map(e){return new d(e.map(this.anchor),e.map(this.head))}resolve(e){return h.between(e.resolve(this.anchor),e.resolve(this.head))}}class u extends s{constructor(e){let t=e.nodeAfter;super(e,e.node(0).resolve(e.pos+t.nodeSize)),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?s.near(i):new u(i)}content(){return new r.j(r.c.from(this.node),0,0)}eq(e){return e instanceof u&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new p(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new u(e.resolve(t.anchor))}static create(e,t){return new u(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}u.prototype.visible=!1,s.jsonID("node",u);class p{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new d(n,n):new p(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&u.isSelectable(n)?new u(t):s.near(t)}}class f extends s{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.j.empty){if(t==r.j.empty){e.delete(0,e.doc.content.size);let t=s.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}}s.jsonID("all",f);const m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,i,o=!1){if(t.inlineContent)return h.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&u.isSelectable(r))return u.create(e,n-(i<0?r.nodeSize:0))}else{let t=g(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function y(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,l=e.steps[r];(l instanceof i.c||l instanceof i.b)&&(e.mapping.maps[r].forEach((e,t,n,r)=>{null==o&&(o=r)}),e.setSelection(s.near(e.doc.resolve(o),n)))}const v=1,b=2,w=4;class x extends i.e{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|v)&~b,this.storedMarks=null,this}get selectionSet(){return(this.updated&v)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=b,this}ensureMarks(e){return r.d.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&b)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~b,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.d.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=w,this}get scrolledIntoView(){return(this.updated&w)>0}}function k(e,t){return t&&e?e.bind(t):e}class S{constructor(e,t,n){this.name=e,this.init=k(t.init,n),this.apply=k(t.apply,n)}}const C=[new S("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new S("selection",{init:(e,t)=>e.selection||s.atStart(t.doc),apply:e=>e.selection}),new S("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new S("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class O{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=C.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new S(e.key,e.spec.state,e))})}}class M{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let l=r?r[o].n:0,a=r?r[o].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new M(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new x(this)}static create(e){let t=new O(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new M(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new O(this.schema,e.plugins),n=t.fields,r=new M(t);for(let i=0;i<n.length;i++){let t=n[i].name;r[t]=this.hasOwnProperty(t)?this[t]:n[i].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new O(e.schema,e.plugins),o=new M(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=r.f.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],l=s.spec.state;if(s.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(o[i.name]=l.fromJSON.call(s,e,t[r],o))}o[i.name]=i.init(e,o)}}),o}}class N{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:A("plugin")}getState(e){return e[this.key]}}const E=Object.create(null);function A(e){return e in E?e+"$"+ ++E[e]:(E[e]=0,e+"$")}class D{constructor(e="key"){this.key=A(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},"cD+i":function(e,t,n){"use strict";n.d(t,"a",function(){return $t}),n.d(t,"b",function(){return _t}),n.d(t,"c",function(){return rn});var r=n("b/sn"),i=n("MEpN"),o=n("uSMm");const s="undefined"!=typeof navigator?navigator:null,l="undefined"!=typeof document?document:null,a=s&&s.userAgent||"",c=/Edge\/(\d+)/.exec(a),h=/MSIE \d/.exec(a),d=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a),u=!!(h||d||c),p=h?document.documentMode:d?+d[1]:c?+c[1]:0,f=!u&&/gecko\/(\d+)/i.test(a);f&&(/Firefox\/(\d+)/.exec(a)||[0,0])[1];const m=!u&&/Chrome\/(\d+)/.exec(a),g=!!m,y=m?+m[1]:0,v=!u&&!!s&&/Apple Computer/.test(s.vendor),b=v&&(/Mobile\/\w+/.test(a)||!!s&&s.maxTouchPoints>2),w=b||!!s&&/Mac/.test(s.platform),x=/Android \d/.test(a),k=!!l&&"webkitFontSmoothing"in l.documentElement.style,S=k?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,C=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},O=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let M=null;const N=function(e,t,n){let r=M||(M=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},E=function(e,t,n,r){return n&&(D(e,t,n,r,-1)||D(e,t,n,r,1))},A=/^(img|br|input|textarea|hr)$/i;function D(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:T(e))){let n=e.parentNode;if(!n||1!=n.nodeType||R(e)||A.test(e.nodeName)||"false"==e.contentEditable)return!1;t=C(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?T(e):0}}}function T(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function R(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const I=function(e){let t=e.isCollapsed;return t&&g&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function $(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function z(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function P(e,t){return"number"==typeof e?e:e[t]}function _(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function j(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=O(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,l=n?z(o):_(e),a=0,c=0;if(t.top<l.top+P(r,"top")?c=-(l.top-t.top+P(i,"top")):t.bottom>l.bottom-P(r,"bottom")&&(c=t.bottom-l.bottom+P(i,"bottom")),t.left<l.left+P(r,"left")?a=-(l.left-t.left+P(i,"left")):t.right>l.right-P(r,"right")&&(a=t.right-l.right+P(i,"right")),a||c)if(n)o.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function B(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=O(r));return t}function V(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let L=null;function F(e,t){let n,r,i=2e8,o=0,s=t.top,l=t.top;for(let a=e.firstChild,c=0;a;a=a.nextSibling,c++){let e;if(1==a.nodeType)e=a.getClientRects();else{if(3!=a.nodeType)continue;e=N(a).getClientRects()}for(let h=0;h<e.length;h++){let d=e[h];if(d.top<=s&&d.bottom>=l){s=Math.max(d.bottom,s),l=Math.min(d.top,l);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=a,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==a.nodeType&&e&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=W(r,1);if(n.top!=n.bottom&&q(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:F(n,r)}function q(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function J(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!q(t,n))return null;if(!(s=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),s=o;;){let r=t.childNodes[s];if(1==r.nodeType){let t=r.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(q(n,o))return e(r,n,o)}}if((s=(s+1)%i)==o)break}return t}(e.dom,t,n)))return null}if(v)for(let a=s;n&&a;a=O(a))a.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(f&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length))<n.childNodes.length){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}o=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=F(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:o,inside:l?l.posAtStart-l.border:-1}}function W(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const H=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function K(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=k||f;if(3==r.nodeType){if(!s||!H.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,U(W(N(r,e,t),o),o<0)}{let e=W(N(r,i,i),n);if(f&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=W(N(r,i-1,i-1),-1);if(t.top==e.top){let n=W(N(r,i,i+1),-1);if(n.top!=e.top)return U(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==T(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return G(e.getBoundingClientRect(),!1)}if(null==o&&i<T(r)){let e=r.childNodes[i];if(1==e.nodeType)return G(e.getBoundingClientRect(),!0)}return G(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==T(r))){let e=r.childNodes[i-1],t=3==e.nodeType?N(e,T(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return U(W(t,1),!1)}if(null==o&&i<T(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?N(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return U(W(t,-1),!0)}return U(W(3==r.nodeType?N(r):r,-n),n>=0)}function U(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function G(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Z(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const X=/[\u0590-\u08ac]/;let Y=null,Q=null,ee=!1;function te(e,t,n){return Y==t&&Q==n?ee:(Y=t,Q=n,ee="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return Z(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=K(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=N(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=e.domSelection();return X.test(r.parent.textContent)&&l.modify?Z(e,t,()=>{let t=l.getRangeAt(0),i=l.focusNode,o=l.focusOffset,s=l.caretBidiLevel;l.modify("move",n,"character");let a=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==l.focusNode.nodeType?l.focusNode:l.focusNode.parentNode)||i==l.focusNode&&o==l.focusOffset;return l.removeAllRanges(),l.addRange(t),null!=s&&(l.caretBidiLevel=s),a}):"left"==n||"backward"==n?o:s}(e,t,n))}const ne=0,re=1,ie=2,oe=3;class se{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=ne,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>C(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n,r=0,i=0;for(let o=0;r<this.children.length;r++){let t=this.children[r],n=o+t.size;if(n>e||t instanceof pe){i=e-o;break}o=n}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof le&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;(e=r?this.children[r-1]:null)&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?C(e.dom)+1:0}}{let e,n=!0;for(;(e=r<this.children.length?this.children[r]:null)&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?C(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],l=o+n.size;if(-1==r&&e<=l){let i=o+n.border;if(e>=i&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=C(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=C(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let d=0,u=0;d<this.children.length;d++){let s=this.children[d],l=u+s.size;if(i>u&&o<l)return s.setSelection(e-u-s.border,t-u-s.border,n,r);u=l}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.getSelection(),c=!1;if((f||v)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if((c=!(!t||"\n"!=e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(s=l={node:n.parentNode,offset:C(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(f&&a.focusNode&&a.focusNode!=l.node&&1==a.focusNode.nodeType){let e=a.focusNode.childNodes[a.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&v)&&E(s.node,s.offset,a.anchorNode,a.anchorOffset)&&E(l.node,l.offset,a.focusNode,a.focusOffset))return;let h=!1;if((a.extend||e==t)&&!c){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),h=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!h){if(e>t){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?ie:re,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=oe);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?oe:ie}n=o}this.dirty=ie}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?ie:re;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class le extends se{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==ne&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class ae extends se{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ce extends se{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let o=r.nodeViews[t.type.name],s=o&&o(t,r,n);return s&&s.dom||(s=i.b.renderSpec(document,t.type.spec.toDOM(t,n))),new ce(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&oe||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=oe&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ne){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=ne}}slice(e,t,n){let r=ce.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Oe(i,t,o,n)),e>0&&(i=Oe(i,0,e,n));for(let s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r}}class he extends se{constructor(e,t,n,r,i,o,s,l,a){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(l,a)}static create(e,t,n,r,o,s){let l,a=o.nodeViews[t.type.name],c=a&&a(t,o,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:s,n,r),h=c&&c.dom,d=c&&c.contentDOM;if(t.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(t.text);else h||({dom:h,contentDOM:d}=i.b.renderSpec(document,t.type.spec.toDOM(t)));d||t.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable="false"),t.type.spec.draggable&&(h.draggable=!0));let u=h;return h=we(h,n,t),c?l=new fe(e,t,n,r,h,d||null,u,c,o,s+1):t.isText?new ue(e,t,n,r,h,u,o):new he(e,t,n,r,h,d||null,u,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=(()=>i.c.empty))}else e.contentElement=this.contentDOM;else e.getContent=(()=>this.node.content);return e}matchesNode(e,t,n){return this.dirty==ne&&e.eq(this.node)&&xe(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new Se(this,s&&s.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Ce);for(let t=0;t<e.length;t++)n(e[t],c,!!a)}else n(t,c,!!a)}let h,d;if(a)d=-1,h=a,a=null;else{if(!(c<e.childCount))break;d=c,h=e.child(c++)}for(let e=0;e<l.length;e++)l[e].to<=o&&l.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let u=o+h.nodeSize;if(h.isText){let e=u;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<u&&(a=h.cut(e-o),h=h.cut(0,e-o),u=e,d=-1)}let p=h.isInline&&!h.isLeaf?l.filter(e=>!e.inline):l.slice();r(h,p,t.forChild(o,h),d),o=u}}(this.node,this.innerDeco,(t,o,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!s&&a.syncToMarks(o==this.node.childCount?i.d.none:this.node.child(o).marks,n,e),a.placeWidget(t,e,r)},(t,i,s,c)=>{let h;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,i,s,c)||l&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(h=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,s,h,e)||a.updateNextNode(t,i,s,e,c)||a.addNode(t,i,s,e,r),r+=t.nodeSize}),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==ie)&&(s&&this.protectLocalComposition(e,s),function e(t,n,r){let i=t.firstChild,o=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=i;)i=ke(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(a,i);if(l instanceof ce){let n=i?i.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=ke(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),b&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof r.h)||n<t||i>t+this.node.content.size)return null;let o=e.domSelection(),s=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];e=e.childNodes[t-1],t=T(e)}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let e=s.nodeValue,r=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;a+=t.text}if(o>=n){let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}(this.node.content,e,n-t,i-t);return r<0?null:{node:s,pos:r,text:e}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new ae(this,i,t,r);e.input.compositionNodes.push(o),this.children=Oe(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(this.dirty==oe||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=ne}updateOuterDeco(e){if(xe(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ve(this.dom,this.nodeDOM,ye(this.outerDeco,this.node,t),ye(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function de(e,t,n,r,i){return we(r,t,e),new he(void 0,e,t,n,r,r,r,i,0)}class ue extends he{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(this.dirty==oe||this.dirty!=ne&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==ne&&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=ne,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new ue(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=oe)}get domAtom(){return!1}}class pe extends se{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ne&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class fe extends he{constructor(e,t,n,r,i,o,s,l,a,c){super(e,t,n,r,i,o,s,a,c),this.spec=l}update(e,t,n,r){if(this.dirty==oe)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}const me=function(e){e&&(this.nodeName=e)};me.prototype=Object.create(null);const ge=[new me];function ye(e,t,n){if(0==e.length)return ge;let r=n?ge[0]:new me,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new me(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new me(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function ve(e,t,n,r){if(n==ge&&r==ge)return t;let i=t;for(let o=0;o<r.length;o++){let t=r[o],s=n[o];if(o){let n;s&&s.nodeName==t.nodeName&&i!=e&&(n=i.parentNode)&&n.nodeName.toLowerCase()==t.nodeName?i=n:((n=document.createElement(t.nodeName)).pmIsDeco=!0,n.appendChild(i),s=ge[0],i=n)}be(i,s||ge[0],t)}return i}function be(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function we(e,t,n){return ve(e,e,ge,ye(t,n,1!=e.nodeType))}function xe(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ke(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Se{constructor(e,t){this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof ce)){l=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=ne,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=ce.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s<l;s++){let r=this.top.children[s];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=s;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return o.dirty==oe&&o.dom==o.contentDOM&&(o.dirty=ie),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof he){let l=this.preMatch.matched.get(s);if(null!=l&&l!=i)return!1;let a=s.dom;if(!(this.lock&&(a==this.lock||1==a.nodeType&&a.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=oe&&xe(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=a&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,he.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new le(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ce;)e=(t=e).children[t.children.length-1];e&&e instanceof ue&&!/\n$/.test(e.node.text)||((v||g)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new pe(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Ce(e,t){return e.type.side-t.type.side}function Oe(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,h=l+=a.size;c>=n||h<=t?o.push(a):(c<t&&o.push(a.slice(0,t-c,r)),i&&(o.push(i),i=void 0),h>n&&o.push(a.slice(n-c,a.size,r)))}return o}function Me(e,t=null){let n=e.domSelection(),i=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),s=o&&0==o.size,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let a,c,h=i.resolve(l);if(I(n)){for(a=h;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&r.c.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==T(e);r||i;){if(e==n)return!0;let t=C(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==T(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;c=new r.c(l==e?h:i.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=i.resolve(t)}if(!c){c=ze(e,a,h,"pointer"==t||e.state.selection.head<h.pos&&!s?1:-1)}return c}function Ne(e){return e.editable?e.hasFocus():_e(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ee(e,t=!1){let n=e.state.selection;if(Ie(e,n),Ne(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&g){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&E(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,C(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&u&&p<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let i,o,{anchor:s,head:l}=n;!Ae||n instanceof r.h||(n.$from.parent.inlineContent||(i=De(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=De(e,n.to))),e.docView.setSelection(s,l,e.root,t),Ae&&(i&&Re(i),o&&Re(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=(()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{Ne(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))}))}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ae=v||g&&y<63;function De(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(v&&i&&"false"==i.contentEditable)return Te(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return Te(i);if(o)return Te(o)}}function Te(e){return e.contentEditable="true",v&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Re(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ie(e,t){if(t instanceof r.c){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&($e(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else $e(e)}function $e(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ze(e,t,n,i){return e.someProp("createSelectionBetween",r=>r(e,t,n))||r.h.between(t,n,i)}function Pe(e){return(!e.editable||e.root.activeElement==e.dom)&&_e(e)}function _e(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function je(e,t){let{$anchor:n,$head:i}=e.selection,o=t>0?n.max(i):n.min(i),s=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return s&&r.f.findFrom(s,t)}function Be(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ve(e,t,n){let i=e.state.selection;if(!(i instanceof r.h)){if(i instanceof r.c&&i.node.isInline)return Be(e,new r.h(t>0?i.$to:i.$from));{let n=je(e.state,t);return!!n&&Be(e,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=je(e.state,t);return!!(n&&n instanceof r.c)&&Be(e,n)}if(!(w&&n.indexOf("m")>-1)){let n,o=i.$head,s=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText)return!1;let l=t<0?o.pos-s.nodeSize:o.pos;return!!(s.isAtom||(n=e.docView.descAt(l))&&!n.contentDOM)&&(r.c.isSelectable(s)?Be(e,new r.c(t<0?e.state.doc.resolve(o.pos-s.nodeSize):o)):!!k&&Be(e,new r.h(e.state.doc.resolve(t<0?l:l+s.nodeSize))))}}function Le(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Fe(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function qe(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(f&&1==n.nodeType&&r<Le(n)&&Fe(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Fe(e))i=n,o=--r;else{if(3!=e.nodeType)break;r=(n=e).nodeValue.length}}}else{if(We(n))break;{let t=n.previousSibling;for(;t&&Fe(t);)i=n.parentNode,o=C(t),t=t.previousSibling;if(t)r=Le(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}}s?He(e,t,n,r):i&&He(e,t,i,o)}function Je(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=Le(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Fe(n.childNodes[r]))break;i=n,o=++r}else{if(We(n))break;{let t=n.nextSibling;for(;t&&Fe(t);)i=t.parentNode,o=C(t)+1,t=t.nextSibling;if(t)r=0,s=Le(n=t);else{if((n=n.parentNode)==e.dom)break;r=s=0}}}i&&He(e,t,i,o)}function We(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function He(e,t,n,r){if(I(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Ee(e)},50)}function Ke(e,t,n){let i=e.state.selection;if(i instanceof r.h&&!i.empty||n.indexOf("s")>-1)return!1;if(w&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=i;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=je(e.state,t);if(n&&n instanceof r.c)return Be(e,n)}if(!o.parent.inlineContent){let n=t<0?o:s,l=i instanceof r.a?r.f.near(n,t):r.f.findFrom(n,t);return!!l&&Be(e,l)}return!1}function Ue(e,t){if(!(e.state.selection instanceof r.h))return!0;let{$head:n,$anchor:i,empty:o}=e.state.selection;if(!n.sameParent(i))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function Ge(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ze(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||w&&72==n&&"c"==r?Ue(e,-1)||qe(e):46==n||w&&68==n&&"c"==r?Ue(e,1)||Je(e):13==n||27==n||(37==n||w&&66==n&&"c"==r?Ve(e,-1,r)||qe(e):39==n||w&&70==n&&"c"==r?Ve(e,1,r)||Je(e):38==n||w&&80==n&&"c"==r?Ke(e,-1,r)||qe(e):40==n||w&&78==n&&"c"==r?function(e){if(!v||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Ge(e,n,"true"),setTimeout(()=>Ge(e,n,"false"),20)}return!1}(e)||Ke(e,1,r)||Je(e):r==(w?"m":"c")&&(66==n||73==n||89==n||90==n))}function Xe(e,t){let n=[],{content:r,openStart:o,openEnd:s}=t;for(;o>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let l=e.someProp("clipboardSerializer")||i.b.fromSchema(e.state.schema),a=lt(),c=a.createElement("div");c.appendChild(l.serializeFragment(r,{document:a}));let h,d=c.firstChild,u=0;for(;d&&1==d.nodeType&&(h=ot[d.nodeName.toLowerCase()]);){for(let e=h.length-1;e>=0;e--){let t=a.createElement(h[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),u++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${s}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:c,text:e.someProp("clipboardTextSerializer",e=>e(t))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ye(e,t,n,r,o){let s,l,a=o.parent.type.spec.code;if(!n&&!t)return null;let c=t&&(r||a||!n);if(c){if(e.someProp("transformPastedText",e=>{t=e(t,a||r)}),a)return t?new i.j(i.c.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):i.j.empty;let n=e.someProp("clipboardTextParser",e=>e(t,o,r));if(n)l=n;else{let n=o.marks(),{schema:r}=e.state,l=i.b.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",e=>{n=e(n)}),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=lt().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&ot[i[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join(""));if(r.innerHTML=e,n)for(let o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),k&&function(e){let t=e.querySelectorAll(g?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let h=s&&s.querySelector("[data-pm-slice]"),d=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let i=+d[3];i>0&&s.firstChild;i--)s=s.firstChild;if(!l){let t=e.someProp("clipboardParser")||e.someProp("domParser")||i.a.fromSchema(e.state.schema);l=t.parseSlice(s,{preserveWhitespace:!(!c&&!d),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Qe.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)l=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:s,openEnd:l}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;o=i.c.from(e.create(n[a+1],o)),s++,l++}return new i.j(o,s,l)}(it(l,+d[1],+d[2]),d[4]);else if((l=i.j.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n),s=o.contentMatchAt(t.index(n)),l=[];if(e.forEach(e=>{if(!l)return;let t,n=s.findWrapping(e.type);if(!n)return l=null;if(t=l.length&&r.length&&tt(n,r,e,l[l.length-1],0))l[l.length-1]=t;else{l.length&&(l[l.length-1]=nt(l[l.length-1],r.length));let t=et(e,n);l.push(t),s=s.matchType(t.type),r=n}}),l)return i.c.from(l)}return e}(l.content,o),!0)).openStart||l.openEnd){let e=0,t=0;for(let n=l.content.firstChild;e<l.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=l.content.lastChild;t<l.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);l=it(l,e,t)}return e.someProp("transformPasted",e=>{l=e(l)}),l}const Qe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function et(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,i.c.from(e));return e}function tt(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let s=tt(e,t,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(i.c.from(et(n,e,o+1))))}}function nt(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,nt(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(i.c.empty,!0);return e.copy(n.append(r))}function rt(e,t,n,r,o,s){let l=t<0?e.firstChild:e.lastChild,a=l.content;return o<r-1&&(a=rt(a,t,n,r,o+1,s)),o>=n&&(a=t<0?l.contentMatchAt(0).fillBefore(a,e.childCount>1||s<=o).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(i.c.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function it(e,t,n){return t<e.openStart&&(e=new i.j(rt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i.j(rt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const ot={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let st=null;function lt(){return st||(st=document.implementation.createHTMLDocument("title"))}const at={};let ct={};class ht{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function dt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ut(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=(t=>pt(e,t)))})}function pt(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function ft(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function mt(e){return{left:e.clientX,top:e.clientY}}function gt(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,t=>s>o.depth?t(e,n,o.nodeAfter,o.before(s),i,!0):t(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function yt(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function vt(e,t,n,i,o){return gt(e,"handleClickOn",t,n,i)||e.someProp("handleClick",n=>n(e,t,i))||(o?function(e,t){if(-1==t)return!1;let n,i,o=e.state.selection;o instanceof r.c&&(n=o.node);let s=e.state.doc.resolve(t);for(let l=s.depth+1;l>0;l--){let e=l>s.depth?s.nodeAfter:s.node(l);if(r.c.isSelectable(e)){i=n&&o.$from.depth>0&&l>=o.$from.depth&&s.before(o.$from.depth+1)==o.$from.pos?s.before(o.$from.depth):s.before(l);break}}return null!=i&&(yt(e,r.c.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&r.c.isSelectable(i))&&(yt(e,new r.c(n),"pointer"),!0)}(e,n))}function bt(e,t,n,i){return gt(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",n=>n(e,t,i))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(yt(e,r.h.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(t);for(let s=o.depth+1;s>0;s--){let t=s>o.depth?o.nodeAfter:o.node(s),n=o.before(s);if(t.inlineContent)yt(e,r.h.create(i,n+1,n+1+t.content.size),"pointer");else{if(!r.c.isSelectable(t))continue;yt(e,r.c.create(i,n),"pointer")}return!0}}(e,n,i)}function wt(e){return Mt(e)}ct.keydown=((e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!kt(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!x||!g||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!b||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||Ze(e,n)?n.preventDefault():dt(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,$(13,"Enter"))),e.input.lastIOSEnter=0)},200)}}),ct.keyup=((e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)}),ct.keypress=((e,t)=>{let n=t;if(kt(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||w&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof r.h&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",n=>n(e,i.$from.pos,i.$to.pos,t))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}});const xt=w?"metaKey":"ctrlKey";at.mousedown=((e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=wt(e),o=Date.now(),s="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[xt]&&("singleClick"==e.input.lastClick.type?s="doubleClick":"doubleClick"==e.input.lastClick.type&&(s="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s};let l=e.posAtCoords(mt(n));l&&("singleClick"==s?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new class{constructor(e,t,n,i){let o,s;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[xt],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,s=n.depth?n.before():0}const l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:c}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof r.c&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!f||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),dt(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ee(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(mt(e))),this.allowDefault||!t?dt(this.view,"pointer"):vt(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||v&&this.mightDrag&&!this.mightDrag.node.isAtom||g&&!(this.view.state.selection instanceof r.h)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(yt(this.view,r.f.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):dt(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),dt(this.view,"pointer"),0==e.buttons&&this.done()}}(e,l,n,!!i)):("doubleClick"==s?function(e,t,n,r){return gt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:bt)(e,l.pos,l.inside,n)?n.preventDefault():dt(e,"pointer"))});function kt(e,t){return!!e.composing||!!(v&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}at.touchdown=(e=>{wt(e),dt(e,"pointer")}),at.contextmenu=(e=>wt(e));const St=x?5e3:-1;function Ct(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Mt(e),t))}function Ot(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Mt(e,t=!1){if(!(x&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ot(e),t||e.docView&&e.docView.dirty){let t=Me(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}ct.compositionstart=ct.compositionupdate=(e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)))e.markCursor=e.state.storedMarks||n.marks(),Mt(e,!0),e.markCursor=null;else if(Mt(e),f&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Ct(e,St)}),ct.compositionend=((e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Ct(e,20))});const Nt=u&&p<15||b&&S<604;function Et(e,t,n,r){let o=Ye(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,r,o||i.j.empty)))return!0;if(!o)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),l=s?e.state.tr.replaceSelectionWith(s,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}at.copy=ct.cut=((e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Nt?null:n.clipboardData,s=r.content(),{dom:l,text:a}=Xe(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}),ct.paste=((e,t)=>{let n=t;if(e.composing&&!x)return;let r=Nt?null:n.clipboardData;r&&Et(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.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(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Et(e,r.value,null,t):Et(e,r.textContent,r.innerHTML,t)},50)}(e,n)});const At=w?"altKey":"ctrlKey";at.dragstart=((e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let o=e.state.selection,s=o.empty?null:e.posAtCoords(mt(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof r.c?o.to-1:o.to));else if(i&&i.mightDrag)e.dispatch(e.state.tr.setSelection(r.c.create(e.state.doc,i.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(r.c.create(e.state.doc,t.posBefore)))}let l=e.state.selection.content(),{dom:a,text:c}=Xe(e,l);n.dataTransfer.clearData(),n.dataTransfer.setData(Nt?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Nt||n.dataTransfer.setData("text/plain",c),e.dragging=new class{constructor(e,t){this.slice=e,this.move=t}}(l,!n[At])}),at.dragend=(e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)}),ct.dragover=ct.dragenter=((e,t)=>t.preventDefault()),ct.drop=((e,t)=>{let n=t,s=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let l=e.posAtCoords(mt(n));if(!l)return;let a=e.state.doc.resolve(l.pos);if(!a)return;let c=s&&s.slice;c?e.someProp("transformPasted",e=>{c=e(c)}):c=Ye(e,n.dataTransfer.getData(Nt?"Text":"text/plain"),Nt?null:n.dataTransfer.getData("text/html"),!1,a);let h=!(!s||n[At]);if(e.someProp("handleDrop",t=>t(e,n,c||i.j.empty,h)))return void n.preventDefault();if(!c)return;n.preventDefault();let d=c?Object(o.h)(e.state.doc,a.pos,c):a.pos;null==d&&(d=a.pos);let u=e.state.tr;h&&u.deleteSelection();let p=u.mapping.map(d),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,m=u.doc;if(f?u.replaceRangeWith(p,p,c.content.firstChild):u.replaceRange(p,p,c),u.doc.eq(m))return;let g=u.doc.resolve(p);if(f&&r.c.isSelectable(c.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(c.content.firstChild))u.setSelection(new r.c(g));else{let t=u.mapping.map(d);u.mapping.maps[u.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),u.setSelection(ze(e,g,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}),at.focus=(e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Ee(e)},20))}),at.blur=((e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)}),at.beforeinput=((e,t)=>{if(g&&x&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,$(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}});for(let hn in ct)at[hn]=ct[hn];function Dt(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Tt{constructor(e,t){this.toDOM=e,this.spec=t||Pt,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new $t(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Tt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Dt(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Rt{constructor(e,t){this.attrs=e,this.spec=t||Pt}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new $t(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Rt&&Dt(this.attrs,e.attrs)&&Dt(this.spec,e.spec)}static is(e){return e.type instanceof Rt}destroy(){}}class It{constructor(e,t){this.attrs=e,this.spec=t||Pt}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new $t(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof It&&Dt(this.attrs,e.attrs)&&Dt(this.spec,e.spec)}destroy(){}}class $t{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new $t(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new $t(e,e,new Tt(t,n))}static inline(e,t,n,r){return new $t(e,t,new Rt(n,r))}static node(e,t,n,r){return new $t(e,t,new It(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Rt}}const zt=[],Pt={};class _t{constructor(e,t){this.local=e.length?e:zt,this.children=t.length?t:zt}static create(e,t){return t.length?qt(t,e,0,Pt):jt}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==jt||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Pt)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(o||(o=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let l=e.slice(),a=(e,t,n,r)=>{for(let s=0;s<l.length;s+=3){let a,c=l[s+1];if(c<0||e>c+o)continue;let h=l[s]+o;t>=h?l[s+1]=e<=h?-2:-1:n>=i&&(a=r-n-(t-e))&&(l[s]+=a,l[s+1]+=a)}};for(let h=0;h<n.maps.length;h++)n.maps[h].forEach(a);let c=!1;for(let h=0;h<l.length;h+=3)if(l[h+1]<0){if(-2==l[h+1]){c=!0,l[h+1]=-1;continue}let t=n.map(e[h]+o),a=t-i;if(a<0||a>=r.content.size){c=!0;continue}let d=n.map(e[h+1]+o,-1),u=d-i,{index:p,offset:f}=r.content.findIndex(a),m=r.maybeChild(p);if(m&&f==a&&f+m.nodeSize==u){let r=l[h+2].mapInner(n,m,t+1,e[h]+o+1,s);r!=jt?(l[h]=a,l[h+1]=u,l[h+2]=r):(l[h+1]=-2,c=!0)}else c=!0}if(c){let a=function(e,t,n,r,i,o,s){function l(e,t){for(let o=0;o<e.local.length;o++){let l=e.local[o].map(r,i,t);l?n.push(l):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let a=0;a<e.length;a+=3)-1==e[a+1]&&l(e[a+2],t[a]+o+1);return n}(l,e,t,n,i,o,s),c=qt(a,r,0,s);t=c.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new _t(t.sort(Jt),l)}(this.children,o||[],e,t,n,r,i):o?new _t(o.sort(Jt),zt):jt}add(e,t){return t.length?this==jt?_t.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let s,l=o+n;if(s=Lt(t,e,l)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,l+1):r.splice(i,0,o,o+e.nodeSize,qt(s,e,l+1,Pt)),i+=3}});let o=Vt(i?Ft(t):t,-n);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||o.splice(s--,1);return new _t(o.length?this.local.concat(o).sort(Jt):this.local,r||this.children)}remove(e){return 0==e.length||this==jt?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let l=n[i+2].removeInner(r,o+1);l!=jt?n[i+2]=l:(n.splice(i,3),i-=3)}if(r.length)for(let i,o=0;o<e.length;o++)if(i=e[o])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new _t(r,n):jt}forChild(e,t){if(this==jt)return this;if(t.isLeaf)return _t.empty;let n,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(n=this.children[s+2]);break}let i=e+1,o=i+t.content.size;for(let s=0;s<this.local.length;s++){let e=this.local[s];if(e.from<o&&e.to>i&&e.type instanceof Rt){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let e=new _t(r.sort(Jt),zt);return n?new Bt([e,n]):e}return n||jt}eq(e){if(this==e)return!0;if(!(e instanceof _t)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Wt(this.localsInner(e))}localsInner(e){if(this==jt)return zt;if(e.inlineContent||!this.local.some(Rt.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Rt||t.push(this.local[n]);return t}}_t.empty=new _t([],[]),_t.removeOverlap=Wt;const jt=_t.empty;class Bt{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Pt));return Bt.from(n)}forChild(e,t){if(t.isLeaf)return _t.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=jt&&(i instanceof Bt?n=n.concat(i.members):n.push(i))}return Bt.from(n)}eq(e){if(!(e instanceof Bt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?Wt(n?t:t.sort(Jt)):zt}static from(e){switch(e.length){case 0:return jt;case 1:return e[0];default:return new Bt(e)}}}function Vt(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new $t(i.from+t,i.to+t,i.type))}return n}function Lt(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o,s=0;s<e.length;s++)(o=e[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[s]=null);return i}function Ft(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function qt(e,t,n,r){let i=[],o=!1;t.forEach((t,s)=>{let l=Lt(e,t,s+n);if(l){o=!0;let e=qt(l,t,n+s+1,r);e!=jt&&i.push(s,s+t.nodeSize,e)}});let s=Vt(o?Ft(e):e,-n).sort(Jt);for(let l=0;l<s.length;l++)s[l].type.valid(t,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new _t(s,i):jt}function Jt(e,t){return e.from-t.from||e.to-t.to}function Wt(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Ht(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),Ht(t,i+1,o.copy(r.to,o.to)))}}return t}function Ht(e,t,n){for(;t<e.length&&Jt(n,e[t])>0;)t++;e.splice(t,0,n)}function Kt(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=jt&&t.push(r)}),e.cursorWrapper&&t.push(_t.create(e.state.doc,[e.cursorWrapper.deco])),Bt.from(t)}const Ut={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Gt=u&&p<=11;class Zt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Xt{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Zt,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);u&&p<=11&&e.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),Gt&&(this.onCharData=(e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()})),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Ut)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Pe(this.view)){if(this.suppressingSelectionUpdates)return Ee(this.view);if(u&&p<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&E(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&Pe(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let l=0;l<e.length;l++){let t=this.registerMutation(e[l],s);t&&(r=r<0?t.from:Math.min(t.from,r),i=i<0?t.to:Math.max(t.to,i),t.typeOver&&(o=!0))}if(f&&s.length>1){let e=s.filter(e=>"BR"==e.nodeName);if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(Yt)return;Yt=!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,i,o,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Ee(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let 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){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(u&&p<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?C(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?C(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let Yt=!1;function Qt(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(v&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||v&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function en(e,t,n,o,s){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Me(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let l=e.state.doc.resolve(t),a=l.sharedDepth(n);t=l.before(a+1),n=e.state.doc.resolve(n).after(a+1);let c=e.state.selection,h=function(e,t,n){let r,{node:o,fromOffset:s,toOffset:l,from:a,to:c}=e.docView.parseRange(t,n),h=e.domSelection(),d=h.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:h.anchorOffset}],I(h)||r.push({node:h.focusNode,offset:h.focusOffset})),g&&8===e.input.lastKeyCode)for(let i=l;i>s;i--){let e=o.childNodes[i-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){l=i;break}if(!t||t.size)break}let u=e.state.doc,p=e.someProp("domParser")||i.a.fromSchema(e.state.schema),f=u.resolve(a),m=null,y=p.parse(o,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:l,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Qt,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),m={anchor:e+a,head:t+a}}return{doc:y,sel:m,from:a,to:c}}(e,t,n);if(g&&e.cursorWrapper&&h.sel&&h.sel.anchor==e.cursorWrapper.deco.from&&h.sel.head==h.sel.anchor){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;h.sel={anchor:h.sel.anchor+n,head:h.sel.anchor+n}}let d,f,m=e.state.doc,y=m.slice(h.from,h.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(d=e.state.selection.to,f="end"):(d=e.state.selection.from,f="start"),e.input.lastKeyCode=null;let v=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){let e=Math.max(0,o-Math.min(s,l));r-=s+e-o}if(s<o&&e.size<t.size){let e=r<=o&&r>=s?o-r:0;l=(o-=e)+(l-s),s=o}else if(l<o){let e=r<=o&&r>=l?o-r:0;s=(o-=e)+(s-l),l=o}return{start:o,endA:s,endB:l}}(y.content,h.doc.content,h.from,d,f);if((b&&e.input.lastIOSEnter>Date.now()-225||x)&&s.some(e=>"DIV"==e.nodeName||"P"==e.nodeName)&&(!v||v.endA>=v.endB)&&e.someProp("handleKeyDown",t=>t(e,$(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!v){if(!(o&&c instanceof r.h&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let t=tn(e,e.state.doc,h.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}v={start:c.from,endA:c.to,endB:c.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&v.start==v.endB&&e.state.selection instanceof r.h&&(v.start>e.state.selection.from&&v.start<=e.state.selection.from+2&&e.state.selection.from>=h.from?v.start=e.state.selection.from:v.endA<e.state.selection.to&&v.endA>=e.state.selection.to-2&&e.state.selection.to<=h.to&&(v.endB+=e.state.selection.to-v.endA,v.endA=e.state.selection.to)),u&&p<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>h.from&&"  "==h.doc.textBetween(v.start-h.from-1,v.start-h.from+1)&&(v.start--,v.endA--,v.endB--);let w,k=h.doc.resolveNoCache(v.start-h.from),S=h.doc.resolveNoCache(v.endB-h.from),C=m.resolve(v.start),O=k.sameParent(S)&&k.parent.inlineContent&&C.end()>=v.endA;if((b&&e.input.lastIOSEnter>Date.now()-225&&(!O||s.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!O&&k.pos<h.doc.content.size&&(w=r.f.findFrom(h.doc.resolve(k.pos+1),1,!0))&&w.head==S.pos)&&e.someProp("handleKeyDown",t=>t(e,$(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>v.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||nn(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(nn(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||nn(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(m,v.start,v.endA,k,S)&&e.someProp("handleKeyDown",t=>t(e,$(8,"Backspace"))))return void(x&&g&&e.domObserver.suppressSelectionUpdates());g&&x&&v.endB==v.start&&(e.input.lastAndroidDelete=Date.now()),x&&!O&&k.start()!=S.start()&&0==S.parentOffset&&k.depth==S.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==v.endA&&(v.endB-=2,S=h.doc.resolveNoCache(v.endB-h.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,$(13,"Enter"))})},20));let M,N,E,A=v.start,D=v.endA;if(O)if(k.pos==S.pos)u&&p<=11&&0==k.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ee(e),20)),M=e.state.tr.delete(A,D),N=m.resolve(v.start).marksAcross(m.resolve(v.endA));else if(v.endA==v.endB&&(E=function(e,t){let n,r,o,s=e.firstChild.marks,l=t.firstChild.marks,a=s,c=l;for(let i=0;i<l.length;i++)a=l[i].removeFromSet(a);for(let i=0;i<s.length;i++)c=s[i].removeFromSet(c);if(1==a.length&&0==c.length)r=a[0],n="add",o=(e=>e.mark(r.addToSet(e.marks)));else{if(0!=a.length||1!=c.length)return null;r=c[0],n="remove",o=(e=>e.mark(r.removeFromSet(e.marks)))}let h=[];for(let i=0;i<t.childCount;i++)h.push(o(t.child(i)));if(i.c.from(h).eq(e))return{mark:r,type:n}}(k.parent.content.cut(k.parentOffset,S.parentOffset),C.parent.content.cut(C.parentOffset,v.endA-C.start()))))M=e.state.tr,"add"==E.type?M.addMark(A,D,E.mark):M.removeMark(A,D,E.mark);else if(k.parent.child(k.index()).isText&&k.index()==S.index()-(S.textOffset?0:1)){let t=k.parent.textBetween(k.parentOffset,S.parentOffset);if(e.someProp("handleTextInput",n=>n(e,A,D,t)))return;M=e.state.tr.insertText(t,A,D)}if(M||(M=e.state.tr.replace(A,D,h.doc.slice(v.start-h.from,v.endB-h.from))),h.sel){let t=tn(e,M.doc,h.sel);t&&!(g&&x&&e.composing&&t.empty&&(v.start!=v.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==A||t.head==M.mapping.map(D)-1)||u&&t.empty&&t.head==A)&&M.setSelection(t)}N&&M.ensureMarks(N),e.dispatch(M.scrollIntoView())}function tn(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ze(e,t.resolve(n.anchor),t.resolve(n.head))}function nn(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class rn{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ht,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(cn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ln(this),sn(this),this.nodeViews=an(this),this.docView=de(this.state.doc,on(this),Kt(this),this.dom,this),this.domObserver=new Xt(this,(e,t,n,r)=>en(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in at){let n=at[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=(t=>{!ft(e,t)||pt(e,t)||!e.editable&&t.type in ct||n(e,t)}))}v&&e.dom.addEventListener("input",()=>null),ut(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ut(this),this._props=e,e.plugins&&(e.plugins.forEach(cn),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,i=!1,o=!1;if(e.storedMarks&&this.composing&&(Ot(this),o=!0),this.state=e,t){let e=an(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,i=!0),ut(this)}this.editable=ln(this),sn(this);let s=Kt(this),l=on(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",c=i||!this.docView.matchesNode(e.doc,l,s);!c&&e.selection.eq(n.selection)||(o=!0);let h="preserve"==a&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=i-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:B(e.dom)}}(this);if(o){this.domObserver.stop();let t=c&&(u||g)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(c){let n=g?this.trackWrites=this.domSelection().focusNode:null;!i&&this.docView.update(e.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=de(e.doc,l,s,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return E(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Ee(this,t):(Ie(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",e=>e(this)));else if(e.selection instanceof r.c){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&j(this,n.getBoundingClientRect(),t)}else j(this,this.coordsAtPos(e.selection.head,1),t)}else h&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;V(n,0==r?0:r-t)}(h)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let o=0;o<this.directPlugins.length;o++){let r=this.directPlugins[o].props[e];if(null!=r&&(n=t?t(r):r))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let r=i[o].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(L)return e.focus(L);let t=B(e);e.focus(null==L?{get preventScroll(){return L={preventScroll:!0},!0}}:void 0),L||(L=!1,V(t,0))}(this.dom),Ee(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=(()=>t.ownerDocument.getSelection())),this._root=t;return e||document}posAtCoords(e){return J(this,e)}coordsAtPos(e,t=1){return K(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return te(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Kt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){pt(e,t)||!at[t.type]||!e.editable&&t.type in ct||at[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function on(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),[$t.node(0,e.state.doc.content.size,t)]}function sn(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:$t.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ln(e){return!e.someProp("editable",t=>!1===t(e.state))}function an(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function cn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}},cqjR:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return d}),n.d(t,"d",function(){return c}),n.d(t,"e",function(){return h});var r=n("b/sn"),i=n("uSMm");class o{constructor(e,t){this.match=e,this.match=e,this.handler="string"==typeof t?function(e){return function(t,n,r,i){let o=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);o+=n[0].slice(e+n[1].length);let t=(r+=e)-i;t>0&&(o=n[0].slice(e-t,e)+o,r=i)}return t.tr.insertText(o,r,i)}}(t):t}}const s=500;function l({rules:e}){let t=new r.d({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,i,o)=>a(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&a(n,r.pos,r.pos,"",e,t)})}}},isInputRules:!0});return t}function a(e,t,n,r,i,o){if(e.composing)return!1;let l=e.state,a=l.doc.resolve(t);if(a.parent.type.spec.code)return!1;let c=a.parent.textBetween(Math.max(0,a.parentOffset-s),a.parentOffset,null,"")+r;for(let s=0;s<i.length;s++){let a=i[s].match.exec(c),h=a&&i[s].handler(l,a,t-(a[0].length-r.length),n);if(h)return e.dispatch(h.setMeta(o,{transform:h,from:t,to:n,text:r})),!0}return!1}const c=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let n=e.tr,r=i.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(i.text){let t=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,e.schema.text(i.text,t))}else n.delete(i.from,i.to);t(n)}return!0}}return!1};new o(/--$/,"—"),new o(/\.\.\.$/,"…"),new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new o(/"$/,"”"),new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new o(/'$/,"’");function h(e,t,n=null,r){return new o(e,(e,o,s,l)=>{let a=n instanceof Function?n(o):n,c=e.tr.delete(s,l),h=c.doc.resolve(s).blockRange(),d=h&&Object(i.i)(h,t,a);if(!d)return null;c.wrap(h,d);let u=c.doc.resolve(s-1).nodeBefore;return u&&u.type==t&&Object(i.f)(c.doc,s-1)&&(!r||r(o,u))&&c.join(s-1),c})}function d(e,t,n=null){return new o(e,(e,r,i,o)=>{let s=e.doc.resolve(i),l=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(i,o).setBlockType(i,i,t,l):null})}},e56X:function(e,t,n){const{noopTest:r,edit:i,merge:o}=n("rUJ1"),s={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:r,table:r,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};s.def=i(s.def).replace("label",s._label).replace("title",s._title).getRegex(),s.bullet=/(?:[*+-]|\d{1,9}\.)/,s.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,s.item=i(s.item,"gm").replace(/bull/g,s.bullet).getRegex(),s.list=i(s.list).replace(/bull/g,s.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+s.def.source+")").getRegex(),s._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",s._comment=/<!--(?!-?>)[\s\S]*?-->/,s.html=i(s.html,"i").replace("comment",s._comment).replace("tag",s._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),s.paragraph=i(s._paragraph).replace("hr",s.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",s._tag).getRegex(),s.blockquote=i(s.blockquote).replace("paragraph",s.paragraph).getRegex(),s.normal=o({},s),s.gfm=o({},s.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),s.gfm.nptable=i(s.gfm.nptable).replace("hr",s.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",s._tag).getRegex(),s.gfm.table=i(s.gfm.table).replace("hr",s.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",s._tag).getRegex(),s.pedantic=o({},s.normal,{html:i("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",s._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:r,paragraph:i(s.normal._paragraph).replace("hr",s.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",s.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const l={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:r,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:r,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,_punctuation:"!\"#$%&'()*+,\\-./:;<=>?@\\[^_{|}~"};l.em=i(l.em).replace(/punctuation/g,l._punctuation).getRegex(),l._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,l._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,l._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,l.autolink=i(l.autolink).replace("scheme",l._scheme).replace("email",l._email).getRegex(),l._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,l.tag=i(l.tag).replace("comment",s._comment).replace("attribute",l._attribute).getRegex(),l._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,l._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,l._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,l.link=i(l.link).replace("label",l._label).replace("href",l._href).replace("title",l._title).getRegex(),l.reflink=i(l.reflink).replace("label",l._label).getRegex(),l.normal=o({},l),l.pedantic=o({},l.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:i(/^!?\[(label)\]\((.*?)\)/).replace("label",l._label).getRegex(),reflink:i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",l._label).getRegex()}),l.gfm=o({},l.normal,{escape:i(l.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),l.gfm.url=i(l.gfm.url,"i").replace("email",l.gfm._extended_email).getRegex(),l.breaks=o({},l.gfm,{br:i(l.br).replace("{2,}","*").getRegex(),text:i(l.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),e.exports={block:s,inline:l}},hyX7:function(e,t,n){const r=n("SbYC"),{defaults:i}=n("vbtb"),{inline:o}=n("e56X"),{findClosingBracket:s,escape:l}=n("rUJ1");e.exports=class e{constructor(e,t){if(this.options=t||i,this.links=e,this.rules=o.normal,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=o.pedantic:this.options.gfm&&(this.options.breaks?this.rules=o.breaks:this.rules=o.gfm)}static get rules(){return o}static output(t,n,r){return new e(n,r).output(t)}output(t){let n,r,i,o,a,c,h="";for(;t;)if(a=this.rules.escape.exec(t))t=t.substring(a[0].length),h+=l(a[1]);else if(a=this.rules.tag.exec(t))!this.inLink&&/^<a /i.test(a[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(a[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(this.inRawBlock=!1),t=t.substring(a[0].length),h+=this.renderer.html(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):l(a[0]):a[0]);else if(a=this.rules.link.exec(t)){const r=s(a[2],"()");if(r>-1){const e=(0===a[0].indexOf("!")?5:4)+a[1].length+r;a[2]=a[2].substring(0,r),a[0]=a[0].substring(0,e).trim(),a[3]=""}t=t.substring(a[0].length),this.inLink=!0,i=a[2],this.options.pedantic?(n=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i))?(i=n[1],o=n[3]):o="":o=a[3]?a[3].slice(1,-1):"",i=i.trim().replace(/^<([\s\S]*)>$/,"$1"),h+=this.outputLink(a,{href:e.escapes(i),title:e.escapes(o)}),this.inLink=!1}else if((a=this.rules.reflink.exec(t))||(a=this.rules.nolink.exec(t))){if(t=t.substring(a[0].length),n=(a[2]||a[1]).replace(/\s+/g," "),!(n=this.links[n.toLowerCase()])||!n.href){h+=a[0].charAt(0),t=a[0].substring(1)+t;continue}this.inLink=!0,h+=this.outputLink(a,n),this.inLink=!1}else if(a=this.rules.strong.exec(t))t=t.substring(a[0].length),h+=this.renderer.strong(this.output(a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.em.exec(t))t=t.substring(a[0].length),h+=this.renderer.em(this.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.code.exec(t))t=t.substring(a[0].length),h+=this.renderer.codespan(l(a[2].trim(),!0));else if(a=this.rules.br.exec(t))t=t.substring(a[0].length),h+=this.renderer.br();else if(a=this.rules.del.exec(t))t=t.substring(a[0].length),h+=this.renderer.del(this.output(a[1]));else if(a=this.rules.autolink.exec(t))t=t.substring(a[0].length),i="@"===a[2]?"mailto:"+(r=l(this.mangle(a[1]))):r=l(a[1]),h+=this.renderer.link(i,null,r);else if(this.inLink||!(a=this.rules.url.exec(t))){if(a=this.rules.text.exec(t))t=t.substring(a[0].length),this.inRawBlock?h+=this.renderer.text(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):l(a[0]):a[0]):h+=this.renderer.text(l(this.smartypants(a[0])));else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}else{if("@"===a[2])i="mailto:"+(r=l(a[0]));else{do{c=a[0],a[0]=this.rules._backpedal.exec(a[0])[0]}while(c!==a[0]);r=l(a[0]),i="www."===a[1]?"http://"+r:r}t=t.substring(a[0].length),h+=this.renderer.link(i,null,r)}return h}static escapes(t){return t?t.replace(e.rules._escapes,"$1"):t}outputLink(e,t){const n=t.href,r=t.title?l(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,l(e[1]))}smartypants(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e}mangle(e){if(!this.options.mangle)return e;const t=e.length;let n,r="",i=0;for(;i<t;i++)n=e.charCodeAt(i),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}}},oV9I:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return a}),n.d(t,"d",function(){return h}),n.d(t,"e",function(){return d}),n.d(t,"f",function(){return u}),n.d(t,"g",function(){return p}),n.d(t,"h",function(){return f}),n.d(t,"i",function(){return m});var r=n("b/sn");
/*!
    * tiptap-utils v1.13.0
    * (c) 2021 überdosis GbR (limited liability)
    * @license MIT
    */function i(e,t){return t?e.createChecked(null,t):e.createAndFill()}function o(e,t,n,r,o){const s=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),l=[],a=[];for(let h=0;h<n;h+=1){const e=i(s.cell,o);if(e&&a.push(e),r){const e=i(s.header_cell,o);e&&l.push(e)}}const c=[];for(let i=0;i<t;i+=1)c.push(s.row.createChecked(null,r&&0===i?l:a));return s.table.createChecked(null,c)}function s(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return function(e){const t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');const n=[];return e.descendants((e,r)=>{if(n.push({node:e,pos:r}),!t)return!1}),n}(e,n).filter(e=>t(e.node))}function l(e,t){return s(e,e=>e.isBlock,t)}function a(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function c(e){return function(t){if(function(e){return e instanceof r.c}(t)){const{node:n}=t,{$from:r}=t;if(function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e}(e,n))return{node:n,pos:r.pos,depth:r.depth}}}}function h(e,t){const{from:n,to:r}=e.selection;let i=[];e.doc.nodesBetween(n,r,e=>{i=[...i,...e.marks]});const o=i.find(e=>e.type.name===t.name);return o?o.attrs:{}}function d(e=null,t=null){if(!e||!t)return!1;const n=e.parent.childAfter(e.parentOffset);if(!n.node)return!1;const r=n.node.marks.find(e=>e.type===t);if(!r)return!1;let i=e.index(),o=e.start()+n.offset,s=i+1,l=o+n.node.nodeSize;for(;i>0&&r.isInSet(e.parent.child(i-1).marks);)i-=1,o-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&r.isInSet(e.parent.child(s).marks);)l+=e.parent.child(s).nodeSize,s+=1;return{from:o,to:l}}function u(e,t){const{from:n,to:r}=e.selection;let i=[];e.doc.nodesBetween(n,r,e=>{i=[...i,e]});const o=i.reverse().find(e=>e.type.name===t.name);return o?o.attrs:{}}function p(e,t){const{from:n,$from:r,to:i,empty:o}=e.selection;return o?!!t.isInSet(e.storedMarks||r.marks()):!!e.doc.rangeHasMark(n,i,t)}function f({types:e,node:t}){return Array.isArray(e)&&e.includes(t.type)||t.type===e}function m(e,t,n={}){const r=c(t)(e.selection)||a(e=>e.type===t)(e.selection);return Object.keys(n).length&&r?r.node.hasMarkup(t,{...r.node.attrs,...n}):!!r}},"qd4/":function(e,t,n){"use strict";n.d(t,"a",function(){return r.b}),n.d(t,"b",function(){return r.c}),n.d(t,"k",function(){return r.e}),n.d(t,"r",function(){return r.f}),n.d(t,"d",function(){return c}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return a}),n.d(t,"o",function(){return d.c}),n.d(t,"u",function(){return d.e}),n.d(t,"c",function(){return p}),n.d(t,"e",function(){return f}),n.d(t,"f",function(){return y}),n.d(t,"g",function(){return m}),n.d(t,"h",function(){return g}),n.d(t,"i",function(){return v}),n.d(t,"j",function(){return b}),n.d(t,"n",function(){return w}),n.d(t,"p",function(){return x}),n.d(t,"q",function(){return S}),n.d(t,"s",function(){return C}),n.d(t,"t",function(){return O});var r=n("RCw7"),i=n("uSMm"),o=n("MEpN"),s=n("b/sn");function l(e,t=null){return function(n,r){let{$from:s,$to:l}=n.selection,a=s.blockRange(l),c=!1,h=a;if(!a)return!1;if(a.depth>=2&&s.node(a.depth-1).type.compatibleContent(e)&&0==a.startIndex){if(0==s.index(a.depth-1))return!1;let e=n.doc.resolve(a.start-2);h=new o.g(e,e,a.depth),a.endIndex<a.parent.childCount&&(a=new o.g(s,n.doc.resolve(l.end(a.depth)),a.depth)),c=!0}let d=Object(i.i)(h,e,t,a);return!!d&&(r&&r(function(e,t,n,r,s){let l=o.c.empty;for(let i=n.length-1;i>=0;i--)l=o.c.from(n[i].type.create(n[i].attrs,l));e.step(new i.b(t.start-(r?2:0),t.end,t.start,t.end,new o.j(l,0,0),n.length,!0));let a=0;for(let i=0;i<n.length;i++)n[i].type==s&&(a=i+1);let c=n.length-a,h=t.start+n.length-(r?2:0),d=t.parent;for(let o=t.startIndex,u=t.endIndex,p=!0;o<u;o++,p=!1)!p&&Object(i.g)(e.doc,h,c)&&(e.split(h,c),h+=2*c),h+=d.child(o).nodeSize;return e}(n.tr,a,d,c,e).scrollIntoView()),!0)}}function a(e){return function(t,n){let{$from:r,$to:l,node:a}=t.selection;if(a&&a.isBlock||r.depth<2||!r.sameParent(l))return!1;let c=r.node(-1);if(c.type!=e)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(3==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=o.c.empty,l=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-l;e>=r.depth-3;e--)i=o.c.from(r.node(e).copy(i));let a=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;i=i.append(o.c.from(e.createAndFill()));let c=r.before(r.depth-(l-1)),h=t.tr.replace(c,r.after(-a),new o.j(i,4-l,0)),d=-1;h.doc.nodesBetween(c,h.doc.content.size,(e,t)=>{if(d>-1)return!1;e.isTextblock&&0==e.content.size&&(d=t+1)}),d>-1&&h.setSelection(s.f.near(h.doc.resolve(d))),n(h.scrollIntoView())}return!0}let h=l.pos==r.end()?c.contentMatchAt(0).defaultType:null,d=t.tr.delete(r.pos,l.pos),u=h?[null,{type:h}]:void 0;return!!Object(i.g)(d.doc,r.pos,2,u)&&(n&&n(d.split(r.pos,2,u).scrollIntoView()),!0)}}function c(e){return function(t,n){let{$from:r,$to:s}=t.selection,l=r.blockRange(s,t=>t.childCount>0&&t.firstChild.type==e);return!!l&&(!n||(r.node(l.depth-1).type==e?function(e,t,n,r){let s=e.tr,l=r.end,a=r.$to.end(r.depth);l<a&&(s.step(new i.b(l-1,a,l,a,new o.j(o.c.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new o.g(s.doc.resolve(r.$from.pos),s.doc.resolve(a),r.depth));const c=Object(i.k)(r);return null!=c&&(t(s.lift(r,c).scrollIntoView()),!0)}(t,n,e,l):function(e,t,n){let r=e.tr,s=n.parent;for(let i=n.end,o=n.endIndex-1,m=n.startIndex;o>m;o--)i-=s.child(o).nodeSize,r.delete(i-1,i+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,h=n.endIndex==s.childCount,d=l.node(-1),u=l.index(-1);if(!d.canReplace(u+(c?0:1),u+1,a.content.append(h?o.c.empty:o.c.from(s))))return!1;let p=l.pos,f=p+a.nodeSize;return r.step(new i.b(p-(c?1:0),f+(h?1:0),p+1,f-1,new o.j((c?o.c.empty:o.c.from(s.copy(o.c.empty))).append(h?o.c.empty:o.c.from(s.copy(o.c.empty))),c?0:1,h?0:1),c?0:1)),t(r.scrollIntoView()),!0}(t,n,l)))}}function h(e){return function(t,n){let{$from:r,$to:s}=t.selection,l=r.blockRange(s,t=>t.childCount>0&&t.firstChild.type==e);if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let c=l.parent,h=c.child(a-1);if(h.type!=e)return!1;if(n){let r=h.lastChild&&h.lastChild.type==c.type,s=o.c.from(r?e.create():null),a=new o.j(o.c.from(e.create(null,o.c.from(c.type.create(null,s)))),r?3:1,0),d=l.start,u=l.end;n(t.tr.step(new i.b(d-(r?3:1),u,d,u,a,1,!0)).scrollIntoView())}return!0}}var d=n("cqjR"),u=n("oV9I");
/*!
    * tiptap-commands v1.17.0
    * (c) 2021 überdosis GbR (limited liability)
    * @license MIT
    */
function p(e=""){return(t,n)=>{const{$from:r}=t.selection,{pos:i}=r.pos;return n(t.tr.insertText(e,i)),!0}}function f(e,t,n){return new d.a(e,(e,r,i,o)=>{const s=n instanceof Function?n(r):n,{tr:l}=e,a=r.length-1;let c=o,h=i;if(r[a]){const n=i+r[0].indexOf(r[a-1]),s=n+r[a-1].length-1,d=n+r[a-1].lastIndexOf(r[a]),u=d+r[a].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}(i,o,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;u<s&&l.delete(u,s),d>n&&l.delete(n,d),c=(h=n)+r[a].length}return l.addMark(h,c,t.create(s)),l.removeStoredMark(t),l})}function m(e,t,n){return new d.a(e,(e,r,i,o)=>{const s=n instanceof Function?n(r):n,{tr:l}=e;return r[0]&&l.replaceWith(i-1,o,t.create(s)),l})}function g(e,t,n){const r=i=>{const s=[];return i.forEach(i=>{if(i.isText){const{text:r}=i;let o,l=0;do{if(o=e.exec(r)){const e=o.index,r=e+o[0].length,a=n instanceof Function?n(o[0]):n;e>0&&s.push(i.cut(l,e)),s.push(i.cut(e,r).mark(t.create(a).addToSet(i.marks))),l=r}}while(o);l<r.length&&s.push(i.cut(l))}else s.push(i.copy(r(i.content)))}),o.c.fromArray(s)};return new s.d({props:{transformPasted:e=>new o.j(r(e.content),e.openStart,e.openEnd)}})}function y(e,t,n){const r=(i,s)=>{const l=[];return i.forEach(i=>{if(i.isText){const{text:r,marks:o}=i;let a,c=0;const h=!!o.filter(e=>"link"===e.type.name)[0];for(;!h&&null!==(a=e.exec(r));)if(s&&s.type.allowsMarkType(t)&&a[1]){const e=a.index,r=e+a[0].length,o=e+a[0].indexOf(a[1]),s=o+a[1].length,h=n instanceof Function?n(a):n;e>0&&l.push(i.cut(c,e)),l.push(i.cut(o,s).mark(t.create(h).addToSet(i.marks))),c=r}c<r.length&&l.push(i.cut(c))}else l.push(i.copy(r(i.content,i)))}),o.c.fromArray(l)};return new s.d({props:{transformPasted:e=>new o.j(r(e.content),e.openStart,e.openEnd)}})}function v(e){return(t,n)=>{const{tr:r,selection:i}=t;let{from:o,to:s}=i;const{$from:l,empty:a}=i;if(a){const t=Object(u.e)(l,e);o=t.from,s=t.to}return r.removeMark(o,s,e),n(r)}}function b(e=null,t,n={},r=o.c.empty){return(i,o)=>{const{$from:s,$to:l}=i.selection,a=s.index(),c=e?e.from:s.pos,h=e?e.to:l.pos;return!!s.parent.canReplaceWith(a,a,t)&&(o&&o(i.tr.replaceWith(c,h,t.create(n,r))),!0)}}function w(e){return function(t,n){const{$from:r,$to:i,node:s}=t.selection;if(s&&s.isBlock||r.depth<2||!r.sameParent(i))return!1;const l=r.node(-1);if(l.type!=e)return!1;if(0==r.parent.content.size){if(2==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=o.c.empty;const s=r.index(-1)>0;for(let e=r.depth-(s?1:2);e>=r.depth-3;e--)i=o.c.from(r.node(e).copy(i));i=i.append(o.c.from(e.createAndFill()));const l=t.tr.replace(r.before(s?null:-1),r.after(-3),new o.j(i,s?3:2,2));l.setSelection(t.selection.constructor.near(l.doc.resolve(r.pos+(s?3:2)))),n(l.scrollIntoView())}return!0}const a=i.pos==r.end()?l.contentMatchAt(r.indexAfter(-1)).defaultType:null,c=t.tr.delete(r.pos,i.pos);let h=a&&[{type:e},{type:a}];return h||(h=[{type:e},null]),!!function(e,t,n=1,r){const i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,h=n-2;c>o;c--,h--){const e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount);const o=r&&r[h]||e;if(o!=e&&(n=n.replaceChild(0,o.type.create(o.attrs))),!e.canReplace(t+1,e.childCount))return!1}const l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}(c.doc,r.pos,2,h)&&(n&&n(c.split(r.pos,2,h).scrollIntoView()),!0)}}function x(e,t,n={}){return(i,o,s)=>{return Object(u.i)(i,e,n)?Object(r.e)(t)(i,o,s):Object(r.e)(e,n)(i,o,s)}}function k(e,t){return e.type===t.nodes.bullet_list||e.type===t.nodes.ordered_list||e.type===t.nodes.todo_list}function S(e,t){return(n,r,i)=>{const{schema:o,selection:s}=n,{$from:a,$to:h}=s,d=a.blockRange(h);if(!d)return!1;const p=Object(u.c)(e=>k(e,o))(s);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===e)return c(t)(n,r,i);if(k(p.node,o)&&e.validContent(p.node.content)){const{tr:t}=n;return t.setNodeMarkup(p.pos,e),r&&r(t),!1}}return l(e)(n,r,i)}}function C(e,t={}){return(n,i,o)=>{return Object(u.i)(n,e,t)?Object(r.d)(n,i):Object(r.g)(e,t)(n,i,o)}}function O(e,t){return(n,r)=>{const{tr:i,selection:o,doc:s}=n,{ranges:l,empty:a}=o;if(a){const{from:n,to:r}=Object(u.e)(o.$from,e);s.rangeHasMark(n,r,e)&&i.removeMark(n,r,e),i.addMark(n,r,e.create(t))}else l.forEach(n=>{const{$to:r,$from:o}=n;s.rangeHasMark(o.pos,r.pos,e)&&i.removeMark(o.pos,r.pos,e),i.addMark(o.pos,r.pos,e.create(t))});return r(i)}}},rUJ1:function(e,t){const n=/[&<>"']/,r=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=e=>s[e];const a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(a,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const h=/(^|[^\[])\^/g;const d=/[^\w:]/g,u=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const p={},f=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function y(e,t){p[" "+e]||(f.test(e)?p[" "+e]=e+"/":p[" "+e]=v(e,"/",!0));const n=-1===(e=p[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(g,"$1")+t:e+t}function v(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.substr(0,r-i)}e.exports={escape:function(e,t){if(t){if(n.test(e))return e.replace(r,l)}else if(i.test(e))return e.replace(o,l);return e},unescape:c,edit:function(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(h,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(c(n)).replace(d,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!u.test(n)&&(n=y(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:y,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},splitCells:function(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},rtrim:v,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&--r<0)return i;return-1},checkSanitizeDeprecation:function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}}},uSMm:function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return k}),n.d(t,"c",function(){return x}),n.d(t,"d",function(){return g}),n.d(t,"e",function(){return W}),n.d(t,"f",function(){return A}),n.d(t,"g",function(){return E}),n.d(t,"h",function(){return R}),n.d(t,"i",function(){return M}),n.d(t,"j",function(){return T}),n.d(t,"k",function(){return O}),n.d(t,"l",function(){return I});var r=n("MEpN");const i=65535,o=Math.pow(2,16);function s(e,t){return e+t*o}function l(e){return e&i}const a=1,c=2,h=4,d=8;class u{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&d)>0}get deletedBefore(){return(this.delInfo&(a|h))>0}get deletedAfter(){return(this.delInfo&(c|h))>0}get deletedAcross(){return(this.delInfo&h)>0}}class p{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&p.empty)return p.empty}recover(e){let t=0,n=l(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(e&i))/o}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let p=this.ranges[l]-(this.inverted?r:0);if(p>e)break;let f=this.ranges[l+i],m=this.ranges[l+o],g=p+f;if(e<=g){let i=p+r+((f?e==p?-1:e==g?1:t:t)<0?0:m);if(n)return i;let o=e==(t<0?p:g)?null:s(l/3,e-p),y=e==p?c:e==g?a:h;return(t<0?e!=p:e!=g)&&(y|=d),new u(i,y,o)}r+=m-f}return n?e+r:new u(e+r,0,null)}touches(e,t){let n=0,r=l(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let l=this.ranges[s+i];if(e<=t+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),l=o+(this.inverted?0:i),a=this.ranges[r+t],c=this.ranges[r+n];e(s,s+a,l,l+c),i+=c-a}}invert(){return new p(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?p.empty:new p(e<0?[0,-e,0]:[0,0,e])}}p.empty=new p([]);class f{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new f(this.maps,this.mirror,e,t)}copy(){return new f(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new f;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new u(e,r,null)}}const m=Object.create(null);class g{getMap(){return p.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=m[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in m)throw new RangeError("Duplicate use of step JSON ID "+e);return m[e]=t,t.prototype.jsonID=e,t}}class y{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new y(e,null)}static fail(e){return new y(null,e)}static fromReplace(e,t,n,i){try{return y.ok(e.replace(t,n,i))}catch(e){if(e instanceof r.h)return y.fail(e.message);throw e}}}function v(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let o=e.child(r);o.content.size&&(o=o.copy(v(o.content,t,o))),o.isInline&&(o=t(o,n,r)),i.push(o)}return r.c.fromArray(i)}class b extends g{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new r.j(v(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,i),t.openStart,t.openEnd);return y.fromReplace(e,this.from,this.to,o)}invert(){return new w(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new b(t.pos,n.pos,this.mark)}merge(e){return e instanceof b&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new b(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new b(t.from,t.to,e.markFromJSON(t.mark))}}g.jsonID("addMark",b);class w extends g{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new r.j(v(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return y.fromReplace(e,this.from,this.to,n)}invert(){return new b(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new w(t.pos,n.pos,this.mark)}merge(e){return e instanceof w&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new w(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new w(t.from,t.to,e.markFromJSON(t.mark))}}g.jsonID("removeMark",w);class x extends g{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&S(e,this.from,this.to)?y.fail("Structure replace would overwrite content"):y.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new p([this.from,this.to-this.from,this.slice.size])}invert(e){return new x(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new x(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof x)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?r.j.empty:new r.j(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new x(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?r.j.empty:new r.j(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new x(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new x(t.from,t.to,r.j.fromJSON(e,t.slice),!!t.structure)}}g.jsonID("replace",x);class k extends g{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(S(e,this.from,this.gapFrom)||S(e,this.gapTo,this.to)))return y.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return y.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?y.fromReplace(e,this.from,this.to,n):y.fail("Content does not fit in gap")}getMap(){return new p([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new k(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new k(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let 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}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new k(t.from,t.to,t.gapFrom,t.gapTo,r.j.fromJSON(e,t.slice),t.insert,!!t.structure)}}function S(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function C(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function O(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!C(r,i,o))break}return null}function M(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let a=r;l&&a<i;a++)l=l.matchType(n.child(a).type);return l&&l.validEnd?s:null}(r,t);return o?i.map(N).concat({type:t,attrs:n}).concat(o.map(N)):null}function N(e){return{type:e,attrs:null}}function E(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,h=n-2;c>o;c--,h--){let e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[h]||e;if(o!=e&&(n=n.replaceChild(0,o.type.create(o.attrs))),!e.canReplace(t+1,e.childCount)||!o.type.validContent(n))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function A(e,t){let n=e.resolve(t),r=n.index();return D(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function D(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function T(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let e,o,s=r.index(i);if(i==r.depth?(e=r.nodeBefore,o=r.nodeAfter):n>0?(e=r.node(i+1),s++,o=r.node(i).maybeChild(s)):(e=r.node(i).maybeChild(s-1),o=r.node(i+1)),e&&!e.isTextblock&&D(e,o)&&r.node(i).canReplace(s,s+1))return t;if(0==i)break;t=n<0?r.before(i):r.after(i)}}function R(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(0==n.openStart&&n.size?2:1);o++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),l=!1;if(1==o)l=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(n,n,e[0])}if(l)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}function I(e,t,n=t,i=r.j.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return $(o,s,i)?new x(t,n,i):new z(o,s,i).fit()}function $(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}g.jsonID("replaceAround",k);class z{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.c.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let i=e.depth;i>0;i--)this.placed=r.c.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,s=n.depth,l=i.depth;for(;s&&l&&1==o.childCount;)o=o.firstChild.content,s--,l--;let a=new r.j(o,s,l);return e>-1?new k(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new x(n.pos,i.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,i=null,o=(n=t?(i=j(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild;for(let s=this.depth;s>=0;s--){let n,{type:l,match:a}=this.frontier[s],c=null;if(1==e&&(o?a.matchType(o.type)||(c=a.fillBefore(r.c.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:s,parent:i,inject:c};if(2==e&&o&&(n=a.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:s,parent:i,wrap:n};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=j(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new r.j(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=j(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new r.j(P(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new r.j(P(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let r=0;r<o.length;r++)this.openFrontierNode(o[r]);let s=this.unplaced,l=n?n.content:s.content,a=s.openStart-e,c=0,h=[],{match:d,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)h.push(i.child(e));d=d.matchFragment(i)}let p=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let e=l.child(c),t=d.matchType(e.type);if(!t)break;(++c>1||0==a||e.content.size)&&(d=t,h.push(B(e.mark(u.allowedMarks(e.marks)),1==c?a:0,c==l.childCount?p:-1)))}let f=c==l.childCount;f||(p=-1),this.placed=_(this.placed,t,r.c.from(h)),this.frontier[t].match=d,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let r=0,m=l;r<p;r++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=f?0==e?r.j.empty:new r.j(P(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new r.j(P(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!V(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=V(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=V(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=_(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_(this.placed,this.depth,r.c.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.c.empty,!0);e.childCount&&(this.placed=_(this.placed,this.frontier.length,e))}}function P(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(P(e.firstChild.content,t-1,n)))}function _(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(_(e.lastChild.content,t-1,n)))}function j(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function B(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,B(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.c.empty,!0)))),e.copy(i)}function V(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?l:null}function L(e){return e.spec.defining||e.spec.definingForContent}function F(e,t,n,i,o){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(F(r.content,t+1,n,i,r)))}if(t>i){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.c.empty,!0))}return e}function q(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let J=class extends Error{};(J=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),J.prototype.constructor=J,J.prototype.name="TransformError";class W{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new f}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new J(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=r.j.empty){let i=I(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new r.j(r.c.from(n),0,0))}delete(e,t){return this.replace(e,t,r.j.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),s=e.doc.resolve(n);if($(o,s,i))return e.step(new x(t,n,i));let l=q(o,e.doc.resolve(n));0==l[l.length-1]&&l.pop();let a=-(o.depth+1);l.unshift(a);for(let r=o.depth,p=o.pos-1;r>0;r--,p--){let e=o.node(r).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;l.indexOf(r)>-1?a=r:o.before(r)==p&&l.splice(1,0,-r)}let c=l.indexOf(a),h=[],d=i.openStart;for(let r=i.content,p=0;;p++){let e=r.firstChild;if(h.push(e),p==i.openStart)break;r=e.content}for(let r=d-1;r>=0;r--){let e=h[r].type,t=L(e);if(t&&o.node(c).type!=e)d=r;else if(t||!e.isTextblock)break}for(let p=i.openStart;p>=0;p--){let t=(p+d+1)%(i.openStart+1),a=h[t];if(a)for(let h=0;h<l.length;h++){let d=l[(h+c)%l.length],u=!0;d<0&&(u=!1,d=-d);let p=o.node(d-1),f=o.index(d-1);if(p.canReplaceWith(f,f,a.type,a.marks))return e.replace(o.before(d),u?s.after(d):n,new r.j(F(i.content,0,i.openStart,t),t,i.openEnd))}}let u=e.steps.length;for(let r=l.length-1;r>=0&&(e.replace(t,n,i),!(e.steps.length>u));r--){let e=l[r];e<0||(t=o.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e<r.node(i).childCount)return null}return null}(e.doc,t,i.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new r.j(r.c.from(i),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=q(r,i);for(let s=0;s<o.length;s++){let t=o[s],n=s==o.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),i.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:i,$to:o,depth:s}=t,l=i.before(s+1),a=o.after(s+1),c=l,h=a,d=r.c.empty,u=0;for(let m=s,g=!1;m>n;m--)g||i.index(m)>0?(g=!0,d=r.c.from(i.node(m).copy(d)),u++):c--;let p=r.c.empty,f=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)<o.end(m)?(g=!0,p=r.c.from(o.node(m).copy(p)),f++):h++;e.step(new k(c,h,l,a,new r.j(d.append(p),u,f),d.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let i=new x(t-n,t+n,r.j.empty,!0);e.step(i)}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=r.c.empty;for(let l=n.length-1;l>=0;l--){if(i.size){let e=n[l].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.c.from(n[l].type.create(n[l].attrs,i))}let o=t.start,s=t.end;e.step(new k(o,s,o,s,new r.j(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{if(t.isTextblock&&!t.hasMarkup(i,o)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(s).map(n),i)){e.clearIncompatible(e.mapping.slice(s).map(n,1),i);let l=e.mapping.slice(s),a=l.map(n,1),c=l.map(n+t.nodeSize,1);return e.step(new k(a,c,a+1,c-1,new r.j(r.c.from(i.create(o,null,t.marks)),0,0),1,!0)),!1}})}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i=[]){return function(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let l=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,l);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new k(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new r.j(r.c.from(l),0,0),1,!0))}(this,e,t,n,i),this}split(e,t=1,n){return function(e,t,n=1,i){let o=e.doc.resolve(t),s=r.c.empty,l=r.c.empty;for(let a=o.depth,c=o.depth-n,h=n-1;a>c;a--,h--){s=r.c.from(o.node(a).copy(s));let e=i&&i[h];l=r.c.from(e?e.type.create(e.attrs,l):o.node(a).copy(l))}e.step(new x(t,t,new r.j(s.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],l=[];e.doc.nodesBetween(t,n,(e,a,c)=>{if(!e.isInline)return;let h=e.marks;if(!r.isInSet(h)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,t),d=Math.min(a+e.nodeSize,n),u=r.addToSet(h);for(let e=0;e<h.length;e++)h[e].isInSet(u)||(i&&i.to==c&&i.mark.eq(h[e])?i.to=d:s.push(i=new w(c,d,h[e])));o&&o.to==c?o.to=d:l.push(o=new b(c,d,r))}}),s.forEach(t=>e.step(t)),l.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(e,l)=>{if(!e.isInline)return;s++;let a=null;if(i instanceof r.e){let t,n=e.marks;for(;t=i.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else i?i.isInSet(e.marks)&&(a=[i]):a=e.marks;if(a&&a.length){let r=Math.min(l+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,i=a[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==s-1&&i.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=s):o.push({style:i,from:Math.max(l,t),to:r,step:s})}}}),o.forEach(t=>e.step(new w(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,i=n.contentMatch){let o=e.doc.nodeAt(t),s=[],l=t+1;for(let a=0;a<o.childCount;a++){let t=o.child(a),c=l+t.nodeSize,h=i.matchType(t.type);if(h){i=h;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new w(l,c,t.marks[r]))}else s.push(new x(l,c,r.j.empty));l=c}if(!i.validEnd){let t=i.fillBefore(r.c.empty,!0);e.replace(l,l,new r.j(t,0,0))}for(let r=s.length-1;r>=0;r--)e.step(s[r])}(this,e,t,n),this}}},vbtb:function(e,t){function n(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1},getDefaults:n,changeDefaults:function(t){e.exports.defaults=t}}},zUJn:function(e,t,n){"use strict";n.d(t,"g",function(){return r.d}),n.d(t,"h",function(){return r.e}),n.d(t,"a",function(){return R}),n.d(t,"b",function(){return I}),n.d(t,"c",function(){return z}),n.d(t,"d",function(){return S}),n.d(t,"e",function(){return O}),n.d(t,"f",function(){return N});var r=n("b/sn"),i=n("cD+i"),o=n("MEpN"),s=n("uSMm");class l{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?t.bottom:t.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:t.left,right:t.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let n,r,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.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),!i||i==document.body&&"static"==getComputedStyle(i).position)n=-pageXOffset,r=-pageYOffset;else{let e=i.getBoundingClientRect();n=e.left-i.scrollLeft,r=e.top-i.scrollTop}this.element.style.left=e.left-n+"px",this.element.style.top=e.top-r+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(e=Object(s.h)(this.editorView.state.doc,e,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}var a=n("49oK");class c extends r.f{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return c.valid(n)?new c(n):r.f.near(n)}content(){return o.j.empty}eq(e){return e instanceof c&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new c(e.resolve(t.pos))}getBookmark(){return new h(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&c.valid(e))return e;let i=e.pos,o=null;for(let n=e.depth;;n--){let r=e.node(n);if(t>0?e.indexAfter(n)<r.childCount:e.index(n)>0){o=r.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;i+=t;let s=e.doc.resolve(i);if(c.valid(s))return s}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!r.c.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),n=!1;continue e}break}o=s,i+=t;let l=e.doc.resolve(i);if(c.valid(l))return l}return null}}}c.prototype.visible=!1,c.findFrom=c.findGapCursorFrom,r.f.jsonID("gapcursor",c);class h{constructor(e){this.pos=e}map(e){return new h(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return c.valid(t)?new c(t):r.f.near(t)}}const d=Object(a.a)({ArrowLeft:u("horiz",-1),ArrowRight:u("horiz",1),ArrowUp:u("vert",-1),ArrowDown:u("vert",1)});function u(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,i,o){let s=e.selection,l=t>0?s.$to:s.$from,a=s.empty;if(s instanceof r.h){if(!o.endOfTextblock(n)||0==l.depth)return!1;a=!1,l=e.doc.resolve(t>0?l.after():l.before())}let h=c.findGapCursorFrom(l,t,a);return!!h&&(i&&i(e.tr.setSelection(new c(h))),!0)}}function p(e,t,n){if(!e||!e.editable)return!1;let i=e.state.doc.resolve(t);if(!c.valid(i))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&r.c.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new c(i))),!0)}function f(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof c))return!1;let{$from:n}=e.state.selection,i=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!i)return!1;let s=o.c.empty;for(let r=i.length-1;r>=0;r--)s=o.c.from(i[r].createAndFill(null,s));let l=e.state.tr.replace(n.pos,n.pos,new o.j(s,0,0));return l.setSelection(r.h.near(l.doc.resolve(n.pos+1))),e.dispatch(l),!1}function m(e){if(!(e.selection instanceof c))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",i.b.create(e.doc,[i.a.widget(e.selection.head,t,{key:"gapcursor"})])}var g=n("RCw7"),y=n("cqjR"),v=n("oV9I"),b=n("Kw5r"),w=n("qd4/");class x{constructor(e,{editor:t,extension:n,parent:r,node:i,view:o,decorations:s,getPos:l}){this.component=e,this.editor=t,this.extension=n,this.parent=r,this.node=i,this.view=o,this.decorations=s,this.isNode=!!this.node.marks,this.isMark=!this.isNode,this.getPos=this.isMark?this.getMarkPos:l,this.captureEvents=!0,this.dom=this.createDOM(),this.contentDOM=this.vm.$refs.content}createDOM(){const e=b.default.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=b.default.config.silent;b.default.config.silent=!0,Object.entries(e).forEach(([e,t])=>{this.vm._props[e]=t}),b.default.config.silent=t}updateAttrs(e){if(!this.view.editable)return;const{state:t}=this.view,{type:n}=this.node,r=this.getPos(),i={...this.node.attrs,...e},o=this.isMark?t.tr.removeMark(r.from,r.to,n).addMark(r.from,r.to,n.create(i)):t.tr.setNodeMarkup(r,null,i);this.view.dispatch(o)}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,i="cut"===e.type,o=e.type.startsWith("drag")||"drop"===e.type;return!(t&&o||n||r||i)&&this.captureEvents}selectNode(){this.updateComponentProps({selected:!0})}deselectNode(){this.updateComponentProps({selected:!1})}getMarkPos(){const e=this.view.posAtDOM(this.dom),t=this.view.state.doc.resolve(e);return Object(v.e)(t,this.node.type)}destroy(){this.vm.$destroy()}}class k{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}}class S{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 C{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 i=t[n]!==r;return Object.assign(t,{[n]:r}),i&&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}){const t=this.extensions.filter(e=>["extension"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({schema:e})),n=this.extensions.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({type:e[`${t.type}s`][t.name],schema:e}));return[...t,...n].map(e=>Object(a.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,r=n.filter(e=>["extension"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({schema:e})),i=n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({type:e[`${t.type}s`][t.name],schema:e}));return[...r,...i].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,r=n.filter(e=>["extension"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({schema:e})),i=n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({type:e[`${t.type}s`][t.name],schema:e}));return[...r,...i].reduce((e,t)=>[...e,...t],[])}commands({schema:e,view:t}){return this.extensions.filter(e=>e.commands).reduce((n,r)=>{const{name:i,type:o}=r,s={},l=r.commands({schema:e,...["node","mark"].includes(o)?{type:e[`${o}s`][i]}:{}}),a=(e,n)=>!!t.editable&&(t.focus(),e(n)(t.state,t.dispatch,t)),c=(e,t)=>{Array.isArray(t)?s[e]=(e=>t.forEach(t=>a(t,e))):"function"==typeof t&&(s[e]=(e=>a(t,e)))};return"object"==typeof l?Object.entries(l).forEach(([e,t])=>{c(e,t)}):c(i,l),{...n,...s}},{})}}class O extends S{constructor(e={}){super(e)}get type(){return"mark"}get view(){return null}get schema(){return null}command(){return()=>{}}}function M(e=0,t=0,n=0){return Math.min(Math.max(parseInt(e,10),t),n)}class N extends S{constructor(e={}){super(e)}get type(){return"node"}get view(){return null}get schema(){return null}command(){return()=>{}}}class E extends N{get name(){return"doc"}get schema(){return{content:"block+"}}}class A extends N{get name(){return"paragraph"}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}commands({type:e}){return()=>Object(w.k)(e)}}class D extends N{get name(){return"text"}get schema(){return{group:"inline"}}}var 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';class R extends k{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)}}(T),null!==this.options.autoFocus&&this.focus(this.options.autoFocus),this.events.forEach(e=>{this.on(e,this.options[
/*!
    * tiptap v1.32.1
    * (c) 2021 überdosis GbR (limited liability)
    * @license MIT
    */
function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"")}(`on ${e}`)]||(()=>{}))}),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 E,new D,new A]:[]}get state(){return this.view?this.view.state:null}createExtensions(){return new C([...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 o.i({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return r.b.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,Object(y.b)({rules:this.inputRules}),...this.pasteRules,...this.keymaps,Object(a.b)({Backspace:y.d}),Object(a.b)(g.a),...this.options.enableDropCursor?[function(e={}){return new r.d({view:t=>new l(t,e)})}(this.options.dropCursor)]:[],...this.options.enableGapCursor?[new r.d({props:{decorations:m,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&c.valid(n)?new c(n):null,handleClick:p,handleKeyDown:d,handleDOMEvents:{beforeinput:f}}})]:[],new r.d({key:new r.e("editable"),props:{editable:()=>this.options.editable}}),new r.d({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.d({props:this.options.editorProps})]})}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=`<div>${e}</div>`,r=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return o.a.fromSchema(this.schema).parse(r,t)}return!1}createView(){return new i.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)=>{return{...t,[n.name]:(t,r,i,o)=>{const s=n.view;return new x(s,{editor:this,extension:n,parent:e,node:t,view:r,getPos:i,decorations:o})}}},{})}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:i}=this.state,o=M(e,0,n.content.size),s=M(t,0,n.content.size),l=r.h.create(n,o,s),a=i.setSelection(l);this.view.dispatch(a)}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=o.b.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:i,tr:o}=this.state,s=this.createDocument(e,n),l=r.h.create(i,0,i.content.size),a=o.setSelection(l).replaceSelectionWith(s,!1).setMeta("preventUpdate",!t);this.view.dispatch(a)}clearContent(e=!1){this.setContent(this.options.emptyDocument,e)}setActiveNodesAndMarks(){this.activeMarks=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:(e={})=>Object(v.g)(this.state,n,e)}),{}),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:Object(v.d)(this.state,n)}),{}),this.activeNodes=Object.entries(this.schema.nodes).reduce((e,[t,n])=>({...e,[t]:(e={})=>Object(v.i)(this.state,n,e)}),{})}getMarkAttrs(e=null){return this.activeMarkAttrs[e]}getNodeAttrs(e=null){return{...Object(v.f)(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(`${e}$`))});this.view.updateState(t)}destroy(){this.view&&this.view.destroy()}}var I={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 ${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 z={props:{editor:{default:null,type:Object}},data:()=>({focused:!1}),watch:{editor:{immediate:!0,handler(e){e&&this.$nextTick(()=>{e.registerPlugin(function(e){return new r.d({key:new r.e("menu_bar"),view:t=>new $({editorView:t,options:e})})}({editor:e,element:this.$el})),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}};Object,Boolean;Object}}]);
//# sourceMappingURL=chunk-0e2d.04760e2c.js.map