1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="39366de0-e854-f7a1-c710-566836c28314")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,609203,e=>{"use strict";function t(e){this.content=e}t.prototype={constructor:t,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,n,r){var i=r&&r!=e?this.remove(r):this,o=i.find(e),s=i.content.slice();return -1==o?s.push(r||e,n):(s[o+1]=n,r&&(s[o]=r)),new t(s)},remove:function(e){var n=this.find(e);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new t(r)},addToStart:function(e,n){return new t([e,n].concat(this.remove(e).content))},addToEnd:function(e,n){var r=this.remove(e).content.slice();return r.push(e,n),new t(r)},addBefore:function(e,n,r){var i=this.remove(n),o=i.content.slice(),s=i.find(e);return o.splice(-1==s?o.length:s,0,n,r),new t(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=t.from(e)).size?new t(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=t.from(e)).size?new t(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var n=this;e=t.from(e);for(var r=0;r<e.content.length;r+=2)n=n.remove(e.content[r]);return n},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},t.from=function(e){if(e instanceof t)return e;var n=[];if(e)for(var r in e)n.push(r,e[r]);return new t(n)};class n{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new n(i,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let r=[],i=0;if(t>e)for(let n=0,o=0;o<t;n++){let s=this.content[n],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),r.push(s),i+=s.nodeSize),o=l}return new n(r,i)}cutByIndex(e,t){return e==t?n.empty:0==e&&t==this.content.length?this:new n(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new n(i,o)}addToStart(e){return new n([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new n(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let o=t.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)r++;return r}if(o.content.size||s.content.size){let t=e(o.content,s.content,r+1);if(null!=t)return t}r+=o.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let o=t.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let l=t.child(--o),a=n.child(--s),d=l.nodeSize;if(l==a){r-=d,i-=d;continue}if(!l.sameMarkup(a))return{a:r,b:i};if(l.isText&&l.text!=a.text){let e=0,t=Math.min(l.text.length,a.text.length);for(;e<t&&l.text[l.text.length-e-1]==a.text[a.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(l.content.size||a.content.size){let t=e(l.content,a.content,r-1,i-1);if(t)return t}r-=d,i-=d}}(this,e,t,n)}findIndex(e){if(0==e)return i(0,e);if(e==this.size)return i(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return i(t+1,r);return i(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return n.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new n(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return n.empty;let t,r=0;for(let n=0;n<e.length;n++){let i=e[n];r+=i.nodeSize,n&&i.isText&&e[n-1].sameMarkup(i)?(t||(t=e.slice(0,n)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new n(t||e,r)}static from(e){if(!e)return n.empty;if(e instanceof n)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new n([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}n.empty=new n([],0);let r={index:0,offset:0};function i(e,t){return r.index=e,r.offset=t,r}function o(e,t){if(e===t)return!0;
vendor: 6,822 bytes, line 2
2if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!o(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!o(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class s{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let 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}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&o(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return s.none;if(e instanceof s)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}s.none=[];class l extends Error{}class a{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i){let{index:o,offset:s}=t.findIndex(n),l=t.maybeChild(o);if(s==n||l.isText)return i&&!i.canReplace(o,o,r)?null:t.cut(0,n).append(r).append(t.cut(n));let a=e(l.content,n-s-1,r,l);return a&&t.replaceChild(o,l.copy(a))}(this.content,e+this.openStart,t);return n&&new a(n,this.openStart,this.openEnd)}removeBetween(e,t){return new a(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),s=t.maybeChild(i),{index:l,offset:a}=t.findIndex(r);if(o==n||s.isText){if(a!=r&&!t.child(l).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-o-1,r-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return a.empty;let r=t.openStart||0,i=t.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new a(n.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new a(e,n,r)}}function d(e,t){if(!t.type.compatibleContent(e.type))throw new l("Cannot join "+t.type.name+" onto "+e.type.name)}function c(e,t,n){let r=e.node(n);return d(r,t.node(n)),r}function h(e,t){let 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 p(e,t,n,r){let 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&&(h(e.nodeAfter,r),o++));for(let e=o;e<s;e++)h(i.child(e),r);t&&t.depth==n&&t.textOffset&&h(t.nodeBefore,r)}function u(e,t){return e.type.checkContent(t),e.copy(t)}function f(e,t,r){let i=[];return p(null,e,r,i),e.depth>r&&h(u(c(e,t,r+1),f(e,t,r+1)),i),p(t,null,r,i),new n(i)}a.empty=new a(n.empty,0,0);class m{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw 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}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let 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)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return s.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var 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}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let 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 v(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s||(t=t.child(e)).isText)break;
2i=s-1,r+=o+1}return new m(t,n,i)}static resolveCached(e,t){let n=b.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else b.set(e,n=new g);let r=n.elts[n.i]=m.resolve(e,t);return n.i=(n.i+1)%y,r}}class g{constructor(){this.elts=[],this.i=0}}let y=12,b=new WeakMap;class v{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let w=Object.create(null);class k{constructor(e,t,r,i=s.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||n.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&o(this.attrs,t||e.defaultAttrs||w)&&s.sameSet(this.marks,n||s.none)}copy(e=null){return e==this.content?this:new k(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new k(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return a.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o);return new a(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(e,t,r){var i=this.resolve(e),o=this.resolve(t);if(r.openStart>i.depth)throw new l("Inserted content deeper than insertion position");if(i.depth-r.openStart!=o.depth-r.openEnd)throw new l("Inconsistent open depths");return function e(t,r,i,o){let s=t.index(o),l=t.node(o);if(s==r.index(o)&&o<t.depth-i.openStart){let n=e(t,r,i,o+1);return l.copy(l.content.replaceChild(s,n))}if(!i.content.size)return u(l,f(t,r,o));if(i.openStart||i.openEnd||t.depth!=o||r.depth!=o){let{start:e,end:s}=function(e,t){let r=t.depth-e.openStart,i=t.node(r).copy(e.content);for(let e=r-1;e>=0;e--)i=t.node(e).copy(n.from(i));return{start:i.resolveNoCache(e.openStart+r),end:i.resolveNoCache(i.content.size-e.openEnd-r)}}(i,t);return u(l,function e(t,r,i,o,s){let l=t.depth>s&&c(t,r,s+1),a=o.depth>s&&c(i,o,s+1),m=[];return p(null,t,s,m),l&&a&&r.index(s)==i.index(s)?(d(l,a),h(u(l,e(t,r,i,o,s+1)),m)):(l&&h(u(l,f(t,r,s+1)),m),p(r,i,s,m),a&&h(u(a,f(i,o,s+1)),m)),p(o,null,s,m),new n(m)}(t,e,s,r,o))}{let e=t.parent,n=e.content;return u(e,n.cut(0,t.parentOffset).append(i.content).append(n.cut(r.parentOffset)))}}(i,o,r,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return m.resolveCached(this,e)}resolveNoCache(e){return m.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}
2toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),S(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=n.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let e=i;e<o;e++)if(!this.type.allowsMarks(r.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=s.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!s.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let 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(e=>e.toJSON())),e}static fromJSON(e,t){let r;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=n.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}k.prototype.text=void 0;class x extends k{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):S(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new x(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new x(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function S(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class M{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new C(e,t);if(null==i.next)return M.empty;let o=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=T(e),r=n;return e.eat(",")&&(r="}"!=e.next?T(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next)return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"))return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}else if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}else if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}else if("opt"==t.type)return[r(o)].concat(e(t.expr,o));else if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}else if("name"==t.type)return[r(o,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}
vendor: 5,547 bytes, line 2
2function i(e,t){e.forEach(e=>e.to=t)}}(o),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);A(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new M(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(O);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return o}(A(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];return function o(s,l){let a=s.matchFragment(e,r);if(a&&(!t||a.validEnd))return n.from(l.map(e=>e.createAndFill()));for(let e=0;e<s.next.length;e++){let{type:t,next:n}=s.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==i.indexOf(n)){i.push(n);let e=o(n,l.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}M.empty=new M(!0);class C{constructor(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.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function T(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function O(e,t){return t-e}function A(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(O)}function N(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function E(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function D(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function R(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new L(e,r,t[r]);return n}class I{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=R(e,n.attrs),this.defaultAttrs=N(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==M.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:E(this.attrs,e)}create(e=null,t,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new k(this,this.computeAttrs(e),n.from(t),s.setFrom(r))}createChecked(e=null,t,r){return t=n.from(t),this.checkContent(t),new k(this,this.computeAttrs(e),t,s.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=n.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(n.empty,!0);return o?new k(this,e,t.append(o),s.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);
2if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){D(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let 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:s.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new I(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class L{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class P{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=R(e,r.attrs),this.excluded=null;let i=N(this.attrs);this.instance=i?new s(this,i):null}create(e=null){return!e&&this.instance?this.instance:new s(this,E(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new P(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){D(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class B{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let t in e)n[t]=e[t];n.nodes=t.from(e.nodes),n.marks=t.from(e.marks||{}),this.nodes=I.compile(this.spec.nodes,this),this.marks=P.compile(this.spec.marks,this);let r=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],n=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=r[n]||(r[n]=M.parse(n,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?z(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:z(this,n.split(" "))}this.nodeFromJSON=e=>k.fromJSON(this,e),this.markFromJSON=e=>s.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof I){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new x(n,n.defaultAttrs,e,s.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function z(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class ${constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];
2t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new K(this,t,!1);return n.addAll(e,s.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new K(this,t,!0);return n.addAll(e,s.none,t.from,t.to),a.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=_(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=_(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $(e,$.schemaRules(e)))}}let H={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},V={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},F={ol:!0,ul:!0};function j(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class W{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=s.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(n.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=n.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(n.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!H.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class K{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,o=j(null,t.preserveWhitespace,0)|4*!!n;i=r?new W(r.type,r.attrs,s.none,!0,t.topMatch||r.type.contentMatch,o):n?new W(null,null,s.none,!0,null,o):new W(e.schema.topNodeType,null,s.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:o}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;F.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&F.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:V.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(H.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=l&&l.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,o;
vendor: 4,107 bytes, line 2
2if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let 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);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+o)&&(r=l,i=s,!l.length))break;if(s.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=s.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):q(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=j(e,i,o.options);4&o.options&&0==o.content.length&&(l|=4);let a=s.none;return n=n.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!q(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new W(e,t,a,r,null,l)),this.open++,n}closeExtra(e=!1){let 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}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let 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)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)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)}findInText(e){if(this.find)for(let 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))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];
2if(t.isTextblock&&t.defaultAttrs)return t}}}function _(e){let t={};for(let n in e)t[n]=e[n];return t}function q(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class J{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=G(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Q(G(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Q(G(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Q(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new J(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=U(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return U(e.marks)}}function U(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function G(e){return e.document||window.document}let Y=new WeakMap;function Q(e,t,n,r){let i,o,s;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let l=t[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=Y.get(r))&&Y.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),o=s)),a=o)&&a.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let d=l.indexOf(" ");d>0&&(n=l.slice(0,d),l=l.slice(d+1));let c=n?e.createElementNS(n,l):e.createElement(l),h=t[1],p=1;if(h&&"object"==typeof h&&null==h.nodeType&&!Array.isArray(h)){for(let e in p=2,h)if(null!=h[e]){let t=e.indexOf(" ");t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),h[e]):"style"==e&&c.style?c.style.cssText=h[e]:c.setAttribute(e,h[e])}}for(let o=p;o<t.length;o++){let s=t[o];if(0===s){if(o<t.length-1||o>p)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:t,contentDOM:o}=Q(e,s,n,r);if(c.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:c,contentDOM:i}}class X{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Z{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Z.empty)return Z.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}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 s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[s+i],d=this.ranges[s+o],c=l+a;if(e<=c){let i=a?e==l?-1:e==c?1:t:t,o=l+r+(i<0?0:d);if(n)return o;let h=e==(t<0?l:c)?null:s/3+(e-l)*65536,p=e==l?2:e==c?1:4;return(t<0?e!=l:e!=c)&&(p|=8),new X(o,p,h)}r+=d-a}return n?e+r:new X(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;
vendor: 25,540 bytes, line 2
2for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+i];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+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],d=this.ranges[r+n];e(s,s+a,l,l+d),i+=d-a}}invert(){return new Z(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Z.empty:new Z(e<0?[0,-e,0]:[0,0,e])}}Z.empty=new Z([]);class ee{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new ee(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),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 ee;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 n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new X(e,r,null)}}let et=Object.create(null);class en{getMap(){return Z.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=et[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in et)throw RangeError("Duplicate use of step JSON ID "+e);return et[e]=t,t.prototype.jsonID=e,t}}class er{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new er(e,null)}static fail(e){return new er(null,e)}static fromReplace(e,t,n,r){try{return er.ok(e.replace(t,n,r))}catch(e){if(e instanceof l)return er.fail(e.message);throw e}}}function ei(e,t,r){let i=[];for(let n=0;n<e.childCount;n++){let o=e.child(n);o.content.size&&(o=o.copy(ei(o.content,t,o))),o.isInline&&(o=t(o,r,n)),i.push(o)}return n.fromArray(i)}class eo extends en{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),r=n.node(n.sharedDepth(this.to)),i=new a(ei(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return er.fromReplace(e,this.from,this.to,i)}invert(){return new es(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 eo(t.pos,n.pos,this.mark)}merge(e){return e instanceof eo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new eo(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 RangeError("Invalid input for AddMarkStep.fromJSON");return new eo(t.from,t.to,e.markFromJSON(t.mark))}}en.jsonID("addMark",eo);class es extends en{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 a(ei(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return er.fromReplace(e,this.from,this.to,n)}invert(){return new eo(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 es(t.pos,n.pos,this.mark)}merge(e){return e instanceof es&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new es(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 RangeError("Invalid input for RemoveMarkStep.fromJSON");return new es(t.from,t.to,e.markFromJSON(t.mark))}}en.jsonID("removeMark",es);class el extends en{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return er.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return er.fromReplace(e,this.pos,this.pos+1,new a(n.from(r),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new el(this.pos,t.marks[n]);return new el(this.pos,this.mark)}}return new ea(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new el(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new el(t.pos,e.markFromJSON(t.mark))}}en.jsonID("addNodeMark",el);class ea extends en{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return er.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return er.fromReplace(e,this.pos,this.pos+1,new a(n.from(r),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new el(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ea(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ea(t.pos,e.markFromJSON(t.mark))}}en.jsonID("removeNodeMark",ea);class ed extends en{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&eh(e,this.from,this.to)?er.fail("Structure replace would overwrite content"):er.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Z([this.from,this.to-this.from,this.slice.size])}invert(e){return new ed(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&ed.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new ed(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ed)||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;else{let t=this.slice.size+e.slice.size==0?a.empty:new a(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ed(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?a.empty:new a(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ed(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 RangeError("Invalid input for ReplaceStep.fromJSON");return new ed(t.from,t.to,a.fromJSON(e,t.slice),!!t.structure)}}ed.MAP_BIAS=1,en.jsonID("replace",ed);class ec extends en{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&&(eh(e,this.from,this.gapFrom)||eh(e,this.gapTo,this.to)))return er.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return er.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?er.fromReplace(e,this.from,this.to,n):er.fail("Content does not fit in gap")}getMap(){return new Z([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 ec(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=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new ec(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 RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ec(t.from,t.to,t.gapFrom,t.gapTo,a.fromJSON(e,t.slice),t.insert,!!t.structure)}}function eh(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 ep(e,t,r,i=r.contentMatch,o=!0){let s=e.doc.nodeAt(t),l=[],d=t+1;for(let t=0;t<s.childCount;t++){let c=s.child(t),h=d+c.nodeSize,p=i.matchType(c.type);if(p){i=p;for(let t=0;t<c.marks.length;t++)r.allowsMarkType(c.marks[t].type)||e.step(new es(d,h,c.marks[t]));if(o&&c.isText&&"pre"!=r.whitespace){let e,t=/\r?\n|\r/g,i;for(;e=t.exec(c.text);)i||(i=new a(n.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),l.push(new ed(d+e.index,d+e.index+e[0].length,i))}}else l.push(new ed(d,h,a.empty));d=h}if(!i.validEnd){let t=i.fillBefore(n.empty,!0);e.replace(d,d,new a(t,0,0))}for(let t=l.length-1;t>=0;t--)e.step(l[t])}function eu(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(s,l,t))return n;if(0==n||o.type.spec.isolating||!((0==s||o.canReplace(s,o.childCount))&&(l==o.childCount||o.canReplace(0,l))))break;s&&(r=1),l<o.childCount&&(i=1)}return null}function ef(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 e=r;l&&e<i;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return o?i.map(em).concat({type:t,attrs:n}).concat(o.map(em)):null}function em(e){return{type:e,attrs:null}}function eg(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function ey(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function eb(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 e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))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 ev(e,t){let n=e.resolve(t),r=n.index();return ew(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ew(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}function ek(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,s=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&ew(i,o)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function ex(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(o,o,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function eS(e,t,n=t,r=a.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return eM(i,o,r)?new ed(t,n,r):new eC(i,o,r).fit()}function eM(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}en.jsonID("replaceAround",ec);class eC{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=n.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=n.from(e.node(t).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,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let l=new a(i,o,s);return e>-1?new ec(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new ed(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let r=1==t?e:this.unplaced.openStart;r>=0;r--){let e=null,i=(r?(e=eA(this.unplaced.content,r-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:l}=this.frontier[o],a,d=null;if(1==t&&(i?l.matchType(i.type)||(d=l.fillBefore(n.from(i),!1)):e&&s.compatibleContent(e.type)))return{sliceDepth:r,frontierDepth:o,parent:e,inject:d};if(2==t&&i&&(a=l.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:o,parent:e,wrap:a};if(e&&l.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=eA(e,t);return!!r.childCount&&!r.firstChild.isLeaf&&(this.unplaced=new a(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=eA(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new a(eT(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new a(eT(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let s=this.unplaced,l=r?r.content:s.content,d=s.openStart-e,c=0,h=[],{match:p,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)h.push(i.child(e));p=p.matchFragment(i)}let f=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let e=l.child(c),t=p.matchType(e.type);if(!t)break;(++c>1||0==d||e.content.size)&&(p=t,h.push(function e(t,r,i){if(r<=0)return t;let o=t.content;return r>1&&(o=o.replaceChild(0,e(o.firstChild,r-1,1==o.childCount?i-1:0))),r>0&&(o=t.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(n.empty,!0)))),t.copy(o)}(e.mark(u.allowedMarks(e.marks)),1==c?d:0,c==l.childCount?f:-1)))}let m=c==l.childCount;m||(f=-1),this.placed=eO(this.placed,t,n.from(h)),this.frontier[t].match=p,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=m?0==e?a.empty:new a(eT(s.content,e-1,1),e-1,f<0?s.openEnd:e-1):new a(eT(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!eN(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){t: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=eN(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=eN(e,n,r,t,!0);if(!i||i.childCount)continue t}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=eO(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,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=eO(this.placed,this.depth,n.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(n.empty,!0);e.childCount&&(this.placed=eO(this.placed,this.frontier.length,e))}}function eT(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(eT(e.firstChild.content,t-1,n)))}function eO(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(eO(e.lastChild.content,t-1,n)))}function eA(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function eN(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 eE(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class eD extends en{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return er.fail("No node at attribute step's position");let r=Object.create(null);for(let e in t.attrs)r[e]=t.attrs[e];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return er.fromReplace(e,this.pos,this.pos+1,new a(n.from(i),0,+!t.isLeaf))}getMap(){return Z.empty}invert(e){return new eD(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eD(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new eD(t.pos,t.attr,t.value)}}en.jsonID("attr",eD);class eR extends en{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return er.ok(n)}getMap(){return Z.empty}invert(e){return new eR(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new eR(t.attr,t.value)}}en.jsonID("docAttr",eR);let eI=class extends Error{};(eI=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),eI.prototype.constructor=eI,eI.prototype.name="TransformError";class eL{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ee}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new eI(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}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}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=a.empty){let r=eS(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,r){return this.replace(e,t,new a(n.from(r),0,0))}delete(e,t){return this.replace(e,t,a.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return!function(e,t,r,i){if(!i.size)return e.deleteRange(t,r);let o=e.doc.resolve(t),s=e.doc.resolve(r);if(eM(o,s,i))return e.step(new ed(t,r,i));let l=eE(o,s);0==l[l.length-1]&&l.pop();let d=-(o.depth+1);l.unshift(d);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?d=e:o.before(e)==t&&l.splice(1,0,-e)}let c=l.indexOf(d),h=[],p=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(h.push(n),t==i.openStart)break;e=n.content}for(let e=p-1;e>=0;e--){var u;let t=h[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(d)-1)))p=e;else if(n||!t.type.isTextblock)break}for(let t=i.openStart;t>=0;t--){let d=(t+p+1)%(i.openStart+1),u=h[d];if(u)for(let t=0;t<l.length;t++){let h=l[(t+c)%l.length],p=!0;h<0&&(p=!1,h=-h);let f=o.node(h-1),m=o.index(h-1);if(f.canReplaceWith(m,m,u.type,u.marks))return e.replace(o.before(h),p?s.after(h):r,new a(function e(t,r,i,o,s){if(r<i){let n=t.firstChild;t=t.replaceChild(0,n.copy(e(n.content,r+1,i,o,n)))}if(r>o){let e=s.contentMatchAt(0),r=e.fillBefore(t).append(t);t=r.append(e.matchFragment(r).fillBefore(n.empty,!0))}return t}(i.content,0,i.openStart,d),d,i.openEnd))}}let f=e.steps.length;for(let n=l.length-1;n>=0&&(e.replace(t,r,i),!(e.steps.length>f));n--){let e=l[n];e<0||(t=o.before(e),r=s.after(e))}}(this,e,t,r),this}replaceRangeWith(e,t,r){var i=e,o=t;if(!r.isInline&&i==o&&this.doc.resolve(i).parent.content.size){let e=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 e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break}return null}(this.doc,i,r.type);null!=e&&(i=o=e)}return this.replaceRange(i,o,new a(n.from(r),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&0==r.parentOffset&&0==i.parentOffset){let o=r.sharedDepth(n),s=!1;for(let e=r.depth;e>o;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=i.depth;e>o;e--)i.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=eE(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,r){let{$from:i,$to:o,depth:s}=t,l=i.before(s+1),d=o.after(s+1),c=l,h=d,p=n.empty,u=0;for(let e=s,t=!1;e>r;e--)t||i.index(e)>
20?(t=!0,p=n.from(i.node(e).copy(p)),u++):c--;let f=n.empty,m=0;for(let e=s,t=!1;e>r;e--)t||o.after(e+1)<o.end(e)?(t=!0,f=n.from(o.node(e).copy(f)),m++):h++;e.step(new ec(c,h,l,d,new a(p.append(f),u,m),p.size-u,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);ey(e,r.node(),r.before(),l)}s.inlineContent&&ep(e,t+n-1,s,o.node().contentMatchAt(o.index()),null==r);let d=e.mapping.slice(l),c=d.map(t-n);if(e.step(new ed(c,d.map(t+n,-1),a.empty,!0)),!0===r){let t=e.doc.resolve(c);eg(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,r){let i=n.empty;for(let e=r.length-1;e>=0;e--){if(i.size){let t=r[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=n.from(r[e].type.create(r[e].attrs,i))}let o=t.start,s=t.end;e.step(new ec(o,s,o,s,new a(i,0,0),r.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,i=null){var o=this;if(!r.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=o.steps.length;return o.doc.nodesBetween(e,t,(e,t)=>{var l,d,c;let h,p,u="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(r,u)&&(l=o.doc,d=o.mapping.slice(s).map(t),c=r,p=(h=l.resolve(d)).index(),h.parent.canReplaceWith(p,p+1,c))){let i=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}!1===i&&ey(o,e,t,s),ep(o,o.mapping.slice(s).map(t,1),r,void 0,null===i);let l=o.mapping.slice(s),d=l.map(t,1),c=l.map(t+e.nodeSize,1);return o.step(new ec(d,c,d+1,c-1,new a(n.from(r.create(u,null,e.marks)),0,0),1,!0)),!0===i&&eg(o,e,t,s),!1}}),this}setNodeMarkup(e,t,r=null,i){return!function(e,t,r,i,o){let s=e.doc.nodeAt(t);if(!s)throw RangeError("No node at given position");r||(r=s.type);let l=r.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,l);if(!r.validContent(s.content))throw RangeError("Invalid content for node type "+r.name);e.step(new ec(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new a(n.from(l),0,0),1,!0))}(this,e,t,r,i),this}setNodeAttribute(e,t,n){return this.step(new eD(e,t,n)),this}setDocAttribute(e,t){return this.step(new eR(e,t)),this}addNodeMark(e,t){return this.step(new el(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof s)t.isInSet(n.marks)&&this.step(new ea(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new ea(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,r){return!function(e,t,r=1,i){let o=e.doc.resolve(t),s=n.empty,l=n.empty;for(let e=o.depth,t=o.depth-r,a=r-1;e>t;e--,a--){s=n.from(o.node(e).copy(s));let t=i&&i[a];l=n.from(t?t.type.create(t.attrs,l):o.node(e).copy(l))}e.step(new ed(t,t,new a(s.append(l),r,r),!0))}(this,e,t,r),this}addMark(e,t,n){var r;let i,o,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(e,t,(r,a,d)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&d.type.allowsMarkType(n.type)){let d=Math.max(a,e),h=Math.min(a+r.nodeSize,t),p=n.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(p)||(i&&i.to==d&&i.mark.eq(c[e])?i.to=h:s.push(i=new es(d,h,c[e])));o&&o.to==d?o.to=h:l.push(o=new eo(d,h,n))}}),s.forEach(e=>r.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,t,n){var r;let i,o;return r=this,i=[],o=0,r.doc.nodesBetween(e,t,(r,s)=>{if(!r.isInline)return;o++;let l=null;if(n instanceof P){let e=r.marks,t;for(;t=n.isInSet(e);)(l||(l=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(r.marks)&&(l=[n]):l=r.marks;if(l&&l.length){let n=Math.min(s+r.nodeSize,t);for(let t=0;t<l.length;t++){let r=l[t],a;for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&r.eq(i[e].style)&&(a=t)}a?(a.to=n,a.step=o):i.push({style:r,from:Math.max(s,e),to:n,step:o})}}}
vendor: 5,821 bytes, line 2
2),i.forEach(e=>r.step(new es(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return ep(this,e,t,n),this}}let eP=Object.create(null);class eB{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new ez(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=a.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:l,$to:d}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(l.pos),c.map(d.pos),s?a.empty:t),0==s&&eJ(e,i,(n?n.isInline:r&&r.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),d=l.map(s.pos);i?e.deleteRange(a,d):(e.replaceRangeWith(a,d,t),eJ(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new eV(e):eq(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?eq(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):eq(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new eK(e.node(0))}static atStart(e){return eq(e,e,0,0,1)||new eK(e)}static atEnd(e){return eq(e,e,e.content.size,e.childCount,-1)||new eK(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=eP[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eP)throw RangeError("Duplicate use of selection JSON ID "+e);return eP[e]=t,t.prototype.jsonID=e,t}getBookmark(){return eV.between(this.$anchor,this.$head).getBookmark()}}eB.prototype.visible=!0;class ez{constructor(e,t){this.$from=e,this.$to=t}}let e$=!1;function eH(e){e$||e.parent.inlineContent||(e$=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class eV extends eB{constructor(e,t=e){eH(e),eH(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 eB.near(n);let r=e.resolve(t.map(this.anchor));return new eV(r.parent.inlineContent?r:n,n)}replace(e,t=a.empty){if(super.replace(e,t),t==a.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof eV&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new eF(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 RangeError("Invalid input for TextSelection.fromJSON");return new eV(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=eB.findFrom(t,n,!0)||eB.findFrom(t,-n,!0);if(!e)return eB.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(eB.findFrom(e,-n,!0)||eB.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new eV(e,t)}}eB.jsonID("text",eV);class eF{constructor(e,t){this.anchor=e,this.head=t}map(e){return new eF(e.map(this.anchor),e.map(this.head))}resolve(e){return eV.between(e.resolve(this.anchor),e.resolve(this.head))}}class ej extends eB{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?eB.near(i):new ej(i)}content(){return new a(n.from(this.node),0,0)}eq(e){return e instanceof ej&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new eW(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new ej(e.resolve(t.anchor))}static create(e,t){return new ej(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}ej.prototype.visible=!1,eB.jsonID("node",ej);class eW{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new eF(n,n):new eW(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ej.isSelectable(n)?new ej(t):eB.near(t)}}class eK extends eB{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=a.empty){if(t==a.empty){e.delete(0,e.doc.content.size);let t=eB.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new eK(e)}map(e){return new eK(e)}eq(e){return e instanceof eK}getBookmark(){return e_}}eB.jsonID("all",eK);let e_={map(){return this},resolve:e=>new eK(e)};function eq(e,t,n,r,i,o=!1){if(t.inlineContent)return eV.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&&ej.isSelectable(r))return ej.create(e,n-(i<0?r.nodeSize:0))}else{let t=eq(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function eJ(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof ed||o instanceof ec)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(eB.near(e.doc.resolve(r),n)))}function eU(e,t){return t&&e?e.bind(t):e}class eG{constructor(e,t,n){this.name=e,this.init=eU(t.init,n),this.apply=eU(t.apply,n)}}new eG("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new eG("selection",{init:(e,t)=>
2e.selection||eB.atStart(t.doc),apply:e=>e.selection}),new eG("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new eG("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t});class eY{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:eX("plugin")}getState(e){return e[this.key]}}let eQ=Object.create(null);function eX(e){return e in eQ?e+"$"+ ++eQ[e]:(eQ[e]=0,e+"$")}class eZ{constructor(e="key"){this.key=eX(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}let e0=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},e1=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},e2=null,e3=function(e,t,n){let r=e2||(e2=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},e5=function(){e2=null},e4=function(e,t,n,r){return n&&(e9(e,t,n,r,-1)||e9(e,t,n,r,1))},e6=/^(img|br|input|textarea|hr)$/i;function e9(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:e7(e))){let n=e.parentNode;if(!n||1!=n.nodeType||e8(e)||e6.test(e.nodeName)||"false"==e.contentEditable)return!1;t=e0(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(o=n.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;else e=n,t=i<0?e7(e):0}}}function e7(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function e8(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)}let te=function(e){return e.focusNode&&e4(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function tt(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let tn="u">typeof navigator?navigator:null,tr="u">typeof document?document:null,ti=tn&&tn.userAgent||"",to=/Edge\/(\d+)/.exec(ti),ts=/MSIE \d/.exec(ti),tl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ti),ta=!!(ts||tl||to),td=ts?document.documentMode:tl?+tl[1]:to?+to[1]:0,tc=!ta&&/gecko\/(\d+)/i.test(ti);tc&&(/Firefox\/(\d+)/.exec(ti)||[0,0])[1];let th=!ta&&/Chrome\/(\d+)/.exec(ti),tp=!!th,tu=th?+th[1]:0,tf=!ta&&!!tn&&/Apple Computer/.test(tn.vendor),tm=tf&&(/Mobile\/\w+/.test(ti)||!!tn&&tn.maxTouchPoints>2),tg=tm||!!tn&&/Mac/.test(tn.platform),ty=!!tn&&/Win/.test(tn.platform),tb=/Android \d/.test(ti),tv=!!tr&&"webkitFontSmoothing"in tr.documentElement.style,tw=tv?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tk(e,t){return"number"==typeof e?e:e[t]}function tx(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;){if(1!=s.nodeType){s=e1(s);continue}let e=s,n=e==o.body,l=n?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(o):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}}(e),a=0,d=0;if(t.top<l.top+tk(r,"top")?d=-(l.top-t.top+tk(i,"top")):t.bottom>l.bottom-tk(r,"bottom")&&(d=t.bottom-t.top>l.bottom-l.top?t.top+tk(i,"top")-l.top:t.bottom-l.bottom+tk(i,"bottom")),t.left<l.left+tk(r,"left")?a=-(l.left-t.left+tk(i,"left")):t.right>l.right-tk(r,"right")&&(a=t.right-l.right+tk(i,"right")),a||d)if(n)o.defaultView.scrollBy(a,d);else{let n=e.scrollLeft,r=e.scrollTop;d&&(e.scrollTop+=d),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}}let c=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(c))break;s="absolute"==c?s.offsetParent:e1(s)}}function tS(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=e1(r));return t}function tM(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 tC=null;function tT(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>
vendor: 9,777 bytes, line 2
2=t.top-1&&e.top<=t.bottom+1}function tO(e){return e.top<e.bottom||e.left<e.right}function tA(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(tO(e))return e}return Array.prototype.find.call(n,tO)||e.getBoundingClientRect()}let tN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function tE(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=tv||tc;if(3==r.nodeType)if(s&&(tN.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=tA(e3(r,i,i),n);if(tc&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=tA(e3(r,i-1,i-1),-1);if(t.top==e.top){let n=tA(e3(r,i,i+1),-1);if(n.top!=e.top)return tD(n,n.left<t.left)}}return e}else{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++,tD(tA(e3(r,e,t),o),o<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==e7(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return tR(e.getBoundingClientRect(),!1)}if(null==o&&i<e7(r)){let e=r.childNodes[i];if(1==e.nodeType)return tR(e.getBoundingClientRect(),!0)}return tR(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==e7(r))){let e=r.childNodes[i-1],t=3==e.nodeType?e3(e,e7(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return tD(tA(t,1),!1)}if(null==o&&i<e7(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?e3(e,0,+!s):1==e.nodeType?e:null:null;if(t)return tD(tA(t,-1),!0)}return tD(tA(3==r.nodeType?e3(r):r,-n),n>=0)}function tD(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 tR(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 tI(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()}}let tL=/[\u0590-\u08ac]/,tP=null,tB=null,tz=!1;class t${constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,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){let r;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}else{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}if(e==this.dom&&this.contentDOM)r=t>e0(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=this.getDesc(r),o;if(i&&(!t||i.node))if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==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;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}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=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],o=t+i.size;if(o>e||i instanceof t_){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof tH&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?e0(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?e0(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=e0(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=e0(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 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 s=0,l=0;s<this.children.length;s++){let a=this.children[s],d=l+a.size;if(i>l&&o<d)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=d}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),d=n.domSelectionRange(),c=!1;if((tc||tf)&&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 t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(s=l={node:n.parentNode,offset:e0(n)+1});break}let e=t.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(tc&&d.focusNode&&d.focusNode!=l.node&&1==d.focusNode.nodeType){let e=d.focusNode.childNodes[d.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&tf)&&e4(s.node,s.offset,d.anchorNode,d.anchorOffset)&&e4(l.node,l.offset,d.focusNode,d.focusOffset))return;let h=!1;if((a.extend||e==t)&&!(c&&tc)){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),h=!0}catch(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){this.dirty=e==n||t==o?2:1,e==r&&t==s&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class tH extends t${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 0==this.dirty&&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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class tV extends t${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 tF extends t${constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}
2static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=J.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new tF(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=tF.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=t2(i,t,o,n)),e>0&&(i=t2(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class tj extends t${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}static create(e,t,n,r,i,o){let s=i.nodeViews[t.type.name],l,a=s&&s(t,i,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:o,n,r),d=a&&a.dom,c=a&&a.contentDOM;if(t.isText)if(d){if(3!=d.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(t.text);else if(!d){let e=J.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:d,contentDOM:c}=e)}c||t.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let h=d;return(d=tQ(d,n,t),a)?l=new tq(e,t,n,r,d,c||null,h,a,i,o+1):t.isText?new tK(e,t,n,r,d,h,i):new tj(e,t,n,r,d,c||null,h,i,o+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=()=>n.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&tX(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new t0(this,o&&o.node,e);(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 d=0;;){let c,h,p,u;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(c?(h||(h=[c])).push(e):c=e)}if(c)if(h){h.sort(t1);for(let e=0;e<h.length;e++)n(h[e],d,!!a)}else n(c,d,!!a);if(a)u=-1,p=a,a=null;else if(d<e.childCount)u=d,p=e.child(d++);else break;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 f=o+p.nodeSize;if(p.isText){let e=f;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<f&&(a=p.cut(e-o),p=p.cut(0,e-o),f=e,u=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=p.isInline&&!p.isLeaf?l.filter(e=>!e.inline):l.slice();r(p,m,t.forChild(o,p),u),o=f}})(this.node,this.innerDeco,(t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?s.none:this.node.child(i).marks,n,e,i),a.placeWidget(t,e,r)},(t,o,s,d)=>{let c;a.syncToMarks(t.marks,n,e,d),a.findNodeMatch(t,o,s,d)||l&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,s,c,e)||a.updateNextNode(t,o,s,e,d,r)||a.addNode(t,o,s,e,r),r+=t.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),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=tZ(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(a,i);if(l instanceof tF){let n=i?i.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=tZ(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),tm&&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:r}=e.state.selection;if(!(e.state.selection instanceof eV)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,o=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}
2if(o>=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;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,r-t);return o<0?null:{node:i,pos:o,text:e}}}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 tV(this,i,t,r);e.input.compositionNodes.push(o),this.children=t2(this.children,n,n+r.length,e,o)}update(e,t,n,r){return 3!=this.dirty&&!!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=0}updateOuterDeco(e){if(tX(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=tY(this.dom,this.nodeDOM,tG(this.outerDeco,this.node,t),tG(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.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function tW(e,t,n,r,i){tQ(r,t,e);let o=new tj(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class tK extends tj{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 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}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 tK(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=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class t_ extends t${parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class tq extends tj{constructor(e,t,n,r,i,o,s,l,a,d){super(e,t,n,r,i,o,s,a,d),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){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.root):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)}}let tJ=function(e){e&&(this.nodeName=e)};tJ.prototype=Object.create(null);let tU=[new tJ];function tG(e,t,n){if(0==e.length)return tU;let r=n?tU[0]:new tJ,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s)for(let e in s.nodeName&&i.push(r=new tJ(s.nodeName)),s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new tJ(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 tY(e,t,n,r){if(n==tU&&r==tU)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),s=tU[0]),i=t}!function(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]);
2if(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=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(i,s||tU[0],o)}return i}function tQ(e,t,n){return tY(e,e,tU,tG(t,n,1!=e.nodeType))}function tX(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 tZ(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class t0{constructor(e,t,n){this.lock=t,this.view=n,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=[];n:for(;i>0;){let l;for(;;)if(r){let e=n.children[r-1];if(e instanceof tF)n=e,r=e.children.length;else{l=e,r--;break}}else if(n==t)break n;else 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,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=tF.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!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,o){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof tj){let a=this.preMatch.matched.get(l);if(null!=a&&a!=i)return!1;let d=l.dom,c,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&tX(t,l.outerDeco));if(!h&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(l,e,t,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!tX(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=tj.create(this.top,t,n,r,i,o);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,i){let o=tj.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),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))this.index++;else{let r=new tH(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof tF;
2)e=(t=e).children[t.children.length-1];(!e||!(e instanceof tK)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((tf||tp)&&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 t_(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function t1(e,t){return e.type.side-t.type.side}function t2(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],d=l,c=l+=a.size;d>=n||c<=t?o.push(a):(d<t&&o.push(a.slice(0,t-d,r)),i&&(o.push(i),i=void 0),c>n&&o.push(a.slice(n-d,a.size,r)))}return o}function t3(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,d;if(te(n)){for(a=s;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ej.isSelectable(e)&&i.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==e7(e);r||i;){if(e==n)return!0;let t=e0(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==e7(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;d=new ej(s==e?l:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,i=s;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[a,s]=i==e.state.selection.anchor?[i,t]:[t,i],l=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let c=r.resolve(a);if(!d){let n="pointer"==t||e.state.selection.head<l.pos&&!o?1:-1;d=nn(e,c,l,n)}return d}function t5(e){return e.editable?e.hasFocus():ni(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function t4(e,t=!1){let n=e.state.selection;if(ne(e,n),t5(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&tp){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&e4(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,e0(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&ta&&td<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var r;let i,o,s,l,{anchor:a,head:d}=n,c,h;t6&&!(n instanceof eV)&&(n.$from.parent.inlineContent||(c=t9(e,n.from)),n.empty||n.$from.parent.inlineContent||(h=t9(e,n.to))),e.docView.setSelection(a,d,e,t),t6&&(c&&t8(c),h&&t8(h)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=(r=e).dom.ownerDocument).removeEventListener("selectionchange",r.input.hideSelectionGuard),s=(o=r.domSelectionRange()).anchorNode,l=o.anchorOffset,i.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(o.anchorNode!=s||o.anchorOffset!=l)&&(i.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!t5(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let t6=tf||tp&&tu<63;function t9(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(tf&&i&&"false"==i.contentEditable)return t7(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return t7(i);else if(o)return t7(o)}}function t7(e){return e.contentEditable="true",tf&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function t8(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ne(e,t){if(t instanceof ej){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(nt(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else nt(e)}function nt(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nn(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||eV.between(t,n,r)}function nr(e){return(!e.editable||!!e.hasFocus())&&ni(e)}function ni(e){let t=e.domSelectionRange();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.focu
2sNode.parentNode:t.focusNode))}catch(e){return!1}}function no(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&eB.findFrom(o,t)}function ns(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function nl(e,t,n){let r=e.state.selection;if(r instanceof eV){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return ns(e,new eV(r.$anchor,o))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=no(e.state,t);return!!n&&n instanceof ej&&ns(e,n)}else if(!(tg&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,o;if(!i||i.isText)return!1;let s=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(o=e.docView.descAt(s))&&!o.contentDOM)&&(ej.isSelectable(i)?ns(e,new ej(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):!!tv&&ns(e,new eV(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}else{if(r instanceof ej&&r.node.isInline)return ns(e,new eV(t>0?r.$to:r.$from));let n=no(e.state,t);return!!n&&ns(e,n)}}function na(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function nd(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function nc(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(tc&&1==n.nodeType&&r<na(n)&&nd(n.childNodes[r],-1)&&(s=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(nd(e,-1))i=n,o=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(nh(n))break;else{let t=n.previousSibling;for(;t&&nd(t,-1);)i=n.parentNode,o=e0(t),t=t.previousSibling;if(t)r=na(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}s?np(e,n,r):i&&np(e,i,o)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s=na(i);for(;;)if(o<s){if(1!=i.nodeType)break;if(nd(i.childNodes[o],1))t=i,n=++o;else break}else if(nh(i))break;else{let r=i.nextSibling;for(;r&&nd(r,1);)t=r.parentNode,n=e0(r)+1,r=r.nextSibling;if(r)o=0,s=na(i=r);else{if((i=i.parentNode)==e.dom)break;o=s=0}}t&&np(e,t,n)}(e)}function nh(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}
vendor: 4,131 bytes, line 2
2function np(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!e8(e);)t=e0(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!e8(e);)t=e0(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(te(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&t4(e)},50)}function nu(e,t){let n=e.state.doc.resolve(t);if(!(tp||ty)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function nf(e,t,n){let r=e.state.selection;if(r instanceof eV&&!r.empty||n.indexOf("s")>-1||tg&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=no(e.state,t);if(n&&n instanceof ej)return ns(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof eK?eB.near(n,t):eB.findFrom(n,t);return!!s&&ns(e,s)}return!1}function nm(e,t){if(!(e.state.selection instanceof eV))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function ng(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ny(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||J.fromSchema(e.state.schema),l=nC(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let d=a.firstChild,c,h=0;for(;d&&1==d.nodeType&&(c=nS[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),h++}d=a.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function nb(e,t,r,i,o){let s,l,d=o.parent.type.spec.code;if(!r&&!t)return null;let c=!!t&&(i||d||!r);if(c){if(e.someProp("transformPastedText",n=>{t=n(t,d||i,e)}),d)return l=new a(n.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let r=e.someProp("clipboardTextParser",n=>n(t,o,i,e));if(r)l=r;else{let n=o.marks(),{schema:r}=e.state,i=J.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(i.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{r=t(r,e)}),s=function(e){var t;let n,r=/^(\s*<meta [^>]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let i=nC().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&nS[o[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(nT||(nT=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),nT.createHTML(t)):t),s)for(let e=0;e<s.length;e++)i=i.querySelector(s[e])||i;return i}(r),tv&&function(e){let t=e.querySelectorAll(tp?"span:not([class]):not
2([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]"),p=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let e=+p[3];e>0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||$.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||p),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||nv.test(e.parentNode.nodeName)?null:{ignore:!0}})),p)l=function(e,t){if(!e.size)return e;let r=e.content.firstChild.type.schema,i;try{i=JSON.parse(t)}catch(t){return e}let{content:o,openStart:s,openEnd:l}=e;for(let e=i.length-2;e>=0;e-=2){let t=r.nodes[i[e]];if(!t||t.hasRequiredAttrs())break;o=n.from(t.create(i[e+1],o)),s++,l++}return new a(o,s,l)}(nx(l,+p[1],+p[2]),p[4]);else if((l=a.maxOpen(function(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let i=t.node(r).contentMatchAt(t.index(r)),o,s=[];if(e.forEach(e=>{if(!s)return;let t=i.findWrapping(e.type),r;if(!t)return s=null;if(r=s.length&&o.length&&function e(t,r,i,o,s){if(s<t.length&&s<r.length&&t[s]==r[s]){let l=e(t,r,i,o.lastChild,s+1);if(l)return o.copy(o.content.replaceChild(o.childCount-1,l));if(o.contentMatchAt(o.childCount).matchType(s==t.length-1?i.type:t[s+1]))return o.copy(o.content.append(n.from(nw(i,t,s+1))))}}(t,o,e,s[s.length-1],0))s[s.length-1]=r;else{s.length&&(s[s.length-1]=function e(t,r){if(0==r)return t;let i=t.content.replaceChild(t.childCount-1,e(t.lastChild,r-1)),o=t.contentMatchAt(t.childCount).fillBefore(n.empty,!0);return t.copy(i.append(o))}(s[s.length-1],o.length));let r=nw(e,t);s.push(r),i=i.matchType(r.type),o=t}}),s)return n.from(s)}return e}(l.content,o),!0)).openStart||l.openEnd){let e=0,t=0;for(let t=l.content.firstChild;e<l.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=l.content.lastChild;t<l.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);l=nx(l,e,t)}return e.someProp("transformPasted",t=>{l=t(l,e,c)}),l}let nv=/^(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 nw(e,t,r=0){for(let i=t.length-1;i>=r;i--)e=t[i].create(null,n.from(e));return e}function nk(e,t,r,i,o,s){let l=t<0?e.firstChild:e.lastChild,a=l.content;return e.childCount>1&&(s=0),o<i-1&&(a=nk(a,t,r,i,o+1,s)),o>=r&&(a=t<0?l.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(n.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function nx(e,t,n){return t<e.openStart&&(e=new a(nk(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new a(nk(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let nS={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},nM=null;function nC(){return nM||(nM=document.implementation.createHTMLDocument("title"))}let nT=null,nO={},nA={},nN={touchstart:!0,touchmove:!0};class nE{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function nD(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function nR(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>nI(e,t))})}function nI(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function nL(e){return{left:e.clientX,top:e.clientY}}function nP(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function nB(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}nA.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!nH(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!tb||!tp||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!tm||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&
2(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||tg&&72==r&&"c"==i)return nm(e,-1)||nc(e,-1);if(46==r&&!t.shiftKey||tg&&68==r&&"c"==i)return nm(e,1)||nc(e,1);if(13==r||27==r)return!0;if(37==r||tg&&66==r&&"c"==i){let t=37==r?"ltr"==nu(e,e.state.selection.from)?-1:1:-1;return nl(e,t,i)||nc(e,t)}if(39==r||tg&&70==r&&"c"==i){let t=39==r?"ltr"==nu(e,e.state.selection.from)?1:-1:1;return nl(e,t,i)||nc(e,t)}else if(38==r||tg&&80==r&&"c"==i)return nf(e,-1,i)||nc(e,-1);else if(40==r||tg&&78==r&&"c"==i)return function(e){if(!tf||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;ng(e,n,"true"),setTimeout(()=>ng(e,n,"false"),20)}return!1}(e)||nf(e,1,i)||nc(e,1);else if(i==(tg?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():nD(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,tt(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},nA.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},nA.keypress=(e,t)=>{if(nH(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||tg&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof eV)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault()}};let nz=tg?"metaKey":"ctrlKey";nO.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let o=nW(e),s=Date.now(),l="singleClick";s-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[nz]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?l="doubleClick":"doubleClick"==e.input.lastClick.type&&(l="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:l,button:t.button};let a=e.posAtCoords(nL(t));a&&("singleClick"==l?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new n$(e,a,t,!!o)):("doubleClick"==l?function(e,t,n,r){return nP(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return nP(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(nB(e,eV.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)nB(e,eV.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ej.isSelectable(n))continue;nB(e,ej.create(r,o),"pointer")}return!0}}(e,n,r)})(e,a.pos,a.inside,t)?t.preventDefault():nD(e,"pointer"))};class n${constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[nz],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.nodeDOM.nodeType?l.nodeDOM:null;let{selection:a}=e.state;0==n.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof ej&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&tc&&!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)),nD(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(()=>t4(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(nL(e))),this.updateAllowDefault(e),this.allowDefault||!t)nD(this.view,"pointer");else{var n,r,i,o;(n=this.view,r=t.pos,i=t.inside,o=this.selectNode,nP(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(o?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof ej&&(r=n.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ej.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(e);break}}
2return null!=i&&(nB(e,ej.create(e.state.doc,i),"pointer"),!0)}(n,i):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ej.isSelectable(r))&&(nB(e,new ej(n),"pointer"),!0)}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||tf&&this.mightDrag&&!this.mightDrag.node.isAtom||tp&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(nB(this.view,eB.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):nD(this.view,"pointer")}}move(e){this.updateAllowDefault(e),nD(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function nH(e,t){return!!e.composing||!!(tf&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}nO.touchstart=e=>{e.input.lastTouch=Date.now(),nW(e),nD(e,"pointer")},nO.touchmove=e=>{e.input.lastTouch=Date.now(),nD(e,"pointer")},nO.contextmenu=e=>nW(e);let nV=tb?5e3:-1;function nF(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>nW(e),t))}function nj(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function nW(e,t=!1){if(!tb||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),nj(e),t||e.docView&&e.docView.dirty){let n=t3(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}nA.compositionstart=nA.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof eV&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||tp&&ty&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),nW(e,!0),e.markCursor=null;else if(nW(e,!t.selection.empty),tc&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}nF(e,nV)},nA.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,nF(e,20))};let nK=ta&&td<15||tm&&tw<604;function n_(e,t,n,r,i){let o=nb(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||a.empty)))return!0;if(!o)return!1;let s=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function nq(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}nO.copy=nA.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=nK?null:t.clipboardData,{dom:o,text:s}=ny(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",s)):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,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},nA.paste=(e,t)=>
vendor: 14,823 bytes, line 2
2{if(e.composing&&!tb)return;let n=nK?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&n_(e,nq(n),n.getData("text/html"),r,t)?t.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();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?n_(e,r.value,null,i,t):n_(e,r.textContent,r.innerHTML,i,t)},50)}(e,t)};class nJ{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let nU=tg?"altKey":"ctrlKey";function nG(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[nU]}for(let e in nO.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(nL(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ej?i.to-1:i.to));else if(r&&r.mightDrag)n=ej.create(e.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=ej.create(e.state.doc,r.posBefore))}let s=(n||e.state.selection).content(),{dom:l,text:a,slice:d}=ny(e,s);t.dataTransfer.files.length&&tp&&!(tu>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(nK?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",nK||t.dataTransfer.setData("text/plain",a),e.dragging=new nJ(d,nG(e,t),n)},nO.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},nA.dragover=nA.dragenter=(e,t)=>t.preventDefault(),nA.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(nL(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=nb(e,nq(t.dataTransfer),nK?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&nG(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||a.empty,s)))return t.preventDefault();if(!o)return;t.preventDefault();let l=o?ex(e.state.doc,i.pos,o):i.pos;null==l&&(l=i.pos);let d=e.state.tr;if(s){let{node:e}=n;e?e.replace(d):d.deleteSelection()}let c=d.mapping.map(l),h=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,p=d.doc;if(h?d.replaceRangeWith(c,c,o.content.firstChild):d.replaceRange(c,c,o),d.doc.eq(p))return;let u=d.doc.resolve(c);if(h&&ej.isSelectable(o.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(o.content.firstChild))d.setSelection(new ej(u));else{let t=d.mapping.map(l);d.mapping.maps[d.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),d.setSelection(nn(e,u,d.doc.resolve(t)))}e.focus(),e.dispatch(d.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},nO.focus=e=>{e.input.lastFocus=Date.now(),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.domSelectionRange())&&t4(e)},20))},nO.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},nO.beforeinput=(e,t)=>{if(tp&&tb&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,tt(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)}},nA)nO[e]=nA[e];function nY(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 nQ{constructor(e,t){this.toDOM=e,this.spec=t||n2,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 n0(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof nQ&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&nY(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class nX{constructor(e,t){this.attrs=e,this.spec=t||n2}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 n0(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof nX&&nY(this.attrs,e.attrs)&&nY(this.spec,e.spec)}static is(e){return e.type instanceof nX}destroy(){}}class nZ{constructor(e,t){this.attrs=e,this.spec=t||n2}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 n0(i.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(e){return this==e||e instanceof nZ&&nY(this.attrs,e.attrs)&&nY(this.spec,e.spec)}destroy(){}}class n0{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new n0(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 n0(e,e,new nQ(t,n))}static inline(e,t,n,r){return new n0(e,t,new nX(n,r))}static node(e,t,n,r){return new n0(e,t,new nZ(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof nX}get widget(){return this.type instanceof nQ}}let n1=[],n2={};class n3{constructor(e,t){this.local=e.length?e:n1,this.children=t.length?t:n1}static create(e,t){return t.length?n8(t,e,0,n2):n5}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==n5||0==e.maps.length?this:this.mapInner(e,t,0,0,n||n2)}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();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let s=o-i-(n-e);for(let i=0;i<l.length;i+=3){let o=l[i+1];if(o<0||e>o+t-r)continue;let a=l[i]+t-r;n>=a?l[i+1]=e<=a?-2:-1:e>=t&&s&&(l[i]+=s,l[i+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let d=n.map(e[t]+o),c=d-i;if(c<0||c>=r.content.size){a=!0;continue}let h=n.map(e[t+1]+o,-1)-i,{index:p,offset:u}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&u==c&&u+f.nodeSize==h){let r=l[t+2].mapInner(n,f,d+1,e[t]+o+1,s);r!=n5?(l[t]=c,l[t+1]=h,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=n8(function(e,t,n,r,i,o,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(r,i,o);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1)}(e[l+2],t[l]+o+1);return n}(l,e,t,n,i,o,s),r,0,s);t=a.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<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new n3(t.sort(re),l)}(this.children,o||[],e,t,n,r,i):o?new n3(o.sort(re),n1):n5}add(e,t){return t.length?this==n5?n3.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let s=o+n,l;if(l=n9(t,e,s)){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,l,s+1):r.splice(i,0,o,o+e.nodeSize,n8(l,e,s+1,n2)),i+=3}});let o=n6(i?n7(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new n3(o.length?this.local.concat(o).sort(re):this.local,r||this.children)}remove(e){return 0==e.length||this==n5?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<s&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(i,o+1);l!=n5?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])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 n3(r,n):n5}forChild(e,t){let n,r;if(this==n5)return this;if(t.isLeaf)return n3.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof nX){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new n3(r.sort(re),n1);return n?new n4([e,n]):e}return n||n5}eq(e){if(this==e)return!0;if(!(e instanceof n3)||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 rt(this.localsInner(e))}localsInner(e){if(this==n5)return n1;if(e.inlineContent||!this.local.some(nX.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof nX||t.push(this.local[e]);return t}forEachSet(e){e(this)}}n3.empty=new n3([],[]),n3.removeOverlap=rt;let n5=n3.empty;class n4{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,n2));return n4.from(n)}forChild(e,t){if(t.isLeaf)return n3.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=n5&&(i instanceof n4?n=n.concat(i.members):n.push(i))}return n4.from(n)}eq(e){if(!(e instanceof n4)||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?rt(n?t:t.sort(re)):n1}static from(e){switch(e.length){case 0:return n5;case 1:return e[0];default:return new n4(e.every(e=>e instanceof n3)?e:e.reduce((e,t)=>e.concat(t instanceof n3?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function n6(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 n0(i.from+t,i.to+t,i.type))}return n}function n9(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i}function n7(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function n8(e,t,n,r){let i=[],o=!1;t.forEach((t,s)=>{let l=n9(e,t,s+n);if(l){o=!0;let e=n8(l,t,n+s+1,r);e!=n5&&i.push(s,s+t.nodeSize,e)}});let s=n6(o?n7(e):e,-n).sort(re);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new n3(s,i):n5}function re(e,t){return e.from-t.from||e.to-t.to}function rt(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.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),rn(t,i+1,o.copy(r.to,o.to)));continue}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),rn(t,i,r.copy(o.from,r.to)));break}}return t}function rn(e,t,n){for(;t<e.length&&re(n,e[t])>0;)t++;e.splice(t,0,n)}function rr(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=n5&&t.push(r)}),e.cursorWrapper&&t.push(n3.create(e.state.doc,[e.cursorWrapper.deco])),n4.from(t)}let ri={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ro=ta&&td<=11;class rs{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 rl{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rs,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);ta&&td<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():tf&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ro&&(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,ri)),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(nr(this.view)){if(this.suppressingSelectionUpdates)return t4(this.view);if(ta&&td<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();
2if(e.focusNode&&e4(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=e1(n))t.add(n);for(let r=e.anchorNode;r;r=e1(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:3==n.nodeType?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&nr(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],a);t&&(o=o<0?t.from:Math.min(t.from,o),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(l=!0))}if(a.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(tc&&a.length){let e=a.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(t,n)!=e)&&r.remove()}}}let d=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&te(r)&&(d=t3(t))&&d.eq(eB.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,t4(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),e=t,!ra.has(e)&&(ra.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=tc,rd||(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."),rd=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(n=o.parentNode)?void 0:n.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(t,a)),this.handleDOMChange(o,s,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||t4(t),this.currentSelection.set(r))}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"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}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(ta&&td<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let o=r&&r.parentNode==e.target?e0(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?e0(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}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let ra=new WeakMap,rd=!1;function rc(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return e4(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function rh(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(tf&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||tf&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let rp=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
2function ru(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:nn(e,t.resolve(n.anchor),t.resolve(n.head))}function rf(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}function rm(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}function rg(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),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.translate||(t.translate="no"),[n0.node(0,e.state.doc.content.size,t)]}function ry(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:n0.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function rb(e){return!e.someProp("editable",t=>!1===t(e.state))}function rv(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 rw(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}(class{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 nE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(rw),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=rb(this),ry(this),this.nodeViews=rv(this),this.docView=tW(this.state.doc,rg(this),rr(this),this.dom,this),this.domObserver=new rl(this,(e,t,r,i)=>(function(e,t,r,i,o){let s,l,a,d=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=t3(e,t);
2if(n&&!e.state.selection.eq(n)){if(tp&&tb&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,tt(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),d&&r.setMeta("composition",d),e.dispatch(r)}return}let c=e.state.doc.resolve(t),h=c.sharedDepth(r);t=c.before(h+1),r=e.state.doc.resolve(r).after(h+1);let p=e.state.selection,u=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),d=e.domSelectionRange(),c=d.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:d.anchorOffset}],te(d)||r.push({node:d.focusNode,offset:d.focusOffset})),tp&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let h=e.state.doc,p=e.someProp("domParser")||$.fromSchema(e.state.schema),u=h.resolve(l),f=null,m=p.parse(i,{topNode:u.parent,topMatch:u.parent.contentMatchAt(u.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=u.parent.type.whitespace||"full",findPositions:r,ruleFromNode:rh,context:u});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,r),f=e.state.doc,m=f.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(s=e.state.selection.to,l="end"):(s=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let g=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;(o-=e)&&o<t.size&&rm(t.textBetween(o-1,o+1))&&(o+=e?1:-1),l=o+(l-s),s=o}else if(l<o){let t=r<=o&&r>=l?o-r:0;(o-=t)&&o<e.size&&rm(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}(m.content,u.doc.content,u.from,s,l);if(g&&e.input.domChangeCount++,(tm&&e.input.lastIOSEnter>Date.now()-225||tb)&&o.some(e=>1==e.nodeType&&!rp.test(e.nodeName))&&(!g||g.endA>=g.endB)&&e.someProp("handleKeyDown",t=>t(e,tt(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!g)if(i&&p instanceof eV&&!p.empty&&p.$head.sameParent(p.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))g={start:p.from,endA:p.to,endB:p.to};else{if(u.sel){let t=ru(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);d&&n.setMeta("composition",d),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&g.start==g.endB&&e.state.selection instanceof eV&&(g.start>e.state.selection.from&&g.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?g.start=e.state.selection.from:g.endA<e.state.selection.to&&g.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(g.endB+=e.state.selection.to-g.endA,g.endA=e.state.selection.to)),ta&&td<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>u.from&&" Â "==u.doc.textBetween(g.start-u.from-1,g.start-u.from+1)&&(g.start--,g.endA--,g.endB--);let y=u.doc.resolveNoCache(g.start-u.from),b=u.doc.resolveNoCache(g.endB-u.from),v=f.resolve(g.start),w=y.sameParent(b)&&y.parent.inlineContent&&v.end()>=g.endA;if((tm&&e.input.lastIOSEnter>Date.now()-225&&(!w||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!w&&y.pos<u.doc.content.size&&(!y.sameParent(b)||!y.parent.inlineContent)&&y.pos<b.pos&&!/\S/.test(u.doc.textBetween(y.pos,b.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,tt(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>g.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||rf(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(rf(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||rf(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(f,g.start,g.endA,y,b)&&e.someProp("handleKeyDown",t=>t(e,tt(8,"Backspace")))){tb&&tp&&e.domObserver.suppressSelectionUpdates();return}
vendor: 5,054 bytes, line 2
2tp&&g.endB==g.start&&(e.input.lastChromeDelete=Date.now()),tb&&!w&&y.start()!=b.start()&&0==b.parentOffset&&y.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==g.endA&&(g.endB-=2,b=u.doc.resolveNoCache(g.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,tt(13,"Enter"))})},20));let k=g.start,x=g.endA,S=t=>{let n=t||e.state.tr.replace(k,x,u.doc.slice(g.start-u.from,g.endB-u.from));if(u.sel){let t=ru(e,n.doc,u.sel);t&&!(tp&&e.composing&&t.empty&&(g.start!=g.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==k||t.head==n.mapping.map(x)-1)||ta&&t.empty&&t.head==k)&&n.setSelection(t)}return d&&n.setMeta("composition",d),n.scrollIntoView()};if(w)if(y.pos==b.pos){ta&&td<=11&&0==y.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>t4(e),20));let t=S(e.state.tr.delete(k,x)),n=f.resolve(g.start).marksAcross(f.resolve(g.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(g.endA==g.endB&&(a=function(e,t){let r=e.firstChild.marks,i=t.firstChild.marks,o=r,s=i,l,a,d;for(let e=0;e<i.length;e++)o=i[e].removeFromSet(o);for(let e=0;e<r.length;e++)s=r[e].removeFromSet(s);if(1==o.length&&0==s.length)a=o[0],l="add",d=e=>e.mark(a.addToSet(e.marks));else{if(0!=o.length||1!=s.length)return null;a=s[0],l="remove",d=e=>e.mark(a.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(d(t.child(e)));if(n.from(c).eq(e))return{mark:a,type:l}}(y.parent.content.cut(y.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,g.endA-v.start())))){let t=S(e.state.tr);"add"==a.type?t.addMark(k,x,a.mark):t.removeMark(k,x,a.mark),e.dispatch(t)}else if(y.parent.child(y.index()).isText&&y.index()==b.index()-!b.textOffset){let t=y.parent.textBetween(y.parentOffset,b.parentOffset),n=()=>S(e.state.tr.insertText(t,k,x));e.someProp("handleTextInput",r=>r(e,k,x,t,n))||e.dispatch(n())}else e.dispatch(S());else e.dispatch(S())})(this,e,t,r,i)),this.domObserver.start(),function(e){for(let t in nO){let n=nO[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(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}(e,t)||nI(e,t)||!e.editable&&t.type in nA||n(e,t)},nN[t]?{passive:!0}:void 0)}tf&&e.dom.addEventListener("input",()=>null),nR(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&nR(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(rw),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,r,i;let o=this.state,s=!1,l=!1;e.storedMarks&&this.composing&&(nj(this),l=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=rv(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&nR(this),this.editable=rb(this),ry(this);let d=rr(this),c=rg(this),h=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",p=s||!this.docView.matchesNode(e.doc,c,d);(p||!e.selection.eq(o.selection))&&(l=!0);let u="preserve"==h&&l&&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:tS(e.dom)}}(this);if(l){let t,n,l;this.domObserver.stop();let a=p&&(ta||tp)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(r=o.selection,i=e.selection,l=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(l)!=i.$anchor.start(l));if(p){let t=tp?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=e7(e=e.childNodes[t-1])}else{if(!e.parentNode||e8(e))return null;t=e0(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||e8(e))return null;t=e0(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);
2if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(s||!this.docView.update(e.doc,c,d,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=tW(e.doc,c,d,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(a=!0)}a||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),e4(t.node,t.offset,n.anchorNode,n.anchorOffset)))?t4(this,a):(ne(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null==(n=this.dragging)?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==h?this.dom.scrollTop=0:"to selection"==h?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;tM(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof ej){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&tx(this,t.getBoundingClientRect(),e)}else tx(this,this.coordsAtPos(this.state.selection.head,1),e)}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))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new nJ(e.slice,e.move,r<0?void 0:ej.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let o=i[n].props[e];if(null!=o&&(r=t?t(o):o))return r}}hasFocus(){if(ta){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(tC)return e.focus(tC);let t=tS(e);e.focus(null==tC?{get preventScroll(){return tC={preventScroll:!0},!0}}:void 0),tC||(tC=!1,tM(t,0))}(this.dom),t4(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let r,i,o=e.dom.ownerDocument,s,l=0,a=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(e7(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(e7(r.startContainer),r.startOffset)}}}(o,t.left,t.top);a&&({node:s,offset:l}=a);let d=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!d||!e.dom.contains(1!=d.nodeType?d.parentNode:d)){let n=e.dom.getBoundingClientRect();if(!tT(t,n)||!(d=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(tT(n,o))return e(r,n,o)}}if((s=(s+1)%i)==o)break}return t}(e.dom,t,n)))return null}if(tf)for(let e=d;s&&e;e=e1(e))e.draggable&&(s=void 0);if(d=(r=(n=d).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(tc&&1==s.nodeType&&(l=Math.min(l,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[l],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&l++}tv&&l&&1==s.nodeType&&1==(n=s.childNodes[l-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&l--,s==e.dom&&l==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>
2s.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==l||1!=s.nodeType||"BR"!=s.childNodes[l-1].nodeName)&&(i=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&s.left>r.left||s.top>r.top?i=t.posBefore:(!o&&s.right<r.left||s.bottom<r.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,s,l,t))}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,o,s=2e8,l,a=0,d=n.top,c=n.top;for(let e=t.firstChild,h=0;e;e=e.nextSibling,h++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=e3(e).getClientRects()}for(let p=0;p<t.length;p++){let u=t[p];if(u.top<=d&&u.bottom>=c){d=Math.max(u.bottom,d),c=Math.min(u.top,c);let t=u.left>n.left?u.left-n.left:u.right<n.left?n.left-u.right:0;if(t<s){o=e,s=t,l=t&&3==o.nodeType?{left:u.right<n.left?u.right:u.left,top:n.top}:n,1==e.nodeType&&t&&(a=h+ +(n.left>=(u.left+u.right)/2));continue}}else u.top>n.top&&!r&&u.left<=n.left&&u.right>=n.left&&(r=e,i={left:Math.max(u.left,Math.min(u.right,n.left)),top:u.top});!o&&(n.left>=u.right&&n.top>=u.top||n.left>=u.left&&n.top>=u.bottom)&&(a=h+1)}}return(!o&&r&&(o=r,l=i,s=0),o&&3==o.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=tA(r,1);if(n.top!=n.bottom&&tT(t,n)){i={node:e,offset:o+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}(o,l):!o||s&&1==o.nodeType?{node:t,offset:a}:e(o,l)}(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,d,t));let c=e.docView.nearestDesc(d,!0);return{pos:i,inside:c?c.posAtStart-c.border:-1}}(this,e)}coordsAtPos(e,t=1){return tE(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 RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,i;return tP==t&&tB==n?tz:(tP=t,tB=n,tz="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,tI(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.contentDOM||n.dom;break}t=n.dom.parentNode}let r=tE(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=e3(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>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=i==r.parent.content.size,s=e.domSelection();return s?tL.test(r.parent.textContent)&&s.modify?tI(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let d=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:c,focusOffset:h}=e.domSelectionRange(),p=c&&!d.contains(1==c.nodeType?c:c.parentNode)||t==c&&i==h;try{s.collapse(o,l),t&&(t!=o||i!=l)&&s.extend&&s.extend(t,i)}catch(e){}return null!=a&&(s.caretBidiLevel=a),p}):"left"==n||"backward"==n?!i:o:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return n_(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return n_(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return ny(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rr(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,e5()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!nI(this,e)&&nO[e.type]&&(this.editable||!(e.type in nA))&&nO[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?tf&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return rc(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?rc(e,n):null}
2(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}).prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var rk={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:"'"},rx={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},rS="u">typeof navigator&&/Mac/.test(navigator.platform),rM="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),rC=0;rC<10;rC++)rk[48+rC]=rk[96+rC]=String(rC);for(var rC=1;rC<=24;rC++)rk[rC+111]="F"+rC;for(var rC=65;rC<=90;rC++)rk[rC]=String.fromCharCode(rC+32),rx[rC]=String.fromCharCode(rC);for(var rT in rk)rx.hasOwnProperty(rT)||(rx[rT]=rk[rT]);let rO="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),rA="u">typeof navigator&&/Win/.test(navigator.platform);function rN(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function rE(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))rO?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=e[n];return t}(e);return function(e,n){var r;let i=("Esc"==(r=!(rS&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||rM&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?rx:rk)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),o,s=t[rN(i,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[rN(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(rA&&n.ctrlKey&&n.altKey)&&(o=rk[n.keyCode])&&o!=i){let r=t[rN(o,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}let rD=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function rR(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let rI=(e,t,n)=>{let r=rR(e,n);if(!r)return!1;let i=rz(r);if(!i){let n=r.blockRange(),i=n&&eu(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(rJ(e,i,t,-1))return!0;if(0==r.parent.content.size&&(rP(o,"end")||ej.isSelectable(o)))for(let n=r.depth;;n--){let s=eS(e.doc,r.before(n),r.after(n),a.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(rP(o,"end")?eB.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):ej.create(n.doc,i.pos-o.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)};function rL(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let o=t.nodeAfter,s=t.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let l=eS(e.doc,i,s,a.empty);if(!l||l.from!=i||l instanceof ed&&l.slice.size>=s-i)return!1;if(n){let t=e.tr.step(l);t.setSelection(eV.create(t.doc,i)),n(t.scrollIntoView())}return!0}function rP(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
2if(n&&1!=r.childCount)break}return!1}let rB=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=rz(r)}let s=o&&o.nodeBefore;return!!s&&!!ej.isSelectable(s)&&(t&&t(e.tr.setSelection(ej.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function rz(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 r$(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let rH=(e,t,n)=>{let r=r$(e,n);if(!r)return!1;let i=rF(r);if(!i)return!1;let o=i.nodeAfter;if(rJ(e,i,t,1))return!0;if(0==r.parent.content.size&&(rP(o,"start")||ej.isSelectable(o))){let n=eS(e.doc,r.before(),r.after(),a.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(rP(o,"start")?eB.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):ej.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},rV=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=rF(r)}let s=o&&o.nodeAfter;return!!s&&!!ej.isSelectable(s)&&(t&&t(e.tr.setSelection(ej.create(e.doc,o.pos)).scrollIntoView()),!0)};function rF(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}let rj=(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)};function rW(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let rK=(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),o=n.indexAfter(-1),s=rW(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(eB.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},r_=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof eK||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=rW(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(eV.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},rq=(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 r=n.before();if(eb(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&eu(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function rJ(e,t,r,i){let o,s,l,d=t.nodeBefore,c=t.nodeAfter,h,p,u=d.type.spec.isolating||c.type.spec.isolating;if(!u&&(o=t.nodeBefore,s=t.nodeAfter,l=t.index(),o&&s&&o.type.compatibleContent(s.type)&&(!o.content.size&&t.parent.canReplace(l-1,l)?(r&&r(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(l,l+1)&&!!(s.isTextblock||ev(e.doc,t.pos))&&(r&&r(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let f=!u&&t.parent.canReplace(t.index(),t.index()+1);if(f&&(h=(p=d.contentMatchAt(d.childCount)).findWrapping(c.type))&&p.matchType(h[0]||c.type).validEnd){if(r){let i=t.pos+c.nodeSize,o=n.empty;for(let e=h.length-1;e>=0;e--)o=n.from(h[e].create(null,o));o=n.from(d.copy(o));let s=e.tr.step(new ec(t.pos-1,i,t.pos,i,new a(o,1,0),h.length,!0)),l=s.doc.resolve(i+2*h.length);l.nodeAfter&&l.nodeAfter.type==d.type&&ev(s.doc,l.pos)&&s.join(l.pos),r(s.scrollIntoView())}return!0}let m=c.type.spec.isolating||i>0&&u?null:eB.findFrom(t,1),g=m&&m.$from.blockRange(m.$to),y=g&&eu(g);if(null!=y&&y>=t.depth)return r&&r(e.tr.lift(g,y).scrollIntoView()),!0;if(f&&rP(c,"start",!0)&&rP(d,"end")){let i=d,o=[];for(;o.push(i),!i.isTextblock;)i=i.lastChild;let s=c,l=1;for(;!s.isTextblock;s=s.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,s.content)){if(r){let i=n.empty;for(let e=o.length-1;e>=0;e--)i=n.from(o[e].copy(i));r(e.tr.step(new ec(t.pos-o.length,t.pos+c.nodeSize,t.pos+l,t.pos+c.nodeSize-l,new a(i,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function rU(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(eV.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let rG=rU(-1),rY=rU(1);function rQ(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function rX(...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 rZ=rX(rD,rI,rB),r0=rX(rD,rH,rV),r1={Enter:rX(rj,r_,rq,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof ej&&e.selection.node.isBlock)return!!n.parentOffset&&!!eb(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i=[],o,s,l=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;l=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),s=rW(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));i.unshift(t||(l&&s?{type:s}:null)),o=e;break}if(1==e)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof eV||e.selection instanceof eK)&&d.deleteSelection();let c=d.mapping.map(n.pos),h=eb(d.doc,c,i.length,i);if(h||(i[0]=s?{type:s}:null,h=eb(d.doc,c,i.length,i)),!h)return!1;if(d.split(c,i.length,i),!l&&a&&n.node(o).type!=s){let e=d.mapping.map(n.before(o)),t=d.doc.resolve(e);s&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&d.setNodeMarkup(d.mapping.map(n.before(o)),s)}return t&&t(d.scrollIntoView()),!0}),"Mod-Enter":rK,Backspace:rZ,"Mod-Backspace":rZ,"Shift-Backspace":rZ,Delete:r0,"Mod-Delete":r0,"Mod-a":(e,t)=>
2(t&&t(e.tr.setSelection(new eK(e.doc))),!0)},r2={"Ctrl-h":r1.Backspace,"Alt-Backspace":r1["Mod-Backspace"],"Ctrl-d":r1.Delete,"Ctrl-Alt-Backspace":r1["Mod-Delete"],"Alt-Delete":r1["Mod-Delete"],"Alt-d":r1["Mod-Delete"],"Ctrl-a":rG,"Ctrl-e":rY};for(let e in r1)r2[e]=r1[e];function r3(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();class r5{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],l=!!e,a=e||i.tr,d=()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(a),s.every(e=>!0===e)),c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(a,t),i=n(...e)(r);return s.push(i),c}])),run:d};return c}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:r3({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}}function r4(e,t,n){return void 0===e.config[t]&&e.parent?r4(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?r4(e.parent,t,n):null}):e.config[t]}function r6(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function r9(e){let t=[],{nodeExtensions:n,markExtensions:r}=r6(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:i},r=r4(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}
2),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=r4(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function r7(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function r8(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter(e=>!i.includes(e));n[e]=[...i,...o].join(" ")}else if("style"===e){let r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],i=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],o=new Map;i.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());o.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());o.set(t,n)}),n[e]=Array.from(o.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function ie(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>r8(e,t),{})}function it(e,t,...n){return"function"==typeof e?t?e.bind(t)(...n):e(...n):e}function ir(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let i=t.reduce((e,t)=>{var r;let i=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?e:{...e,[t.name]:i}},{});return{...r,...i}}}}function ii(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function io(e,t){var n;let r=r9(e),{nodeExtensions:i,markExtensions:o}=r6(e),s=null==(n=i.find(e=>r4(e,"topNode")))?void 0:n.name;return new B({topNode:s,nodes:Object.fromEntries(i.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=ii({...e.reduce((e,t)=>{let r=r4(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:it(r4(n,"content",o)),marks:it(r4(n,"marks",o)),group:it(r4(n,"group",o)),inline:it(r4(n,"inline",o)),atom:it(r4(n,"atom",o)),selectable:it(r4(n,"selectable",o)),draggable:it(r4(n,"draggable",o)),code:it(r4(n,"code",o)),whitespace:it(r4(n,"whitespace",o)),linebreakReplacement:it(r4(n,"linebreakReplacement",o)),defining:it(r4(n,"defining",o)),isolating:it(r4(n,"isolating",o)),attrs:Object.fromEntries(i.map(e=>{var t;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default}]}))}),l=it(r4(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>ir(e,i)));let a=r4(n,"renderHTML",o);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:ie(e,i)}));let d=r4(n,"renderText",o);return d&&(s.toText=d),[n.name,s]})),marks:Object.fromEntries(o.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=ii({...e.reduce((e,t)=>{let r=r4(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:it(r4(n,"inclusive",o)),excludes:it(r4(n,"excludes",o)),group:it(r4(n,"group",o)),spanning:it(r4(n,"spanning",o)),code:it(r4(n,"code",o)),attrs:Object.fromEntries(i.map(e=>{var t;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default}]}))}),l=it(r4(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>ir(e,i)));let a=r4(n,"renderHTML",o);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:ie(e,i)})),[n.name,s]}))})}function is(e,t){return t.nodes[e]||t.marks[e]||null}function il(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function ia(e,t){let n=J.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function id(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class ic{constructor(e){this.find=e.find,this.handler=e.handler}}function ih(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;let d=a.state.doc.resolve(r);if(d.parent.type.spec.code||(null==(t=d.nodeBefore||d.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let c=!1,h=((e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,o)=>{var s,l;let a=(null==(l=(s=e.type.spec).toText)?void 0:l.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(d)+o;
2return s.forEach(e=>{if(c)return;let t=((e,t)=>{if(id(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(h,e.find);if(!t)return;let s=a.state.tr,d=r3({state:a.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:u,chain:f,can:m}=new r5({editor:n,state:d});null!==e.handler({state:d,range:p,match:t,commands:u,chain:f,can:m})&&s.steps.length&&(s.setMeta(l,{transform:s,from:r,to:i,text:o}),a.dispatch(s),c=!0)}),c}function ip(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function iu(e,t){let n={...e};return ip(e)&&ip(t)&&Object.keys(t).forEach(r=>{ip(t[r])&&ip(e[r])?n[r]=iu(e[r],t[r]):n[r]=t[r]}),n}class im{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(r4(this,"addOptions",{name:this.name}))),this.storage=it(r4(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new im(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>iu(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new im(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=it(r4(t,"addOptions",{name:t.name})),t.storage=it(r4(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}class ig{constructor(e){this.find=e.find,this.handler=e.handler}}let iy=null;class ib{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=ib.resolve(e),this.schema=io(this.extensions,t),this.setupExtensions()}static resolve(e){var t;let n=ib.sort(ib.flatten(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=r4(e,"addExtensions",t);return n?[e,...this.flatten(n())]:e}).flat(10)}static sort(e){return e.sort((e,t)=>{let n=r4(e,"priority")||100,r=r4(t,"priority")||100;return n>r?-1:+(n<r)})}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:is(t.name,this.schema)},r=r4(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this,t=ib.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(t=>{let n={name:t.name,options:t.options,storage:t.storage,editor:e,type:is(t.name,this.schema)},o=[],s=r4(t,"addKeyboardShortcuts",n),l={};if("mark"===t.type&&r4(t,"exitable",n)&&(l.ArrowRight=()=>im.handleExit({editor:e,mark:t})),s){let t=Object.fromEntries(Object.entries(s()).map(([t,n])=>[t,()=>n({editor:e})]));l={...l,...t}}let a=new eY({props:{handleKeyDown:rE(l)}});o.push(a);let d=r4(t,"addInputRules",n);il(t,e.options.enableInputRules)&&d&&r.push(...d());let c=r4(t,"addPasteRules",n);il(t,e.options.enablePasteRules)&&c&&i.push(...c());let h=r4(t,"addProseMirrorPlugins",n);if(h){let e=h();o.push(...e)}return o}
2).flat();return[function(e){let{editor:t,rules:r}=e,i=new eY({state:{init:()=>null,apply(e,o,s){let l=e.getMeta(i);if(l)return l;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=ia(n.from(e),s.schema));let{from:o}=a,l=o+e.length;ih({editor:t,from:o,to:l,text:e,rules:r,plugin:i})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,n,o,s)=>ih({editor:t,from:n,to:o,text:s,rules:r,plugin:i}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:n}=e.state.selection;n&&ih({editor:t,from:n.pos,to:n.pos,text:"",rules:r,plugin:i})}),!1)},handleKeyDown(e,n){if("Enter"!==n.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&ih({editor:t,from:o.pos,to:o.pos,text:"\n",rules:r,plugin:i})}},isInputRules:!0});return i}({editor:e,rules:r}),...function(e){let t,{editor:r,rules:i}=e,o=null,s=!1,l=!1,a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let d=({state:e,from:n,to:i,rule:o,pasteEvt:s})=>{let l=e.tr;if(function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:d,can:c}=new r5({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(!e.isTextblock||e.type.spec.code)return;let p=Math.max(r,t),u=Math.min(i,t+e.content.size);((e,t,n)=>{if(id(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.textBetween(p-t,u-t,void 0,""),o.find,s).forEach(e=>{if(void 0===e.index)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=o.handler({state:n,range:i,match:e,commands:a,chain:d,can:c,pasteEvent:s,dropEvent:l});h.push(u)})}),h.every(e=>null!==e)}({editor:r,state:r3({state:e,transaction:l}),from:Math.max(n-1,0),to:i.b-1,rule:o,pasteEvent:s,dropEvent:t})&&l.steps.length){try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return i.map(e=>new eY({view(e){let t=t=>{var n;(o=(null==(n=e.dom.parentElement)?void 0:n.contains(t.target))?e.dom.parentElement:null)&&(iy=r)},n=()=>{iy&&(iy=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",n),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",n)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(l=o===e.dom.parentElement,t=n,!l){let e=iy;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,r,i)=>{let o=t[0],c="paste"===o.getMeta("uiEvent")&&!s,h="drop"===o.getMeta("uiEvent")&&!l,p=o.getMeta("applyPasteRules"),u=!!p;if(!c&&!h&&!u)return;if(u){var f,m;let t,{text:r}=p;"string"==typeof r||(r=ia(n.from(r),i.schema));let{from:o}=p,s=o+r.length;return d({rule:e,state:i,from:o,to:{b:s},pasteEvt:(f=r,null==(m=(t=new ClipboardEvent("paste",{clipboardData:new DataTransfer})).clipboardData)||m.setData("text/html",f),t)})}let g=r.doc.content.findDiffStart(i.doc.content),y=r.doc.content.findDiffEnd(i.doc.content);if("number"==typeof g&&y&&g!==y.b)return d({rule:e,state:i,from:g,to:y,pasteEvt:a})}}))}({editor:e,rules:i}),...o]}get attributes(){return r9(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=r6(this.extensions);return Object.fromEntries(t.filter(e=>!!r4(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:r7(t.name,this.schema)},i=r4(t,"addNodeView",r);return i?[t.name,(r,o,s,l,a)=>{let d=ie(r,n);return i()({node:r,view:o,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}
2setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;let n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:is(e.name,this.schema)};"mark"===e.type&&(null==(t=it(r4(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=r4(e,"onBeforeCreate",n),i=r4(e,"onCreate",n),o=r4(e,"onUpdate",n),s=r4(e,"onSelectionUpdate",n),l=r4(e,"onTransaction",n),a=r4(e,"onFocus",n),d=r4(e,"onBlur",n),c=r4(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),a&&this.editor.on("focus",a),d&&this.editor.on("blur",d),c&&this.editor.on("destroy",c)})}}class iv{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(r4(this,"addOptions",{name:this.name}))),this.storage=it(r4(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new iv(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>iu(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new iv({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=it(r4(t,"addOptions",{name:t.name})),t.storage=it(r4(t,"addStorage",{name:t.name,options:t.options})),t}}function iw(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:id(t[r])?t[r].test(e[r]):t[r]===e[r])}function ik(e,t,n={}){return e.find(e=>e.type===t&&iw(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function ix(e,t,n={}){return!!ik(e,t,n)}function iS(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some(e=>e.type===t)||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(e=>e.type===t)||(n=n||(null==(r=i.node.marks[0])?void 0:r.attrs),!ik([...i.node.marks],t,n)))return;let o=i.index,s=e.start()+i.offset,l=o+1,a=s+i.node.nodeSize;for(;o>0&&ix([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;l<e.parent.childCount&&ix([...e.parent.child(l).marks],t,n);)a+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function iM(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function iC(e){return e instanceof eV}function iT(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function iO(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function iA(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}iv.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new eY({key:new eZ("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),l=Math.max(...o.map(e=>e.$to.pos)),a=Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]));return function(e,t,n){let{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},l="";return e.nodesBetween(r,i,(e,n,a,d)=>{var c;e.isBlock&&n>r&&(l+=o);let h=null==s?void 0:s[e.type.name];if(h)return a&&(l+=h({node:e,pos:n,parent:a,index:d,range:t})),!1;e.isText&&(l+=null==(c=null==e?void 0:e.text)?void 0:c.slice(Math.max(r,n)-n,i-n))}),l}(r,{from:s,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{}
2,textSerializers:a})}}})]}});let iN=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&iN(r)}return e};function iE(e){let t=`<body>${e}</body>`;return iN(new window.DOMParser().parseFromString(t,"text/html").body)}function iD(e,t,r){if(e instanceof k||e instanceof n)return e;r={slice:!0,parseOptions:{},...r};let i="object"==typeof e&&null!==e,o="string"==typeof e;if(i)try{if(Array.isArray(e)&&e.length>0)return n.fromArray(e.map(e=>t.nodeFromJSON(e)));let i=t.nodeFromJSON(e);return r.errorOnInvalidContent&&i.check(),i}catch(n){if(r.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:n});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",n),iD("",t,r)}if(o){if(r.errorOnInvalidContent){let n=!1,i="",o=new B({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(n=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(r.slice?$.fromSchema(o).parseSlice(iE(e),r.parseOptions):$.fromSchema(o).parse(iE(e),r.parseOptions),r.errorOnInvalidContent&&n)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let n=$.fromSchema(t);return r.slice?n.parseSlice(iE(e),r.parseOptions).content:n.parse(iE(e),r.parseOptions)}return iD("",t,r)}function iR(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}function iI(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?r7(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);l.push({node:e,from:n,to:o})});let a=i-r,d=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>iw(e.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=a}function iL(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function iP(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function iB(e,t){let n=iM(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{s.push(...e.marks)});let l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function iz(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let 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 i$(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=iS(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function iH(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function iV(e,t){let{nodeExtensions:n}=r6(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=it(r4(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function iF(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}let ij=(e,t)=>{let n=iz(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&ev(e.doc,n.pos))||(e.join(n.pos),!0)},iW=(e,t)=>{let n=iz(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&ev(e.doc,r))||(e.join(r),!0)};var iK=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),l=o.blockRange(s);if(!l)return;let a=eu(l);
2if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(l.start,e)}(a||0===a)&&t.lift(l,a)})}),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>r_(e,t),cut:(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new eV(r.doc.resolve(Math.max(s-1,0)))),!0},deleteCurrentNode:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},deleteNode:e=>({tr:t,state:n,dispatch:r})=>{let i=r7(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>rD(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>rK(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=iM(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:d,to:c}=l;if(i){let e=iS(a,o,t);if(e&&e.from<=d&&e.to>=c){let t=eV.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(iA()||iO())&&r.dom.focus(),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!iA()&&!iO()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!iC(n.state.selection))return s(),!0;let l=function(e,t=null){if(!t)return null;let n=eB.atStart(e),r=eB.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?eV.create(e,iT(0,i,o),iT(e.content.size,i,o)):eV.create(e,iT(t,i,o),iT(t,i,o))}(i.doc,e)||n.state.selection,a=n.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,r)=>({tr:i,dispatch:o,editor:s})=>{var l;if(o){let o,a;r={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let d=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{iD(t,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){d(e)}try{o=iD(t,s.schema,{parseOptions:c,errorOnInvalidContent:null!=(l=r.errorOnInvalidContent)?l:s.options.enableContentCheck})}catch(e){return d(e),!1}let{from:h,to:p}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},u=!0,f=!0;if((!("type"in o)?o:[o]).forEach(e=>{e.check(),u=!!u&&e.isText&&0===e.marks.length,f=!!f&&e.isBlock}),h===p&&f){let{parent:e}=i.doc.resolve(h);!e.isTextblock||e.type.spec.code||e.childCount||(h-=1,p+=1)}if(u){if(Array.isArray(t))a=t.map(e=>e.text||"").join("");else if(t instanceof n){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),a=e}else a="object"==typeof t&&t&&t.text?t.text:t;i.insertText(a,h,p)}else a=o,i.replaceWith(h,p,a);r.updateSelection&&function(e,t){let n=e.steps.length-1;if(n<t)return;let r=e.steps[n];if(!(r instanceof ed||r instanceof ec))return;let i=e.mapping.maps[n],o=0;i.forEach((e,t,n,r)=>{0===o&&(o=r)}),e.setSelection(eB.near(e.doc.resolve(o),-1))}(i,i.steps.length-1),r.applyInputRules&&i.setMeta("applyInputRules",{from:h,text:a}),r.applyPasteRules&&i.setMeta("applyPasteRules",{from:h,text:a})}return!0},joinBackward:()=>({state:e,dispatch:t})=>rI(e,t),joinDown:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r;if(n instanceof ej){if(n.node.isTextblock||!ev(e.doc,n.to))return!1;r=n.to}else if(null==(r=ek(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0})(e,t),joinForward:()=>({state:e,dispatch:t})=>rH(e,t),joinItemBackward:()=>({state:e,dispatch:t,tr:n})=>{try{let r=ek(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},joinItemForward:()=>({state:e,dispatch:t,tr:n})=>{try{let r=ek(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},joinTextblockBackward:()=>({state:e,dispatch:t})=>((e,t)=>{let n=rR(e,void 0);if(!n)return!1;let r=rz(n);return!!r&&rL(e,r,t)})(e,t),joinTextblockForward:()=>({state:e,dispatch:t})=>((e,t)=>{let n=r$(e,void 0);if(!n)return!1;let r=rF(n);return!!r&&rL(e,r,t)})(e,t),joinUp:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r=n instanceof ej,i;if(r){if(n.node.isTextblock||!ev(e.doc,n.from))return!1;i=n.from}else if(null==(i=ek(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(ej.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))iA()||iR()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"
2===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},lift:(e,t={})=>({state:n,dispatch:r})=>{let i=r7(e,n.schema);return!!iI(n,i,t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&eu(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r)},liftEmptyBlock:()=>({state:e,dispatch:t})=>rq(e,t),liftListItem:e=>({state:t,dispatch:r})=>{var i;return(i=r7(e,t.schema),function(e,t){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,e=>e.childCount>0&&e.firstChild.type==i);return!!s&&(!t||(r.node(s.depth-1).type==i?function(e,t,r,i){let o=e.tr,s=i.end,l=i.$to.end(i.depth);s<l&&(o.step(new ec(s-1,l,s,l,new a(n.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new v(o.doc.resolve(i.$from.pos),o.doc.resolve(l),i.depth));let d=eu(i);if(null==d)return!1;o.lift(i,d);let c=o.doc.resolve(o.mapping.map(s,-1)-1);return ev(o.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&o.join(c.pos),t(o.scrollIntoView()),!0}(e,t,i,s):function(e,t,r){let i=e.tr,o=r.parent;for(let e=r.end,t=r.endIndex-1,n=r.startIndex;t>n;t--)e-=o.child(t).nodeSize,i.delete(e-1,e+1);let s=i.doc.resolve(r.start),l=s.nodeAfter;if(i.mapping.map(r.end)!=r.start+s.nodeAfter.nodeSize)return!1;let d=0==r.startIndex,c=r.endIndex==o.childCount,h=s.node(-1),p=s.index(-1);if(!h.canReplace(p+ +!d,p+1,l.content.append(c?n.empty:n.from(o))))return!1;let u=s.pos,f=u+l.nodeSize;return i.step(new ec(u-!!d,f+ +!!c,u+1,f-1,new a((d?n.empty:n.from(o.copy(n.empty))).append(c?n.empty:n.from(o.copy(n.empty))),+!d,+!c),+!d)),t(i.scrollIntoView()),!0}(e,t,s)))})(t,r)},newlineInCode:()=>({state:e,dispatch:t})=>rj(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=iL("string"==typeof e?e:e.name,r.schema);return!!l&&("node"===l&&(o=r7(e,r.schema)),"mark"===l&&(s=iM(e,r.schema)),i&&n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,iP(e.attrs,t)),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(iP(i.attrs,t)))})})}),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,dispatch:t})=>{if(t){let t=new eK(e.doc);e.setSelection(t)}return!0},selectNodeBackward:()=>({state:e,dispatch:t})=>rB(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>rV(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),t&&t(e.tr.setSelection(ej.create(e.doc,i))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>rY(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>rG(e,t),setContent:(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var a,d;let{doc:c}=o;if("full"!==n.preserveWhitespace){let l=function(e,t,n={},r={}){return iD(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}(e,i.schema,n,{errorOnInvalidContent:null!=(a=r.errorOnInvalidContent)?a:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,l).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:c.content.size},e,{parseOptions:n,errorOnInvalidContent:null!=(d=r.errorOnInvalidContent)?d:i.options.enableContentCheck})},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,a=iM(e,r.schema);if(i)if(s){let e=iB(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let s=Math.max(r,i),l=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){var r;let{selection:i}=t,o=null;
2if(iC(i)&&(o=i.$cursor),o){let t=null!=(r=e.storedMarks)?r:o.marks();return!!n.isInSet(t)||!t.some(e=>e.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,a)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=r7(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!rQ(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>rQ(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=iT(e,0,n.content.size),i=ej.create(n,r);t.setSelection(i)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=eV.atStart(n).from,s=eV.atEnd(n).to,l=iT(r,o,s),a=iT(i,o,s),d=eV.create(n,l,a);t.setSelection(d)}return!0},sinkListItem:e=>({state:t,dispatch:r})=>{var i;return(i=r7(e,t.schema),function(e,t){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,e=>e.childCount>0&&e.firstChild.type==i);if(!s)return!1;let l=s.startIndex;if(0==l)return!1;let d=s.parent,c=d.child(l-1);if(c.type!=i)return!1;if(t){let r=c.lastChild&&c.lastChild.type==d.type,o=n.from(r?i.create():null),l=new a(n.from(i.create(null,n.from(d.type.create(null,o)))),r?3:1,0),h=s.start,p=s.end;t(e.tr.step(new ec(h-(r?3:1),p,h,p,l,1,!0)).scrollIntoView())}return!0})(t,r)},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:l,$to:a}=o,d=iH(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(o instanceof ej&&o.node.isBlock)return!!l.parentOffset&&!!eb(s,l.pos)&&(r&&(e&&iF(n,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let c=a.parentOffset===a.parent.content.size,h=0===l.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1))),p=c&&h?[{type:h,attrs:d}]:void 0,u=eb(t.doc,t.mapping.map(l.pos),1,p);if(!p&&!u&&eb(t.doc,t.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(u=!0,p=h?[{type:h,attrs:d}]:void 0),r){if(u&&(o instanceof eV&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,p),h&&!c&&!l.parentOffset&&l.parent.type!==h)){let e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(l.before()),h)}e&&iF(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return u},splitListItem:(e,t={})=>({tr:r,state:i,dispatch:o,editor:s})=>{var l;let d=r7(e,i.schema),{$from:c,$to:h}=i.selection,p=i.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(h))return!1;let u=c.node(-1);if(u.type!==d)return!1;let f=s.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if(2===c.depth||c.node(-3).type!==d||c.index(-2)!==c.node(-2).childCount-1)return!1;if(o){let e=n.empty,i=c.index(-1)?1:c.index(-2)?2:3;for(let t=c.depth-i;t>=c.depth-3;t-=1)e=n.from(c.node(t).copy(e));let o=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,s={...iH(f,c.node().type.name,c.node().attrs),...t},h=(null==(l=d.contentMatch.defaultType)?void 0:l.createAndFill(s))||void 0;e=e.append(n.from(d.createAndFill(null,h)||void 0));let p=c.before(c.depth-(i-1));r.replace(p,c.after(-o),new a(e,4-i,0));let u=-1;r.doc.nodesBetween(p,r.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)}),u>-1&&r.setSelection(eV.near(r.doc.resolve(u))),r.scrollIntoView()}return!0}let m=h.pos===c.end()?u.contentMatchAt(0).defaultType:null,g={...iH(f,u.type.name,u.attrs),...t},y={...iH(f,c.node().type.name,c.node().attrs),...t};r.delete(c.pos,h.pos);let b=m?[{type:d,attrs:g},{type:m,attrs:y}]:[{type:d,attrs:g}];if(!eb(r.doc,c.pos,2))return!1;if(o){let{selection:e,storedMarks:t}=i,{splittableMarks:n}=s.extensionManager,l=t||e.$to.parentOffset&&e.$from.marks();if(r.split(c.pos,2,b).scrollIntoView(),!l||!o)return!0;let a=l.filter(e=>
2n.includes(e.type.name));r.ensureMarks(a)}return!0},toggleList:(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:d,can:c})=>{let{extensions:h,splittableMarks:p}=i.extensionManager,u=r7(e,s.schema),f=r7(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,v=y.blockRange(b),w=g||m.$to.parentOffset&&m.$from.marks();if(!v)return!1;let k=iz(e=>iV(e.type.name,h))(m);if(v.depth>=1&&k&&v.depth-k.depth<=1){if(k.node.type===u)return d.liftListItem(f);if(iV(k.node.type.name,h)&&u.validContent(k.node.content)&&l)return a().command(()=>(o.setNodeMarkup(k.pos,u),!0)).command(()=>ij(o,u)).command(()=>iW(o,u)).run()}return n&&w&&l?a().command(()=>{let e=c().wrapInList(u,r),t=w.filter(e=>p.includes(e.type.name));return o.ensureMarks(t),!!e||d.clearNodes()}).wrapInList(u,r).command(()=>ij(o,u)).command(()=>iW(o,u)).run():a().command(()=>!!c().wrapInList(u,r)||d.clearNodes()).wrapInList(u,r).command(()=>ij(o,u)).command(()=>iW(o,u)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=iM(e,r.schema);return!function(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?iM(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>iw(e.attrs,n,{strict:!1}));let s=0,l=[];
2if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:o})))})}),0===s)return!1;let a=l.filter(e=>!o||o.name===e.mark.type.name).filter(e=>iw(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),d=l.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+d:a)>=s}(r,s,t)?i.setMark(s,t):i.unsetMark(s,{extendEmptyMarkRange:o})},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{let o,s=r7(e,r.schema),l=r7(t,r.schema),a=iI(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),a)?i.setNode(l,o):i.setNode(s,{...o,...n})},toggleWrap:(e,t={})=>({state:n,commands:r})=>{let i=r7(e,n.schema);return iI(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;
2return!!r||(t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=iM(e,r.schema),{$from:d,empty:c,ranges:h}=l;if(!i)return!0;if(c&&s){let{from:e,to:t}=l,r=null==(o=d.marks().find(e=>e.type===a))?void 0:o.attrs,i=iS(d,a,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,a)}else h.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=iL("string"==typeof e?e:e.name,r.schema);return!!l&&("node"===l&&(o=r7(e,r.schema)),"mark"===l&&(s=iM(e,r.schema)),i&&n.selection.ranges.forEach(e=>{let i,l,a,d,c=e.$from.pos,h=e.$to.pos;n.selection.empty?r.doc.nodesBetween(c,h,(e,t)=>{o&&o===e.type&&(a=Math.max(t,c),d=Math.min(t+e.nodeSize,h),i=t,l=e)}):r.doc.nodesBetween(c,h,(e,r)=>{r<c&&o&&o===e.type&&(a=Math.max(r,c),d=Math.min(r+e.nodeSize,h),i=r,l=e),r>=c&&r<=h&&(o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type){let o=Math.max(r,c),l=Math.min(r+e.nodeSize,h);n.addMark(o,l,s.create({...i.attrs,...t}))}}))}),l&&(void 0!==i&&n.setNodeMarkup(i,void 0,{...l.attrs,...t}),s&&l.marks.length&&l.marks.forEach(e=>{s===e.type&&n.addMark(a,d,s.create({...e.attrs,...t}))}))}),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&ef(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}})(r7(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:r,dispatch:i})=>(function(e,t=null){return function(r,i){let{$from:o,$to:s}=r.selection,l=o.blockRange(s);if(!l)return!1;let d=i?r.tr:null;return!!function(e,t,r,i=null){let o=!1,s=t,l=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(r)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=l.resolve(t.start-2);s=new v(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new v(t.$from,l.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let d=ef(s,r,i,t);return!!d&&(e&&function(e,t,r,i,o){let s=n.empty;for(let e=r.length-1;e>=0;e--)s=n.from(r[e].type.create(r[e].attrs,s));e.step(new ec(t.start-2*!!i,t.end,t.start,t.end,new a(s,0,0),r.length,!0));let l=0;for(let e=0;e<r.length;e++)r[e].type==o&&(l=e+1);let d=r.length-l,c=t.start+r.length-2*!!i,h=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&eb(e.doc,c,d)&&(e.split(c,d),c+=2*d),c+=h.child(n).nodeSize}(e,t,d,o,r),!0)}(d,l,e,t)&&(i&&i(d.scrollIntoView()),!0)}})(r7(e,r.schema),t)(r,i)});iv.create({name:"commands",addCommands:()=>({...iK})}),iv.create({name:"drop",addProseMirrorPlugins(){return[new eY({key:new eZ("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),iv.create({name:"editable",addProseMirrorPlugins(){return[new eY({key:new eZ("editable"),props:{editable:()=>this.editor.options.editable}})]}});let i_=new eZ("focusEvents");function iq(e){return new ic({find:e.find,handler:({state:t,range:n,match:r})=>{let i=it(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],l=r[0];if(s){let r=l.search(/\S/),a=n.from+l.indexOf(s),d=a+s.length;if(i$(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;
2d<n.to&&o.delete(d,n.to),a>n.from&&o.delete(n.from+r,a);let c=n.from+r+s.length;o.addMark(n.from+r,c,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function iJ(e){return new ic({find:e.find,handler:({state:t,range:n,match:r})=>{let i=it(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,l=n.to,a=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>l?e=l:l=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,l,a)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function iU(e){return new ic({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=it(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function iG(e){return new ic({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=it(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&ef(l,e.type,o);if(!a)return null;if(s.wrap(l,a),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&ev(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&s.join(n.from-1)}})}iv.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new eY({key:i_,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),iv.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:l}=o,a=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,d=a.parent.type.spec.isolating,c=o.pos-o.parentOffset,h=d&&1===a.parent.childCount?c===o.pos:eB.atStart(r).from===s;return!!i&&!!l.type.isTextblock&&!l.textContent.length&&!!h&&(!h||"paragraph"!==o.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return iA()||iR()?i:r},addProseMirrorPlugins(){return[new eY({key:new eZ("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=t.selection,a=eB.atStart(t.doc).from,d=eB.atEnd(t.doc).to;if(o||s!==a||l!==d||!function e(t,{checkChildren:n=!0,ignoreWhitespace:r=!1}={}){var i;if(r){if("hardBreak"===t.type.name)return!0;if(t.isText)return/^\s*$/m.test(null!=(i=t.text)?i:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(n){let i=!0;return t.content.forEach(t=>{!1===i||e(t,{ignoreWhitespace:r,checkChildren:n})||(i=!1)}),i}return!1}(n.doc))return;let c=n.tr,h=r3({state:n,transaction:c}),{commands:p}=new r5({editor:this.editor,state:h});if(p.clearNodes(),c.steps.length)return c}})]}}),iv.create({name:"paste",addProseMirrorPlugins(){return[new eY({key:new eZ("tiptapPaste"),props:{handlePaste:(e,t,n
2)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),iv.create({name:"tabindex",addProseMirrorPlugins(){return[new eY({key:new eZ("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class iY{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(r4(this,"addOptions",{name:this.name}))),this.storage=it(r4(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new iY(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>iu(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new iY(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=it(r4(t,"addOptions",{name:t.name})),t.storage=it(r4(t,"addStorage",{name:t.name,options:t.options})),t}}function iQ(e){return new ig({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=it(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,l=r[r.length-1],a=r[0],d=n.to;if(l){let r=a.search(/\S/),i=n.from+a.indexOf(l),c=i+l.length;if(i$(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;c<n.to&&s.delete(c,n.to),i>n.from&&s.delete(n.from+r,i),d=n.from+r+l.length,s.addMark(n.from+r,d,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}let iX=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,iZ=iY.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",r8(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}
2,addInputRules(){return[iJ({find:iX,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),i0="numeric",i1="ascii",i2="alpha",i3="asciinumeric",i5="alphanumeric",i4="domain",i6="emoji",i9="whitespace";function i7(e,t,n){for(let r in t[i0]&&(t[i3]=!0,t[i5]=!0),t[i1]&&(t[i3]=!0,t[i2]=!0),t[i3]&&(t[i5]=!0),t[i2]&&(t[i5]=!0),t[i5]&&(t[i4]=!0),t[i6]&&(t[i4]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function i8(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}i8.groups={},i8.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){let i;return r=r||i8.groups,t&&t.j?i=t:(i=new i8(t),n&&r&&i7(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){if(r=r||i8.groups,t&&t.j)return this.j[e]=t,t;let i,o=this.go(e);return o?(Object.assign((i=new i8).j,o.j),i.jr.push.apply(i.jr,o.jr),i.jd=o.jd,i.t=o.t):i=new i8,t&&(r&&(i.t&&"string"==typeof i.t?i7(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&i7(t,n,r)),i.t=t),this.j[e]=i,i}};let oe=(e,t,n,r,i)=>e.ta(t,n,r,i),ot=(e,t,n,r,i)=>e.tr(t,n,r,i),on=(e,t,n,r,i)=>e.ts(t,n,r,i),or=(e,t,n,r,i)=>e.tt(t,n,r,i),oi="WORD",oo="UWORD",ol="ASCIINUMERICAL",oa="ALPHANUMERICAL",od="LOCALHOST",oc="UTLD",oh="SCHEME",op="SLASH_SCHEME",ou="OPENBRACE",of="CLOSEBRACE",om="OPENBRACKET",og="CLOSEBRACKET",oy="OPENPAREN",ob="CLOSEPAREN",ov="OPENANGLEBRACKET",ow="CLOSEANGLEBRACKET",ok="FULLWIDTHLEFTPAREN",ox="FULLWIDTHRIGHTPAREN",oS="LEFTCORNERBRACKET",oM="RIGHTCORNERBRACKET",oC="LEFTWHITECORNERBRACKET",oT="RIGHTWHITECORNERBRACKET",oO="FULLWIDTHLESSTHAN",oA="FULLWIDTHGREATERTHAN",oN="AMPERSAND",oE="APOSTROPHE",oD="ASTERISK",oR="BACKSLASH",oI="BACKTICK",oL="CARET",oP="COLON",oB="COMMA",oz="DOLLAR",o$="EQUALS",oH="EXCLAMATION",oV="HYPHEN",oF="PERCENT",oj="PIPE",oW="PLUS",oK="POUND",o_="QUERY",oq="QUOTE",oJ="FULLWIDTHMIDDLEDOT",oU="SEMI",oG="SLASH",oY="TILDE",oQ="UNDERSCORE",oX="EMOJI";var oZ=Object.freeze({__proto__:null,ALPHANUMERICAL:oa,AMPERSAND:oN,APOSTROPHE:oE,ASCIINUMERICAL:ol,ASTERISK:oD,AT:"AT",BACKSLASH:oR,BACKTICK:oI,CARET:oL,CLOSEANGLEBRACKET:ow,CLOSEBRACE:of,CLOSEBRACKET:og,CLOSEPAREN:ob,COLON:oP,COMMA:oB,DOLLAR:oz,DOT:"DOT",EMOJI:oX,EQUALS:o$,EXCLAMATION:oH,FULLWIDTHGREATERTHAN:oA,FULLWIDTHLEFTPAREN:ok,FULLWIDTHLESSTHAN:oO,FULLWIDTHMIDDLEDOT:oJ,FULLWIDTHRIGHTPAREN:ox,HYPHEN:oV,LEFTCORNERBRACKET:oS,LEFTWHITECORNERBRACKET:oC,LOCALHOST:od,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:ov,OPENBRACE:ou,OPENBRACKET:om,OPENPAREN:oy,PERCENT:oF,PIPE:oj,PLUS:oW,POUND:oK,QUERY:o_,QUOTE:oq,RIGHTCORNERBRACKET:oM,RIGHTWHITECORNERBRACKET:oT,SCHEME:oh,SEMI:oU,SLASH:oG,SLASH_SCHEME:op,SYM:"SYM",TILDE:oY,TLD:"TLD",UNDERSCORE:oQ,UTLD:oc,UWORD:oo,WORD:oi,WS:"WS"});let o0=/[a-z]/,o1=/\p{L}/u,o2=/\p{Emoji}/u,o3=/\d/,o5=/\s/,o4=null,o6=null;function o9(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let i,o=e.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let l=e,a=null,d=0,c=null,h=-1,p=-1;for(;s<r&&(a=l.go(n[s]));)(l=a).accepts()?(h=0,p=0,c=l):h>=0&&(h+=n[s].length,p++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=p,d-=h,i.push({t:c.t,v:t.slice(o-d,o),s:o-d,e:o})}return i}function o7(e,t,n,r,i){let o,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?o=e.j[s]:((o=new i8(r)).jr=i.slice(),e.j[s]=o),e=o}return(o=new i8(n)).jr=i.slice(),e.j[t[s-1]]=o,o}function o8(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;"0123456789".indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}let se={defaultProtocol:"http",events:null,format:sn,formatHref:sn,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function st(e,t=null){let n=Object.assign({},se);e&&(n=Object.assign(n,e instanceof st?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function sn(e){return e}function sr(e,t){this.t="token",this.v=e,this.tk=t}
2function si(e,t){class n extends sr{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}st.prototype={o:se,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,i=this.o[e];return i&&("object"==typeof i?"function"==typeof(i=n.t in i?i[n.t]:se[e])&&r&&(i=i(t,n)):"function"==typeof i&&r&&(i=i(t,n.t,n))),i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},sr.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"â¦":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=se.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),i=this.toFormattedString(e),o={},s=e.get("className",t,this),l=e.get("target",t,this),a=e.get("rel",t,this),d=e.getObj("attributes",t,this),c=e.getObj("events",t,this);return o.href=n,s&&(o.class=s),l&&(o.target=l),a&&(o.rel=a),d&&Object.assign(o,d),{tagName:r,attributes:o,content:i,eventListeners:c}}};let so=si("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ss=si("text"),sl=si("nl"),sa=si("url",{isLink:!0,toHref(e=se.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==od&&e[1].t===oP}}),sd=e=>new i8(e);function sc(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}let sh="u">typeof console&&console&&console.warn||(()=>{}),sp={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function su(e,t=!1){if(sp.initialized&&sh(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format. 31. Must only contain digits, lowercase ASCII letters or "-" 42. Cannot start or end with "-" 53. "-" cannot repeat`);sp.customSchemes.push([e,t])}function sf(e){return sp.initialized||function(){sp.scanner=function(e=[]){let t={};i8.groups=t;let n=new i8;null==o4&&(o4=o8("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
5ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==o6&&(o6=o8("ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
5ºÐ´2он1Ñква6онлайн5Ñг3ÑÑÑ2Ñ2ÑайÑ3Ñб3ÑкÑ3Òаз3Õ°Õ¡Õµ3×שר××5×§××3Ø§Ø¨ÙØ¸Ø¨Ù5راÙ
ÙÙ5ÙØ§Ø±Ø¯Ù4Ø¨ØØ±ÙÙ5جزائر5Ø³Ø¹ÙØ¯ÙØ©6عÙÙØ§Ù5Ù
غرب5Ù
ارات5ÛØ±Ø§Ù5بارت2زار4ÙØªÙ3ھارت5تÙÙØ³4Ø³ÙØ¯Ø§Ù3Ø±ÙØ©5Ø´Ø¨ÙØ©4عراÙ2ب2Ù
اÙ4ÙÙØ³Ø·ÙÙ6ÙØ·Ø±3ÙØ§Ø«ÙÙÙÙ6ÙÙ
3Ù
صر2ÙÙØ³Ùا5ÙØ±ÙتاÙÙØ§7ÙØ¹4ÙÙ
راÙ5پاکستاÙ7ÚØ§Ø±Øª4à¤à¥à¤®3नà¥à¤3à¤à¤¾à¤°à¤¤0मà¥3à¥à¤¤5सà¤à¤à¤ न5বাà¦à¦²à¦¾5à¦à¦¾à¦°à¦¤2ৰত4à¨à¨¾à¨°à¨¤4àªàª¾àª°àª¤4à¬à¬¾à¬°à¬¤4à®à®¨à¯à®¤à®¿à®¯à®¾6லà®à¯à®à¯6à®à®¿à®à¯à®à®ªà¯à®ªà¯à®°à¯11à°à°¾à°°à°¤à±5à²à²¾à²°à²¤4à´à´¾à´°à´¤à´5à¶½à¶à¶à·4à¸à¸à¸¡3à¹à¸à¸¢3ລາວ3áá2ã¿ããª3ã¢ãã¾ã³4ã¯ã©ã¦ã4ã°ã¼ã°ã«4ã³ã 2ã¹ãã¢3ã»ã¼ã«3ãã¡ãã·ã§ã³6ãã¤ã³ã4ä¸ç2ä¸ä¿¡1å½1å1æç½3äºé©¬é3ä¼ä¸2ä½å±±2ä¿¡æ¯2å¥åº·2å
«å¦2å
¬å¸1ç2å°æ¹¾1ç£2åå1åº1æ 2åé0大é
åº5å¨çº¿2大æ¿2天主æ3娱ä¹2å®¶é»2广ä¸2å¾®å2æ
å2æç±ä½ 3ææº2æè2æ¿å¡1åº2æ°å å¡2é»2æ¶å°2æ¸ç±2æºæ2淡马é¡3游æ2æ¾³é2ç¹ç2ç§»å¨2ç»ç»æºæ4ç½å1åº1ç«1ç»2èé2è°·æ2è´ç©2é販2éå¢2é»è¨çç§4é£å©æµ¦3é£å2é¤å
2馿 ¼éæ3港2ë·ë·1ì»´2ì¼ì±2íêµ2")),or(n,"'",oE),or(n,"{",ou),or(n,"}",of),or(n,"[",om),or(n,"]",og),or(n,"(",oy),or(n,")",ob),or(n,"<",ov),or(n,">",ow),or(n,"ï¼",ok),or(n,"ï¼",ox),or(n,"ã",oS),or(n,"ã",oM),or(n,"ã",oC),or(n,"ã",oT),or(n,"ï¼",oO),or(n,"ï¼",oA),or(n,"&",oN),or(n,"*",oD),or(n,"@","AT"),or(n,"`",oI),or(n,"^",oL),or(n,":",oP),or(n,",",oB),or(n,"$",oz),or(n,".","DOT"),or(n,"=",o$),or(n,"!",oH),or(n,"-",oV),or(n,"%",oF),or(n,"|",oj),or(n,"+",oW),or(n,"#",oK),or(n,"?",o_),or(n,'"',oq),or(n,"/",oG),or(n,";",oU),or(n,"~",oY),or(n,"_",oQ),or(n,"\\",oR),or(n,"ã»",oJ);let r=ot(n,o3,"NUM",{[i0]:!0});ot(r,o3,r);let i=ot(r,o0,ol,{[i3]:!0}),o=ot(r,o1,oa,{[i5]:!0}),s=ot(n,o0,oi,{[i1]:!0});ot(s,o3,i),ot(s,o0,s),ot(i,o3,i),ot(i,o0,i);let l=ot(n,o1,oo,{[i2]:!0});ot(l,o0),ot(l,o3,o),ot(l,o1,l),ot(o,o3,o),ot(o,o0),ot(o,o1,o);let a=or(n,"\n","NL",{[i9]:!0}),d=or(n,"\r","WS",{[i9]:!0}),c=ot(n,o5,"WS",{[i9]:!0});or(n,"",c),or(d,"\n",a),or(d,"",c),ot(d,o5,c),or(c,"\r"),or(c,"\n"),ot(c,o5,c),or(c,"",c);let h=ot(n,o2,oX,{[i6]:!0});or(h,"#"),ot(h,o2,h),or(h,"ï¸",h);let p=or(h,"â");or(p,"#"),ot(p,o2,h);let u=[[o0,s],[o3,i]],f=[[o0,null],[o1,l],[o3,o]];for(let e=0;e<o4.length;e++)o7(n,o4[e],"TLD",oi,u);for(let e=0;e<o6.length;e++)o7(n,o6[e],oc,oo,f);i7("TLD",{tld:!0,ascii:!0},t),i7(oc,{utld:!0,alpha:!0},t),o7(n,"file",oh,oi,u),o7(n,"mailto",oh,oi,u),o7(n,"http",op,oi,u),o7(n,"https",op,oi,u),o7(n,"ftp",op,oi,u),o7(n,"ftps",op,oi,u),i7(oh,{scheme:!0,ascii:!0},t),i7(op,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?i[i4]=!0:o0.test(r)?o3.test(r)?i[i3]=!0:i[i1]=!0:i[i0]=!0,on(n,r,r,i)}return on(n,"localhost",od,{ascii:!0}),n.jd=new i8("SYM"),{start:n,tokens:Object.assign({groups:t},oZ)}}(sp.customSchemes);for(let e=0;e<sp.tokenQueue.length;e++)sp.tokenQueue[e][1]({scanner:sp.scanner});sp.parser=function({groups:e}){let t=e.domain.concat([oN,oD,"AT",oR,oI,oL,oz,o$,oV,"NUM",oF,oj,oW,oK,oG,"SYM",oY,oQ]),n=[oE,oP,oB,"DOT",oH,oF,o_,oq,oU,ov,ow,ou,of,og,om,oy,ob,ok,ox,oS,oM,oC,oT,oO,oA],r=[oN,oE,oD,oR,oI,oL,oz,o$,oV,ou,of,oF,oj,oW,oK,o_,oG,"SYM",oY,oQ],i=sd(),o=or(i,oY);oe(o,r,o),oe(o,e.domain,o);let s=sd(),l=sd(),a=sd();oe(i,e.domain,s),oe(i,e.scheme,l),oe(i,e.slashscheme,a),oe(s,r,o),oe(s,e.domain,s);let d=or(s,"AT");or(o,"AT",d),or(l,"AT",d),or(a,"AT",d);
5let c=or(o,"DOT");oe(c,r,o),oe(c,e.domain,o);let h=sd();oe(d,e.domain,h),oe(h,e.domain,h);let p=or(h,"DOT");oe(p,e.domain,h);let u=sd(so);oe(p,e.tld,u),oe(p,e.utld,u),or(d,od,u);let f=or(h,oV);or(f,oV,f),oe(f,e.domain,h),oe(u,e.domain,h),or(u,"DOT",p),or(u,oV,f),oe(or(u,oP),e.numeric,so);let m=or(s,oV),g=or(s,"DOT");or(m,oV,m),oe(m,e.domain,s),oe(g,r,o),oe(g,e.domain,s);let y=sd(sa);oe(g,e.tld,y),oe(g,e.utld,y),oe(y,e.domain,s),oe(y,r,o),or(y,"DOT",g),or(y,oV,m),or(y,"AT",d);let b=or(y,oP),v=sd(sa);oe(b,e.numeric,v);let w=sd(sa),k=sd();oe(w,t,w),oe(w,n,k),oe(k,t,w),oe(k,n,k),or(y,oG,w),or(v,oG,w);let x=or(l,oP),S=or(a,oP),M=or(S,oG),C=or(M,oG);oe(l,e.domain,s),or(l,"DOT",g),or(l,oV,m),oe(a,e.domain,s),or(a,"DOT",g),or(a,oV,m),oe(x,e.domain,w),or(x,oG,w),or(x,o_,w),oe(C,e.domain,w),oe(C,t,w),or(C,oG,w);let T=[[ou,of],[om,og],[oy,ob],[ov,ow],[ok,ox],[oS,oM],[oC,oT],[oO,oA]];for(let e=0;e<T.length;e++){let[r,i]=T[e],o=or(w,r);or(k,r,o),or(o,i,w);let s=sd(sa);oe(o,t,s);let l=sd();oe(o,n),oe(s,t,s),oe(s,n,l),oe(l,t,s),oe(l,n,l),or(s,i,w),or(l,i,w)}return or(i,od,y),or(i,"NL",sl),{start:i,tokens:oZ}}(sp.scanner.tokens);for(let e=0;e<sp.pluginQueue.length;e++)sp.pluginQueue[e][1]({scanner:sp.scanner,parser:sp.parser});sp.initialized=!0}(),function(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=e,a=null,d=null,c=0,h=null,p=-1;for(;i<r&&!(a=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(d=a||l.go(n[i].t));)a=null,(l=d).accepts()?(p=0,h=l):p>=0&&p++,i++,c++;if(p<0)(i-=c)<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(sc(ss,t,s)),s=[]),i-=p,c-=p;let e=h.t,r=n.slice(i-c,i);o.push(sc(e,t,r))}}return s.length>0&&o.push(sc(ss,t,s)),o}(sp.parser.start,e,o9(sp.scanner.start,e))}function sm(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new st(n),i=sf(e),o=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&o.push(n.toFormattedObject(r))}return o}sf.scan=o9;let sg="[\0- Â áá â-\u2029âã]",sy=new RegExp(sg),sb=RegExp(`${sg}$`),sv=RegExp(sg,"g");function sw(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(sv,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}let sk=im.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"==typeof e?su(e):su(e.scheme,e.optionalSlashes)})},onDestroy(){i8.groups={},sp.scanner=null,sp.parser=null,sp.tokenQueue=[],sp.pluginQueue=[],sp.customSchemes=[],sp.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!sw(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!sw(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!sw(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",r8(this.options.HTMLAttributes,e),0]:["a",r8(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!sw(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!sw(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}
5,addPasteRules(){return[iQ({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=sm(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!sw(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>t.push({text:e.value,data:{href:e.href},index:e.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let r=[],{protocols:i,defaultProtocol:o}=this.options;return this.options.autolink&&r.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!sw(e,i),protocols:i,defaultProtocol:o}),shouldAutoLink:this.options.shouldAutoLink},new eY({key:new eZ("autolink"),appendTransaction:(t,n,r)=>{var i,o;let s,l=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta("preventAutolink"));if(!l||a)return;let{tr:d}=r;if((function(e){let t,{mapping:n,steps:r}=e,i=[];return n.maps.forEach((e,t)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:n}=r[t];if(void 0===e||void 0===n)return;o.push({from:e,to:n})}o.forEach(({from:e,to:r})=>{let o=n.slice(t).map(e,-1),s=n.slice(t).map(r),l=n.invert().map(o,-1),a=n.invert().map(s);i.push({oldRange:{from:l,to:a},newRange:{from:o,to:s}})})}),1===(t=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(i)).length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))})((i=n.doc,o=[...t],s=new eL(i),o.forEach(e=>{e.steps.forEach(e=>{s.step(e)})}),s)).forEach(({newRange:t})=>{var n,i;let o,s,l,a=(n=r.doc,i=e=>e.isTextblock,l=[],n.nodesBetween(t.from,t.to,(e,t)=>{i(e)&&l.push({node:e,pos:t})}),l);if(a.length>1)o=a[0],s=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(a.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!sb.test(e))return;o=a[0],s=r.doc.textBetween(o.pos,t.to,void 0," ")}if(o&&s){let t=s.split(sy).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],i=o.pos+s.lastIndexOf(n);if(!n)return!1;let l=sf(n).map(t=>t.toObject(e.defaultProtocol));if(!(1===l.length?l[0].isLink:3===l.length&&!!l[1].isLink&&["()","[]"].includes(l[0].value+l[2].value)))return!1;l.filter(e=>e.isLink).map(e=>({...e,from:i+e.start+1,to:i+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{i$(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||d.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),d.steps.length)return d}}))),!0===this.options.openOnClick&&r.push((t={type:this.type},new eY({key:new eZ("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o,s,l;let a;if(0!==r.button||!e.editable)return!1;let d=r.target,c=[];for(;"DIV"!==d.nodeName;)c.push(d),d=d.parentNode;if(!c.find(e=>"A"===e.nodeName))return!1;let h=(s=e.state,"node"===(a=iL("string"==typeof(l=t.type.name)?l:l.name,s.schema))?function(e,t){let n=r7(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,e=>{o.push(e)});let s=o.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(s,l):"mark"===a?iB(s,l):{}),p=r.target,u=null!=(i=null==p?void 0:p.href)?i:h.href,f=null!=(o=null==p?void 0:p.target)?o:h.target;return!!p&&!!u&&(window.open(u,f),!0)}}}))),this.options.linkOnPaste&&r.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type},new eY({key:new eZ("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(e=>{l+=e.textContent});let a=sm(l,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!!l&&!!a&&n.editor.commands.setMark(n.type,{href:a.href})}}}))),r}});function sx(e){var t;let{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:l}=e,a=r&&!i,d=n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),c=RegExp(`\\s${d}$`),h=s?"^":"",p=i?"":d,u=a?RegExp(`${h}${d}.*?(?=\\s${p}|$)`,"gm"):RegExp(`${h}(?:^)?${d}[^\\s${p}]*`,"gm"),f=(null==(t=l.nodeBefore)?void 0:t.isText)&&l.nodeBefore.text;if(!f)return null;let m=l.pos-f.length,g=Array.from(f.matchAll(u)).pop();if(!g||void 0===g.input||void 0===g.index)return null;
5let y=g.input.slice(Math.max(0,g.index-1),g.index),b=RegExp(`^[${null==o?void 0:o.join("")}\0]?$`).test(y);if(null!==o&&!b)return null;let v=m+g.index,w=v+g[0].length;return(a&&c.test(f.slice(w-1,w+1))&&(g[0]+=" ",w+=1),v<l.pos&&w>=l.pos)?{range:{from:v,to:w},query:g[0].slice(n.length),text:g[0]}:null}let sS=new eZ("suggestion");function sM({pluginKey:e=sS,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:d="",decorationEmptyClass:c="is-empty",command:h=()=>null,items:p=()=>[],render:u=()=>({}),allow:f=()=>!0,findSuggestionMatch:m=sx}){let g,y=null==u?void 0:u(),b=new eY({key:e,view(){return{update:async(e,n)=>{var r,i,o,s,l,a,d;let c=null==(r=this.key)?void 0:r.getState(n),u=null==(i=this.key)?void 0:i.getState(e.state),f=c.active&&u.active&&c.range.from!==u.range.from,m=!c.active&&u.active,b=c.active&&!u.active,v=!m&&!b&&c.query!==u.query,w=m||f&&v,k=v||f,x=b||f&&v;if(!w&&!k&&!x)return;let S=x&&!w?c:u,M=e.dom.querySelector(`[data-decoration-id="${S.decorationId}"]`);g={editor:t,range:S.range,query:S.query,text:S.text,items:[],command:e=>h({editor:t,range:S.range,props:e}),decorationNode:M,clientRect:M?()=>{var n;let{decorationId:r}=null==(n=this.key)?void 0:n.getState(t.state),i=e.dom.querySelector(`[data-decoration-id="${r}"]`);return(null==i?void 0:i.getBoundingClientRect())||null}:null},w&&(null==(o=null==y?void 0:y.onBeforeStart)||o.call(y,g)),k&&(null==(s=null==y?void 0:y.onBeforeUpdate)||s.call(y,g)),(k||w)&&(g.items=await p({editor:t,query:S.query})),x&&(null==(l=null==y?void 0:y.onExit)||l.call(y,g)),k&&(null==(a=null==y?void 0:y.onUpdate)||a.call(y,g)),w&&(null==(d=null==y?void 0:y.onStart)||d.call(y,g))},destroy:()=>{var e;g&&(null==(e=null==y?void 0:y.onExit)||e.call(y,g))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,l,a,d){let{isEditable:c}=t,{composing:h}=t.view,{selection:p}=e,{empty:u,from:g}=p,y={...l};if(y.composing=h,c&&(u||t.view.composing)){(g<l.range.from||g>l.range.to)&&!h&&!l.composing&&(y.active=!1);let e=m({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:p.$from}),a=`id_${Math.floor(0xffffffff*Math.random())}`;e&&f({editor:t,state:d,range:e.range,isActive:l.active})?(y.active=!0,y.decorationId=l.decorationId?l.decorationId:a,y.range=e.range,y.query=e.query,y.text=e.text):y.active=!1}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(e,t){var n;let{active:r,range:i}=b.getState(e.state);return!!r&&((null==(n=null==y?void 0:y.onKeyDown)?void 0:n.call(y,{view:e,event:t,range:i}))||!1)},decorations(e){let{active:t,range:n,decorationId:r,query:i}=b.getState(e);if(!t)return null;let o=!(null==i?void 0:i.length),s=[a];return o&&s.push(c),n3.create(e.doc,[n0.inline(n.from,n.to,{nodeName:l,class:s.join(" "),"data-decoration-id":r,"data-decoration-content":d})])}}});return b}function sC(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>(function({editor:e,overrideSuggestionOptions:t,extensionName:n,char:r="@"}){return{editor:e,char:r,pluginKey:new eZ,command:({editor:e,range:t,props:i})=>{var o,s,l;let a=e.view.state.selection.$to.nodeAfter;(null==(o=null==a?void 0:a.text)?void 0:o.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:n,attrs:{...i,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),null==(l=null==(s=e.view.dom.ownerDocument.defaultView)?void 0:s.getSelection())||l.collapseToEnd()},allow:({state:e,range:t})=>{let r=e.doc.resolve(t.from),i=e.schema.nodes[n];return!!r.parent.type.contentMatch.matchType(i)},...t}})({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function sT(e,t){let n=sC(e),r=n.find(e=>e.char===t);return r||(n.length?n[0]:null)}let sO=iY.create({name:"mention",priority:101,addOptions:()=>({HTMLAttributes:{},renderText({node:e,suggestion:t}){var n,r;return`${null!=(n=null==t?void 0:t.char)?n:"@"}${null!=(r=e.attrs.label)?r:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:n}){var r,i;return["span",r8(this.HTMLAttributes,e.HTMLAttributes),`${null!=(r=null==n?void 0:n.char)?r:"@"}${null!=(i=t.attrs.label)?i:t.attrs.id}`]},suggestions:[],suggestion:{}}),group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:e=>e.getAttribute("data-mention-suggestion-char"),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}),parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=sT(this,e.attrs.mentionSuggestionChar);if(void 0!==this.options.renderLabel)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",r8({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:n})];let r={...this.options};r.HTMLAttributes=r8({"data-type":this.name},this.options.HTMLAttributes,t);let i=this.options.renderHTML({options:r,node:e,suggestion:n});return"string"==typeof i?["span",r8({"data-type":this.name},this.options.HTMLAttributes,t),i]:i},renderText({node:e}){let t={options:this.options,node:e,suggestion:sT(this,e.attrs.mentionSuggestionChar)};return void 0!==this.options.renderLabel?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(t)):this.options.renderText(t)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1,{selection:r}=t,{empty:i,anchor:o}=r;if(!i)return!1;t.doc.nodesBetween(o-1,o,(t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",r,r+t.nodeSize),!1});let s=new k,l=0;return t.doc.nodesBetween(o-1,o,(e,t)=>
5{if(e.type.name===this.name)return n=!0,s=e,l=t,!1}),n&&e.insertText(this.options.deleteTriggerWithBackspace?"":s.attrs.mentionSuggestionChar,l,l+s.nodeSize),n})}},addProseMirrorPlugins(){return sC(this).map(sM)}}),sA=im.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),sN=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,sE=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,sD=iY.create({name:"youtube",addOptions:()=>({addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640,rel:1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML:()=>[{tag:"div[data-youtube-video] iframe"}],addCommands(){return{setYoutubeVideo:e=>({commands:t})=>!!e.src.match(sN)&&t.insertContent({type:this.name,attrs:e})}},addPasteRules(){var e;return this.options.addPasteHandler?[new ig({find:(e={find:sE,type:this.t
5ype,getAttributes:e=>({src:e.input})}).find,handler({match:t,chain:n,range:r,pasteEvent:i}){let o=it(e.getAttributes,void 0,t,i),s=it(e.getContent,void 0,o);if(!1===o||null===o)return null;let l={type:e.type.name,attrs:o};s&&(l.content=s),t.input&&n().deleteRange(r).insertContentAt(r.from,l)}})]:[]},renderHTML({HTMLAttributes:e}){let t=(e=>{var t;let{url:n,allowFullscreen:r,autoplay:i,ccLanguage:o,ccLoadPolicy:s,controls:l,disableKBcontrols:a,enableIFrameApi:d,endTime:c,interfaceLanguage:h,ivLoadPolicy:p,loop:u,modestBranding:f,nocookie:m,origin:g,playlist:y,progressBarColor:b,startAt:v,rel:w}=e;if(!n.match(sN))return null;if(n.includes("/embed/"))return n;let k=new URL(n),{id:x,isPlaylist:S}=null!=(t=k.searchParams.has("v")?{id:k.searchParams.get("v")}:"youtu.be"===k.hostname||k.pathname.includes("shorts")||k.pathname.includes("live")?{id:k.pathname.split("/").pop()}:k.searchParams.has("list")?{id:k.searchParams.get("list"),isPlaylist:!0}:null)?t:{};if(!x)return null;let M=new URL(`${S?"https://www.youtube-nocookie.com/embed/videoseries?list=":m?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/"}${x}`);return k.searchParams.has("t")&&M.searchParams.set("start",k.searchParams.get("t").replaceAll("s","")),!1===r&&M.searchParams.set("fs","0"),i&&M.searchParams.set("autoplay","1"),o&&M.searchParams.set("cc_lang_pref",o),s&&M.searchParams.set("cc_load_policy","1"),l||M.searchParams.set("controls","0"),a&&M.searchParams.set("disablekb","1"),d&&M.searchParams.set("enablejsapi","1"),c&&M.searchParams.set("end",c.toString()),h&&M.searchParams.set("hl",h),p&&M.searchParams.set("iv_load_policy",p.toString()),u&&M.searchParams.set("loop","1"),f&&M.searchParams.set("modestbranding","1"),g&&M.searchParams.set("origin",g),y&&M.searchParams.set("playlist",y),v&&M.searchParams.set("start",v.toString()),b&&M.searchParams.set("color",b),void 0!==w&&M.searchParams.set("rel",w.toString()),M.toString()})({url:e.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:e.start||0,rel:this.options.rel});return e.src=t,["div",{"data-youtube-video":""},["iframe",r8(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,rel:this.options.rel},e)]]}}),sR=/^\s*>\s$/,sI=iY.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}}
vendor: 2,677 bytes, line 5
5,addInputRules(){return[iG({find:sR,type:this.type})]}}),sL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,sP=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,sB=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,sz=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,s$=im.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[iq({find:sL,type:this.type}),iq({find:sB,type:this.type})]},addPasteRules(){return[iQ({find:sP,type:this.type}),iQ({find:sz,type:this.type})]}}),sH="textStyle",sV=/^\s*([-+*])\s$/,sF=iY.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(sH)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=iG({find:sV,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=iG({find:sV,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(sH),editor:this.editor})),[e]}}),sj=/(^|[^`])`([^`]+)`(?!`)/,sW=/(^|[^`])`([^`]+)`(?!`)/g,sK=im.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}}
5,addInputRules(){return[iq({find:sj,type:this.type})]},addPasteRules(){return[iQ({find:sW,type:this.type})]}}),s_=/^```([a-z]+)?[\s\n]$/,sq=/^~~~([a-z]+)?[\s\n]$/,sJ=iY.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options,r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",r8(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!o&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(eB.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[iU({find:s_,type:this.type,getAttributes:e=>({language:e[1]})}),iU({find:sq,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new eY({key:new eZ("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>
5{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:s,schema:l}=e.state,a=l.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(eV.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),sU=iY.create({name:"doc",topNode:!0,content:"block+"});class sG{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0: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,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,o=this.editorView.dom,s=o.getBoundingClientRect(),l=s.width/o.offsetWidth,a=s.height/o.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=e?r.bottom:r.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*a;i={left:r.left,right:r.right,top:o-s,bottom:o+s}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*l;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let d=this.editorView.dom.offsetParent;if(!this.element&&(this.element=d.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),d&&(d!=document.body||"static"!=getComputedStyle(d).position)){let n=d.getBoundingClientRect(),r=n.width/d.offsetWidth,i=n.height/d.offsetHeight;e=n.left-d.scrollLeft*r,t=n.top-d.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/l+"px",this.element.style.top=(i.top-t)/a+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/a+"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){let t=ex(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}let sY=iv.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new eY({view:t=>new sG(t,e)})}(this.options)]}});class sQ extends eB{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return sQ.valid(n)?new sQ(n):eB.near(n)}content(){return a.empty}eq(e){return e instanceof sQ&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new sQ(e.resolve(t.pos))}getBookmark(){return new sX(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||sZ(e.type))return!0;
vendor: 2,862 bytes, line 5
5if(e.inlineContent)return!1}}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){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||sZ(e.type))return!0;if(e.inlineContent)return!1}}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){r:for(;;){if(!n&&sQ.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(sQ.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!ej.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue r}break}i=o,r+=t;let s=e.doc.resolve(r);if(sQ.valid(s))return s}return null}}}sQ.prototype.visible=!1,sQ.findFrom=sQ.findGapCursorFrom,eB.jsonID("gapcursor",sQ);class sX{constructor(e){this.pos=e}map(e){return new sX(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return sQ.valid(t)?new sQ(t):eB.near(t)}}function sZ(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let s0=rE({ArrowLeft:s1("horiz",-1),ArrowRight:s1("horiz",1),ArrowUp:s1("vert",-1),ArrowDown:s1("vert",1)});function s1(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,l=o.empty;if(o instanceof eV){if(!i.endOfTextblock(n)||0==s.depth)return!1;l=!1,s=e.doc.resolve(t>0?s.after():s.before())}let a=sQ.findGapCursorFrom(s,t,l);return!!a&&(r&&r(e.tr.setSelection(new sQ(a))),!0)}}function s2(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!sQ.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&ej.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new sQ(r))),!0)}function s3(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof sQ))return!1;let{$from:r}=e.state.selection,i=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!i)return!1;let o=n.empty;for(let e=i.length-1;e>=0;e--)o=n.from(i[e].createAndFill(null,o));let s=e.state.tr.replace(r.pos,r.pos,new a(o,0,0));return s.setSelection(eV.near(s.doc.resolve(r.pos+1))),e.dispatch(s),!1}function s5(e){if(!(e.selection instanceof sQ))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",n3.create(e.doc,[n0.widget(e.selection.head,t,{key:"gapcursor"})])}let s4=iv.create({name:"gapCursor",addProseMirrorPlugins:()=>[new eY({props:{decorations:s5,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&sQ.valid(n)?new sQ(n):null,handleClick:s2,handleKeyDown:s0,handleDOMEvents:{beforeinput
5:s3}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=it(r4(e,"allowGapCursor",n)))?t:null}}}),s6=iY.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",r8(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,l=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&o){let t=l.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),s9=iY.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,r8(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,...{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}}),{})},addInputRules(){return this.options.levels.map(e=>iU({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
5)\\s$`),type:this.type,getAttributes:{level:e}}))}});var s7=function(){};s7.prototype.append=function(e){return e.length?(e=s7.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},s7.prototype.prepend=function(e){return e.length?s7.from(e).append(this):this},s7.prototype.appendInner=function(e){return new le(this,e)},s7.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?s7.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},s7.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},s7.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)},s7.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},s7.from=function(e){return e instanceof s7?e:e&&e.length?new s8(e):s7.empty};var s8=function(e){function t(t){e.call(this),this.values=t}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}(s7);s7.empty=new s8([]);var le=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 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;if(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))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(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))return!1},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}(s7);class lt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let l=e.tr,a=[],d=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,d.push(e);return}if(n){d.push(new ln(e.map));let t=e.step.map(n.slice(r)),i;t&&l.maybeStep(t).doc&&(i=l.mapping.maps[l.mapping.maps.length-1],a.push(new ln(i,void 0,void 0,a.length+d.length))),r--,i&&n.appendMap(i,r)}else l.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new lt(this.items.slice(0,s).append(d.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:l,selection:i}}addTransform(e,t,n,r){var i,o;let s,l=[],a=this.eventCount,d=this.items,c=!r&&d.length?d.get(d.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new ln(e.mapping.maps[n],i,t),s;(s=c&&c.merge(o))&&(o=s,n?l.pop():d=d.slice(0,d.length-1)),l.push(o),t&&(a++,t=void 0),r||(c=o)}let h=a-n.depth;return h>
5li&&(i=d,o=h,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1}),d=i.slice(s),a-=h),new lt(d.append(l),a)}remapping(e,t){let n=new ee;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 lt(this.items.append(e.map(e=>new ln(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]),d=t.selection&&t.selection.map(i.slice(l+1,r));d&&s++,n.push(new ln(a,o,d))}else n.push(new ln(a))},r);let a=[];for(let e=t;e<o;e++)a.push(new ln(i.maps[e]));let d=new lt(this.items.slice(0,r).append(a).append(n),s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}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=new ln(s.invert(),e,l),d,c=r.length-1;(d=r.length&&r[c].merge(a))?r[c]=d:r.push(a)}}else o.map&&n--},this.items.length,0),new lt(s7.from(r.reverse()),i)}}lt.empty=new lt(s7.empty,0);class ln{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 ln(t.getMap().invert(),t,this.selection)}}}class lr{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let li=20;function lo(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function ls(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}let ll=!1,la=null;function ld(e){let t=e.plugins;if(la!=t){ll=!1,la=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){ll=!0;break}}return ll}let lc=new eZ("history"),lh=new eZ("closeHistory");function lp(e,t){return(n,r)=>{let i=lc.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=ld(t),i=lc.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),a=new lr(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(lc,{redo:n,historyState:a})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let lu=lp(!1,!0),lf=lp(!0,!0);lp(!1,!1),lp(!0,!1);let lm=iv.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>lu(e,t),redo:()=>({state:e,dispatch:t})=>lf(e,t)}),addProseMirrorPlugins(){return[function(e={}){return new eY({key:lc,state:{init:()=>new lr(lt.empty,lt.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(lc),o;if(i)return i.historyState;n.getMeta(lh)&&(e=new lr(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(lc))if(s.getMeta(lc).redo)return new lr(e.done.addTransform(n,void 0,r,ld(t)),e.undone,lo(n.mapping.maps),e.prevTime,e.prevComposition);else return new lr(e.done,e.undone.addTransform(n,void 0,r,ld(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new lr(e.done.rebased(n,o),e.undone.rebased(n,o),ls(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new lr(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),ls(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;
5return 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)),l=s?ls(e.prevRanges,n.mapping):lo(n.mapping.maps);return new lr(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,ld(t)),lt.empty,l,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?lu:"historyRedo"==n?lf:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),lg=iY.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",r8(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof ej){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$from:r,$to:i}=n,o=e();return 0===r.parentOffset?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):n instanceof ej?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:e,dispatch:t})=>{var n;if(t){let{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(eV.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(ej.create(e.doc,t.pos)):e.setSelection(eV.create(e.doc,t.pos));else{let i=null==(n=t.parent.type.contentMatch.defaultType)?void 0:n.create();i&&(e.insert(r,i),e.setSelection(eV.create(e.doc,r+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){return[iJ({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
vendor: 2,475 bytes, line 5
5ype})]}}),ly=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,lb=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,lv=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,lw=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,lk=im.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[iq({find:ly,type:this.type}),iq({find:lv,type:this.type})]},addPasteRules(){return[iQ({find:lb,type:this.type}),iQ({find:lw,type:this.type})]}}),lx=iY.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",r8(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),lS="textStyle",lM=/^(\d+)\.\s$/,lC=iY.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",r8(this.options.HTMLAttributes,n),0]:["ol",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(lS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}
5,addInputRules(){let e=iG({find:lM,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=iG({find:lM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(lS)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),lT=iY.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),lO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,lA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,lN=im.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",r8(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[iq({find:lO,type:this.type})]},addPasteRules(){return[iQ({find:lA,type:this.type})]}}),lE=iY.create({name:"text",group:"inline"}),lD=iv.create({name:"starterKit",addExtensions(){let e=[];return!1!==this.options.bold&&e.push(s$.configure(this.options.bold)),!1!==this.options.blockquote&&e.push(sI.configure(this.options.blockquote)),!1!==this.options.bulletList&&e.push(sF.configure(this.options.bulletList)),!1!==this.options.code&&e.push(sK.configure(this.options.code)),!1!==this.options.codeBlock&&e.push(sJ.configure(this.options.codeBlock)),!1!==this.options.document&&e.push(sU.configure(this.options.document)),!1!==this.options.dropcursor&&e.push(sY.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&e.push(s4.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&e.push(s6.configure(this.options.hardBreak)),!1!==this.options.heading&&e.push(s9.configure(this.options.heading)),!1!==this.options.history&&e.push(lm.configure(this.options.history)),!1!==this.options.horizontalRule&&e.push(lg.configure(this.options.horizontalRule)),!1!==this.options.italic&&e.push(lk.configure(this.options.italic)),!1!==this.options.listItem&&e.push(lx.configure(this.options.listItem)),!1!==this.options.orderedList&&e.push(lC.configure(this.options.orderedList)),!1!==this.options.paragraph&&e.push(lT.configure(this.options.paragraph)),!1!==this.options.strike&&e.push(lN.configure(this.options.strike)),!1!==this.options.text&&e.push(lE.configure(this.options.text)),e}}),lR=iZ.extend({parseHTML(){return[{tag:'img:not([data-internalCreatorStoreImage="true"])',ignore:!0},...this.parent?.()??[]]},addInputRules:()=>[]}).configure({HTMLAttributes:{"data-internalCreatorStoreImage":"true"}});e.s(["tiptapJsonToHtml",0,(e,t=!0,n=!0)=>{if(!e)return"";try{var r,i;let o;return r=JSON.parse(e),i=(({withYoutube:e,withHorizontalRule:t,deleteTriggerWithBackspace:n})=>{let r=[lD.configure({horizontalRule:!!t&&void 0,heading:{HTMLAttributes:{class:"tiptap-heading"}},paragraph:{HTMLAttributes:{class:"tiptap-p"}},bulletList:{HTMLAttributes:{class:"tiptap-ul"}},listItem:{HTMLAttributes:{class:"tiptap-li"}}}),sA,sO.configure({HTMLAttributes:{class:"tiptap-variable"},renderLabel:e=>e.node.attrs.id?e.node.attrs.id:"",deleteTriggerWithBackspace:n}),sk.configure({openOnClick:!1,HTMLAttributes:{class:"tiptap-link"}}),lR];return e&&r.push(sD),r})({withYoutube:t,withHorizontalRule:n}),o=io(ib.resolve(i),void 0),ia(k.fromJSON(o,r).content,o)}catch(t){return e}}],609203)}]); 6 7//# debugId=39366de0-e854-f7a1-c710-566836c28314
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.