From e5aa9c0f732fb81a8d657d6464e0c5c605270f3e Mon Sep 17 00:00:00 2001 From: Christoph Schweppe Date: Tue, 7 Dec 2021 12:46:34 +0100 Subject: [PATCH] Update dependencies --- composer.json | 1 - composer.lock | 18 ++ dist/tiptap.umd.js | 44 +-- package-lock.json | 735 +++++++++++++++++++++++++++++---------------- package.json | 39 ++- 5 files changed, 536 insertions(+), 301 deletions(-) create mode 100644 composer.lock diff --git a/composer.json b/composer.json index 270b2ba..701767f 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,6 @@ "Emptynick\\Tiptap\\": "src/" } }, - "minimum-stability": "stable", "extra": { "laravel": { "providers": [ diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..9e2cadc --- /dev/null +++ b/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "26e480ac47b9715955e281f5f9373994", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/dist/tiptap.umd.js b/dist/tiptap.umd.js index 0104c31..c464eed 100644 --- a/dist/tiptap.umd.js +++ b/dist/tiptap.umd.js @@ -1,16 +1,16 @@ -var f1=Object.defineProperty,p1=Object.defineProperties;var d1=Object.getOwnPropertyDescriptors;var Lo=Object.getOwnPropertySymbols;var Ku=Object.prototype.hasOwnProperty,Uu=Object.prototype.propertyIsEnumerable;var Gu=(f,H,dt)=>H in f?f1(f,H,{enumerable:!0,configurable:!0,writable:!0,value:dt}):f[H]=dt,x=(f,H)=>{for(var dt in H||(H={}))Ku.call(H,dt)&&Gu(f,dt,H[dt]);if(Lo)for(var dt of Lo(H))Uu.call(H,dt)&&Gu(f,dt,H[dt]);return f},Lt=(f,H)=>p1(f,d1(H));var Yu=(f,H)=>{var dt={};for(var Xt in f)Ku.call(f,Xt)&&H.indexOf(Xt)<0&&(dt[Xt]=f[Xt]);if(f!=null&&Lo)for(var Xt of Lo(f))H.indexOf(Xt)<0&&Uu.call(f,Xt)&&(dt[Xt]=f[Xt]);return dt};var __vite_style__=document.createElement("style");__vite_style__.innerHTML=`.ProseMirror li>p:first-child,.ProseMirror div{display:inline}ul[data-type=taskList]{list-style:none;padding:0}ul[data-type=taskList] li{display:flex;align-items:center}ul[data-type=taskList] li>label{flex:0 0 auto;margin-right:.5rem} -`;document.head.appendChild(__vite_style__);(function(f,H){typeof exports=="object"&&typeof module!="undefined"?H(require("vue")):typeof define=="function"&&define.amd?define(["vue"],H):(f=typeof globalThis!="undefined"?globalThis:f||self,H(f.Vue))})(this,function(f){"use strict";function H(n){this.content=n}H.prototype={constructor:H,find:function(n){for(var t=0;t>1}},H.from=function(n){if(n instanceof H)return n;var t=[];if(n)for(var e in n)t.push(e,n[e]);return new H(t)};var dt=H;function Xt(n,t,e){for(var r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;var o=n.child(r),i=t.child(r);if(o==i){e+=o.nodeSize;continue}if(!o.sameMarkup(i))return e;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)e++;return e}if(o.content.size||i.content.size){var a=Xt(o.content,i.content,e+1);if(a!=null)return a}e+=o.nodeSize}}function Hs(n,t,e,r){for(var o=n.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:e,b:r};var s=n.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){e-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:e,b:r};if(s.isText&&s.text!=a.text){for(var c=0,u=Math.min(s.text.length,a.text.length);ct&&r(l,o+a,i,s)!==!1&&l.content.size){var u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,e-u),r,o+u)}a=c}},S.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},S.prototype.textBetween=function(t,e,r,o){var i="",s=!0;return this.nodesBetween(t,e,function(a,l){a.isText?(i+=a.text.slice(Math.max(t,l)-l,e-l),s=!r):a.isLeaf&&o?(i+=typeof o=="function"?o(a):o,s=!r):!s&&a.isBlock&&(i+=r,s=!0)},0),i},S.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(r)&&(o[o.length-1]=e.withText(e.text+r.text),i=1);it)for(var i=0,s=0;st&&((se)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),r.push(a),o+=a.nodeSize),s=l}return new S(r,o)},S.prototype.cutByIndex=function(t,e){return t==e?S.empty:t==0&&e==this.content.length?this:new S(this.content.slice(t,e))},S.prototype.replaceChild=function(t,e){var r=this.content[t];if(r==e)return this;var o=this.content.slice(),i=this.size+e.nodeSize-r.nodeSize;return o[t]=e,new S(o,i)},S.prototype.addToStart=function(t){return new S([t].concat(this.content),this.size+t.nodeSize)},S.prototype.addToEnd=function(t){return new S(this.content.concat(t),this.size+t.nodeSize)},S.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var r=0,o=0;;r++){var i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||e>0?Pr(r+1,s):Pr(r,o);o=s}},S.prototype.toString=function(){return"<"+this.toStringInner()+">"},S.prototype.toStringInner=function(){return this.content.join(", ")},S.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null},S.fromJSON=function(t,e){if(!e)return S.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new S(e.map(t.nodeFromJSON))},S.fromArray=function(t){if(!t.length)return S.empty;for(var e,r=0,o=0;othis.type.rank&&(e||(e=t.slice(0,o)),e.push(this),r=!0),e&&e.push(i)}}return e||(e=t.slice()),r||e.push(this),e},J.prototype.removeFromSet=function(t){for(var e=0;e0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},T.fromJSON=function(t,e){if(!e)return T.empty;var r=e.openStart||0,o=e.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new T(S.fromJSON(t,e.content),r,o)},T.maxOpen=function(t,e){e===void 0&&(e=!0);for(var r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)r++;for(var s=t.lastChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.lastChild)o++;return new T(t,r,o)},Object.defineProperties(T.prototype,Js);function $s(n,t,e){var r=n.findIndex(t),o=r.index,i=r.offset,s=n.maybeChild(o),a=n.findIndex(e),l=a.index,c=a.offset;if(i==t||s.isText){if(c!=e&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(o!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(o,s.copy($s(s.content,t-i-1,e-i-1)))}function qs(n,t,e,r){var o=n.findIndex(t),i=o.index,s=o.offset,a=n.maybeChild(i);if(s==t||a.isText)return r&&!r.canReplace(i,i,e)?null:n.cut(0,t).append(e).append(n.cut(t));var l=qs(a.content,t-s-1,e);return l&&n.replaceChild(i,a.copy(l))}T.empty=new T(S.empty,0,0);function Xu(n,t,e){if(e.openStart>n.depth)throw new he("Inserted content deeper than insertion position");if(n.depth-e.openStart!=t.depth-e.openEnd)throw new he("Inconsistent open depths");return js(n,t,e,0)}function js(n,t,e,r){var o=n.index(r),i=n.node(r);if(o==t.index(r)&&r=0&&n.isText&&n.sameMarkup(t[e])?t[e]=n.withText(t[e].text+n.text):t.push(n)}function Wn(n,t,e,r){var o=(t||n).node(e),i=0,s=t?t.index(e):o.childCount;n&&(i=n.index(e),n.depth>e?i++:n.textOffset&&(Ze(n.nodeAfter,r),i++));for(var a=i;ao&&Ho(n,t,o+1),s=r.depth>o&&Ho(e,r,o+1),a=[];return Wn(null,n,o,a),i&&s&&t.index(o)==e.index(o)?(Ws(i,s),Ze(tn(i,Ks(n,t,e,r,o+1)),a)):(i&&Ze(tn(i,Lr(n,t,o+1)),a),Wn(t,e,o,a),s&&Ze(tn(s,Lr(e,r,o+1)),a)),Wn(r,null,o,a),new S(a)}function Lr(n,t,e){var r=[];if(Wn(null,n,e,r),n.depth>e){var o=Ho(n,t,e+1);Ze(tn(o,Lr(n,t,e+1)),r)}return Wn(t,null,e,r),new S(r)}function Qu(n,t){for(var e=t.depth-n.openStart,r=t.node(e),o=r.copy(n.content),i=e-1;i>=0;i--)o=t.node(i).copy(S.from(o));return{start:o.resolveNoCache(n.openStart+e),end:o.resolveNoCache(o.content.size-n.openEnd-e)}}var nt=function(t,e,r){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=r},yn={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};nt.prototype.resolveDepth=function(t){return t==null?this.depth:t<0?this.depth+t:t},yn.parent.get=function(){return this.node(this.depth)},yn.doc.get=function(){return this.node(0)},nt.prototype.node=function(t){return this.path[this.resolveDepth(t)*3]},nt.prototype.index=function(t){return this.path[this.resolveDepth(t)*3+1]},nt.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)},nt.prototype.start=function(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1},nt.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},nt.prototype.before=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]},nt.prototype.after=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize},yn.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},yn.nodeAfter.get=function(){var n=this.parent,t=this.index(this.depth);if(t==n.childCount)return null;var e=this.pos-this.path[this.path.length-1],r=n.child(t);return e?n.child(t).cut(e):r},yn.nodeBefore.get=function(){var n=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(n).cut(0,t):n==0?null:this.parent.child(n-1)},nt.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var r=this.path[e*3],o=e==0?0:this.path[e*3-1]+1,i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},nt.prototype.blockRange=function(t,e){if(t===void 0&&(t=this),t.pos=0;r--)if(t.pos<=this.end(r)&&(!e||e(this.node(r))))return new Kn(this,t,r)},nt.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},nt.prototype.max=function(t){return t.pos>this.pos?t:this},nt.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var r=[],o=0,i=e,s=t;;){var a=s.content.findIndex(i),l=a.index,c=a.offset,u=i-c;if(r.push(s,l,o+c),!u||(s=s.child(l),s.isText))break;i=u-1,o+=c+1}return new nt(e,r,i)},nt.resolveCached=function(t,e){for(var r=0;rt&&this.nodesBetween(t,e,function(i){return r.isInSet(i.marks)&&(o=!0),!o}),o},$t.isBlock.get=function(){return this.type.isBlock},$t.isTextblock.get=function(){return this.type.isTextblock},$t.inlineContent.get=function(){return this.type.inlineContent},$t.isInline.get=function(){return this.type.isInline},$t.isText.get=function(){return this.type.isText},$t.isLeaf.get=function(){return this.type.isLeaf},$t.isAtom.get=function(){return this.type.isAtom},$.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Us(this.marks,t)},$.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},$.prototype.canReplace=function(t,e,r,o,i){r===void 0&&(r=S.empty),o===void 0&&(o=0),i===void 0&&(i=r.childCount);var s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var l=o;l=0;e--)t=n[e].type.name+"("+t+")";return t}var xt=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},Fr={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};xt.parse=function(t,e){var r=new Hr(t,e);if(r.next==null)return xt.empty;var o=Ys(r);r.next&&r.err("Unexpected trailing text");var i=cf(lf(o));return uf(i,r),i},xt.prototype.matchType=function(t){for(var e=0;e>1},xt.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},xt.prototype.toString=function(){var t=[];function e(r){t.push(r);for(var o=1;o"+t.indexOf(r.next[s+1]);return i}).join(` -`)},Object.defineProperties(xt.prototype,Fr),xt.empty=new xt(!0);var Hr=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()},Gs={next:{configurable:!0}};Gs.next.get=function(){return this.tokens[this.pos]},Hr.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},Hr.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(Hr.prototype,Gs);function Ys(n){var t=[];do t.push(nf(n));while(n.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function nf(n){var t=[];do t.push(rf(n));while(n.next&&n.next!=")"&&n.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function rf(n){for(var t=af(n);;)if(n.eat("+"))t={type:"plus",expr:t};else if(n.eat("*"))t={type:"star",expr:t};else if(n.eat("?"))t={type:"opt",expr:t};else if(n.eat("{"))t=of(n,t);else break;return t}function Xs(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");var t=Number(n.next);return n.pos++,t}function of(n,t){var e=Xs(n),r=e;return n.eat(",")&&(n.next!="}"?r=Xs(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:e,max:r,expr:t}}function sf(n,t){var e=n.nodeTypes,r=e[t];if(r)return[r];var o=[];for(var i in e){var s=e[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&n.err("No node type or group '"+t+"' found"),o}function af(n){if(n.eat("(")){var t=Ys(n);return n.eat(")")||n.err("Missing closing paren"),t}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{var e=sf(n,n.next).map(function(r){return n.inline==null?n.inline=r.isInline:n.inline!=r.isInline&&n.err("Mixing inline and block content"),{type:"name",value:r}});return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function lf(n){var t=[[]];return o(i(n,0),e()),t;function e(){return t.push([])-1}function r(s,a,l){var c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(function(l){return l.to=a})}function i(s,a){if(s.type=="choice")return s.exprs.reduce(function(k,b){return k.concat(i(b,a))},[]);if(s.type=="seq")for(var l=0;;l++){var c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=e())}else if(s.type=="star"){var u=e();return r(a,u),o(i(s.expr,u),u),[r(u)]}else if(s.type=="plus"){var p=e();return o(i(s.expr,a),p),o(i(s.expr,p),p),[r(p)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){for(var d=a,h=0;h-1&&o[d+1];Zs(n,p).forEach(function(m){h||o.push(u,h=[]),h.indexOf(m)==-1&&h.push(m)})}})});for(var i=t[r.join(",")]=new xt(r.indexOf(n.length-1)>-1),s=0;s-1},At.prototype.allowsMarks=function(t){if(this.markSet==null)return!0;for(var e=0;e-1};var en=function(t){this.spec={};for(var e in t)this.spec[e]=t[e];this.spec.nodes=dt.from(t.nodes),this.spec.marks=dt.from(t.marks),this.nodes=At.compile(this.spec.nodes,this),this.marks=Ve.compile(this.spec.marks,this);var r=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=r[s]||(r[s]=xt.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?ia(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(var l in this.marks){var c=this.marks[l],u=c.spec.excludes;c.excluded=u==null?[c]:u==""?[]:ia(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};en.prototype.node=function(t,e,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof At){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(e,r,o)},en.prototype.text=function(t,e){var r=this.nodes.text;return new ef(r,r.defaultAttrs,t,J.setFrom(e))},en.prototype.mark=function(t,e){return typeof t=="string"&&(t=this.marks[t]),t.create(e)},en.prototype.nodeFromJSON=function(t){return $.fromJSON(this,t)},en.prototype.markFromJSON=function(t){return J.fromJSON(this,t)},en.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};function ia(n,t){for(var e=[],r=0;r-1)&&e.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return e}var se=function(t,e){var r=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(function(o){o.tag?r.tags.push(o):o.style&&r.styles.push(o)}),this.normalizeLists=!this.tags.some(function(o){if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;var i=t.nodes[o.node];return i.contentMatch.matchType(i)})};se.prototype.parse=function(t,e){e===void 0&&(e={});var r=new tt(this,e,!1);return r.addAll(t,null,e.from,e.to),r.finish()},se.prototype.parseSlice=function(t,e){e===void 0&&(e={});var r=new tt(this,e,!0);return r.addAll(t,null,e.from,e.to),T.maxOpen(r.finish())},se.prototype.matchTag=function(t,e,r){for(var o=r?this.tags.indexOf(r)+1:0;ot.length&&(s.style.charCodeAt(t.length)!=61||s.style.slice(t.length+1)!=e))){if(s.getAttrs){var a=s.getAttrs(e);if(a===!1)continue;s.attrs=a}return s}}},se.schemaRules=function(t){var e=[];function r(l){for(var c=l.priority==null?50:l.priority,u=0;u=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},Ce.prototype.applyPending=function(t){for(var e=0,r=this.pendingMarks;e=0;o--){var i=this.nodes[o],s=i.findWrapping(t);if(s&&(!e||e.length>s.length)&&(e=s,r=i,!s.length)||i.solid)break}if(!e)return!1;this.sync(r);for(var a=0;athis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},tt.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},tt.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t){this.open=e;return}},Ko.currentPos.get=function(){this.closeExtra();for(var n=0,t=this.open;t>=0;t--){for(var e=this.nodes[t].content,r=e.length-1;r>=0;r--)n+=e[r].nodeSize;t&&n++}return n},tt.prototype.findAtPoint=function(t,e){if(this.find)for(var r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var r=t.split("/"),o=this.options.context,i=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=function(l,c){for(;l>=0;l--){var u=r[l];if(u==""){if(l==r.length-1||l==0)continue;for(;c>=s;c--)if(a(l-1,c))return!0;return!1}else{var p=c>0||c==0&&i?e.nodes[c].type:o&&c>=s?o.node(c-s).type:null;if(!p||p.name!=u&&p.groups.indexOf(u)==-1)return!1;c--}}return!0};return a(r.length-1,this.open)},tt.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var r=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(var o in this.parser.schema.nodes){var i=this.parser.schema.nodes[o];if(i.isTextblock&&i.defaultAttrs)return i}},tt.prototype.addPendingMark=function(t){var e=vf(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},tt.prototype.removePendingMark=function(t,e){for(var r=this.open;r>=0;r--){var o=this.nodes[r],i=o.pendingMarks.lastIndexOf(t);if(i>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==e)break}},Object.defineProperties(tt.prototype,Ko);function pf(n){for(var t=n.firstChild,e=null;t;t=t.nextSibling){var r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&sa.hasOwnProperty(r)&&e?(e.appendChild(t),t=e):r=="li"?e=t:r&&(e=null)}}function df(n,t){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,t)}function hf(n){for(var t=/\s*([\w-]+)\s*:\s*([^;]+)/g,e,r=[];e=t.exec(n);)r.push(e[1],e[2].trim());return r}function la(n){var t={};for(var e in n)t[e]=n[e];return t}function mf(n,t){var e=t.schema.nodes,r=function(s){var a=e[s];if(!!a.allowsMarkType(n)){var l=[],c=function(u){l.push(u);for(var p=0;p=0;o--){var i=this.serializeMark(t.marks[o],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r},ht.prototype.serializeMark=function(t,e,r){r===void 0&&(r={});var o=this.marks[t.type.name];return o&&ht.renderSpec(Uo(r),o(t,e))},ht.renderSpec=function(t,e,r){if(r===void 0&&(r=null),typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;var o=e[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));var s=null,a=r?t.createElementNS(r,o):t.createElement(o),l=e[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(var u in l)if(l[u]!=null){var p=u.indexOf(" ");p>0?a.setAttributeNS(u.slice(0,p),u.slice(p+1),l[u]):a.setAttribute(u,l[u])}}for(var d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{var m=ht.renderSpec(t,h,r),g=m.dom,y=m.contentDOM;if(a.appendChild(g),y){if(s)throw new RangeError("Multiple content holes");s=y}}}return{dom:a,contentDOM:s}},ht.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new ht(this.nodesFromSchema(t),this.marksFromSchema(t)))},ht.nodesFromSchema=function(t){var e=ca(t.nodes);return e.text||(e.text=function(r){return r.text}),e},ht.marksFromSchema=function(t){return ca(t.marks)};function ca(n){var t={};for(var e in n){var r=n[e].spec.toDOM;r&&(t[e]=r)}return t}function Uo(n){return n.document||window.document}var ua=65535,fa=Math.pow(2,16);function gf(n,t){return n+t*fa}function pa(n){return n&ua}function yf(n){return(n-(n&ua))/fa}var Go=function(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=null),this.pos=t,this.deleted=e,this.recover=r},mt=function(t,e){e===void 0&&(e=!1),this.ranges=t,this.inverted=e};mt.prototype.recover=function(t){var e=0,r=pa(t);if(!this.inverted)for(var o=0;ot)break;var c=this.ranges[a+i],u=this.ranges[a+s],p=l+c;if(t<=p){var d=c?t==l?-1:t==p?1:e:e,h=l+o+(d<0?0:u);if(r)return h;var m=t==(e<0?l:p)?null:gf(a/3,t-l);return new Go(h,e<0?t!=l:t!=p,m)}o+=u-c}return r?t+o:new Go(t+o)},mt.prototype.touches=function(t,e){for(var r=0,o=pa(e),i=this.inverted?2:1,s=this.inverted?1:2,a=0;at)break;var c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1},mt.prototype.forEach=function(t){for(var e=this.inverted?2:1,r=this.inverted?1:2,o=0,i=0;o=0;e--){var o=t.getMirror(e);this.appendMap(t.maps[e].invert(),o!=null&&o>e?r-o-1:null)}},Mt.prototype.invert=function(){var t=new Mt;return t.appendMappingInverted(this),t},Mt.prototype.map=function(t,e){if(e===void 0&&(e=1),this.mirror)return this._map(t,e,!0);for(var r=this.from;ri&&l0},at.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(at.prototype,Yo);function Jr(){throw new Error("Override me")}var Xo=Object.create(null),Ct=function(){};Ct.prototype.apply=function(t){return Jr()},Ct.prototype.getMap=function(){return mt.empty},Ct.prototype.invert=function(t){return Jr()},Ct.prototype.map=function(t){return Jr()},Ct.prototype.merge=function(t){return null},Ct.prototype.toJSON=function(){return Jr()},Ct.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var r=Xo[e.stepType];if(!r)throw new RangeError("No step type "+e.stepType+" defined");return r.fromJSON(t,e)},Ct.jsonID=function(t,e){if(t in Xo)throw new RangeError("Duplicate use of step JSON ID "+t);return Xo[t]=e,e.prototype.jsonID=t,e};var Dt=function(t,e){this.doc=t,this.failed=e};Dt.ok=function(t){return new Dt(t,null)},Dt.fail=function(t){return new Dt(null,t)},Dt.fromReplace=function(t,e,r,o){try{return Dt.ok(t.replace(e,r,o))}catch(i){if(i instanceof he)return Dt.fail(i.message);throw i}};var Ee=function(n){function t(e,r,o,i){n.call(this),this.from=e,this.to=r,this.slice=o,this.structure=!!i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){return this.structure&&Qo(r,this.from,this.to)?Dt.fail("Structure replace would overwrite content"):Dt.fromReplace(r,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new mt([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(r){return new t(this.from,this.from+this.slice.size,r.slice(this.from,this.to))},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted?null:new t(o.pos,Math.max(o.pos,i.pos),this.slice)},t.prototype.merge=function(r){if(!(r instanceof t)||r.structure||this.structure)return null;if(this.from+this.slice.size==r.from&&!this.slice.openEnd&&!r.slice.openStart){var o=this.slice.size+r.slice.size==0?T.empty:new T(this.slice.content.append(r.slice.content),this.slice.openStart,r.slice.openEnd);return new t(this.from,this.to+(r.to-r.from),o,this.structure)}else if(r.to==this.from&&!this.slice.openStart&&!r.slice.openEnd){var i=this.slice.size+r.slice.size==0?T.empty:new T(r.slice.content.append(this.slice.content),r.slice.openStart,this.slice.openEnd);return new t(r.from,this.to,i,this.structure)}else return null},t.prototype.toJSON=function(){var r={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(o.from,o.to,T.fromJSON(r,o.slice),!!o.structure)},t}(Ct);Ct.jsonID("replace",Ee);var Ft=function(n){function t(e,r,o,i,s,a,l){n.call(this),this.from=e,this.to=r,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=!!l}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){if(this.structure&&(Qo(r,this.from,this.gapFrom)||Qo(r,this.gapTo,this.to)))return Dt.fail("Structure gap-replace would overwrite content");var o=r.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return Dt.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?Dt.fromReplace(r,this.from,this.to,i):Dt.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new mt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(r){var o=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,r.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),s=r.map(this.gapFrom,-1),a=r.map(this.gapTo,1);return o.deleted&&i.deleted||si.pos?null:new t(o.pos,i.pos,s,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var r={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number"||typeof o.gapFrom!="number"||typeof o.gapTo!="number"||typeof o.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(o.from,o.to,o.gapFrom,o.gapTo,T.fromJSON(r,o.slice),o.insert,!!o.structure)},t}(Ct);Ct.jsonID("replaceAround",Ft);function Qo(n,t,e){for(var r=n.resolve(t),o=e-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function bf(n,t,e){return(t==0||n.canReplace(t,n.childCount))&&(e==n.childCount||n.canReplace(0,e))}function wn(n){for(var t=n.parent,e=t.content.cutByIndex(n.startIndex,n.endIndex),r=n.depth;;--r){var o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;p--)d||e.index(p)>0?(d=!0,c=S.from(e.node(p).copy(c)),u++):a--;for(var h=S.empty,m=0,g=o,y=!1;g>t;g--)y||r.after(g+1)=0;r--)e=S.from(t[r].type.create(t[r].attrs,e));var o=n.start,i=n.end;return this.step(new Ft(o,i,o,i,new T(e,0,0),t.length,!0))},at.prototype.setBlockType=function(n,t,e,r){var o=this;if(t===void 0&&(t=n),!e.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(n,t,function(s,a){if(s.isTextblock&&!s.hasMarkup(e,r)&&Sf(o.doc,o.mapping.slice(i).map(a),e)){o.clearIncompatible(o.mapping.slice(i).map(a,1),e);var l=o.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return o.step(new Ft(c,u,c+1,u-1,new T(S.from(e.create(r,null,s.marks)),0,0),1,!0)),!1}}),this};function Sf(n,t,e){var r=n.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,e)}at.prototype.setNodeMarkup=function(n,t,e,r){var o=this.doc.nodeAt(n);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var i=t.create(e,null,r||o.marks);if(o.isLeaf)return this.replaceWith(n,n+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new Ft(n,n+o.nodeSize,n+1,n+o.nodeSize-1,new T(S.from(i),0,0),1,!0))};function Oe(n,t,e,r){e===void 0&&(e=1);var o=n.resolve(t),i=o.depth-e,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,l=e-2;a>i;a--,l--){var c=o.node(a),u=o.index(a);if(c.type.spec.isolating)return!1;var p=c.content.cutByIndex(u,c.childCount),d=r&&r[l]||c;if(d!=c&&(p=p.replaceChild(0,d.type.create(d.attrs))),!c.canReplace(u+1,c.childCount)||!d.type.validContent(p))return!1}var h=o.indexAfter(i),m=r&&r[0];return o.node(i).canReplaceWith(h,h,m?m.type:o.node(i+1).type)}at.prototype.split=function(n,t,e){t===void 0&&(t=1);for(var r=this.doc.resolve(n),o=S.empty,i=S.empty,s=r.depth,a=r.depth-t,l=t-1;s>a;s--,l--){o=S.from(r.node(s).copy(o));var c=e&&e[l];i=S.from(c?c.type.create(c.attrs,i):r.node(s).copy(i))}return this.step(new Ee(n,n,new T(o.append(i),t,t),!0))};function ti(n,t){var e=n.resolve(t),r=e.index();return xf(e.nodeBefore,e.nodeAfter)&&e.parent.canReplace(r,r+1)}function xf(n,t){return n&&t&&!n.isLeaf&&n.canAppend(t)}at.prototype.join=function(n,t){t===void 0&&(t=1);var e=new Ee(n-t,n+t,T.empty,!0);return this.step(e)};function Mf(n,t,e){var r=n.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),e))return t;if(r.parentOffset==0)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,e))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,e))return r.after(s+1);if(a=0;a--){var l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(l>0?1:0),u=r.node(a),p=!1;if(s==1)p=u.canReplace(c,c,o);else{var d=u.contentMatchAt(c).findWrapping(o.firstChild.type);p=d&&u.canReplaceWith(c,c,d[0])}if(p)return l==0?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function ei(n,t,e){for(var r=[],o=0;o=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(r){if(r instanceof t&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from)return new t(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(o.from,o.to,r.markFromJSON(o.mark))},t}(Ct);Ct.jsonID("addMark",ni);var Yn=function(n){function t(e,r,o){n.call(this),this.from=e,this.to=r,this.mark=o}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){var o=this,i=r.slice(this.from,this.to),s=new T(ei(i.content,function(a){return a.mark(o.mark.removeFromSet(a.marks))}),i.openStart,i.openEnd);return Dt.fromReplace(r,this.from,this.to,s)},t.prototype.invert=function(){return new ni(this.from,this.to,this.mark)},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(r){if(r instanceof t&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from)return new t(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(o.from,o.to,r.markFromJSON(o.mark))},t}(Ct);Ct.jsonID("removeMark",Yn),at.prototype.addMark=function(n,t,e){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(n,t,function(l,c,u){if(!!l.isInline){var p=l.marks;if(!e.isInSet(p)&&u.type.allowsMarkType(e.type)){for(var d=Math.max(c,n),h=Math.min(c+l.nodeSize,t),m=e.addToSet(p),g=0;g=0;d--)this.step(o[d]);return this};function Cf(n,t,e,r){if(e===void 0&&(e=t),r===void 0&&(r=T.empty),t==e&&!r.size)return null;var o=n.resolve(t),i=n.resolve(e);return ma(o,i,r)?new Ee(t,e,r):new Qt(o,i,r).fit()}at.prototype.replace=function(n,t,e){t===void 0&&(t=n),e===void 0&&(e=T.empty);var r=Cf(this.doc,n,t,e);return r&&this.step(r),this},at.prototype.replaceWith=function(n,t,e){return this.replace(n,t,new T(S.from(e),0,0))},at.prototype.delete=function(n,t){return this.replace(n,t,T.empty)},at.prototype.insert=function(n,t){return this.replaceWith(n,n,t)};function ma(n,t,e){return!e.openStart&&!e.openEnd&&n.start()==t.start()&&n.parent.canReplace(n.index(),t.index(),e.content)}var Qt=function(t,e,r){this.$to=e,this.$from=t,this.unplaced=r,this.frontier=[];for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}this.placed=S.empty;for(var s=t.depth;s>0;s--)this.placed=S.from(t.node(s).copy(this.placed))},va={depth:{configurable:!0}};va.depth.get=function(){return this.frontier.length-1},Qt.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;for(var s=this.placed,a=o.depth,l=i.depth;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;var c=new T(s,a,l);if(e>-1)return new Ft(o.pos,e,this.$to.pos,this.$to.end(),c,r);if(c.size||o.pos!=this.$to.pos)return new Ee(o.pos,i.pos,c)},Qt.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--){var r=void 0,o=void 0;e?(o=ri(this.unplaced.content,e-1).firstChild,r=o.content):r=this.unplaced.content;for(var i=r.firstChild,s=this.depth;s>=0;s--){var a=this.frontier[s],l=a.type,c=a.match,u=void 0,p=void 0;if(t==1&&(i?c.matchType(i.type)||(p=c.fillBefore(S.from(i),!1)):l.compatibleContent(o.type)))return{sliceDepth:e,frontierDepth:s,parent:o,inject:p};if(t==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:e,frontierDepth:s,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}},Qt.prototype.openMore=function(){var t=this.unplaced,e=t.content,r=t.openStart,o=t.openEnd,i=ri(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new T(e,r+1,Math.max(o,i.size+r>=e.size-o?r+1:0)),!0)},Qt.prototype.dropNode=function(){var t=this.unplaced,e=t.content,r=t.openStart,o=t.openEnd,i=ri(e,r);if(i.childCount<=1&&r>0){var s=e.size-r<=r+i.size;this.unplaced=new T(Xn(e,r-1,1),r-1,s?r-1:o)}else this.unplaced=new T(Xn(e,r,1),r,o)},Qt.prototype.placeNodes=function(t){for(var e=t.sliceDepth,r=t.frontierDepth,o=t.parent,i=t.inject,s=t.wrap;this.depth>r;)this.closeFrontierNode();if(s)for(var a=0;a1||u==0||b.content.size)&&(m=N,d.push(ga(b.mark(g.allowedMarks(b.marks)),p==1?u:0,p==c.childCount?k:-1)))}var v=p==c.childCount;v||(k=-1),this.placed=Qn(this.placed,r,S.from(d)),this.frontier[r].match=m,v&&k<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,C=c;E1&&i==this.$to.end(--o);)++i;return i},Qt.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var r=this.frontier[e],o=r.match,i=r.type,s=e=0;l--){var c=this.frontier[l],u=c.match,p=c.type,d=oi(t,l,p,u,!0);if(!d||d.childCount)continue t}return{depth:e,fit:a,move:s?t.doc.resolve(t.after(e+1)):t}}}},Qt.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Qn(this.placed,e.depth,e.fit)),t=e.move;for(var r=e.depth+1;r<=t.depth;r++){var o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t},Qt.prototype.openFrontierNode=function(t,e,r){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Qn(this.placed,this.depth,S.from(t.create(e,r))),this.frontier.push({type:t,match:t.contentMatch})},Qt.prototype.closeFrontierNode=function(){var t=this.frontier.pop(),e=t.match.fillBefore(S.empty,!0);e.childCount&&(this.placed=Qn(this.placed,this.frontier.length,e))},Object.defineProperties(Qt.prototype,va);function Xn(n,t,e){return t==0?n.cutByIndex(e):n.replaceChild(0,n.firstChild.copy(Xn(n.firstChild.content,t-1,e)))}function Qn(n,t,e){return t==0?n.append(e):n.replaceChild(n.childCount-1,n.lastChild.copy(Qn(n.lastChild.content,t-1,e)))}function ri(n,t){for(var e=0;e1&&(r=r.replaceChild(0,ga(r.firstChild,t-1,r.childCount==1?e-1:0))),t>0&&(r=n.type.contentMatch.fillBefore(r).append(r),e<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(S.empty,!0)))),n.copy(r)}function oi(n,t,e,r,o){var i=n.node(t),s=o?n.indexAfter(t):n.index(t);if(s==i.childCount&&!e.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!Ef(e,i.content,s)?a:null}function Ef(n,t,e){for(var r=e;r0;a--,l--){var c=r.node(a).type.spec;if(c.defining||c.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==l&&i.splice(1,0,-a)}for(var u=i.indexOf(s),p=[],d=e.openStart,h=e.content,m=0;;m++){var g=h.firstChild;if(p.push(g),m==e.openStart)break;h=g.content}d>0&&p[d-1].type.spec.defining&&r.node(u).type!=p[d-1].type?d-=1:d>=2&&p[d-1].isTextblock&&p[d-2].type.spec.defining&&r.node(u).type!=p[d-2].type&&(d-=2);for(var y=e.openStart;y>=0;y--){var k=(y+d+1)%(e.openStart+1),b=p[k];if(!!b)for(var N=0;N=0&&(this.replace(n,t,e),!(this.steps.length>B));V--){var F=i[V];F<0||(n=r.before(F),t=o.after(F))}return this};function ya(n,t,e,r,o){if(tr){var s=o.contentMatchAt(0),a=s.fillBefore(n).append(n);n=a.append(s.matchFragment(a).fillBefore(S.empty,!0))}return n}at.prototype.replaceRangeWith=function(n,t,e){if(!e.isInline&&n==t&&this.doc.resolve(n).parent.content.size){var r=Mf(this.doc,n,e.type);r!=null&&(n=t=r)}return this.replaceRange(n,t,new T(S.from(e),0,0))},at.prototype.deleteRange=function(n,t){for(var e=this.doc.resolve(n),r=this.doc.resolve(t),o=ba(e,r),i=0;i0&&(a||e.node(s-1).canReplace(e.index(s-1),r.indexAfter(s-1))))return this.delete(e.before(s),r.after(s))}for(var l=1;l<=e.depth&&l<=r.depth;l++)if(n-e.start(l)==e.depth-l&&t>e.end(l)&&r.end(l)-t!=r.depth-l)return this.delete(e.before(l),t);return this.delete(n,t)};function ba(n,t){for(var e=[],r=Math.min(n.depth,t.depth),o=r;o>=0;o--){var i=n.start(o);if(it.pos+(t.depth-o)||n.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==n.depth&&o==t.depth&&n.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&e.push(o)}return e}var ii=Object.create(null),z=function(t,e,r){this.ranges=r||[new Of(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Ie={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Ie.anchor.get=function(){return this.$anchor.pos},Ie.head.get=function(){return this.$head.pos},Ie.from.get=function(){return this.$from.pos},Ie.to.get=function(){return this.$to.pos},Ie.$from.get=function(){return this.ranges[0].$from},Ie.$to.get=function(){return this.ranges[0].$to},Ie.empty.get=function(){for(var n=this.ranges,t=0;t=0;i--){var s=e<0?Sn(t.node(0),t.node(i),t.before(i+1),t.index(i),e,r):Sn(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,r);if(s)return s}},z.near=function(t,e){return e===void 0&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new Ne(t.node(0))},z.atStart=function(t){return Sn(t,t,0,0,1)||new Ne(t)},z.atEnd=function(t){return Sn(t,t,t.content.size,t.childCount,-1)||new Ne(t)},z.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var r=ii[e.type];if(!r)throw new RangeError("No selection type "+e.type+" defined");return r.fromJSON(t,e)},z.jsonID=function(t,e){if(t in ii)throw new RangeError("Duplicate use of selection JSON ID "+t);return ii[t]=e,e.prototype.jsonID=t,e},z.prototype.getBookmark=function(){return K.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(z.prototype,Ie),z.prototype.visible=!0;var Of=function(t,e){this.$from=t,this.$to=e},K=function(n){function t(r,o){o===void 0&&(o=r),n.call(this,r,o)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={$cursor:{configurable:!0}};return e.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(o,i){var s=o.resolve(i.map(this.head));if(!s.parent.inlineContent)return n.near(s);var a=o.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:s,s)},t.prototype.replace=function(o,i){if(i===void 0&&(i=T.empty),n.prototype.replace.call(this,o,i),i==T.empty){var s=this.$from.marksAcross(this.$to);s&&o.ensureMarks(s)}},t.prototype.eq=function(o){return o instanceof t&&o.anchor==this.anchor&&o.head==this.head},t.prototype.getBookmark=function(){return new Zn(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(o,i){if(typeof i.anchor!="number"||typeof i.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(o.resolve(i.anchor),o.resolve(i.head))},t.create=function(o,i,s){s===void 0&&(s=i);var a=o.resolve(i);return new this(a,s==i?a:o.resolve(s))},t.between=function(o,i,s){var a=o.pos-i.pos;if((!s||a)&&(s=a>=0?1:-1),!i.parent.inlineContent){var l=n.findFrom(i,s,!0)||n.findFrom(i,-s,!0);if(l)i=l.$head;else return n.near(i,s)}return o.parent.inlineContent||(a==0?o=i:(o=(n.findFrom(o,-s,!0)||n.findFrom(o,s,!0)).$anchor,o.pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&P.isSelectable(a))return P.create(n,e-(o<0?a.nodeSize:0))}else{var l=Sn(n,a,e+o,o<0?a.childCount:0,o,i);if(l)return l}e+=a.nodeSize*o}}function ka(n,t,e){var r=n.steps.length-1;if(!(r0},t.prototype.setStoredMarks=function(o){return this.storedMarks=o,this.updated|=qr,this},t.prototype.ensureMarks=function(o){return J.sameSet(this.storedMarks||this.selection.$from.marks(),o)||this.setStoredMarks(o),this},t.prototype.addStoredMark=function(o){return this.ensureMarks(o.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(o){return this.ensureMarks(o.removeFromSet(this.storedMarks||this.selection.$head.marks()))},e.storedMarksSet.get=function(){return(this.updated&qr)>0},t.prototype.addStep=function(o,i){n.prototype.addStep.call(this,o,i),this.updated=this.updated&~qr,this.storedMarks=null},t.prototype.setTime=function(o){return this.time=o,this},t.prototype.replaceSelection=function(o){return this.selection.replace(this,o),this},t.prototype.replaceSelectionWith=function(o,i){var s=this.selection;return i!==!1&&(o=o.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||J.none))),s.replaceWith(this,o),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(o,i,s){s===void 0&&(s=i);var a=this.doc.type.schema;if(i==null)return o?this.replaceSelectionWith(a.text(o),!0):this.deleteSelection();if(!o)return this.deleteRange(i,s);var l=this.storedMarks;if(!l){var c=this.doc.resolve(i);l=s==i?c.marks():c.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(i,s,a.text(o,l)),this.selection.empty||this.setSelection(z.near(this.selection.$to)),this},t.prototype.setMeta=function(o,i){return this.meta[typeof o=="string"?o:o.key]=i,this},t.prototype.getMeta=function(o){return this.meta[typeof o=="string"?o:o.key]},e.isGeneric.get=function(){for(var r in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=Sa,this},e.scrolledIntoView.get=function(){return(this.updated&Sa)>0},Object.defineProperties(t.prototype,e),t}(at);function xa(n,t){return!t||!n?n:n.bind(t)}var tr=function(t,e,r){this.name=t,this.init=xa(e.init,r),this.apply=xa(e.apply,r)},_f=[new tr("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new tr("selection",{init:function(t,e){return t.selection||z.atStart(e.doc)},apply:function(t){return t.selection}}),new tr("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,r,o){return o.selection.$cursor?t.storedMarks:null}}),new tr("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],si=function(t,e){var r=this;this.schema=t,this.fields=_f.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach(function(o){if(r.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");r.plugins.push(o),r.pluginsByKey[o.key]=o,o.spec.state&&r.fields.push(new tr(o.key,o.spec.state,o))})},Et=function(t){this.config=t},jr={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};jr.schema.get=function(){return this.config.schema},jr.plugins.get=function(){return this.config.plugins},Et.prototype.apply=function(t){return this.applyTransaction(t).state},Et.prototype.filterTransaction=function(t,e){e===void 0&&(e=-1);for(var r=0;r-1&&er.splice(e,1)},Object.defineProperties(Et.prototype,jr);var er=[];function Ma(n,t,e){for(var r in n){var o=n[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=Ma(o,t,{})),e[r]=o}return e}var Ht=function(t){this.props={},t.props&&Ma(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:Ca("plugin")};Ht.prototype.getState=function(t){return t[this.key]};var ai=Object.create(null);function Ca(n){return n in ai?n+"$"+ ++ai[n]:(ai[n]=0,n+"$")}var ae=function(t){t===void 0&&(t="key"),this.key=Ca(t)};ae.prototype.get=function(t){return t.config.pluginsByKey[this.key]},ae.prototype.getState=function(t){return t[this.key]};function li(n,t){return n.selection.empty?!1:(t&&t(n.tr.deleteSelection().scrollIntoView()),!0)}function Ea(n,t,e){var r=n.selection,o=r.$cursor;if(!o||(e?!e.endOfTextblock("backward",n):o.parentOffset>0))return!1;var i=Na(o);if(!i){var s=o.blockRange(),a=s&&wn(s);return a==null?!1:(t&&t(n.tr.lift(s,a).scrollIntoView()),!0)}var l=i.nodeBefore;if(!l.type.spec.isolating&&Pa(n,i,t))return!0;if(o.parent.content.size==0&&(xn(l,"end")||P.isSelectable(l))){if(t){var c=n.tr.deleteRange(o.before(),o.after());c.setSelection(xn(l,"end")?z.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):P.create(c.doc,i.pos-l.nodeSize)),t(c.scrollIntoView())}return!0}return l.isAtom&&i.depth==o.depth-1?(t&&t(n.tr.delete(i.pos-l.nodeSize,i.pos).scrollIntoView()),!0):!1}function xn(n,t,e){for(;n;n=t=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(e&&n.childCount!=1)return!1}return!1}function Oa(n,t,e){var r=n.selection,o=r.$head,i=r.empty,s=o;if(!i)return!1;if(o.parent.isTextblock){if(e?!e.endOfTextblock("backward",n):o.parentOffset>0)return!1;s=Na(o)}var a=s&&s.nodeBefore;return!a||!P.isSelectable(a)?!1:(t&&t(n.tr.setSelection(P.create(n.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}function Na(n){if(!n.parent.type.spec.isolating)for(var t=n.depth-1;t>=0;t--){if(n.index(t)>0)return n.doc.resolve(n.before(t+1));if(n.node(t).type.spec.isolating)break}return null}function Ta(n,t,e){var r=n.selection,o=r.$cursor;if(!o||(e?!e.endOfTextblock("forward",n):o.parentOffset=0;t--){var e=n.node(t);if(n.index(t)+11&&r.after()!=r.end(-1)){var o=r.before();if(Oe(n.doc,o))return t&&t(n.tr.split(o).scrollIntoView()),!0}var i=r.blockRange(),s=i&&wn(i);return s==null?!1:(t&&t(n.tr.lift(i,s).scrollIntoView()),!0)}function Af(n,t){var e=n.selection,r=e.$from,o=e.$to;if(n.selection instanceof P&&n.selection.node.isBlock)return!r.parentOffset||!Oe(n.doc,r.pos)?!1:(t&&t(n.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,s=n.tr;(n.selection instanceof K||n.selection instanceof Ne)&&s.deleteSelection();var a=r.depth==0?null:ci(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=i&&a?[{type:a}]:null,c=Oe(s.doc,s.mapping.map(r.pos),1,l);if(!l&&!c&&Oe(s.doc,s.mapping.map(r.pos),1,a&&[{type:a}])&&(l=[{type:a}],c=!0),c&&(s.split(s.mapping.map(r.pos),1,l),!i&&!r.parentOffset&&r.parent.type!=a)){var u=s.mapping.map(r.before()),p=s.doc.resolve(u);r.node(-1).canReplaceWith(p.index(),p.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}t(s.scrollIntoView())}return!0}function Df(n,t){var e=n.selection,r=e.$from,o=e.to,i,s=r.sharedDepth(o);return s==0?!1:(i=r.before(s),t&&t(n.tr.setSelection(P.create(n.doc,i))),!0)}function Rf(n,t){return t&&t(n.tr.setSelection(new Ne(n.doc))),!0}function Vf(n,t,e){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(e&&e(n.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||ti(n.doc,t.pos))?!1:(e&&e(n.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function Pa(n,t,e){var r=t.nodeBefore,o=t.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(Vf(n,t,e))return!0;var a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(e){for(var l=t.pos+o.nodeSize,c=S.empty,u=i.length-1;u>=0;u--)c=S.from(i[u].create(null,c));c=S.from(r.copy(c));var p=n.tr.step(new Ft(t.pos-1,l,t.pos,l,new T(c,1,0),i.length,!0)),d=l+2*i.length;ti(p.doc,d)&&p.join(d),e(p.scrollIntoView())}return!0}var h=z.findFrom(t,1),m=h&&h.$from.blockRange(h.$to),g=m&&wn(m);if(g!=null&&g>=t.depth)return e&&e(n.tr.lift(m,g).scrollIntoView()),!0;if(a&&xn(o,"start",!0)&&xn(r,"end")){for(var y=r,k=[];k.push(y),!y.isTextblock;)y=y.lastChild;for(var b=o,N=1;!b.isTextblock;b=b.firstChild)N++;if(y.canReplace(y.childCount,y.childCount,b.content)){if(e){for(var v=S.empty,E=k.length-1;E>=0;E--)v=S.from(k[E].copy(v));var C=n.tr.step(new Ft(t.pos-k.length,t.pos+o.nodeSize,t.pos+N,t.pos+o.nodeSize-N,new T(v,k.length,0),0,!0));e(C.scrollIntoView())}return!0}}return!1}function za(n,t){return function(e,r){var o=e.selection,i=o.$from,s=o.$to,a=i.blockRange(s),l=a&&Zo(a,n,t);return l?(r&&r(e.tr.wrap(a,l).scrollIntoView()),!0):!1}}function If(n,t){return function(e,r){var o=e.selection,i=o.from,s=o.to,a=!1;return e.doc.nodesBetween(i,s,function(l,c){if(a)return!1;if(!(!l.isTextblock||l.hasMarkup(n,t)))if(l.type==n)a=!0;else{var u=e.doc.resolve(c),p=u.index();a=u.parent.canReplaceWith(p,p+1,n)}}),a?(r&&r(e.tr.setBlockType(i,s,n,t).scrollIntoView()),!0):!1}}function ui(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];return function(e,r,o){for(var i=0;i=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;var u=e.doc.resolve(a.start-2);c=new Kn(u,u,a.depth),a.endIndex=0;s--)i=S.from(e[s].type.create(e[s].attrs,i));n.step(new Ft(t.start-(r?2:0),t.end,t.start,t.end,new T(i,0,0),e.length,!0));for(var a=0,l=0;la;s--)i-=o.child(s).nodeSize,r.delete(i-1,i+1);var l=r.doc.resolve(e.start),c=l.nodeAfter;if(r.mapping.map(e.end)!=e.start+l.nodeAfter.nodeSize)return!1;var u=e.startIndex==0,p=e.endIndex==o.childCount,d=l.node(-1),h=l.index(-1);if(!d.canReplace(h+(u?0:1),h+1,c.content.append(p?S.empty:S.from(o))))return!1;var m=l.pos,g=m+c.nodeSize;return r.step(new Ft(m-(u?1:0),g+(p?1:0),m+1,g-1,new T((u?S.empty:S.from(o.copy(S.empty))).append(p?S.empty:S.from(o.copy(S.empty))),u?0:1,p?0:1),u?0:1)),t(r.scrollIntoView()),!0}function Jf(n){return function(t,e){var r=t.selection,o=r.$from,i=r.$to,s=o.blockRange(i,function(g){return g.childCount&&g.firstChild.type==n});if(!s)return!1;var a=s.startIndex;if(a==0)return!1;var l=s.parent,c=l.child(a-1);if(c.type!=n)return!1;if(e){var u=c.lastChild&&c.lastChild.type==l.type,p=S.from(u?n.create():null),d=new T(S.from(n.create(null,S.from(l.type.create(null,p)))),u?3:1,0),h=s.start,m=s.end;e(t.tr.step(new Ft(h-(u?3:1),m,h,m,d,1,!0)).scrollIntoView())}return!0}}var M={};if(typeof navigator!="undefined"&&typeof document!="undefined"){var pi=/Edge\/(\d+)/.exec(navigator.userAgent),Ha=/MSIE \d/.test(navigator.userAgent),di=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),hi=M.ie=!!(Ha||di||pi);M.ie_version=Ha?document.documentMode||6:di?+di[1]:pi?+pi[1]:null,M.gecko=!hi&&/gecko\/(\d+)/i.test(navigator.userAgent),M.gecko_version=M.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var mi=!hi&&/Chrome\/(\d+)/.exec(navigator.userAgent);M.chrome=!!mi,M.chrome_version=mi&&+mi[1],M.safari=!hi&&/Apple Computer/.test(navigator.vendor),M.ios=M.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),M.mac=M.ios||/Mac/.test(navigator.platform),M.android=/Android \d/.test(navigator.userAgent),M.webkit="webkitFontSmoothing"in document.documentElement.style,M.webkit_version=M.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var qt=function(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t},vi=function(n){var t=n.assignedSlot||n.parentNode;return t&&t.nodeType==11?t.host:t},Ja=null,Te=function(n,t,e){var r=Ja||(Ja=document.createRange());return r.setEnd(n,e==null?n.nodeValue.length:e),r.setStart(n,t||0),r},Wr=function(n,t,e,r){return e&&($a(n,t,e,r,-1)||$a(n,t,e,r,1))},$f=/^(img|br|input|textarea|hr)$/i;function $a(n,t,e,r,o){for(;;){if(n==e&&t==r)return!0;if(t==(o<0?0:me(n))){var i=n.parentNode;if(i.nodeType!=1||jf(n)||$f.test(n.nodeName)||n.contentEditable=="false")return!1;t=qt(n)+(o<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[t+(o<0?-1:0)],n.contentEditable=="false")return!1;t=o<0?me(n):0}else return!1}}function me(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function qf(n,t,e){for(var r=t==0,o=t==me(n);r||o;){if(n==e)return!0;var i=qt(n);if(n=n.parentNode,!n)return!1;r=r&&i==0,o=o&&i==me(n)}}function jf(n){for(var t,e=n;e&&!(t=e.pmViewDesc);e=e.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==n||t.contentDOM==n)}var gi=function(n){var t=n.isCollapsed;return t&&M.chrome&&n.rangeCount&&!n.getRangeAt(0).collapsed&&(t=!1),t};function Mn(n,t){var e=document.createEvent("Event");return e.initEvent("keydown",!0,!0),e.keyCode=n,e.key=e.code=t,e}function Wf(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Pe(n,t){return typeof n=="number"?n:n[t]}function Kf(n){var t=n.getBoundingClientRect(),e=t.width/n.offsetWidth||1,r=t.height/n.offsetHeight||1;return{left:t.left,right:t.left+n.clientWidth*e,top:t.top,bottom:t.top+n.clientHeight*r}}function qa(n,t,e){for(var r=n.someProp("scrollThreshold")||0,o=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument,s=e||n.dom;s;s=vi(s))if(s.nodeType==1){var a=s==i.body||s.nodeType!=1,l=a?Wf(i):Kf(s),c=0,u=0;if(t.topl.bottom-Pe(r,"bottom")&&(u=t.bottom-l.bottom+Pe(o,"bottom")),t.leftl.right-Pe(r,"right")&&(c=t.right-l.right+Pe(o,"right")),c||u)if(a)i.defaultView.scrollBy(c,u);else{var p=s.scrollLeft,d=s.scrollTop;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);var h=s.scrollLeft-p,m=s.scrollTop-d;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(a)break}}function Uf(n){for(var t=n.dom.getBoundingClientRect(),e=Math.max(0,t.top),r,o,i=(t.left+t.right)/2,s=e+1;s=e-20){r=a,o=l.top;break}}}return{refDOM:r,refTop:o,stack:ja(n.dom)}}function ja(n){for(var t=[],e=n.ownerDocument;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),n!=e);n=vi(n));return t}function Gf(n){var t=n.refDOM,e=n.refTop,r=n.stack,o=t?t.getBoundingClientRect().top:0;Wa(r,o==0?0:o-e)}function Wa(n,t){for(var e=0;e=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);var h=d.left>t.left?d.left-t.left:d.right=(d.left+d.right)/2?1:0));continue}}!e&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(i=c+1)}}return e&&e.nodeType==3?Xf(e,o):!e||r&&e.nodeType==1?{node:n,offset:i}:Ka(e,o)}function Xf(n,t){for(var e=n.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:n,offset:0}}function yi(n,t){return n.left>=t.left-1&&n.left<=t.right+1&&n.top>=t.top-1&&n.top<=t.bottom+1}function Qf(n,t){var e=n.parentNode;return e&&/^li$/i.test(e.nodeName)&&t.left(a.left+a.right)/2?1:-1}return n.docView.posFromDOM(o,i,s)}function tp(n,t,e,r){for(var o=-1,i=t;i!=n.dom;){var s=n.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else if(a.right-1?o:n.docView.posFromDOM(t,e)}function Ua(n,t,e){var r=n.childNodes.length;if(r&&e.topt.top&&s++}i==n.dom&&s==i.childNodes.length-1&&i.lastChild.nodeType==1&&t.top>i.lastChild.getBoundingClientRect().bottom?u=n.state.doc.content.size:(s==0||i.nodeType!=1||i.childNodes[s-1].nodeName!="BR")&&(u=tp(n,i,s,t))}u==null&&(u=Zf(n,c,t));var g=n.docView.nearestDesc(c,!0);return{pos:u,inside:g?g.posAtStart-g.border:-1}}function ze(n,t){var e=n.getClientRects();return e.length?e[t<0?0:e.length-1]:n.getBoundingClientRect()}var np=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ga(n,t,e){var r=n.docView.domFromPos(t,e<0?-1:1),o=r.node,i=r.offset,s=M.webkit||M.gecko;if(o.nodeType==3)if(s&&(np.test(o.nodeValue)||(e<0?!i:i==o.nodeValue.length))){var a=ze(Te(o,i,i),e);if(M.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i=0&&i==o.nodeValue.length?(u--,d=1):e<0?u--:p++,nr(ze(Te(o,u,p),d),d<0)}if(!n.state.doc.resolve(t).parent.inlineContent){if(i&&(e<0||i==me(o))){var h=o.childNodes[i-1];if(h.nodeType==1)return bi(h.getBoundingClientRect(),!1)}if(i=0)}if(i&&(e<0||i==me(o))){var g=o.childNodes[i-1],y=g.nodeType==3?Te(g,me(g)-(s?0:1)):g.nodeType==1&&(g.nodeName!="BR"||!g.nextSibling)?g:null;if(y)return nr(ze(y,1),!1)}if(i=0)}function nr(n,t){if(n.width==0)return n;var e=t?n.left:n.right;return{top:n.top,bottom:n.bottom,left:e,right:e}}function bi(n,t){if(n.height==0)return n;var e=t?n.top:n.bottom;return{top:e,bottom:e,left:n.left,right:n.right}}function Ya(n,t,e){var r=n.state,o=n.root.activeElement;r!=t&&n.updateState(t),o!=n.dom&&n.focus();try{return e()}finally{r!=t&&n.updateState(r),o!=n.dom&&o&&o.focus()}}function rp(n,t,e){var r=t.selection,o=e=="up"?r.$from:r.$to;return Ya(n,t,function(){for(var i=n.docView.domFromPos(o.pos,e=="up"?-1:1),s=i.node;;){var a=n.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.dom;break}s=a.dom.parentNode}for(var l=Ga(n,o.pos,1),c=s.firstChild;c;c=c.nextSibling){var u=void 0;if(c.nodeType==1)u=c.getClientRects();else if(c.nodeType==3)u=Te(c,0,c.nodeValue.length).getClientRects();else continue;for(var p=0;pd.top+1&&(e=="up"?l.top-d.top>(d.bottom-l.top)*2:d.bottom-l.bottom>(l.bottom-d.top)*2))return!1}}return!0})}var op=/[\u0590-\u08ac]/;function ip(n,t,e){var r=t.selection,o=r.$head;if(!o.parent.isTextblock)return!1;var i=o.parentOffset,s=!i,a=i==o.parent.content.size,l=n.root.getSelection();return!op.test(o.parent.textContent)||!l.modify?e=="left"||e=="backward"?s:a:Ya(n,t,function(){var c=l.getRangeAt(0),u=l.focusNode,p=l.focusOffset,d=l.caretBidiLevel;l.modify("move",e,"character");var h=o.depth?n.docView.domAfterPos(o.before()):n.dom,m=!h.contains(l.focusNode.nodeType==1?l.focusNode:l.focusNode.parentNode)||u==l.focusNode&&p==l.focusOffset;return l.removeAllRanges(),l.addRange(c),d!=null&&(l.caretBidiLevel=d),m})}var Xa=null,Qa=null,Za=!1;function sp(n,t,e){return Xa==t&&Qa==e?Za:(Xa=t,Qa=e,Za=e=="up"||e=="down"?rp(n,t,e):ip(n,t,e))}var le=0,tl=1,rr=2,Le=3,Q=function(t,e,r,o){this.parent=t,this.children=e,this.dom=r,r.pmViewDesc=this,this.contentDOM=o,this.dirty=le},ve={size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};Q.prototype.matchesWidget=function(){return!1},Q.prototype.matchesMark=function(){return!1},Q.prototype.matchesNode=function(){return!1},Q.prototype.matchesHack=function(t){return!1},Q.prototype.parseRule=function(){return null},Q.prototype.stopEvent=function(){return!1},ve.size.get=function(){for(var n=0,t=0;tqt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))l=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(e==0)for(var c=t;;c=c.parentNode){if(c==this.dom){l=!1;break}if(c.parentNode.firstChild!=c)break}if(l==null&&e==t.childNodes.length)for(var u=t;;u=u.parentNode){if(u==this.dom){l=!0;break}if(u.parentNode.lastChild!=u)break}}return(l==null?r>0:l)?this.posAtEnd:this.posAtStart},Q.prototype.nearestDesc=function(t,e){for(var r=!0,o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i&&(!e||i.node))if(r&&i.nodeDOM&&!(i.nodeDOM.nodeType==1?i.nodeDOM.contains(t.nodeType==1?t:t.parentNode):i.nodeDOM==t))r=!1;else return i}},Q.prototype.getDesc=function(t){for(var e=t.pmViewDesc,r=e;r;r=r.parent)if(r==this)return e},Q.prototype.posFromDOM=function(t,e,r){for(var o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i)return i.localPosFromDOM(t,e,r)}return-1},Q.prototype.descAt=function(t){for(var e=0,r=0;et||s instanceof ol){o=t-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(var l=void 0;r&&!(l=this.children[r-1]).size&&l instanceof el&&l.widget.type.side>=0;r--);if(e<=0){for(var c,u=!0;c=r?this.children[r-1]:null,!(!c||c.dom.parentNode==this.contentDOM);r--,u=!1);return c&&e&&u&&!c.border&&!c.domAtom?c.domFromPos(c.size,e):{node:this.contentDOM,offset:c?qt(c.dom)+1:0}}else{for(var p,d=!0;p=r=u&&e<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,e,u);t=s;for(var p=a;p>0;p--){var d=this.children[p-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){o=qt(d.dom)+1;break}t-=d.size}o==-1&&(o=0)}if(o>-1&&(c>e||a==this.children.length-1)){e=c;for(var h=a+1;hl&&se){var A=p;p=d,d=A}var B=document.createRange();B.setEnd(d.node,d.offset),B.setStart(p.node,p.offset),h.removeAllRanges(),h.addRange(B)}}},Q.prototype.ignoreMutation=function(t){return!this.contentDOM&&t.type!="selection"},ve.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},Q.prototype.markDirty=function(t,e){for(var r=0,o=0;o=r:tr){var a=r+i.border,l=s-i.border;if(t>=a&&e<=l){this.dirty=t==r||e==s?rr:tl,t==a&&e==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Le:i.markDirty(t-a,e-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM?rr:Le}r=s}this.dirty=rr},Q.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var r=t==1?rr:tl;e.dirty0&&(a=Si(a,0,r,i));for(var c=0;c-1?c:null,p=c&&c.pos<0,d=new Zt(this,u&&u.node);pp(this.node,this.innerDeco,function(h,m,g){h.spec.marks?d.syncToMarks(h.spec.marks,a,o):h.type.side>=0&&!g&&d.syncToMarks(m==s.node.childCount?J.none:s.node.child(m).marks,a,o),d.placeWidget(h,o,l)},function(h,m,g,y){d.syncToMarks(h.marks,a,o);var k;d.findNodeMatch(h,m,g,y)||p&&o.state.selection.from>l&&o.state.selection.to-1&&d.updateNodeAt(h,m,g,k,o)||d.updateNextNode(h,m,g,o,y)||d.addNode(h,m,g,o,l),l+=h.nodeSize}),d.syncToMarks(Fe,a,o),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||this.dirty==rr)&&(u&&this.protectLocalComposition(o,u),il(this.contentDOM,this.children,o),M.ios&&dp(this.dom))},t.prototype.localCompositionInfo=function(o,i){var s=o.state.selection,a=s.from,l=s.to;if(!(!(o.state.selection instanceof K)||ai+this.node.content.size)){var c=o.root.getSelection(),u=hp(c.focusNode,c.focusOffset);if(!(!u||!this.dom.contains(u.parentNode)))if(this.node.inlineContent){var p=u.nodeValue,d=mp(this.node.content,p,a-i,l-i);return d<0?null:{node:u,pos:d,text:p}}else return{node:u,pos:-1}}},t.prototype.protectLocalComposition=function(o,i){var s=i.node,a=i.pos,l=i.text;if(!this.getDesc(s)){for(var c=s;c.parentNode!=this.contentDOM;c=c.parentNode){for(;c.previousSibling;)c.parentNode.removeChild(c.previousSibling);for(;c.nextSibling;)c.parentNode.removeChild(c.nextSibling);c.pmViewDesc&&(c.pmViewDesc=null)}var u=new ap(this,c,s,l);o.compositionNodes.push(u),this.children=Si(this.children,a,a+l.length,o,u)}},t.prototype.update=function(o,i,s,a){return this.dirty==Le||!o.sameMarkup(this.node)?!1:(this.updateInner(o,i,s,a),!0)},t.prototype.updateInner=function(o,i,s,a){this.updateOuterDeco(i),this.node=o,this.innerDeco=s,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=le},t.prototype.updateOuterDeco=function(o){if(!wi(o,this.outerDeco)){var i=this.nodeDOM.nodeType!=1,s=this.dom;this.dom=sl(this.dom,this.nodeDOM,ki(this.outerDeco,this.node,i),ki(o,this.node,i)),this.dom!=s&&(s.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=o}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")},e.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(t.prototype,e),t}(Q);function nl(n,t,e,r,o){return al(r,t,n),new or(null,n,t,e,r,r,r,o,0)}var rl=function(n){function t(r,o,i,s,a,l,c){n.call(this,r,o,i,s,a,null,l,c)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){for(var o=this.nodeDOM.parentNode;o&&o!=this.dom&&!o.pmIsDeco;)o=o.parentNode;return{skip:o||!0}},t.prototype.update=function(o,i,s,a){return this.dirty==Le||this.dirty!=le&&!this.inParent()||!o.sameMarkup(this.node)?!1:(this.updateOuterDeco(i),(this.dirty!=le||o.text!=this.node.text)&&o.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=o.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=o,this.dirty=le,!0)},t.prototype.inParent=function(){for(var o=this.parent.contentDOM,i=this.nodeDOM;i;i=i.parentNode)if(i==o)return!0;return!1},t.prototype.domFromPos=function(o){return{node:this.nodeDOM,offset:o}},t.prototype.localPosFromDOM=function(o,i,s){return o==this.nodeDOM?this.posAtStart+Math.min(i,this.node.text.length):n.prototype.localPosFromDOM.call(this,o,i,s)},t.prototype.ignoreMutation=function(o){return o.type!="characterData"&&o.type!="selection"},t.prototype.slice=function(o,i,s){var a=this.node.cut(o,i),l=document.createTextNode(a.text);return new t(this.parent,a,this.outerDeco,this.innerDeco,l,l,s)},t.prototype.markDirty=function(o,i){n.prototype.markDirty.call(this,o,i),this.dom!=this.nodeDOM&&(o==0||i==this.nodeDOM.nodeValue.length)&&(this.dirty=Le)},e.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,e),t}(or),ol=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(o){return this.dirty==le&&this.dom.nodeName==o},e.domAtom.get=function(){return!0},e.ignoreForCoords.get=function(){return this.dom.nodeName=="IMG"},Object.defineProperties(t.prototype,e),t}(Q),lp=function(n){function t(e,r,o,i,s,a,l,c,u,p){n.call(this,e,r,o,i,s,a,l,u,p),this.spec=c}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.update=function(r,o,i,s){if(this.dirty==Le)return!1;if(this.spec.update){var a=this.spec.update(r,o,i);return a&&this.updateInner(r,o,i,s),a}else return!this.contentDOM&&!r.isLeaf?!1:n.prototype.update.call(this,r,o,i,s)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():n.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():n.prototype.deselectNode.call(this)},t.prototype.setSelection=function(r,o,i,s){this.spec.setSelection?this.spec.setSelection(r,o,i):n.prototype.setSelection.call(this,r,o,i,s)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),n.prototype.destroy.call(this)},t.prototype.stopEvent=function(r){return this.spec.stopEvent?this.spec.stopEvent(r):!1},t.prototype.ignoreMutation=function(r){return this.spec.ignoreMutation?this.spec.ignoreMutation(r):n.prototype.ignoreMutation.call(this,r)},t}(or);function il(n,t,e){for(var r=n.firstChild,o=!1,i=0;i>1,s=Math.min(i,t.length);o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var c=Kr.create(this.top,t[i],e,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}},Zt.prototype.findNodeMatch=function(t,e,r,o){var i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,e,r))i=this.top.children.indexOf(s,this.index);else for(var a=this.index,l=Math.min(this.top.children.length,a+5);a0;){for(var a=void 0;;)if(r){var l=e.children[r-1];if(l instanceof Kr)e=l,r=l.children.length;else{a=l,r--;break}}else{if(e==t)break t;r=e.parent.children.indexOf(e),e=e.parent}var c=a.node;if(!!c){if(c!=n.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function fp(n,t){return n.type.side-t.type.side}function pp(n,t,e,r){var o=t.locals(n),i=0;if(o.length==0){for(var s=0;si;)c.push(o[l++]);var b=i+g.nodeSize;if(g.isText){var N=b;l0){if(n.childNodes.length>t&&n.childNodes[t].nodeType==3)return n.childNodes[t];n=n.childNodes[t-1],t=me(n)}else if(n.nodeType==1&&t=e){var u=l.lastIndexOf(t,r-a);if(u>=0&&u+t.length+a>=e)return a+u}}}return-1}function Si(n,t,e,r,o){for(var i=[],s=0,a=0;s=e||u<=t?i.push(l):(ce&&i.push(l.slice(e-c,l.size,r)))}return i}function cl(n,t){var e=n.root.getSelection(),r=n.state.doc;if(!e.focusNode)return null;var o=n.docView.nearestDesc(e.focusNode),i=o&&o.size==0,s=n.docView.posFromDOM(e.focusNode,e.focusOffset);if(s<0)return null;var a=r.resolve(s),l,c;if(gi(e)){for(l=a;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&P.isSelectable(o.node)&&o.parent&&!(o.node.isInline&&qf(e.focusNode,e.focusOffset,o.dom))){var u=o.posBefore;c=new P(s==u?a:r.resolve(u))}}else{var p=n.docView.posFromDOM(e.anchorNode,e.anchorOffset);if(p<0)return null;l=r.resolve(p)}if(!c){var d=t=="pointer"||n.state.selection.head0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?n.doc.resolve(t>0?i.after():i.before()):null:i;return s&&z.findFrom(s,t)}function rn(n,t){return n.dispatch(n.state.tr.setSelection(t).scrollIntoView()),!0}function vl(n,t,e){var r=n.state.selection;if(r instanceof K){if(!r.empty||e.indexOf("s")>-1)return!1;if(n.endOfTextblock(t>0?"right":"left")){var o=Ei(n.state,t);return o&&o instanceof P?rn(n,o):!1}else if(!(M.mac&&e.indexOf("m")>-1)){var i=r.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;var l=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=n.docView.descAt(l))&&!a.contentDOM?P.isSelectable(s)?rn(n,new P(t<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):M.webkit?rn(n,new K(n.state.doc.resolve(t<0?l:l+s.nodeSize))):!1:!1}}else{if(r instanceof P&&r.node.isInline)return rn(n,new K(t>0?r.$to:r.$from));var c=Ei(n.state,t);return c?rn(n,c):!1}}function Ur(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function sr(n){var t=n.pmViewDesc;return t&&t.size==0&&(n.nextSibling||n.nodeName!="BR")}function Oi(n){var t=n.root.getSelection(),e=t.focusNode,r=t.focusOffset;if(!!e){var o,i,s=!1;for(M.gecko&&e.nodeType==1&&r0){if(e.nodeType!=1)break;var a=e.childNodes[r-1];if(sr(a))o=e,i=--r;else if(a.nodeType==3)e=a,r=e.nodeValue.length;else break}else{if(gl(e))break;for(var l=e.previousSibling;l&&sr(l);)o=e.parentNode,i=qt(l),l=l.previousSibling;if(l)e=l,r=Ur(e);else{if(e=e.parentNode,e==n.dom)break;r=0}}s?Ti(n,t,e,r):o&&Ti(n,t,o,i)}}function Ni(n){var t=n.root.getSelection(),e=t.focusNode,r=t.focusOffset;if(!!e){for(var o=Ur(e),i,s;;)if(r-1||M.mac&&e.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||n.endOfTextblock(t<0?"up":"down")){var s=Ei(n.state,t);if(s&&s instanceof P)return rn(n,s)}if(!o.parent.inlineContent){var a=t<0?o:i,l=r instanceof Ne?z.near(a,t):z.findFrom(a,t);return l?rn(n,l):!1}return!1}function bl(n,t){if(!(n.state.selection instanceof K))return!0;var e=n.state.selection,r=e.$head,o=e.$anchor,i=e.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(n.endOfTextblock(t>0?"forward":"backward"))return!0;var s=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=n.state.tr;return t<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),n.dispatch(a),!0}return!1}function kl(n,t,e){n.domObserver.stop(),t.contentEditable=e,n.domObserver.start()}function kp(n){if(!(!M.safari||n.state.selection.$head.parentOffset>0)){var t=n.root.getSelection(),e=t.focusNode,r=t.focusOffset;if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){var o=e.firstChild;kl(n,o,!0),setTimeout(function(){return kl(n,o,!1)},20)}}}function wp(n){var t="";return n.ctrlKey&&(t+="c"),n.metaKey&&(t+="m"),n.altKey&&(t+="a"),n.shiftKey&&(t+="s"),t}function Sp(n,t){var e=t.keyCode,r=wp(t);return e==8||M.mac&&e==72&&r=="c"?bl(n,-1)||Oi(n):e==46||M.mac&&e==68&&r=="c"?bl(n,1)||Ni(n):e==13||e==27?!0:e==37?vl(n,-1,r)||Oi(n):e==39?vl(n,1,r)||Ni(n):e==38?yl(n,-1,r)||Oi(n):e==40?kp(n)||yl(n,1,r)||Ni(n):r==(M.mac?"m":"c")&&(e==66||e==73||e==89||e==90)}function xp(n,t,e){var r=n.docView.parseRange(t,e),o=r.node,i=r.fromOffset,s=r.toOffset,a=r.from,l=r.to,c=n.root.getSelection(),u=null,p=c.anchorNode;if(p&&n.dom.contains(p.nodeType==1?p:p.parentNode)&&(u=[{node:p,offset:c.anchorOffset}],gi(c)||u.push({node:c.focusNode,offset:c.focusOffset})),M.chrome&&n.lastKeyCode===8)for(var d=s;d>i;d--){var h=o.childNodes[d-1],m=h.pmViewDesc;if(h.nodeName=="BR"&&!m){s=d;break}if(!m||m.size)break}var g=n.state.doc,y=n.someProp("domParser")||se.fromSchema(n.state.schema),k=g.resolve(a),b=null,N=y.parse(o,{topNode:k.parent,topMatch:k.parent.contentMatchAt(k.index()),topOpen:!0,from:i,to:s,preserveWhitespace:k.parent.type.spec.code?"full":!0,editableContent:!0,findPositions:u,ruleFromNode:Mp,context:k});if(u&&u[0].pos!=null){var v=u[0].pos,E=u[1]&&u[1].pos;E==null&&(E=v),b={anchor:v+a,head:E+a}}return{doc:N,sel:b,from:a,to:l}}function Mp(n){var t=n.pmViewDesc;if(t)return t.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(M.safari&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){var e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(n.parentNode.lastChild==n||M.safari&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0}}function Cp(n,t,e,r,o){if(t<0){var i=n.lastSelectionTime>Date.now()-50?n.lastSelectionOrigin:null,s=cl(n,i);if(s&&!n.state.selection.eq(s)){var a=n.state.tr.setSelection(s);i=="pointer"?a.setMeta("pointer",!0):i=="key"&&a.scrollIntoView(),n.dispatch(a)}return}var l=n.state.doc.resolve(t),c=l.sharedDepth(e);t=l.before(c+1),e=n.state.doc.resolve(e).after(c+1);var u=n.state.selection,p=xp(n,t,e);if(M.chrome&&n.cursorWrapper&&p.sel&&p.sel.anchor==n.cursorWrapper.deco.from){var d=n.cursorWrapper.deco.type.toDOM.nextSibling,h=d&&d.nodeValue?d.nodeValue.length:1;p.sel={anchor:p.sel.anchor+h,head:p.sel.anchor+h}}var m=n.state.doc,g=m.slice(p.from,p.to),y,k;n.lastKeyCode===8&&Date.now()-100Date.now()-225||M.android)&&o.some(function(X){return X.nodeName=="DIV"||X.nodeName=="P"})&&n.someProp("handleKeyDown",function(X){return X(n,Mn(13,"Enter"))})){n.lastIOSEnter=0;return}else{if(p.sel){var N=wl(n,n.state.doc,p.sel);N&&!N.eq(n.state.selection)&&n.dispatch(n.state.tr.setSelection(N))}return}n.domChangeCount++,n.state.selection.fromn.state.selection.from&&b.start<=n.state.selection.from+2?b.start=n.state.selection.from:b.endA=n.state.selection.to-2&&(b.endB+=n.state.selection.to-b.endA,b.endA=n.state.selection.to)),M.ie&&M.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>p.from&&p.doc.textBetween(b.start-p.from-1,b.start-p.from+1)==" \xA0"&&(b.start--,b.endA--,b.endB--);var v=p.doc.resolveNoCache(b.start-p.from),E=p.doc.resolveNoCache(b.endB-p.from),C=v.sameParent(E)&&v.parent.inlineContent,A;if((M.ios&&n.lastIOSEnter>Date.now()-225&&(!C||o.some(function(X){return X.nodeName=="DIV"||X.nodeName=="P"}))||!C&&v.posb.start&&Op(m,b.start,b.endA,v,E)&&n.someProp("handleKeyDown",function(X){return X(n,Mn(8,"Backspace"))})){M.android&&M.chrome&&n.domObserver.suppressSelectionUpdates();return}M.chrome&&M.android&&b.toB==b.from&&(n.lastAndroidDelete=Date.now()),M.android&&!C&&v.start()!=E.start()&&E.parentOffset==0&&v.depth==E.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==b.endA&&(b.endB-=2,E=p.doc.resolveNoCache(b.endB-p.from),setTimeout(function(){n.someProp("handleKeyDown",function(X){return X(n,Mn(13,"Enter"))})},20));var B=b.start,V=b.endA,F,st,et,U;if(C){if(v.pos==E.pos)M.ie&&M.ie_version<=11&&v.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(function(){return He(n)},20)),F=n.state.tr.delete(B,V),st=m.resolve(b.start).marksAcross(m.resolve(b.endA));else if(b.endA==b.endB&&(U=m.resolve(b.start))&&(et=Ep(v.parent.content.cut(v.parentOffset,E.parentOffset),U.parent.content.cut(U.parentOffset,b.endA-U.start()))))F=n.state.tr,et.type=="add"?F.addMark(B,V,et.mark):F.removeMark(B,V,et.mark);else if(v.parent.child(v.index()).isText&&v.index()==E.index()-(E.textOffset?0:1)){var Nt=v.parent.textBetween(v.parentOffset,E.parentOffset);if(n.someProp("handleTextInput",function(X){return X(n,B,V,Nt)}))return;F=n.state.tr.insertText(Nt,B,V)}}if(F||(F=n.state.tr.replace(B,V,p.doc.slice(b.start-p.from,b.endB-p.from))),p.sel){var Z=wl(n,F.doc,p.sel);Z&&!(M.chrome&&M.android&&n.composing&&Z.empty&&(b.start!=b.endB||n.lastAndroidDeletet.content.size?null:Mi(n,t.resolve(e.anchor),t.resolve(e.head))}function Ep(n,t){for(var e=n.firstChild.marks,r=t.firstChild.marks,o=e,i=r,s,a,l,c=0;ce||_i(s,!0,!1)0&&(t||n.indexAfter(r)==n.node(r).childCount);)r--,o++,t=!1;if(e)for(var i=n.node(r).maybeChild(n.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Np(n,t,e,r,o){var i=n.findDiffStart(t,e);if(i==null)return null;var s=n.findDiffEnd(t,e+n.size,e+t.size),a=s.a,l=s.b;if(o=="end"){var c=Math.max(0,i-Math.min(a,l));r-=a+c-i}if(a=a?i-r:0;i-=u,l=i+(l-a),a=i}else if(l=l?i-r:0;i-=p,a=i+(a-l),l=i}return{start:i,endA:a,endB:l}}function Sl(n,t){for(var e=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;var s=r.firstChild;e.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),r=s.content}var a=n.someProp("clipboardSerializer")||ht.fromSchema(n.state.schema),l=_l(),c=l.createElement("div");c.appendChild(a.serializeFragment(r,{document:l}));for(var u=c.firstChild,p;u&&u.nodeType==1&&(p=Nl[u.nodeName.toLowerCase()]);){for(var d=p.length-1;d>=0;d--){for(var h=l.createElement(p[d]);c.firstChild;)h.appendChild(c.firstChild);c.appendChild(h),p[d]!="tbody"&&(o++,i++)}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(e));var m=n.someProp("clipboardTextSerializer",function(g){return g(t)})||t.content.textBetween(0,t.content.size,` - -`);return{dom:c,text:m}}function xl(n,t,e,r,o){var i,s=o.parent.type.spec.code,a;if(!e&&!t)return null;var l=t&&(r||s||!e);if(l){if(n.someProp("transformPastedText",function(E){t=E(t,s||r)}),s)return t?new T(S.from(n.state.schema.text(t.replace(/\r\n?/g,` -`))),0,0):T.empty;var c=n.someProp("clipboardTextParser",function(E){return E(t,o,r)});if(c)a=c;else{var u=o.marks(),p=n.state,d=p.schema,h=ht.fromSchema(d);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(function(E){var C=i.appendChild(document.createElement("p"));E&&C.appendChild(h.serializeNode(d.text(E,u)))})}}else n.someProp("transformPastedHTML",function(E){e=E(e)}),i=_p(e),M.webkit&&Ap(i);var m=i&&i.querySelector("[data-pm-slice]"),g=m&&/^(\d+) (\d+) (.*)/.exec(m.getAttribute("data-pm-slice"));if(!a){var y=n.someProp("clipboardParser")||n.someProp("domParser")||se.fromSchema(n.state.schema);a=y.parseSlice(i,{preserveWhitespace:!!(l||g),context:o,ruleFromNode:function(C){if(C.nodeName=="BR"&&!C.nextSibling)return{ignore:!0}}})}if(g)a=Dp(Ol(a,+g[1],+g[2]),g[3]);else if(a=T.maxOpen(Tp(a.content,o),!0),a.openStart||a.openEnd){for(var k=0,b=0,N=a.content.firstChild;k=0;r--){var o=e(r);if(o)return o.v}return n}function Ml(n,t,e){e===void 0&&(e=0);for(var r=t.length-1;r>=e;r--)n=t[r].create(null,S.from(n));return n}function Cl(n,t,e,r,o){if(o=e&&(a=t<0?s.contentMatchAt(0).fillBefore(a,n.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(S.empty,!0))),n.replaceChild(t<0?0:n.childCount-1,s.copy(a))}function Ol(n,t,e){return t]*>)*/.exec(n);t&&(n=n.slice(t[0].length));var e=_l().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),o;if((o=r&&Nl[r[1].toLowerCase()])&&(n=o.map(function(s){return"<"+s+">"}).join("")+n+o.map(function(s){return""}).reverse().join("")),e.innerHTML=n,o)for(var i=0;i=0;a-=2){var l=e.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=S.from(l.create(r[a+1],o)),i++,s++}return new T(o,i,s)}var Rp={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Di=M.ie&&M.ie_version<=11,Ri=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Ri.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},Ri.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var jt=function(t,e){var r=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(o){for(var i=0;is.target.nodeValue.length})?r.flushSoon():r.flush()}),this.currentSelection=new Ri,Di&&(this.onCharData=function(o){r.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};jt.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){t.flushingSoon=-1,t.flush()},20))},jt.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},jt.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Rp),Di&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},jt.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var r=0;r-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Ci(this.view)&&!this.ignoreSelectionChange(e),o=-1,i=-1,s=!1,a=[];if(this.view.editable)for(var l=0;l1){var u=a.filter(function(h){return h.nodeName=="BR"});if(u.length==2){var p=u[0],d=u[1];p.parentNode&&p.parentNode.parentNode==d.parentNode?d.remove():p.remove()}}(o>-1||r)&&(o>-1&&(this.view.docView.markDirty(o,i),Vp(this.view)),this.handleDOMChange(o,i,s,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||He(this.view),this.currentSelection.set(e))}},jt.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(var o=0;oi.depth?u(n,e,i.nodeAfter,i.before(c),o,!0):u(n,e,i.node(c),i.before(c),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var l=s(a);if(l)return l.v}return!1}function En(n,t,e){n.focused||n.focus();var r=n.state.tr.setSelection(t);e=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Fp(n,t){if(t==-1)return!1;var e=n.state.doc.resolve(t),r=e.nodeAfter;return r&&r.isAtom&&P.isSelectable(r)?(En(n,new P(e),"pointer"),!0):!1}function Hp(n,t){if(t==-1)return!1;var e=n.state.selection,r,o;e instanceof P&&(r=e.node);for(var i=n.state.doc.resolve(t),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(P.isSelectable(a)){r&&e.$from.depth>0&&s>=e.$from.depth&&i.before(e.$from.depth+1)==e.$from.pos?o=i.before(e.$from.depth):o=i.before(s);break}}return o!=null?(En(n,P.create(n.state.doc,o),"pointer"),!0):!1}function Jp(n,t,e,r,o){return Bi(n,"handleClickOn",t,e,r)||n.someProp("handleClick",function(i){return i(n,t,r)})||(o?Hp(n,e):Fp(n,e))}function $p(n,t,e,r){return Bi(n,"handleDoubleClickOn",t,e,r)||n.someProp("handleDoubleClick",function(o){return o(n,t,r)})}function qp(n,t,e,r){return Bi(n,"handleTripleClickOn",t,e,r)||n.someProp("handleTripleClick",function(o){return o(n,t,r)})||jp(n,e,r)}function jp(n,t,e){if(e.button!=0)return!1;var r=n.state.doc;if(t==-1)return r.inlineContent?(En(n,K.create(r,0,r.content.size),"pointer"),!0):!1;for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)En(n,K.create(r,a+1,a+1+s.content.size),"pointer");else if(P.isSelectable(s))En(n,P.create(r,a),"pointer");else continue;return!0}}function Pi(n){return Xr(n)}var Dl=M.mac?"metaKey":"ctrlKey";Jt.mousedown=function(n,t){n.shiftKey=t.shiftKey;var e=Pi(n),r=Date.now(),o="singleClick";r-n.lastClick.time<500&&Lp(t,n.lastClick)&&!t[Dl]&&(n.lastClick.type=="singleClick"?o="doubleClick":n.lastClick.type=="doubleClick"&&(o="tripleClick")),n.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=n.posAtCoords(Gr(t));!i||(o=="singleClick"?(n.mouseDown&&n.mouseDown.done(),n.mouseDown=new Yr(n,i,t,e)):(o=="doubleClick"?$p:qp)(n,i.pos,i.inside,t)?t.preventDefault():on(n,"pointer"))};var Yr=function(t,e,r,o){var i=this;this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=r,this.flushed=o,this.selectNode=r[Dl],this.allowDefault=r.shiftKey,this.delayedSelectionSync=!1;var s,a;if(e.inside>-1)s=t.state.doc.nodeAt(e.inside),a=e.inside;else{var l=t.state.doc.resolve(e.pos);s=l.parent,a=l.depth?l.before():0}this.mightDrag=null;var c=o?null:r.target,u=c?t.docView.nearestDesc(c,!0):null;this.target=u?u.dom:null;var p=t.state,d=p.selection;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof P&&d.from<=a&&d.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&M.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){i.view.mouseDown==i&&i.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),on(t,"pointer")};Yr.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return He(t.view)}),this.view.mouseDown=null},Yr.prototype.up=function(t){if(this.done(),!!this.view.dom.contains(t.target.nodeType==3?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Gr(t))),this.allowDefault||!e?on(this.view,"pointer"):Jp(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||M.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||M.chrome&&!(this.view.state.selection instanceof K)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(En(this.view,z.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):on(this.view,"pointer")}},Yr.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),on(this.view,"pointer"),t.buttons==0&&this.done()},Jt.touchdown=function(n){Pi(n),on(n,"pointer")},Jt.contextmenu=function(n){return Pi(n)};function Rl(n,t){return n.composing?!0:M.safari&&Math.abs(t.timeStamp-n.compositionEndedAt)<500?(n.compositionEndedAt=-2e8,!0):!1}var Wp=M.android?5e3:-1;Rt.compositionstart=Rt.compositionupdate=function(n){if(!n.composing){n.domObserver.flush();var t=n.state,e=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!e.textOffset&&e.parentOffset&&e.nodeBefore.marks.some(function(a){return a.type.spec.inclusive===!1})))n.markCursor=n.state.storedMarks||e.marks(),Xr(n,!0),n.markCursor=null;else if(Xr(n),M.gecko&&t.selection.empty&&e.parentOffset&&!e.textOffset&&e.nodeBefore.marks.length)for(var r=n.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){r.collapse(s,s.nodeValue.length);break}else o=s,i=-1}n.composing=!0}Vl(n,Wp)},Rt.compositionend=function(n,t){n.composing&&(n.composing=!1,n.compositionEndedAt=t.timeStamp,Vl(n,20))};function Vl(n,t){clearTimeout(n.composingTimeout),t>-1&&(n.composingTimeout=setTimeout(function(){return Xr(n)},t))}function Il(n){for(n.composing&&(n.composing=!1,n.compositionEndedAt=Kp());n.compositionNodes.length>0;)n.compositionNodes.pop().markParentsDirty()}function Kp(){var n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Xr(n,t){if(n.domObserver.forceFlush(),Il(n),t||n.docView.dirty){var e=cl(n);return e&&!e.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(e)):n.updateState(n.state),!0}return!1}function Up(n,t){if(!!n.dom.parentNode){var e=n.dom.parentNode.appendChild(document.createElement("div"));e.appendChild(t),e.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),n.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e),n.focus()},50)}}var On=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;Jt.copy=Rt.cut=function(n,t){var e=n.state.selection,r=t.type=="cut";if(!e.empty){var o=On?null:t.clipboardData,i=e.content(),s=Sl(n,i),a=s.dom,l=s.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):Up(n,a),r&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}};function Gp(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Yp(n,t){if(!!n.dom.parentNode){var e=n.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(e?"textarea":"div"));e||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(function(){n.focus(),r.parentNode&&r.parentNode.removeChild(r),e?zi(n,r.value,null,t):zi(n,r.textContent,r.innerHTML,t)},50)}}function zi(n,t,e,r){var o=xl(n,t,e,n.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",function(a){return a(n,r,o||T.empty)}))return!0;if(!o)return!1;var i=Gp(o),s=i?n.state.tr.replaceSelectionWith(i,n.shiftKey):n.state.tr.replaceSelection(o);return n.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Rt.paste=function(n,t){var e=On?null:t.clipboardData;e&&zi(n,e.getData("text/plain"),e.getData("text/html"),t)?t.preventDefault():Yp(n,t)};var Xp=function(t,e){this.slice=t,this.move=e},Bl=M.mac?"altKey":"ctrlKey";Jt.dragstart=function(n,t){var e=n.mouseDown;if(e&&e.done(),!!t.dataTransfer){var r=n.state.selection,o=r.empty?null:n.posAtCoords(Gr(t));if(!(o&&o.pos>=r.from&&o.pos<=(r instanceof P?r.to-1:r.to))){if(e&&e.mightDrag)n.dispatch(n.state.tr.setSelection(P.create(n.state.doc,e.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){var i=n.docView.nearestDesc(t.target,!0);i&&i.node.type.spec.draggable&&i!=n.docView&&n.dispatch(n.state.tr.setSelection(P.create(n.state.doc,i.posBefore)))}}var s=n.state.selection.content(),a=Sl(n,s),l=a.dom,c=a.text;t.dataTransfer.clearData(),t.dataTransfer.setData(On?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",On||t.dataTransfer.setData("text/plain",c),n.dragging=new Xp(s,!t[Bl])}},Jt.dragend=function(n){var t=n.dragging;window.setTimeout(function(){n.dragging==t&&(n.dragging=null)},50)},Rt.dragover=Rt.dragenter=function(n,t){return t.preventDefault()},Rt.drop=function(n,t){var e=n.dragging;if(n.dragging=null,!!t.dataTransfer){var r=n.posAtCoords(Gr(t));if(!!r){var o=n.state.doc.resolve(r.pos);if(!!o){var i=e&&e.slice;i?n.someProp("transformPasted",function(m){i=m(i)}):i=xl(n,t.dataTransfer.getData(On?"Text":"text/plain"),On?null:t.dataTransfer.getData("text/html"),!1,o);var s=e&&!t[Bl];if(n.someProp("handleDrop",function(m){return m(n,t,i||T.empty,s)})){t.preventDefault();return}if(!!i){t.preventDefault();var a=i?ha(n.state.doc,o.pos,i):o.pos;a==null&&(a=o.pos);var l=n.state.tr;s&&l.deleteSelection();var c=l.mapping.map(a),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,p=l.doc;if(u?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),!l.doc.eq(p)){var d=l.doc.resolve(c);if(u&&P.isSelectable(i.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new P(d));else{var h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach(function(m,g,y,k){return h=k}),l.setSelection(Mi(n,d,l.doc.resolve(h)))}n.focus(),n.dispatch(l.setMeta("uiEvent","drop"))}}}}}},Jt.focus=function(n){n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(function(){n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.root.getSelection())&&He(n)},20))},Jt.blur=function(n,t){n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.set({}),n.focused=!1)},Jt.beforeinput=function(n,t){if(M.chrome&&M.android&&t.inputType=="deleteContentBackward"){var e=n.domChangeCount;setTimeout(function(){if(n.domChangeCount==e&&(n.dom.blur(),n.focus(),!n.someProp("handleKeyDown",function(i){return i(n,Mn(8,"Backspace"))}))){var r=n.state.selection,o=r.$cursor;o&&o.pos>0&&n.dispatch(n.state.tr.delete(o.pos-1,o.pos).scrollIntoView())}},50)}};for(var Pl in Rt)Jt[Pl]=Rt[Pl];function ar(n,t){if(n==t)return!0;for(var e in n)if(n[e]!==t[e])return!1;for(var r in t)if(!(r in n))return!1;return!0}var Nn=function(t,e){this.spec=e||sn,this.side=this.spec.side||0,this.toDOM=t};Nn.prototype.map=function(t,e,r,o){var i=t.mapResult(e.from+o,this.side<0?-1:1),s=i.pos,a=i.deleted;return a?null:new ut(s-r,s-r,this)},Nn.prototype.valid=function(){return!0},Nn.prototype.eq=function(t){return this==t||t instanceof Nn&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ar(this.spec,t.spec))},Nn.prototype.destroy=function(t){this.spec.destroy&&this.spec.destroy(t)};var ce=function(t,e){this.spec=e||sn,this.attrs=t};ce.prototype.map=function(t,e,r,o){var i=t.map(e.from+o,this.spec.inclusiveStart?-1:1)-r,s=t.map(e.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new ut(i,s,this)},ce.prototype.valid=function(t,e){return e.from=t&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(var l=0;lt){var c=this.children[l]+1;this.children[l+2].findInner(t-c,e-c,r,o+c,i)}},Y.prototype.map=function(t,e,r){return this==vt||t.maps.length==0?this:this.mapInner(t,e,0,0,r||sn)},Y.prototype.mapInner=function(t,e,r,o,i){for(var s,a=0;aa&&u.to=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var s=t+1,a=s+e.content.size,l=0;ls&&c.type instanceof ce){var u=Math.max(s,c.from)-s,p=Math.min(a,c.to)-s;uX+i||(et>=a[Z]+i?a[Z+1]=-1:U>=o&&(Tt=Nt-U-(et-st))&&(a[Z]+=Tt,a[Z+1]+=Tt))}},c=0;c=r.content.size){u=!0;continue}var m=e.map(n[p+1]+i,-1),g=m-o,y=r.content.findIndex(h),k=y.index,b=y.offset,N=r.maybeChild(k);if(N&&b==h&&b+N.nodeSize==g){var v=a[p+2].mapInner(e,N,d+1,n[p]+i+1,s);v!=vt?(a[p]=h,a[p+1]=g,a[p+2]=v):(a[p+1]=-2,u=!0)}else u=!0}if(u){var E=Zp(a,n,t||[],e,o,i,s),C=Zr(E,r,0,s);t=C.local;for(var A=0;Ae&&s.to0;)t++;n.splice(t,0,e)}function Hi(n){var t=[];return n.someProp("decorations",function(e){var r=e(n.state);r&&r!=vt&&t.push(r)}),n.cursorWrapper&&t.push(Y.create(n.state.doc,[n.cursorWrapper.deco])),te.from(t)}var ct=function(t,e){this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Wl),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ql(this),this.markCursor=null,this.cursorWrapper=null,$l(this),this.nodeViews=jl(this),this.docView=nl(this.state.doc,Jl(this),Hi(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,Ip(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},to={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};to.props.get=function(){if(this._props.state!=this.state){var n=this._props;this._props={};for(var t in n)this._props[t]=n[t];this._props.state=this.state}return this._props},ct.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Vi(this),this._props=t,t.plugins&&(t.plugins.forEach(Wl),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)},ct.prototype.setProps=function(t){var e={};for(var r in this._props)e[r]=this._props[r];e.state=this.state;for(var o in t)e[o]=t[o];this.update(e)},ct.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},ct.prototype.updateStateInner=function(t,e){var r=this,o=this.state,i=!1,s=!1;if(t.storedMarks&&this.composing&&(Il(this),s=!0),this.state=t,e){var a=jl(this);ed(a,this.nodeViews)&&(this.nodeViews=a,i=!0),Vi(this)}this.editable=ql(this),$l(this);var l=Hi(this),c=Jl(this),u=e?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",p=i||!this.docView.matchesNode(t.doc,c,l);(p||!t.selection.eq(o.selection))&&(s=!0);var d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Uf(this);if(s){this.domObserver.stop();var h=p&&(M.ie||M.chrome)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&td(o.selection,t.selection);if(p){var m=M.chrome?this.trackWrites=this.root.getSelection().focusNode:null;(i||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=nl(t.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&bp(this))?He(this,h):(hl(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),u=="reset")this.dom.scrollTop=0;else if(u=="to selection"){var g=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(y){return y(r)})||(t.selection instanceof P?qa(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),g):qa(this,this.coordsAtPos(t.selection.head,1),g))}else d&&Gf(d)},ct.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},ct.prototype.updatePluginViews=function(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Kl=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),nd=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),rd=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),Ul=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),od=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),id=Kl&&(Ul||+Kl[1]<57)||rd&&Ul,gt=0;gt<10;gt++)Je[48+gt]=Je[96+gt]=String(gt);for(var gt=1;gt<=24;gt++)Je[gt+111]="F"+gt;for(var gt=65;gt<=90;gt++)Je[gt]=String.fromCharCode(gt+32),eo[gt]=String.fromCharCode(gt);for(var Ji in Je)eo.hasOwnProperty(Ji)||(eo[Ji]=Je[Ji]);function sd(n){var t=id&&(n.ctrlKey||n.altKey||n.metaKey)||(nd||od)&&n.shiftKey&&n.key&&n.key.length==1,e=!t&&n.key||(n.shiftKey?eo:Je)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}var ad=typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function ld(n){var t=n.split(/-(?!$)/),e=t[t.length-1];e=="Space"&&(e=" ");for(var r,o,i,s,a=0;a127)&&(s=Je[r.keyCode])&&s!=o){var l=t[$i(s,r,!0)];if(l&&l(e.state,e.dispatch,e))return!0}else if(i&&r.shiftKey){var c=t[$i(o,r,!0)];if(c&&c(e.state,e.dispatch,e))return!0}return!1}}function fd(n){return Object.prototype.toString.call(n).slice(8,-1)}function qi(n){return fd(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function no(n,t){const e=x({},n);return qi(n)&&qi(t)&&Object.keys(t).forEach(r=>{qi(t[r])?r in n?e[r]=no(n[r],t[r]):Object.assign(e,{[r]:t[r]}):Object.assign(e,{[r]:t[r]})}),e}function Yl(n){return typeof n=="function"}function L(n,t=void 0,...e){return Yl(n)?t?n.bind(t)(...e):n(...e):n}function _(n,t,e){return n.config[t]===void 0&&n.parent?_(n.parent,t,e):typeof n.config[t]=="function"?n.config[t].bind(Lt(x({},e),{parent:n.parent?_(n.parent,t,e):null})):n.config[t]}class yt{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=x(x({},this.config),t),this.name=this.config.name,t.defaultOptions&&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=L(_(this,"addOptions",{name:this.name}))),this.storage=L(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new yt(t)}configure(t={}){const e=this.extend();return e.options=no(this.options,t),e.storage=L(_(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new yt(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=t.defaultOptions?t.defaultOptions:e.parent.options,t.addOptions&&(e.options=L(_(e,"addOptions",{name:e.name}))),e.storage=L(_(e,"addStorage",{name:e.name,options:e.options})),e}}function Xl(n,t,e){const{from:r,to:o}=t,{blockSeparator:i=` - -`,textSerializers:s={}}=e||{};let a="",l=!0;return n.nodesBetween(r,o,(c,u,p,d)=>{var h;const m=s==null?void 0:s[c.type.name];m?(c.isBlock&&!l&&(a+=i,l=!0),a+=m({node:c,pos:u,parent:p,index:d})):c.isText?(a+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,o-u),l=!1):c.isBlock&&!l&&(a+=i,l=!0)}),a}function Ql(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}const pd=yt.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ht({key:new ae("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:t,schema:e}=n,{doc:r,selection:o}=t,{from:i,to:s}=o,a=Ql(e);return Xl(r,{from:i,to:s},{textSerializers:a})}}})]}});var dd=Object.freeze({__proto__:null,blur:()=>({editor:n,view:t})=>(requestAnimationFrame(()=>{n.isDestroyed||t.dom.blur()}),!0)}),hd=Object.freeze({__proto__:null,clearContent:(n=!1)=>({commands:t})=>t.setContent("",n)}),md=Object.freeze({__proto__:null,clearNodes:()=>({state:n,tr:t,dispatch:e})=>{const{selection:r}=t,{ranges:o}=r;return o.forEach(i=>{n.doc.nodesBetween(i.$from.pos,i.$to.pos,(s,a)=>{if(s.type.isText)return;const l=t.doc.resolve(t.mapping.map(a)),c=t.doc.resolve(t.mapping.map(a+s.nodeSize)),u=l.blockRange(c);if(!u)return;const p=wn(u);if(s.type.isTextblock&&e){const{defaultType:d}=l.parent.contentMatchAt(l.index());t.setNodeMarkup(u.start,d)}(p||p===0)&&e&&t.lift(u,p)})}),!0}}),vd=Object.freeze({__proto__:null,command:n=>t=>n(t)}),gd=Object.freeze({__proto__:null,createParagraphNear:()=>({state:n,dispatch:t})=>Ia(n,t)});function ft(n,t){if(typeof n=="string"){if(!t.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return t.nodes[n]}return n}var yd=Object.freeze({__proto__:null,deleteNode:n=>({tr:t,state:e,dispatch:r})=>{const o=ft(n,e.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const l=i.before(s),c=i.after(s);t.delete(l,c).scrollIntoView()}return!0}return!1}}),bd=Object.freeze({__proto__:null,deleteRange:n=>({tr:t,dispatch:e})=>{const{from:r,to:o}=n;return e&&t.delete(r,o),!0}}),kd=Object.freeze({__proto__:null,deleteSelection:()=>({state:n,dispatch:t})=>li(n,t)}),wd=Object.freeze({__proto__:null,enter:()=>({commands:n})=>n.keyboardShortcut("Enter")}),Sd=Object.freeze({__proto__:null,exitCode:()=>({state:n,dispatch:t})=>Va(n,t)});function $e(n,t){if(typeof n=="string"){if(!t.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return t.marks[n]}return n}function ji(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function ro(n,t,e={strict:!0}){const r=Object.keys(t);return r.length?r.every(o=>e.strict?t[o]===n[o]:ji(t[o])?t[o].test(n[o]):t[o]===n[o]):!0}function Wi(n,t,e={}){return n.find(r=>r.type===t&&ro(r.attrs,e))}function xd(n,t,e={}){return!!Wi(n,t,e)}function Zl(n,t,e={}){if(!n||!t)return;const r=n.parent.childAfter(n.parentOffset);if(!r.node)return;const o=Wi(r.node.marks,t,e);if(!o)return;let i=n.index(),s=n.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(Wi(r.node.marks,t,e);i>0&&o.isInSet(n.parent.child(i-1).marks);)i-=1,s-=n.parent.child(i).nodeSize;for(;a({tr:e,state:r,dispatch:o})=>{const i=$e(n,r.schema),{doc:s,selection:a}=e,{$from:l,from:c,to:u}=a;if(o){const p=Zl(l,i,t);if(p&&p.from<=c&&p.to>=u){const d=K.create(s,p.from,p.to);e.setSelection(d)}}return!0}}),Cd=Object.freeze({__proto__:null,first:n=>t=>{const e=typeof n=="function"?n(t):n;for(let r=0;r({editor:t,view:e,tr:r,dispatch:o})=>{const i=()=>{Od()&&e.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(e.focus(),t.commands.scrollIntoView())})};if(e.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!tc(t.state.selection))return i(),!0;const{from:s,to:a}=Nd(t.state,n)||t.state.selection,{doc:l,storedMarks:c}=r,u=z.atStart(l).from,p=z.atEnd(l).to,d=ln(s,u,p),h=ln(a,u,p),m=K.create(l,d,h),g=t.state.selection.eq(m);return o&&(g||r.setSelection(m),g&&c&&r.setStoredMarks(c),i()),!0}}),_d=Object.freeze({__proto__:null,forEach:(n,t)=>e=>n.every((r,o)=>t(r,Lt(x({},e),{index:o})))}),Ad=Object.freeze({__proto__:null,insertContent:(n,t)=>({tr:e,commands:r})=>r.insertContentAt({from:e.selection.from,to:e.selection.to},n,t)});function ec(n){const t=`${n}`;return new window.DOMParser().parseFromString(t,"text/html").body}function oo(n,t,e){if(e=x({slice:!0,parseOptions:{}},e),typeof n=="object"&&n!==null)try{return Array.isArray(n)?S.fromArray(n.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),oo("",t,e)}if(typeof n=="string"){const r=se.fromSchema(t);return e.slice?r.parseSlice(ec(n),e.parseOptions).content:r.parse(ec(n),e.parseOptions)}return oo("",t,e)}function Dd(n,t,e){const r=n.steps.length-1;if(r{s===0&&(s=u)}),n.setSelection(z.near(n.doc.resolve(s),e))}const Rd=n=>n.toString().startsWith("<");var Vd=Object.freeze({__proto__:null,insertContentAt:(n,t,e)=>({tr:r,dispatch:o,editor:i})=>{if(o){e=x({parseOptions:{},updateSelection:!0},e);const s=oo(t,i.schema,{parseOptions:x({preserveWhitespace:"full"},e.parseOptions)});if(s.toString()==="<>")return!0;let{from:a,to:l}=typeof n=="number"?{from:n,to:n}:n,c=!0;if((Rd(s)?s:[s]).forEach(p=>{c=c?p.isBlock:!1}),a===l&&c){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,l+=1)}r.replaceWith(a,l,s),e.updateSelection&&Dd(r,r.steps.length-1,-1)}return!0}}),Id=Object.freeze({__proto__:null,joinBackward:()=>({state:n,dispatch:t})=>Ea(n,t)}),Bd=Object.freeze({__proto__:null,joinForward:()=>({state:n,dispatch:t})=>Ta(n,t)});const Pd=typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1;function zd(n){const t=n.split(/-(?!$)/);let e=t[t.length-1];e==="Space"&&(e=" ");let r,o,i,s;for(let a=0;a({editor:t,view:e,tr:r,dispatch:o})=>{const i=zd(n).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{e.someProp("handleKeyDown",c=>c(e,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0}});function Tn(n,t,e={}){const{from:r,to:o,empty:i}=n.selection,s=t?ft(t,n.schema):null,a=[];n.doc.nodesBetween(r,o,(p,d)=>{if(p.isText)return;const h=Math.max(r,d),m=Math.min(o,d+p.nodeSize);a.push({node:p,from:h,to:m})});const l=o-r,c=a.filter(p=>s?s.name===p.node.type.name:!0).filter(p=>ro(p.node.attrs,e,{strict:!1}));return i?!!c.length:c.reduce((p,d)=>p+d.to-d.from,0)>=l}var Fd=Object.freeze({__proto__:null,lift:(n,t={})=>({state:e,dispatch:r})=>{const o=ft(n,e.schema);return Tn(e,o,t)?Da(e,r):!1}}),Hd=Object.freeze({__proto__:null,liftEmptyBlock:()=>({state:n,dispatch:t})=>Ba(n,t)}),Jd=Object.freeze({__proto__:null,liftListItem:n=>({state:t,dispatch:e})=>{const r=ft(n,t.schema);return Lf(r)(t,e)}}),$d=Object.freeze({__proto__:null,newlineInCode:()=>({state:n,dispatch:t})=>Ra(n,t)});function io(n,t){return t.nodes[n]?"node":t.marks[n]?"mark":null}function nc(n,t){const e=typeof t=="string"?[t]:t;return Object.keys(n).reduce((r,o)=>(e.includes(o)||(r[o]=n[o]),r),{})}var qd=Object.freeze({__proto__:null,resetAttributes:(n,t)=>({tr:e,state:r,dispatch:o})=>{let i=null,s=null;const a=io(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=ft(n,r.schema)),a==="mark"&&(s=$e(n,r.schema)),o&&e.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&e.setNodeMarkup(u,void 0,nc(c.attrs,t)),s&&c.marks.length&&c.marks.forEach(p=>{s===p.type&&e.addMark(u,u+c.nodeSize,s.create(nc(p.attrs,t)))})})}),!0):!1}}),jd=Object.freeze({__proto__:null,scrollIntoView:()=>({tr:n,dispatch:t})=>(t&&n.scrollIntoView(),!0)}),Wd=Object.freeze({__proto__:null,selectAll:()=>({tr:n,commands:t})=>t.setTextSelection({from:0,to:n.doc.content.size})}),Kd=Object.freeze({__proto__:null,selectNodeBackward:()=>({state:n,dispatch:t})=>Oa(n,t)}),Ud=Object.freeze({__proto__:null,selectNodeForward:()=>({state:n,dispatch:t})=>_a(n,t)}),Gd=Object.freeze({__proto__:null,selectParentNode:()=>({state:n,dispatch:t})=>Df(n,t)});function rc(n,t,e={}){return oo(n,t,{slice:!1,parseOptions:e})}var Yd=Object.freeze({__proto__:null,setContent:(n,t=!1,e={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=rc(n,o.schema,e),l=K.create(s,0,s.content.size);return i&&r.setSelection(l).replaceSelectionWith(a,!1).setMeta("preventUpdate",!t),!0}});function oc(n,t){const e=$e(t,n.schema),{from:r,to:o,empty:i}=n.selection,s=[];i?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===e.name);return a?x({},a.attrs):{}}var Xd=Object.freeze({__proto__:null,setMark:(n,t={})=>({tr:e,state:r,dispatch:o})=>{const{selection:i}=e,{empty:s,ranges:a}=i,l=$e(n,r.schema);if(o)if(s){const c=oc(r,l);e.addStoredMark(l.create(x(x({},c),t)))}else a.forEach(c=>{const u=c.$from.pos,p=c.$to.pos;r.doc.nodesBetween(u,p,(d,h)=>{const m=Math.max(h,u),g=Math.min(h+d.nodeSize,p);d.marks.find(k=>k.type===l)?d.marks.forEach(k=>{l===k.type&&e.addMark(m,g,l.create(x(x({},k.attrs),t)))}):e.addMark(m,g,l.create(t))})});return!0}}),Qd=Object.freeze({__proto__:null,setMeta:(n,t)=>({tr:e})=>(e.setMeta(n,t),!0)}),Zd=Object.freeze({__proto__:null,setNode:(n,t={})=>({state:e,dispatch:r})=>{const o=ft(n,e.schema);return If(o,t)(e,r)}}),th=Object.freeze({__proto__:null,setNodeSelection:n=>({tr:t,dispatch:e})=>{if(e){const{doc:r}=t,o=z.atStart(r).from,i=z.atEnd(r).to,s=ln(n,o,i),a=P.create(r,s);t.setSelection(a)}return!0}}),eh=Object.freeze({__proto__:null,setTextSelection:n=>({tr:t,dispatch:e})=>{if(e){const{doc:r}=t,{from:o,to:i}=typeof n=="number"?{from:n,to:n}:n,s=z.atStart(r).from,a=z.atEnd(r).to,l=ln(o,s,a),c=ln(i,s,a),u=K.create(r,l,c);t.setSelection(u)}return!0}}),nh=Object.freeze({__proto__:null,sinkListItem:n=>({state:t,dispatch:e})=>{const r=ft(n,t.schema);return Jf(r)(t,e)}});function so(n,t,e){return Object.fromEntries(Object.entries(e).filter(([r])=>{const o=n.find(i=>i.type===t&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function rh(n){for(let t=0;tt==null?void 0:t.includes(o.type.name));n.tr.ensureMarks(r)}}var oh=Object.freeze({__proto__:null,splitBlock:({keepMarks:n=!0}={})=>({tr:t,state:e,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=so(c,a.node().type.name,a.node().attrs);if(i instanceof P&&i.node.isBlock)return!a.parentOffset||!Oe(s,a.pos)?!1:(r&&(n&&ic(e,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const p=l.parentOffset===l.parent.content.size;i instanceof K&&t.deleteSelection();const d=a.depth===0?void 0:rh(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=p&&d?[{type:d,attrs:u}]:void 0,m=Oe(t.doc,t.mapping.map(a.pos),1,h);if(!h&&!m&&Oe(t.doc,t.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(m=!0,h=d?[{type:d,attrs:u}]:void 0),m&&(t.split(t.mapping.map(a.pos),1,h),d&&!p&&!a.parentOffset&&a.parent.type!==d)){const g=t.mapping.map(a.before()),y=t.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(a.before()),d)}n&&ic(e,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0}}),ih=Object.freeze({__proto__:null,splitListItem:n=>({tr:t,state:e,dispatch:r,editor:o})=>{var i;const s=ft(n,e.schema),{$from:a,$to:l}=e.selection,c=e.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const p=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let y=S.empty;const k=a.index(-1)?1:a.index(-2)?2:3;for(let A=a.depth-k;A>=a.depth-3;A-=1)y=S.from(a.node(A).copy(y));const b=a.indexAfter(-1){if(C>-1)return!1;A.isTextblock&&A.content.size===0&&(C=B+1)}),C>-1&&t.setSelection(K.near(t.doc.resolve(C))),t.scrollIntoView()}return!0}const d=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=so(p,u.type.name,u.attrs),m=so(p,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const g=d?[{type:s,attrs:h},{type:d,attrs:m}]:[{type:s,attrs:h}];return Oe(t.doc,a.pos,2)?(r&&t.split(a.pos,2,g).scrollIntoView(),!0):!1}});function sh(n,t){for(let e=n.depth;e>0;e-=1){const r=n.node(e);if(t(r))return{pos:e>0?n.before(e):0,start:n.start(e),depth:e,node:r}}}function ah(n){return t=>sh(t.$from,n)}function ao(n){const t=n.filter(o=>o.type==="extension"),e=n.filter(o=>o.type==="node"),r=n.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:e,markExtensions:r}}function sc(n,t){const{nodeExtensions:e}=ao(t),r=e.find(s=>s.name===n);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=L(_(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}var lh=Object.freeze({__proto__:null,toggleList:(n,t)=>({editor:e,tr:r,state:o,dispatch:i,chain:s,commands:a,can:l})=>{const{extensions:c}=e.extensionManager,u=ft(n,o.schema),p=ft(t,o.schema),{selection:d}=o,{$from:h,$to:m}=d,g=h.blockRange(m);if(!g)return!1;const y=ah(b=>sc(b.type.name,c))(d);if(g.depth>=1&&y&&g.depth-y.depth<=1){if(y.node.type===u)return a.liftListItem(p);if(sc(y.node.type.name,c)&&u.validContent(y.node.content)&&i)return r.setNodeMarkup(y.pos,u),!0}return l().wrapInList(u)?a.wrapInList(u):s().clearNodes().wrapInList(u).run()}});function Ui(n,t,e={}){const{empty:r,ranges:o}=n.selection,i=t?$e(t,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>i?i.name===p.type.name:!0).find(p=>ro(p.attrs,e,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:p,$to:d})=>{const h=p.pos,m=d.pos;n.doc.nodesBetween(h,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const k=Math.max(h,y),b=Math.min(m,y+g.nodeSize);s+=b-k,a.push(...g.marks.map(v=>({mark:v,from:k,to:b})))})}),s===0)return!1;const l=a.filter(p=>i?i.name===p.mark.type.name:!0).filter(p=>ro(p.mark.attrs,e,{strict:!1})).reduce((p,d)=>p+d.to-d.from,0),c=a.filter(p=>i?p.mark.type!==i&&p.mark.type.excludes(i):!0).reduce((p,d)=>p+d.to-d.from,0);return(l>0?l+c:l)>=s}var ch=Object.freeze({__proto__:null,toggleMark:(n,t={},e={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=e,s=$e(n,r.schema);return Ui(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)}}),uh=Object.freeze({__proto__:null,toggleNode:(n,t,e={})=>({state:r,commands:o})=>{const i=ft(n,r.schema),s=ft(t,r.schema);return Tn(r,i,e)?o.setNode(s):o.setNode(i,e)}}),fh=Object.freeze({__proto__:null,toggleWrap:(n,t={})=>({state:e,dispatch:r})=>{const o=ft(n,e.schema);return Tn(e,o,t)?Da(e,r):za(o,t)(e,r)}}),ph=Object.freeze({__proto__:null,undoInputRule:()=>({state:n,dispatch:t})=>{const e=n.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,n.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1}}),dh=Object.freeze({__proto__:null,unsetAllMarks:()=>({tr:n,state:t,dispatch:e})=>{const{selection:r}=n,{empty:o,ranges:i}=r;return o||e&&Object.entries(t.schema.marks).forEach(([,s])=>{i.forEach(a=>{n.removeMark(a.$from.pos,a.$to.pos,s)})}),!0}}),hh=Object.freeze({__proto__:null,unsetMark:(n,t={})=>({tr:e,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=e,l=$e(n,r.schema),{$from:c,empty:u,ranges:p}=a;if(!o)return!0;if(u&&s){let{from:d,to:h}=a;const m=(i=c.marks().find(y=>y.type===l))===null||i===void 0?void 0:i.attrs,g=Zl(c,l,m);g&&(d=g.from,h=g.to),e.removeMark(d,h,l)}else p.forEach(d=>{e.removeMark(d.$from.pos,d.$to.pos,l)});return e.removeStoredMark(l),!0}}),mh=Object.freeze({__proto__:null,updateAttributes:(n,t={})=>({tr:e,state:r,dispatch:o})=>{let i=null,s=null;const a=io(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=ft(n,r.schema)),a==="mark"&&(s=$e(n,r.schema)),o&&e.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(p,d)=>{i&&i===p.type&&e.setNodeMarkup(d,void 0,x(x({},p.attrs),t)),s&&p.marks.length&&p.marks.forEach(h=>{if(s===h.type){const m=Math.max(d,c),g=Math.min(d+p.nodeSize,u);e.addMark(m,g,s.create(x(x({},h.attrs),t)))}})})}),!0):!1}}),vh=Object.freeze({__proto__:null,wrapIn:(n,t={})=>({state:e,dispatch:r})=>{const o=ft(n,e.schema);return Tn(e,o,t)?!1:za(o,t)(e,r)}}),gh=Object.freeze({__proto__:null,wrapInList:(n,t={})=>({state:e,dispatch:r})=>{const o=ft(n,e.schema);return Pf(o,t)(e,r)}});const yh=yt.create({name:"commands",addCommands(){return x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x({},dd),hd),md),vd),gd),yd),bd),kd),wd),Sd),Md),Cd),Td),_d),Ad),Vd),Id),Bd),Ld),Fd),Hd),Jd),$d),qd),jd),Wd),Kd),Ud),Gd),Yd),Xd),Qd),Zd),th),eh),nh),oh),ih),lh),ch),uh),fh),ph),dh),hh),mh),vh),gh)}}),bh=yt.create({name:"editable",addProseMirrorPlugins(){return[new Ht({key:new ae("editable"),props:{editable:()=>this.editor.options.editable}})]}}),kh=yt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ht({key:new ae("focusEvents"),props:{handleDOMEvents:{focus:(t,e)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:e}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,e)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:e}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),wh=yt.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()]);return{Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()}}}),Sh=yt.create({name:"tabindex",addProseMirrorPlugins(){return[new Ht({key:new ae("tabindex"),props:{attributes:{tabindex:"0"}}})]}});var xh=Object.freeze({__proto__:null,ClipboardTextSerializer:pd,Commands:yh,Editable:bh,FocusEvents:kh,Keymap:wh,Tabindex:Sh});function Mh(n,t){const e=ft(t,n.schema),{from:r,to:o}=n.selection,i=[];n.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===e.name);return s?x({},s.attrs):{}}function Ch(n,t){const e=io(typeof t=="string"?t:t.name,n.schema);return e==="node"?Mh(n,t):e==="mark"?oc(n,t):{}}function Eh(n,t,e={}){if(!t)return Tn(n,null,e)||Ui(n,null,e);const r=io(t,n.schema);return r==="node"?Tn(n,t,e):r==="mark"?Ui(n,t,e):!1}function Oh(n,t){const e=ht.fromSchema(t).serializeFragment(n),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(e),o.innerHTML}function Nh(n,t){const e={from:0,to:n.content.size};return Xl(n,e,t)}function Th(n){var t;const e=(t=n.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=n.toJSON();return JSON.stringify(e)===JSON.stringify(r)}function _h(n){const t=document.querySelector("style[data-tiptap-style]");if(t!==null)return t;const e=document.createElement("style");return e.setAttribute("data-tiptap-style",""),e.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(e),e}function Gi(n){const{state:t,transaction:e}=n;let{selection:r}=e,{doc:o}=e,{storedMarks:i}=e;return Lt(x({},t),{schema:t.schema,plugins:t.plugins,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=e.selection,o=e.doc,i=e.storedMarks,e}})}class Yi{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:r}=this,{view:o}=e,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...u)=>{const p=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!t,c=t||i.tr,u=()=>(!l&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(d=>d===!0)),p=Lt(x({},Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...g)=>{const y=this.buildProps(c,e),k=h(...g)(y);return a.push(k),p}]))),{run:u});return p}createCan(t){const{rawCommands:e,state:r}=this,o=void 0,i=t||r.tr,s=this.buildProps(i,o),a=Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...u)=>c(...u)(Lt(x({},s),{dispatch:o}))]));return Lt(x({},a),{chain:()=>this.createChain(i,o)})}buildProps(t,e=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o;i.storedMarks&&t.setStoredMarks(i.storedMarks);const a={tr:t,editor:o,view:s,state:Gi({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class lo{constructor(t){this.find=t.find,this.handler=t.handler}}const Ah=(n,t)=>{if(ji(t))return t.exec(n);const e=t(n);if(!e)return null;const r=[];return r.push(e.text),r.index=e.index,r.input=n,r.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(e.replaceWith)),r};function Xi(n){var t;const{editor:e,from:r,to:o,text:i,rules:s,plugin:a}=n,{view:l}=e;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0?void 0:t.marks.find(h=>h.type.spec.code)))return!1;let u=!1;const p=500,d=c.parent.textBetween(Math.max(0,c.parentOffset-p),c.parentOffset,void 0,"\uFFFC")+i;return s.forEach(h=>{if(u)return;const m=Ah(d,h.find);if(!m)return;const g=l.state.tr,y=Gi({state:l.state,transaction:g}),k={from:r-(m[0].length-i.length),to:o},{commands:b,chain:N,can:v}=new Yi({editor:e,state:y});h.handler({state:y,range:k,match:m,commands:b,chain:N,can:v}),!!g.steps.length&&(g.setMeta(a,{transform:g,from:r,to:o,text:i}),l.dispatch(g),u=!0)}),u}function Dh(n){const{editor:t,rules:e}=n,r=new Ht({state:{init(){return null},apply(o,i){const s=o.getMeta(this);return s||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput(o,i,s,a){return Xi({editor:t,from:i,to:s,text:a,rules:e,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Xi({editor:t,from:i.pos,to:i.pos,text:"",rules:e,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?Xi({editor:t,from:s.pos,to:s.pos,text:` -`,rules:e,plugin:r}):!1}},isInputRules:!0});return r}function Rh(n){return typeof n=="number"}class Vh{constructor(t){this.find=t.find,this.handler=t.handler}}const Ih=(n,t)=>{if(ji(t))return[...n.matchAll(t)];const e=t(n);return e?e.map(r=>{const o=[];return o.push(r.text),o.index=r.index,o.input=n,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function Bh(n){const{editor:t,state:e,from:r,to:o,rules:i}=n,{commands:s,chain:a,can:l}=new Yi({editor:t,state:e});e.doc.nodesBetween(r,o,(c,u)=>{if(!c.isTextblock||c.type.spec.code)return;const p=Math.max(r,u),d=Math.min(o,u+c.content.size),h=c.textBetween(p-u,d-u,void 0,"\uFFFC");i.forEach(m=>{Ih(h,m.find).forEach(y=>{if(y.index===void 0)return;const k=p+y.index+1,b=k+y[0].length,N={from:e.tr.mapping.map(k),to:e.tr.mapping.map(b)};m.handler({state:e,range:N,match:y,commands:s,chain:a,can:l})})})})}function Ph(n){const{editor:t,rules:e}=n;let r=!1;const o=new Ht({props:{handlePaste:(i,s)=>{var a;const l=(a=s.clipboardData)===null||a===void 0?void 0:a.getData("text/html");return r=!!(l==null?void 0:l.includes("data-pm-slice")),!1}},appendTransaction:(i,s,a)=>{const l=i[0];if(!l.getMeta("paste")||r)return;const{doc:c,before:u}=l,p=u.content.findDiffStart(c.content),d=u.content.findDiffEnd(c.content);if(!Rh(p)||!d||p===d.b)return;const h=a.tr,m=Gi({state:a,transaction:h});if(Bh({editor:t,state:m,from:Math.max(p-1,0),to:d.b,rules:e,plugin:o}),!!h.steps.length)return h},isPasteRules:!0});return o}function ac(n){const t=[],{nodeExtensions:e,markExtensions:r}=ao(n),o=[...e,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0};return n.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=_(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(p=>{Object.entries(u.attributes).forEach(([d,h])=>{t.push({type:p,name:d,attribute:x(x({},i),h)})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=_(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,p])=>{t.push({type:s.name,name:u,attribute:x(x({},i),p)})})}),t}function pt(...n){return n.filter(t=>!!t).reduce((t,e)=>{const r=x({},t);return Object.entries(e).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}o==="class"?r[o]=[r[o],i].join(" "):o==="style"?r[o]=[r[o],i].join("; "):r[o]=i}),r},{})}function Qi(n,t){return t.filter(e=>e.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(n.attrs)||{}:{[e.name]:n.attrs[e.name]}).reduce((e,r)=>pt(e,r),{})}function zh(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Lh(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function lc(n,t){return n.style?n:Lt(x({},n),{getAttrs:e=>{const r=n.getAttrs?n.getAttrs(e):n.attrs;if(r===!1)return!1;const o=t.filter(i=>i.attribute.rendered).reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(e):Lh(e.getAttribute(s.name));return Ki(a)&&console.warn(`[tiptap warn]: BREAKING CHANGE: "parseHTML" for your attribute "${s.name}" returns an object but should return the value itself. If this is expected you can ignore this message. This warning will be removed in one of the next releases. Further information: https://github.com/ueberdosis/tiptap/issues/1863`),a==null?i:Lt(x({},i),{[s.name]:a})},{});return x(x({},r),o)}})}function cc(n){return Object.fromEntries(Object.entries(n).filter(([t,e])=>t==="attrs"&&zh(e)?!1:e!=null))}function Fh(n){var t;const e=ac(n),{nodeExtensions:r,markExtensions:o}=ao(n),i=(t=r.find(l=>_(l,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(r.map(l=>{const c=e.filter(y=>y.type===l.name),u={name:l.name,options:l.options,storage:l.storage},p=n.reduce((y,k)=>{const b=_(k,"extendNodeSchema",u);return x(x({},y),b?b(l):{})},{}),d=cc(Lt(x({},p),{content:L(_(l,"content",u)),marks:L(_(l,"marks",u)),group:L(_(l,"group",u)),inline:L(_(l,"inline",u)),atom:L(_(l,"atom",u)),selectable:L(_(l,"selectable",u)),draggable:L(_(l,"draggable",u)),code:L(_(l,"code",u)),defining:L(_(l,"defining",u)),isolating:L(_(l,"isolating",u)),attrs:Object.fromEntries(c.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))})),h=L(_(l,"parseHTML",u));h&&(d.parseDOM=h.map(y=>lc(y,c)));const m=_(l,"renderHTML",u);m&&(d.toDOM=y=>m({node:y,HTMLAttributes:Qi(y,c)}));const g=_(l,"renderText",u);return g&&(d.toText=g),[l.name,d]})),a=Object.fromEntries(o.map(l=>{const c=e.filter(g=>g.type===l.name),u={name:l.name,options:l.options,storage:l.storage},p=n.reduce((g,y)=>{const k=_(y,"extendMarkSchema",u);return x(x({},g),k?k(l):{})},{}),d=cc(Lt(x({},p),{inclusive:L(_(l,"inclusive",u)),excludes:L(_(l,"excludes",u)),group:L(_(l,"group",u)),spanning:L(_(l,"spanning",u)),code:L(_(l,"code",u)),attrs:Object.fromEntries(c.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))})),h=L(_(l,"parseHTML",u));h&&(d.parseDOM=h.map(g=>lc(g,c)));const m=_(l,"renderHTML",u);return m&&(d.toDOM=g=>m({mark:g,HTMLAttributes:Qi(g,c)})),[l.name,d]}));return new en({topNode:i,nodes:s,marks:a})}function Zi(n,t){return t.nodes[n]||t.marks[n]||null}function uc(n,t){return Array.isArray(t)?t.some(e=>(typeof e=="string"?e:e.name)===n.name):t}function Hh(n){const t=n.filter((e,r)=>n.indexOf(e)!==r);return[...new Set(t)]}class _n{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=_n.resolve(t),this.schema=Fh(this.extensions),this.extensions.forEach(r=>{var o;this.editor.extensionStorage[r.name]=r.storage;const i={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Zi(r.name,this.schema)};r.type==="mark"&&((o=L(_(r,"keepOnSplit",i)))!==null&&o!==void 0?o:!0)&&this.splittableMarks.push(r.name);const s=_(r,"onBeforeCreate",i);s&&this.editor.on("beforeCreate",s);const a=_(r,"onCreate",i);a&&this.editor.on("create",a);const l=_(r,"onUpdate",i);l&&this.editor.on("update",l);const c=_(r,"onSelectionUpdate",i);c&&this.editor.on("selectionUpdate",c);const u=_(r,"onTransaction",i);u&&this.editor.on("transaction",u);const p=_(r,"onFocus",i);p&&this.editor.on("focus",p);const d=_(r,"onBlur",i);d&&this.editor.on("blur",d);const h=_(r,"onDestroy",i);h&&this.editor.on("destroy",h)})}static resolve(t){const e=_n.sort(_n.flatten(t)),r=Hh(e.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map(e=>{const r={name:e.name,options:e.options,storage:e.storage},o=_(e,"addExtensions",r);return o?[e,...this.flatten(o())]:e}).flat(10)}static sort(t){const e=100;return t.sort((r,o)=>{const i=_(r,"priority")||e,s=_(o,"priority")||e;return i>s?-1:i{const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Zi(e.name,this.schema)},o=_(e,"addCommands",r);return o?x(x({},t),o()):t},{})}get plugins(){const{editor:t}=this,e=_n.sort([...this.extensions].reverse()),r=[],o=[],i=e.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:t,type:Zi(s.name,this.schema)},l=[],c=_(s,"addKeyboardShortcuts",a);if(c){const h=Object.fromEntries(Object.entries(c()).map(([g,y])=>[g,()=>y({editor:t})])),m=ud(h);l.push(m)}const u=_(s,"addInputRules",a);uc(s,t.options.enableInputRules)&&u&&r.push(...u());const p=_(s,"addPasteRules",a);uc(s,t.options.enablePasteRules)&&p&&o.push(...p());const d=_(s,"addProseMirrorPlugins",a);if(d){const h=d();l.push(...h)}return l}).flat();return[Dh({editor:t,rules:r}),Ph({editor:t,rules:o}),...i]}get attributes(){return ac(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ao(this.extensions);return Object.fromEntries(e.filter(r=>!!_(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:t,type:ft(r.name,this.schema)},s=_(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,p)=>{const d=Qi(l,o);return s()({editor:t,node:l,getPos:u,decorations:p,HTMLAttributes:d,extension:r})};return[r.name,a]}))}}class Jh{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const r=this.callbacks[t];return r&&r.forEach(o=>o.apply(this,e)),this}off(t,e){const r=this.callbacks[t];return r&&(e?this.callbacks[t]=r.filter(o=>o!==e):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}const $h=`.ProseMirror { +var d1=Object.defineProperty,h1=Object.defineProperties;var m1=Object.getOwnPropertyDescriptors;var Ko=Object.getOwnPropertySymbols;var tf=Object.prototype.hasOwnProperty,ef=Object.prototype.propertyIsEnumerable;var nf=(f,H,ht)=>H in f?d1(f,H,{enumerable:!0,configurable:!0,writable:!0,value:ht}):f[H]=ht,x=(f,H)=>{for(var ht in H||(H={}))tf.call(H,ht)&&nf(f,ht,H[ht]);if(Ko)for(var ht of Ko(H))ef.call(H,ht)&&nf(f,ht,H[ht]);return f},Lt=(f,H)=>h1(f,m1(H));var rf=(f,H)=>{var ht={};for(var Yt in f)tf.call(f,Yt)&&H.indexOf(Yt)<0&&(ht[Yt]=f[Yt]);if(f!=null&&Ko)for(var Yt of Ko(f))H.indexOf(Yt)<0&&ef.call(f,Yt)&&(ht[Yt]=f[Yt]);return ht};var __vite_style__=document.createElement("style");__vite_style__.innerHTML=`.ProseMirror li>p:first-child,.ProseMirror div{display:inline}ul[data-type=taskList]{list-style:none;padding:0}ul[data-type=taskList] li{display:flex;align-items:center}ul[data-type=taskList] li>label{flex:0 0 auto;margin-right:.5rem} +`;document.head.appendChild(__vite_style__);(function(f,H){typeof exports=="object"&&typeof module!="undefined"?H(require("vue")):typeof define=="function"&&define.amd?define(["vue"],H):(f=typeof globalThis!="undefined"?globalThis:f||self,H(f.Vue))})(this,function(f){"use strict";function H(n){this.content=n}H.prototype={constructor:H,find:function(n){for(var t=0;t>1}},H.from=function(n){if(n instanceof H)return n;var t=[];if(n)for(var e in n)t.push(e,n[e]);return new H(t)};var ht=H;function Yt(n,t,e){for(var r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;var o=n.child(r),i=t.child(r);if(o==i){e+=o.nodeSize;continue}if(!o.sameMarkup(i))return e;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)e++;return e}if(o.content.size||i.content.size){var a=Yt(o.content,i.content,e+1);if(a!=null)return a}e+=o.nodeSize}}function Gs(n,t,e,r){for(var o=n.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:e,b:r};var s=n.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){e-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:e,b:r};if(s.isText&&s.text!=a.text){for(var c=0,u=Math.min(s.text.length,a.text.length);ct&&r(l,o+a,i,s)!==!1&&l.content.size){var u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,e-u),r,o+u)}a=c}},S.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},S.prototype.textBetween=function(t,e,r,o){var i="",s=!0;return this.nodesBetween(t,e,function(a,l){a.isText?(i+=a.text.slice(Math.max(t,l)-l,e-l),s=!r):a.isLeaf&&o?(i+=typeof o=="function"?o(a):o,s=!r):!s&&a.isBlock&&(i+=r,s=!0)},0),i},S.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(r)&&(o[o.length-1]=e.withText(e.text+r.text),i=1);it)for(var i=0,s=0;st&&((se)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),r.push(a),o+=a.nodeSize),s=l}return new S(r,o)},S.prototype.cutByIndex=function(t,e){return t==e?S.empty:t==0&&e==this.content.length?this:new S(this.content.slice(t,e))},S.prototype.replaceChild=function(t,e){var r=this.content[t];if(r==e)return this;var o=this.content.slice(),i=this.size+e.nodeSize-r.nodeSize;return o[t]=e,new S(o,i)},S.prototype.addToStart=function(t){return new S([t].concat(this.content),this.size+t.nodeSize)},S.prototype.addToEnd=function(t){return new S(this.content.concat(t),this.size+t.nodeSize)},S.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var r=0,o=0;;r++){var i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||e>0?Fr(r+1,s):Fr(r,o);o=s}},S.prototype.toString=function(){return"<"+this.toStringInner()+">"},S.prototype.toStringInner=function(){return this.content.join(", ")},S.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null},S.fromJSON=function(t,e){if(!e)return S.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new S(e.map(t.nodeFromJSON))},S.fromArray=function(t){if(!t.length)return S.empty;for(var e,r=0,o=0;othis.type.rank&&(e||(e=t.slice(0,o)),e.push(this),r=!0),e&&e.push(i)}}return e||(e=t.slice()),r||e.push(this),e},J.prototype.removeFromSet=function(t){for(var e=0;e0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},T.fromJSON=function(t,e){if(!e)return T.empty;var r=e.openStart||0,o=e.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new T(S.fromJSON(t,e.content),r,o)},T.maxOpen=function(t,e){e===void 0&&(e=!0);for(var r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)r++;for(var s=t.lastChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.lastChild)o++;return new T(t,r,o)},Object.defineProperties(T.prototype,Ys);function Xs(n,t,e){var r=n.findIndex(t),o=r.index,i=r.offset,s=n.maybeChild(o),a=n.findIndex(e),l=a.index,c=a.offset;if(i==t||s.isText){if(c!=e&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(o!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(o,s.copy(Xs(s.content,t-i-1,e-i-1)))}function Qs(n,t,e,r){var o=n.findIndex(t),i=o.index,s=o.offset,a=n.maybeChild(i);if(s==t||a.isText)return r&&!r.canReplace(i,i,e)?null:n.cut(0,t).append(e).append(n.cut(t));var l=Qs(a.content,t-s-1,e);return l&&n.replaceChild(i,a.copy(l))}T.empty=new T(S.empty,0,0);function of(n,t,e){if(e.openStart>n.depth)throw new de("Inserted content deeper than insertion position");if(n.depth-e.openStart!=t.depth-e.openEnd)throw new de("Inconsistent open depths");return Zs(n,t,e,0)}function Zs(n,t,e,r){var o=n.index(r),i=n.node(r);if(o==t.index(r)&&r=0&&n.isText&&n.sameMarkup(t[e])?t[e]=n.withText(t[e].text+n.text):t.push(n)}function Qn(n,t,e,r){var o=(t||n).node(e),i=0,s=t?t.index(e):o.childCount;n&&(i=n.index(e),n.depth>e?i++:n.textOffset&&(tn(n.nodeAfter,r),i++));for(var a=i;ao&&Go(n,t,o+1),s=r.depth>o&&Go(e,r,o+1),a=[];return Qn(null,n,o,a),i&&s&&t.index(o)==e.index(o)?(ta(i,s),tn(en(i,ea(n,t,e,r,o+1)),a)):(i&&tn(en(i,Jr(n,t,o+1)),a),Qn(t,e,o,a),s&&tn(en(s,Jr(e,r,o+1)),a)),Qn(r,null,o,a),new S(a)}function Jr(n,t,e){var r=[];if(Qn(null,n,e,r),n.depth>e){var o=Go(n,t,e+1);tn(en(o,Jr(n,t,e+1)),r)}return Qn(t,null,e,r),new S(r)}function sf(n,t){for(var e=t.depth-n.openStart,r=t.node(e),o=r.copy(n.content),i=e-1;i>=0;i--)o=t.node(i).copy(S.from(o));return{start:o.resolveNoCache(n.openStart+e),end:o.resolveNoCache(o.content.size-n.openEnd-e)}}var nt=function(t,e,r){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=r},kn={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};nt.prototype.resolveDepth=function(t){return t==null?this.depth:t<0?this.depth+t:t},kn.parent.get=function(){return this.node(this.depth)},kn.doc.get=function(){return this.node(0)},nt.prototype.node=function(t){return this.path[this.resolveDepth(t)*3]},nt.prototype.index=function(t){return this.path[this.resolveDepth(t)*3+1]},nt.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)},nt.prototype.start=function(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1},nt.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},nt.prototype.before=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]},nt.prototype.after=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize},kn.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},kn.nodeAfter.get=function(){var n=this.parent,t=this.index(this.depth);if(t==n.childCount)return null;var e=this.pos-this.path[this.path.length-1],r=n.child(t);return e?n.child(t).cut(e):r},kn.nodeBefore.get=function(){var n=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(n).cut(0,t):n==0?null:this.parent.child(n-1)},nt.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var r=this.path[e*3],o=e==0?0:this.path[e*3-1]+1,i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},nt.prototype.blockRange=function(t,e){if(t===void 0&&(t=this),t.pos=0;r--)if(t.pos<=this.end(r)&&(!e||e(this.node(r))))return new Zn(this,t,r)},nt.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},nt.prototype.max=function(t){return t.pos>this.pos?t:this},nt.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var r=[],o=0,i=e,s=t;;){var a=s.content.findIndex(i),l=a.index,c=a.offset,u=i-c;if(r.push(s,l,o+c),!u||(s=s.child(l),s.isText))break;i=u-1,o+=c+1}return new nt(e,r,i)},nt.resolveCached=function(t,e){for(var r=0;rt&&this.nodesBetween(t,e,function(i){return r.isInSet(i.marks)&&(o=!0),!o}),o},jt.isBlock.get=function(){return this.type.isBlock},jt.isTextblock.get=function(){return this.type.isTextblock},jt.inlineContent.get=function(){return this.type.inlineContent},jt.isInline.get=function(){return this.type.isInline},jt.isText.get=function(){return this.type.isText},jt.isLeaf.get=function(){return this.type.isLeaf},jt.isAtom.get=function(){return this.type.isAtom},$.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),na(this.marks,t)},$.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},$.prototype.canReplace=function(t,e,r,o,i){r===void 0&&(r=S.empty),o===void 0&&(o=0),i===void 0&&(i=r.childCount);var s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var l=o;l=0;e--)t=n[e].type.name+"("+t+")";return t}var Ct=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},$r={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};Ct.parse=function(t,e){var r=new qr(t,e);if(r.next==null)return Ct.empty;var o=oa(r);r.next&&r.err("Unexpected trailing text");var i=vf(mf(o));return gf(i,r),i},Ct.prototype.matchType=function(t){for(var e=0;e>1},Ct.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},Ct.prototype.toString=function(){var t=[];function e(r){t.push(r);for(var o=1;o"+t.indexOf(r.next[s+1]);return i}).join(` +`)},Object.defineProperties(Ct.prototype,$r),Ct.empty=new Ct(!0);var qr=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()},ra={next:{configurable:!0}};ra.next.get=function(){return this.tokens[this.pos]},qr.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},qr.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(qr.prototype,ra);function oa(n){var t=[];do t.push(uf(n));while(n.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function uf(n){var t=[];do t.push(ff(n));while(n.next&&n.next!=")"&&n.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function ff(n){for(var t=hf(n);;)if(n.eat("+"))t={type:"plus",expr:t};else if(n.eat("*"))t={type:"star",expr:t};else if(n.eat("?"))t={type:"opt",expr:t};else if(n.eat("{"))t=pf(n,t);else break;return t}function ia(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");var t=Number(n.next);return n.pos++,t}function pf(n,t){var e=ia(n),r=e;return n.eat(",")&&(n.next!="}"?r=ia(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:e,max:r,expr:t}}function df(n,t){var e=n.nodeTypes,r=e[t];if(r)return[r];var o=[];for(var i in e){var s=e[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&n.err("No node type or group '"+t+"' found"),o}function hf(n){if(n.eat("(")){var t=oa(n);return n.eat(")")||n.err("Missing closing paren"),t}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{var e=df(n,n.next).map(function(r){return n.inline==null?n.inline=r.isInline:n.inline!=r.isInline&&n.err("Mixing inline and block content"),{type:"name",value:r}});return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function mf(n){var t=[[]];return o(i(n,0),e()),t;function e(){return t.push([])-1}function r(s,a,l){var c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(function(l){return l.to=a})}function i(s,a){if(s.type=="choice")return s.exprs.reduce(function(k,b){return k.concat(i(b,a))},[]);if(s.type=="seq")for(var l=0;;l++){var c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=e())}else if(s.type=="star"){var u=e();return r(a,u),o(i(s.expr,u),u),[r(u)]}else if(s.type=="plus"){var p=e();return o(i(s.expr,a),p),o(i(s.expr,p),p),[r(p)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){for(var d=a,h=0;h-1&&o[d+1];aa(n,p).forEach(function(m){h||o.push(u,h=[]),h.indexOf(m)==-1&&h.push(m)})}})});for(var i=t[r.join(",")]=new Ct(r.indexOf(n.length-1)>-1),s=0;s-1},_t.prototype.allowsMarks=function(t){if(this.markSet==null)return!0;for(var e=0;e-1};var nn=function(t){this.spec={};for(var e in t)this.spec[e]=t[e];this.spec.nodes=ht.from(t.nodes),this.spec.marks=ht.from(t.marks),this.nodes=_t.compile(this.spec.nodes,this),this.marks=Be.compile(this.spec.marks,this);var r=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=r[s]||(r[s]=Ct.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?da(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(var l in this.marks){var c=this.marks[l],u=c.spec.excludes;c.excluded=u==null?[c]:u==""?[]:da(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};nn.prototype.node=function(t,e,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof _t){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(e,r,o)},nn.prototype.text=function(t,e){var r=this.nodes.text;return new cf(r,r.defaultAttrs,t,J.setFrom(e))},nn.prototype.mark=function(t,e){return typeof t=="string"&&(t=this.marks[t]),t.create(e)},nn.prototype.nodeFromJSON=function(t){return $.fromJSON(this,t)},nn.prototype.markFromJSON=function(t){return J.fromJSON(this,t)},nn.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};function da(n,t){for(var e=[],r=0;r-1)&&e.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return e}var ie=function(t,e){var r=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(function(o){o.tag?r.tags.push(o):o.style&&r.styles.push(o)}),this.normalizeLists=!this.tags.some(function(o){if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;var i=t.nodes[o.node];return i.contentMatch.matchType(i)})};ie.prototype.parse=function(t,e){e===void 0&&(e={});var r=new et(this,e,!1);return r.addAll(t,null,e.from,e.to),r.finish()},ie.prototype.parseSlice=function(t,e){e===void 0&&(e={});var r=new et(this,e,!0);return r.addAll(t,null,e.from,e.to),T.maxOpen(r.finish())},ie.prototype.matchTag=function(t,e,r){for(var o=r?this.tags.indexOf(r)+1:0;ot.length&&(s.style.charCodeAt(t.length)!=61||s.style.slice(t.length+1)!=e))){if(s.getAttrs){var a=s.getAttrs(e);if(a===!1)continue;s.attrs=a}return s}}},ie.schemaRules=function(t){var e=[];function r(l){for(var c=l.priority==null?50:l.priority,u=0;u=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},Ee.prototype.applyPending=function(t){for(var e=0,r=this.pendingMarks;e=0;o--){var i=this.nodes[o],s=i.findWrapping(t);if(s&&(!e||e.length>s.length)&&(e=s,r=i,!s.length)||i.solid)break}if(!e)return!1;this.sync(r);for(var a=0;athis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},et.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},et.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t){this.open=e;return}},ei.currentPos.get=function(){this.closeExtra();for(var n=0,t=this.open;t>=0;t--){for(var e=this.nodes[t].content,r=e.length-1;r>=0;r--)n+=e[r].nodeSize;t&&n++}return n},et.prototype.findAtPoint=function(t,e){if(this.find)for(var r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var r=t.split("/"),o=this.options.context,i=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=function(l,c){for(;l>=0;l--){var u=r[l];if(u==""){if(l==r.length-1||l==0)continue;for(;c>=s;c--)if(a(l-1,c))return!0;return!1}else{var p=c>0||c==0&&i?e.nodes[c].type:o&&c>=s?o.node(c-s).type:null;if(!p||p.name!=u&&p.groups.indexOf(u)==-1)return!1;c--}}return!0};return a(r.length-1,this.open)},et.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var r=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(var o in this.parser.schema.nodes){var i=this.parser.schema.nodes[o];if(i.isTextblock&&i.defaultAttrs)return i}},et.prototype.addPendingMark=function(t){var e=xf(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},et.prototype.removePendingMark=function(t,e){for(var r=this.open;r>=0;r--){var o=this.nodes[r],i=o.pendingMarks.lastIndexOf(t);if(i>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==e)break}},Object.defineProperties(et.prototype,ei);function bf(n){for(var t=n.firstChild,e=null;t;t=t.nextSibling){var r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&ha.hasOwnProperty(r)&&e?(e.appendChild(t),t=e):r=="li"?e=t:r&&(e=null)}}function kf(n,t){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,t)}function wf(n){for(var t=/\s*([\w-]+)\s*:\s*([^;]+)/g,e,r=[];e=t.exec(n);)r.push(e[1],e[2].trim());return r}function va(n){var t={};for(var e in n)t[e]=n[e];return t}function Sf(n,t){var e=t.schema.nodes,r=function(s){var a=e[s];if(!!a.allowsMarkType(n)){var l=[],c=function(u){l.push(u);for(var p=0;p=0;o--){var i=this.serializeMark(t.marks[o],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r},mt.prototype.serializeMark=function(t,e,r){r===void 0&&(r={});var o=this.marks[t.type.name];return o&&mt.renderSpec(ni(r),o(t,e))},mt.renderSpec=function(t,e,r){if(r===void 0&&(r=null),typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;var o=e[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));var s=null,a=r?t.createElementNS(r,o):t.createElement(o),l=e[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(var u in l)if(l[u]!=null){var p=u.indexOf(" ");p>0?a.setAttributeNS(u.slice(0,p),u.slice(p+1),l[u]):a.setAttribute(u,l[u])}}for(var d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{var m=mt.renderSpec(t,h,r),g=m.dom,y=m.contentDOM;if(a.appendChild(g),y){if(s)throw new RangeError("Multiple content holes");s=y}}}return{dom:a,contentDOM:s}},mt.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new mt(this.nodesFromSchema(t),this.marksFromSchema(t)))},mt.nodesFromSchema=function(t){var e=ga(t.nodes);return e.text||(e.text=function(r){return r.text}),e},mt.marksFromSchema=function(t){return ga(t.marks)};function ga(n){var t={};for(var e in n){var r=n[e].spec.toDOM;r&&(t[e]=r)}return t}function ni(n){return n.document||window.document}var ya=65535,ba=Math.pow(2,16);function Mf(n,t){return n+t*ba}function ka(n){return n&ya}function Cf(n){return(n-(n&ya))/ba}var ri=function(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=null),this.pos=t,this.deleted=e,this.recover=r},vt=function(t,e){e===void 0&&(e=!1),this.ranges=t,this.inverted=e};vt.prototype.recover=function(t){var e=0,r=ka(t);if(!this.inverted)for(var o=0;ot)break;var c=this.ranges[a+i],u=this.ranges[a+s],p=l+c;if(t<=p){var d=c?t==l?-1:t==p?1:e:e,h=l+o+(d<0?0:u);if(r)return h;var m=t==(e<0?l:p)?null:Mf(a/3,t-l);return new ri(h,e<0?t!=l:t!=p,m)}o+=u-c}return r?t+o:new ri(t+o)},vt.prototype.touches=function(t,e){for(var r=0,o=ka(e),i=this.inverted?2:1,s=this.inverted?1:2,a=0;at)break;var c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1},vt.prototype.forEach=function(t){for(var e=this.inverted?2:1,r=this.inverted?1:2,o=0,i=0;o=0;e--){var o=t.getMirror(e);this.appendMap(t.maps[e].invert(),o!=null&&o>e?r-o-1:null)}},Et.prototype.invert=function(){var t=new Et;return t.appendMappingInverted(this),t},Et.prototype.map=function(t,e){if(e===void 0&&(e=1),this.mirror)return this._map(t,e,!0);for(var r=this.from;ri&&l0},at.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(at.prototype,oi);function jr(){throw new Error("Override me")}var ii=Object.create(null),Nt=function(){};Nt.prototype.apply=function(t){return jr()},Nt.prototype.getMap=function(){return vt.empty},Nt.prototype.invert=function(t){return jr()},Nt.prototype.map=function(t){return jr()},Nt.prototype.merge=function(t){return null},Nt.prototype.toJSON=function(){return jr()},Nt.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var r=ii[e.stepType];if(!r)throw new RangeError("No step type "+e.stepType+" defined");return r.fromJSON(t,e)},Nt.jsonID=function(t,e){if(t in ii)throw new RangeError("Duplicate use of step JSON ID "+t);return ii[t]=e,e.prototype.jsonID=t,e};var Dt=function(t,e){this.doc=t,this.failed=e};Dt.ok=function(t){return new Dt(t,null)},Dt.fail=function(t){return new Dt(null,t)},Dt.fromReplace=function(t,e,r,o){try{return Dt.ok(t.replace(e,r,o))}catch(i){if(i instanceof de)return Dt.fail(i.message);throw i}};var Ne=function(n){function t(e,r,o,i){n.call(this),this.from=e,this.to=r,this.slice=o,this.structure=!!i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){return this.structure&&si(r,this.from,this.to)?Dt.fail("Structure replace would overwrite content"):Dt.fromReplace(r,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new vt([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(r){return new t(this.from,this.from+this.slice.size,r.slice(this.from,this.to))},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted?null:new t(o.pos,Math.max(o.pos,i.pos),this.slice)},t.prototype.merge=function(r){if(!(r instanceof t)||r.structure||this.structure)return null;if(this.from+this.slice.size==r.from&&!this.slice.openEnd&&!r.slice.openStart){var o=this.slice.size+r.slice.size==0?T.empty:new T(this.slice.content.append(r.slice.content),this.slice.openStart,r.slice.openEnd);return new t(this.from,this.to+(r.to-r.from),o,this.structure)}else if(r.to==this.from&&!this.slice.openStart&&!r.slice.openEnd){var i=this.slice.size+r.slice.size==0?T.empty:new T(r.slice.content.append(this.slice.content),r.slice.openStart,this.slice.openEnd);return new t(r.from,this.to,i,this.structure)}else return null},t.prototype.toJSON=function(){var r={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(o.from,o.to,T.fromJSON(r,o.slice),!!o.structure)},t}(Nt);Nt.jsonID("replace",Ne);var Ft=function(n){function t(e,r,o,i,s,a,l){n.call(this),this.from=e,this.to=r,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=!!l}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){if(this.structure&&(si(r,this.from,this.gapFrom)||si(r,this.gapTo,this.to)))return Dt.fail("Structure gap-replace would overwrite content");var o=r.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return Dt.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?Dt.fromReplace(r,this.from,this.to,i):Dt.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new vt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(r){var o=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,r.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),s=r.map(this.gapFrom,-1),a=r.map(this.gapTo,1);return o.deleted&&i.deleted||si.pos?null:new t(o.pos,i.pos,s,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var r={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number"||typeof o.gapFrom!="number"||typeof o.gapTo!="number"||typeof o.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(o.from,o.to,o.gapFrom,o.gapTo,T.fromJSON(r,o.slice),o.insert,!!o.structure)},t}(Nt);Nt.jsonID("replaceAround",Ft);function si(n,t,e){for(var r=n.resolve(t),o=e-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Ef(n,t,e){return(t==0||n.canReplace(t,n.childCount))&&(e==n.childCount||n.canReplace(0,e))}function xn(n){for(var t=n.parent,e=t.content.cutByIndex(n.startIndex,n.endIndex),r=n.depth;;--r){var o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;p--)d||e.index(p)>0?(d=!0,c=S.from(e.node(p).copy(c)),u++):a--;for(var h=S.empty,m=0,g=o,y=!1;g>t;g--)y||r.after(g+1)=0;r--)e=S.from(t[r].type.create(t[r].attrs,e));var o=n.start,i=n.end;return this.step(new Ft(o,i,o,i,new T(e,0,0),t.length,!0))},at.prototype.setBlockType=function(n,t,e,r){var o=this;if(t===void 0&&(t=n),!e.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(n,t,function(s,a){if(s.isTextblock&&!s.hasMarkup(e,r)&&Tf(o.doc,o.mapping.slice(i).map(a),e)){o.clearIncompatible(o.mapping.slice(i).map(a,1),e);var l=o.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return o.step(new Ft(c,u,c+1,u-1,new T(S.from(e.create(r,null,s.marks)),0,0),1,!0)),!1}}),this};function Tf(n,t,e){var r=n.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,e)}at.prototype.setNodeMarkup=function(n,t,e,r){var o=this.doc.nodeAt(n);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var i=t.create(e,null,r||o.marks);if(o.isLeaf)return this.replaceWith(n,n+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new Ft(n,n+o.nodeSize,n+1,n+o.nodeSize-1,new T(S.from(i),0,0),1,!0))};function Oe(n,t,e,r){e===void 0&&(e=1);var o=n.resolve(t),i=o.depth-e,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,l=e-2;a>i;a--,l--){var c=o.node(a),u=o.index(a);if(c.type.spec.isolating)return!1;var p=c.content.cutByIndex(u,c.childCount),d=r&&r[l]||c;if(d!=c&&(p=p.replaceChild(0,d.type.create(d.attrs))),!c.canReplace(u+1,c.childCount)||!d.type.validContent(p))return!1}var h=o.indexAfter(i),m=r&&r[0];return o.node(i).canReplaceWith(h,h,m?m.type:o.node(i+1).type)}at.prototype.split=function(n,t,e){t===void 0&&(t=1);for(var r=this.doc.resolve(n),o=S.empty,i=S.empty,s=r.depth,a=r.depth-t,l=t-1;s>a;s--,l--){o=S.from(r.node(s).copy(o));var c=e&&e[l];i=S.from(c?c.type.create(c.attrs,i):r.node(s).copy(i))}return this.step(new Ne(n,n,new T(o.append(i),t,t),!0))};function li(n,t){var e=n.resolve(t),r=e.index();return Af(e.nodeBefore,e.nodeAfter)&&e.parent.canReplace(r,r+1)}function Af(n,t){return n&&t&&!n.isLeaf&&n.canAppend(t)}at.prototype.join=function(n,t){t===void 0&&(t=1);var e=new Ne(n-t,n+t,T.empty,!0);return this.step(e)};function _f(n,t,e){var r=n.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),e))return t;if(r.parentOffset==0)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,e))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,e))return r.after(s+1);if(a=0;a--){var l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(l>0?1:0),u=r.node(a),p=!1;if(s==1)p=u.canReplace(c,c,o);else{var d=u.contentMatchAt(c).findWrapping(o.firstChild.type);p=d&&u.canReplaceWith(c,c,d[0])}if(p)return l==0?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function ci(n,t,e){for(var r=[],o=0;o=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(r){if(r instanceof t&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from)return new t(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(o.from,o.to,r.markFromJSON(o.mark))},t}(Nt);Nt.jsonID("addMark",ui);var nr=function(n){function t(e,r,o){n.call(this),this.from=e,this.to=r,this.mark=o}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){var o=this,i=r.slice(this.from,this.to),s=new T(ci(i.content,function(a){return a.mark(o.mark.removeFromSet(a.marks))}),i.openStart,i.openEnd);return Dt.fromReplace(r,this.from,this.to,s)},t.prototype.invert=function(){return new ui(this.from,this.to,this.mark)},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(r){if(r instanceof t&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from)return new t(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(o.from,o.to,r.markFromJSON(o.mark))},t}(Nt);Nt.jsonID("removeMark",nr),at.prototype.addMark=function(n,t,e){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(n,t,function(l,c,u){if(!!l.isInline){var p=l.marks;if(!e.isInSet(p)&&u.type.allowsMarkType(e.type)){for(var d=Math.max(c,n),h=Math.min(c+l.nodeSize,t),m=e.addToSet(p),g=0;g=0;d--)this.step(o[d]);return this};function Df(n,t,e,r){if(e===void 0&&(e=t),r===void 0&&(r=T.empty),t==e&&!r.size)return null;var o=n.resolve(t),i=n.resolve(e);return xa(o,i,r)?new Ne(t,e,r):new Xt(o,i,r).fit()}at.prototype.replace=function(n,t,e){t===void 0&&(t=n),e===void 0&&(e=T.empty);var r=Df(this.doc,n,t,e);return r&&this.step(r),this},at.prototype.replaceWith=function(n,t,e){return this.replace(n,t,new T(S.from(e),0,0))},at.prototype.delete=function(n,t){return this.replace(n,t,T.empty)},at.prototype.insert=function(n,t){return this.replaceWith(n,n,t)};function xa(n,t,e){return!e.openStart&&!e.openEnd&&n.start()==t.start()&&n.parent.canReplace(n.index(),t.index(),e.content)}var Xt=function(t,e,r){this.$to=e,this.$from=t,this.unplaced=r,this.frontier=[];for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}this.placed=S.empty;for(var s=t.depth;s>0;s--)this.placed=S.from(t.node(s).copy(this.placed))},Ma={depth:{configurable:!0}};Ma.depth.get=function(){return this.frontier.length-1},Xt.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;for(var s=this.placed,a=o.depth,l=i.depth;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;var c=new T(s,a,l);if(e>-1)return new Ft(o.pos,e,this.$to.pos,this.$to.end(),c,r);if(c.size||o.pos!=this.$to.pos)return new Ne(o.pos,i.pos,c)},Xt.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--){var r=void 0,o=void 0;e?(o=fi(this.unplaced.content,e-1).firstChild,r=o.content):r=this.unplaced.content;for(var i=r.firstChild,s=this.depth;s>=0;s--){var a=this.frontier[s],l=a.type,c=a.match,u=void 0,p=void 0;if(t==1&&(i?c.matchType(i.type)||(p=c.fillBefore(S.from(i),!1)):l.compatibleContent(o.type)))return{sliceDepth:e,frontierDepth:s,parent:o,inject:p};if(t==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:e,frontierDepth:s,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}},Xt.prototype.openMore=function(){var t=this.unplaced,e=t.content,r=t.openStart,o=t.openEnd,i=fi(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new T(e,r+1,Math.max(o,i.size+r>=e.size-o?r+1:0)),!0)},Xt.prototype.dropNode=function(){var t=this.unplaced,e=t.content,r=t.openStart,o=t.openEnd,i=fi(e,r);if(i.childCount<=1&&r>0){var s=e.size-r<=r+i.size;this.unplaced=new T(rr(e,r-1,1),r-1,s?r-1:o)}else this.unplaced=new T(rr(e,r,1),r,o)},Xt.prototype.placeNodes=function(t){for(var e=t.sliceDepth,r=t.frontierDepth,o=t.parent,i=t.inject,s=t.wrap;this.depth>r;)this.closeFrontierNode();if(s)for(var a=0;a1||u==0||b.content.size)&&(m=O,d.push(Ca(b.mark(g.allowedMarks(b.marks)),p==1?u:0,p==c.childCount?k:-1)))}var v=p==c.childCount;v||(k=-1),this.placed=or(this.placed,r,S.from(d)),this.frontier[r].match=m,v&&k<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,M=c;E1&&i==this.$to.end(--o);)++i;return i},Xt.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var r=this.frontier[e],o=r.match,i=r.type,s=e=0;l--){var c=this.frontier[l],u=c.match,p=c.type,d=pi(t,l,p,u,!0);if(!d||d.childCount)continue t}return{depth:e,fit:a,move:s?t.doc.resolve(t.after(e+1)):t}}}},Xt.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=or(this.placed,e.depth,e.fit)),t=e.move;for(var r=e.depth+1;r<=t.depth;r++){var o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t},Xt.prototype.openFrontierNode=function(t,e,r){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=or(this.placed,this.depth,S.from(t.create(e,r))),this.frontier.push({type:t,match:t.contentMatch})},Xt.prototype.closeFrontierNode=function(){var t=this.frontier.pop(),e=t.match.fillBefore(S.empty,!0);e.childCount&&(this.placed=or(this.placed,this.frontier.length,e))},Object.defineProperties(Xt.prototype,Ma);function rr(n,t,e){return t==0?n.cutByIndex(e):n.replaceChild(0,n.firstChild.copy(rr(n.firstChild.content,t-1,e)))}function or(n,t,e){return t==0?n.append(e):n.replaceChild(n.childCount-1,n.lastChild.copy(or(n.lastChild.content,t-1,e)))}function fi(n,t){for(var e=0;e1&&(r=r.replaceChild(0,Ca(r.firstChild,t-1,r.childCount==1?e-1:0))),t>0&&(r=n.type.contentMatch.fillBefore(r).append(r),e<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(S.empty,!0)))),n.copy(r)}function pi(n,t,e,r,o){var i=n.node(t),s=o?n.indexAfter(t):n.index(t);if(s==i.childCount&&!e.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!Rf(e,i.content,s)?a:null}function Rf(n,t,e){for(var r=e;r0;a--,l--){var c=r.node(a).type.spec;if(c.defining||c.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==l&&i.splice(1,0,-a)}for(var u=i.indexOf(s),p=[],d=e.openStart,h=e.content,m=0;;m++){var g=h.firstChild;if(p.push(g),m==e.openStart)break;h=g.content}d>0&&p[d-1].type.spec.defining&&r.node(u).type!=p[d-1].type?d-=1:d>=2&&p[d-1].isTextblock&&p[d-2].type.spec.defining&&r.node(u).type!=p[d-2].type&&(d-=2);for(var y=e.openStart;y>=0;y--){var k=(y+d+1)%(e.openStart+1),b=p[k];if(!!b)for(var O=0;O=0&&(this.replace(n,t,e),!(this.steps.length>V));L--){var z=i[L];z<0||(n=r.before(z),t=o.after(z))}return this};function Ea(n,t,e,r,o){if(tr){var s=o.contentMatchAt(0),a=s.fillBefore(n).append(n);n=a.append(s.matchFragment(a).fillBefore(S.empty,!0))}return n}at.prototype.replaceRangeWith=function(n,t,e){if(!e.isInline&&n==t&&this.doc.resolve(n).parent.content.size){var r=_f(this.doc,n,e.type);r!=null&&(n=t=r)}return this.replaceRange(n,t,new T(S.from(e),0,0))},at.prototype.deleteRange=function(n,t){for(var e=this.doc.resolve(n),r=this.doc.resolve(t),o=Na(e,r),i=0;i0&&(a||e.node(s-1).canReplace(e.index(s-1),r.indexAfter(s-1))))return this.delete(e.before(s),r.after(s))}for(var l=1;l<=e.depth&&l<=r.depth;l++)if(n-e.start(l)==e.depth-l&&t>e.end(l)&&r.end(l)-t!=r.depth-l)return this.delete(e.before(l),t);return this.delete(n,t)};function Na(n,t){for(var e=[],r=Math.min(n.depth,t.depth),o=r;o>=0;o--){var i=n.start(o);if(it.pos+(t.depth-o)||n.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==n.depth&&o==t.depth&&n.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&e.push(o)}return e}var di=Object.create(null),B=function(t,e,r){this.ranges=r||[new Vf(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Pe={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Pe.anchor.get=function(){return this.$anchor.pos},Pe.head.get=function(){return this.$head.pos},Pe.from.get=function(){return this.$from.pos},Pe.to.get=function(){return this.$to.pos},Pe.$from.get=function(){return this.ranges[0].$from},Pe.$to.get=function(){return this.ranges[0].$to},Pe.empty.get=function(){for(var n=this.ranges,t=0;t=0;i--){var s=e<0?Mn(t.node(0),t.node(i),t.before(i+1),t.index(i),e,r):Mn(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,r);if(s)return s}},B.near=function(t,e){return e===void 0&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new Te(t.node(0))},B.atStart=function(t){return Mn(t,t,0,0,1)||new Te(t)},B.atEnd=function(t){return Mn(t,t,t.content.size,t.childCount,-1)||new Te(t)},B.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var r=di[e.type];if(!r)throw new RangeError("No selection type "+e.type+" defined");return r.fromJSON(t,e)},B.jsonID=function(t,e){if(t in di)throw new RangeError("Duplicate use of selection JSON ID "+t);return di[t]=e,e.prototype.jsonID=t,e},B.prototype.getBookmark=function(){return j.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(B.prototype,Pe),B.prototype.visible=!0;var Vf=function(t,e){this.$from=t,this.$to=e},j=function(n){function t(r,o){o===void 0&&(o=r),n.call(this,r,o)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={$cursor:{configurable:!0}};return e.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(o,i){var s=o.resolve(i.map(this.head));if(!s.parent.inlineContent)return n.near(s);var a=o.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:s,s)},t.prototype.replace=function(o,i){if(i===void 0&&(i=T.empty),n.prototype.replace.call(this,o,i),i==T.empty){var s=this.$from.marksAcross(this.$to);s&&o.ensureMarks(s)}},t.prototype.eq=function(o){return o instanceof t&&o.anchor==this.anchor&&o.head==this.head},t.prototype.getBookmark=function(){return new ir(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(o,i){if(typeof i.anchor!="number"||typeof i.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(o.resolve(i.anchor),o.resolve(i.head))},t.create=function(o,i,s){s===void 0&&(s=i);var a=o.resolve(i);return new this(a,s==i?a:o.resolve(s))},t.between=function(o,i,s){var a=o.pos-i.pos;if((!s||a)&&(s=a>=0?1:-1),!i.parent.inlineContent){var l=n.findFrom(i,s,!0)||n.findFrom(i,-s,!0);if(l)i=l.$head;else return n.near(i,s)}return o.parent.inlineContent||(a==0?o=i:(o=(n.findFrom(o,-s,!0)||n.findFrom(o,s,!0)).$anchor,o.pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&P.isSelectable(a))return P.create(n,e-(o<0?a.nodeSize:0))}else{var l=Mn(n,a,e+o,o<0?a.childCount:0,o,i);if(l)return l}e+=a.nodeSize*o}}function Oa(n,t,e){var r=n.steps.length-1;if(!(r0},t.prototype.setStoredMarks=function(o){return this.storedMarks=o,this.updated|=Kr,this},t.prototype.ensureMarks=function(o){return J.sameSet(this.storedMarks||this.selection.$from.marks(),o)||this.setStoredMarks(o),this},t.prototype.addStoredMark=function(o){return this.ensureMarks(o.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(o){return this.ensureMarks(o.removeFromSet(this.storedMarks||this.selection.$head.marks()))},e.storedMarksSet.get=function(){return(this.updated&Kr)>0},t.prototype.addStep=function(o,i){n.prototype.addStep.call(this,o,i),this.updated=this.updated&~Kr,this.storedMarks=null},t.prototype.setTime=function(o){return this.time=o,this},t.prototype.replaceSelection=function(o){return this.selection.replace(this,o),this},t.prototype.replaceSelectionWith=function(o,i){var s=this.selection;return i!==!1&&(o=o.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||J.none))),s.replaceWith(this,o),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(o,i,s){s===void 0&&(s=i);var a=this.doc.type.schema;if(i==null)return o?this.replaceSelectionWith(a.text(o),!0):this.deleteSelection();if(!o)return this.deleteRange(i,s);var l=this.storedMarks;if(!l){var c=this.doc.resolve(i);l=s==i?c.marks():c.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(i,s,a.text(o,l)),this.selection.empty||this.setSelection(B.near(this.selection.$to)),this},t.prototype.setMeta=function(o,i){return this.meta[typeof o=="string"?o:o.key]=i,this},t.prototype.getMeta=function(o){return this.meta[typeof o=="string"?o:o.key]},e.isGeneric.get=function(){for(var r in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=Aa,this},e.scrolledIntoView.get=function(){return(this.updated&Aa)>0},Object.defineProperties(t.prototype,e),t}(at);function _a(n,t){return!t||!n?n:n.bind(t)}var sr=function(t,e,r){this.name=t,this.init=_a(e.init,r),this.apply=_a(e.apply,r)},Pf=[new sr("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new sr("selection",{init:function(t,e){return t.selection||B.atStart(e.doc)},apply:function(t){return t.selection}}),new sr("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,r,o){return o.selection.$cursor?t.storedMarks:null}}),new sr("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],hi=function(t,e){var r=this;this.schema=t,this.fields=Pf.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach(function(o){if(r.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");r.plugins.push(o),r.pluginsByKey[o.key]=o,o.spec.state&&r.fields.push(new sr(o.key,o.spec.state,o))})},Ot=function(t){this.config=t},Ur={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};Ur.schema.get=function(){return this.config.schema},Ur.plugins.get=function(){return this.config.plugins},Ot.prototype.apply=function(t){return this.applyTransaction(t).state},Ot.prototype.filterTransaction=function(t,e){e===void 0&&(e=-1);for(var r=0;r-1&&ar.splice(e,1)},Object.defineProperties(Ot.prototype,Ur);var ar=[];function Da(n,t,e){for(var r in n){var o=n[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=Da(o,t,{})),e[r]=o}return e}var Ht=function(t){this.props={},t.props&&Da(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:Ra("plugin")};Ht.prototype.getState=function(t){return t[this.key]};var mi=Object.create(null);function Ra(n){return n in mi?n+"$"+ ++mi[n]:(mi[n]=0,n+"$")}var se=function(t){t===void 0&&(t="key"),this.key=Ra(t)};se.prototype.get=function(t){return t.config.pluginsByKey[this.key]},se.prototype.getState=function(t){return t[this.key]};function vi(n,t){return n.selection.empty?!1:(t&&t(n.tr.deleteSelection().scrollIntoView()),!0)}function Va(n,t,e){var r=n.selection,o=r.$cursor;if(!o||(e?!e.endOfTextblock("backward",n):o.parentOffset>0))return!1;var i=Ba(o);if(!i){var s=o.blockRange(),a=s&&xn(s);return a==null?!1:(t&&t(n.tr.lift(s,a).scrollIntoView()),!0)}var l=i.nodeBefore;if(!l.type.spec.isolating&&ja(n,i,t))return!0;if(o.parent.content.size==0&&(Cn(l,"end")||P.isSelectable(l))){if(t){var c=n.tr.deleteRange(o.before(),o.after());c.setSelection(Cn(l,"end")?B.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):P.create(c.doc,i.pos-l.nodeSize)),t(c.scrollIntoView())}return!0}return l.isAtom&&i.depth==o.depth-1?(t&&t(n.tr.delete(i.pos-l.nodeSize,i.pos).scrollIntoView()),!0):!1}function Cn(n,t,e){for(;n;n=t=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(e&&n.childCount!=1)return!1}return!1}function Ia(n,t,e){var r=n.selection,o=r.$head,i=r.empty,s=o;if(!i)return!1;if(o.parent.isTextblock){if(e?!e.endOfTextblock("backward",n):o.parentOffset>0)return!1;s=Ba(o)}var a=s&&s.nodeBefore;return!a||!P.isSelectable(a)?!1:(t&&t(n.tr.setSelection(P.create(n.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}function Ba(n){if(!n.parent.type.spec.isolating)for(var t=n.depth-1;t>=0;t--){if(n.index(t)>0)return n.doc.resolve(n.before(t+1));if(n.node(t).type.spec.isolating)break}return null}function Pa(n,t,e){var r=n.selection,o=r.$cursor;if(!o||(e?!e.endOfTextblock("forward",n):o.parentOffset=0;t--){var e=n.node(t);if(n.index(t)+11&&r.after()!=r.end(-1)){var o=r.before();if(Oe(n.doc,o))return t&&t(n.tr.split(o).scrollIntoView()),!0}var i=r.blockRange(),s=i&&xn(i);return s==null?!1:(t&&t(n.tr.lift(i,s).scrollIntoView()),!0)}function zf(n,t){var e=n.selection,r=e.$from,o=e.$to;if(n.selection instanceof P&&n.selection.node.isBlock)return!r.parentOffset||!Oe(n.doc,r.pos)?!1:(t&&t(n.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,s=n.tr;(n.selection instanceof j||n.selection instanceof Te)&&s.deleteSelection();var a=r.depth==0?null:gi(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=i&&a?[{type:a}]:null,c=Oe(s.doc,s.mapping.map(r.pos),1,l);if(!l&&!c&&Oe(s.doc,s.mapping.map(r.pos),1,a&&[{type:a}])&&(l=[{type:a}],c=!0),c&&(s.split(s.mapping.map(r.pos),1,l),!i&&!r.parentOffset&&r.parent.type!=a)){var u=s.mapping.map(r.before()),p=s.doc.resolve(u);r.node(-1).canReplaceWith(p.index(),p.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}t(s.scrollIntoView())}return!0}function Lf(n,t){var e=n.selection,r=e.$from,o=e.to,i,s=r.sharedDepth(o);return s==0?!1:(i=r.before(s),t&&t(n.tr.setSelection(P.create(n.doc,i))),!0)}function Ff(n,t){return t&&t(n.tr.setSelection(new Te(n.doc))),!0}function Hf(n,t,e){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(e&&e(n.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||li(n.doc,t.pos))?!1:(e&&e(n.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function ja(n,t,e){var r=t.nodeBefore,o=t.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(Hf(n,t,e))return!0;var a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(e){for(var l=t.pos+o.nodeSize,c=S.empty,u=i.length-1;u>=0;u--)c=S.from(i[u].create(null,c));c=S.from(r.copy(c));var p=n.tr.step(new Ft(t.pos-1,l,t.pos,l,new T(c,1,0),i.length,!0)),d=l+2*i.length;li(p.doc,d)&&p.join(d),e(p.scrollIntoView())}return!0}var h=B.findFrom(t,1),m=h&&h.$from.blockRange(h.$to),g=m&&xn(m);if(g!=null&&g>=t.depth)return e&&e(n.tr.lift(m,g).scrollIntoView()),!0;if(a&&Cn(o,"start",!0)&&Cn(r,"end")){for(var y=r,k=[];k.push(y),!y.isTextblock;)y=y.lastChild;for(var b=o,O=1;!b.isTextblock;b=b.firstChild)O++;if(y.canReplace(y.childCount,y.childCount,b.content)){if(e){for(var v=S.empty,E=k.length-1;E>=0;E--)v=S.from(k[E].copy(v));var M=n.tr.step(new Ft(t.pos-k.length,t.pos+o.nodeSize,t.pos+O,t.pos+o.nodeSize-O,new T(v,k.length,0),0,!0));e(M.scrollIntoView())}return!0}}return!1}function Wa(n,t){return function(e,r){var o=e.selection,i=o.$from,s=o.$to,a=i.blockRange(s),l=a&&ai(a,n,t);return l?(r&&r(e.tr.wrap(a,l).scrollIntoView()),!0):!1}}function Jf(n,t){return function(e,r){var o=e.selection,i=o.from,s=o.to,a=!1;return e.doc.nodesBetween(i,s,function(l,c){if(a)return!1;if(!(!l.isTextblock||l.hasMarkup(n,t)))if(l.type==n)a=!0;else{var u=e.doc.resolve(c),p=u.index();a=u.parent.canReplaceWith(p,p+1,n)}}),a?(r&&r(e.tr.setBlockType(i,s,n,t).scrollIntoView()),!0):!1}}function yi(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];return function(e,r,o){for(var i=0;i=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;var u=e.doc.resolve(a.start-2);c=new Zn(u,u,a.depth),a.endIndex=0;s--)i=S.from(e[s].type.create(e[s].attrs,i));n.step(new Ft(t.start-(r?2:0),t.end,t.start,t.end,new T(i,0,0),e.length,!0));for(var a=0,l=0;la;s--)i-=o.child(s).nodeSize,r.delete(i-1,i+1);var l=r.doc.resolve(e.start),c=l.nodeAfter;if(r.mapping.map(e.end)!=e.start+l.nodeAfter.nodeSize)return!1;var u=e.startIndex==0,p=e.endIndex==o.childCount,d=l.node(-1),h=l.index(-1);if(!d.canReplace(h+(u?0:1),h+1,c.content.append(p?S.empty:S.from(o))))return!1;var m=l.pos,g=m+c.nodeSize;return r.step(new Ft(m-(u?1:0),g+(p?1:0),m+1,g-1,new T((u?S.empty:S.from(o.copy(S.empty))).append(p?S.empty:S.from(o.copy(S.empty))),u?0:1,p?0:1),u?0:1)),t(r.scrollIntoView()),!0}function Gf(n){return function(t,e){var r=t.selection,o=r.$from,i=r.$to,s=o.blockRange(i,function(g){return g.childCount&&g.firstChild.type==n});if(!s)return!1;var a=s.startIndex;if(a==0)return!1;var l=s.parent,c=l.child(a-1);if(c.type!=n)return!1;if(e){var u=c.lastChild&&c.lastChild.type==l.type,p=S.from(u?n.create():null),d=new T(S.from(n.create(null,S.from(l.type.create(null,p)))),u?3:1,0),h=s.start,m=s.end;e(t.tr.step(new Ft(h-(u?3:1),m,h,m,d,1,!0)).scrollIntoView())}return!0}}var C={};if(typeof navigator!="undefined"&&typeof document!="undefined"){var ki=/Edge\/(\d+)/.exec(navigator.userAgent),Ga=/MSIE \d/.test(navigator.userAgent),wi=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Si=C.ie=!!(Ga||wi||ki);C.ie_version=Ga?document.documentMode||6:wi?+wi[1]:ki?+ki[1]:null,C.gecko=!Si&&/gecko\/(\d+)/i.test(navigator.userAgent),C.gecko_version=C.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var xi=!Si&&/Chrome\/(\d+)/.exec(navigator.userAgent);C.chrome=!!xi,C.chrome_version=xi&&+xi[1],C.safari=!Si&&/Apple Computer/.test(navigator.vendor),C.ios=C.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),C.mac=C.ios||/Mac/.test(navigator.platform),C.android=/Android \d/.test(navigator.userAgent),C.webkit="webkitFontSmoothing"in document.documentElement.style,C.webkit_version=C.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var Wt=function(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t},Mi=function(n){var t=n.assignedSlot||n.parentNode;return t&&t.nodeType==11?t.host:t},Ya=null,Ae=function(n,t,e){var r=Ya||(Ya=document.createRange());return r.setEnd(n,e==null?n.nodeValue.length:e),r.setStart(n,t||0),r},Gr=function(n,t,e,r){return e&&(Xa(n,t,e,r,-1)||Xa(n,t,e,r,1))},Yf=/^(img|br|input|textarea|hr)$/i;function Xa(n,t,e,r,o){for(;;){if(n==e&&t==r)return!0;if(t==(o<0?0:he(n))){var i=n.parentNode;if(i.nodeType!=1||Qf(n)||Yf.test(n.nodeName)||n.contentEditable=="false")return!1;t=Wt(n)+(o<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[t+(o<0?-1:0)],n.contentEditable=="false")return!1;t=o<0?he(n):0}else return!1}}function he(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Xf(n,t,e){for(var r=t==0,o=t==he(n);r||o;){if(n==e)return!0;var i=Wt(n);if(n=n.parentNode,!n)return!1;r=r&&i==0,o=o&&i==he(n)}}function Qf(n){for(var t,e=n;e&&!(t=e.pmViewDesc);e=e.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==n||t.contentDOM==n)}var Ci=function(n){var t=n.isCollapsed;return t&&C.chrome&&n.rangeCount&&!n.getRangeAt(0).collapsed&&(t=!1),t};function En(n,t){var e=document.createEvent("Event");return e.initEvent("keydown",!0,!0),e.keyCode=n,e.key=e.code=t,e}function Zf(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Le(n,t){return typeof n=="number"?n:n[t]}function tp(n){var t=n.getBoundingClientRect(),e=t.width/n.offsetWidth||1,r=t.height/n.offsetHeight||1;return{left:t.left,right:t.left+n.clientWidth*e,top:t.top,bottom:t.top+n.clientHeight*r}}function Qa(n,t,e){for(var r=n.someProp("scrollThreshold")||0,o=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument,s=e||n.dom;s;s=Mi(s))if(s.nodeType==1){var a=s==i.body||s.nodeType!=1,l=a?Zf(i):tp(s),c=0,u=0;if(t.topl.bottom-Le(r,"bottom")&&(u=t.bottom-l.bottom+Le(o,"bottom")),t.leftl.right-Le(r,"right")&&(c=t.right-l.right+Le(o,"right")),c||u)if(a)i.defaultView.scrollBy(c,u);else{var p=s.scrollLeft,d=s.scrollTop;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);var h=s.scrollLeft-p,m=s.scrollTop-d;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(a)break}}function ep(n){for(var t=n.dom.getBoundingClientRect(),e=Math.max(0,t.top),r,o,i=(t.left+t.right)/2,s=e+1;s=e-20){r=a,o=l.top;break}}}return{refDOM:r,refTop:o,stack:Za(n.dom)}}function Za(n){for(var t=[],e=n.ownerDocument;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),n!=e);n=Mi(n));return t}function np(n){var t=n.refDOM,e=n.refTop,r=n.stack,o=t?t.getBoundingClientRect().top:0;tl(r,o==0?0:o-e)}function tl(n,t){for(var e=0;e=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);var h=d.left>t.left?d.left-t.left:d.right=(d.left+d.right)/2?1:0));continue}}!e&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(i=c+1)}}return e&&e.nodeType==3?op(e,o):!e||r&&e.nodeType==1?{node:n,offset:i}:el(e,o)}function op(n,t){for(var e=n.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:n,offset:0}}function Ei(n,t){return n.left>=t.left-1&&n.left<=t.right+1&&n.top>=t.top-1&&n.top<=t.bottom+1}function ip(n,t){var e=n.parentNode;return e&&/^li$/i.test(e.nodeName)&&t.left(a.left+a.right)/2?1:-1}return n.docView.posFromDOM(o,i,s)}function ap(n,t,e,r){for(var o=-1,i=t;i!=n.dom;){var s=n.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else if(a.right-1?o:n.docView.posFromDOM(t,e)}function nl(n,t,e){var r=n.childNodes.length;if(r&&e.topt.top&&s++}i==n.dom&&s==i.childNodes.length-1&&i.lastChild.nodeType==1&&t.top>i.lastChild.getBoundingClientRect().bottom?u=n.state.doc.content.size:(s==0||i.nodeType!=1||i.childNodes[s-1].nodeName!="BR")&&(u=ap(n,i,s,t))}u==null&&(u=sp(n,c,t));var g=n.docView.nearestDesc(c,!0);return{pos:u,inside:g?g.posAtStart-g.border:-1}}function Fe(n,t){var e=n.getClientRects();return e.length?e[t<0?0:e.length-1]:n.getBoundingClientRect()}var cp=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function rl(n,t,e){var r=n.docView.domFromPos(t,e<0?-1:1),o=r.node,i=r.offset,s=C.webkit||C.gecko;if(o.nodeType==3)if(s&&(cp.test(o.nodeValue)||(e<0?!i:i==o.nodeValue.length))){var a=Fe(Ae(o,i,i),e);if(C.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i=0&&i==o.nodeValue.length?(u--,d=1):e<0?u--:p++,lr(Fe(Ae(o,u,p),d),d<0)}if(!n.state.doc.resolve(t).parent.inlineContent){if(i&&(e<0||i==he(o))){var h=o.childNodes[i-1];if(h.nodeType==1)return Ni(h.getBoundingClientRect(),!1)}if(i=0)}if(i&&(e<0||i==he(o))){var g=o.childNodes[i-1],y=g.nodeType==3?Ae(g,he(g)-(s?0:1)):g.nodeType==1&&(g.nodeName!="BR"||!g.nextSibling)?g:null;if(y)return lr(Fe(y,1),!1)}if(i=0)}function lr(n,t){if(n.width==0)return n;var e=t?n.left:n.right;return{top:n.top,bottom:n.bottom,left:e,right:e}}function Ni(n,t){if(n.height==0)return n;var e=t?n.top:n.bottom;return{top:e,bottom:e,left:n.left,right:n.right}}function ol(n,t,e){var r=n.state,o=n.root.activeElement;r!=t&&n.updateState(t),o!=n.dom&&n.focus();try{return e()}finally{r!=t&&n.updateState(r),o!=n.dom&&o&&o.focus()}}function up(n,t,e){var r=t.selection,o=e=="up"?r.$from:r.$to;return ol(n,t,function(){for(var i=n.docView.domFromPos(o.pos,e=="up"?-1:1),s=i.node;;){var a=n.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.dom;break}s=a.dom.parentNode}for(var l=rl(n,o.pos,1),c=s.firstChild;c;c=c.nextSibling){var u=void 0;if(c.nodeType==1)u=c.getClientRects();else if(c.nodeType==3)u=Ae(c,0,c.nodeValue.length).getClientRects();else continue;for(var p=0;pd.top+1&&(e=="up"?l.top-d.top>(d.bottom-l.top)*2:d.bottom-l.bottom>(l.bottom-d.top)*2))return!1}}return!0})}var fp=/[\u0590-\u08ac]/;function pp(n,t,e){var r=t.selection,o=r.$head;if(!o.parent.isTextblock)return!1;var i=o.parentOffset,s=!i,a=i==o.parent.content.size,l=n.root.getSelection();return!fp.test(o.parent.textContent)||!l.modify?e=="left"||e=="backward"?s:a:ol(n,t,function(){var c=l.getRangeAt(0),u=l.focusNode,p=l.focusOffset,d=l.caretBidiLevel;l.modify("move",e,"character");var h=o.depth?n.docView.domAfterPos(o.before()):n.dom,m=!h.contains(l.focusNode.nodeType==1?l.focusNode:l.focusNode.parentNode)||u==l.focusNode&&p==l.focusOffset;return l.removeAllRanges(),l.addRange(c),d!=null&&(l.caretBidiLevel=d),m})}var il=null,sl=null,al=!1;function dp(n,t,e){return il==t&&sl==e?al:(il=t,sl=e,al=e=="up"||e=="down"?up(n,t,e):pp(n,t,e))}var ae=0,ll=1,cr=2,He=3,Q=function(t,e,r,o){this.parent=t,this.children=e,this.dom=r,r.pmViewDesc=this,this.contentDOM=o,this.dirty=ae},me={size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};Q.prototype.matchesWidget=function(){return!1},Q.prototype.matchesMark=function(){return!1},Q.prototype.matchesNode=function(){return!1},Q.prototype.matchesHack=function(t){return!1},Q.prototype.parseRule=function(){return null},Q.prototype.stopEvent=function(){return!1},me.size.get=function(){for(var n=0,t=0;tWt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))l=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(e==0)for(var c=t;;c=c.parentNode){if(c==this.dom){l=!1;break}if(c.parentNode.firstChild!=c)break}if(l==null&&e==t.childNodes.length)for(var u=t;;u=u.parentNode){if(u==this.dom){l=!0;break}if(u.parentNode.lastChild!=u)break}}return(l==null?r>0:l)?this.posAtEnd:this.posAtStart},Q.prototype.nearestDesc=function(t,e){for(var r=!0,o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i&&(!e||i.node))if(r&&i.nodeDOM&&!(i.nodeDOM.nodeType==1?i.nodeDOM.contains(t.nodeType==1?t:t.parentNode):i.nodeDOM==t))r=!1;else return i}},Q.prototype.getDesc=function(t){for(var e=t.pmViewDesc,r=e;r;r=r.parent)if(r==this)return e},Q.prototype.posFromDOM=function(t,e,r){for(var o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i)return i.localPosFromDOM(t,e,r)}return-1},Q.prototype.descAt=function(t){for(var e=0,r=0;et||s instanceof pl){o=t-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(var l=void 0;r&&!(l=this.children[r-1]).size&&l instanceof cl&&l.widget.type.side>=0;r--);if(e<=0){for(var c,u=!0;c=r?this.children[r-1]:null,!(!c||c.dom.parentNode==this.contentDOM);r--,u=!1);return c&&e&&u&&!c.border&&!c.domAtom?c.domFromPos(c.size,e):{node:this.contentDOM,offset:c?Wt(c.dom)+1:0}}else{for(var p,d=!0;p=r=u&&e<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,e,u);t=s;for(var p=a;p>0;p--){var d=this.children[p-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){o=Wt(d.dom)+1;break}t-=d.size}o==-1&&(o=0)}if(o>-1&&(c>e||a==this.children.length-1)){e=c;for(var h=a+1;hl&&se){var _=p;p=d,d=_}var V=document.createRange();V.setEnd(d.node,d.offset),V.setStart(p.node,p.offset),h.removeAllRanges(),h.addRange(V)}}},Q.prototype.ignoreMutation=function(t){return!this.contentDOM&&t.type!="selection"},me.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},Q.prototype.markDirty=function(t,e){for(var r=0,o=0;o=r:tr){var a=r+i.border,l=s-i.border;if(t>=a&&e<=l){this.dirty=t==r||e==s?cr:ll,t==a&&e==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=He:i.markDirty(t-a,e-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM?cr:He}r=s}this.dirty=cr},Q.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var r=t==1?cr:ll;e.dirty0&&(a=Ai(a,0,r,i));for(var c=0;c-1?c:null,p=c&&c.pos<0,d=new Qt(this,u&&u.node);bp(this.node,this.innerDeco,function(h,m,g){h.spec.marks?d.syncToMarks(h.spec.marks,a,o):h.type.side>=0&&!g&&d.syncToMarks(m==s.node.childCount?J.none:s.node.child(m).marks,a,o),d.placeWidget(h,o,l)},function(h,m,g,y){d.syncToMarks(h.marks,a,o);var k;d.findNodeMatch(h,m,g,y)||p&&o.state.selection.from>l&&o.state.selection.to-1&&d.updateNodeAt(h,m,g,k,o)||d.updateNextNode(h,m,g,o,y)||d.addNode(h,m,g,o,l),l+=h.nodeSize}),d.syncToMarks(Je,a,o),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||this.dirty==cr)&&(u&&this.protectLocalComposition(o,u),dl(this.contentDOM,this.children,o),C.ios&&kp(this.dom))},t.prototype.localCompositionInfo=function(o,i){var s=o.state.selection,a=s.from,l=s.to;if(!(!(o.state.selection instanceof j)||ai+this.node.content.size)){var c=o.root.getSelection(),u=wp(c.focusNode,c.focusOffset);if(!(!u||!this.dom.contains(u.parentNode)))if(this.node.inlineContent){var p=u.nodeValue,d=Sp(this.node.content,p,a-i,l-i);return d<0?null:{node:u,pos:d,text:p}}else return{node:u,pos:-1}}},t.prototype.protectLocalComposition=function(o,i){var s=i.node,a=i.pos,l=i.text;if(!this.getDesc(s)){for(var c=s;c.parentNode!=this.contentDOM;c=c.parentNode){for(;c.previousSibling;)c.parentNode.removeChild(c.previousSibling);for(;c.nextSibling;)c.parentNode.removeChild(c.nextSibling);c.pmViewDesc&&(c.pmViewDesc=null)}var u=new hp(this,c,s,l);o.compositionNodes.push(u),this.children=Ai(this.children,a,a+l.length,o,u)}},t.prototype.update=function(o,i,s,a){return this.dirty==He||!o.sameMarkup(this.node)?!1:(this.updateInner(o,i,s,a),!0)},t.prototype.updateInner=function(o,i,s,a){this.updateOuterDeco(i),this.node=o,this.innerDeco=s,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=ae},t.prototype.updateOuterDeco=function(o){if(!Ti(o,this.outerDeco)){var i=this.nodeDOM.nodeType!=1,s=this.dom;this.dom=hl(this.dom,this.nodeDOM,Oi(this.outerDeco,this.node,i),Oi(o,this.node,i)),this.dom!=s&&(s.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=o}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")},e.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(t.prototype,e),t}(Q);function ul(n,t,e,r,o){return ml(r,t,n),new ur(null,n,t,e,r,r,r,o,0)}var fl=function(n){function t(r,o,i,s,a,l,c){n.call(this,r,o,i,s,a,null,l,c)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){for(var o=this.nodeDOM.parentNode;o&&o!=this.dom&&!o.pmIsDeco;)o=o.parentNode;return{skip:o||!0}},t.prototype.update=function(o,i,s,a){return this.dirty==He||this.dirty!=ae&&!this.inParent()||!o.sameMarkup(this.node)?!1:(this.updateOuterDeco(i),(this.dirty!=ae||o.text!=this.node.text)&&o.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=o.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=o,this.dirty=ae,!0)},t.prototype.inParent=function(){for(var o=this.parent.contentDOM,i=this.nodeDOM;i;i=i.parentNode)if(i==o)return!0;return!1},t.prototype.domFromPos=function(o){return{node:this.nodeDOM,offset:o}},t.prototype.localPosFromDOM=function(o,i,s){return o==this.nodeDOM?this.posAtStart+Math.min(i,this.node.text.length):n.prototype.localPosFromDOM.call(this,o,i,s)},t.prototype.ignoreMutation=function(o){return o.type!="characterData"&&o.type!="selection"},t.prototype.slice=function(o,i,s){var a=this.node.cut(o,i),l=document.createTextNode(a.text);return new t(this.parent,a,this.outerDeco,this.innerDeco,l,l,s)},t.prototype.markDirty=function(o,i){n.prototype.markDirty.call(this,o,i),this.dom!=this.nodeDOM&&(o==0||i==this.nodeDOM.nodeValue.length)&&(this.dirty=He)},e.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,e),t}(ur),pl=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(o){return this.dirty==ae&&this.dom.nodeName==o},e.domAtom.get=function(){return!0},e.ignoreForCoords.get=function(){return this.dom.nodeName=="IMG"},Object.defineProperties(t.prototype,e),t}(Q),mp=function(n){function t(e,r,o,i,s,a,l,c,u,p){n.call(this,e,r,o,i,s,a,l,u,p),this.spec=c}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.update=function(r,o,i,s){if(this.dirty==He)return!1;if(this.spec.update){var a=this.spec.update(r,o,i);return a&&this.updateInner(r,o,i,s),a}else return!this.contentDOM&&!r.isLeaf?!1:n.prototype.update.call(this,r,o,i,s)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():n.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():n.prototype.deselectNode.call(this)},t.prototype.setSelection=function(r,o,i,s){this.spec.setSelection?this.spec.setSelection(r,o,i):n.prototype.setSelection.call(this,r,o,i,s)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),n.prototype.destroy.call(this)},t.prototype.stopEvent=function(r){return this.spec.stopEvent?this.spec.stopEvent(r):!1},t.prototype.ignoreMutation=function(r){return this.spec.ignoreMutation?this.spec.ignoreMutation(r):n.prototype.ignoreMutation.call(this,r)},t}(ur);function dl(n,t,e){for(var r=n.firstChild,o=!1,i=0;i>1,s=Math.min(i,t.length);o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var c=Yr.create(this.top,t[i],e,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}},Qt.prototype.findNodeMatch=function(t,e,r,o){var i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,e,r))i=this.top.children.indexOf(s,this.index);else for(var a=this.index,l=Math.min(this.top.children.length,a+5);a0;){for(var a=void 0;;)if(r){var l=e.children[r-1];if(l instanceof Yr)e=l,r=l.children.length;else{a=l,r--;break}}else{if(e==t)break t;r=e.parent.children.indexOf(e),e=e.parent}var c=a.node;if(!!c){if(c!=n.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function yp(n,t){return n.type.side-t.type.side}function bp(n,t,e,r){var o=t.locals(n),i=0;if(o.length==0){for(var s=0;si;)c.push(o[l++]);var b=i+g.nodeSize;if(g.isText){var O=b;l0){if(n.childNodes.length>t&&n.childNodes[t].nodeType==3)return n.childNodes[t];n=n.childNodes[t-1],t=he(n)}else if(n.nodeType==1&&t=e){var u=l.lastIndexOf(t,r-a);if(u>=0&&u+t.length+a>=e)return a+u}}}return-1}function Ai(n,t,e,r,o){for(var i=[],s=0,a=0;s=e||u<=t?i.push(l):(ce&&i.push(l.slice(e-c,l.size,r)))}return i}function gl(n,t){var e=n.root.getSelection(),r=n.state.doc;if(!e.focusNode)return null;var o=n.docView.nearestDesc(e.focusNode),i=o&&o.size==0,s=n.docView.posFromDOM(e.focusNode,e.focusOffset);if(s<0)return null;var a=r.resolve(s),l,c;if(Ci(e)){for(l=a;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&P.isSelectable(o.node)&&o.parent&&!(o.node.isInline&&Xf(e.focusNode,e.focusOffset,o.dom))){var u=o.posBefore;c=new P(s==u?a:r.resolve(u))}}else{var p=n.docView.posFromDOM(e.anchorNode,e.anchorOffset);if(p<0)return null;l=r.resolve(p)}if(!c){var d=t=="pointer"||n.state.selection.head0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?n.doc.resolve(t>0?i.after():i.before()):null:i;return s&&B.findFrom(s,t)}function on(n,t){return n.dispatch(n.state.tr.setSelection(t).scrollIntoView()),!0}function Ml(n,t,e){var r=n.state.selection;if(r instanceof j){if(!r.empty||e.indexOf("s")>-1)return!1;if(n.endOfTextblock(t>0?"right":"left")){var o=Vi(n.state,t);return o&&o instanceof P?on(n,o):!1}else if(!(C.mac&&e.indexOf("m")>-1)){var i=r.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;var l=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=n.docView.descAt(l))&&!a.contentDOM?P.isSelectable(s)?on(n,new P(t<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):C.webkit?on(n,new j(n.state.doc.resolve(t<0?l:l+s.nodeSize))):!1:!1}}else{if(r instanceof P&&r.node.isInline)return on(n,new j(t>0?r.$to:r.$from));var c=Vi(n.state,t);return c?on(n,c):!1}}function Xr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function pr(n){var t=n.pmViewDesc;return t&&t.size==0&&(n.nextSibling||n.nodeName!="BR")}function Ii(n){var t=n.root.getSelection(),e=t.focusNode,r=t.focusOffset;if(!!e){var o,i,s=!1;for(C.gecko&&e.nodeType==1&&r0){if(e.nodeType!=1)break;var a=e.childNodes[r-1];if(pr(a))o=e,i=--r;else if(a.nodeType==3)e=a,r=e.nodeValue.length;else break}else{if(Cl(e))break;for(var l=e.previousSibling;l&&pr(l);)o=e.parentNode,i=Wt(l),l=l.previousSibling;if(l)e=l,r=Xr(e);else{if(e=e.parentNode,e==n.dom)break;r=0}}s?Pi(n,t,e,r):o&&Pi(n,t,o,i)}}function Bi(n){var t=n.root.getSelection(),e=t.focusNode,r=t.focusOffset;if(!!e){for(var o=Xr(e),i,s;;)if(r-1||C.mac&&e.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||n.endOfTextblock(t<0?"up":"down")){var s=Vi(n.state,t);if(s&&s instanceof P)return on(n,s)}if(!o.parent.inlineContent){var a=t<0?o:i,l=r instanceof Te?B.near(a,t):B.findFrom(a,t);return l?on(n,l):!1}return!1}function Nl(n,t){if(!(n.state.selection instanceof j))return!0;var e=n.state.selection,r=e.$head,o=e.$anchor,i=e.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(n.endOfTextblock(t>0?"forward":"backward"))return!0;var s=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=n.state.tr;return t<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),n.dispatch(a),!0}return!1}function Ol(n,t,e){n.domObserver.stop(),t.contentEditable=e,n.domObserver.start()}function Np(n){if(!(!C.safari||n.state.selection.$head.parentOffset>0)){var t=n.root.getSelection(),e=t.focusNode,r=t.focusOffset;if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){var o=e.firstChild;Ol(n,o,!0),setTimeout(function(){return Ol(n,o,!1)},20)}}}function Op(n){var t="";return n.ctrlKey&&(t+="c"),n.metaKey&&(t+="m"),n.altKey&&(t+="a"),n.shiftKey&&(t+="s"),t}function Tp(n,t){var e=t.keyCode,r=Op(t);return e==8||C.mac&&e==72&&r=="c"?Nl(n,-1)||Ii(n):e==46||C.mac&&e==68&&r=="c"?Nl(n,1)||Bi(n):e==13||e==27?!0:e==37?Ml(n,-1,r)||Ii(n):e==39?Ml(n,1,r)||Bi(n):e==38?El(n,-1,r)||Ii(n):e==40?Np(n)||El(n,1,r)||Bi(n):r==(C.mac?"m":"c")&&(e==66||e==73||e==89||e==90)}function Ap(n,t,e){var r=n.docView.parseRange(t,e),o=r.node,i=r.fromOffset,s=r.toOffset,a=r.from,l=r.to,c=n.root.getSelection(),u=null,p=c.anchorNode;if(p&&n.dom.contains(p.nodeType==1?p:p.parentNode)&&(u=[{node:p,offset:c.anchorOffset}],Ci(c)||u.push({node:c.focusNode,offset:c.focusOffset})),C.chrome&&n.lastKeyCode===8)for(var d=s;d>i;d--){var h=o.childNodes[d-1],m=h.pmViewDesc;if(h.nodeName=="BR"&&!m){s=d;break}if(!m||m.size)break}var g=n.state.doc,y=n.someProp("domParser")||ie.fromSchema(n.state.schema),k=g.resolve(a),b=null,O=y.parse(o,{topNode:k.parent,topMatch:k.parent.contentMatchAt(k.index()),topOpen:!0,from:i,to:s,preserveWhitespace:k.parent.type.spec.code?"full":!0,editableContent:!0,findPositions:u,ruleFromNode:_p,context:k});if(u&&u[0].pos!=null){var v=u[0].pos,E=u[1]&&u[1].pos;E==null&&(E=v),b={anchor:v+a,head:E+a}}return{doc:O,sel:b,from:a,to:l}}function _p(n){var t=n.pmViewDesc;if(t)return t.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(C.safari&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){var e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(n.parentNode.lastChild==n||C.safari&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0}}function Dp(n,t,e,r,o){if(t<0){var i=n.lastSelectionTime>Date.now()-50?n.lastSelectionOrigin:null,s=gl(n,i);if(s&&!n.state.selection.eq(s)){var a=n.state.tr.setSelection(s);i=="pointer"?a.setMeta("pointer",!0):i=="key"&&a.scrollIntoView(),n.dispatch(a)}return}var l=n.state.doc.resolve(t),c=l.sharedDepth(e);t=l.before(c+1),e=n.state.doc.resolve(e).after(c+1);var u=n.state.selection,p=Ap(n,t,e);if(C.chrome&&n.cursorWrapper&&p.sel&&p.sel.anchor==n.cursorWrapper.deco.from){var d=n.cursorWrapper.deco.type.toDOM.nextSibling,h=d&&d.nodeValue?d.nodeValue.length:1;p.sel={anchor:p.sel.anchor+h,head:p.sel.anchor+h}}var m=n.state.doc,g=m.slice(p.from,p.to),y,k;n.lastKeyCode===8&&Date.now()-100Date.now()-225||C.android)&&o.some(function(q){return q.nodeName=="DIV"||q.nodeName=="P"})&&n.someProp("handleKeyDown",function(q){return q(n,En(13,"Enter"))})){n.lastIOSEnter=0;return}else{if(p.sel){var O=Tl(n,n.state.doc,p.sel);O&&!O.eq(n.state.selection)&&n.dispatch(n.state.tr.setSelection(O))}return}n.domChangeCount++,n.state.selection.fromn.state.selection.from&&b.start<=n.state.selection.from+2?b.start=n.state.selection.from:b.endA=n.state.selection.to-2&&(b.endB+=n.state.selection.to-b.endA,b.endA=n.state.selection.to)),C.ie&&C.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>p.from&&p.doc.textBetween(b.start-p.from-1,b.start-p.from+1)==" \xA0"&&(b.start--,b.endA--,b.endB--);var v=p.doc.resolveNoCache(b.start-p.from),E=p.doc.resolveNoCache(b.endB-p.from),M=v.sameParent(E)&&v.parent.inlineContent,_;if((C.ios&&n.lastIOSEnter>Date.now()-225&&(!M||o.some(function(q){return q.nodeName=="DIV"||q.nodeName=="P"}))||!M&&v.posb.start&&Vp(m,b.start,b.endA,v,E)&&n.someProp("handleKeyDown",function(q){return q(n,En(8,"Backspace"))})){C.android&&C.chrome&&n.domObserver.suppressSelectionUpdates();return}C.chrome&&C.android&&b.toB==b.from&&(n.lastAndroidDelete=Date.now()),C.android&&!M&&v.start()!=E.start()&&E.parentOffset==0&&v.depth==E.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==b.endA&&(b.endB-=2,E=p.doc.resolveNoCache(b.endB-p.from),setTimeout(function(){n.someProp("handleKeyDown",function(q){return q(n,En(13,"Enter"))})},20));var V=b.start,L=b.endA,z,Z,U,st;if(M){if(v.pos==E.pos)C.ie&&C.ie_version<=11&&v.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(function(){return $e(n)},20)),z=n.state.tr.delete(V,L),Z=m.resolve(b.start).marksAcross(m.resolve(b.endA));else if(b.endA==b.endB&&(st=m.resolve(b.start))&&(U=Rp(v.parent.content.cut(v.parentOffset,E.parentOffset),st.parent.content.cut(st.parentOffset,b.endA-st.start()))))z=n.state.tr,U.type=="add"?z.addMark(V,L,U.mark):z.removeMark(V,L,U.mark);else if(v.parent.child(v.index()).isText&&v.index()==E.index()-(E.textOffset?0:1)){var At=v.parent.textBetween(v.parentOffset,E.parentOffset);if(n.someProp("handleTextInput",function(q){return q(n,V,L,At)}))return;z=n.state.tr.insertText(At,V,L)}}if(z||(z=n.state.tr.replace(V,L,p.doc.slice(b.start-p.from,b.endB-p.from))),p.sel){var tt=Tl(n,z.doc,p.sel);tt&&!(C.chrome&&C.android&&n.composing&&tt.empty&&(b.start!=b.endB||n.lastAndroidDeletet.content.size?null:Di(n,t.resolve(e.anchor),t.resolve(e.head))}function Rp(n,t){for(var e=n.firstChild.marks,r=t.firstChild.marks,o=e,i=r,s,a,l,c=0;ce||zi(s,!0,!1)0&&(t||n.indexAfter(r)==n.node(r).childCount);)r--,o++,t=!1;if(e)for(var i=n.node(r).maybeChild(n.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Ip(n,t,e,r,o){var i=n.findDiffStart(t,e);if(i==null)return null;var s=n.findDiffEnd(t,e+n.size,e+t.size),a=s.a,l=s.b;if(o=="end"){var c=Math.max(0,i-Math.min(a,l));r-=a+c-i}if(a=a?i-r:0;i-=u,l=i+(l-a),a=i}else if(l=l?i-r:0;i-=p,a=i+(a-l),l=i}return{start:i,endA:a,endB:l}}function Al(n,t){for(var e=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;var s=r.firstChild;e.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),r=s.content}var a=n.someProp("clipboardSerializer")||mt.fromSchema(n.state.schema),l=zl(),c=l.createElement("div");c.appendChild(a.serializeFragment(r,{document:l}));for(var u=c.firstChild,p;u&&u.nodeType==1&&(p=Bl[u.nodeName.toLowerCase()]);){for(var d=p.length-1;d>=0;d--){for(var h=l.createElement(p[d]);c.firstChild;)h.appendChild(c.firstChild);c.appendChild(h),p[d]!="tbody"&&(o++,i++)}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(e));var m=n.someProp("clipboardTextSerializer",function(g){return g(t)})||t.content.textBetween(0,t.content.size,` + +`);return{dom:c,text:m}}function _l(n,t,e,r,o){var i,s=o.parent.type.spec.code,a;if(!e&&!t)return null;var l=t&&(r||s||!e);if(l){if(n.someProp("transformPastedText",function(E){t=E(t,s||r)}),s)return t?new T(S.from(n.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0):T.empty;var c=n.someProp("clipboardTextParser",function(E){return E(t,o,r)});if(c)a=c;else{var u=o.marks(),p=n.state,d=p.schema,h=mt.fromSchema(d);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(function(E){var M=i.appendChild(document.createElement("p"));E&&M.appendChild(h.serializeNode(d.text(E,u)))})}}else n.someProp("transformPastedHTML",function(E){e=E(e)}),i=zp(e),C.webkit&&Lp(i);var m=i&&i.querySelector("[data-pm-slice]"),g=m&&/^(\d+) (\d+) (.*)/.exec(m.getAttribute("data-pm-slice"));if(!a){var y=n.someProp("clipboardParser")||n.someProp("domParser")||ie.fromSchema(n.state.schema);a=y.parseSlice(i,{preserveWhitespace:!!(l||g),context:o,ruleFromNode:function(M){if(M.nodeName=="BR"&&!M.nextSibling&&M.parentNode&&!Bp.test(M.parentNode.nodeName))return{ignore:!0}}})}if(g)a=Fp(Il(a,+g[1],+g[2]),g[3]);else if(a=T.maxOpen(Pp(a.content,o),!0),a.openStart||a.openEnd){for(var k=0,b=0,O=a.content.firstChild;k=0;r--){var o=e(r);if(o)return o.v}return n}function Dl(n,t,e){e===void 0&&(e=0);for(var r=t.length-1;r>=e;r--)n=t[r].create(null,S.from(n));return n}function Rl(n,t,e,r,o){if(o=e&&(a=t<0?s.contentMatchAt(0).fillBefore(a,n.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(S.empty,!0))),n.replaceChild(t<0?0:n.childCount-1,s.copy(a))}function Il(n,t,e){return t]*>)*/.exec(n);t&&(n=n.slice(t[0].length));var e=zl().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),o;if((o=r&&Bl[r[1].toLowerCase()])&&(n=o.map(function(s){return"<"+s+">"}).join("")+n+o.map(function(s){return""}).reverse().join("")),e.innerHTML=n,o)for(var i=0;i=0;a-=2){var l=e.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=S.from(l.create(r[a+1],o)),i++,s++}return new T(o,i,s)}var Hp={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Fi=C.ie&&C.ie_version<=11,Hi=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Hi.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},Hi.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var Kt=function(t,e){var r=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(o){for(var i=0;is.target.nodeValue.length})?r.flushSoon():r.flush()}),this.currentSelection=new Hi,Fi&&(this.onCharData=function(o){r.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Kt.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){t.flushingSoon=-1,t.flush()},20))},Kt.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},Kt.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Hp),Fi&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},Kt.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var r=0;r-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Ri(this.view)&&!this.ignoreSelectionChange(e),o=-1,i=-1,s=!1,a=[];if(this.view.editable)for(var l=0;l1){var u=a.filter(function(h){return h.nodeName=="BR"});if(u.length==2){var p=u[0],d=u[1];p.parentNode&&p.parentNode.parentNode==d.parentNode?d.remove():p.remove()}}(o>-1||r)&&(o>-1&&(this.view.docView.markDirty(o,i),Jp(this.view)),this.handleDOMChange(o,i,s,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||$e(this.view),this.currentSelection.set(e))}},Kt.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(var o=0;oi.depth?u(n,e,i.nodeAfter,i.before(c),o,!0):u(n,e,i.node(c),i.before(c),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var l=s(a);if(l)return l.v}return!1}function On(n,t,e){n.focused||n.focus();var r=n.state.tr.setSelection(t);e=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Up(n,t){if(t==-1)return!1;var e=n.state.doc.resolve(t),r=e.nodeAfter;return r&&r.isAtom&&P.isSelectable(r)?(On(n,new P(e),"pointer"),!0):!1}function Gp(n,t){if(t==-1)return!1;var e=n.state.selection,r,o;e instanceof P&&(r=e.node);for(var i=n.state.doc.resolve(t),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(P.isSelectable(a)){r&&e.$from.depth>0&&s>=e.$from.depth&&i.before(e.$from.depth+1)==e.$from.pos?o=i.before(e.$from.depth):o=i.before(s);break}}return o!=null?(On(n,P.create(n.state.doc,o),"pointer"),!0):!1}function Yp(n,t,e,r,o){return qi(n,"handleClickOn",t,e,r)||n.someProp("handleClick",function(i){return i(n,t,r)})||(o?Gp(n,e):Up(n,e))}function Xp(n,t,e,r){return qi(n,"handleDoubleClickOn",t,e,r)||n.someProp("handleDoubleClick",function(o){return o(n,t,r)})}function Qp(n,t,e,r){return qi(n,"handleTripleClickOn",t,e,r)||n.someProp("handleTripleClick",function(o){return o(n,t,r)})||Zp(n,e,r)}function Zp(n,t,e){if(e.button!=0)return!1;var r=n.state.doc;if(t==-1)return r.inlineContent?(On(n,j.create(r,0,r.content.size),"pointer"),!0):!1;for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)On(n,j.create(r,a+1,a+1+s.content.size),"pointer");else if(P.isSelectable(s))On(n,P.create(r,a),"pointer");else continue;return!0}}function ji(n){return to(n)}var Fl=C.mac?"metaKey":"ctrlKey";Jt.mousedown=function(n,t){n.shiftKey=t.shiftKey;var e=ji(n),r=Date.now(),o="singleClick";r-n.lastClick.time<500&&Kp(t,n.lastClick)&&!t[Fl]&&(n.lastClick.type=="singleClick"?o="doubleClick":n.lastClick.type=="doubleClick"&&(o="tripleClick")),n.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=n.posAtCoords(Qr(t));!i||(o=="singleClick"?(n.mouseDown&&n.mouseDown.done(),n.mouseDown=new Zr(n,i,t,e)):(o=="doubleClick"?Xp:Qp)(n,i.pos,i.inside,t)?t.preventDefault():sn(n,"pointer"))};var Zr=function(t,e,r,o){var i=this;this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=r,this.flushed=o,this.selectNode=r[Fl],this.allowDefault=r.shiftKey,this.delayedSelectionSync=!1;var s,a;if(e.inside>-1)s=t.state.doc.nodeAt(e.inside),a=e.inside;else{var l=t.state.doc.resolve(e.pos);s=l.parent,a=l.depth?l.before():0}this.mightDrag=null;var c=o?null:r.target,u=c?t.docView.nearestDesc(c,!0):null;this.target=u?u.dom:null;var p=t.state,d=p.selection;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof P&&d.from<=a&&d.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&C.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){i.view.mouseDown==i&&i.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),sn(t,"pointer")};Zr.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return $e(t.view)}),this.view.mouseDown=null},Zr.prototype.up=function(t){if(this.done(),!!this.view.dom.contains(t.target.nodeType==3?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Qr(t))),this.allowDefault||!e?sn(this.view,"pointer"):Yp(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||C.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||C.chrome&&!(this.view.state.selection instanceof j)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(On(this.view,B.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):sn(this.view,"pointer")}},Zr.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),sn(this.view,"pointer"),t.buttons==0&&this.done()},Jt.touchdown=function(n){ji(n),sn(n,"pointer")},Jt.contextmenu=function(n){return ji(n)};function Hl(n,t){return n.composing?!0:C.safari&&Math.abs(t.timeStamp-n.compositionEndedAt)<500?(n.compositionEndedAt=-2e8,!0):!1}var td=C.android?5e3:-1;Rt.compositionstart=Rt.compositionupdate=function(n){if(!n.composing){n.domObserver.flush();var t=n.state,e=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!e.textOffset&&e.parentOffset&&e.nodeBefore.marks.some(function(a){return a.type.spec.inclusive===!1})))n.markCursor=n.state.storedMarks||e.marks(),to(n,!0),n.markCursor=null;else if(to(n),C.gecko&&t.selection.empty&&e.parentOffset&&!e.textOffset&&e.nodeBefore.marks.length)for(var r=n.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){r.collapse(s,s.nodeValue.length);break}else o=s,i=-1}n.composing=!0}Jl(n,td)},Rt.compositionend=function(n,t){n.composing&&(n.composing=!1,n.compositionEndedAt=t.timeStamp,Jl(n,20))};function Jl(n,t){clearTimeout(n.composingTimeout),t>-1&&(n.composingTimeout=setTimeout(function(){return to(n)},t))}function $l(n){for(n.composing&&(n.composing=!1,n.compositionEndedAt=ed());n.compositionNodes.length>0;)n.compositionNodes.pop().markParentsDirty()}function ed(){var n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function to(n,t){if(n.domObserver.forceFlush(),$l(n),t||n.docView.dirty){var e=gl(n);return e&&!e.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(e)):n.updateState(n.state),!0}return!1}function nd(n,t){if(!!n.dom.parentNode){var e=n.dom.parentNode.appendChild(document.createElement("div"));e.appendChild(t),e.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),n.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e),n.focus()},50)}}var Tn=C.ie&&C.ie_version<15||C.ios&&C.webkit_version<604;Jt.copy=Rt.cut=function(n,t){var e=n.state.selection,r=t.type=="cut";if(!e.empty){var o=Tn?null:t.clipboardData,i=e.content(),s=Al(n,i),a=s.dom,l=s.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):nd(n,a),r&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}};function rd(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function od(n,t){if(!!n.dom.parentNode){var e=n.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(e?"textarea":"div"));e||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(function(){n.focus(),r.parentNode&&r.parentNode.removeChild(r),e?Wi(n,r.value,null,t):Wi(n,r.textContent,r.innerHTML,t)},50)}}function Wi(n,t,e,r){var o=_l(n,t,e,n.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",function(a){return a(n,r,o||T.empty)}))return!0;if(!o)return!1;var i=rd(o),s=i?n.state.tr.replaceSelectionWith(i,n.shiftKey):n.state.tr.replaceSelection(o);return n.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Rt.paste=function(n,t){var e=Tn?null:t.clipboardData;e&&Wi(n,e.getData("text/plain"),e.getData("text/html"),t)?t.preventDefault():od(n,t)};var id=function(t,e){this.slice=t,this.move=e},ql=C.mac?"altKey":"ctrlKey";Jt.dragstart=function(n,t){var e=n.mouseDown;if(e&&e.done(),!!t.dataTransfer){var r=n.state.selection,o=r.empty?null:n.posAtCoords(Qr(t));if(!(o&&o.pos>=r.from&&o.pos<=(r instanceof P?r.to-1:r.to))){if(e&&e.mightDrag)n.dispatch(n.state.tr.setSelection(P.create(n.state.doc,e.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){var i=n.docView.nearestDesc(t.target,!0);i&&i.node.type.spec.draggable&&i!=n.docView&&n.dispatch(n.state.tr.setSelection(P.create(n.state.doc,i.posBefore)))}}var s=n.state.selection.content(),a=Al(n,s),l=a.dom,c=a.text;t.dataTransfer.clearData(),t.dataTransfer.setData(Tn?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",Tn||t.dataTransfer.setData("text/plain",c),n.dragging=new id(s,!t[ql])}},Jt.dragend=function(n){var t=n.dragging;window.setTimeout(function(){n.dragging==t&&(n.dragging=null)},50)},Rt.dragover=Rt.dragenter=function(n,t){return t.preventDefault()},Rt.drop=function(n,t){var e=n.dragging;if(n.dragging=null,!!t.dataTransfer){var r=n.posAtCoords(Qr(t));if(!!r){var o=n.state.doc.resolve(r.pos);if(!!o){var i=e&&e.slice;i?n.someProp("transformPasted",function(m){i=m(i)}):i=_l(n,t.dataTransfer.getData(Tn?"Text":"text/plain"),Tn?null:t.dataTransfer.getData("text/html"),!1,o);var s=e&&!t[ql];if(n.someProp("handleDrop",function(m){return m(n,t,i||T.empty,s)})){t.preventDefault();return}if(!!i){t.preventDefault();var a=i?Sa(n.state.doc,o.pos,i):o.pos;a==null&&(a=o.pos);var l=n.state.tr;s&&l.deleteSelection();var c=l.mapping.map(a),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,p=l.doc;if(u?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),!l.doc.eq(p)){var d=l.doc.resolve(c);if(u&&P.isSelectable(i.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new P(d));else{var h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach(function(m,g,y,k){return h=k}),l.setSelection(Di(n,d,l.doc.resolve(h)))}n.focus(),n.dispatch(l.setMeta("uiEvent","drop"))}}}}}},Jt.focus=function(n){n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(function(){n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.root.getSelection())&&$e(n)},20))},Jt.blur=function(n,t){n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.set({}),n.focused=!1)},Jt.beforeinput=function(n,t){if(C.chrome&&C.android&&t.inputType=="deleteContentBackward"){var e=n.domChangeCount;setTimeout(function(){if(n.domChangeCount==e&&(n.dom.blur(),n.focus(),!n.someProp("handleKeyDown",function(i){return i(n,En(8,"Backspace"))}))){var r=n.state.selection,o=r.$cursor;o&&o.pos>0&&n.dispatch(n.state.tr.delete(o.pos-1,o.pos).scrollIntoView())}},50)}};for(var jl in Rt)Jt[jl]=Rt[jl];function dr(n,t){if(n==t)return!0;for(var e in n)if(n[e]!==t[e])return!1;for(var r in t)if(!(r in n))return!1;return!0}var An=function(t,e){this.spec=e||an,this.side=this.spec.side||0,this.toDOM=t};An.prototype.map=function(t,e,r,o){var i=t.mapResult(e.from+o,this.side<0?-1:1),s=i.pos,a=i.deleted;return a?null:new ft(s-r,s-r,this)},An.prototype.valid=function(){return!0},An.prototype.eq=function(t){return this==t||t instanceof An&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&dr(this.spec,t.spec))},An.prototype.destroy=function(t){this.spec.destroy&&this.spec.destroy(t)};var le=function(t,e){this.spec=e||an,this.attrs=t};le.prototype.map=function(t,e,r,o){var i=t.map(e.from+o,this.spec.inclusiveStart?-1:1)-r,s=t.map(e.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new ft(i,s,this)},le.prototype.valid=function(t,e){return e.from=t&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(var l=0;lt){var c=this.children[l]+1;this.children[l+2].findInner(t-c,e-c,r,o+c,i)}},X.prototype.map=function(t,e,r){return this==gt||t.maps.length==0?this:this.mapInner(t,e,0,0,r||an)},X.prototype.mapInner=function(t,e,r,o,i){for(var s,a=0;aa&&u.to=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var s=t+1,a=s+e.content.size,l=0;ls&&c.type instanceof le){var u=Math.max(s,c.from)-s,p=Math.min(a,c.to)-s;uq+i||(U>=a[tt]+i?a[tt+1]=-1:st>=o&&(ut=At-st-(U-Z))&&(a[tt]+=ut,a[tt+1]+=ut))}},c=0;c=r.content.size){u=!0;continue}var m=e.map(n[p+1]+i,-1),g=m-o,y=r.content.findIndex(h),k=y.index,b=y.offset,O=r.maybeChild(k);if(O&&b==h&&b+O.nodeSize==g){var v=a[p+2].mapInner(e,O,d+1,n[p]+i+1,s);v!=gt?(a[p]=h,a[p+1]=g,a[p+2]=v):(a[p+1]=-2,u=!0)}else u=!0}if(u){var E=ad(a,n,t||[],e,o,i,s),M=no(E,r,0,s);t=M.local;for(var _=0;_e&&s.to0;)t++;n.splice(t,0,e)}function Gi(n){var t=[];return n.someProp("decorations",function(e){var r=e(n.state);r&&r!=gt&&t.push(r)}),n.cursorWrapper&&t.push(X.create(n.state.doc,[n.cursorWrapper.deco])),Zt.from(t)}var ct=function(t,e){this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(tc),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Ql(this),this.markCursor=null,this.cursorWrapper=null,Xl(this),this.nodeViews=Zl(this),this.docView=ul(this.state.doc,Yl(this),Gi(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,$p(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},ro={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};ro.props.get=function(){if(this._props.state!=this.state){var n=this._props;this._props={};for(var t in n)this._props[t]=n[t];this._props.state=this.state}return this._props},ct.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Ji(this),this._props=t,t.plugins&&(t.plugins.forEach(tc),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)},ct.prototype.setProps=function(t){var e={};for(var r in this._props)e[r]=this._props[r];e.state=this.state;for(var o in t)e[o]=t[o];this.update(e)},ct.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},ct.prototype.updateStateInner=function(t,e){var r=this,o=this.state,i=!1,s=!1;if(t.storedMarks&&this.composing&&($l(this),s=!0),this.state=t,e){var a=Zl(this);cd(a,this.nodeViews)&&(this.nodeViews=a,i=!0),Ji(this)}this.editable=Ql(this),Xl(this);var l=Gi(this),c=Yl(this),u=e?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",p=i||!this.docView.matchesNode(t.doc,c,l);(p||!t.selection.eq(o.selection))&&(s=!0);var d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&ep(this);if(s){this.domObserver.stop();var h=p&&(C.ie||C.chrome)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&ld(o.selection,t.selection);if(p){var m=C.chrome?this.trackWrites=this.root.getSelection().focusNode:null;(i||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ul(t.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&Ep(this))?$e(this,h):(Sl(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),u=="reset")this.dom.scrollTop=0;else if(u=="to selection"){var g=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(y){return y(r)})||(t.selection instanceof P?Qa(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),g):Qa(this,this.coordsAtPos(t.selection.head,1),g))}else d&&np(d)},ct.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},ct.prototype.updatePluginViews=function(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},ec=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),ud=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),fd=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),nc=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),pd=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),dd=ec&&(nc||+ec[1]<57)||fd&&nc,yt=0;yt<10;yt++)qe[48+yt]=qe[96+yt]=String(yt);for(var yt=1;yt<=24;yt++)qe[yt+111]="F"+yt;for(var yt=65;yt<=90;yt++)qe[yt]=String.fromCharCode(yt+32),oo[yt]=String.fromCharCode(yt);for(var Yi in qe)oo.hasOwnProperty(Yi)||(oo[Yi]=qe[Yi]);function hd(n){var t=dd&&(n.ctrlKey||n.altKey||n.metaKey)||(ud||pd)&&n.shiftKey&&n.key&&n.key.length==1,e=!t&&n.key||(n.shiftKey?oo:qe)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}var md=typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function vd(n){var t=n.split(/-(?!$)/),e=t[t.length-1];e=="Space"&&(e=" ");for(var r,o,i,s,a=0;a127)&&(s=qe[r.keyCode])&&s!=o){var l=t[Xi(s,r,!0)];if(l&&l(e.state,e.dispatch,e))return!0}else if(i&&r.shiftKey){var c=t[Xi(o,r,!0)];if(c&&c(e.state,e.dispatch,e))return!0}return!1}}function bd(n){return Object.prototype.toString.call(n).slice(8,-1)}function Qi(n){return bd(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function io(n,t){const e=x({},n);return Qi(n)&&Qi(t)&&Object.keys(t).forEach(r=>{Qi(t[r])?r in n?e[r]=io(n[r],t[r]):Object.assign(e,{[r]:t[r]}):Object.assign(e,{[r]:t[r]})}),e}function oc(n){return typeof n=="function"}function F(n,t=void 0,...e){return oc(n)?t?n.bind(t)(...e):n(...e):n}function A(n,t,e){return n.config[t]===void 0&&n.parent?A(n.parent,t,e):typeof n.config[t]=="function"?n.config[t].bind(Lt(x({},e),{parent:n.parent?A(n.parent,t,e):null})):n.config[t]}class bt{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=x(x({},this.config),t),this.name=this.config.name,t.defaultOptions&&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=F(A(this,"addOptions",{name:this.name}))),this.storage=F(A(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new bt(t)}configure(t={}){const e=this.extend();return e.options=io(this.options,t),e.storage=F(A(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new bt(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(A(e,"addOptions",{name:e.name})),e.storage=F(A(e,"addStorage",{name:e.name,options:e.options})),e}}function ic(n,t,e){const{from:r,to:o}=t,{blockSeparator:i=` + +`,textSerializers:s={}}=e||{};let a="",l=!0;return n.nodesBetween(r,o,(c,u,p,d)=>{var h;const m=s==null?void 0:s[c.type.name];m?(c.isBlock&&!l&&(a+=i,l=!0),a+=m({node:c,pos:u,parent:p,index:d})):c.isText?(a+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,o-u),l=!1):c.isBlock&&!l&&(a+=i,l=!0)}),a}function sc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}const kd=bt.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ht({key:new se("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:t,schema:e}=n,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos)),l=sc(e);return ic(r,{from:s,to:a},{textSerializers:l})}}})]}});var wd=Object.freeze({__proto__:null,blur:()=>({editor:n,view:t})=>(requestAnimationFrame(()=>{n.isDestroyed||t.dom.blur()}),!0)}),Sd=Object.freeze({__proto__:null,clearContent:(n=!1)=>({commands:t})=>t.setContent("",n)}),xd=Object.freeze({__proto__:null,clearNodes:()=>({state:n,tr:t,dispatch:e})=>{const{selection:r}=t,{ranges:o}=r;return o.forEach(i=>{n.doc.nodesBetween(i.$from.pos,i.$to.pos,(s,a)=>{if(s.type.isText)return;const l=t.doc.resolve(t.mapping.map(a)),c=t.doc.resolve(t.mapping.map(a+s.nodeSize)),u=l.blockRange(c);if(!u)return;const p=xn(u);if(s.type.isTextblock&&e){const{defaultType:d}=l.parent.contentMatchAt(l.index());t.setNodeMarkup(u.start,d)}(p||p===0)&&e&&t.lift(u,p)})}),!0}}),Md=Object.freeze({__proto__:null,command:n=>t=>n(t)}),Cd=Object.freeze({__proto__:null,createParagraphNear:()=>({state:n,dispatch:t})=>$a(n,t)});function pt(n,t){if(typeof n=="string"){if(!t.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return t.nodes[n]}return n}var Ed=Object.freeze({__proto__:null,deleteNode:n=>({tr:t,state:e,dispatch:r})=>{const o=pt(n,e.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const l=i.before(s),c=i.after(s);t.delete(l,c).scrollIntoView()}return!0}return!1}}),Nd=Object.freeze({__proto__:null,deleteRange:n=>({tr:t,dispatch:e})=>{const{from:r,to:o}=n;return e&&t.delete(r,o),!0}}),Od=Object.freeze({__proto__:null,deleteSelection:()=>({state:n,dispatch:t})=>vi(n,t)}),Td=Object.freeze({__proto__:null,enter:()=>({commands:n})=>n.keyboardShortcut("Enter")}),Ad=Object.freeze({__proto__:null,exitCode:()=>({state:n,dispatch:t})=>Ja(n,t)});function je(n,t){if(typeof n=="string"){if(!t.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return t.marks[n]}return n}function Zi(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function so(n,t,e={strict:!0}){const r=Object.keys(t);return r.length?r.every(o=>e.strict?t[o]===n[o]:Zi(t[o])?t[o].test(n[o]):t[o]===n[o]):!0}function ts(n,t,e={}){return n.find(r=>r.type===t&&so(r.attrs,e))}function _d(n,t,e={}){return!!ts(n,t,e)}function es(n,t,e={}){if(!n||!t)return;const r=n.parent.childAfter(n.parentOffset);if(!r.node)return;const o=ts(r.node.marks,t,e);if(!o)return;let i=n.index(),s=n.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(ts(r.node.marks,t,e);i>0&&o.isInSet(n.parent.child(i-1).marks);)i-=1,s-=n.parent.child(i).nodeSize;for(;a({tr:e,state:r,dispatch:o})=>{const i=je(n,r.schema),{doc:s,selection:a}=e,{$from:l,from:c,to:u}=a;if(o){const p=es(l,i,t);if(p&&p.from<=c&&p.to>=u){const d=j.create(s,p.from,p.to);e.setSelection(d)}}return!0}}),Rd=Object.freeze({__proto__:null,first:n=>t=>{const e=typeof n=="function"?n(t):n;for(let r=0;r({editor:e,view:r,tr:o,dispatch:i})=>{t=x({scrollIntoView:!0},t);const s=()=>{Id()&&r.dom.focus(),requestAnimationFrame(()=>{e.isDestroyed||(r.focus(),(t==null?void 0:t.scrollIntoView)&&e.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(i&&n===null&&!ac(e.state.selection))return s(),!0;const a=lc(e.state.doc,n)||e.state.selection,l=e.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0}}),Pd=Object.freeze({__proto__:null,forEach:(n,t)=>e=>n.every((r,o)=>t(r,Lt(x({},e),{index:o})))}),zd=Object.freeze({__proto__:null,insertContent:(n,t)=>({tr:e,commands:r})=>r.insertContentAt({from:e.selection.from,to:e.selection.to},n,t)});function cc(n){const t=`${n}`;return new window.DOMParser().parseFromString(t,"text/html").body}function ao(n,t,e){if(e=x({slice:!0,parseOptions:{}},e),typeof n=="object"&&n!==null)try{return Array.isArray(n)?S.fromArray(n.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),ao("",t,e)}if(typeof n=="string"){const r=ie.fromSchema(t);return e.slice?r.parseSlice(cc(n),e.parseOptions).content:r.parse(cc(n),e.parseOptions)}return ao("",t,e)}function Ld(n,t,e){const r=n.steps.length-1;if(r{s===0&&(s=u)}),n.setSelection(B.near(n.doc.resolve(s),e))}const Fd=n=>n.toString().startsWith("<");var Hd=Object.freeze({__proto__:null,insertContentAt:(n,t,e)=>({tr:r,dispatch:o,editor:i})=>{if(o){e=x({parseOptions:{},updateSelection:!0},e);const s=ao(t,i.schema,{parseOptions:x({preserveWhitespace:"full"},e.parseOptions)});if(s.toString()==="<>")return!0;let{from:a,to:l}=typeof n=="number"?{from:n,to:n}:n,c=!0;if((Fd(s)?s:[s]).forEach(p=>{c=c?p.isBlock:!1}),a===l&&c){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,l+=1)}r.replaceWith(a,l,s),e.updateSelection&&Ld(r,r.steps.length-1,-1)}return!0}}),Jd=Object.freeze({__proto__:null,joinBackward:()=>({state:n,dispatch:t})=>Va(n,t)}),$d=Object.freeze({__proto__:null,joinForward:()=>({state:n,dispatch:t})=>Pa(n,t)});const qd=typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1;function jd(n){const t=n.split(/-(?!$)/);let e=t[t.length-1];e==="Space"&&(e=" ");let r,o,i,s;for(let a=0;a({editor:t,view:e,tr:r,dispatch:o})=>{const i=jd(n).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{e.someProp("handleKeyDown",c=>c(e,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0}});function _n(n,t,e={}){const{from:r,to:o,empty:i}=n.selection,s=t?pt(t,n.schema):null,a=[];n.doc.nodesBetween(r,o,(p,d)=>{if(p.isText)return;const h=Math.max(r,d),m=Math.min(o,d+p.nodeSize);a.push({node:p,from:h,to:m})});const l=o-r,c=a.filter(p=>s?s.name===p.node.type.name:!0).filter(p=>so(p.node.attrs,e,{strict:!1}));return i?!!c.length:c.reduce((p,d)=>p+d.to-d.from,0)>=l}var Kd=Object.freeze({__proto__:null,lift:(n,t={})=>({state:e,dispatch:r})=>{const o=pt(n,e.schema);return _n(e,o,t)?Fa(e,r):!1}}),Ud=Object.freeze({__proto__:null,liftEmptyBlock:()=>({state:n,dispatch:t})=>qa(n,t)}),Gd=Object.freeze({__proto__:null,liftListItem:n=>({state:t,dispatch:e})=>{const r=pt(n,t.schema);return Wf(r)(t,e)}}),Yd=Object.freeze({__proto__:null,newlineInCode:()=>({state:n,dispatch:t})=>Ha(n,t)});function lo(n,t){return t.nodes[n]?"node":t.marks[n]?"mark":null}function uc(n,t){const e=typeof t=="string"?[t]:t;return Object.keys(n).reduce((r,o)=>(e.includes(o)||(r[o]=n[o]),r),{})}var Xd=Object.freeze({__proto__:null,resetAttributes:(n,t)=>({tr:e,state:r,dispatch:o})=>{let i=null,s=null;const a=lo(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=pt(n,r.schema)),a==="mark"&&(s=je(n,r.schema)),o&&e.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&e.setNodeMarkup(u,void 0,uc(c.attrs,t)),s&&c.marks.length&&c.marks.forEach(p=>{s===p.type&&e.addMark(u,u+c.nodeSize,s.create(uc(p.attrs,t)))})})}),!0):!1}}),Qd=Object.freeze({__proto__:null,scrollIntoView:()=>({tr:n,dispatch:t})=>(t&&n.scrollIntoView(),!0)}),Zd=Object.freeze({__proto__:null,selectAll:()=>({tr:n,commands:t})=>t.setTextSelection({from:0,to:n.doc.content.size})}),th=Object.freeze({__proto__:null,selectNodeBackward:()=>({state:n,dispatch:t})=>Ia(n,t)}),eh=Object.freeze({__proto__:null,selectNodeForward:()=>({state:n,dispatch:t})=>za(n,t)}),nh=Object.freeze({__proto__:null,selectParentNode:()=>({state:n,dispatch:t})=>Lf(n,t)});function fc(n,t,e={}){return ao(n,t,{slice:!1,parseOptions:e})}var rh=Object.freeze({__proto__:null,setContent:(n,t=!1,e={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=fc(n,o.schema,e),l=j.create(s,0,s.content.size);return i&&r.setSelection(l).replaceSelectionWith(a,!1).setMeta("preventUpdate",!t),!0}});function pc(n,t){const e=je(t,n.schema),{from:r,to:o,empty:i}=n.selection,s=[];i?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===e.name);return a?x({},a.attrs):{}}var oh=Object.freeze({__proto__:null,setMark:(n,t={})=>({tr:e,state:r,dispatch:o})=>{const{selection:i}=e,{empty:s,ranges:a}=i,l=je(n,r.schema);if(o)if(s){const c=pc(r,l);e.addStoredMark(l.create(x(x({},c),t)))}else a.forEach(c=>{const u=c.$from.pos,p=c.$to.pos;r.doc.nodesBetween(u,p,(d,h)=>{const m=Math.max(h,u),g=Math.min(h+d.nodeSize,p);d.marks.find(k=>k.type===l)?d.marks.forEach(k=>{l===k.type&&e.addMark(m,g,l.create(x(x({},k.attrs),t)))}):e.addMark(m,g,l.create(t))})});return!0}}),ih=Object.freeze({__proto__:null,setMeta:(n,t)=>({tr:e})=>(e.setMeta(n,t),!0)}),sh=Object.freeze({__proto__:null,setNode:(n,t={})=>({state:e,dispatch:r})=>{const o=pt(n,e.schema);return Jf(o,t)(e,r)}}),ah=Object.freeze({__proto__:null,setNodeSelection:n=>({tr:t,dispatch:e})=>{if(e){const{doc:r}=t,o=B.atStart(r).from,i=B.atEnd(r).to,s=cn(n,o,i),a=P.create(r,s);t.setSelection(a)}return!0}}),lh=Object.freeze({__proto__:null,setTextSelection:n=>({tr:t,dispatch:e})=>{if(e){const{doc:r}=t,{from:o,to:i}=typeof n=="number"?{from:n,to:n}:n,s=B.atStart(r).from,a=B.atEnd(r).to,l=cn(o,s,a),c=cn(i,s,a),u=j.create(r,l,c);t.setSelection(u)}return!0}}),ch=Object.freeze({__proto__:null,sinkListItem:n=>({state:t,dispatch:e})=>{const r=pt(n,t.schema);return Gf(r)(t,e)}});function co(n,t,e){return Object.fromEntries(Object.entries(e).filter(([r])=>{const o=n.find(i=>i.type===t&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function uh(n){for(let t=0;tt==null?void 0:t.includes(o.type.name));n.tr.ensureMarks(r)}}var fh=Object.freeze({__proto__:null,splitBlock:({keepMarks:n=!0}={})=>({tr:t,state:e,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=co(c,a.node().type.name,a.node().attrs);if(i instanceof P&&i.node.isBlock)return!a.parentOffset||!Oe(s,a.pos)?!1:(r&&(n&&dc(e,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const p=l.parentOffset===l.parent.content.size;i instanceof j&&t.deleteSelection();const d=a.depth===0?void 0:uh(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=p&&d?[{type:d,attrs:u}]:void 0,m=Oe(t.doc,t.mapping.map(a.pos),1,h);if(!h&&!m&&Oe(t.doc,t.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(m=!0,h=d?[{type:d,attrs:u}]:void 0),m&&(t.split(t.mapping.map(a.pos),1,h),d&&!p&&!a.parentOffset&&a.parent.type!==d)){const g=t.mapping.map(a.before()),y=t.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(a.before()),d)}n&&dc(e,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0}}),ph=Object.freeze({__proto__:null,splitListItem:n=>({tr:t,state:e,dispatch:r,editor:o})=>{var i;const s=pt(n,e.schema),{$from:a,$to:l}=e.selection,c=e.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const p=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let y=S.empty;const k=a.index(-1)?1:a.index(-2)?2:3;for(let _=a.depth-k;_>=a.depth-3;_-=1)y=S.from(a.node(_).copy(y));const b=a.indexAfter(-1){if(M>-1)return!1;_.isTextblock&&_.content.size===0&&(M=V+1)}),M>-1&&t.setSelection(j.near(t.doc.resolve(M))),t.scrollIntoView()}return!0}const d=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=co(p,u.type.name,u.attrs),m=co(p,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const g=d?[{type:s,attrs:h},{type:d,attrs:m}]:[{type:s,attrs:h}];return Oe(t.doc,a.pos,2)?(r&&t.split(a.pos,2,g).scrollIntoView(),!0):!1}});function dh(n,t){for(let e=n.depth;e>0;e-=1){const r=n.node(e);if(t(r))return{pos:e>0?n.before(e):0,start:n.start(e),depth:e,node:r}}}function hh(n){return t=>dh(t.$from,n)}function uo(n){const t=n.filter(o=>o.type==="extension"),e=n.filter(o=>o.type==="node"),r=n.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:e,markExtensions:r}}function hc(n,t){const{nodeExtensions:e}=uo(t),r=e.find(s=>s.name===n);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=F(A(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}var mh=Object.freeze({__proto__:null,toggleList:(n,t)=>({editor:e,tr:r,state:o,dispatch:i,chain:s,commands:a,can:l})=>{const{extensions:c}=e.extensionManager,u=pt(n,o.schema),p=pt(t,o.schema),{selection:d}=o,{$from:h,$to:m}=d,g=h.blockRange(m);if(!g)return!1;const y=hh(b=>hc(b.type.name,c))(d);if(g.depth>=1&&y&&g.depth-y.depth<=1){if(y.node.type===u)return a.liftListItem(p);if(hc(y.node.type.name,c)&&u.validContent(y.node.content)&&i)return r.setNodeMarkup(y.pos,u),!0}return l().wrapInList(u)?a.wrapInList(u):s().clearNodes().wrapInList(u).run()}});function rs(n,t,e={}){const{empty:r,ranges:o}=n.selection,i=t?je(t,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>i?i.name===p.type.name:!0).find(p=>so(p.attrs,e,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:p,$to:d})=>{const h=p.pos,m=d.pos;n.doc.nodesBetween(h,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const k=Math.max(h,y),b=Math.min(m,y+g.nodeSize);s+=b-k,a.push(...g.marks.map(v=>({mark:v,from:k,to:b})))})}),s===0)return!1;const l=a.filter(p=>i?i.name===p.mark.type.name:!0).filter(p=>so(p.mark.attrs,e,{strict:!1})).reduce((p,d)=>p+d.to-d.from,0),c=a.filter(p=>i?p.mark.type!==i&&p.mark.type.excludes(i):!0).reduce((p,d)=>p+d.to-d.from,0);return(l>0?l+c:l)>=s}var vh=Object.freeze({__proto__:null,toggleMark:(n,t={},e={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=e,s=je(n,r.schema);return rs(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)}}),gh=Object.freeze({__proto__:null,toggleNode:(n,t,e={})=>({state:r,commands:o})=>{const i=pt(n,r.schema),s=pt(t,r.schema);return _n(r,i,e)?o.setNode(s):o.setNode(i,e)}}),yh=Object.freeze({__proto__:null,toggleWrap:(n,t={})=>({state:e,dispatch:r})=>{const o=pt(n,e.schema);return _n(e,o,t)?Fa(e,r):Wa(o,t)(e,r)}}),bh=Object.freeze({__proto__:null,undoInputRule:()=>({state:n,dispatch:t})=>{const e=n.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,n.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1}}),kh=Object.freeze({__proto__:null,unsetAllMarks:()=>({tr:n,state:t,dispatch:e})=>{const{selection:r}=n,{empty:o,ranges:i}=r;return o||e&&Object.entries(t.schema.marks).forEach(([,s])=>{i.forEach(a=>{n.removeMark(a.$from.pos,a.$to.pos,s)})}),!0}}),wh=Object.freeze({__proto__:null,unsetMark:(n,t={})=>({tr:e,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=e,l=je(n,r.schema),{$from:c,empty:u,ranges:p}=a;if(!o)return!0;if(u&&s){let{from:d,to:h}=a;const m=(i=c.marks().find(y=>y.type===l))===null||i===void 0?void 0:i.attrs,g=es(c,l,m);g&&(d=g.from,h=g.to),e.removeMark(d,h,l)}else p.forEach(d=>{e.removeMark(d.$from.pos,d.$to.pos,l)});return e.removeStoredMark(l),!0}}),Sh=Object.freeze({__proto__:null,updateAttributes:(n,t={})=>({tr:e,state:r,dispatch:o})=>{let i=null,s=null;const a=lo(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=pt(n,r.schema)),a==="mark"&&(s=je(n,r.schema)),o&&e.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(p,d)=>{i&&i===p.type&&e.setNodeMarkup(d,void 0,x(x({},p.attrs),t)),s&&p.marks.length&&p.marks.forEach(h=>{if(s===h.type){const m=Math.max(d,c),g=Math.min(d+p.nodeSize,u);e.addMark(m,g,s.create(x(x({},h.attrs),t)))}})})}),!0):!1}}),xh=Object.freeze({__proto__:null,wrapIn:(n,t={})=>({state:e,dispatch:r})=>{const o=pt(n,e.schema);return _n(e,o,t)?!1:Wa(o,t)(e,r)}}),Mh=Object.freeze({__proto__:null,wrapInList:(n,t={})=>({state:e,dispatch:r})=>{const o=pt(n,e.schema);return qf(o,t)(e,r)}});const Ch=bt.create({name:"commands",addCommands(){return x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x(x({},wd),Sd),xd),Md),Cd),Ed),Nd),Od),Td),Ad),Dd),Rd),Bd),Pd),zd),Hd),Jd),$d),Wd),Kd),Ud),Gd),Yd),Xd),Qd),Zd),th),eh),nh),rh),oh),ih),sh),ah),lh),ch),fh),ph),mh),vh),gh),yh),bh),kh),wh),Sh),xh),Mh)}}),Eh=bt.create({name:"editable",addProseMirrorPlugins(){return[new Ht({key:new se("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Nh=bt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ht({key:new se("focusEvents"),props:{handleDOMEvents:{focus:(t,e)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:e}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,e)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:e}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Oh=bt.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()]);return{Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()}}}),Th=bt.create({name:"tabindex",addProseMirrorPlugins(){return[new Ht({key:new se("tabindex"),props:{attributes:{tabindex:"0"}}})]}});var Ah=Object.freeze({__proto__:null,ClipboardTextSerializer:kd,Commands:Ch,Editable:Eh,FocusEvents:Nh,Keymap:Oh,Tabindex:Th});function _h(n,t){const e=pt(t,n.schema),{from:r,to:o}=n.selection,i=[];n.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===e.name);return s?x({},s.attrs):{}}function Dh(n,t){const e=lo(typeof t=="string"?t:t.name,n.schema);return e==="node"?_h(n,t):e==="mark"?pc(n,t):{}}function Rh(n,t,e={}){if(!t)return _n(n,null,e)||rs(n,null,e);const r=lo(t,n.schema);return r==="node"?_n(n,t,e):r==="mark"?rs(n,t,e):!1}function Vh(n,t){const e=mt.fromSchema(t).serializeFragment(n),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(e),o.innerHTML}function Ih(n,t){const e={from:0,to:n.content.size};return ic(n,e,t)}function Bh(n){var t;const e=(t=n.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=n.toJSON();return JSON.stringify(e)===JSON.stringify(r)}function Ph(n){const t=document.querySelector("style[data-tiptap-style]");if(t!==null)return t;const e=document.createElement("style");return e.setAttribute("data-tiptap-style",""),e.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(e),e}function is(n){const{state:t,transaction:e}=n;let{selection:r}=e,{doc:o}=e,{storedMarks:i}=e;return Lt(x({},t),{schema:t.schema,plugins:t.plugins,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=e.selection,o=e.doc,i=e.storedMarks,e}})}class ss{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:r}=this,{view:o}=e,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...u)=>{const p=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!t,c=t||i.tr,u=()=>(!l&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(d=>d===!0)),p=Lt(x({},Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...g)=>{const y=this.buildProps(c,e),k=h(...g)(y);return a.push(k),p}]))),{run:u});return p}createCan(t){const{rawCommands:e,state:r}=this,o=void 0,i=t||r.tr,s=this.buildProps(i,o),a=Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...u)=>c(...u)(Lt(x({},s),{dispatch:o}))]));return Lt(x({},a),{chain:()=>this.createChain(i,o)})}buildProps(t,e=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o;i.storedMarks&&t.setStoredMarks(i.storedMarks);const a={tr:t,editor:o,view:s,state:is({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class fo{constructor(t){this.find=t.find,this.handler=t.handler}}const zh=(n,t)=>{if(Zi(t))return t.exec(n);const e=t(n);if(!e)return null;const r=[];return r.push(e.text),r.index=e.index,r.input=n,r.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(e.replaceWith)),r};function as(n){var t;const{editor:e,from:r,to:o,text:i,rules:s,plugin:a}=n,{view:l}=e;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0?void 0:t.marks.find(h=>h.type.spec.code)))return!1;let u=!1;const p=500,d=c.parent.textBetween(Math.max(0,c.parentOffset-p),c.parentOffset,void 0,"\uFFFC")+i;return s.forEach(h=>{if(u)return;const m=zh(d,h.find);if(!m)return;const g=l.state.tr,y=is({state:l.state,transaction:g}),k={from:r-(m[0].length-i.length),to:o},{commands:b,chain:O,can:v}=new ss({editor:e,state:y});h.handler({state:y,range:k,match:m,commands:b,chain:O,can:v}),!!g.steps.length&&(g.setMeta(a,{transform:g,from:r,to:o,text:i}),l.dispatch(g),u=!0)}),u}function Lh(n){const{editor:t,rules:e}=n,r=new Ht({state:{init(){return null},apply(o,i){const s=o.getMeta(this);return s||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput(o,i,s,a){return as({editor:t,from:i,to:s,text:a,rules:e,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&as({editor:t,from:i.pos,to:i.pos,text:"",rules:e,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?as({editor:t,from:s.pos,to:s.pos,text:` +`,rules:e,plugin:r}):!1}},isInputRules:!0});return r}function Fh(n){return typeof n=="number"}class Hh{constructor(t){this.find=t.find,this.handler=t.handler}}const Jh=(n,t)=>{if(Zi(t))return[...n.matchAll(t)];const e=t(n);return e?e.map(r=>{const o=[];return o.push(r.text),o.index=r.index,o.input=n,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function $h(n){const{editor:t,state:e,from:r,to:o,rules:i}=n,{commands:s,chain:a,can:l}=new ss({editor:t,state:e});e.doc.nodesBetween(r,o,(c,u)=>{if(!c.isTextblock||c.type.spec.code)return;const p=Math.max(r,u),d=Math.min(o,u+c.content.size),h=c.textBetween(p-u,d-u,void 0,"\uFFFC");i.forEach(m=>{Jh(h,m.find).forEach(y=>{if(y.index===void 0)return;const k=p+y.index+1,b=k+y[0].length,O={from:e.tr.mapping.map(k),to:e.tr.mapping.map(b)};m.handler({state:e,range:O,match:y,commands:s,chain:a,can:l})})})})}function qh(n){const{editor:t,rules:e}=n;let r=!1;const o=new Ht({props:{handlePaste:(i,s)=>{var a;const l=(a=s.clipboardData)===null||a===void 0?void 0:a.getData("text/html");return r=!!(l==null?void 0:l.includes("data-pm-slice")),!1}},appendTransaction:(i,s,a)=>{const l=i[0];if(!l.getMeta("paste")||r)return;const{doc:c,before:u}=l,p=u.content.findDiffStart(c.content),d=u.content.findDiffEnd(c.content);if(!Fh(p)||!d||p===d.b)return;const h=a.tr,m=is({state:a,transaction:h});if($h({editor:t,state:m,from:Math.max(p-1,0),to:d.b,rules:e,plugin:o}),!!h.steps.length)return h},isPasteRules:!0});return o}function mc(n){const t=[],{nodeExtensions:e,markExtensions:r}=uo(n),o=[...e,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0};return n.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=A(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(p=>{Object.entries(u.attributes).forEach(([d,h])=>{t.push({type:p,name:d,attribute:x(x({},i),h)})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=A(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,p])=>{t.push({type:s.name,name:u,attribute:x(x({},i),p)})})}),t}function dt(...n){return n.filter(t=>!!t).reduce((t,e)=>{const r=x({},t);return Object.entries(e).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}o==="class"?r[o]=[r[o],i].join(" "):o==="style"?r[o]=[r[o],i].join("; "):r[o]=i}),r},{})}function ls(n,t){return t.filter(e=>e.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(n.attrs)||{}:{[e.name]:n.attrs[e.name]}).reduce((e,r)=>dt(e,r),{})}function jh(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Wh(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function vc(n,t){return n.style?n:Lt(x({},n),{getAttrs:e=>{const r=n.getAttrs?n.getAttrs(e):n.attrs;if(r===!1)return!1;const o=t.filter(i=>i.attribute.rendered).reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(e):Wh(e.getAttribute(s.name));return ns(a)&&console.warn(`[tiptap warn]: BREAKING CHANGE: "parseHTML" for your attribute "${s.name}" returns an object but should return the value itself. If this is expected you can ignore this message. This warning will be removed in one of the next releases. Further information: https://github.com/ueberdosis/tiptap/issues/1863`),a==null?i:Lt(x({},i),{[s.name]:a})},{});return x(x({},r),o)}})}function gc(n){return Object.fromEntries(Object.entries(n).filter(([t,e])=>t==="attrs"&&jh(e)?!1:e!=null))}function Kh(n){var t;const e=mc(n),{nodeExtensions:r,markExtensions:o}=uo(n),i=(t=r.find(l=>A(l,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(r.map(l=>{const c=e.filter(y=>y.type===l.name),u={name:l.name,options:l.options,storage:l.storage},p=n.reduce((y,k)=>{const b=A(k,"extendNodeSchema",u);return x(x({},y),b?b(l):{})},{}),d=gc(Lt(x({},p),{content:F(A(l,"content",u)),marks:F(A(l,"marks",u)),group:F(A(l,"group",u)),inline:F(A(l,"inline",u)),atom:F(A(l,"atom",u)),selectable:F(A(l,"selectable",u)),draggable:F(A(l,"draggable",u)),code:F(A(l,"code",u)),defining:F(A(l,"defining",u)),isolating:F(A(l,"isolating",u)),attrs:Object.fromEntries(c.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))})),h=F(A(l,"parseHTML",u));h&&(d.parseDOM=h.map(y=>vc(y,c)));const m=A(l,"renderHTML",u);m&&(d.toDOM=y=>m({node:y,HTMLAttributes:ls(y,c)}));const g=A(l,"renderText",u);return g&&(d.toText=g),[l.name,d]})),a=Object.fromEntries(o.map(l=>{const c=e.filter(g=>g.type===l.name),u={name:l.name,options:l.options,storage:l.storage},p=n.reduce((g,y)=>{const k=A(y,"extendMarkSchema",u);return x(x({},g),k?k(l):{})},{}),d=gc(Lt(x({},p),{inclusive:F(A(l,"inclusive",u)),excludes:F(A(l,"excludes",u)),group:F(A(l,"group",u)),spanning:F(A(l,"spanning",u)),code:F(A(l,"code",u)),attrs:Object.fromEntries(c.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))})),h=F(A(l,"parseHTML",u));h&&(d.parseDOM=h.map(g=>vc(g,c)));const m=A(l,"renderHTML",u);return m&&(d.toDOM=g=>m({mark:g,HTMLAttributes:ls(g,c)})),[l.name,d]}));return new nn({topNode:i,nodes:s,marks:a})}function cs(n,t){return t.nodes[n]||t.marks[n]||null}function yc(n,t){return Array.isArray(t)?t.some(e=>(typeof e=="string"?e:e.name)===n.name):t}function Uh(n){const t=n.filter((e,r)=>n.indexOf(e)!==r);return[...new Set(t)]}class Dn{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Dn.resolve(t),this.schema=Kh(this.extensions),this.extensions.forEach(r=>{var o;this.editor.extensionStorage[r.name]=r.storage;const i={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:cs(r.name,this.schema)};r.type==="mark"&&((o=F(A(r,"keepOnSplit",i)))!==null&&o!==void 0?o:!0)&&this.splittableMarks.push(r.name);const s=A(r,"onBeforeCreate",i);s&&this.editor.on("beforeCreate",s);const a=A(r,"onCreate",i);a&&this.editor.on("create",a);const l=A(r,"onUpdate",i);l&&this.editor.on("update",l);const c=A(r,"onSelectionUpdate",i);c&&this.editor.on("selectionUpdate",c);const u=A(r,"onTransaction",i);u&&this.editor.on("transaction",u);const p=A(r,"onFocus",i);p&&this.editor.on("focus",p);const d=A(r,"onBlur",i);d&&this.editor.on("blur",d);const h=A(r,"onDestroy",i);h&&this.editor.on("destroy",h)})}static resolve(t){const e=Dn.sort(Dn.flatten(t)),r=Uh(e.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map(e=>{const r={name:e.name,options:e.options,storage:e.storage},o=A(e,"addExtensions",r);return o?[e,...this.flatten(o())]:e}).flat(10)}static sort(t){const e=100;return t.sort((r,o)=>{const i=A(r,"priority")||e,s=A(o,"priority")||e;return i>s?-1:i{const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:cs(e.name,this.schema)},o=A(e,"addCommands",r);return o?x(x({},t),o()):t},{})}get plugins(){const{editor:t}=this,e=Dn.sort([...this.extensions].reverse()),r=[],o=[],i=e.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:t,type:cs(s.name,this.schema)},l=[],c=A(s,"addKeyboardShortcuts",a);if(c){const h=Object.fromEntries(Object.entries(c()).map(([g,y])=>[g,()=>y({editor:t})])),m=yd(h);l.push(m)}const u=A(s,"addInputRules",a);yc(s,t.options.enableInputRules)&&u&&r.push(...u());const p=A(s,"addPasteRules",a);yc(s,t.options.enablePasteRules)&&p&&o.push(...p());const d=A(s,"addProseMirrorPlugins",a);if(d){const h=d();l.push(...h)}return l}).flat();return[Lh({editor:t,rules:r}),qh({editor:t,rules:o}),...i]}get attributes(){return mc(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=uo(this.extensions);return Object.fromEntries(e.filter(r=>!!A(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:t,type:pt(r.name,this.schema)},s=A(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,p)=>{const d=ls(l,o);return s()({editor:t,node:l,getPos:u,decorations:p,HTMLAttributes:d,extension:r})};return[r.name,a]}))}}class Gh{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const r=this.callbacks[t];return r&&r.forEach(o=>o.apply(this,e)),this}off(t,e){const r=this.callbacks[t];return r&&(e?this.callbacks[t]=r.filter(o=>o!==e):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}const Yh=`.ProseMirror { position: relative; } @@ -84,11 +84,13 @@ img.ProseMirror-separator { .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 -}`;class qh extends Jh{constructor(t={}){super();this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=_h($h))}setOptions(t={}){this.options=x(x({},this.options),t),!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t){this.setOptions({editable:t})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const r=Yl(e)?e(t,this.state.plugins):[...this.state.plugins,t],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const e=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(e))});this.view.updateState(r)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(xh):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new _n(e,this)}createCommandManager(){this.commandManager=new Yi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){this.view=new ct(this.options.element,Lt(x({},this.options.editorProps),{dispatchTransaction:this.dispatchTransaction.bind(this),state:Et.create({doc:rc(this.options.content,this.schema,this.options.parseOptions)})}));const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews();const e=this.view.dom;e.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const e=this.state.apply(t),r=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return Ch(this.state,t)}isActive(t,e){const r=typeof t=="string"?t:null,o=typeof t=="string"?e:t;return Eh(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Oh(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=` - -`,textSerializers:r={}}=t||{};return Nh(this.state.doc,{blockSeparator:e,textSerializers:x(x({},r),Ql(this.schema))})}get isEmpty(){return Th(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!((t=this.view)===null||t===void 0?void 0:t.docView)}}class bt{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=x(x({},this.config),t),this.name=this.config.name,t.defaultOptions&&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=L(_(this,"addOptions",{name:this.name}))),this.storage=L(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new bt(t)}configure(t={}){const e=this.extend();return e.options=no(this.options,t),e.storage=L(_(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new bt(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=t.defaultOptions?t.defaultOptions:e.parent.options,t.addOptions&&(e.options=L(_(e,"addOptions",{name:e.name}))),e.storage=L(_(e,"addStorage",{name:e.name,options:e.options})),e}}class qe{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=x(x({},this.config),t),this.name=this.config.name,t.defaultOptions&&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=L(_(this,"addOptions",{name:this.name}))),this.storage=L(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new qe(t)}configure(t={}){const e=this.extend();return e.options=no(this.options,t),e.storage=L(_(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new qe(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=t.defaultOptions?t.defaultOptions:e.parent.options,t.addOptions&&(e.options=L(_(e,"addOptions",{name:e.name}))),e.storage=L(_(e,"addStorage",{name:e.name,options:e.options})),e}}function fc(n){return new lo({find:n.find,handler:({state:t,range:e,match:r})=>{const o=L(n.getAttributes,void 0,r)||{},{tr:i}=t,s=e.from;let a=e.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);let c=s+l;c>a?c=a:a=c+r[1].length;const u=r[0][r[0].length-1];i.insertText(u,s+r[0].length-1),i.replaceWith(c,a,n.type.create(o))}else r[0]&&i.replaceWith(s,a,n.type.create(o))}})}function pc(n,t,e){const r=[];return e.doc.nodesBetween(n,t,(o,i)=>{r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function An(n){return new lo({find:n.find,handler:({state:t,range:e,match:r})=>{const o=L(n.getAttributes,void 0,r);if(o===!1||o===null)return;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=e.to;if(s){const c=a.search(/\S/),u=e.from+a.indexOf(s),p=u+s.length;if(pc(e.from,e.to,t).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;pe.from&&i.delete(e.from+c,u),l=e.from+c+s.length,i.addMark(e.from+c,l,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}function ts(n){return new lo({find:n.find,handler:({state:t,range:e,match:r})=>{const o=t.doc.resolve(e.from),i=L(n.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),n.type))return null;t.tr.delete(e.from,e.to).setBlockType(e.from,e.from,n.type,i)}})}function co(n){return new lo({find:n.find,handler:({state:t,range:e,match:r})=>{const o=L(n.getAttributes,void 0,r)||{},i=t.tr.delete(e.from,e.to),a=i.doc.resolve(e.from).blockRange(),l=a&&Zo(a,n.type,o);if(!l)return null;i.wrap(a,l);const c=i.doc.resolve(e.from-1).nodeBefore;c&&c.type===n.type&&ti(i.doc,e.from-1)&&(!n.joinPredicate||n.joinPredicate(r,c))&&i.join(e.from-1)}})}function Dn(n){return new Vh({find:n.find,handler:({state:t,range:e,match:r})=>{const o=L(n.getAttributes,void 0,r);if(o===!1||o===null)return;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=e.to;if(s){const c=a.search(/\S/),u=e.from+a.indexOf(s),p=u+s.length;if(pc(e.from,e.to,t).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;pe.from&&i.delete(e.from+c,u),l=e.from+c+s.length,i.addMark(e.from+c,l,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}function jh(n){return Ki(n)&&n instanceof P}function dc(n,t,e){const r=0,o=n.state.doc.content.size,i=ln(t,r,o),s=ln(e,r,o),a=n.coordsAtPos(i),l=n.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),p=Math.min(a.left,l.left),d=Math.max(a.right,l.right),h=d-p,m=u-c,k={top:c,bottom:u,left:p,right:d,width:h,height:m,x:p,y:c};return Lt(x({},k),{toJSON:()=>k})}var Wt="top",ee="bottom",ne="right",Kt="left",es="auto",cr=[Wt,ee,ne,Kt],Rn="start",ur="end",Wh="clippingParents",hc="viewport",fr="popper",Kh="reference",mc=cr.reduce(function(n,t){return n.concat([t+"-"+Rn,t+"-"+ur])},[]),vc=[].concat(cr,[es]).reduce(function(n,t){return n.concat([t,t+"-"+Rn,t+"-"+ur])},[]),Uh="beforeRead",Gh="read",Yh="afterRead",Xh="beforeMain",Qh="main",Zh="afterMain",tm="beforeWrite",em="write",nm="afterWrite",rm=[Uh,Gh,Yh,Xh,Qh,Zh,tm,em,nm];function ge(n){return n?(n.nodeName||"").toLowerCase():null}function ue(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function pr(n){var t=ue(n).Element;return n instanceof t||n instanceof Element}function re(n){var t=ue(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function gc(n){if(typeof ShadowRoot=="undefined")return!1;var t=ue(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function om(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},o=t.attributes[e]||{},i=t.elements[e];!re(i)||!ge(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function im(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:e[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!re(o)||!ge(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}var yc={name:"applyStyles",enabled:!0,phase:"write",fn:om,effect:im,requires:["computeStyles"]};function ye(n){return n.split("-")[0]}function Vn(n,t){var e=n.getBoundingClientRect(),r=1,o=1;return{width:e.width/r,height:e.height/o,top:e.top/o,right:e.right/r,bottom:e.bottom/o,left:e.left/r,x:e.left/r,y:e.top/o}}function ns(n){var t=Vn(n),e=n.offsetWidth,r=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:r}}function bc(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&gc(e)){var r=t;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function _e(n){return ue(n).getComputedStyle(n)}function sm(n){return["table","td","th"].indexOf(ge(n))>=0}function je(n){return((pr(n)?n.ownerDocument:n.document)||window.document).documentElement}function uo(n){return ge(n)==="html"?n:n.assignedSlot||n.parentNode||(gc(n)?n.host:null)||je(n)}function kc(n){return!re(n)||_e(n).position==="fixed"?null:n.offsetParent}function am(n){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,e=navigator.userAgent.indexOf("Trident")!==-1;if(e&&re(n)){var r=_e(n);if(r.position==="fixed")return null}for(var o=uo(n);re(o)&&["html","body"].indexOf(ge(o))<0;){var i=_e(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function dr(n){for(var t=ue(n),e=kc(n);e&&sm(e)&&_e(e).position==="static";)e=kc(e);return e&&(ge(e)==="html"||ge(e)==="body"&&_e(e).position==="static")?t:e||am(n)||t}function rs(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}var We=Math.max,hr=Math.min,fo=Math.round;function po(n,t,e){return We(n,hr(t,e))}function wc(){return{top:0,right:0,bottom:0,left:0}}function Sc(n){return Object.assign({},wc(),n)}function xc(n,t){return t.reduce(function(e,r){return e[r]=n,e},{})}var lm=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Sc(typeof t!="number"?t:xc(t,cr))};function cm(n){var t,e=n.state,r=n.name,o=n.options,i=e.elements.arrow,s=e.modifiersData.popperOffsets,a=ye(e.placement),l=rs(a),c=[Kt,ne].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var p=lm(o.padding,e),d=ns(i),h=l==="y"?Wt:Kt,m=l==="y"?ee:ne,g=e.rects.reference[u]+e.rects.reference[l]-s[l]-e.rects.popper[u],y=s[l]-e.rects.reference[l],k=dr(i),b=k?l==="y"?k.clientHeight||0:k.clientWidth||0:0,N=g/2-y/2,v=p[h],E=b-d[u]-p[m],C=b/2-d[u]/2+N,A=po(v,C,E),B=l;e.modifiersData[r]=(t={},t[B]=A,t.centerOffset=A-C,t)}}function um(n){var t=n.state,e=n.options,r=e.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||!bc(t.elements.popper,o)||(t.elements.arrow=o))}var fm={name:"arrow",enabled:!0,phase:"main",fn:cm,effect:um,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function In(n){return n.split("-")[1]}var pm={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dm(n){var t=n.x,e=n.y,r=window,o=r.devicePixelRatio||1;return{x:fo(fo(t*o)/o)||0,y:fo(fo(e*o)/o)||0}}function Mc(n){var t,e=n.popper,r=n.popperRect,o=n.placement,i=n.variation,s=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,p=u===!0?dm(s):typeof u=="function"?u(s):s,d=p.x,h=d===void 0?0:d,m=p.y,g=m===void 0?0:m,y=s.hasOwnProperty("x"),k=s.hasOwnProperty("y"),b=Kt,N=Wt,v=window;if(c){var E=dr(e),C="clientHeight",A="clientWidth";E===ue(e)&&(E=je(e),_e(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",A="scrollWidth")),E=E,(o===Wt||(o===Kt||o===ne)&&i===ur)&&(N=ee,g-=E[C]-r.height,g*=l?1:-1),(o===Kt||(o===Wt||o===ee)&&i===ur)&&(b=ne,h-=E[A]-r.width,h*=l?1:-1)}var B=Object.assign({position:a},c&&pm);if(l){var V;return Object.assign({},B,(V={},V[N]=k?"0":"",V[b]=y?"0":"",V.transform=(v.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",V))}return Object.assign({},B,(t={},t[N]=k?g+"px":"",t[b]=y?h+"px":"",t.transform="",t))}function hm(n){var t=n.state,e=n.options,r=e.gpuAcceleration,o=r===void 0?!0:r,i=e.adaptive,s=i===void 0?!0:i,a=e.roundOffsets,l=a===void 0?!0:a,c={placement:ye(t.placement),variation:In(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Mc(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Mc(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var mm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:hm,data:{}},ho={passive:!0};function vm(n){var t=n.state,e=n.instance,r=n.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=ue(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",e.update,ho)}),a&&l.addEventListener("resize",e.update,ho),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",e.update,ho)}),a&&l.removeEventListener("resize",e.update,ho)}}var gm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:vm,data:{}},ym={left:"right",right:"left",bottom:"top",top:"bottom"};function mo(n){return n.replace(/left|right|bottom|top/g,function(t){return ym[t]})}var bm={start:"end",end:"start"};function Cc(n){return n.replace(/start|end/g,function(t){return bm[t]})}function is(n){var t=ue(n),e=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:e,scrollTop:r}}function ss(n){return Vn(je(n)).left+is(n).scrollLeft}function km(n){var t=ue(n),e=je(n),r=t.visualViewport,o=e.clientWidth,i=e.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+ss(n),y:a}}function wm(n){var t,e=je(n),r=is(n),o=(t=n.ownerDocument)==null?void 0:t.body,i=We(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=We(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+ss(n),l=-r.scrollTop;return _e(o||e).direction==="rtl"&&(a+=We(e.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function as(n){var t=_e(n),e=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+o+r)}function Ec(n){return["html","body","#document"].indexOf(ge(n))>=0?n.ownerDocument.body:re(n)&&as(n)?n:Ec(uo(n))}function mr(n,t){var e;t===void 0&&(t=[]);var r=Ec(n),o=r===((e=n.ownerDocument)==null?void 0:e.body),i=ue(r),s=o?[i].concat(i.visualViewport||[],as(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(mr(uo(s)))}function ls(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Sm(n){var t=Vn(n);return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Oc(n,t){return t===hc?ls(km(n)):re(t)?Sm(t):ls(wm(je(n)))}function xm(n){var t=mr(uo(n)),e=["absolute","fixed"].indexOf(_e(n).position)>=0,r=e&&re(n)?dr(n):n;return pr(r)?t.filter(function(o){return pr(o)&&bc(o,r)&&ge(o)!=="body"}):[]}function Mm(n,t,e){var r=t==="clippingParents"?xm(n):[].concat(t),o=[].concat(r,[e]),i=o[0],s=o.reduce(function(a,l){var c=Oc(n,l);return a.top=We(c.top,a.top),a.right=hr(c.right,a.right),a.bottom=hr(c.bottom,a.bottom),a.left=We(c.left,a.left),a},Oc(n,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Nc(n){var t=n.reference,e=n.element,r=n.placement,o=r?ye(r):null,i=r?In(r):null,s=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(o){case Wt:l={x:s,y:t.y-e.height};break;case ee:l={x:s,y:t.y+t.height};break;case ne:l={x:t.x+t.width,y:a};break;case Kt:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?rs(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Rn:l[c]=l[c]-(t[u]/2-e[u]/2);break;case ur:l[c]=l[c]+(t[u]/2-e[u]/2);break}}return l}function vr(n,t){t===void 0&&(t={});var e=t,r=e.placement,o=r===void 0?n.placement:r,i=e.boundary,s=i===void 0?Wh:i,a=e.rootBoundary,l=a===void 0?hc:a,c=e.elementContext,u=c===void 0?fr:c,p=e.altBoundary,d=p===void 0?!1:p,h=e.padding,m=h===void 0?0:h,g=Sc(typeof m!="number"?m:xc(m,cr)),y=u===fr?Kh:fr,k=n.rects.popper,b=n.elements[d?y:u],N=Mm(pr(b)?b:b.contextElement||je(n.elements.popper),s,l),v=Vn(n.elements.reference),E=Nc({reference:v,element:k,strategy:"absolute",placement:o}),C=ls(Object.assign({},k,E)),A=u===fr?C:v,B={top:N.top-A.top+g.top,bottom:A.bottom-N.bottom+g.bottom,left:N.left-A.left+g.left,right:A.right-N.right+g.right},V=n.modifiersData.offset;if(u===fr&&V){var F=V[o];Object.keys(B).forEach(function(st){var et=[ne,ee].indexOf(st)>=0?1:-1,U=[Wt,ee].indexOf(st)>=0?"y":"x";B[st]+=F[U]*et})}return B}function Cm(n,t){t===void 0&&(t={});var e=t,r=e.placement,o=e.boundary,i=e.rootBoundary,s=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,c=l===void 0?vc:l,u=In(r),p=u?a?mc:mc.filter(function(m){return In(m)===u}):cr,d=p.filter(function(m){return c.indexOf(m)>=0});d.length===0&&(d=p);var h=d.reduce(function(m,g){return m[g]=vr(n,{placement:g,boundary:o,rootBoundary:i,padding:s})[ye(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function Em(n){if(ye(n)===es)return[];var t=mo(n);return[Cc(n),t,Cc(t)]}function Om(n){var t=n.state,e=n.options,r=n.name;if(!t.modifiersData[r]._skip){for(var o=e.mainAxis,i=o===void 0?!0:o,s=e.altAxis,a=s===void 0?!0:s,l=e.fallbackPlacements,c=e.padding,u=e.boundary,p=e.rootBoundary,d=e.altBoundary,h=e.flipVariations,m=h===void 0?!0:h,g=e.allowedAutoPlacements,y=t.options.placement,k=ye(y),b=k===y,N=l||(b||!m?[mo(y)]:Em(y)),v=[y].concat(N).reduce(function(Me,Yt){return Me.concat(ye(Yt)===es?Cm(t,{placement:Yt,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:g}):Yt)},[]),E=t.rects.reference,C=t.rects.popper,A=new Map,B=!0,V=v[0],F=0;F=0,Z=Nt?"width":"height",X=vr(t,{placement:st,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),Tt=Nt?U?ne:Kt:U?ee:Wt;E[Z]>C[Z]&&(Tt=mo(Tt));var _t=mo(Tt),De=[];if(i&&De.push(X[et]<=0),a&&De.push(X[Tt]<=0,X[_t]<=0),De.every(function(Me){return Me})){V=st,B=!1;break}A.set(st,De)}if(B)for(var xe=m?3:1,hn=function(Yt){var Xe=v.find(function(Tr){var Qe=A.get(Tr);if(Qe)return Qe.slice(0,Yt).every(function($n){return $n})});if(Xe)return V=Xe,"break"},de=xe;de>0;de--){var mn=hn(de);if(mn==="break")break}t.placement!==V&&(t.modifiersData[r]._skip=!0,t.placement=V,t.reset=!0)}}var Nm={name:"flip",enabled:!0,phase:"main",fn:Om,requiresIfExists:["offset"],data:{_skip:!1}};function Tc(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function _c(n){return[Wt,ne,ee,Kt].some(function(t){return n[t]>=0})}function Tm(n){var t=n.state,e=n.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=vr(t,{elementContext:"reference"}),a=vr(t,{altBoundary:!0}),l=Tc(s,r),c=Tc(a,o,i),u=_c(l),p=_c(c);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}var _m={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Tm};function Am(n,t,e){var r=ye(n),o=[Kt,Wt].indexOf(r)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Kt,ne].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Dm(n){var t=n.state,e=n.options,r=n.name,o=e.offset,i=o===void 0?[0,0]:o,s=vc.reduce(function(u,p){return u[p]=Am(p,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}var Rm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Dm};function Vm(n){var t=n.state,e=n.name;t.modifiersData[e]=Nc({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Im={name:"popperOffsets",enabled:!0,phase:"read",fn:Vm,data:{}};function Bm(n){return n==="x"?"y":"x"}function Pm(n){var t=n.state,e=n.options,r=n.name,o=e.mainAxis,i=o===void 0?!0:o,s=e.altAxis,a=s===void 0?!1:s,l=e.boundary,c=e.rootBoundary,u=e.altBoundary,p=e.padding,d=e.tether,h=d===void 0?!0:d,m=e.tetherOffset,g=m===void 0?0:m,y=vr(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),k=ye(t.placement),b=In(t.placement),N=!b,v=rs(k),E=Bm(v),C=t.modifiersData.popperOffsets,A=t.rects.reference,B=t.rects.popper,V=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,F={x:0,y:0};if(!!C){if(i||a){var st=v==="y"?Wt:Kt,et=v==="y"?ee:ne,U=v==="y"?"height":"width",Nt=C[v],Z=C[v]+y[st],X=C[v]-y[et],Tt=h?-B[U]/2:0,_t=b===Rn?A[U]:B[U],De=b===Rn?-B[U]:-A[U],xe=t.elements.arrow,hn=h&&xe?ns(xe):{width:0,height:0},de=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:wc(),mn=de[st],Me=de[et],Yt=po(0,A[U],hn[U]),Xe=N?A[U]/2-Tt-Yt-mn-V:_t-Yt-mn-V,Tr=N?-A[U]/2+Tt+Yt+Me+V:De+Yt+Me+V,Qe=t.elements.arrow&&dr(t.elements.arrow),$n=Qe?v==="y"?Qe.clientTop||0:Qe.clientLeft||0:0,Re=t.modifiersData.offset?t.modifiersData.offset[t.placement][v]:0,_r=C[v]+Xe-Re-$n,Ar=C[v]+Tr-Re;if(i){var Dr=po(h?hr(Z,_r):Z,Nt,h?We(X,Ar):X);C[v]=Dr,F[v]=Dr-Nt}if(a){var Vo=v==="x"?Wt:Kt,Io=v==="x"?ee:ne,vn=C[E],Rr=vn+y[Vo],Vr=vn-y[Io],Ir=po(h?hr(Rr,_r):Rr,vn,h?We(Vr,Ar):Vr);C[E]=Ir,F[E]=Ir-vn}}t.modifiersData[r]=F}}var zm={name:"preventOverflow",enabled:!0,phase:"main",fn:Pm,requiresIfExists:["offset"]};function Lm(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Fm(n){return n===ue(n)||!re(n)?is(n):Lm(n)}function Hm(n){var t=n.getBoundingClientRect(),e=t.width/n.offsetWidth||1,r=t.height/n.offsetHeight||1;return e!==1||r!==1}function Jm(n,t,e){e===void 0&&(e=!1);var r=re(t);re(t)&&Hm(t);var o=je(t),i=Vn(n),s={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!e)&&((ge(t)!=="body"||as(o))&&(s=Fm(t)),re(t)?(a=Vn(t),a.x+=t.clientLeft,a.y+=t.clientTop):o&&(a.x=ss(o))),{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}function $m(n){var t=new Map,e=new Set,r=[];n.forEach(function(i){t.set(i.name,i)});function o(i){e.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return n.forEach(function(i){e.has(i.name)||o(i)}),r}function qm(n){var t=$m(n);return rm.reduce(function(e,r){return e.concat(t.filter(function(o){return o.phase===r}))},[])}function jm(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function Wm(n){var t=n.reduce(function(e,r){var o=e[r.name];return e[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,e},{});return Object.keys(t).map(function(e){return t[e]})}var Ac={placement:"bottom",modifiers:[],strategy:"absolute"};function Dc(){for(var n=arguments.length,t=new Array(n),e=0;e-1}function Pc(n,t){return typeof n=="function"?n.apply(void 0,t):n}function zc(n,t){if(t===0)return n;var e;return function(r){clearTimeout(e),e=setTimeout(function(){n(r)},t)}}function Qm(n){return n.split(/\s+/).filter(Boolean)}function Bn(n){return[].concat(n)}function Lc(n,t){n.indexOf(t)===-1&&n.push(t)}function Zm(n){return n.filter(function(t,e){return n.indexOf(t)===e})}function tv(n){return n.split("-")[0]}function vo(n){return[].slice.call(n)}function Fc(n){return Object.keys(n).reduce(function(t,e){return n[e]!==void 0&&(t[e]=n[e]),t},{})}function gr(){return document.createElement("div")}function go(n){return["Element","Fragment"].some(function(t){return us(n,t)})}function ev(n){return us(n,"NodeList")}function nv(n){return us(n,"MouseEvent")}function rv(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function ov(n){return go(n)?[n]:ev(n)?vo(n):Array.isArray(n)?n:vo(document.querySelectorAll(n))}function fs(n,t){n.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function Hc(n,t){n.forEach(function(e){e&&e.setAttribute("data-state",t)})}function iv(n){var t,e=Bn(n),r=e[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function sv(n,t){var e=t.clientX,r=t.clientY;return n.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=tv(s.placement),u=s.modifiersData.offset;if(!u)return!0;var p=c==="bottom"?u.top.y:0,d=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,m=c==="left"?u.right.x:0,g=i.top-r+p>l,y=r-i.bottom-d>l,k=i.left-e+h>l,b=e-i.right-m>l;return g||y||k||b})}function ps(n,t,e){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){n[r](o,e)})}function Jc(n,t){for(var e=t;e;){var r;if(n.contains(e))return!0;e=e.getRootNode==null||(r=e.getRootNode())==null?void 0:r.host}return!1}var be={isTouch:!1},$c=0;function av(){be.isTouch||(be.isTouch=!0,window.performance&&document.addEventListener("mousemove",qc))}function qc(){var n=performance.now();n-$c<20&&(be.isTouch=!1,document.removeEventListener("mousemove",qc)),$c=n}function lv(){var n=document.activeElement;if(rv(n)){var t=n._tippy;n.blur&&!t.state.isVisible&&n.blur()}}function cv(){document.addEventListener("touchstart",av,cn),window.addEventListener("blur",lv)}var uv=typeof window!="undefined"&&typeof document!="undefined",fv=uv?!!window.msCrypto:!1,pv={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},dv={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},fe=Object.assign({appendTo:Bc,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},pv,dv),hv=Object.keys(fe),mv=function(t){var e=Object.keys(t);e.forEach(function(r){fe[r]=t[r]})};function jc(n){var t=n.plugins||[],e=t.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var a;r[i]=n[i]!==void 0?n[i]:(a=fe[i])!=null?a:s}return r},{});return Object.assign({},n,e)}function vv(n,t){var e=t?Object.keys(jc(Object.assign({},fe,{plugins:t}))):hv,r=e.reduce(function(o,i){var s=(n.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function Wc(n,t){var e=Object.assign({},t,{content:Pc(t.content,[n])},t.ignoreAttributes?{}:vv(n,t.plugins));return e.aria=Object.assign({},fe.aria,e.aria),e.aria={expanded:e.aria.expanded==="auto"?t.interactive:e.aria.expanded,content:e.aria.content==="auto"?t.interactive?null:"describedby":e.aria.content},e}var gv=function(){return"innerHTML"};function ds(n,t){n[gv()]=t}function Kc(n){var t=gr();return n===!0?t.className=Vc:(t.className=Ic,go(n)?t.appendChild(n):ds(t,n)),t}function Uc(n,t){go(t.content)?(ds(n,""),n.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?ds(n,t.content):n.textContent=t.content)}function hs(n){var t=n.firstElementChild,e=vo(t.children);return{box:t,content:e.find(function(r){return r.classList.contains(Rc)}),arrow:e.find(function(r){return r.classList.contains(Vc)||r.classList.contains(Ic)}),backdrop:e.find(function(r){return r.classList.contains(Xm)})}}function Gc(n){var t=gr(),e=gr();e.className=Ym,e.setAttribute("data-state","hidden"),e.setAttribute("tabindex","-1");var r=gr();r.className=Rc,r.setAttribute("data-state","hidden"),Uc(r,n.props),t.appendChild(e),e.appendChild(r),o(n.props,n.props);function o(i,s){var a=hs(t),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Uc(c,n.props),s.arrow?u?i.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(Kc(s.arrow))):l.appendChild(Kc(s.arrow)):u&&l.removeChild(u)}return{popper:t,onUpdate:o}}Gc.$$tippy=!0;var yv=1,yo=[],ms=[];function bv(n,t){var e=Wc(n,Object.assign({},fe,jc(Fc(t)))),r,o,i,s=!1,a=!1,l=!1,c=!1,u,p,d,h=[],m=zc(Vo,e.interactiveDebounce),g,y=yv++,k=null,b=Zm(e.plugins),N={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:y,reference:n,popper:gr(),popperInstance:k,props:e,state:N,plugins:b,clearDelayTimeouts:n1,setProps:r1,setContent:o1,show:i1,hide:s1,hideWithInteractivity:a1,enable:t1,disable:e1,unmount:l1,destroy:c1};if(!e.render)return v;var E=e.render(v),C=E.popper,A=E.onUpdate;C.setAttribute("data-tippy-root",""),C.id="tippy-"+v.id,v.popper=C,n._tippy=v,C._tippy=v;var B=b.map(function(w){return w.fn(v)}),V=n.hasAttribute("aria-expanded");return _r(),xe(),Tt(),_t("onCreate",[v]),e.showOnCreate&&ju(),C.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),C.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&Nt().addEventListener("mousemove",m)}),v;function F(){var w=v.props.touch;return Array.isArray(w)?w:[w,0]}function st(){return F()[0]==="hold"}function et(){var w;return!!((w=v.props.render)!=null&&w.$$tippy)}function U(){return g||n}function Nt(){var w=U().parentNode;return w?iv(w):document}function Z(){return hs(C)}function X(w){return v.state.isMounted&&!v.state.isVisible||be.isTouch||u&&u.type==="focus"?0:cs(v.props.delay,w?0:1,fe.delay)}function Tt(w){w===void 0&&(w=!1),C.style.pointerEvents=v.props.interactive&&!w?"":"none",C.style.zIndex=""+v.props.zIndex}function _t(w,D,I){if(I===void 0&&(I=!0),B.forEach(function(W){W[w]&&W[w].apply(W,D)}),I){var G;(G=v.props)[w].apply(G,D)}}function De(){var w=v.props.aria;if(!!w.content){var D="aria-"+w.content,I=C.id,G=Bn(v.props.triggerTarget||n);G.forEach(function(W){var zt=W.getAttribute(D);if(v.state.isVisible)W.setAttribute(D,zt?zt+" "+I:I);else{var ie=zt&&zt.replace(I,"").trim();ie?W.setAttribute(D,ie):W.removeAttribute(D)}})}}function xe(){if(!(V||!v.props.aria.expanded)){var w=Bn(v.props.triggerTarget||n);w.forEach(function(D){v.props.interactive?D.setAttribute("aria-expanded",v.state.isVisible&&D===U()?"true":"false"):D.removeAttribute("aria-expanded")})}}function hn(){Nt().removeEventListener("mousemove",m),yo=yo.filter(function(w){return w!==m})}function de(w){if(!(be.isTouch&&(l||w.type==="mousedown"))){var D=w.composedPath&&w.composedPath()[0]||w.target;if(!(v.props.interactive&&Jc(C,D))){if(Bn(v.props.triggerTarget||n).some(function(I){return Jc(I,D)})){if(be.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else _t("onClickOutside",[v,w]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||Xe())}}}function mn(){l=!0}function Me(){l=!1}function Yt(){var w=Nt();w.addEventListener("mousedown",de,!0),w.addEventListener("touchend",de,cn),w.addEventListener("touchstart",Me,cn),w.addEventListener("touchmove",mn,cn)}function Xe(){var w=Nt();w.removeEventListener("mousedown",de,!0),w.removeEventListener("touchend",de,cn),w.removeEventListener("touchstart",Me,cn),w.removeEventListener("touchmove",mn,cn)}function Tr(w,D){$n(w,function(){!v.state.isVisible&&C.parentNode&&C.parentNode.contains(C)&&D()})}function Qe(w,D){$n(w,D)}function $n(w,D){var I=Z().box;function G(W){W.target===I&&(ps(I,"remove",G),D())}if(w===0)return D();ps(I,"remove",p),ps(I,"add",G),p=G}function Re(w,D,I){I===void 0&&(I=!1);var G=Bn(v.props.triggerTarget||n);G.forEach(function(W){W.addEventListener(w,D,I),h.push({node:W,eventType:w,handler:D,options:I})})}function _r(){st()&&(Re("touchstart",Dr,{passive:!0}),Re("touchend",Io,{passive:!0})),Qm(v.props.trigger).forEach(function(w){if(w!=="manual")switch(Re(w,Dr),w){case"mouseenter":Re("mouseleave",Io);break;case"focus":Re(fv?"focusout":"blur",vn);break;case"focusin":Re("focusout",vn);break}})}function Ar(){h.forEach(function(w){var D=w.node,I=w.eventType,G=w.handler,W=w.options;D.removeEventListener(I,G,W)}),h=[]}function Dr(w){var D,I=!1;if(!(!v.state.isEnabled||Rr(w)||a)){var G=((D=u)==null?void 0:D.type)==="focus";u=w,g=w.currentTarget,xe(),!v.state.isVisible&&nv(w)&&yo.forEach(function(W){return W(w)}),w.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||s)&&v.props.hideOnClick!==!1&&v.state.isVisible?I=!0:ju(w),w.type==="click"&&(s=!I),I&&!G&&Bo(w)}}function Vo(w){var D=w.target,I=U().contains(D)||C.contains(D);if(!(w.type==="mousemove"&&I)){var G=zs().concat(C).map(function(W){var zt,ie=W._tippy,qn=(zt=ie.popperInstance)==null?void 0:zt.state;return qn?{popperRect:W.getBoundingClientRect(),popperState:qn,props:e}:null}).filter(Boolean);sv(G,w)&&(hn(),Bo(w))}}function Io(w){var D=Rr(w)||v.props.trigger.indexOf("click")>=0&&s;if(!D){if(v.props.interactive){v.hideWithInteractivity(w);return}Bo(w)}}function vn(w){v.props.trigger.indexOf("focusin")<0&&w.target!==U()||v.props.interactive&&w.relatedTarget&&C.contains(w.relatedTarget)||Bo(w)}function Rr(w){return be.isTouch?st()!==w.type.indexOf("touch")>=0:!1}function Vr(){Ir();var w=v.props,D=w.popperOptions,I=w.placement,G=w.offset,W=w.getReferenceClientRect,zt=w.moveTransition,ie=et()?hs(C).arrow:null,qn=W?{getBoundingClientRect:W,contextElement:W.contextElement||U()}:n,Wu={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Po){var jn=Po.state;if(et()){var u1=Z(),Fs=u1.box;["placement","reference-hidden","escaped"].forEach(function(zo){zo==="placement"?Fs.setAttribute("data-placement",jn.placement):jn.attributes.popper["data-popper-"+zo]?Fs.setAttribute("data-"+zo,""):Fs.removeAttribute("data-"+zo)}),jn.attributes.popper={}}}},gn=[{name:"offset",options:{offset:G}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!zt}},Wu];et()&&ie&&gn.push({name:"arrow",options:{element:ie,padding:3}}),gn.push.apply(gn,(D==null?void 0:D.modifiers)||[]),v.popperInstance=Gm(qn,C,Object.assign({},D,{placement:I,onFirstUpdate:d,modifiers:gn}))}function Ir(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Zb(){var w=v.props.appendTo,D,I=U();v.props.interactive&&w===Bc||w==="parent"?D=I.parentNode:D=Pc(w,[I]),D.contains(C)||D.appendChild(C),v.state.isMounted=!0,Vr()}function zs(){return vo(C.querySelectorAll("[data-tippy-root]"))}function ju(w){v.clearDelayTimeouts(),w&&_t("onTrigger",[v,w]),Yt();var D=X(!0),I=F(),G=I[0],W=I[1];be.isTouch&&G==="hold"&&W&&(D=W),D?r=setTimeout(function(){v.show()},D):v.show()}function Bo(w){if(v.clearDelayTimeouts(),_t("onUntrigger",[v,w]),!v.state.isVisible){Xe();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(w.type)>=0&&s)){var D=X(!1);D?o=setTimeout(function(){v.state.isVisible&&v.hide()},D):i=requestAnimationFrame(function(){v.hide()})}}function t1(){v.state.isEnabled=!0}function e1(){v.hide(),v.state.isEnabled=!1}function n1(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function r1(w){if(!v.state.isDestroyed){_t("onBeforeUpdate",[v,w]),Ar();var D=v.props,I=Wc(n,Object.assign({},D,Fc(w),{ignoreAttributes:!0}));v.props=I,_r(),D.interactiveDebounce!==I.interactiveDebounce&&(hn(),m=zc(Vo,I.interactiveDebounce)),D.triggerTarget&&!I.triggerTarget?Bn(D.triggerTarget).forEach(function(G){G.removeAttribute("aria-expanded")}):I.triggerTarget&&n.removeAttribute("aria-expanded"),xe(),Tt(),A&&A(D,I),v.popperInstance&&(Vr(),zs().forEach(function(G){requestAnimationFrame(G._tippy.popperInstance.forceUpdate)})),_t("onAfterUpdate",[v,w])}}function o1(w){v.setProps({content:w})}function i1(){var w=v.state.isVisible,D=v.state.isDestroyed,I=!v.state.isEnabled,G=be.isTouch&&!v.props.touch,W=cs(v.props.duration,0,fe.duration);if(!(w||D||I||G)&&!U().hasAttribute("disabled")&&(_t("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,et()&&(C.style.visibility="visible"),Tt(),Yt(),v.state.isMounted||(C.style.transition="none"),et()){var zt=Z(),ie=zt.box,qn=zt.content;fs([ie,qn],0)}d=function(){var gn;if(!(!v.state.isVisible||c)){if(c=!0,C.offsetHeight,C.style.transition=v.props.moveTransition,et()&&v.props.animation){var Ls=Z(),Po=Ls.box,jn=Ls.content;fs([Po,jn],W),Hc([Po,jn],"visible")}De(),xe(),Lc(ms,v),(gn=v.popperInstance)==null||gn.forceUpdate(),_t("onMount",[v]),v.props.animation&&et()&&Qe(W,function(){v.state.isShown=!0,_t("onShown",[v])})}},Zb()}}function s1(){var w=!v.state.isVisible,D=v.state.isDestroyed,I=!v.state.isEnabled,G=cs(v.props.duration,1,fe.duration);if(!(w||D||I)&&(_t("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,c=!1,s=!1,et()&&(C.style.visibility="hidden"),hn(),Xe(),Tt(!0),et()){var W=Z(),zt=W.box,ie=W.content;v.props.animation&&(fs([zt,ie],G),Hc([zt,ie],"hidden"))}De(),xe(),v.props.animation?et()&&Tr(G,v.unmount):v.unmount()}}function a1(w){Nt().addEventListener("mousemove",m),Lc(yo,m),m(w)}function l1(){v.state.isVisible&&v.hide(),!!v.state.isMounted&&(Ir(),zs().forEach(function(w){w._tippy.unmount()}),C.parentNode&&C.parentNode.removeChild(C),ms=ms.filter(function(w){return w!==v}),v.state.isMounted=!1,_t("onHidden",[v]))}function c1(){v.state.isDestroyed||(v.clearDelayTimeouts(),v.unmount(),Ar(),delete n._tippy,v.state.isDestroyed=!0,_t("onDestroy",[v]))}}function Pn(n,t){t===void 0&&(t={});var e=fe.plugins.concat(t.plugins||[]);cv();var r=Object.assign({},t,{plugins:e}),o=ov(n),i=o.reduce(function(s,a){var l=a&&bv(a,r);return l&&s.push(l),s},[]);return go(n)?i[0]:i}Pn.defaultProps=fe,Pn.setDefaultProps=mv,Pn.currentInput=be,Object.assign({},yc,{effect:function(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow)}}),Pn.setDefaultProps({render:Gc});class kv{constructor({editor:t,element:e,view:r,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s,from:a,to:l})=>{const{doc:c,selection:u}=s,{empty:p}=u,d=!c.textBetween(a,l).length&&tc(s.selection);return!(p||d)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}(s==null?void 0:s.relatedTarget)&&((a=this.element.parentNode)===null||a===void 0?void 0:a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=r,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;this.tippy||!e||(this.tippy=Pn(t,x({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},this.tippyOptions)))}update(t,e){var r,o;const{state:i,composing:s}=t,{doc:a,selection:l}=i,c=e&&e.doc.eq(a)&&e.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:u}=l,p=Math.min(...u.map(m=>m.$from.pos)),d=Math.max(...u.map(m=>m.$to.pos));if(!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:t,state:i,oldState:e,from:p,to:d}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:()=>{if(jh(i.selection)){const m=t.nodeDOM(p);if(m)return m.getBoundingClientRect()}return dc(t,p,d)}}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Yc=n=>new Ht({key:typeof n.pluginKey=="string"?new ae(n.pluginKey):n.pluginKey,view:t=>new kv(x({view:t},n))});yt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Yc({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class wv{constructor({editor:t,element:e,view:r,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s})=>{const{selection:a}=s,{$anchor:l,empty:c}=a,u=l.depth===1,p=l.parent.isTextblock&&!l.parent.type.spec.code&&!l.parent.textContent;return!(!c||!u||!p)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}(s==null?void 0:s.relatedTarget)&&((a=this.element.parentNode)===null||a===void 0?void 0:a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=r,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;this.tippy||!e||(this.tippy=Pn(t,x({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},this.tippyOptions)))}update(t,e){var r,o;const{state:i}=t,{doc:s,selection:a}=i,{from:l,to:c}=a;if(e&&e.doc.eq(s)&&e.selection.eq(a))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:t,state:i,oldState:e}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:()=>dc(t,l,c)}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Xc=n=>new Ht({key:typeof n.pluginKey=="string"?new ae(n.pluginKey):n.pluginKey,view:t=>new wv(x({view:t},n))});yt.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Xc({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const Sv=f.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:null,default:"bubbleMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:t}){const e=f.ref(null);return f.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:i,shouldShow:s}=n;o.registerPlugin(Yc({pluginKey:r,editor:o,element:e.value,tippyOptions:i,shouldShow:s}))}),f.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=n;o.unregisterPlugin(r)}),()=>{var r;return f.h("div",{ref:e},(r=t.default)===null||r===void 0?void 0:r.call(t))}}});function Qc(n){return f.customRef((t,e)=>({get(){return t(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e()})})}}))}class xv extends qh{constructor(t={}){super(t);return this.vueRenderers=f.reactive(new Map),this.contentComponent=null,this.reactiveState=Qc(this.view.state),this.reactiveExtensionStorage=Qc(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),f.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){super.registerPlugin(t,e),this.reactiveState.value=this.view.state}unregisterPlugin(t){super.unregisterPlugin(t),this.reactiveState.value=this.view.state}}const Mv=f.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const t=f.ref(),e=f.getCurrentInstance();return f.watchEffect(()=>{const r=n.editor;r&&r.options.element&&t.value&&f.nextTick(()=>{if(!t.value||!r.options.element.firstChild)return;const o=f.unref(t.value);t.value.append(...r.options.element.childNodes),r.contentComponent=e.ctx._,r.setOptions({element:o}),r.createNodeViews()})}),f.onBeforeUnmount(()=>{const r=n.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const o=document.createElement("div");o.append(...r.options.element.childNodes),r.setOptions({element:o})}),{rootEl:t}},render(){const n=[];return this.editor&&this.editor.vueRenderers.forEach(t=>{const e=f.h(f.Teleport,{to:t.teleportElement,key:t.id},f.h(t.component,x({ref:t.id},t.props)));n.push(e)}),f.h("div",{ref:t=>{this.rootEl=t}},...n)}});f.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:t}){const e=f.ref(null);return f.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:i,shouldShow:s}=n;o.registerPlugin(Xc({pluginKey:r,editor:o,element:e.value,tippyOptions:i,shouldShow:s}))}),f.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=n;o.unregisterPlugin(r)}),()=>{var r;return f.h("div",{ref:e},(r=t.default)===null||r===void 0?void 0:r.call(t))}}}),f.defineComponent({props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,t;return f.h(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(t=(n=this.$slots).default)===null||t===void 0?void 0:t.call(n))}}),f.defineComponent({props:{as:{type:String,default:"div"}},render(){return f.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const Cv=/^```(?[a-z]*)?[\s\n]$/,Ev=/^~~~(?[a-z]*)?[\s\n]$/,Ov=bt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var t;const{languageClassPrefix:e}=this.options,i=[...((t=n.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(s=>s.startsWith(e)).map(s=>s.replace(e,""))[0];return i||null},renderHTML:n=>n.language?{class:this.options.languageClassPrefix+n.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:n}){return["pre",this.options.HTMLAttributes,["code",n,0]]},addCommands(){return{setCodeBlock:n=>({commands:t})=>t.setNode("codeBlock",n),toggleCodeBlock:n=>({commands:t})=>t.toggleNode("codeBlock","paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:t}=this.editor.state.selection,e=t.pos===1;return!n||t.parent.type.name!==this.name?!1:e||!t.parent.textContent.length?this.editor.commands.clearNodes():!1}}},addInputRules(){return[ts({find:Cv,type:this.type,getAttributes:({groups:n})=>n}),ts({find:Ev,type:this.type,getAttributes:({groups:n})=>n})]},addProseMirrorPlugins(){return[new Ht({key:new ae("codeBlockVSCodeHandler"),props:{handlePaste:(n,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const e=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!e||!i)return!1;const{tr:s}=n.state;return s.replaceSelectionWith(this.type.create({language:i})),s.setSelection(K.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(e.replace(/\r\n?/g,` -`)),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Nv=qe.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark("underline"),toggleUnderline:()=>({commands:n})=>n.toggleMark("underline"),unsetUnderline:()=>({commands:n})=>n.unsetMark("underline")}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});function Zc(n,t,e){for(var r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;var o=n.child(r),i=t.child(r);if(o==i){e+=o.nodeSize;continue}if(!o.sameMarkup(i))return e;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)e++;return e}if(o.content.size||i.content.size){var a=Zc(o.content,i.content,e+1);if(a!=null)return a}e+=o.nodeSize}}function tu(n,t,e,r){for(var o=n.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:e,b:r};var s=n.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){e-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:e,b:r};if(s.isText&&s.text!=a.text){for(var c=0,u=Math.min(s.text.length,a.text.length);ct&&r(l,o+a,i,s)!==!1&&l.content.size){var u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,e-u),r,o+u)}a=c}},O.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},O.prototype.textBetween=function(t,e,r,o){var i="",s=!0;return this.nodesBetween(t,e,function(a,l){a.isText?(i+=a.text.slice(Math.max(t,l)-l,e-l),s=!r):a.isLeaf&&o?(i+=typeof o=="function"?o(a):o,s=!r):!s&&a.isBlock&&(i+=r,s=!0)},0),i},O.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(r)&&(o[o.length-1]=e.withText(e.text+r.text),i=1);it)for(var i=0,s=0;st&&((se)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),r.push(a),o+=a.nodeSize),s=l}return new O(r,o)},O.prototype.cutByIndex=function(t,e){return t==e?O.empty:t==0&&e==this.content.length?this:new O(this.content.slice(t,e))},O.prototype.replaceChild=function(t,e){var r=this.content[t];if(r==e)return this;var o=this.content.slice(),i=this.size+e.nodeSize-r.nodeSize;return o[t]=e,new O(o,i)},O.prototype.addToStart=function(t){return new O([t].concat(this.content),this.size+t.nodeSize)},O.prototype.addToEnd=function(t){return new O(this.content.concat(t),this.size+t.nodeSize)},O.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var r=0,o=0;;r++){var i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||e>0?ko(r+1,s):ko(r,o);o=s}},O.prototype.toString=function(){return"<"+this.toStringInner()+">"},O.prototype.toStringInner=function(){return this.content.join(", ")},O.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null},O.fromJSON=function(t,e){if(!e)return O.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new O(e.map(t.nodeFromJSON))},O.fromArray=function(t){if(!t.length)return O.empty;for(var e,r=0,o=0;othis.type.rank&&(e||(e=t.slice(0,o)),e.push(this),r=!0),e&&e.push(i)}}return e||(e=t.slice()),r||e.push(this),e},q.prototype.removeFromSet=function(t){for(var e=0;e0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},R.fromJSON=function(t,e){if(!e)return R.empty;var r=e.openStart||0,o=e.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new R(O.fromJSON(t,e.content),r,o)},R.maxOpen=function(t,e){e===void 0&&(e=!0);for(var r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)r++;for(var s=t.lastChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.lastChild)o++;return new R(t,r,o)},Object.defineProperties(R.prototype,eu);function nu(n,t,e){var r=n.findIndex(t),o=r.index,i=r.offset,s=n.maybeChild(o),a=n.findIndex(e),l=a.index,c=a.offset;if(i==t||s.isText){if(c!=e&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(o!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(o,s.copy(nu(s.content,t-i-1,e-i-1)))}function ru(n,t,e,r){var o=n.findIndex(t),i=o.index,s=o.offset,a=n.maybeChild(i);if(s==t||a.isText)return r&&!r.canReplace(i,i,e)?null:n.cut(0,t).append(e).append(n.cut(t));var l=ru(a.content,t-s-1,e);return l&&n.replaceChild(i,a.copy(l))}R.empty=new R(O.empty,0,0);function Tv(n,t,e){if(e.openStart>n.depth)throw new ke("Inserted content deeper than insertion position");if(n.depth-e.openStart!=t.depth-e.openEnd)throw new ke("Inconsistent open depths");return ou(n,t,e,0)}function ou(n,t,e,r){var o=n.index(r),i=n.node(r);if(o==t.index(r)&&r=0&&n.isText&&n.sameMarkup(t[e])?t[e]=n.withText(t[e].text+n.text):t.push(n)}function yr(n,t,e,r){var o=(t||n).node(e),i=0,s=t?t.index(e):o.childCount;n&&(i=n.index(e),n.depth>e?i++:n.textOffset&&(un(n.nodeAfter,r),i++));for(var a=i;ao&&gs(n,t,o+1),s=r.depth>o&&gs(e,r,o+1),a=[];return yr(null,n,o,a),i&&s&&t.index(o)==e.index(o)?(iu(i,s),un(fn(i,su(n,t,e,r,o+1)),a)):(i&&un(fn(i,So(n,t,o+1)),a),yr(t,e,o,a),s&&un(fn(s,So(e,r,o+1)),a)),yr(r,null,o,a),new O(a)}function So(n,t,e){var r=[];if(yr(null,n,e,r),n.depth>e){var o=gs(n,t,e+1);un(fn(o,So(n,t,e+1)),r)}return yr(t,null,e,r),new O(r)}function _v(n,t){for(var e=t.depth-n.openStart,r=t.node(e),o=r.copy(n.content),i=e-1;i>=0;i--)o=t.node(i).copy(O.from(o));return{start:o.resolveNoCache(n.openStart+e),end:o.resolveNoCache(o.content.size-n.openEnd-e)}}var rt=function(t,e,r){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=r},zn={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};rt.prototype.resolveDepth=function(t){return t==null?this.depth:t<0?this.depth+t:t},zn.parent.get=function(){return this.node(this.depth)},zn.doc.get=function(){return this.node(0)},rt.prototype.node=function(t){return this.path[this.resolveDepth(t)*3]},rt.prototype.index=function(t){return this.path[this.resolveDepth(t)*3+1]},rt.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)},rt.prototype.start=function(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1},rt.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},rt.prototype.before=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]},rt.prototype.after=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize},zn.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},zn.nodeAfter.get=function(){var n=this.parent,t=this.index(this.depth);if(t==n.childCount)return null;var e=this.pos-this.path[this.path.length-1],r=n.child(t);return e?n.child(t).cut(e):r},zn.nodeBefore.get=function(){var n=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(n).cut(0,t):n==0?null:this.parent.child(n-1)},rt.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var r=this.path[e*3],o=e==0?0:this.path[e*3-1]+1,i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},rt.prototype.blockRange=function(t,e){if(t===void 0&&(t=this),t.pos=0;r--)if(t.pos<=this.end(r)&&(!e||e(this.node(r))))return new au(this,t,r)},rt.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},rt.prototype.max=function(t){return t.pos>this.pos?t:this},rt.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var r=[],o=0,i=e,s=t;;){var a=s.content.findIndex(i),l=a.index,c=a.offset,u=i-c;if(r.push(s,l,o+c),!u||(s=s.child(l),s.isText))break;i=u-1,o+=c+1}return new rt(e,r,i)},rt.resolveCached=function(t,e){for(var r=0;rt&&this.nodesBetween(t,e,function(i){return r.isInSet(i.marks)&&(o=!0),!o}),o},Ut.isBlock.get=function(){return this.type.isBlock},Ut.isTextblock.get=function(){return this.type.isTextblock},Ut.inlineContent.get=function(){return this.type.inlineContent},Ut.isInline.get=function(){return this.type.isInline},Ut.isText.get=function(){return this.type.isText},Ut.isLeaf.get=function(){return this.type.isLeaf},Ut.isAtom.get=function(){return this.type.isAtom},j.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Rv(this.marks,t)},j.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},j.prototype.canReplace=function(t,e,r,o,i){r===void 0&&(r=O.empty),o===void 0&&(o=0),i===void 0&&(i=r.childCount);var s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var l=o;l=0;e--)t=n[e].type.name+"("+t+")";return t}var Vt=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},xo={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};Vt.parse=function(t,e){var r=new Mo(t,e);if(r.next==null)return Vt.empty;var o=cu(r);r.next&&r.err("Unexpected trailing text");var i=Fv(Lv(o));return Hv(i,r),i},Vt.prototype.matchType=function(t){for(var e=0;e>1},Vt.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},Vt.prototype.toString=function(){var t=[];function e(r){t.push(r);for(var o=1;o"+t.indexOf(r.next[s+1]);return i}).join(` -`)},Object.defineProperties(Vt.prototype,xo),Vt.empty=new Vt(!0);var Mo=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()},lu={next:{configurable:!0}};lu.next.get=function(){return this.tokens[this.pos]},Mo.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},Mo.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(Mo.prototype,lu);function cu(n){var t=[];do t.push(Vv(n));while(n.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Vv(n){var t=[];do t.push(Iv(n));while(n.next&&n.next!=")"&&n.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Iv(n){for(var t=zv(n);;)if(n.eat("+"))t={type:"plus",expr:t};else if(n.eat("*"))t={type:"star",expr:t};else if(n.eat("?"))t={type:"opt",expr:t};else if(n.eat("{"))t=Bv(n,t);else break;return t}function uu(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");var t=Number(n.next);return n.pos++,t}function Bv(n,t){var e=uu(n),r=e;return n.eat(",")&&(n.next!="}"?r=uu(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:e,max:r,expr:t}}function Pv(n,t){var e=n.nodeTypes,r=e[t];if(r)return[r];var o=[];for(var i in e){var s=e[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&n.err("No node type or group '"+t+"' found"),o}function zv(n){if(n.eat("(")){var t=cu(n);return n.eat(")")||n.err("Missing closing paren"),t}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{var e=Pv(n,n.next).map(function(r){return n.inline==null?n.inline=r.isInline:n.inline!=r.isInline&&n.err("Mixing inline and block content"),{type:"name",value:r}});return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Lv(n){var t=[[]];return o(i(n,0),e()),t;function e(){return t.push([])-1}function r(s,a,l){var c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(function(l){return l.to=a})}function i(s,a){if(s.type=="choice")return s.exprs.reduce(function(k,b){return k.concat(i(b,a))},[]);if(s.type=="seq")for(var l=0;;l++){var c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=e())}else if(s.type=="star"){var u=e();return r(a,u),o(i(s.expr,u),u),[r(u)]}else if(s.type=="plus"){var p=e();return o(i(s.expr,a),p),o(i(s.expr,p),p),[r(p)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){for(var d=a,h=0;h-1&&o[d+1];pu(n,p).forEach(function(m){h||o.push(u,h=[]),h.indexOf(m)==-1&&h.push(m)})}})});for(var i=t[r.join(",")]=new Vt(r.indexOf(n.length-1)>-1),s=0;s-1},Gt.prototype.allowsMarks=function(t){if(this.markSet==null)return!0;for(var e=0;e-1};var ks={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},Jv={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},yu={ol:!0,ul:!0},ws=1,Ss=2,kr=4;function bu(n){return(n?ws:0)|(n==="full"?Ss:0)}var Ae=function(t,e,r,o,i,s,a){this.type=t,this.attrs=e,this.solid=i,this.match=s||(a&kr?null:t.contentMatch),this.options=a,this.content=[],this.marks=r,this.activeMarks=q.none,this.pendingMarks=o,this.stashMarks=[]};Ae.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(O.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{var r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)},Ae.prototype.finish=function(t){if(!(this.options&ws)){var e=this.content[this.content.length-1],r;e&&e.isText&&(r=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-r[0].length)))}var o=O.from(this.content);return!t&&this.match&&(o=o.append(this.match.fillBefore(O.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o},Ae.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},Ae.prototype.applyPending=function(t){for(var e=0,r=this.pendingMarks;e=0;o--){var i=this.nodes[o],s=i.findWrapping(t);if(s&&(!e||e.length>s.length)&&(e=s,r=i,!s.length)||i.solid)break}if(!e)return!1;this.sync(r);for(var a=0;athis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},ot.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ot.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t){this.open=e;return}},xs.currentPos.get=function(){this.closeExtra();for(var n=0,t=this.open;t>=0;t--){for(var e=this.nodes[t].content,r=e.length-1;r>=0;r--)n+=e[r].nodeSize;t&&n++}return n},ot.prototype.findAtPoint=function(t,e){if(this.find)for(var r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var r=t.split("/"),o=this.options.context,i=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=function(l,c){for(;l>=0;l--){var u=r[l];if(u==""){if(l==r.length-1||l==0)continue;for(;c>=s;c--)if(a(l-1,c))return!0;return!1}else{var p=c>0||c==0&&i?e.nodes[c].type:o&&c>=s?o.node(c-s).type:null;if(!p||p.name!=u&&p.groups.indexOf(u)==-1)return!1;c--}}return!0};return a(r.length-1,this.open)},ot.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var r=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(var o in this.parser.schema.nodes){var i=this.parser.schema.nodes[o];if(i.isTextblock&&i.defaultAttrs)return i}},ot.prototype.addPendingMark=function(t){var e=Wv(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},ot.prototype.removePendingMark=function(t,e){for(var r=this.open;r>=0;r--){var o=this.nodes[r],i=o.pendingMarks.lastIndexOf(t);if(i>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==e)break}},Object.defineProperties(ot.prototype,xs);function $v(n){for(var t=n.firstChild,e=null;t;t=t.nextSibling){var r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&yu.hasOwnProperty(r)&&e?(e.appendChild(t),t=e):r=="li"?e=t:r&&(e=null)}}function qv(n){for(var t=/\s*([\w-]+)\s*:\s*([^;]+)/g,e,r=[];e=t.exec(n);)r.push(e[1],e[2].trim());return r}function jv(n,t){var e=t.schema.nodes,r=function(s){var a=e[s];if(!!a.allowsMarkType(n)){var l=[],c=function(u){l.push(u);for(var p=0;pt)break;var c=this.ranges[a+i],u=this.ranges[a+s],p=l+c;if(t<=p){var d=c?t==l?-1:t==p?1:e:e,h=l+o+(d<0?0:u);if(r)return h;var m=t==(e<0?l:p)?null:Kv(a/3,t-l);return new Ms(h,e<0?t!=l:t!=p,m)}o+=u-c}return r?t+o:new Ms(t+o)},kt.prototype.touches=function(t,e){for(var r=0,o=Su(e),i=this.inverted?2:1,s=this.inverted?1:2,a=0;at)break;var c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1},kt.prototype.forEach=function(t){for(var e=this.inverted?2:1,r=this.inverted?1:2,o=0,i=0;o=0;e--){var o=t.getMirror(e);this.appendMap(t.maps[e].invert(),o!=null&&o>e?r-o-1:null)}},It.prototype.invert=function(){var t=new It;return t.appendMappingInverted(this),t},It.prototype.map=function(t,e){if(e===void 0&&(e=1),this.mirror)return this._map(t,e,!0);for(var r=this.from;ri&&l0},lt.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(lt.prototype,Cs);function Co(){throw new Error("Override me")}var Es=Object.create(null),Ot=function(){};Ot.prototype.apply=function(t){return Co()},Ot.prototype.getMap=function(){return kt.empty},Ot.prototype.invert=function(t){return Co()},Ot.prototype.map=function(t){return Co()},Ot.prototype.merge=function(t){return null},Ot.prototype.toJSON=function(){return Co()},Ot.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var r=Es[e.stepType];if(!r)throw new RangeError("No step type "+e.stepType+" defined");return r.fromJSON(t,e)},Ot.jsonID=function(t,e){if(t in Es)throw new RangeError("Duplicate use of step JSON ID "+t);return Es[t]=e,e.prototype.jsonID=t,e};var Bt=function(t,e){this.doc=t,this.failed=e};Bt.ok=function(t){return new Bt(t,null)},Bt.fail=function(t){return new Bt(null,t)},Bt.fromReplace=function(t,e,r,o){try{return Bt.ok(t.replace(e,r,o))}catch(i){if(i instanceof ke)return Bt.fail(i.message);throw i}};var Ke=function(n){function t(e,r,o,i){n.call(this),this.from=e,this.to=r,this.slice=o,this.structure=!!i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){return this.structure&&Os(r,this.from,this.to)?Bt.fail("Structure replace would overwrite content"):Bt.fromReplace(r,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new kt([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(r){return new t(this.from,this.from+this.slice.size,r.slice(this.from,this.to))},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted?null:new t(o.pos,Math.max(o.pos,i.pos),this.slice)},t.prototype.merge=function(r){if(!(r instanceof t)||r.structure||this.structure)return null;if(this.from+this.slice.size==r.from&&!this.slice.openEnd&&!r.slice.openStart){var o=this.slice.size+r.slice.size==0?R.empty:new R(this.slice.content.append(r.slice.content),this.slice.openStart,r.slice.openEnd);return new t(this.from,this.to+(r.to-r.from),o,this.structure)}else if(r.to==this.from&&!this.slice.openStart&&!r.slice.openEnd){var i=this.slice.size+r.slice.size==0?R.empty:new R(r.slice.content.append(this.slice.content),r.slice.openStart,this.slice.openEnd);return new t(r.from,this.to,i,this.structure)}else return null},t.prototype.toJSON=function(){var r={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(o.from,o.to,R.fromJSON(r,o.slice),!!o.structure)},t}(Ot);Ot.jsonID("replace",Ke);var dn=function(n){function t(e,r,o,i,s,a,l){n.call(this),this.from=e,this.to=r,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=!!l}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){if(this.structure&&(Os(r,this.from,this.gapFrom)||Os(r,this.gapTo,this.to)))return Bt.fail("Structure gap-replace would overwrite content");var o=r.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return Bt.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?Bt.fromReplace(r,this.from,this.to,i):Bt.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new kt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(r){var o=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,r.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),s=r.map(this.gapFrom,-1),a=r.map(this.gapTo,1);return o.deleted&&i.deleted||si.pos?null:new t(o.pos,i.pos,s,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var r={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number"||typeof o.gapFrom!="number"||typeof o.gapTo!="number"||typeof o.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(o.from,o.to,o.gapFrom,o.gapTo,R.fromJSON(r,o.slice),o.insert,!!o.structure)},t}(Ot);Ot.jsonID("replaceAround",dn);function Os(n,t,e){for(var r=n.resolve(t),o=e-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}lt.prototype.lift=function(n,t){for(var e=n.$from,r=n.$to,o=n.depth,i=e.before(o+1),s=r.after(o+1),a=i,l=s,c=O.empty,u=0,p=o,d=!1;p>t;p--)d||e.index(p)>0?(d=!0,c=O.from(e.node(p).copy(c)),u++):a--;for(var h=O.empty,m=0,g=o,y=!1;g>t;g--)y||r.after(g+1)=0;r--)e=O.from(t[r].type.create(t[r].attrs,e));var o=n.start,i=n.end;return this.step(new dn(o,i,o,i,new R(e,0,0),t.length,!0))},lt.prototype.setBlockType=function(n,t,e,r){var o=this;if(t===void 0&&(t=n),!e.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(n,t,function(s,a){if(s.isTextblock&&!s.hasMarkup(e,r)&&Gv(o.doc,o.mapping.slice(i).map(a),e)){o.clearIncompatible(o.mapping.slice(i).map(a,1),e);var l=o.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return o.step(new dn(c,u,c+1,u-1,new R(O.from(e.create(r,null,s.marks)),0,0),1,!0)),!1}}),this};function Gv(n,t,e){var r=n.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,e)}lt.prototype.setNodeMarkup=function(n,t,e,r){var o=this.doc.nodeAt(n);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var i=t.create(e,null,r||o.marks);if(o.isLeaf)return this.replaceWith(n,n+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new dn(n,n+o.nodeSize,n+1,n+o.nodeSize-1,new R(O.from(i),0,0),1,!0))},lt.prototype.split=function(n,t,e){t===void 0&&(t=1);for(var r=this.doc.resolve(n),o=O.empty,i=O.empty,s=r.depth,a=r.depth-t,l=t-1;s>a;s--,l--){o=O.from(r.node(s).copy(o));var c=e&&e[l];i=O.from(c?c.type.create(c.attrs,i):r.node(s).copy(i))}return this.step(new Ke(n,n,new R(o.append(i),t,t),!0))},lt.prototype.join=function(n,t){t===void 0&&(t=1);var e=new Ke(n-t,n+t,R.empty,!0);return this.step(e)};function Yv(n,t,e){var r=n.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),e))return t;if(r.parentOffset==0)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,e))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,e))return r.after(s+1);if(a=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(r){if(r instanceof t&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from)return new t(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(o.from,o.to,r.markFromJSON(o.mark))},t}(Ot);Ot.jsonID("addMark",Ts);var wr=function(n){function t(e,r,o){n.call(this),this.from=e,this.to=r,this.mark=o}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){var o=this,i=r.slice(this.from,this.to),s=new R(Ns(i.content,function(a){return a.mark(o.mark.removeFromSet(a.marks))}),i.openStart,i.openEnd);return Bt.fromReplace(r,this.from,this.to,s)},t.prototype.invert=function(){return new Ts(this.from,this.to,this.mark)},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(r){if(r instanceof t&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from)return new t(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(o.from,o.to,r.markFromJSON(o.mark))},t}(Ot);Ot.jsonID("removeMark",wr),lt.prototype.addMark=function(n,t,e){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(n,t,function(l,c,u){if(!!l.isInline){var p=l.marks;if(!e.isInSet(p)&&u.type.allowsMarkType(e.type)){for(var d=Math.max(c,n),h=Math.min(c+l.nodeSize,t),m=e.addToSet(p),g=0;g=0;d--)this.step(o[d]);return this};function Xv(n,t,e,r){if(e===void 0&&(e=t),r===void 0&&(r=R.empty),t==e&&!r.size)return null;var o=n.resolve(t),i=n.resolve(e);return xu(o,i,r)?new Ke(t,e,r):new oe(o,i,r).fit()}lt.prototype.replace=function(n,t,e){t===void 0&&(t=n),e===void 0&&(e=R.empty);var r=Xv(this.doc,n,t,e);return r&&this.step(r),this},lt.prototype.replaceWith=function(n,t,e){return this.replace(n,t,new R(O.from(e),0,0))},lt.prototype.delete=function(n,t){return this.replace(n,t,R.empty)},lt.prototype.insert=function(n,t){return this.replaceWith(n,n,t)};function xu(n,t,e){return!e.openStart&&!e.openEnd&&n.start()==t.start()&&n.parent.canReplace(n.index(),t.index(),e.content)}var oe=function(t,e,r){this.$to=e,this.$from=t,this.unplaced=r,this.frontier=[];for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}this.placed=O.empty;for(var s=t.depth;s>0;s--)this.placed=O.from(t.node(s).copy(this.placed))},Mu={depth:{configurable:!0}};Mu.depth.get=function(){return this.frontier.length-1},oe.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;for(var s=this.placed,a=o.depth,l=i.depth;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;var c=new R(s,a,l);if(e>-1)return new dn(o.pos,e,this.$to.pos,this.$to.end(),c,r);if(c.size||o.pos!=this.$to.pos)return new Ke(o.pos,i.pos,c)},oe.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--){var r=void 0,o=void 0;e?(o=_s(this.unplaced.content,e-1).firstChild,r=o.content):r=this.unplaced.content;for(var i=r.firstChild,s=this.depth;s>=0;s--){var a=this.frontier[s],l=a.type,c=a.match,u=void 0,p=void 0;if(t==1&&(i?c.matchType(i.type)||(p=c.fillBefore(O.from(i),!1)):l.compatibleContent(o.type)))return{sliceDepth:e,frontierDepth:s,parent:o,inject:p};if(t==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:e,frontierDepth:s,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}},oe.prototype.openMore=function(){var t=this.unplaced,e=t.content,r=t.openStart,o=t.openEnd,i=_s(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new R(e,r+1,Math.max(o,i.size+r>=e.size-o?r+1:0)),!0)},oe.prototype.dropNode=function(){var t=this.unplaced,e=t.content,r=t.openStart,o=t.openEnd,i=_s(e,r);if(i.childCount<=1&&r>0){var s=e.size-r<=r+i.size;this.unplaced=new R(Sr(e,r-1,1),r-1,s?r-1:o)}else this.unplaced=new R(Sr(e,r,1),r,o)},oe.prototype.placeNodes=function(t){for(var e=t.sliceDepth,r=t.frontierDepth,o=t.parent,i=t.inject,s=t.wrap;this.depth>r;)this.closeFrontierNode();if(s)for(var a=0;a1||u==0||b.content.size)&&(m=N,d.push(Cu(b.mark(g.allowedMarks(b.marks)),p==1?u:0,p==c.childCount?k:-1)))}var v=p==c.childCount;v||(k=-1),this.placed=xr(this.placed,r,O.from(d)),this.frontier[r].match=m,v&&k<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,C=c;E1&&i==this.$to.end(--o);)++i;return i},oe.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var r=this.frontier[e],o=r.match,i=r.type,s=e=0;l--){var c=this.frontier[l],u=c.match,p=c.type,d=As(t,l,p,u,!0);if(!d||d.childCount)continue t}return{depth:e,fit:a,move:s?t.doc.resolve(t.after(e+1)):t}}}},oe.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=xr(this.placed,e.depth,e.fit)),t=e.move;for(var r=e.depth+1;r<=t.depth;r++){var o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t},oe.prototype.openFrontierNode=function(t,e,r){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=xr(this.placed,this.depth,O.from(t.create(e,r))),this.frontier.push({type:t,match:t.contentMatch})},oe.prototype.closeFrontierNode=function(){var t=this.frontier.pop(),e=t.match.fillBefore(O.empty,!0);e.childCount&&(this.placed=xr(this.placed,this.frontier.length,e))},Object.defineProperties(oe.prototype,Mu);function Sr(n,t,e){return t==0?n.cutByIndex(e):n.replaceChild(0,n.firstChild.copy(Sr(n.firstChild.content,t-1,e)))}function xr(n,t,e){return t==0?n.append(e):n.replaceChild(n.childCount-1,n.lastChild.copy(xr(n.lastChild.content,t-1,e)))}function _s(n,t){for(var e=0;e1&&(r=r.replaceChild(0,Cu(r.firstChild,t-1,r.childCount==1?e-1:0))),t>0&&(r=n.type.contentMatch.fillBefore(r).append(r),e<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(O.empty,!0)))),n.copy(r)}function As(n,t,e,r,o){var i=n.node(t),s=o?n.indexAfter(t):n.index(t);if(s==i.childCount&&!e.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!Qv(e,i.content,s)?a:null}function Qv(n,t,e){for(var r=e;r0;a--,l--){var c=r.node(a).type.spec;if(c.defining||c.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==l&&i.splice(1,0,-a)}for(var u=i.indexOf(s),p=[],d=e.openStart,h=e.content,m=0;;m++){var g=h.firstChild;if(p.push(g),m==e.openStart)break;h=g.content}d>0&&p[d-1].type.spec.defining&&r.node(u).type!=p[d-1].type?d-=1:d>=2&&p[d-1].isTextblock&&p[d-2].type.spec.defining&&r.node(u).type!=p[d-2].type&&(d-=2);for(var y=e.openStart;y>=0;y--){var k=(y+d+1)%(e.openStart+1),b=p[k];if(!!b)for(var N=0;N=0&&(this.replace(n,t,e),!(this.steps.length>B));V--){var F=i[V];F<0||(n=r.before(F),t=o.after(F))}return this};function Eu(n,t,e,r,o){if(tr){var s=o.contentMatchAt(0),a=s.fillBefore(n).append(n);n=a.append(s.matchFragment(a).fillBefore(O.empty,!0))}return n}lt.prototype.replaceRangeWith=function(n,t,e){if(!e.isInline&&n==t&&this.doc.resolve(n).parent.content.size){var r=Yv(this.doc,n,e.type);r!=null&&(n=t=r)}return this.replaceRange(n,t,new R(O.from(e),0,0))},lt.prototype.deleteRange=function(n,t){for(var e=this.doc.resolve(n),r=this.doc.resolve(t),o=Ou(e,r),i=0;i0&&(a||e.node(s-1).canReplace(e.index(s-1),r.indexAfter(s-1))))return this.delete(e.before(s),r.after(s))}for(var l=1;l<=e.depth&&l<=r.depth;l++)if(n-e.start(l)==e.depth-l&&t>e.end(l)&&r.end(l)-t!=r.depth-l)return this.delete(e.before(l),t);return this.delete(n,t)};function Ou(n,t){for(var e=[],r=Math.min(n.depth,t.depth),o=r;o>=0;o--){var i=n.start(o);if(it.pos+(t.depth-o)||n.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==n.depth&&o==t.depth&&n.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&e.push(o)}return e}var Ds=Object.create(null),it=function(t,e,r){this.ranges=r||[new Zv(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Ue={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Ue.anchor.get=function(){return this.$anchor.pos},Ue.head.get=function(){return this.$head.pos},Ue.from.get=function(){return this.$from.pos},Ue.to.get=function(){return this.$to.pos},Ue.$from.get=function(){return this.ranges[0].$from},Ue.$to.get=function(){return this.ranges[0].$to},Ue.empty.get=function(){for(var n=this.ranges,t=0;t=0;i--){var s=e<0?Jn(t.node(0),t.node(i),t.before(i+1),t.index(i),e,r):Jn(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,r);if(s)return s}},it.near=function(t,e){return e===void 0&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new Er(t.node(0))},it.atStart=function(t){return Jn(t,t,0,0,1)||new Er(t)},it.atEnd=function(t){return Jn(t,t,t.content.size,t.childCount,-1)||new Er(t)},it.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var r=Ds[e.type];if(!r)throw new RangeError("No selection type "+e.type+" defined");return r.fromJSON(t,e)},it.jsonID=function(t,e){if(t in Ds)throw new RangeError("Duplicate use of selection JSON ID "+t);return Ds[t]=e,e.prototype.jsonID=t,e},it.prototype.getBookmark=function(){return Mr.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(it.prototype,Ue),it.prototype.visible=!0;var Zv=function(t,e){this.$from=t,this.$to=e},Mr=function(n){function t(r,o){o===void 0&&(o=r),n.call(this,r,o)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={$cursor:{configurable:!0}};return e.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(o,i){var s=o.resolve(i.map(this.head));if(!s.parent.inlineContent)return n.near(s);var a=o.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:s,s)},t.prototype.replace=function(o,i){if(i===void 0&&(i=R.empty),n.prototype.replace.call(this,o,i),i==R.empty){var s=this.$from.marksAcross(this.$to);s&&o.ensureMarks(s)}},t.prototype.eq=function(o){return o instanceof t&&o.anchor==this.anchor&&o.head==this.head},t.prototype.getBookmark=function(){return new Cr(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(o,i){if(typeof i.anchor!="number"||typeof i.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(o.resolve(i.anchor),o.resolve(i.head))},t.create=function(o,i,s){s===void 0&&(s=i);var a=o.resolve(i);return new this(a,s==i?a:o.resolve(s))},t.between=function(o,i,s){var a=o.pos-i.pos;if((!s||a)&&(s=a>=0?1:-1),!i.parent.inlineContent){var l=n.findFrom(i,s,!0)||n.findFrom(i,-s,!0);if(l)i=l.$head;else return n.near(i,s)}return o.parent.inlineContent||(a==0?o=i:(o=(n.findFrom(o,-s,!0)||n.findFrom(o,s,!0)).$anchor,o.pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&Hn.isSelectable(a))return Hn.create(n,e-(o<0?a.nodeSize:0))}else{var l=Jn(n,a,e+o,o<0?a.childCount:0,o,i);if(l)return l}e+=a.nodeSize*o}}function Nu(n,t,e){var r=n.steps.length-1;if(!(r0},t.prototype.setStoredMarks=function(o){return this.storedMarks=o,this.updated|=Oo,this},t.prototype.ensureMarks=function(o){return q.sameSet(this.storedMarks||this.selection.$from.marks(),o)||this.setStoredMarks(o),this},t.prototype.addStoredMark=function(o){return this.ensureMarks(o.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(o){return this.ensureMarks(o.removeFromSet(this.storedMarks||this.selection.$head.marks()))},e.storedMarksSet.get=function(){return(this.updated&Oo)>0},t.prototype.addStep=function(o,i){n.prototype.addStep.call(this,o,i),this.updated=this.updated&~Oo,this.storedMarks=null},t.prototype.setTime=function(o){return this.time=o,this},t.prototype.replaceSelection=function(o){return this.selection.replace(this,o),this},t.prototype.replaceSelectionWith=function(o,i){var s=this.selection;return i!==!1&&(o=o.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||q.none))),s.replaceWith(this,o),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(o,i,s){s===void 0&&(s=i);var a=this.doc.type.schema;if(i==null)return o?this.replaceSelectionWith(a.text(o),!0):this.deleteSelection();if(!o)return this.deleteRange(i,s);var l=this.storedMarks;if(!l){var c=this.doc.resolve(i);l=s==i?c.marks():c.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(i,s,a.text(o,l)),this.selection.empty||this.setSelection(it.near(this.selection.$to)),this},t.prototype.setMeta=function(o,i){return this.meta[typeof o=="string"?o:o.key]=i,this},t.prototype.getMeta=function(o){return this.meta[typeof o=="string"?o:o.key]},e.isGeneric.get=function(){for(var r in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=_u,this},e.scrolledIntoView.get=function(){return(this.updated&_u)>0},Object.defineProperties(t.prototype,e),t}(lt);function Au(n,t){return!t||!n?n:n.bind(t)}var Or=function(t,e,r){this.name=t,this.init=Au(e.init,r),this.apply=Au(e.apply,r)},ng=[new Or("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new Or("selection",{init:function(t,e){return t.selection||it.atStart(e.doc)},apply:function(t){return t.selection}}),new Or("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,r,o){return o.selection.$cursor?t.storedMarks:null}}),new Or("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],Rs=function(t,e){var r=this;this.schema=t,this.fields=ng.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach(function(o){if(r.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");r.plugins.push(o),r.pluginsByKey[o.key]=o,o.spec.state&&r.fields.push(new Or(o.key,o.spec.state,o))})},Pt=function(t){this.config=t},No={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};No.schema.get=function(){return this.config.schema},No.plugins.get=function(){return this.config.plugins},Pt.prototype.apply=function(t){return this.applyTransaction(t).state},Pt.prototype.filterTransaction=function(t,e){e===void 0&&(e=-1);for(var r=0;r-1&&Nr.splice(e,1)},Object.defineProperties(Pt.prototype,No);var Nr=[];function Du(n,t,e){for(var r in n){var o=n[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=Du(o,t,{})),e[r]=o}return e}var Ru=function(t){this.props={},t.props&&Du(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:Vu("plugin")};Ru.prototype.getState=function(t){return t[this.key]};var Vs=Object.create(null);function Vu(n){return n in Vs?n+"$"+ ++Vs[n]:(Vs[n]=0,n+"$")}var Is=function(t){t===void 0&&(t="key"),this.key=Vu(t)};Is.prototype.get=function(t){return t.config.pluginsByKey[this.key]},Is.prototype.getState=function(t){return t[this.key]};const rg=new Is("characterLimit"),og=yt.create({name:"characterCount",addOptions(){return{limit:0}},addProseMirrorPlugins(){const{options:n}=this;return[new Ru({key:rg,appendTransaction:(t,e,r)=>{const o=r.doc.content.size;if(n.limit&&o>n.limit)return r.tr.insertText("",n.limit+1,o)}})]}}),ig=yt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:t})=>this.options.alignments.includes(n)?this.options.types.every(e=>t.updateAttributes(e,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(t=>n.resetAttributes(t,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),sg=bt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",pt(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n})=>n().insertContent({type:this.name}).command(({tr:t,dispatch:e})=>{var r;if(e){const{parent:o,pos:i}=t.selection.$from,s=i+1;if(t.doc.nodeAt(s))t.setSelection(K.create(t.doc,s));else{const l=(r=o.type.contentMatch.defaultType)===null||r===void 0?void 0:r.create();l&&(t.insert(s,l),t.setSelection(K.create(t.doc,s)))}t.scrollIntoView()}return!0}).run()}},addInputRules(){return[fc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),ag=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/;bt.create({name:"image",addOptions(){return{inline:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:"img[src]"}]},renderHTML({HTMLAttributes:n}){return["img",pt(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:t})=>t.insertContent({type:this.name,attrs:n})}},addInputRules(){return[fc({find:ag,type:this.type,getAttributes:n=>{const[,,t,e,r]=n;return{src:e,alt:t,title:r}}})]}});const lg=/^\s*([-+*])\s$/,Iu=bt.create({name:"bulletList",addOptions(){return{HTMLAttributes:{}}},group:"block list",content:"listItem+",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n})=>n.toggleList("bulletList","listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[co({find:lg,type:this.type})]}}),cg=/^(\d+)\.\s$/,Bu=bt.create({name:"orderedList",addOptions(){return{HTMLAttributes:{}}},group:"block list",content:"listItem+",addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const r=n,{start:t}=r,e=Yu(r,["start"]);return t===1?["ol",pt(this.options.HTMLAttributes,e),0]:["ol",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n})=>n.toggleList("orderedList","listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[co({find:cg,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:(n,t)=>t.childCount+t.attrs.start===+n[1]})]}}),ug=bt.create({name:"taskList",addOptions(){return{HTMLAttributes:{}}},group:"block list",content:"taskItem+",parseHTML(){return[{tag:'ul[data-type="taskList"]',priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",pt(this.options.HTMLAttributes,n,{"data-type":"taskList"}),0]},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList("taskList","taskItem")}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),fg=/^\s*(\[([ |x])\])\s$/,pg=bt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{}}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>n.getAttribute("data-checked")==="true",renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:'li[data-type="taskItem"]',priority:51}]},renderHTML({node:n,HTMLAttributes:t}){return["li",pt(this.options.HTMLAttributes,t,{"data-type":"taskItem"}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem("taskItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("taskItem")};return this.options.nested?Lt(x({},n),{Tab:()=>this.editor.commands.sinkListItem("taskItem")}):n},addNodeView(){return({node:n,HTMLAttributes:t,getPos:e,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");return i.contentEditable="false",a.type="checkbox",a.addEventListener("change",c=>{if(!r.isEditable){a.checked=!a.checked;return}const{checked:u}=c.target;r.isEditable&&typeof e=="function"&&r.chain().focus().command(({tr:p})=>(p.setNodeMarkup(e(),void 0,{checked:u}),!0)).run()}),Object.entries(this.options.HTMLAttributes).forEach(([c,u])=>{o.setAttribute(c,u)}),o.dataset.checked=n.attrs.checked,n.attrs.checked&&a.setAttribute("checked","checked"),i.append(a,s),o.append(i,l),Object.entries(t).forEach(([c,u])=>{o.setAttribute(c,u)}),{dom:o,contentDOM:l,update:c=>c.type!==this.type?!1:(o.dataset.checked=c.attrs.checked,c.attrs.checked?a.setAttribute("checked","checked"):a.removeAttribute("checked"),!0)}}},addInputRules(){return[co({find:fg,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),dg=/^\s*>\s$/,hg=bt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block*",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn("blockquote"),toggleBlockquote:()=>({commands:n})=>n.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:n})=>n.lift("blockquote")}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[co({find:dg,type:this.type})]}}),mg=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,vg=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,gg=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,yg=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,bg=qe.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark("bold"),toggleBold:()=>({commands:n})=>n.toggleMark("bold"),unsetBold:()=>({commands:n})=>n.unsetMark("bold")}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[An({find:mg,type:this.type}),An({find:gg,type:this.type})]},addPasteRules(){return[Dn({find:vg,type:this.type}),Dn({find:yg,type:this.type})]}}),kg=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,wg=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Sg=qe.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark("code"),toggleCode:()=>({commands:n})=>n.toggleMark("code"),unsetCode:()=>({commands:n})=>n.unsetMark("code")}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[An({find:kg,type:this.type})]},addPasteRules(){return[Dn({find:wg,type:this.type})]}}),xg=bt.create({name:"doc",topNode:!0,content:"block+"});function Mg(n){return n===void 0&&(n={}),new Ht({view:function(e){return new we(e,n)}})}var we=function(t,e){var r=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map(function(o){var i=function(s){return r[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})};we.prototype.destroy=function(){var t=this;this.handlers.forEach(function(e){var r=e.name,o=e.handler;return t.editorView.dom.removeEventListener(r,o)})},we.prototype.update=function(t,e){this.cursorPos!=null&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())},we.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},we.prototype.updateOverlay=function(){var t=this.editorView.state.doc.resolve(this.cursorPos),e;if(!t.parent.inlineContent){var r=t.nodeBefore,o=t.nodeAfter;if(r||o){var i=this.editorView.nodeDOM(this.cursorPos-(r?r.nodeSize:0)).getBoundingClientRect(),s=r?i.bottom:i.top;r&&o&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:i.left,right:i.right,top:s-this.width/2,bottom:s+this.width/2}}}if(!e){var a=this.editorView.coordsAtPos(this.cursorPos);e={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{var p=l.getBoundingClientRect();c=p.left-l.scrollLeft,u=p.top-l.scrollTop}this.element.style.left=e.left-c+"px",this.element.style.top=e.top-u+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},we.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return e.setCursor(null)},t)},we.prototype.dragover=function(t){if(!!this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,e):o;if(e&&!i){var s=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(s=ha(this.editorView.state.doc,s,this.editorView.dragging.slice),s==null))return this.setCursor(null);this.setCursor(s),this.scheduleRemoval(5e3)}}},we.prototype.dragend=function(){this.scheduleRemoval(20)},we.prototype.drop=function(){this.scheduleRemoval(20)},we.prototype.dragleave=function(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)};const Cg=yt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:null}},addProseMirrorPlugins(){return[Mg(this.options)]}});var pe=function(n){function t(e){n.call(this,e,e)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.map=function(r,o){var i=r.resolve(o.map(this.head));return t.valid(i)?new t(i):n.near(i)},t.prototype.content=function(){return T.empty},t.prototype.eq=function(r){return r instanceof t&&r.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(r,o){if(typeof o.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(r.resolve(o.pos))},t.prototype.getBookmark=function(){return new To(this.anchor)},t.valid=function(r){var o=r.parent;if(o.isTextblock||!Eg(r)||!Og(r))return!1;var i=o.type.spec.allowGapCursor;if(i!=null)return i;var s=o.contentMatchAt(r.index()).defaultType;return s&&s.isTextblock},t.findFrom=function(r,o,i){t:for(;;){if(!i&&t.valid(r))return r;for(var s=r.pos,a=null,l=r.depth;;l--){var c=r.node(l);if(o>0?r.indexAfter(l)0){a=c.child(o>0?r.indexAfter(l):r.index(l)-1);break}else if(l==0)return null;s+=o;var u=r.doc.resolve(s);if(t.valid(u))return u}for(;;){var p=o>0?a.firstChild:a.lastChild;if(!p){if(a.isAtom&&!a.isText&&!P.isSelectable(a)){r=r.doc.resolve(s+a.nodeSize*o),i=!1;continue t}break}a=p,s+=o;var d=r.doc.resolve(s);if(t.valid(d))return d}return null}},t}(z);pe.prototype.visible=!1,z.jsonID("gapcursor",pe);var To=function(t){this.pos=t};To.prototype.map=function(t){return new To(t.map(this.pos))},To.prototype.resolve=function(t){var e=t.resolve(this.pos);return pe.valid(e)?new pe(e):z.near(e)};function Eg(n){for(var t=n.depth;t>=0;t--){var e=n.index(t);if(e!=0)for(var r=n.node(t).child(e-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function Og(n){for(var t=n.depth;t>=0;t--){var e=n.indexAfter(t),r=n.node(t);if(e!=r.childCount)for(var o=r.child(e);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}var Ng=function(){return new Ht({props:{decorations:Ag,createSelectionBetween:function(t,e,r){if(e.pos==r.pos&&pe.valid(r))return new pe(r)},handleClick:_g,handleKeyDown:Tg}})},Tg=Gl({ArrowLeft:_o("horiz",-1),ArrowRight:_o("horiz",1),ArrowUp:_o("vert",-1),ArrowDown:_o("vert",1)});function _o(n,t){var e=n=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,i){var s=r.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof K){if(!i.endOfTextblock(e)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}var c=pe.findFrom(a,t,l);return c?(o&&o(r.tr.setSelection(new pe(c))),!0):!1}}function _g(n,t,e){if(!n.editable)return!1;var r=n.state.doc.resolve(t);if(!pe.valid(r))return!1;var o=n.posAtCoords({left:e.clientX,top:e.clientY}),i=o.inside;return i>-1&&P.isSelectable(n.state.doc.nodeAt(i))?!1:(n.dispatch(n.state.tr.setSelection(new pe(r))),!0)}function Ag(n){if(!(n.selection instanceof pe))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Y.create(n.doc,[ut.widget(n.selection.head,t,{key:"gapcursor"})])}const Dg=yt.create({name:"gapCursor",addProseMirrorPlugins(){return[Ng()]},extendNodeSchema(n){var t;const e={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(t=L(_(n,"allowGapCursor",e)))!==null&&t!==void 0?t:null}}}),Rg=bt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",pt(this.options.HTMLAttributes,n)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:n,chain:t,state:e,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:o,storedMarks:i}=e;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const p=l.filter(d=>a.includes(d.type.name));c.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Vg=bt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:t}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,pt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.setNode("heading",n):!1,toggleHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.toggleNode("heading","paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,t)=>Lt(x({},n),{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(n=>ts({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Ao=200,wt=function(){};wt.prototype.append=function(t){return t.length?(t=wt.from(t),!this.length&&t||t.length=e?wt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},wt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},wt.prototype.forEach=function(t,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length),e<=r?this.forEachInner(t,e,r,0):this.forEachInvertedInner(t,e,r,0)},wt.prototype.map=function(t,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},e,r),o},wt.from=function(t){return t instanceof wt?t:t&&t.length?new Pu(t):wt.empty};var Pu=function(n){function t(r){n.call(this),this.values=r}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Ao)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Ao)return new t(o.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(t.prototype,e),t}(wt);wt.empty=new Pu([]);var Ig=function(n){function t(e,r){n.call(this),this.left=e,this.right=r,this.length=e.length+r.length,this.depth=Math.max(e.depth,r.depth)+1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new t(o,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(wt),zu=wt,Bg=500,St=function(t,e){this.items=t,this.eventCount=e};St.prototype.popEvent=function(t,e){var r=this;if(this.eventCount==0)return null;for(var o=this.items.length;;o--){var i=this.items.get(o-1);if(i.selection){--o;break}}var s,a;e&&(s=this.remapping(o,this.items.length),a=s.maps.length);var l=t.tr,c,u,p=[],d=[];return this.items.forEach(function(h,m){if(!h.step){s||(s=r.remapping(o,m+1),a=s.maps.length),a--,d.push(h);return}if(s){d.push(new Se(h.map));var g=h.step.map(s.slice(a)),y;g&&l.maybeStep(g).doc&&(y=l.mapping.maps[l.mapping.maps.length-1],p.push(new Se(y,null,null,p.length+d.length))),a--,y&&s.appendMap(y,a)}else l.maybeStep(h.step);if(h.selection)return c=s?h.selection.map(s.slice(a)):h.selection,u=new St(r.items.slice(0,o).append(d.reverse().concat(p)),r.eventCount-1),!1},this.items.length,0),{remaining:u,transform:l,selection:c}},St.prototype.addTransform=function(t,e,r,o){for(var i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null,c=0;czg&&(a=Pg(a,h),s-=h),new St(a.append(i),s)},St.prototype.remapping=function(t,e){var r=new Mt;return this.items.forEach(function(o,i){var s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?r.maps.length-o.mirrorOffset:null;r.appendMap(o.map,s)},t,e),r},St.prototype.addMaps=function(t){return this.eventCount==0?this:new St(this.items.append(t.map(function(e){return new Se(e)})),this.eventCount)},St.prototype.rebased=function(t,e){if(!this.eventCount)return this;var r=[],o=Math.max(0,this.items.length-e),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(function(h){h.selection&&a--},o);var l=e;this.items.forEach(function(h){var m=i.getMirror(--l);if(m!=null){s=Math.min(s,m);var g=i.maps[m];if(h.step){var y=t.steps[m].invert(t.docs[m]),k=h.selection&&h.selection.map(i.slice(l+1,m));k&&a++,r.push(new Se(g,y,k))}else r.push(new Se(g))}},o);for(var c=[],u=e;uBg&&(d=d.compress(this.items.length-r.length)),d},St.prototype.emptyItemCount=function(){var t=0;return this.items.forEach(function(e){e.step||t++}),t},St.prototype.compress=function(t){t===void 0&&(t=this.items.length);var e=this.remapping(0,t),r=e.maps.length,o=[],i=0;return this.items.forEach(function(s,a){if(a>=t)o.push(s),s.selection&&i++;else if(s.step){var l=s.step.map(e.slice(r)),c=l&&l.getMap();if(r--,c&&e.appendMap(c,r),l){var u=s.selection&&s.selection.map(e.slice(r));u&&i++;var p=new Se(c.invert(),l,u),d,h=o.length-1;(d=o.length&&o[h].merge(p))?o[h]=d:o.push(p)}}else s.map&&r--},this.items.length,0),new St(zu.from(o.reverse()),i)},St.empty=new St(zu.empty,0);function Pg(n,t){var e;return n.forEach(function(r,o){if(r.selection&&t--==0)return e=o,!1}),n.slice(e)}var Se=function(t,e,r,o){this.map=t,this.step=e,this.selection=r,this.mirrorOffset=o};Se.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new Se(e.getMap().invert(),e,this.selection)}};var Ge=function(t,e,r,o){this.done=t,this.undone=e,this.prevRanges=r,this.prevTime=o},zg=20;function Lg(n,t,e,r){var o=e.getMeta(Ye),i;if(o)return o.historyState;e.getMeta(Hg)&&(n=new Ge(n.done,n.undone,null,0));var s=e.getMeta("appendedTransaction");if(e.steps.length==0)return n;if(s&&s.getMeta(Ye))return s.getMeta(Ye).redo?new Ge(n.done.addTransform(e,null,r,Do(t)),n.undone,Lu(e.mapping.maps[e.steps.length-1]),n.prevTime):new Ge(n.done,n.undone.addTransform(e,null,r,Do(t)),null,n.prevTime);if(e.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){var a=n.prevTime==0||!s&&(n.prevTime<(e.time||0)-r.newGroupDelay||!Fg(e,n.prevRanges)),l=s?Bs(n.prevRanges,e.mapping):Lu(e.mapping.maps[e.steps.length-1]);return new Ge(n.done.addTransform(e,a?t.selection.getBookmark():null,r,Do(t)),St.empty,l,e.time)}else return(i=e.getMeta("rebased"))?new Ge(n.done.rebased(e,i),n.undone.rebased(e,i),Bs(n.prevRanges,e.mapping),n.prevTime):new Ge(n.done.addMaps(e.mapping.maps),n.undone.addMaps(e.mapping.maps),Bs(n.prevRanges,e.mapping),n.prevTime)}function Fg(n,t){if(!t)return!1;if(!n.docChanged)return!0;var e=!1;return n.mapping.maps[0].forEach(function(r,o){for(var i=0;i=t[i]&&(e=!0)}),e}function Lu(n){var t=[];return n.forEach(function(e,r,o,i){return t.push(o,i)}),t}function Bs(n,t){if(!n)return null;for(var e=[],r=0;r({state:n,dispatch:t})=>Ju(n,t),redo:()=>({state:n,dispatch:t})=>$u(n,t)}},addProseMirrorPlugins(){return[Jg(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),qg=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,jg=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Wg=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Kg=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Ug=qe.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark("italic"),toggleItalic:()=>({commands:n})=>n.toggleMark("italic"),unsetItalic:()=>({commands:n})=>n.unsetMark("italic")}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[An({find:qg,type:this.type}),An({find:Wg,type:this.type})]},addPasteRules(){return[Dn({find:jg,type:this.type}),Dn({find:Kg,type:this.type})]}}),Gg=bt.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",pt(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),Yg=bt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode("paragraph")}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Xg=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Qg=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Zg=qe.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",pt(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark("strike"),toggleStrike:()=>({commands:n})=>n.toggleMark("strike"),unsetStrike:()=>({commands:n})=>n.unsetMark("strike")}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[An({find:Xg,type:this.type})]},addPasteRules(){return[Dn({find:Qg,type:this.type})]}}),ty=bt.create({name:"text",group:"inline"}),ey=yt.create({name:"starterKit",addExtensions(){var n,t,e,r,o,i,s,a,l,c,u,p,d,h,m,g,y,k;const b=[];return this.options.blockquote!==!1&&b.push(hg.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&b.push(bg.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.bulletList!==!1&&b.push(Iu.configure((e=this.options)===null||e===void 0?void 0:e.bulletList)),this.options.code!==!1&&b.push(Sg.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&b.push(Ov.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&b.push(xg.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&b.push(Cg.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&b.push(Dg.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&b.push(Rg.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&b.push(Vg.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&b.push($g.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&b.push(sg.configure((p=this.options)===null||p===void 0?void 0:p.horizontalRule)),this.options.italic!==!1&&b.push(Ug.configure((d=this.options)===null||d===void 0?void 0:d.italic)),this.options.listItem!==!1&&b.push(Gg.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&b.push(Bu.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&b.push(Yg.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&b.push(Zg.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&b.push(ty.configure((k=this.options)===null||k===void 0?void 0:k.text)),b}});var lk="",Ro=(n,t)=>{const e=n.__vccOpts||n;for(const[r,o]of t)e[r]=o;return e};const ny={components:{EditorContent:Mv,BubbleMenu:Sv},props:{modelValue:{type:String,default:""},maxChars:{type:Number,default:0},bubbleMenu:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},bold:{type:Boolean,default:!0},italic:{type:Boolean,default:!0},strike:{type:Boolean,default:!0},underline:{type:Boolean,default:!0},code:{type:Boolean,default:!0},codeBlock:{type:Boolean,default:!0},blockquote:{type:Boolean,default:!0},bulletList:{type:Boolean,default:!0},orderedList:{type:Boolean,default:!0},taskList:{type:Boolean,default:!0},heading:{type:Boolean,default:!0},textAlign:{type:Boolean,default:!0},horizontalRule:{type:Boolean,default:!0},undoRedo:{type:Boolean,default:!0}},data(){return{editor:null,headingOpen:!1,alignOpen:!1}},watch:{modelValue(n){this.editor.getHTML()!==n&&this.editor.commands.setContent(this.modelValue,!1)},disabled(n){this.editor&&this.editor.setEditable(!n)}},methods:{insertImageFromURL(n){this.editor.chain().focus().setImage({src:n},!1).run()}},computed:{extensions(){return[ey.configure({orderedList:!1,bulletList:!1}),Nv,ig,Bu.configure({class:"inline-flex"}),Iu.configure({class:"inline-flex"}),og.configure({limit:this.maxChars}),ug,pg]},hasTextAlign(){return this.editor.isActive({textAlign:"left"})||this.editor.isActive({textAlign:"right"})||this.editor.isActive({textAlign:"center"})||this.editor.isActive({textAlign:"justify"})},charPercentage(){return Math.round(100/this.maxChars*this.editor.getCharacterCount())}},mounted(){this.editor=new xv({content:this.modelValue,extensions:this.extensions,editorProps:{attributes:{class:"h-full overflow-y-auto input"}},editable:!this.disabled}).on("update",({editor:n})=>{this.$emit("update:modelValue",n.getHTML())}),this.$watch(()=>this.maxChars,()=>{})},beforeUnmount(){this.editor.destroy()}},ry=["aria-label"],oy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}),f.createElementVNode("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"})],-1)],iy=["aria-label"],sy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"11",y1:"5",x2:"17",y2:"5"}),f.createElementVNode("line",{x1:"7",y1:"19",x2:"13",y2:"19"}),f.createElementVNode("line",{x1:"14",y1:"5",x2:"10",y2:"19"})],-1)],ay=["aria-label"],ly=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M7 5v9a5 5 0 0 0 10 0v-9"}),f.createElementVNode("path",{d:"M4 12h16"})],-1)],cy=["aria-label"],uy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M7 5v5a5 5 0 0 0 10 0v-5"}),f.createElementVNode("path",{d:"M5 19h14"})],-1)],fy=["aria-label"],py=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("polyline",{points:"7 8 3 12 7 16"}),f.createElementVNode("polyline",{points:"17 8 21 12 17 16"}),f.createElementVNode("line",{x1:"14",y1:"4",x2:"10",y2:"20"})],-1)],dy=["aria-label"],hy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),f.createElementVNode("path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"}),f.createElementVNode("path",{d:"M10 13l-1 2l1 2"}),f.createElementVNode("path",{d:"M14 13l1 2l-1 2"})],-1)],my=["aria-label"],vy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M6 15h15"}),f.createElementVNode("path",{d:"M21 19h-15"}),f.createElementVNode("path",{d:"M15 11h6"}),f.createElementVNode("path",{d:"M21 7h-6"}),f.createElementVNode("path",{d:"M9 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"}),f.createElementVNode("path",{d:"M3 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"})],-1)],gy=["aria-label"],yy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"9",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"9",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"9",y1:"18",x2:"20",y2:"18"}),f.createElementVNode("line",{x1:"5",y1:"6",x2:"5",y2:"6.01"}),f.createElementVNode("line",{x1:"5",y1:"12",x2:"5",y2:"12.01"}),f.createElementVNode("line",{x1:"5",y1:"18",x2:"5",y2:"18.01"})],-1)],by=["aria-label"],ky=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M11 6h9"}),f.createElementVNode("path",{d:"M11 12h9"}),f.createElementVNode("path",{d:"M12 18h8"}),f.createElementVNode("path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"}),f.createElementVNode("path",{d:"M6 10v-6l-2 2"})],-1)],wy=["aria-label"],Sy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M3.5 5.5l1.5 1.5l2.5 -2.5"}),f.createElementVNode("path",{d:"M3.5 11.5l1.5 1.5l2.5 -2.5"}),f.createElementVNode("path",{d:"M3.5 17.5l1.5 1.5l2.5 -2.5"}),f.createElementVNode("line",{x1:"11",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"11",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"11",y1:"18",x2:"20",y2:"18"})],-1)],xy={key:10},My=["aria-label"],Cy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M7 12h10"}),f.createElementVNode("path",{d:"M7 4v16"}),f.createElementVNode("path",{d:"M17 4v16"}),f.createElementVNode("path",{d:"M15 20h4"}),f.createElementVNode("path",{d:"M15 4h4"}),f.createElementVNode("path",{d:"M5 20h4"}),f.createElementVNode("path",{d:"M5 4h4"})],-1)],Ey={key:0,class:"mx-1 inline-flex space-x-1"},Oy=["aria-label"],Ny=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M19 18v-8l-2 2"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Ty=["aria-label"],_y=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 -.001"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Ay=["aria-label"],Dy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M19 14a2 2 0 1 0 -2 -2"}),f.createElementVNode("path",{d:"M17 16a2 2 0 1 0 2 -2"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Ry=["aria-label"],Vy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M20 18v-8l-4 6h5"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Iy=["aria-label"],By=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M17 18h2a2 2 0 1 0 0 -4h-2v-4h4"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Py=["aria-label"],zy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("circle",{transform:"rotate(180 19 16)",cx:"19",cy:"16",r:"2"}),f.createElementVNode("path",{d:"M21 12a2 2 0 1 0 -4 0v4"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Ly={key:11},Fy=["aria-label"],Hy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),f.createElementVNode("line",{x1:"6",y1:"18",x2:"18",y2:"18"})],-1)],Jy={key:0,class:"inline-flex mx-1 space-x-1"},$y=["aria-label"],qy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12"}),f.createElementVNode("line",{x1:"4",y1:"18",x2:"18",y2:"18"})],-1)],jy=["aria-label"],Wy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),f.createElementVNode("line",{x1:"6",y1:"18",x2:"18",y2:"18"})],-1)],Ky=["aria-label"],Uy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"6",y1:"18",x2:"20",y2:"18"})],-1)],Gy=["aria-label"],Yy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"4",y1:"18",x2:"16",y2:"18"})],-1)],Xy=["aria-label"],Qy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"7",x2:"20",y2:"7"}),f.createElementVNode("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),f.createElementVNode("line",{x1:"14",y1:"11",x2:"14",y2:"17"}),f.createElementVNode("path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}),f.createElementVNode("path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"})],-1)],Zy=["aria-label"],t0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"4",y1:"4",x2:"4",y2:"4.01"}),f.createElementVNode("line",{x1:"8",y1:"4",x2:"8",y2:"4.01"}),f.createElementVNode("line",{x1:"12",y1:"4",x2:"12",y2:"4.01"}),f.createElementVNode("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),f.createElementVNode("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),f.createElementVNode("line",{x1:"4",y1:"8",x2:"4",y2:"8.01"}),f.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"8.01"}),f.createElementVNode("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),f.createElementVNode("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),f.createElementVNode("line",{x1:"12",y1:"16",x2:"12",y2:"16.01"}),f.createElementVNode("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),f.createElementVNode("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),f.createElementVNode("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),f.createElementVNode("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),f.createElementVNode("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),f.createElementVNode("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})],-1)],e0=["aria-label"],n0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"})],-1)],r0=["aria-label"],o0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"})],-1)];function i0(n,t,e,r,o,i){const s=f.resolveComponent("CollapseXTransition"),a=f.resolveComponent("editor-content"),l=f.resolveDirective("tooltip");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",null,[o.editor?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(e.bubbleMenu?"bubble-menu":"div"),{key:0,editor:o.editor,class:f.normalizeClass(["flex-wrap space-x-1",e.bubbleMenu?"bg-gray-600 rounded dark p-1":"mb-2"])},{default:f.withCtx(()=>[e.bold?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:0,"aria-label":n.__("tiptap::tiptap.bold"),onClick:t[0]||(t[0]=c=>o.editor.chain().focus().toggleBold().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("bold")}])},oy,10,ry)),[[l,n.__("tiptap::tiptap.bold")]]):f.createCommentVNode("",!0),e.italic?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:1,"aria-label":n.__("tiptap::tiptap.italic"),onClick:t[1]||(t[1]=c=>o.editor.chain().focus().toggleItalic().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("italic")}])},sy,10,iy)),[[l,n.__("tiptap::tiptap.italic")]]):f.createCommentVNode("",!0),e.strike?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:2,"aria-label":n.__("tiptap::tiptap.strike"),onClick:t[2]||(t[2]=c=>o.editor.chain().focus().toggleStrike().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("strike")}])},ly,10,ay)),[[l,n.__("tiptap::tiptap.strike")]]):f.createCommentVNode("",!0),e.underline?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:3,"aria-label":n.__("tiptap::tiptap.underline"),onClick:t[3]||(t[3]=c=>o.editor.chain().focus().toggleUnderline().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("underline")}])},uy,10,cy)),[[l,n.__("tiptap::tiptap.underline")]]):f.createCommentVNode("",!0),e.code?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:4,"aria-label":n.__("tiptap::tiptap.code"),onClick:t[4]||(t[4]=c=>o.editor.chain().focus().toggleCode().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("code")}])},py,10,fy)),[[l,n.__("tiptap::tiptap.code")]]):f.createCommentVNode("",!0),e.codeBlock?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:5,"aria-label":n.__("tiptap::tiptap.code_block"),onClick:t[5]||(t[5]=c=>o.editor.chain().focus().toggleCodeBlock().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("codeBlock")}])},hy,10,dy)),[[l,n.__("tiptap::tiptap.code_block")]]):f.createCommentVNode("",!0),e.blockquote?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:6,"aria-label":n.__("tiptap::tiptap.blockquote"),onClick:t[6]||(t[6]=c=>o.editor.chain().focus().toggleBlockquote().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("blockquote")}])},vy,10,my)),[[l,n.__("tiptap::tiptap.blockquote")]]):f.createCommentVNode("",!0),e.bulletList?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:7,"aria-label":n.__("tiptap::tiptap.bullet_list"),onClick:t[7]||(t[7]=c=>o.editor.chain().focus().toggleBulletList().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("bulletList")}])},yy,10,gy)),[[l,n.__("tiptap::tiptap.bullet_list")]]):f.createCommentVNode("",!0),e.orderedList?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:8,"aria-label":n.__("tiptap::tiptap.ordered_list"),onClick:t[8]||(t[8]=c=>o.editor.chain().focus().toggleOrderedList().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("orderedList")}])},ky,10,by)),[[l,n.__("tiptap::tiptap.ordered_list")]]):f.createCommentVNode("",!0),e.taskList?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:9,"aria-label":n.__("tiptap::tiptap.task_list"),onClick:t[9]||(t[9]=c=>o.editor.chain().focus().toggleTaskList().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("taskList")}])},Sy,10,wy)),[[l,n.__("tiptap::tiptap.task_list")]]):f.createCommentVNode("",!0),e.heading?(f.openBlock(),f.createElementBlock("span",xy,[f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading")}]),onClick:t[10]||(t[10]=c=>{o.headingOpen=!o.headingOpen,o.alignOpen=!1}),"aria-label":n.__("tiptap::tiptap.heading")},Cy,10,My),[[l,n.__("tiptap::tiptap.heading")]]),f.createVNode(s,null,{default:f.withCtx(()=>[o.headingOpen?(f.openBlock(),f.createElementBlock("div",Ey,[f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:1})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 1`,onClick:t[11]||(t[11]=c=>o.editor.chain().focus().toggleHeading({level:1}).run())},Ny,10,Oy),[[l,`${n.__("tiptap::tiptap.heading")} 1`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:2})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 2`,onClick:t[12]||(t[12]=c=>o.editor.chain().focus().toggleHeading({level:2}).run())},_y,10,Ty),[[l,`${n.__("tiptap::tiptap.heading")} 2`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:3})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 3`,onClick:t[13]||(t[13]=c=>o.editor.chain().focus().toggleHeading({level:3}).run())},Dy,10,Ay),[[l,`${n.__("tiptap::tiptap.heading")} 3`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:4})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 4`,onClick:t[14]||(t[14]=c=>o.editor.chain().focus().toggleHeading({level:4}).run())},Vy,10,Ry),[[l,`${n.__("tiptap::tiptap.heading")} 4`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:5})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 5`,onClick:t[15]||(t[15]=c=>o.editor.chain().focus().toggleHeading({level:5}).run())},By,10,Iy),[[l,`${n.__("tiptap::tiptap.heading")} 5`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:6})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 6`,onClick:t[16]||(t[16]=c=>o.editor.chain().focus().toggleHeading({level:6}).run())},zy,10,Py),[[l,`${n.__("tiptap::tiptap.heading")} 6`]])])):f.createCommentVNode("",!0)]),_:1})])):f.createCommentVNode("",!0),e.textAlign?(f.openBlock(),f.createElementBlock("span",Ly,[f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:i.hasTextAlign}]),onClick:t[17]||(t[17]=c=>{o.alignOpen=!o.alignOpen,o.headingOpen=!1}),"aria-label":n.__("tiptap::tiptap.text_align")},Hy,10,Fy),[[l,n.__("tiptap::tiptap.text_align")]]),f.createVNode(s,null,{default:f.withCtx(()=>[o.alignOpen?(f.openBlock(),f.createElementBlock("div",Jy,[f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive({textAlign:"left"})}]),"aria-label":n.__("tiptap::tiptap.left"),onClick:t[18]||(t[18]=c=>o.editor.chain().focus().setTextAlign("left").run())},qy,10,$y),[[l,n.__("tiptap::tiptap.left")]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive({textAlign:"center"})}]),"aria-label":n.__("tiptap::tiptap.center"),onClick:t[19]||(t[19]=c=>o.editor.chain().focus().setTextAlign("center").run())},Wy,10,jy),[[l,n.__("tiptap::tiptap.center")]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive({textAlign:"right"})}]),"aria-label":n.__("tiptap::tiptap.right"),onClick:t[20]||(t[20]=c=>o.editor.chain().focus().setTextAlign("right").run())},Uy,10,Ky),[[l,n.__("tiptap::tiptap.right")]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive({textAlign:"justify"})}]),"aria-label":n.__("tiptap::tiptap.justify"),onClick:t[21]||(t[21]=c=>o.editor.chain().focus().setTextAlign("justify").run())},Yy,10,Gy),[[l,n.__("tiptap::tiptap.justify")]]),f.withDirectives(f.createElementVNode("button",{class:"button","aria-label":n.__("tiptap::tiptap.clear"),onClick:t[22]||(t[22]=c=>o.editor.chain().focus().unsetTextAlign().run())},Qy,8,Xy),[[l,n.__("tiptap::tiptap.clear")]])])):f.createCommentVNode("",!0)]),_:1})])):f.createCommentVNode("",!0),e.horizontalRule?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:12,"aria-label":n.__("tiptap::tiptap.horizontal_rule"),onClick:t[23]||(t[23]=c=>o.editor.chain().focus().setHorizontalRule().run()),class:"button"},t0,8,Zy)),[[l,n.__("tiptap::tiptap.horizontal_rule")]]):f.createCommentVNode("",!0),e.undoRedo?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:13,"aria-label":n.__("tiptap::tiptap.undo"),onClick:t[24]||(t[24]=c=>o.editor.chain().focus().undo().run()),class:"button"},n0,8,e0)),[[l,n.__("tiptap::tiptap.undo")]]):f.createCommentVNode("",!0),e.undoRedo?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:14,"aria-label":n.__("tiptap::tiptap.redo"),onClick:t[25]||(t[25]=c=>o.editor.chain().focus().redo().run()),class:"button"},o0,8,r0)),[[l,n.__("tiptap::tiptap.redo")]]):f.createCommentVNode("",!0)]),_:1},8,["editor","class"])):f.createCommentVNode("",!0)]),f.createVNode(a,{editor:o.editor,class:"min-h-64 h-64",onClick:t[26]||(t[26]=c=>{o.headingOpen=!1,o.alignOpen=!1})},null,8,["editor"]),o.editor&&e.maxChars>0?(f.openBlock(),f.createElementBlock("div",{key:0,class:f.normalizeClass(["w-full",i.charPercentage>90?"text-red-500":i.charPercentage>75?"text-yellow-500":null])},f.toDisplayString(n.__("tiptap::tiptap.character_count",{chars:o.editor.getCharacterCount(),max:e.maxChars})),3)):f.createCommentVNode("",!0)])}var qu=Ro(ny,[["render",i0]]);const s0={components:{Tiptap:qu},data(){return{bubbleMenu:!1,maxChars:280,content:"

This is tiptap 2 in Voyager II using Vue 3 \u{1F389}

",disabled:!1,bold:!0,italic:!0,strike:!0,underline:!0,code:!0,codeBlock:!0,blockquote:!0,bulletList:!0,orderedList:!0,taskList:!0,heading:!0,textAlign:!0,horizontalRule:!0,undoRedo:!0}}},a0={class:"flex space-x-2"},l0={class:"input-group"},c0=f.createElementVNode("label",{for:"bubble",class:"label"},"Bubble menu",-1),u0={class:"mt-1"},f0={class:"input-group"},p0=f.createElementVNode("label",{for:"maxChars",class:"label"},"Max characters (0 = infinite)",-1),d0={class:"mt-1"},h0={class:"input-group"},m0=f.createElementVNode("label",{for:"disabled",class:"label"},"Disabled",-1),v0={class:"mt-1"},g0={class:"flex flex-wrap space-x-2 mt-4"},y0={class:"input-group"},b0={for:"bold",class:"label"},k0={class:"mt-1"},w0={class:"input-group"},S0={for:"italic",class:"label"},x0={class:"mt-1"},M0={class:"input-group"},C0={for:"strike",class:"label"},E0={class:"mt-1"},O0={class:"input-group"},N0={for:"underline",class:"label"},T0={class:"mt-1"},_0={class:"input-group"},A0={for:"code",class:"label"},D0={class:"mt-1"},R0={class:"input-group"},V0={for:"codeBlock",class:"label"},I0={class:"mt-1"},B0={class:"input-group"},P0={for:"blockquote",class:"label"},z0={class:"mt-1"},L0={class:"input-group"},F0={for:"bulletList",class:"label"},H0={class:"mt-1"},J0={class:"input-group"},$0={for:"orderedList",class:"label"},q0={class:"mt-1"},j0={class:"input-group"},W0={for:"taskList",class:"label"},K0={class:"mt-1"},U0={class:"input-group"},G0={for:"heading",class:"label"},Y0={class:"mt-1"},X0={class:"input-group"},Q0={for:"textAlign",class:"label"},Z0={class:"mt-1"},tb={class:"input-group"},eb={for:"horizontalRule",class:"label"},nb={class:"mt-1"},rb={class:"input-group"},ob={for:"undoRedo",class:"label"},ib={class:"mt-1"};function sb(n,t,e,r,o,i){const s=f.resolveComponent("tiptap"),a=f.resolveComponent("collapsible");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(s,{bubbleMenu:o.bubbleMenu,maxChars:o.maxChars,modelValue:o.content,"onUpdate:modelValue":t[0]||(t[0]=l=>o.content=l),disabled:o.disabled,bold:o.bold,italic:o.italic,strike:o.strike,underline:o.underline,code:o.code,codeBlock:o.codeBlock,blockquote:o.blockquote,bulletList:o.bulletList,orderedList:o.orderedList,taskList:o.taskList,heading:o.heading,textAlign:o.textAlign,horizontalRule:o.horizontalRule,undoRedo:o.undoRedo,class:"mb-2"},null,8,["bubbleMenu","maxChars","modelValue","disabled","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"]),f.createVNode(a,{title:"Options"},{default:f.withCtx(()=>[f.createElementVNode("div",a0,[f.createElementVNode("div",l0,[c0,f.createElementVNode("div",u0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[1]||(t[1]=l=>o.bubbleMenu=l),id:"bubble"},null,512),[[f.vModelCheckbox,o.bubbleMenu]])])]),f.createElementVNode("div",f0,[p0,f.createElementVNode("div",d0,[f.withDirectives(f.createElementVNode("input",{type:"number",class:"input","onUpdate:modelValue":t[2]||(t[2]=l=>o.maxChars=l),min:"0",id:"maxChars"},null,512),[[f.vModelText,o.maxChars,void 0,{number:!0}]])])]),f.createElementVNode("div",h0,[m0,f.createElementVNode("div",v0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[3]||(t[3]=l=>o.disabled=l),id:"disabled"},null,512),[[f.vModelCheckbox,o.disabled]])])])]),f.createElementVNode("div",g0,[f.createElementVNode("div",y0,[f.createElementVNode("label",b0,f.toDisplayString(n.__("tiptap::tiptap.bold")),1),f.createElementVNode("div",k0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[4]||(t[4]=l=>o.bold=l),id:"bold"},null,512),[[f.vModelCheckbox,o.bold]])])]),f.createElementVNode("div",w0,[f.createElementVNode("label",S0,f.toDisplayString(n.__("tiptap::tiptap.italic")),1),f.createElementVNode("div",x0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[5]||(t[5]=l=>o.italic=l),id:"italic"},null,512),[[f.vModelCheckbox,o.italic]])])]),f.createElementVNode("div",M0,[f.createElementVNode("label",C0,f.toDisplayString(n.__("tiptap::tiptap.strike")),1),f.createElementVNode("div",E0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[6]||(t[6]=l=>o.strike=l),id:"strike"},null,512),[[f.vModelCheckbox,o.strike]])])]),f.createElementVNode("div",O0,[f.createElementVNode("label",N0,f.toDisplayString(n.__("tiptap::tiptap.underline")),1),f.createElementVNode("div",T0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[7]||(t[7]=l=>o.underline=l),id:"underline"},null,512),[[f.vModelCheckbox,o.underline]])])]),f.createElementVNode("div",_0,[f.createElementVNode("label",A0,f.toDisplayString(n.__("tiptap::tiptap.code")),1),f.createElementVNode("div",D0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[8]||(t[8]=l=>o.code=l),id:"code"},null,512),[[f.vModelCheckbox,o.code]])])]),f.createElementVNode("div",R0,[f.createElementVNode("label",V0,f.toDisplayString(n.__("tiptap::tiptap.code_block")),1),f.createElementVNode("div",I0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[9]||(t[9]=l=>o.codeBlock=l),id:"codeBlock"},null,512),[[f.vModelCheckbox,o.codeBlock]])])]),f.createElementVNode("div",B0,[f.createElementVNode("label",P0,f.toDisplayString(n.__("tiptap::tiptap.blockquote")),1),f.createElementVNode("div",z0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[10]||(t[10]=l=>o.blockquote=l),id:"blockquote"},null,512),[[f.vModelCheckbox,o.blockquote]])])]),f.createElementVNode("div",L0,[f.createElementVNode("label",F0,f.toDisplayString(n.__("tiptap::tiptap.bullet_list")),1),f.createElementVNode("div",H0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[11]||(t[11]=l=>o.bulletList=l),id:"bulletList"},null,512),[[f.vModelCheckbox,o.bulletList]])])]),f.createElementVNode("div",J0,[f.createElementVNode("label",$0,f.toDisplayString(n.__("tiptap::tiptap.ordered_list")),1),f.createElementVNode("div",q0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[12]||(t[12]=l=>o.orderedList=l),id:"orderedList"},null,512),[[f.vModelCheckbox,o.orderedList]])])]),f.createElementVNode("div",j0,[f.createElementVNode("label",W0,f.toDisplayString(n.__("tiptap::tiptap.task_list")),1),f.createElementVNode("div",K0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[13]||(t[13]=l=>o.taskList=l),id:"taskList"},null,512),[[f.vModelCheckbox,o.taskList]])])]),f.createElementVNode("div",U0,[f.createElementVNode("label",G0,f.toDisplayString(n.__("tiptap::tiptap.heading")),1),f.createElementVNode("div",Y0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[14]||(t[14]=l=>o.heading=l),id:"heading"},null,512),[[f.vModelCheckbox,o.heading]])])]),f.createElementVNode("div",X0,[f.createElementVNode("label",Q0,f.toDisplayString(n.__("tiptap::tiptap.text_align")),1),f.createElementVNode("div",Z0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[15]||(t[15]=l=>o.textAlign=l),id:"textAlign"},null,512),[[f.vModelCheckbox,o.textAlign]])])]),f.createElementVNode("div",tb,[f.createElementVNode("label",eb,f.toDisplayString(n.__("tiptap::tiptap.horizontal_rule")),1),f.createElementVNode("div",nb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[16]||(t[16]=l=>o.horizontalRule=l),id:"horizontalRule"},null,512),[[f.vModelCheckbox,o.horizontalRule]])])]),f.createElementVNode("div",rb,[f.createElementVNode("label",ob,f.toDisplayString(n.__("tiptap::tiptap.undo"))+"/"+f.toDisplayString(n.__("tiptap::tiptap.redo")),1),f.createElementVNode("div",ib,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[17]||(t[17]=l=>o.undoRedo=l),id:"undoRedo"},null,512),[[f.vModelCheckbox,o.undoRedo]])])])])]),_:1}),f.createVNode(a,{title:"HTML Output"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("textarea",{class:"input w-full min-h-64","onUpdate:modelValue":t[18]||(t[18]=l=>o.content=l)},null,512),[[f.vModelText,o.content]])]),_:1})],64)}var ab=Ro(s0,[["render",sb]]);const lb={mixins:[voyager.formfieldMixin]},cb={key:1},ub={key:2};function fb(n,t,e,r,o,i){const s=f.resolveComponent("tiptap");return n.action=="query"?f.renderSlot(n.$slots,"default",{key:0}):n.action=="add"||n.action=="edit"?(f.openBlock(),f.createElementBlock("div",cb,[f.createVNode(s,{bubbleMenu:n.options.bubbleMenu,maxChars:n.options.maxChars,modelValue:n.modelValue,"onUpdate:modelValue":t[0]||(t[0]=a=>n.$emit("update:modelValue",a)),bold:n.options.bold,italic:n.options.italic,strike:n.options.strike,underline:n.options.underline,code:n.options.code,codeBlock:n.options.codeBlock,blockquote:n.options.blockquote,bulletList:n.options.bulletList,orderedList:n.options.orderedList,taskList:n.options.taskList,heading:n.options.heading,textAlign:n.options.textAlign,horizontalRule:n.options.horizontalRule,undoRedo:n.options.undoRedo},null,8,["bubbleMenu","maxChars","modelValue","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"])])):n.action=="browse"?(f.openBlock(),f.createElementBlock("div",ub,f.toDisplayString(n.modelValue),1)):f.createCommentVNode("",!0)}var pb=Ro(lb,[["render",fb]]);const db={mixins:[voyager.formfieldBuilderMixin],computed:{defaultListOptions(){return{display_length:150}},defaultViewOptions(){return{bubbleMenu:!1,maxChars:0,bold:!0,italic:!0,strike:!0,underline:!0,code:!0,codeBlock:!0,blockquote:!0,bulletList:!0,orderedList:!0,taskList:!0,heading:!0,textAlign:!0,horizontalRule:!0,undoRedo:!0}}}},hb={key:0},mb={for:"length",class:"label"},vb={key:1},gb={class:"mt-2"},yb={for:"maxChars",class:"label"},bb={class:"grid grid-cols-3 lg:grid-cols-2 xl:grid-cols-3 gap-2 mt-2"},kb={class:"flex items-center space-x-1"},wb={for:"bubble",class:"label"},Sb={class:"flex items-center space-x-1"},xb={for:"bold",class:"label"},Mb={class:"flex items-center space-x-1"},Cb={for:"italic",class:"label"},Eb={class:"flex items-center space-x-1"},Ob={for:"strike",class:"label"},Nb={class:"flex items-center space-x-1"},Tb={for:"underline",class:"label"},_b={class:"flex items-center space-x-1"},Ab={for:"code",class:"label"},Db={class:"flex items-center space-x-1"},Rb={for:"codeBlock",class:"label"},Vb={class:"flex items-center space-x-1"},Ib={for:"blockquote",class:"label"},Bb={class:"flex items-center space-x-1"},Pb={for:"bulletList",class:"label"},zb={class:"flex items-center space-x-1"},Lb={for:"orderedList",class:"label"},Fb={class:"flex items-center space-x-1"},Hb={for:"taskList",class:"label"},Jb={class:"flex items-center space-x-1"},$b={for:"heading",class:"label"},qb={class:"flex items-center space-x-1"},jb={for:"textAlign",class:"label"},Wb={class:"flex items-center space-x-1"},Kb={for:"horizontalRule",class:"label"},Ub={class:"flex items-center space-x-1"},Gb={for:"undoRedo",class:"label"},Yb={key:2};function Xb(n,t,e,r,o,i){const s=f.resolveComponent("tiptap");return n.action=="list-options"?(f.openBlock(),f.createElementBlock("div",hb,[f.createElementVNode("label",mb,f.toDisplayString(n.__("voyager::generic.display_length")),1),f.withDirectives(f.createElementVNode("input",{type:"number",id:"length",class:"input w-full","onUpdate:modelValue":t[0]||(t[0]=a=>n.options.display_length=a)},null,512),[[f.vModelText,n.options.display_length,void 0,{number:!0}]])])):n.action=="view-options"?(f.openBlock(),f.createElementBlock("div",vb,[f.createElementVNode("div",gb,[f.createElementVNode("label",yb,f.toDisplayString(n.__("tiptap::tiptap.max_characters")),1),f.withDirectives(f.createElementVNode("input",{type:"number",class:"input w-full","onUpdate:modelValue":t[1]||(t[1]=a=>n.options.maxChars=a),min:"0",id:"maxChars"},null,512),[[f.vModelText,n.options.maxChars,void 0,{number:!0}]])]),f.createElementVNode("div",bb,[f.createElementVNode("div",kb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[2]||(t[2]=a=>n.options.bubbleMenu=a),id:"bubble"},null,512),[[f.vModelCheckbox,n.options.bubbleMenu]]),f.createElementVNode("label",wb,f.toDisplayString(n.__("tiptap::tiptap.bubble_menu")),1)]),f.createElementVNode("div",Sb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[3]||(t[3]=a=>n.options.bold=a),id:"bold"},null,512),[[f.vModelCheckbox,n.options.bold]]),f.createElementVNode("label",xb,f.toDisplayString(n.__("tiptap::tiptap.bold")),1)]),f.createElementVNode("div",Mb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[4]||(t[4]=a=>n.options.italic=a),id:"italic"},null,512),[[f.vModelCheckbox,n.options.italic]]),f.createElementVNode("label",Cb,f.toDisplayString(n.__("tiptap::tiptap.italic")),1)]),f.createElementVNode("div",Eb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[5]||(t[5]=a=>n.options.strike=a),id:"strike"},null,512),[[f.vModelCheckbox,n.options.strike]]),f.createElementVNode("label",Ob,f.toDisplayString(n.__("tiptap::tiptap.strike")),1)]),f.createElementVNode("div",Nb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[6]||(t[6]=a=>n.options.underline=a),id:"underline"},null,512),[[f.vModelCheckbox,n.options.underline]]),f.createElementVNode("label",Tb,f.toDisplayString(n.__("tiptap::tiptap.underline")),1)]),f.createElementVNode("div",_b,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[7]||(t[7]=a=>n.options.code=a),id:"code"},null,512),[[f.vModelCheckbox,n.options.code]]),f.createElementVNode("label",Ab,f.toDisplayString(n.__("tiptap::tiptap.code")),1)]),f.createElementVNode("div",Db,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[8]||(t[8]=a=>n.options.codeBlock=a),id:"codeBlock"},null,512),[[f.vModelCheckbox,n.options.codeBlock]]),f.createElementVNode("label",Rb,f.toDisplayString(n.__("tiptap::tiptap.code_block")),1)]),f.createElementVNode("div",Vb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[9]||(t[9]=a=>n.options.blockquote=a),id:"blockquote"},null,512),[[f.vModelCheckbox,n.options.blockquote]]),f.createElementVNode("label",Ib,f.toDisplayString(n.__("tiptap::tiptap.blockquote")),1)]),f.createElementVNode("div",Bb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[10]||(t[10]=a=>n.options.bulletList=a),id:"bulletList"},null,512),[[f.vModelCheckbox,n.options.bulletList]]),f.createElementVNode("label",Pb,f.toDisplayString(n.__("tiptap::tiptap.bullet_list")),1)]),f.createElementVNode("div",zb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[11]||(t[11]=a=>n.options.orderedList=a),id:"orderedList"},null,512),[[f.vModelCheckbox,n.options.orderedList]]),f.createElementVNode("label",Lb,f.toDisplayString(n.__("tiptap::tiptap.ordered_list")),1)]),f.createElementVNode("div",Fb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[12]||(t[12]=a=>n.options.taskList=a),id:"taskList"},null,512),[[f.vModelCheckbox,n.options.taskList]]),f.createElementVNode("label",Hb,f.toDisplayString(n.__("tiptap::tiptap.task_list")),1)]),f.createElementVNode("div",Jb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[13]||(t[13]=a=>n.options.heading=a),id:"heading"},null,512),[[f.vModelCheckbox,n.options.heading]]),f.createElementVNode("label",$b,f.toDisplayString(n.__("tiptap::tiptap.heading")),1)]),f.createElementVNode("div",qb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[14]||(t[14]=a=>n.options.textAlign=a),id:"textAlign"},null,512),[[f.vModelCheckbox,n.options.textAlign]]),f.createElementVNode("label",jb,f.toDisplayString(n.__("tiptap::tiptap.text_align")),1)]),f.createElementVNode("div",Wb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[15]||(t[15]=a=>n.options.horizontalRule=a),id:"horizontalRule"},null,512),[[f.vModelCheckbox,n.options.horizontalRule]]),f.createElementVNode("label",Kb,f.toDisplayString(n.__("tiptap::tiptap.horizontal_rule")),1)]),f.createElementVNode("div",Ub,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[16]||(t[16]=a=>n.options.undoRedo=a),id:"undoRedo"},null,512),[[f.vModelCheckbox,n.options.undoRedo]]),f.createElementVNode("label",Gb,f.toDisplayString(n.__("tiptap::tiptap.undo"))+"/"+f.toDisplayString(n.__("tiptap::tiptap.redo")),1)])])])):n.action=="view"?(f.openBlock(),f.createElementBlock("div",Yb,[f.createVNode(s,{bubbleMenu:n.options.bubbleMenu,maxChars:n.options.maxChars,value:"''",bold:n.options.bold,italic:n.options.italic,strike:n.options.strike,underline:n.options.underline,code:n.options.code,codeBlock:n.options.codeBlock,blockquote:n.options.blockquote,bulletList:n.options.bulletList,orderedList:n.options.orderedList,taskList:n.options.taskList,heading:n.options.heading,textAlign:n.options.textAlign,horizontalRule:n.options.horizontalRule,undoRedo:n.options.undoRedo},null,8,["bubbleMenu","maxChars","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"])])):f.createCommentVNode("",!0)}var Qb=Ro(db,[["render",Xb]]);voyager.component("tiptap",qu),voyager.component("tiptap-demo",ab),voyager.component("tiptap-formfield",pb),voyager.component("tiptap-builder",Qb),voyager.addToUI("Tiptap","tiptap-demo")}); +}`;class Xh extends Gh{constructor(t={}){super();this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Ph(Yh))}setOptions(t={}){this.options=x(x({},this.options),t),!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t){this.setOptions({editable:t})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const r=oc(e)?e(t,this.state.plugins):[...this.state.plugins,t],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const e=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(e))});this.view.updateState(r)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(Ah):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Dn(e,this)}createCommandManager(){this.commandManager=new ss({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=fc(this.options.content,this.schema,this.options.parseOptions),e=lc(t,this.options.autofocus);this.view=new ct(this.options.element,Lt(x({},this.options.editorProps),{dispatchTransaction:this.dispatchTransaction.bind(this),state:Ot.create({doc:t,selection:e})}));const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const e=this.state.apply(t),r=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return Dh(this.state,t)}isActive(t,e){const r=typeof t=="string"?t:null,o=typeof t=="string"?e:t;return Rh(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Vh(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=` + +`,textSerializers:r={}}=t||{};return Ih(this.state.doc,{blockSeparator:e,textSerializers:x(x({},r),sc(this.schema))})}get isEmpty(){return Bh(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!((t=this.view)===null||t===void 0?void 0:t.docView)}}class kt{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=x(x({},this.config),t),this.name=this.config.name,t.defaultOptions&&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=F(A(this,"addOptions",{name:this.name}))),this.storage=F(A(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new kt(t)}configure(t={}){const e=this.extend();return e.options=io(this.options,t),e.storage=F(A(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new kt(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(A(e,"addOptions",{name:e.name})),e.storage=F(A(e,"addStorage",{name:e.name,options:e.options})),e}}class We{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=x(x({},this.config),t),this.name=this.config.name,t.defaultOptions&&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=F(A(this,"addOptions",{name:this.name}))),this.storage=F(A(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new We(t)}configure(t={}){const e=this.extend();return e.options=io(this.options,t),e.storage=F(A(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new We(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=F(A(e,"addOptions",{name:e.name})),e.storage=F(A(e,"addStorage",{name:e.name,options:e.options})),e}}function bc(n){return new fo({find:n.find,handler:({state:t,range:e,match:r})=>{const o=F(n.getAttributes,void 0,r)||{},{tr:i}=t,s=e.from;let a=e.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);let c=s+l;c>a?c=a:a=c+r[1].length;const u=r[0][r[0].length-1];i.insertText(u,s+r[0].length-1),i.replaceWith(c,a,n.type.create(o))}else r[0]&&i.replaceWith(s,a,n.type.create(o))}})}function kc(n,t,e){const r=[];return n===t?e.resolve(n).marks().forEach(o=>{const i=e.resolve(n-1),s=es(i,o.type);!s||r.push(x({mark:o},s))}):e.nodesBetween(n,t,(o,i)=>{r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Rn(n){return new fo({find:n.find,handler:({state:t,range:e,match:r})=>{const o=F(n.getAttributes,void 0,r);if(o===!1||o===null)return;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=e.to;if(s){const c=a.search(/\S/),u=e.from+a.indexOf(s),p=u+s.length;if(kc(e.from,e.to,t.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;pe.from&&i.delete(e.from+c,u),l=e.from+c+s.length,i.addMark(e.from+c,l,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}function us(n){return new fo({find:n.find,handler:({state:t,range:e,match:r})=>{const o=t.doc.resolve(e.from),i=F(n.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),n.type))return null;t.tr.delete(e.from,e.to).setBlockType(e.from,e.from,n.type,i)}})}function po(n){return new fo({find:n.find,handler:({state:t,range:e,match:r})=>{const o=F(n.getAttributes,void 0,r)||{},i=t.tr.delete(e.from,e.to),a=i.doc.resolve(e.from).blockRange(),l=a&&ai(a,n.type,o);if(!l)return null;i.wrap(a,l);const c=i.doc.resolve(e.from-1).nodeBefore;c&&c.type===n.type&&li(i.doc,e.from-1)&&(!n.joinPredicate||n.joinPredicate(r,c))&&i.join(e.from-1)}})}function Vn(n){return new Hh({find:n.find,handler:({state:t,range:e,match:r})=>{const o=F(n.getAttributes,void 0,r);if(o===!1||o===null)return;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=e.to;if(s){const c=a.search(/\S/),u=e.from+a.indexOf(s),p=u+s.length;if(kc(e.from,e.to,t.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;pe.from&&i.delete(e.from+c,u),l=e.from+c+s.length,i.addMark(e.from+c,l,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}function Qh(n){return ns(n)&&n instanceof P}function wc(n,t,e){const r=0,o=n.state.doc.content.size,i=cn(t,r,o),s=cn(e,r,o),a=n.coordsAtPos(i),l=n.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),p=Math.min(a.left,l.left),d=Math.max(a.right,l.right),h=d-p,m=u-c,k={top:c,bottom:u,left:p,right:d,width:h,height:m,x:p,y:c};return Lt(x({},k),{toJSON:()=>k})}var $t="top",te="bottom",ee="right",qt="left",fs="auto",mr=[$t,te,ee,qt],In="start",vr="end",Zh="clippingParents",Sc="viewport",gr="popper",tm="reference",xc=mr.reduce(function(n,t){return n.concat([t+"-"+In,t+"-"+vr])},[]),Mc=[].concat(mr,[fs]).reduce(function(n,t){return n.concat([t,t+"-"+In,t+"-"+vr])},[]),em="beforeRead",nm="read",rm="afterRead",om="beforeMain",im="main",sm="afterMain",am="beforeWrite",lm="write",cm="afterWrite",um=[em,nm,rm,om,im,sm,am,lm,cm];function ve(n){return n?(n.nodeName||"").toLowerCase():null}function ce(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function Bn(n){var t=ce(n).Element;return n instanceof t||n instanceof Element}function ne(n){var t=ce(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function Cc(n){if(typeof ShadowRoot=="undefined")return!1;var t=ce(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function fm(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},o=t.attributes[e]||{},i=t.elements[e];!ne(i)||!ve(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function pm(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:e[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!ne(o)||!ve(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}var Ec={name:"applyStyles",enabled:!0,phase:"write",fn:fm,effect:pm,requires:["computeStyles"]};function ge(n){return n.split("-")[0]}var un=Math.max,ho=Math.min,Pn=Math.round;function zn(n,t){t===void 0&&(t=!1);var e=n.getBoundingClientRect(),r=1,o=1;if(ne(n)&&t){var i=n.offsetHeight,s=n.offsetWidth;s>0&&(r=Pn(e.width)/s||1),i>0&&(o=Pn(e.height)/i||1)}return{width:e.width/r,height:e.height/o,top:e.top/o,right:e.right/r,bottom:e.bottom/o,left:e.left/r,x:e.left/r,y:e.top/o}}function ps(n){var t=zn(n),e=n.offsetWidth,r=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:r}}function Nc(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&Cc(e)){var r=t;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ye(n){return ce(n).getComputedStyle(n)}function dm(n){return["table","td","th"].indexOf(ve(n))>=0}function Ke(n){return((Bn(n)?n.ownerDocument:n.document)||window.document).documentElement}function mo(n){return ve(n)==="html"?n:n.assignedSlot||n.parentNode||(Cc(n)?n.host:null)||Ke(n)}function Oc(n){return!ne(n)||ye(n).position==="fixed"?null:n.offsetParent}function hm(n){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,e=navigator.userAgent.indexOf("Trident")!==-1;if(e&&ne(n)){var r=ye(n);if(r.position==="fixed")return null}for(var o=mo(n);ne(o)&&["html","body"].indexOf(ve(o))<0;){var i=ye(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function yr(n){for(var t=ce(n),e=Oc(n);e&&dm(e)&&ye(e).position==="static";)e=Oc(e);return e&&(ve(e)==="html"||ve(e)==="body"&&ye(e).position==="static")?t:e||hm(n)||t}function ds(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function br(n,t,e){return un(n,ho(t,e))}function mm(n,t,e){var r=br(n,t,e);return r>e?e:r}function Tc(){return{top:0,right:0,bottom:0,left:0}}function Ac(n){return Object.assign({},Tc(),n)}function _c(n,t){return t.reduce(function(e,r){return e[r]=n,e},{})}var vm=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ac(typeof t!="number"?t:_c(t,mr))};function gm(n){var t,e=n.state,r=n.name,o=n.options,i=e.elements.arrow,s=e.modifiersData.popperOffsets,a=ge(e.placement),l=ds(a),c=[qt,ee].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var p=vm(o.padding,e),d=ps(i),h=l==="y"?$t:qt,m=l==="y"?te:ee,g=e.rects.reference[u]+e.rects.reference[l]-s[l]-e.rects.popper[u],y=s[l]-e.rects.reference[l],k=yr(i),b=k?l==="y"?k.clientHeight||0:k.clientWidth||0:0,O=g/2-y/2,v=p[h],E=b-d[u]-p[m],M=b/2-d[u]/2+O,_=br(v,M,E),V=l;e.modifiersData[r]=(t={},t[V]=_,t.centerOffset=_-M,t)}}function ym(n){var t=n.state,e=n.options,r=e.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||!Nc(t.elements.popper,o)||(t.elements.arrow=o))}var bm={name:"arrow",enabled:!0,phase:"main",fn:gm,effect:ym,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ln(n){return n.split("-")[1]}var km={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wm(n){var t=n.x,e=n.y,r=window,o=r.devicePixelRatio||1;return{x:Pn(t*o)/o||0,y:Pn(e*o)/o||0}}function Dc(n){var t,e=n.popper,r=n.popperRect,o=n.placement,i=n.variation,s=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,p=n.isFixed,d=u===!0?wm(s):typeof u=="function"?u(s):s,h=d.x,m=h===void 0?0:h,g=d.y,y=g===void 0?0:g,k=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),O=qt,v=$t,E=window;if(c){var M=yr(e),_="clientHeight",V="clientWidth";if(M===ce(e)&&(M=Ke(e),ye(M).position!=="static"&&a==="absolute"&&(_="scrollHeight",V="scrollWidth")),M=M,o===$t||(o===qt||o===ee)&&i===vr){v=te;var L=p&&E.visualViewport?E.visualViewport.height:M[_];y-=L-r.height,y*=l?1:-1}if(o===qt||(o===$t||o===te)&&i===vr){O=ee;var z=p&&E.visualViewport?E.visualViewport.width:M[V];m-=z-r.width,m*=l?1:-1}}var Z=Object.assign({position:a},c&&km);if(l){var U;return Object.assign({},Z,(U={},U[v]=b?"0":"",U[O]=k?"0":"",U.transform=(E.devicePixelRatio||1)<=1?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",U))}return Object.assign({},Z,(t={},t[v]=b?y+"px":"",t[O]=k?m+"px":"",t.transform="",t))}function Sm(n){var t=n.state,e=n.options,r=e.gpuAcceleration,o=r===void 0?!0:r,i=e.adaptive,s=i===void 0?!0:i,a=e.roundOffsets,l=a===void 0?!0:a,c={placement:ge(t.placement),variation:Ln(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Dc(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Dc(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var xm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Sm,data:{}},vo={passive:!0};function Mm(n){var t=n.state,e=n.instance,r=n.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=ce(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",e.update,vo)}),a&&l.addEventListener("resize",e.update,vo),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",e.update,vo)}),a&&l.removeEventListener("resize",e.update,vo)}}var Cm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Mm,data:{}},Em={left:"right",right:"left",bottom:"top",top:"bottom"};function go(n){return n.replace(/left|right|bottom|top/g,function(t){return Em[t]})}var Nm={start:"end",end:"start"};function Rc(n){return n.replace(/start|end/g,function(t){return Nm[t]})}function hs(n){var t=ce(n),e=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:e,scrollTop:r}}function ms(n){return zn(Ke(n)).left+hs(n).scrollLeft}function Om(n){var t=ce(n),e=Ke(n),r=t.visualViewport,o=e.clientWidth,i=e.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+ms(n),y:a}}function Tm(n){var t,e=Ke(n),r=hs(n),o=(t=n.ownerDocument)==null?void 0:t.body,i=un(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=un(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+ms(n),l=-r.scrollTop;return ye(o||e).direction==="rtl"&&(a+=un(e.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function vs(n){var t=ye(n),e=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+o+r)}function Vc(n){return["html","body","#document"].indexOf(ve(n))>=0?n.ownerDocument.body:ne(n)&&vs(n)?n:Vc(mo(n))}function kr(n,t){var e;t===void 0&&(t=[]);var r=Vc(n),o=r===((e=n.ownerDocument)==null?void 0:e.body),i=ce(r),s=o?[i].concat(i.visualViewport||[],vs(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(kr(mo(s)))}function gs(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function Am(n){var t=zn(n);return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Ic(n,t){return t===Sc?gs(Om(n)):Bn(t)?Am(t):gs(Tm(Ke(n)))}function _m(n){var t=kr(mo(n)),e=["absolute","fixed"].indexOf(ye(n).position)>=0,r=e&&ne(n)?yr(n):n;return Bn(r)?t.filter(function(o){return Bn(o)&&Nc(o,r)&&ve(o)!=="body"&&(e?ye(o).position!=="static":!0)}):[]}function Dm(n,t,e){var r=t==="clippingParents"?_m(n):[].concat(t),o=[].concat(r,[e]),i=o[0],s=o.reduce(function(a,l){var c=Ic(n,l);return a.top=un(c.top,a.top),a.right=ho(c.right,a.right),a.bottom=ho(c.bottom,a.bottom),a.left=un(c.left,a.left),a},Ic(n,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Bc(n){var t=n.reference,e=n.element,r=n.placement,o=r?ge(r):null,i=r?Ln(r):null,s=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(o){case $t:l={x:s,y:t.y-e.height};break;case te:l={x:s,y:t.y+t.height};break;case ee:l={x:t.x+t.width,y:a};break;case qt:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?ds(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case In:l[c]=l[c]-(t[u]/2-e[u]/2);break;case vr:l[c]=l[c]+(t[u]/2-e[u]/2);break}}return l}function wr(n,t){t===void 0&&(t={});var e=t,r=e.placement,o=r===void 0?n.placement:r,i=e.boundary,s=i===void 0?Zh:i,a=e.rootBoundary,l=a===void 0?Sc:a,c=e.elementContext,u=c===void 0?gr:c,p=e.altBoundary,d=p===void 0?!1:p,h=e.padding,m=h===void 0?0:h,g=Ac(typeof m!="number"?m:_c(m,mr)),y=u===gr?tm:gr,k=n.rects.popper,b=n.elements[d?y:u],O=Dm(Bn(b)?b:b.contextElement||Ke(n.elements.popper),s,l),v=zn(n.elements.reference),E=Bc({reference:v,element:k,strategy:"absolute",placement:o}),M=gs(Object.assign({},k,E)),_=u===gr?M:v,V={top:O.top-_.top+g.top,bottom:_.bottom-O.bottom+g.bottom,left:O.left-_.left+g.left,right:_.right-O.right+g.right},L=n.modifiersData.offset;if(u===gr&&L){var z=L[o];Object.keys(V).forEach(function(Z){var U=[ee,te].indexOf(Z)>=0?1:-1,st=[$t,te].indexOf(Z)>=0?"y":"x";V[Z]+=z[st]*U})}return V}function Rm(n,t){t===void 0&&(t={});var e=t,r=e.placement,o=e.boundary,i=e.rootBoundary,s=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,c=l===void 0?Mc:l,u=Ln(r),p=u?a?xc:xc.filter(function(m){return Ln(m)===u}):mr,d=p.filter(function(m){return c.indexOf(m)>=0});d.length===0&&(d=p);var h=d.reduce(function(m,g){return m[g]=wr(n,{placement:g,boundary:o,rootBoundary:i,padding:s})[ge(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function Vm(n){if(ge(n)===fs)return[];var t=go(n);return[Rc(n),t,Rc(t)]}function Im(n){var t=n.state,e=n.options,r=n.name;if(!t.modifiersData[r]._skip){for(var o=e.mainAxis,i=o===void 0?!0:o,s=e.altAxis,a=s===void 0?!0:s,l=e.fallbackPlacements,c=e.padding,u=e.boundary,p=e.rootBoundary,d=e.altBoundary,h=e.flipVariations,m=h===void 0?!0:h,g=e.allowedAutoPlacements,y=t.options.placement,k=ge(y),b=k===y,O=l||(b||!m?[go(y)]:Vm(y)),v=[y].concat(O).reduce(function(De,pe){return De.concat(ge(pe)===fs?Rm(t,{placement:pe,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:g}):pe)},[]),E=t.rects.reference,M=t.rects.popper,_=new Map,V=!0,L=v[0],z=0;z=0,tt=At?"width":"height",q=wr(t,{placement:Z,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),ut=At?st?ee:qt:st?te:$t;E[tt]>M[tt]&&(ut=go(ut));var Mt=go(ut),xe=[];if(i&&xe.push(q[U]<=0),a&&xe.push(q[ut]<=0,q[Mt]<=0),xe.every(function(De){return De})){L=Z,V=!1;break}_.set(Z,xe)}if(V)for(var Me=m?3:1,vn=function(pe){var Re=v.find(function(Kn){var Ve=_.get(Kn);if(Ve)return Ve.slice(0,pe).every(function(Un){return Un})});if(Re)return L=Re,"break"},Ce=Me;Ce>0;Ce--){var gn=vn(Ce);if(gn==="break")break}t.placement!==L&&(t.modifiersData[r]._skip=!0,t.placement=L,t.reset=!0)}}var Bm={name:"flip",enabled:!0,phase:"main",fn:Im,requiresIfExists:["offset"],data:{_skip:!1}};function Pc(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function zc(n){return[$t,ee,te,qt].some(function(t){return n[t]>=0})}function Pm(n){var t=n.state,e=n.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=wr(t,{elementContext:"reference"}),a=wr(t,{altBoundary:!0}),l=Pc(s,r),c=Pc(a,o,i),u=zc(l),p=zc(c);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}var zm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Pm};function Lm(n,t,e){var r=ge(n),o=[qt,$t].indexOf(r)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[qt,ee].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Fm(n){var t=n.state,e=n.options,r=n.name,o=e.offset,i=o===void 0?[0,0]:o,s=Mc.reduce(function(u,p){return u[p]=Lm(p,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}var Hm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Fm};function Jm(n){var t=n.state,e=n.name;t.modifiersData[e]=Bc({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var $m={name:"popperOffsets",enabled:!0,phase:"read",fn:Jm,data:{}};function qm(n){return n==="x"?"y":"x"}function jm(n){var t=n.state,e=n.options,r=n.name,o=e.mainAxis,i=o===void 0?!0:o,s=e.altAxis,a=s===void 0?!1:s,l=e.boundary,c=e.rootBoundary,u=e.altBoundary,p=e.padding,d=e.tether,h=d===void 0?!0:d,m=e.tetherOffset,g=m===void 0?0:m,y=wr(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),k=ge(t.placement),b=Ln(t.placement),O=!b,v=ds(k),E=qm(v),M=t.modifiersData.popperOffsets,_=t.rects.reference,V=t.rects.popper,L=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,z=typeof L=="number"?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),Z=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,U={x:0,y:0};if(!!M){if(i){var st,At=v==="y"?$t:qt,tt=v==="y"?te:ee,q=v==="y"?"height":"width",ut=M[v],Mt=ut+y[At],xe=ut-y[tt],Me=h?-V[q]/2:0,vn=b===In?_[q]:V[q],Ce=b===In?-V[q]:-_[q],gn=t.elements.arrow,De=h&&gn?ps(gn):{width:0,height:0},pe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Tc(),Re=pe[At],Kn=pe[tt],Ve=br(0,_[q],De[q]),Un=O?_[q]/2-Me-Ve-Re-z.mainAxis:vn-Ve-Re-z.mainAxis,Qe=O?-_[q]/2+Me+Ve+Kn+z.mainAxis:Ce+Ve+Kn+z.mainAxis,Gn=t.elements.arrow&&yr(t.elements.arrow),Bo=Gn?v==="y"?Gn.clientTop||0:Gn.clientLeft||0:0,Vr=(st=Z==null?void 0:Z[v])!=null?st:0,Po=ut+Un-Vr-Bo,zo=ut+Qe-Vr,Ir=br(h?ho(Mt,Po):Mt,ut,h?un(xe,zo):xe);M[v]=Ir,U[v]=Ir-ut}if(a){var Br,Lo=v==="x"?$t:qt,Fo=v==="x"?te:ee,Ie=M[E],Ze=E==="y"?"height":"width",Pr=Ie+y[Lo],yn=Ie-y[Fo],zr=[$t,qt].indexOf(k)!==-1,Ho=(Br=Z==null?void 0:Z[E])!=null?Br:0,Jo=zr?Pr:Ie-_[Ze]-V[Ze]-Ho+z.altAxis,$o=zr?Ie+_[Ze]+V[Ze]-Ho-z.altAxis:yn,qo=h&&zr?mm(Jo,Ie,$o):br(h?Jo:Pr,Ie,h?$o:yn);M[E]=qo,U[E]=qo-Ie}t.modifiersData[r]=U}}var Wm={name:"preventOverflow",enabled:!0,phase:"main",fn:jm,requiresIfExists:["offset"]};function Km(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Um(n){return n===ce(n)||!ne(n)?hs(n):Km(n)}function Gm(n){var t=n.getBoundingClientRect(),e=Pn(t.width)/n.offsetWidth||1,r=Pn(t.height)/n.offsetHeight||1;return e!==1||r!==1}function Ym(n,t,e){e===void 0&&(e=!1);var r=ne(t),o=ne(t)&&Gm(t),i=Ke(t),s=zn(n,o),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!e)&&((ve(t)!=="body"||vs(i))&&(a=Um(t)),ne(t)?(l=zn(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=ms(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Xm(n){var t=new Map,e=new Set,r=[];n.forEach(function(i){t.set(i.name,i)});function o(i){e.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return n.forEach(function(i){e.has(i.name)||o(i)}),r}function Qm(n){var t=Xm(n);return um.reduce(function(e,r){return e.concat(t.filter(function(o){return o.phase===r}))},[])}function Zm(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function tv(n){var t=n.reduce(function(e,r){var o=e[r.name];return e[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,e},{});return Object.keys(t).map(function(e){return t[e]})}var Lc={placement:"bottom",modifiers:[],strategy:"absolute"};function Fc(){for(var n=arguments.length,t=new Array(n),e=0;e-1}function jc(n,t){return typeof n=="function"?n.apply(void 0,t):n}function Wc(n,t){if(t===0)return n;var e;return function(r){clearTimeout(e),e=setTimeout(function(){n(r)},t)}}function sv(n){return n.split(/\s+/).filter(Boolean)}function Fn(n){return[].concat(n)}function Kc(n,t){n.indexOf(t)===-1&&n.push(t)}function av(n){return n.filter(function(t,e){return n.indexOf(t)===e})}function lv(n){return n.split("-")[0]}function yo(n){return[].slice.call(n)}function Uc(n){return Object.keys(n).reduce(function(t,e){return n[e]!==void 0&&(t[e]=n[e]),t},{})}function Sr(){return document.createElement("div")}function bo(n){return["Element","Fragment"].some(function(t){return bs(n,t)})}function cv(n){return bs(n,"NodeList")}function uv(n){return bs(n,"MouseEvent")}function fv(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function pv(n){return bo(n)?[n]:cv(n)?yo(n):Array.isArray(n)?n:yo(document.querySelectorAll(n))}function ks(n,t){n.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function Gc(n,t){n.forEach(function(e){e&&e.setAttribute("data-state",t)})}function dv(n){var t,e=Fn(n),r=e[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function hv(n,t){var e=t.clientX,r=t.clientY;return n.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=lv(s.placement),u=s.modifiersData.offset;if(!u)return!0;var p=c==="bottom"?u.top.y:0,d=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,m=c==="left"?u.right.x:0,g=i.top-r+p>l,y=r-i.bottom-d>l,k=i.left-e+h>l,b=e-i.right-m>l;return g||y||k||b})}function ws(n,t,e){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){n[r](o,e)})}function Yc(n,t){for(var e=t;e;){var r;if(n.contains(e))return!0;e=e.getRootNode==null||(r=e.getRootNode())==null?void 0:r.host}return!1}var be={isTouch:!1},Xc=0;function mv(){be.isTouch||(be.isTouch=!0,window.performance&&document.addEventListener("mousemove",Qc))}function Qc(){var n=performance.now();n-Xc<20&&(be.isTouch=!1,document.removeEventListener("mousemove",Qc)),Xc=n}function vv(){var n=document.activeElement;if(fv(n)){var t=n._tippy;n.blur&&!t.state.isVisible&&n.blur()}}function gv(){document.addEventListener("touchstart",mv,fn),window.addEventListener("blur",vv)}var yv=typeof window!="undefined"&&typeof document!="undefined",bv=yv?!!window.msCrypto:!1,kv={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},wv={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ue=Object.assign({appendTo:qc,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},kv,wv),Sv=Object.keys(ue),xv=function(t){var e=Object.keys(t);e.forEach(function(r){ue[r]=t[r]})};function Zc(n){var t=n.plugins||[],e=t.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var a;r[i]=n[i]!==void 0?n[i]:(a=ue[i])!=null?a:s}return r},{});return Object.assign({},n,e)}function Mv(n,t){var e=t?Object.keys(Zc(Object.assign({},ue,{plugins:t}))):Sv,r=e.reduce(function(o,i){var s=(n.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function tu(n,t){var e=Object.assign({},t,{content:jc(t.content,[n])},t.ignoreAttributes?{}:Mv(n,t.plugins));return e.aria=Object.assign({},ue.aria,e.aria),e.aria={expanded:e.aria.expanded==="auto"?t.interactive:e.aria.expanded,content:e.aria.content==="auto"?t.interactive?null:"describedby":e.aria.content},e}var Cv=function(){return"innerHTML"};function Ss(n,t){n[Cv()]=t}function eu(n){var t=Sr();return n===!0?t.className=Jc:(t.className=$c,bo(n)?t.appendChild(n):Ss(t,n)),t}function nu(n,t){bo(t.content)?(Ss(n,""),n.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Ss(n,t.content):n.textContent=t.content)}function xs(n){var t=n.firstElementChild,e=yo(t.children);return{box:t,content:e.find(function(r){return r.classList.contains(Hc)}),arrow:e.find(function(r){return r.classList.contains(Jc)||r.classList.contains($c)}),backdrop:e.find(function(r){return r.classList.contains(iv)})}}function ru(n){var t=Sr(),e=Sr();e.className=ov,e.setAttribute("data-state","hidden"),e.setAttribute("tabindex","-1");var r=Sr();r.className=Hc,r.setAttribute("data-state","hidden"),nu(r,n.props),t.appendChild(e),e.appendChild(r),o(n.props,n.props);function o(i,s){var a=xs(t),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&nu(c,n.props),s.arrow?u?i.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(eu(s.arrow))):l.appendChild(eu(s.arrow)):u&&l.removeChild(u)}return{popper:t,onUpdate:o}}ru.$$tippy=!0;var Ev=1,ko=[],Ms=[];function Nv(n,t){var e=tu(n,Object.assign({},ue,Zc(Uc(t)))),r,o,i,s=!1,a=!1,l=!1,c=!1,u,p,d,h=[],m=Wc(Po,e.interactiveDebounce),g,y=Ev++,k=null,b=av(e.plugins),O={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:y,reference:n,popper:Sr(),popperInstance:k,props:e,state:O,plugins:b,clearDelayTimeouts:Jo,setProps:$o,setContent:qo,show:a1,hide:l1,hideWithInteractivity:c1,enable:zr,disable:Ho,unmount:u1,destroy:f1};if(!e.render)return v;var E=e.render(v),M=E.popper,_=E.onUpdate;M.setAttribute("data-tippy-root",""),M.id="tippy-"+v.id,v.popper=M,n._tippy=v,M._tippy=v;var V=b.map(function(w){return w.fn(v)}),L=n.hasAttribute("aria-expanded");return Gn(),Me(),ut(),Mt("onCreate",[v]),e.showOnCreate&&Pr(),M.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),M.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&At().addEventListener("mousemove",m)}),v;function z(){var w=v.props.touch;return Array.isArray(w)?w:[w,0]}function Z(){return z()[0]==="hold"}function U(){var w;return!!((w=v.props.render)!=null&&w.$$tippy)}function st(){return g||n}function At(){var w=st().parentNode;return w?dv(w):document}function tt(){return xs(M)}function q(w){return v.state.isMounted&&!v.state.isVisible||be.isTouch||u&&u.type==="focus"?0:ys(v.props.delay,w?0:1,ue.delay)}function ut(w){w===void 0&&(w=!1),M.style.pointerEvents=v.props.interactive&&!w?"":"none",M.style.zIndex=""+v.props.zIndex}function Mt(w,D,I){if(I===void 0&&(I=!0),V.forEach(function(G){G[w]&&G[w].apply(G,D)}),I){var Y;(Y=v.props)[w].apply(Y,D)}}function xe(){var w=v.props.aria;if(!!w.content){var D="aria-"+w.content,I=M.id,Y=Fn(v.props.triggerTarget||n);Y.forEach(function(G){var zt=G.getAttribute(D);if(v.state.isVisible)G.setAttribute(D,zt?zt+" "+I:I);else{var oe=zt&&zt.replace(I,"").trim();oe?G.setAttribute(D,oe):G.removeAttribute(D)}})}}function Me(){if(!(L||!v.props.aria.expanded)){var w=Fn(v.props.triggerTarget||n);w.forEach(function(D){v.props.interactive?D.setAttribute("aria-expanded",v.state.isVisible&&D===st()?"true":"false"):D.removeAttribute("aria-expanded")})}}function vn(){At().removeEventListener("mousemove",m),ko=ko.filter(function(w){return w!==m})}function Ce(w){if(!(be.isTouch&&(l||w.type==="mousedown"))){var D=w.composedPath&&w.composedPath()[0]||w.target;if(!(v.props.interactive&&Yc(M,D))){if(Fn(v.props.triggerTarget||n).some(function(I){return Yc(I,D)})){if(be.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else Mt("onClickOutside",[v,w]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||Re())}}}function gn(){l=!0}function De(){l=!1}function pe(){var w=At();w.addEventListener("mousedown",Ce,!0),w.addEventListener("touchend",Ce,fn),w.addEventListener("touchstart",De,fn),w.addEventListener("touchmove",gn,fn)}function Re(){var w=At();w.removeEventListener("mousedown",Ce,!0),w.removeEventListener("touchend",Ce,fn),w.removeEventListener("touchstart",De,fn),w.removeEventListener("touchmove",gn,fn)}function Kn(w,D){Un(w,function(){!v.state.isVisible&&M.parentNode&&M.parentNode.contains(M)&&D()})}function Ve(w,D){Un(w,D)}function Un(w,D){var I=tt().box;function Y(G){G.target===I&&(ws(I,"remove",Y),D())}if(w===0)return D();ws(I,"remove",p),ws(I,"add",Y),p=Y}function Qe(w,D,I){I===void 0&&(I=!1);var Y=Fn(v.props.triggerTarget||n);Y.forEach(function(G){G.addEventListener(w,D,I),h.push({node:G,eventType:w,handler:D,options:I})})}function Gn(){Z()&&(Qe("touchstart",Vr,{passive:!0}),Qe("touchend",zo,{passive:!0})),sv(v.props.trigger).forEach(function(w){if(w!=="manual")switch(Qe(w,Vr),w){case"mouseenter":Qe("mouseleave",zo);break;case"focus":Qe(bv?"focusout":"blur",Ir);break;case"focusin":Qe("focusout",Ir);break}})}function Bo(){h.forEach(function(w){var D=w.node,I=w.eventType,Y=w.handler,G=w.options;D.removeEventListener(I,Y,G)}),h=[]}function Vr(w){var D,I=!1;if(!(!v.state.isEnabled||Br(w)||a)){var Y=((D=u)==null?void 0:D.type)==="focus";u=w,g=w.currentTarget,Me(),!v.state.isVisible&&uv(w)&&ko.forEach(function(G){return G(w)}),w.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||s)&&v.props.hideOnClick!==!1&&v.state.isVisible?I=!0:Pr(w),w.type==="click"&&(s=!I),I&&!Y&&yn(w)}}function Po(w){var D=w.target,I=st().contains(D)||M.contains(D);if(!(w.type==="mousemove"&&I)){var Y=Ze().concat(M).map(function(G){var zt,oe=G._tippy,Yn=(zt=oe.popperInstance)==null?void 0:zt.state;return Yn?{popperRect:G.getBoundingClientRect(),popperState:Yn,props:e}:null}).filter(Boolean);hv(Y,w)&&(vn(),yn(w))}}function zo(w){var D=Br(w)||v.props.trigger.indexOf("click")>=0&&s;if(!D){if(v.props.interactive){v.hideWithInteractivity(w);return}yn(w)}}function Ir(w){v.props.trigger.indexOf("focusin")<0&&w.target!==st()||v.props.interactive&&w.relatedTarget&&M.contains(w.relatedTarget)||yn(w)}function Br(w){return be.isTouch?Z()!==w.type.indexOf("touch")>=0:!1}function Lo(){Fo();var w=v.props,D=w.popperOptions,I=w.placement,Y=w.offset,G=w.getReferenceClientRect,zt=w.moveTransition,oe=U()?xs(M).arrow:null,Yn=G?{getBoundingClientRect:G,contextElement:G.contextElement||st()}:n,Zu={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(jo){var Xn=jo.state;if(U()){var p1=tt(),Us=p1.box;["placement","reference-hidden","escaped"].forEach(function(Wo){Wo==="placement"?Us.setAttribute("data-placement",Xn.placement):Xn.attributes.popper["data-popper-"+Wo]?Us.setAttribute("data-"+Wo,""):Us.removeAttribute("data-"+Wo)}),Xn.attributes.popper={}}}},bn=[{name:"offset",options:{offset:Y}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!zt}},Zu];U()&&oe&&bn.push({name:"arrow",options:{element:oe,padding:3}}),bn.push.apply(bn,(D==null?void 0:D.modifiers)||[]),v.popperInstance=rv(Yn,M,Object.assign({},D,{placement:I,onFirstUpdate:d,modifiers:bn}))}function Fo(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Ie(){var w=v.props.appendTo,D,I=st();v.props.interactive&&w===qc||w==="parent"?D=I.parentNode:D=jc(w,[I]),D.contains(M)||D.appendChild(M),v.state.isMounted=!0,Lo()}function Ze(){return yo(M.querySelectorAll("[data-tippy-root]"))}function Pr(w){v.clearDelayTimeouts(),w&&Mt("onTrigger",[v,w]),pe();var D=q(!0),I=z(),Y=I[0],G=I[1];be.isTouch&&Y==="hold"&&G&&(D=G),D?r=setTimeout(function(){v.show()},D):v.show()}function yn(w){if(v.clearDelayTimeouts(),Mt("onUntrigger",[v,w]),!v.state.isVisible){Re();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(w.type)>=0&&s)){var D=q(!1);D?o=setTimeout(function(){v.state.isVisible&&v.hide()},D):i=requestAnimationFrame(function(){v.hide()})}}function zr(){v.state.isEnabled=!0}function Ho(){v.hide(),v.state.isEnabled=!1}function Jo(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function $o(w){if(!v.state.isDestroyed){Mt("onBeforeUpdate",[v,w]),Bo();var D=v.props,I=tu(n,Object.assign({},D,Uc(w),{ignoreAttributes:!0}));v.props=I,Gn(),D.interactiveDebounce!==I.interactiveDebounce&&(vn(),m=Wc(Po,I.interactiveDebounce)),D.triggerTarget&&!I.triggerTarget?Fn(D.triggerTarget).forEach(function(Y){Y.removeAttribute("aria-expanded")}):I.triggerTarget&&n.removeAttribute("aria-expanded"),Me(),ut(),_&&_(D,I),v.popperInstance&&(Lo(),Ze().forEach(function(Y){requestAnimationFrame(Y._tippy.popperInstance.forceUpdate)})),Mt("onAfterUpdate",[v,w])}}function qo(w){v.setProps({content:w})}function a1(){var w=v.state.isVisible,D=v.state.isDestroyed,I=!v.state.isEnabled,Y=be.isTouch&&!v.props.touch,G=ys(v.props.duration,0,ue.duration);if(!(w||D||I||Y)&&!st().hasAttribute("disabled")&&(Mt("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,U()&&(M.style.visibility="visible"),ut(),pe(),v.state.isMounted||(M.style.transition="none"),U()){var zt=tt(),oe=zt.box,Yn=zt.content;ks([oe,Yn],0)}d=function(){var bn;if(!(!v.state.isVisible||c)){if(c=!0,M.offsetHeight,M.style.transition=v.props.moveTransition,U()&&v.props.animation){var Ks=tt(),jo=Ks.box,Xn=Ks.content;ks([jo,Xn],G),Gc([jo,Xn],"visible")}xe(),Me(),Kc(Ms,v),(bn=v.popperInstance)==null||bn.forceUpdate(),Mt("onMount",[v]),v.props.animation&&U()&&Ve(G,function(){v.state.isShown=!0,Mt("onShown",[v])})}},Ie()}}function l1(){var w=!v.state.isVisible,D=v.state.isDestroyed,I=!v.state.isEnabled,Y=ys(v.props.duration,1,ue.duration);if(!(w||D||I)&&(Mt("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,c=!1,s=!1,U()&&(M.style.visibility="hidden"),vn(),Re(),ut(!0),U()){var G=tt(),zt=G.box,oe=G.content;v.props.animation&&(ks([zt,oe],Y),Gc([zt,oe],"hidden"))}xe(),Me(),v.props.animation?U()&&Kn(Y,v.unmount):v.unmount()}}function c1(w){At().addEventListener("mousemove",m),Kc(ko,m),m(w)}function u1(){v.state.isVisible&&v.hide(),!!v.state.isMounted&&(Fo(),Ze().forEach(function(w){w._tippy.unmount()}),M.parentNode&&M.parentNode.removeChild(M),Ms=Ms.filter(function(w){return w!==v}),v.state.isMounted=!1,Mt("onHidden",[v]))}function f1(){v.state.isDestroyed||(v.clearDelayTimeouts(),v.unmount(),Bo(),delete n._tippy,v.state.isDestroyed=!0,Mt("onDestroy",[v]))}}function Hn(n,t){t===void 0&&(t={});var e=ue.plugins.concat(t.plugins||[]);gv();var r=Object.assign({},t,{plugins:e}),o=pv(n),i=o.reduce(function(s,a){var l=a&&Nv(a,r);return l&&s.push(l),s},[]);return bo(n)?i[0]:i}Hn.defaultProps=ue,Hn.setDefaultProps=xv,Hn.currentInput=be,Object.assign({},Ec,{effect:function(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow)}}),Hn.setDefaultProps({render:ru});class Ov{constructor({editor:t,element:e,view:r,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s,from:a,to:l})=>{const{doc:c,selection:u}=s,{empty:p}=u,d=!c.textBetween(a,l).length&&ac(s.selection);return!(p||d)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}(s==null?void 0:s.relatedTarget)&&((a=this.element.parentNode)===null||a===void 0?void 0:a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=r,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;this.tippy||!e||(this.tippy=Hn(t,x({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},this.tippyOptions)))}update(t,e){var r,o;const{state:i,composing:s}=t,{doc:a,selection:l}=i,c=e&&e.doc.eq(a)&&e.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:u}=l,p=Math.min(...u.map(m=>m.$from.pos)),d=Math.max(...u.map(m=>m.$to.pos));if(!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:t,state:i,oldState:e,from:p,to:d}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:()=>{if(Qh(i.selection)){const m=t.nodeDOM(p);if(m)return m.getBoundingClientRect()}return wc(t,p,d)}}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const ou=n=>new Ht({key:typeof n.pluginKey=="string"?new se(n.pluginKey):n.pluginKey,view:t=>new Ov(x({view:t},n))});bt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ou({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Tv{constructor({editor:t,element:e,view:r,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s})=>{const{selection:a}=s,{$anchor:l,empty:c}=a,u=l.depth===1,p=l.parent.isTextblock&&!l.parent.type.spec.code&&!l.parent.textContent;return!(!c||!u||!p)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}(s==null?void 0:s.relatedTarget)&&((a=this.element.parentNode)===null||a===void 0?void 0:a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=r,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;this.tippy||!e||(this.tippy=Hn(t,x({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},this.tippyOptions)))}update(t,e){var r,o;const{state:i}=t,{doc:s,selection:a}=i,{from:l,to:c}=a;if(e&&e.doc.eq(s)&&e.selection.eq(a))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:t,state:i,oldState:e}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:()=>wc(t,l,c)}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const iu=n=>new Ht({key:typeof n.pluginKey=="string"?new se(n.pluginKey):n.pluginKey,view:t=>new Tv(x({view:t},n))});bt.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[iu({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const Av=f.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:null,default:"bubbleMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:t}){const e=f.ref(null);return f.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:i,shouldShow:s}=n;o.registerPlugin(ou({pluginKey:r,editor:o,element:e.value,tippyOptions:i,shouldShow:s}))}),f.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=n;o.unregisterPlugin(r)}),()=>{var r;return f.h("div",{ref:e},(r=t.default)===null||r===void 0?void 0:r.call(t))}}});function su(n){return f.customRef((t,e)=>({get(){return t(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e()})})}}))}class _v extends Xh{constructor(t={}){super(t);return this.vueRenderers=f.reactive(new Map),this.contentComponent=null,this.reactiveState=su(this.view.state),this.reactiveExtensionStorage=su(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),f.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){super.registerPlugin(t,e),this.reactiveState.value=this.view.state}unregisterPlugin(t){super.unregisterPlugin(t),this.reactiveState.value=this.view.state}}const Dv=f.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const t=f.ref(),e=f.getCurrentInstance();return f.watchEffect(()=>{const r=n.editor;r&&r.options.element&&t.value&&f.nextTick(()=>{if(!t.value||!r.options.element.firstChild)return;const o=f.unref(t.value);t.value.append(...r.options.element.childNodes),r.contentComponent=e.ctx._,r.setOptions({element:o}),r.createNodeViews()})}),f.onBeforeUnmount(()=>{const r=n.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const o=document.createElement("div");o.append(...r.options.element.childNodes),r.setOptions({element:o})}),{rootEl:t}},render(){const n=[];return this.editor&&this.editor.vueRenderers.forEach(t=>{const e=f.h(f.Teleport,{to:t.teleportElement,key:t.id},f.h(t.component,x({ref:t.id},t.props)));n.push(e)}),f.h("div",{ref:t=>{this.rootEl=t}},...n)}});f.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:t}){const e=f.ref(null);return f.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:i,shouldShow:s}=n;o.registerPlugin(iu({pluginKey:r,editor:o,element:e.value,tippyOptions:i,shouldShow:s}))}),f.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=n;o.unregisterPlugin(r)}),()=>{var r;return f.h("div",{ref:e},(r=t.default)===null||r===void 0?void 0:r.call(t))}}}),f.defineComponent({props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,t;return f.h(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(t=(n=this.$slots).default)===null||t===void 0?void 0:t.call(n))}}),f.defineComponent({props:{as:{type:String,default:"div"}},render(){return f.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const Rv=/^```(?[a-z]*)?[\s\n]$/,Vv=/^~~~(?[a-z]*)?[\s\n]$/,Iv=kt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var t;const{languageClassPrefix:e}=this.options,i=[...((t=n.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(s=>s.startsWith(e)).map(s=>s.replace(e,""))[0];return i||null},renderHTML:n=>n.language?{class:this.options.languageClassPrefix+n.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:n}){return["pre",this.options.HTMLAttributes,["code",n,0]]},addCommands(){return{setCodeBlock:n=>({commands:t})=>t.setNode(this.name,n),toggleCodeBlock:n=>({commands:t})=>t.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:t}=this.editor.state.selection,e=t.pos===1;return!n||t.parent.type.name!==this.name?!1:e||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{const{state:t}=n,{selection:e}=t,{$from:r,empty:o}=e;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` + +`);return!i||!s?!1:n.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()}}},addInputRules(){return[us({find:Rv,type:this.type,getAttributes:({groups:n})=>n}),us({find:Vv,type:this.type,getAttributes:({groups:n})=>n})]},addProseMirrorPlugins(){return[new Ht({key:new se("codeBlockVSCodeHandler"),props:{handlePaste:(n,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const e=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!e||!i)return!1;const{tr:s}=n.state;return s.replaceSelectionWith(this.type.create({language:i})),s.setSelection(j.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(e.replace(/\r\n?/g,` +`)),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Bv=We.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});function au(n,t,e){for(var r=0;;r++){if(r==n.childCount||r==t.childCount)return n.childCount==t.childCount?null:e;var o=n.child(r),i=t.child(r);if(o==i){e+=o.nodeSize;continue}if(!o.sameMarkup(i))return e;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)e++;return e}if(o.content.size||i.content.size){var a=au(o.content,i.content,e+1);if(a!=null)return a}e+=o.nodeSize}}function lu(n,t,e,r){for(var o=n.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:e,b:r};var s=n.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){e-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:e,b:r};if(s.isText&&s.text!=a.text){for(var c=0,u=Math.min(s.text.length,a.text.length);ct&&r(l,o+a,i,s)!==!1&&l.content.size){var u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,e-u),r,o+u)}a=c}},N.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},N.prototype.textBetween=function(t,e,r,o){var i="",s=!0;return this.nodesBetween(t,e,function(a,l){a.isText?(i+=a.text.slice(Math.max(t,l)-l,e-l),s=!r):a.isLeaf&&o?(i+=typeof o=="function"?o(a):o,s=!r):!s&&a.isBlock&&(i+=r,s=!0)},0),i},N.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(r)&&(o[o.length-1]=e.withText(e.text+r.text),i=1);it)for(var i=0,s=0;st&&((se)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),r.push(a),o+=a.nodeSize),s=l}return new N(r,o)},N.prototype.cutByIndex=function(t,e){return t==e?N.empty:t==0&&e==this.content.length?this:new N(this.content.slice(t,e))},N.prototype.replaceChild=function(t,e){var r=this.content[t];if(r==e)return this;var o=this.content.slice(),i=this.size+e.nodeSize-r.nodeSize;return o[t]=e,new N(o,i)},N.prototype.addToStart=function(t){return new N([t].concat(this.content),this.size+t.nodeSize)},N.prototype.addToEnd=function(t){return new N(this.content.concat(t),this.size+t.nodeSize)},N.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var r=0,o=0;;r++){var i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||e>0?So(r+1,s):So(r,o);o=s}},N.prototype.toString=function(){return"<"+this.toStringInner()+">"},N.prototype.toStringInner=function(){return this.content.join(", ")},N.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null},N.fromJSON=function(t,e){if(!e)return N.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new N(e.map(t.nodeFromJSON))},N.fromArray=function(t){if(!t.length)return N.empty;for(var e,r=0,o=0;othis.type.rank&&(e||(e=t.slice(0,o)),e.push(this),r=!0),e&&e.push(i)}}return e||(e=t.slice()),r||e.push(this),e},W.prototype.removeFromSet=function(t){for(var e=0;e0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},R.fromJSON=function(t,e){if(!e)return R.empty;var r=e.openStart||0,o=e.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new R(N.fromJSON(t,e.content),r,o)},R.maxOpen=function(t,e){e===void 0&&(e=!0);for(var r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)r++;for(var s=t.lastChild;s&&!s.isLeaf&&(e||!s.type.spec.isolating);s=s.lastChild)o++;return new R(t,r,o)},Object.defineProperties(R.prototype,cu);function uu(n,t,e){var r=n.findIndex(t),o=r.index,i=r.offset,s=n.maybeChild(o),a=n.findIndex(e),l=a.index,c=a.offset;if(i==t||s.isText){if(c!=e&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(o!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(o,s.copy(uu(s.content,t-i-1,e-i-1)))}function fu(n,t,e,r){var o=n.findIndex(t),i=o.index,s=o.offset,a=n.maybeChild(i);if(s==t||a.isText)return r&&!r.canReplace(i,i,e)?null:n.cut(0,t).append(e).append(n.cut(t));var l=fu(a.content,t-s-1,e);return l&&n.replaceChild(i,a.copy(l))}R.empty=new R(N.empty,0,0);function Pv(n,t,e){if(e.openStart>n.depth)throw new ke("Inserted content deeper than insertion position");if(n.depth-e.openStart!=t.depth-e.openEnd)throw new ke("Inconsistent open depths");return pu(n,t,e,0)}function pu(n,t,e,r){var o=n.index(r),i=n.node(r);if(o==t.index(r)&&r=0&&n.isText&&n.sameMarkup(t[e])?t[e]=n.withText(t[e].text+n.text):t.push(n)}function xr(n,t,e,r){var o=(t||n).node(e),i=0,s=t?t.index(e):o.childCount;n&&(i=n.index(e),n.depth>e?i++:n.textOffset&&(pn(n.nodeAfter,r),i++));for(var a=i;ao&&Es(n,t,o+1),s=r.depth>o&&Es(e,r,o+1),a=[];return xr(null,n,o,a),i&&s&&t.index(o)==e.index(o)?(du(i,s),pn(dn(i,hu(n,t,e,r,o+1)),a)):(i&&pn(dn(i,Mo(n,t,o+1)),a),xr(t,e,o,a),s&&pn(dn(s,Mo(e,r,o+1)),a)),xr(r,null,o,a),new N(a)}function Mo(n,t,e){var r=[];if(xr(null,n,e,r),n.depth>e){var o=Es(n,t,e+1);pn(dn(o,Mo(n,t,e+1)),r)}return xr(t,null,e,r),new N(r)}function zv(n,t){for(var e=t.depth-n.openStart,r=t.node(e),o=r.copy(n.content),i=e-1;i>=0;i--)o=t.node(i).copy(N.from(o));return{start:o.resolveNoCache(n.openStart+e),end:o.resolveNoCache(o.content.size-n.openEnd-e)}}var rt=function(t,e,r){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=r},Jn={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};rt.prototype.resolveDepth=function(t){return t==null?this.depth:t<0?this.depth+t:t},Jn.parent.get=function(){return this.node(this.depth)},Jn.doc.get=function(){return this.node(0)},rt.prototype.node=function(t){return this.path[this.resolveDepth(t)*3]},rt.prototype.index=function(t){return this.path[this.resolveDepth(t)*3+1]},rt.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)},rt.prototype.start=function(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1},rt.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},rt.prototype.before=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]},rt.prototype.after=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize},Jn.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Jn.nodeAfter.get=function(){var n=this.parent,t=this.index(this.depth);if(t==n.childCount)return null;var e=this.pos-this.path[this.path.length-1],r=n.child(t);return e?n.child(t).cut(e):r},Jn.nodeBefore.get=function(){var n=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(n).cut(0,t):n==0?null:this.parent.child(n-1)},rt.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var r=this.path[e*3],o=e==0?0:this.path[e*3-1]+1,i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},rt.prototype.blockRange=function(t,e){if(t===void 0&&(t=this),t.pos=0;r--)if(t.pos<=this.end(r)&&(!e||e(this.node(r))))return new mu(this,t,r)},rt.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},rt.prototype.max=function(t){return t.pos>this.pos?t:this},rt.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var r=[],o=0,i=e,s=t;;){var a=s.content.findIndex(i),l=a.index,c=a.offset,u=i-c;if(r.push(s,l,o+c),!u||(s=s.child(l),s.isText))break;i=u-1,o+=c+1}return new rt(e,r,i)},rt.resolveCached=function(t,e){for(var r=0;rt&&this.nodesBetween(t,e,function(i){return r.isInSet(i.marks)&&(o=!0),!o}),o},Ut.isBlock.get=function(){return this.type.isBlock},Ut.isTextblock.get=function(){return this.type.isTextblock},Ut.inlineContent.get=function(){return this.type.inlineContent},Ut.isInline.get=function(){return this.type.isInline},Ut.isText.get=function(){return this.type.isText},Ut.isLeaf.get=function(){return this.type.isLeaf},Ut.isAtom.get=function(){return this.type.isAtom},K.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Hv(this.marks,t)},K.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},K.prototype.canReplace=function(t,e,r,o,i){r===void 0&&(r=N.empty),o===void 0&&(o=0),i===void 0&&(i=r.childCount);var s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var l=o;l=0;e--)t=n[e].type.name+"("+t+")";return t}var Vt=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},Co={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};Vt.parse=function(t,e){var r=new Eo(t,e);if(r.next==null)return Vt.empty;var o=gu(r);r.next&&r.err("Unexpected trailing text");var i=Uv(Kv(o));return Gv(i,r),i},Vt.prototype.matchType=function(t){for(var e=0;e>1},Vt.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},Vt.prototype.toString=function(){var t=[];function e(r){t.push(r);for(var o=1;o"+t.indexOf(r.next[s+1]);return i}).join(` +`)},Object.defineProperties(Vt.prototype,Co),Vt.empty=new Vt(!0);var Eo=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()},vu={next:{configurable:!0}};vu.next.get=function(){return this.tokens[this.pos]},Eo.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},Eo.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(Eo.prototype,vu);function gu(n){var t=[];do t.push(Jv(n));while(n.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Jv(n){var t=[];do t.push($v(n));while(n.next&&n.next!=")"&&n.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function $v(n){for(var t=Wv(n);;)if(n.eat("+"))t={type:"plus",expr:t};else if(n.eat("*"))t={type:"star",expr:t};else if(n.eat("?"))t={type:"opt",expr:t};else if(n.eat("{"))t=qv(n,t);else break;return t}function yu(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");var t=Number(n.next);return n.pos++,t}function qv(n,t){var e=yu(n),r=e;return n.eat(",")&&(n.next!="}"?r=yu(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:e,max:r,expr:t}}function jv(n,t){var e=n.nodeTypes,r=e[t];if(r)return[r];var o=[];for(var i in e){var s=e[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&n.err("No node type or group '"+t+"' found"),o}function Wv(n){if(n.eat("(")){var t=gu(n);return n.eat(")")||n.err("Missing closing paren"),t}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{var e=jv(n,n.next).map(function(r){return n.inline==null?n.inline=r.isInline:n.inline!=r.isInline&&n.err("Mixing inline and block content"),{type:"name",value:r}});return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Kv(n){var t=[[]];return o(i(n,0),e()),t;function e(){return t.push([])-1}function r(s,a,l){var c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(function(l){return l.to=a})}function i(s,a){if(s.type=="choice")return s.exprs.reduce(function(k,b){return k.concat(i(b,a))},[]);if(s.type=="seq")for(var l=0;;l++){var c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=e())}else if(s.type=="star"){var u=e();return r(a,u),o(i(s.expr,u),u),[r(u)]}else if(s.type=="plus"){var p=e();return o(i(s.expr,a),p),o(i(s.expr,p),p),[r(p)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){for(var d=a,h=0;h-1&&o[d+1];ku(n,p).forEach(function(m){h||o.push(u,h=[]),h.indexOf(m)==-1&&h.push(m)})}})});for(var i=t[r.join(",")]=new Vt(r.indexOf(n.length-1)>-1),s=0;s-1},Gt.prototype.allowsMarks=function(t){if(this.markSet==null)return!0;for(var e=0;e-1};var Ts={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},Yv={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Eu={ol:!0,ul:!0},As=1,_s=2,Cr=4;function Nu(n){return(n?As:0)|(n==="full"?_s:0)}var _e=function(t,e,r,o,i,s,a){this.type=t,this.attrs=e,this.solid=i,this.match=s||(a&Cr?null:t.contentMatch),this.options=a,this.content=[],this.marks=r,this.activeMarks=W.none,this.pendingMarks=o,this.stashMarks=[]};_e.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(N.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{var r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)},_e.prototype.finish=function(t){if(!(this.options&As)){var e=this.content[this.content.length-1],r;e&&e.isText&&(r=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-r[0].length)))}var o=N.from(this.content);return!t&&this.match&&(o=o.append(this.match.fillBefore(N.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o},_e.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},_e.prototype.applyPending=function(t){for(var e=0,r=this.pendingMarks;e=0;o--){var i=this.nodes[o],s=i.findWrapping(t);if(s&&(!e||e.length>s.length)&&(e=s,r=i,!s.length)||i.solid)break}if(!e)return!1;this.sync(r);for(var a=0;athis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},ot.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ot.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t){this.open=e;return}},Ds.currentPos.get=function(){this.closeExtra();for(var n=0,t=this.open;t>=0;t--){for(var e=this.nodes[t].content,r=e.length-1;r>=0;r--)n+=e[r].nodeSize;t&&n++}return n},ot.prototype.findAtPoint=function(t,e){if(this.find)for(var r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var r=t.split("/"),o=this.options.context,i=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=function(l,c){for(;l>=0;l--){var u=r[l];if(u==""){if(l==r.length-1||l==0)continue;for(;c>=s;c--)if(a(l-1,c))return!0;return!1}else{var p=c>0||c==0&&i?e.nodes[c].type:o&&c>=s?o.node(c-s).type:null;if(!p||p.name!=u&&p.groups.indexOf(u)==-1)return!1;c--}}return!0};return a(r.length-1,this.open)},ot.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var r=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(var o in this.parser.schema.nodes){var i=this.parser.schema.nodes[o];if(i.isTextblock&&i.defaultAttrs)return i}},ot.prototype.addPendingMark=function(t){var e=tg(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},ot.prototype.removePendingMark=function(t,e){for(var r=this.open;r>=0;r--){var o=this.nodes[r],i=o.pendingMarks.lastIndexOf(t);if(i>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==e)break}},Object.defineProperties(ot.prototype,Ds);function Xv(n){for(var t=n.firstChild,e=null;t;t=t.nextSibling){var r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&Eu.hasOwnProperty(r)&&e?(e.appendChild(t),t=e):r=="li"?e=t:r&&(e=null)}}function Qv(n){for(var t=/\s*([\w-]+)\s*:\s*([^;]+)/g,e,r=[];e=t.exec(n);)r.push(e[1],e[2].trim());return r}function Zv(n,t){var e=t.schema.nodes,r=function(s){var a=e[s];if(!!a.allowsMarkType(n)){var l=[],c=function(u){l.push(u);for(var p=0;pt)break;var c=this.ranges[a+i],u=this.ranges[a+s],p=l+c;if(t<=p){var d=c?t==l?-1:t==p?1:e:e,h=l+o+(d<0?0:u);if(r)return h;var m=t==(e<0?l:p)?null:eg(a/3,t-l);return new Rs(h,e<0?t!=l:t!=p,m)}o+=u-c}return r?t+o:new Rs(t+o)},wt.prototype.touches=function(t,e){for(var r=0,o=Au(e),i=this.inverted?2:1,s=this.inverted?1:2,a=0;at)break;var c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1},wt.prototype.forEach=function(t){for(var e=this.inverted?2:1,r=this.inverted?1:2,o=0,i=0;o=0;e--){var o=t.getMirror(e);this.appendMap(t.maps[e].invert(),o!=null&&o>e?r-o-1:null)}},It.prototype.invert=function(){var t=new It;return t.appendMappingInverted(this),t},It.prototype.map=function(t,e){if(e===void 0&&(e=1),this.mirror)return this._map(t,e,!0);for(var r=this.from;ri&&l0},lt.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(lt.prototype,Vs);function No(){throw new Error("Override me")}var Is=Object.create(null),Tt=function(){};Tt.prototype.apply=function(t){return No()},Tt.prototype.getMap=function(){return wt.empty},Tt.prototype.invert=function(t){return No()},Tt.prototype.map=function(t){return No()},Tt.prototype.merge=function(t){return null},Tt.prototype.toJSON=function(){return No()},Tt.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var r=Is[e.stepType];if(!r)throw new RangeError("No step type "+e.stepType+" defined");return r.fromJSON(t,e)},Tt.jsonID=function(t,e){if(t in Is)throw new RangeError("Duplicate use of step JSON ID "+t);return Is[t]=e,e.prototype.jsonID=t,e};var Bt=function(t,e){this.doc=t,this.failed=e};Bt.ok=function(t){return new Bt(t,null)},Bt.fail=function(t){return new Bt(null,t)},Bt.fromReplace=function(t,e,r,o){try{return Bt.ok(t.replace(e,r,o))}catch(i){if(i instanceof ke)return Bt.fail(i.message);throw i}};var Ue=function(n){function t(e,r,o,i){n.call(this),this.from=e,this.to=r,this.slice=o,this.structure=!!i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){return this.structure&&Bs(r,this.from,this.to)?Bt.fail("Structure replace would overwrite content"):Bt.fromReplace(r,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new wt([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(r){return new t(this.from,this.from+this.slice.size,r.slice(this.from,this.to))},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted?null:new t(o.pos,Math.max(o.pos,i.pos),this.slice)},t.prototype.merge=function(r){if(!(r instanceof t)||r.structure||this.structure)return null;if(this.from+this.slice.size==r.from&&!this.slice.openEnd&&!r.slice.openStart){var o=this.slice.size+r.slice.size==0?R.empty:new R(this.slice.content.append(r.slice.content),this.slice.openStart,r.slice.openEnd);return new t(this.from,this.to+(r.to-r.from),o,this.structure)}else if(r.to==this.from&&!this.slice.openStart&&!r.slice.openEnd){var i=this.slice.size+r.slice.size==0?R.empty:new R(r.slice.content.append(this.slice.content),r.slice.openStart,this.slice.openEnd);return new t(r.from,this.to,i,this.structure)}else return null},t.prototype.toJSON=function(){var r={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(o.from,o.to,R.fromJSON(r,o.slice),!!o.structure)},t}(Tt);Tt.jsonID("replace",Ue);var mn=function(n){function t(e,r,o,i,s,a,l){n.call(this),this.from=e,this.to=r,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=!!l}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){if(this.structure&&(Bs(r,this.from,this.gapFrom)||Bs(r,this.gapTo,this.to)))return Bt.fail("Structure gap-replace would overwrite content");var o=r.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return Bt.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?Bt.fromReplace(r,this.from,this.to,i):Bt.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new wt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(r){var o=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,r.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),s=r.map(this.gapFrom,-1),a=r.map(this.gapTo,1);return o.deleted&&i.deleted||si.pos?null:new t(o.pos,i.pos,s,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var r={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number"||typeof o.gapFrom!="number"||typeof o.gapTo!="number"||typeof o.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(o.from,o.to,o.gapFrom,o.gapTo,R.fromJSON(r,o.slice),o.insert,!!o.structure)},t}(Tt);Tt.jsonID("replaceAround",mn);function Bs(n,t,e){for(var r=n.resolve(t),o=e-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}lt.prototype.lift=function(n,t){for(var e=n.$from,r=n.$to,o=n.depth,i=e.before(o+1),s=r.after(o+1),a=i,l=s,c=N.empty,u=0,p=o,d=!1;p>t;p--)d||e.index(p)>0?(d=!0,c=N.from(e.node(p).copy(c)),u++):a--;for(var h=N.empty,m=0,g=o,y=!1;g>t;g--)y||r.after(g+1)=0;r--)e=N.from(t[r].type.create(t[r].attrs,e));var o=n.start,i=n.end;return this.step(new mn(o,i,o,i,new R(e,0,0),t.length,!0))},lt.prototype.setBlockType=function(n,t,e,r){var o=this;if(t===void 0&&(t=n),!e.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(n,t,function(s,a){if(s.isTextblock&&!s.hasMarkup(e,r)&&rg(o.doc,o.mapping.slice(i).map(a),e)){o.clearIncompatible(o.mapping.slice(i).map(a,1),e);var l=o.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return o.step(new mn(c,u,c+1,u-1,new R(N.from(e.create(r,null,s.marks)),0,0),1,!0)),!1}}),this};function rg(n,t,e){var r=n.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,e)}lt.prototype.setNodeMarkup=function(n,t,e,r){var o=this.doc.nodeAt(n);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var i=t.create(e,null,r||o.marks);if(o.isLeaf)return this.replaceWith(n,n+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new mn(n,n+o.nodeSize,n+1,n+o.nodeSize-1,new R(N.from(i),0,0),1,!0))},lt.prototype.split=function(n,t,e){t===void 0&&(t=1);for(var r=this.doc.resolve(n),o=N.empty,i=N.empty,s=r.depth,a=r.depth-t,l=t-1;s>a;s--,l--){o=N.from(r.node(s).copy(o));var c=e&&e[l];i=N.from(c?c.type.create(c.attrs,i):r.node(s).copy(i))}return this.step(new Ue(n,n,new R(o.append(i),t,t),!0))},lt.prototype.join=function(n,t){t===void 0&&(t=1);var e=new Ue(n-t,n+t,R.empty,!0);return this.step(e)};function og(n,t,e){var r=n.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),e))return t;if(r.parentOffset==0)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,e))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,e))return r.after(s+1);if(a=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(r){if(r instanceof t&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from)return new t(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(o.from,o.to,r.markFromJSON(o.mark))},t}(Tt);Tt.jsonID("addMark",zs);var Er=function(n){function t(e,r,o){n.call(this),this.from=e,this.to=r,this.mark=o}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.apply=function(r){var o=this,i=r.slice(this.from,this.to),s=new R(Ps(i.content,function(a){return a.mark(o.mark.removeFromSet(a.marks))}),i.openStart,i.openEnd);return Bt.fromReplace(r,this.from,this.to,s)},t.prototype.invert=function(){return new zs(this.from,this.to,this.mark)},t.prototype.map=function(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(r){if(r instanceof t&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from)return new t(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(r,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(o.from,o.to,r.markFromJSON(o.mark))},t}(Tt);Tt.jsonID("removeMark",Er),lt.prototype.addMark=function(n,t,e){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(n,t,function(l,c,u){if(!!l.isInline){var p=l.marks;if(!e.isInSet(p)&&u.type.allowsMarkType(e.type)){for(var d=Math.max(c,n),h=Math.min(c+l.nodeSize,t),m=e.addToSet(p),g=0;g=0;d--)this.step(o[d]);return this};function ig(n,t,e,r){if(e===void 0&&(e=t),r===void 0&&(r=R.empty),t==e&&!r.size)return null;var o=n.resolve(t),i=n.resolve(e);return _u(o,i,r)?new Ue(t,e,r):new re(o,i,r).fit()}lt.prototype.replace=function(n,t,e){t===void 0&&(t=n),e===void 0&&(e=R.empty);var r=ig(this.doc,n,t,e);return r&&this.step(r),this},lt.prototype.replaceWith=function(n,t,e){return this.replace(n,t,new R(N.from(e),0,0))},lt.prototype.delete=function(n,t){return this.replace(n,t,R.empty)},lt.prototype.insert=function(n,t){return this.replaceWith(n,n,t)};function _u(n,t,e){return!e.openStart&&!e.openEnd&&n.start()==t.start()&&n.parent.canReplace(n.index(),t.index(),e.content)}var re=function(t,e,r){this.$to=e,this.$from=t,this.unplaced=r,this.frontier=[];for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}this.placed=N.empty;for(var s=t.depth;s>0;s--)this.placed=N.from(t.node(s).copy(this.placed))},Du={depth:{configurable:!0}};Du.depth.get=function(){return this.frontier.length-1},re.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;for(var s=this.placed,a=o.depth,l=i.depth;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;var c=new R(s,a,l);if(e>-1)return new mn(o.pos,e,this.$to.pos,this.$to.end(),c,r);if(c.size||o.pos!=this.$to.pos)return new Ue(o.pos,i.pos,c)},re.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--){var r=void 0,o=void 0;e?(o=Ls(this.unplaced.content,e-1).firstChild,r=o.content):r=this.unplaced.content;for(var i=r.firstChild,s=this.depth;s>=0;s--){var a=this.frontier[s],l=a.type,c=a.match,u=void 0,p=void 0;if(t==1&&(i?c.matchType(i.type)||(p=c.fillBefore(N.from(i),!1)):l.compatibleContent(o.type)))return{sliceDepth:e,frontierDepth:s,parent:o,inject:p};if(t==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:e,frontierDepth:s,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}},re.prototype.openMore=function(){var t=this.unplaced,e=t.content,r=t.openStart,o=t.openEnd,i=Ls(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new R(e,r+1,Math.max(o,i.size+r>=e.size-o?r+1:0)),!0)},re.prototype.dropNode=function(){var t=this.unplaced,e=t.content,r=t.openStart,o=t.openEnd,i=Ls(e,r);if(i.childCount<=1&&r>0){var s=e.size-r<=r+i.size;this.unplaced=new R(Nr(e,r-1,1),r-1,s?r-1:o)}else this.unplaced=new R(Nr(e,r,1),r,o)},re.prototype.placeNodes=function(t){for(var e=t.sliceDepth,r=t.frontierDepth,o=t.parent,i=t.inject,s=t.wrap;this.depth>r;)this.closeFrontierNode();if(s)for(var a=0;a1||u==0||b.content.size)&&(m=O,d.push(Ru(b.mark(g.allowedMarks(b.marks)),p==1?u:0,p==c.childCount?k:-1)))}var v=p==c.childCount;v||(k=-1),this.placed=Or(this.placed,r,N.from(d)),this.frontier[r].match=m,v&&k<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var E=0,M=c;E1&&i==this.$to.end(--o);)++i;return i},re.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var r=this.frontier[e],o=r.match,i=r.type,s=e=0;l--){var c=this.frontier[l],u=c.match,p=c.type,d=Fs(t,l,p,u,!0);if(!d||d.childCount)continue t}return{depth:e,fit:a,move:s?t.doc.resolve(t.after(e+1)):t}}}},re.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Or(this.placed,e.depth,e.fit)),t=e.move;for(var r=e.depth+1;r<=t.depth;r++){var o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t},re.prototype.openFrontierNode=function(t,e,r){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Or(this.placed,this.depth,N.from(t.create(e,r))),this.frontier.push({type:t,match:t.contentMatch})},re.prototype.closeFrontierNode=function(){var t=this.frontier.pop(),e=t.match.fillBefore(N.empty,!0);e.childCount&&(this.placed=Or(this.placed,this.frontier.length,e))},Object.defineProperties(re.prototype,Du);function Nr(n,t,e){return t==0?n.cutByIndex(e):n.replaceChild(0,n.firstChild.copy(Nr(n.firstChild.content,t-1,e)))}function Or(n,t,e){return t==0?n.append(e):n.replaceChild(n.childCount-1,n.lastChild.copy(Or(n.lastChild.content,t-1,e)))}function Ls(n,t){for(var e=0;e1&&(r=r.replaceChild(0,Ru(r.firstChild,t-1,r.childCount==1?e-1:0))),t>0&&(r=n.type.contentMatch.fillBefore(r).append(r),e<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(N.empty,!0)))),n.copy(r)}function Fs(n,t,e,r,o){var i=n.node(t),s=o?n.indexAfter(t):n.index(t);if(s==i.childCount&&!e.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!sg(e,i.content,s)?a:null}function sg(n,t,e){for(var r=e;r0;a--,l--){var c=r.node(a).type.spec;if(c.defining||c.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==l&&i.splice(1,0,-a)}for(var u=i.indexOf(s),p=[],d=e.openStart,h=e.content,m=0;;m++){var g=h.firstChild;if(p.push(g),m==e.openStart)break;h=g.content}d>0&&p[d-1].type.spec.defining&&r.node(u).type!=p[d-1].type?d-=1:d>=2&&p[d-1].isTextblock&&p[d-2].type.spec.defining&&r.node(u).type!=p[d-2].type&&(d-=2);for(var y=e.openStart;y>=0;y--){var k=(y+d+1)%(e.openStart+1),b=p[k];if(!!b)for(var O=0;O=0&&(this.replace(n,t,e),!(this.steps.length>V));L--){var z=i[L];z<0||(n=r.before(z),t=o.after(z))}return this};function Vu(n,t,e,r,o){if(tr){var s=o.contentMatchAt(0),a=s.fillBefore(n).append(n);n=a.append(s.matchFragment(a).fillBefore(N.empty,!0))}return n}lt.prototype.replaceRangeWith=function(n,t,e){if(!e.isInline&&n==t&&this.doc.resolve(n).parent.content.size){var r=og(this.doc,n,e.type);r!=null&&(n=t=r)}return this.replaceRange(n,t,new R(N.from(e),0,0))},lt.prototype.deleteRange=function(n,t){for(var e=this.doc.resolve(n),r=this.doc.resolve(t),o=Iu(e,r),i=0;i0&&(a||e.node(s-1).canReplace(e.index(s-1),r.indexAfter(s-1))))return this.delete(e.before(s),r.after(s))}for(var l=1;l<=e.depth&&l<=r.depth;l++)if(n-e.start(l)==e.depth-l&&t>e.end(l)&&r.end(l)-t!=r.depth-l)return this.delete(e.before(l),t);return this.delete(n,t)};function Iu(n,t){for(var e=[],r=Math.min(n.depth,t.depth),o=r;o>=0;o--){var i=n.start(o);if(it.pos+(t.depth-o)||n.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==n.depth&&o==t.depth&&n.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&e.push(o)}return e}var Hs=Object.create(null),it=function(t,e,r){this.ranges=r||[new ag(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Ge={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Ge.anchor.get=function(){return this.$anchor.pos},Ge.head.get=function(){return this.$head.pos},Ge.from.get=function(){return this.$from.pos},Ge.to.get=function(){return this.$to.pos},Ge.$from.get=function(){return this.ranges[0].$from},Ge.$to.get=function(){return this.ranges[0].$to},Ge.empty.get=function(){for(var n=this.ranges,t=0;t=0;i--){var s=e<0?Wn(t.node(0),t.node(i),t.before(i+1),t.index(i),e,r):Wn(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,r);if(s)return s}},it.near=function(t,e){return e===void 0&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new _r(t.node(0))},it.atStart=function(t){return Wn(t,t,0,0,1)||new _r(t)},it.atEnd=function(t){return Wn(t,t,t.content.size,t.childCount,-1)||new _r(t)},it.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var r=Hs[e.type];if(!r)throw new RangeError("No selection type "+e.type+" defined");return r.fromJSON(t,e)},it.jsonID=function(t,e){if(t in Hs)throw new RangeError("Duplicate use of selection JSON ID "+t);return Hs[t]=e,e.prototype.jsonID=t,e},it.prototype.getBookmark=function(){return Tr.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(it.prototype,Ge),it.prototype.visible=!0;var ag=function(t,e){this.$from=t,this.$to=e},Tr=function(n){function t(r,o){o===void 0&&(o=r),n.call(this,r,o)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={$cursor:{configurable:!0}};return e.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(o,i){var s=o.resolve(i.map(this.head));if(!s.parent.inlineContent)return n.near(s);var a=o.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:s,s)},t.prototype.replace=function(o,i){if(i===void 0&&(i=R.empty),n.prototype.replace.call(this,o,i),i==R.empty){var s=this.$from.marksAcross(this.$to);s&&o.ensureMarks(s)}},t.prototype.eq=function(o){return o instanceof t&&o.anchor==this.anchor&&o.head==this.head},t.prototype.getBookmark=function(){return new Ar(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(o,i){if(typeof i.anchor!="number"||typeof i.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(o.resolve(i.anchor),o.resolve(i.head))},t.create=function(o,i,s){s===void 0&&(s=i);var a=o.resolve(i);return new this(a,s==i?a:o.resolve(s))},t.between=function(o,i,s){var a=o.pos-i.pos;if((!s||a)&&(s=a>=0?1:-1),!i.parent.inlineContent){var l=n.findFrom(i,s,!0)||n.findFrom(i,-s,!0);if(l)i=l.$head;else return n.near(i,s)}return o.parent.inlineContent||(a==0?o=i:(o=(n.findFrom(o,-s,!0)||n.findFrom(o,s,!0)).$anchor,o.pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&jn.isSelectable(a))return jn.create(n,e-(o<0?a.nodeSize:0))}else{var l=Wn(n,a,e+o,o<0?a.childCount:0,o,i);if(l)return l}e+=a.nodeSize*o}}function Bu(n,t,e){var r=n.steps.length-1;if(!(r0},t.prototype.setStoredMarks=function(o){return this.storedMarks=o,this.updated|=To,this},t.prototype.ensureMarks=function(o){return W.sameSet(this.storedMarks||this.selection.$from.marks(),o)||this.setStoredMarks(o),this},t.prototype.addStoredMark=function(o){return this.ensureMarks(o.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(o){return this.ensureMarks(o.removeFromSet(this.storedMarks||this.selection.$head.marks()))},e.storedMarksSet.get=function(){return(this.updated&To)>0},t.prototype.addStep=function(o,i){n.prototype.addStep.call(this,o,i),this.updated=this.updated&~To,this.storedMarks=null},t.prototype.setTime=function(o){return this.time=o,this},t.prototype.replaceSelection=function(o){return this.selection.replace(this,o),this},t.prototype.replaceSelectionWith=function(o,i){var s=this.selection;return i!==!1&&(o=o.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||W.none))),s.replaceWith(this,o),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(o,i,s){s===void 0&&(s=i);var a=this.doc.type.schema;if(i==null)return o?this.replaceSelectionWith(a.text(o),!0):this.deleteSelection();if(!o)return this.deleteRange(i,s);var l=this.storedMarks;if(!l){var c=this.doc.resolve(i);l=s==i?c.marks():c.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(i,s,a.text(o,l)),this.selection.empty||this.setSelection(it.near(this.selection.$to)),this},t.prototype.setMeta=function(o,i){return this.meta[typeof o=="string"?o:o.key]=i,this},t.prototype.getMeta=function(o){return this.meta[typeof o=="string"?o:o.key]},e.isGeneric.get=function(){for(var r in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=zu,this},e.scrolledIntoView.get=function(){return(this.updated&zu)>0},Object.defineProperties(t.prototype,e),t}(lt);function Lu(n,t){return!t||!n?n:n.bind(t)}var Dr=function(t,e,r){this.name=t,this.init=Lu(e.init,r),this.apply=Lu(e.apply,r)},ug=[new Dr("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new Dr("selection",{init:function(t,e){return t.selection||it.atStart(e.doc)},apply:function(t){return t.selection}}),new Dr("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,r,o){return o.selection.$cursor?t.storedMarks:null}}),new Dr("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],Js=function(t,e){var r=this;this.schema=t,this.fields=ug.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach(function(o){if(r.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");r.plugins.push(o),r.pluginsByKey[o.key]=o,o.spec.state&&r.fields.push(new Dr(o.key,o.spec.state,o))})},Pt=function(t){this.config=t},Ao={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};Ao.schema.get=function(){return this.config.schema},Ao.plugins.get=function(){return this.config.plugins},Pt.prototype.apply=function(t){return this.applyTransaction(t).state},Pt.prototype.filterTransaction=function(t,e){e===void 0&&(e=-1);for(var r=0;r-1&&Rr.splice(e,1)},Object.defineProperties(Pt.prototype,Ao);var Rr=[];function Fu(n,t,e){for(var r in n){var o=n[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=Fu(o,t,{})),e[r]=o}return e}var Hu=function(t){this.props={},t.props&&Fu(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:Ju("plugin")};Hu.prototype.getState=function(t){return t[this.key]};var $s=Object.create(null);function Ju(n){return n in $s?n+"$"+ ++$s[n]:($s[n]=0,n+"$")}var qs=function(t){t===void 0&&(t="key"),this.key=Ju(t)};qs.prototype.get=function(t){return t.config.pluginsByKey[this.key]},qs.prototype.getState=function(t){return t[this.key]};const fg=new qs("characterLimit"),pg=bt.create({name:"characterCount",addOptions(){return{limit:0}},addProseMirrorPlugins(){const{options:n}=this;return[new Hu({key:fg,appendTransaction:(t,e,r)=>{const o=r.doc.content.size;if(n.limit&&o>n.limit)return r.tr.insertText("",n.limit+1,o)}})]}}),dg=bt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:t})=>this.options.alignments.includes(n)?this.options.types.every(e=>t.updateAttributes(e,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(t=>n.resetAttributes(t,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),hg=kt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",dt(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n})=>n().insertContent({type:this.name}).command(({tr:t,dispatch:e})=>{var r;if(e){const{parent:o,pos:i}=t.selection.$from,s=i+1;if(t.doc.nodeAt(s))t.setSelection(j.create(t.doc,s));else{const l=(r=o.type.contentMatch.defaultType)===null||r===void 0?void 0:r.create();l&&(t.insert(s,l),t.setSelection(j.create(t.doc,s)))}t.scrollIntoView()}return!0}).run()}},addInputRules(){return[bc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),mg=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/;kt.create({name:"image",addOptions(){return{inline:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:"img[src]"}]},renderHTML({HTMLAttributes:n}){return["img",dt(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:t})=>t.insertContent({type:this.name,attrs:n})}},addInputRules(){return[bc({find:mg,type:this.type,getAttributes:n=>{const[,,t,e,r]=n;return{src:e,alt:t,title:r}}})]}});const vg=/^\s*([-+*])\s$/,$u=kt.create({name:"bulletList",addOptions(){return{HTMLAttributes:{}}},group:"block list",content:"listItem+",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n})=>n.toggleList(this.name,"listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[po({find:vg,type:this.type})]}}),gg=/^(\d+)\.\s$/,qu=kt.create({name:"orderedList",addOptions(){return{HTMLAttributes:{}}},group:"block list",content:"listItem+",addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const r=n,{start:t}=r,e=rf(r,["start"]);return t===1?["ol",dt(this.options.HTMLAttributes,e),0]:["ol",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n})=>n.toggleList(this.name,"listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[po({find:gg,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:(n,t)=>t.childCount+t.attrs.start===+n[1]})]}}),yg=kt.create({name:"taskList",addOptions(){return{HTMLAttributes:{}}},group:"block list",content:"taskItem+",parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",dt(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,"taskItem")}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),bg=/^\s*(\[([ |x])\])\s$/,kg=kt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{}}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>n.getAttribute("data-checked")==="true",renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:t}){return["li",dt(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?Lt(x({},n),{Tab:()=>this.editor.commands.sinkListItem(this.name)}):n},addNodeView(){return({node:n,HTMLAttributes:t,getPos:e,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");return i.contentEditable="false",a.type="checkbox",a.addEventListener("change",c=>{if(!r.isEditable){a.checked=!a.checked;return}const{checked:u}=c.target;r.isEditable&&typeof e=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>(p.setNodeMarkup(e(),void 0,{checked:u}),!0)).run()}),Object.entries(this.options.HTMLAttributes).forEach(([c,u])=>{o.setAttribute(c,u)}),o.dataset.checked=n.attrs.checked,n.attrs.checked&&a.setAttribute("checked","checked"),i.append(a,s),o.append(i,l),Object.entries(t).forEach(([c,u])=>{o.setAttribute(c,u)}),{dom:o,contentDOM:l,update:c=>c.type!==this.type?!1:(o.dataset.checked=c.attrs.checked,c.attrs.checked?a.setAttribute("checked","checked"):a.removeAttribute("checked"),!0)}}},addInputRules(){return[po({find:bg,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),wg=/^\s*>\s$/,Sg=kt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[po({find:wg,type:this.type})]}}),xg=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Mg=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Cg=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Eg=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Ng=We.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Rn({find:xg,type:this.type}),Rn({find:Cg,type:this.type})]},addPasteRules(){return[Vn({find:Mg,type:this.type}),Vn({find:Eg,type:this.type})]}}),Og=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Tg=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Ag=We.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Rn({find:Og,type:this.type})]},addPasteRules(){return[Vn({find:Tg,type:this.type})]}}),_g=kt.create({name:"doc",topNode:!0,content:"block+"});function Dg(n){return n===void 0&&(n={}),new Ht({view:function(e){return new we(e,n)}})}var we=function(t,e){var r=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map(function(o){var i=function(s){return r[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})};we.prototype.destroy=function(){var t=this;this.handlers.forEach(function(e){var r=e.name,o=e.handler;return t.editorView.dom.removeEventListener(r,o)})},we.prototype.update=function(t,e){this.cursorPos!=null&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())},we.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},we.prototype.updateOverlay=function(){var t=this.editorView.state.doc.resolve(this.cursorPos),e;if(!t.parent.inlineContent){var r=t.nodeBefore,o=t.nodeAfter;if(r||o){var i=this.editorView.nodeDOM(this.cursorPos-(r?r.nodeSize:0)).getBoundingClientRect(),s=r?i.bottom:i.top;r&&o&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:i.left,right:i.right,top:s-this.width/2,bottom:s+this.width/2}}}if(!e){var a=this.editorView.coordsAtPos(this.cursorPos);e={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{var p=l.getBoundingClientRect();c=p.left-l.scrollLeft,u=p.top-l.scrollTop}this.element.style.left=e.left-c+"px",this.element.style.top=e.top-u+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},we.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return e.setCursor(null)},t)},we.prototype.dragover=function(t){if(!!this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,e):o;if(e&&!i){var s=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(s=Sa(this.editorView.state.doc,s,this.editorView.dragging.slice),s==null))return this.setCursor(null);this.setCursor(s),this.scheduleRemoval(5e3)}}},we.prototype.dragend=function(){this.scheduleRemoval(20)},we.prototype.drop=function(){this.scheduleRemoval(20)},we.prototype.dragleave=function(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)};const Rg=bt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:null}},addProseMirrorPlugins(){return[Dg(this.options)]}});var fe=function(n){function t(e){n.call(this,e,e)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.map=function(r,o){var i=r.resolve(o.map(this.head));return t.valid(i)?new t(i):n.near(i)},t.prototype.content=function(){return T.empty},t.prototype.eq=function(r){return r instanceof t&&r.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(r,o){if(typeof o.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(r.resolve(o.pos))},t.prototype.getBookmark=function(){return new _o(this.anchor)},t.valid=function(r){var o=r.parent;if(o.isTextblock||!Vg(r)||!Ig(r))return!1;var i=o.type.spec.allowGapCursor;if(i!=null)return i;var s=o.contentMatchAt(r.index()).defaultType;return s&&s.isTextblock},t.findFrom=function(r,o,i){t:for(;;){if(!i&&t.valid(r))return r;for(var s=r.pos,a=null,l=r.depth;;l--){var c=r.node(l);if(o>0?r.indexAfter(l)0){a=c.child(o>0?r.indexAfter(l):r.index(l)-1);break}else if(l==0)return null;s+=o;var u=r.doc.resolve(s);if(t.valid(u))return u}for(;;){var p=o>0?a.firstChild:a.lastChild;if(!p){if(a.isAtom&&!a.isText&&!P.isSelectable(a)){r=r.doc.resolve(s+a.nodeSize*o),i=!1;continue t}break}a=p,s+=o;var d=r.doc.resolve(s);if(t.valid(d))return d}return null}},t}(B);fe.prototype.visible=!1,B.jsonID("gapcursor",fe);var _o=function(t){this.pos=t};_o.prototype.map=function(t){return new _o(t.map(this.pos))},_o.prototype.resolve=function(t){var e=t.resolve(this.pos);return fe.valid(e)?new fe(e):B.near(e)};function Vg(n){for(var t=n.depth;t>=0;t--){var e=n.index(t);if(e!=0)for(var r=n.node(t).child(e-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function Ig(n){for(var t=n.depth;t>=0;t--){var e=n.indexAfter(t),r=n.node(t);if(e!=r.childCount)for(var o=r.child(e);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}var Bg=function(){return new Ht({props:{decorations:Lg,createSelectionBetween:function(t,e,r){if(e.pos==r.pos&&fe.valid(r))return new fe(r)},handleClick:zg,handleKeyDown:Pg}})},Pg=rc({ArrowLeft:Do("horiz",-1),ArrowRight:Do("horiz",1),ArrowUp:Do("vert",-1),ArrowDown:Do("vert",1)});function Do(n,t){var e=n=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,i){var s=r.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof j){if(!i.endOfTextblock(e)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}var c=fe.findFrom(a,t,l);return c?(o&&o(r.tr.setSelection(new fe(c))),!0):!1}}function zg(n,t,e){if(!n.editable)return!1;var r=n.state.doc.resolve(t);if(!fe.valid(r))return!1;var o=n.posAtCoords({left:e.clientX,top:e.clientY}),i=o.inside;return i>-1&&P.isSelectable(n.state.doc.nodeAt(i))?!1:(n.dispatch(n.state.tr.setSelection(new fe(r))),!0)}function Lg(n){if(!(n.selection instanceof fe))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",X.create(n.doc,[ft.widget(n.selection.head,t,{key:"gapcursor"})])}const Fg=bt.create({name:"gapCursor",addProseMirrorPlugins(){return[Bg()]},extendNodeSchema(n){var t;const e={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(t=F(A(n,"allowGapCursor",e)))!==null&&t!==void 0?t:null}}}),Hg=kt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",dt(this.options.HTMLAttributes,n)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:n,chain:t,state:e,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:o,storedMarks:i}=e;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const p=l.filter(d=>a.includes(d.type.name));c.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Jg=kt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:t}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,dt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.setNode(this.name,n):!1,toggleHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,t)=>Lt(x({},n),{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(n=>us({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Ro=200,St=function(){};St.prototype.append=function(t){return t.length?(t=St.from(t),!this.length&&t||t.length=e?St.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},St.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},St.prototype.forEach=function(t,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length),e<=r?this.forEachInner(t,e,r,0):this.forEachInvertedInner(t,e,r,0)},St.prototype.map=function(t,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},e,r),o},St.from=function(t){return t instanceof St?t:t&&t.length?new ju(t):St.empty};var ju=function(n){function t(r){n.call(this),this.values=r}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Ro)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Ro)return new t(o.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(t.prototype,e),t}(St);St.empty=new ju([]);var $g=function(n){function t(e,r){n.call(this),this.left=e,this.right=r,this.length=e.length+r.length,this.depth=Math.max(e.depth,r.depth)+1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new t(o,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(St),Wu=St,qg=500,xt=function(t,e){this.items=t,this.eventCount=e};xt.prototype.popEvent=function(t,e){var r=this;if(this.eventCount==0)return null;for(var o=this.items.length;;o--){var i=this.items.get(o-1);if(i.selection){--o;break}}var s,a;e&&(s=this.remapping(o,this.items.length),a=s.maps.length);var l=t.tr,c,u,p=[],d=[];return this.items.forEach(function(h,m){if(!h.step){s||(s=r.remapping(o,m+1),a=s.maps.length),a--,d.push(h);return}if(s){d.push(new Se(h.map));var g=h.step.map(s.slice(a)),y;g&&l.maybeStep(g).doc&&(y=l.mapping.maps[l.mapping.maps.length-1],p.push(new Se(y,null,null,p.length+d.length))),a--,y&&s.appendMap(y,a)}else l.maybeStep(h.step);if(h.selection)return c=s?h.selection.map(s.slice(a)):h.selection,u=new xt(r.items.slice(0,o).append(d.reverse().concat(p)),r.eventCount-1),!1},this.items.length,0),{remaining:u,transform:l,selection:c}},xt.prototype.addTransform=function(t,e,r,o){for(var i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null,c=0;cWg&&(a=jg(a,h),s-=h),new xt(a.append(i),s)},xt.prototype.remapping=function(t,e){var r=new Et;return this.items.forEach(function(o,i){var s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?r.maps.length-o.mirrorOffset:null;r.appendMap(o.map,s)},t,e),r},xt.prototype.addMaps=function(t){return this.eventCount==0?this:new xt(this.items.append(t.map(function(e){return new Se(e)})),this.eventCount)},xt.prototype.rebased=function(t,e){if(!this.eventCount)return this;var r=[],o=Math.max(0,this.items.length-e),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(function(h){h.selection&&a--},o);var l=e;this.items.forEach(function(h){var m=i.getMirror(--l);if(m!=null){s=Math.min(s,m);var g=i.maps[m];if(h.step){var y=t.steps[m].invert(t.docs[m]),k=h.selection&&h.selection.map(i.slice(l+1,m));k&&a++,r.push(new Se(g,y,k))}else r.push(new Se(g))}},o);for(var c=[],u=e;uqg&&(d=d.compress(this.items.length-r.length)),d},xt.prototype.emptyItemCount=function(){var t=0;return this.items.forEach(function(e){e.step||t++}),t},xt.prototype.compress=function(t){t===void 0&&(t=this.items.length);var e=this.remapping(0,t),r=e.maps.length,o=[],i=0;return this.items.forEach(function(s,a){if(a>=t)o.push(s),s.selection&&i++;else if(s.step){var l=s.step.map(e.slice(r)),c=l&&l.getMap();if(r--,c&&e.appendMap(c,r),l){var u=s.selection&&s.selection.map(e.slice(r));u&&i++;var p=new Se(c.invert(),l,u),d,h=o.length-1;(d=o.length&&o[h].merge(p))?o[h]=d:o.push(p)}}else s.map&&r--},this.items.length,0),new xt(Wu.from(o.reverse()),i)},xt.empty=new xt(Wu.empty,0);function jg(n,t){var e;return n.forEach(function(r,o){if(r.selection&&t--==0)return e=o,!1}),n.slice(e)}var Se=function(t,e,r,o){this.map=t,this.step=e,this.selection=r,this.mirrorOffset=o};Se.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new Se(e.getMap().invert(),e,this.selection)}};var Ye=function(t,e,r,o){this.done=t,this.undone=e,this.prevRanges=r,this.prevTime=o},Wg=20;function Kg(n,t,e,r){var o=e.getMeta(Xe),i;if(o)return o.historyState;e.getMeta(Gg)&&(n=new Ye(n.done,n.undone,null,0));var s=e.getMeta("appendedTransaction");if(e.steps.length==0)return n;if(s&&s.getMeta(Xe))return s.getMeta(Xe).redo?new Ye(n.done.addTransform(e,null,r,Vo(t)),n.undone,Ku(e.mapping.maps[e.steps.length-1]),n.prevTime):new Ye(n.done,n.undone.addTransform(e,null,r,Vo(t)),null,n.prevTime);if(e.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){var a=n.prevTime==0||!s&&(n.prevTime<(e.time||0)-r.newGroupDelay||!Ug(e,n.prevRanges)),l=s?js(n.prevRanges,e.mapping):Ku(e.mapping.maps[e.steps.length-1]);return new Ye(n.done.addTransform(e,a?t.selection.getBookmark():null,r,Vo(t)),xt.empty,l,e.time)}else return(i=e.getMeta("rebased"))?new Ye(n.done.rebased(e,i),n.undone.rebased(e,i),js(n.prevRanges,e.mapping),n.prevTime):new Ye(n.done.addMaps(e.mapping.maps),n.undone.addMaps(e.mapping.maps),js(n.prevRanges,e.mapping),n.prevTime)}function Ug(n,t){if(!t)return!1;if(!n.docChanged)return!0;var e=!1;return n.mapping.maps[0].forEach(function(r,o){for(var i=0;i=t[i]&&(e=!0)}),e}function Ku(n){var t=[];return n.forEach(function(e,r,o,i){return t.push(o,i)}),t}function js(n,t){if(!n)return null;for(var e=[],r=0;r({state:n,dispatch:t})=>Yu(n,t),redo:()=>({state:n,dispatch:t})=>Xu(n,t)}},addProseMirrorPlugins(){return[Yg(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Qg=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Zg=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,ty=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,ey=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,ny=We.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Rn({find:Qg,type:this.type}),Rn({find:ty,type:this.type})]},addPasteRules(){return[Vn({find:Zg,type:this.type}),Vn({find:ey,type:this.type})]}}),ry=kt.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",dt(this.options.HTMLAttributes,n),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)}}}),oy=kt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),iy=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,sy=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,ay=We.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",dt(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Rn({find:iy,type:this.type})]},addPasteRules(){return[Vn({find:sy,type:this.type})]}}),ly=kt.create({name:"text",group:"inline"}),cy=bt.create({name:"starterKit",addExtensions(){var n,t,e,r,o,i,s,a,l,c,u,p,d,h,m,g,y,k;const b=[];return this.options.blockquote!==!1&&b.push(Sg.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&b.push(Ng.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.bulletList!==!1&&b.push($u.configure((e=this.options)===null||e===void 0?void 0:e.bulletList)),this.options.code!==!1&&b.push(Ag.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&b.push(Iv.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&b.push(_g.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&b.push(Rg.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&b.push(Fg.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&b.push(Hg.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&b.push(Jg.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&b.push(Xg.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&b.push(hg.configure((p=this.options)===null||p===void 0?void 0:p.horizontalRule)),this.options.italic!==!1&&b.push(ny.configure((d=this.options)===null||d===void 0?void 0:d.italic)),this.options.listItem!==!1&&b.push(ry.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&b.push(qu.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&b.push(oy.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&b.push(ay.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&b.push(ly.configure((k=this.options)===null||k===void 0?void 0:k.text)),b}});var uk="",Io=(n,t)=>{const e=n.__vccOpts||n;for(const[r,o]of t)e[r]=o;return e};const uy={components:{EditorContent:Dv,BubbleMenu:Av},props:{modelValue:{type:String,default:""},maxChars:{type:Number,default:0},bubbleMenu:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},bold:{type:Boolean,default:!0},italic:{type:Boolean,default:!0},strike:{type:Boolean,default:!0},underline:{type:Boolean,default:!0},code:{type:Boolean,default:!0},codeBlock:{type:Boolean,default:!0},blockquote:{type:Boolean,default:!0},bulletList:{type:Boolean,default:!0},orderedList:{type:Boolean,default:!0},taskList:{type:Boolean,default:!0},heading:{type:Boolean,default:!0},textAlign:{type:Boolean,default:!0},horizontalRule:{type:Boolean,default:!0},undoRedo:{type:Boolean,default:!0}},data(){return{editor:null,headingOpen:!1,alignOpen:!1}},watch:{modelValue(n){this.editor.getHTML()!==n&&this.editor.commands.setContent(this.modelValue,!1)},disabled(n){this.editor&&this.editor.setEditable(!n)}},methods:{insertImageFromURL(n){this.editor.chain().focus().setImage({src:n},!1).run()}},computed:{extensions(){return[cy.configure({orderedList:!1,bulletList:!1}),Bv,dg,qu.configure({class:"inline-flex"}),$u.configure({class:"inline-flex"}),pg.configure({limit:this.maxChars}),yg,kg]},hasTextAlign(){return this.editor.isActive({textAlign:"left"})||this.editor.isActive({textAlign:"right"})||this.editor.isActive({textAlign:"center"})||this.editor.isActive({textAlign:"justify"})},charPercentage(){return Math.round(100/this.maxChars*this.editor.getCharacterCount())}},mounted(){this.editor=new _v({content:this.modelValue,extensions:this.extensions,editorProps:{attributes:{class:"h-full overflow-y-auto input"}},editable:!this.disabled}).on("update",({editor:n})=>{this.$emit("update:modelValue",n.getHTML())}),this.$watch(()=>this.maxChars,()=>{})},beforeUnmount(){this.editor.destroy()}},fy=["aria-label"],py=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}),f.createElementVNode("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"})],-1)],dy=["aria-label"],hy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"11",y1:"5",x2:"17",y2:"5"}),f.createElementVNode("line",{x1:"7",y1:"19",x2:"13",y2:"19"}),f.createElementVNode("line",{x1:"14",y1:"5",x2:"10",y2:"19"})],-1)],my=["aria-label"],vy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M7 5v9a5 5 0 0 0 10 0v-9"}),f.createElementVNode("path",{d:"M4 12h16"})],-1)],gy=["aria-label"],yy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M7 5v5a5 5 0 0 0 10 0v-5"}),f.createElementVNode("path",{d:"M5 19h14"})],-1)],by=["aria-label"],ky=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("polyline",{points:"7 8 3 12 7 16"}),f.createElementVNode("polyline",{points:"17 8 21 12 17 16"}),f.createElementVNode("line",{x1:"14",y1:"4",x2:"10",y2:"20"})],-1)],wy=["aria-label"],Sy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),f.createElementVNode("path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"}),f.createElementVNode("path",{d:"M10 13l-1 2l1 2"}),f.createElementVNode("path",{d:"M14 13l1 2l-1 2"})],-1)],xy=["aria-label"],My=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M6 15h15"}),f.createElementVNode("path",{d:"M21 19h-15"}),f.createElementVNode("path",{d:"M15 11h6"}),f.createElementVNode("path",{d:"M21 7h-6"}),f.createElementVNode("path",{d:"M9 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"}),f.createElementVNode("path",{d:"M3 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"})],-1)],Cy=["aria-label"],Ey=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"9",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"9",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"9",y1:"18",x2:"20",y2:"18"}),f.createElementVNode("line",{x1:"5",y1:"6",x2:"5",y2:"6.01"}),f.createElementVNode("line",{x1:"5",y1:"12",x2:"5",y2:"12.01"}),f.createElementVNode("line",{x1:"5",y1:"18",x2:"5",y2:"18.01"})],-1)],Ny=["aria-label"],Oy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M11 6h9"}),f.createElementVNode("path",{d:"M11 12h9"}),f.createElementVNode("path",{d:"M12 18h8"}),f.createElementVNode("path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"}),f.createElementVNode("path",{d:"M6 10v-6l-2 2"})],-1)],Ty=["aria-label"],Ay=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M3.5 5.5l1.5 1.5l2.5 -2.5"}),f.createElementVNode("path",{d:"M3.5 11.5l1.5 1.5l2.5 -2.5"}),f.createElementVNode("path",{d:"M3.5 17.5l1.5 1.5l2.5 -2.5"}),f.createElementVNode("line",{x1:"11",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"11",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"11",y1:"18",x2:"20",y2:"18"})],-1)],_y={key:10},Dy=["aria-label"],Ry=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M7 12h10"}),f.createElementVNode("path",{d:"M7 4v16"}),f.createElementVNode("path",{d:"M17 4v16"}),f.createElementVNode("path",{d:"M15 20h4"}),f.createElementVNode("path",{d:"M15 4h4"}),f.createElementVNode("path",{d:"M5 20h4"}),f.createElementVNode("path",{d:"M5 4h4"})],-1)],Vy={key:0,class:"mx-1 inline-flex space-x-1"},Iy=["aria-label"],By=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M19 18v-8l-2 2"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Py=["aria-label"],zy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 -.001"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Ly=["aria-label"],Fy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M19 14a2 2 0 1 0 -2 -2"}),f.createElementVNode("path",{d:"M17 16a2 2 0 1 0 2 -2"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Hy=["aria-label"],Jy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M20 18v-8l-4 6h5"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],$y=["aria-label"],qy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M17 18h2a2 2 0 1 0 0 -4h-2v-4h4"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],jy=["aria-label"],Wy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("circle",{transform:"rotate(180 19 16)",cx:"19",cy:"16",r:"2"}),f.createElementVNode("path",{d:"M21 12a2 2 0 1 0 -4 0v4"}),f.createElementVNode("path",{d:"M4 6v12"}),f.createElementVNode("path",{d:"M12 6v12"}),f.createElementVNode("path",{d:"M11 18h2"}),f.createElementVNode("path",{d:"M3 18h2"}),f.createElementVNode("path",{d:"M4 12h8"}),f.createElementVNode("path",{d:"M3 6h2"}),f.createElementVNode("path",{d:"M11 6h2"})],-1)],Ky={key:11},Uy=["aria-label"],Gy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),f.createElementVNode("line",{x1:"6",y1:"18",x2:"18",y2:"18"})],-1)],Yy={key:0,class:"inline-flex mx-1 space-x-1"},Xy=["aria-label"],Qy=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12"}),f.createElementVNode("line",{x1:"4",y1:"18",x2:"18",y2:"18"})],-1)],Zy=["aria-label"],t0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),f.createElementVNode("line",{x1:"6",y1:"18",x2:"18",y2:"18"})],-1)],e0=["aria-label"],n0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"6",y1:"18",x2:"20",y2:"18"})],-1)],r0=["aria-label"],o0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),f.createElementVNode("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"4",y1:"18",x2:"16",y2:"18"})],-1)],i0=["aria-label"],s0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"7",x2:"20",y2:"7"}),f.createElementVNode("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),f.createElementVNode("line",{x1:"14",y1:"11",x2:"14",y2:"17"}),f.createElementVNode("path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}),f.createElementVNode("path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"})],-1)],a0=["aria-label"],l0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),f.createElementVNode("line",{x1:"4",y1:"4",x2:"4",y2:"4.01"}),f.createElementVNode("line",{x1:"8",y1:"4",x2:"8",y2:"4.01"}),f.createElementVNode("line",{x1:"12",y1:"4",x2:"12",y2:"4.01"}),f.createElementVNode("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),f.createElementVNode("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),f.createElementVNode("line",{x1:"4",y1:"8",x2:"4",y2:"8.01"}),f.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"8.01"}),f.createElementVNode("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),f.createElementVNode("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),f.createElementVNode("line",{x1:"12",y1:"16",x2:"12",y2:"16.01"}),f.createElementVNode("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),f.createElementVNode("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),f.createElementVNode("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),f.createElementVNode("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),f.createElementVNode("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),f.createElementVNode("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})],-1)],c0=["aria-label"],u0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"})],-1)],f0=["aria-label"],p0=[f.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[f.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),f.createElementVNode("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"})],-1)];function d0(n,t,e,r,o,i){const s=f.resolveComponent("CollapseXTransition"),a=f.resolveComponent("editor-content"),l=f.resolveDirective("tooltip");return f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",null,[o.editor?(f.openBlock(),f.createBlock(f.resolveDynamicComponent(e.bubbleMenu?"bubble-menu":"div"),{key:0,editor:o.editor,class:f.normalizeClass(["flex-wrap space-x-1",e.bubbleMenu?"bg-gray-600 rounded dark p-1":"mb-2"])},{default:f.withCtx(()=>[e.bold?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:0,"aria-label":n.__("tiptap::tiptap.bold"),onClick:t[0]||(t[0]=c=>o.editor.chain().focus().toggleBold().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("bold")}])},py,10,fy)),[[l,n.__("tiptap::tiptap.bold")]]):f.createCommentVNode("",!0),e.italic?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:1,"aria-label":n.__("tiptap::tiptap.italic"),onClick:t[1]||(t[1]=c=>o.editor.chain().focus().toggleItalic().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("italic")}])},hy,10,dy)),[[l,n.__("tiptap::tiptap.italic")]]):f.createCommentVNode("",!0),e.strike?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:2,"aria-label":n.__("tiptap::tiptap.strike"),onClick:t[2]||(t[2]=c=>o.editor.chain().focus().toggleStrike().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("strike")}])},vy,10,my)),[[l,n.__("tiptap::tiptap.strike")]]):f.createCommentVNode("",!0),e.underline?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:3,"aria-label":n.__("tiptap::tiptap.underline"),onClick:t[3]||(t[3]=c=>o.editor.chain().focus().toggleUnderline().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("underline")}])},yy,10,gy)),[[l,n.__("tiptap::tiptap.underline")]]):f.createCommentVNode("",!0),e.code?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:4,"aria-label":n.__("tiptap::tiptap.code"),onClick:t[4]||(t[4]=c=>o.editor.chain().focus().toggleCode().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("code")}])},ky,10,by)),[[l,n.__("tiptap::tiptap.code")]]):f.createCommentVNode("",!0),e.codeBlock?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:5,"aria-label":n.__("tiptap::tiptap.code_block"),onClick:t[5]||(t[5]=c=>o.editor.chain().focus().toggleCodeBlock().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("codeBlock")}])},Sy,10,wy)),[[l,n.__("tiptap::tiptap.code_block")]]):f.createCommentVNode("",!0),e.blockquote?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:6,"aria-label":n.__("tiptap::tiptap.blockquote"),onClick:t[6]||(t[6]=c=>o.editor.chain().focus().toggleBlockquote().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("blockquote")}])},My,10,xy)),[[l,n.__("tiptap::tiptap.blockquote")]]):f.createCommentVNode("",!0),e.bulletList?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:7,"aria-label":n.__("tiptap::tiptap.bullet_list"),onClick:t[7]||(t[7]=c=>o.editor.chain().focus().toggleBulletList().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("bulletList")}])},Ey,10,Cy)),[[l,n.__("tiptap::tiptap.bullet_list")]]):f.createCommentVNode("",!0),e.orderedList?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:8,"aria-label":n.__("tiptap::tiptap.ordered_list"),onClick:t[8]||(t[8]=c=>o.editor.chain().focus().toggleOrderedList().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("orderedList")}])},Oy,10,Ny)),[[l,n.__("tiptap::tiptap.ordered_list")]]):f.createCommentVNode("",!0),e.taskList?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:9,"aria-label":n.__("tiptap::tiptap.task_list"),onClick:t[9]||(t[9]=c=>o.editor.chain().focus().toggleTaskList().run()),class:f.normalizeClass(["button",{accent:o.editor.isActive("taskList")}])},Ay,10,Ty)),[[l,n.__("tiptap::tiptap.task_list")]]):f.createCommentVNode("",!0),e.heading?(f.openBlock(),f.createElementBlock("span",_y,[f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading")}]),onClick:t[10]||(t[10]=c=>{o.headingOpen=!o.headingOpen,o.alignOpen=!1}),"aria-label":n.__("tiptap::tiptap.heading")},Ry,10,Dy),[[l,n.__("tiptap::tiptap.heading")]]),f.createVNode(s,null,{default:f.withCtx(()=>[o.headingOpen?(f.openBlock(),f.createElementBlock("div",Vy,[f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:1})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 1`,onClick:t[11]||(t[11]=c=>o.editor.chain().focus().toggleHeading({level:1}).run())},By,10,Iy),[[l,`${n.__("tiptap::tiptap.heading")} 1`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:2})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 2`,onClick:t[12]||(t[12]=c=>o.editor.chain().focus().toggleHeading({level:2}).run())},zy,10,Py),[[l,`${n.__("tiptap::tiptap.heading")} 2`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:3})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 3`,onClick:t[13]||(t[13]=c=>o.editor.chain().focus().toggleHeading({level:3}).run())},Fy,10,Ly),[[l,`${n.__("tiptap::tiptap.heading")} 3`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:4})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 4`,onClick:t[14]||(t[14]=c=>o.editor.chain().focus().toggleHeading({level:4}).run())},Jy,10,Hy),[[l,`${n.__("tiptap::tiptap.heading")} 4`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:5})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 5`,onClick:t[15]||(t[15]=c=>o.editor.chain().focus().toggleHeading({level:5}).run())},qy,10,$y),[[l,`${n.__("tiptap::tiptap.heading")} 5`]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive("heading",{level:6})}]),"aria-label":`${n.__("tiptap::tiptap.heading")} 6`,onClick:t[16]||(t[16]=c=>o.editor.chain().focus().toggleHeading({level:6}).run())},Wy,10,jy),[[l,`${n.__("tiptap::tiptap.heading")} 6`]])])):f.createCommentVNode("",!0)]),_:1})])):f.createCommentVNode("",!0),e.textAlign?(f.openBlock(),f.createElementBlock("span",Ky,[f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:i.hasTextAlign}]),onClick:t[17]||(t[17]=c=>{o.alignOpen=!o.alignOpen,o.headingOpen=!1}),"aria-label":n.__("tiptap::tiptap.text_align")},Gy,10,Uy),[[l,n.__("tiptap::tiptap.text_align")]]),f.createVNode(s,null,{default:f.withCtx(()=>[o.alignOpen?(f.openBlock(),f.createElementBlock("div",Yy,[f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive({textAlign:"left"})}]),"aria-label":n.__("tiptap::tiptap.left"),onClick:t[18]||(t[18]=c=>o.editor.chain().focus().setTextAlign("left").run())},Qy,10,Xy),[[l,n.__("tiptap::tiptap.left")]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive({textAlign:"center"})}]),"aria-label":n.__("tiptap::tiptap.center"),onClick:t[19]||(t[19]=c=>o.editor.chain().focus().setTextAlign("center").run())},t0,10,Zy),[[l,n.__("tiptap::tiptap.center")]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive({textAlign:"right"})}]),"aria-label":n.__("tiptap::tiptap.right"),onClick:t[20]||(t[20]=c=>o.editor.chain().focus().setTextAlign("right").run())},n0,10,e0),[[l,n.__("tiptap::tiptap.right")]]),f.withDirectives(f.createElementVNode("button",{class:f.normalizeClass(["button",{accent:o.editor.isActive({textAlign:"justify"})}]),"aria-label":n.__("tiptap::tiptap.justify"),onClick:t[21]||(t[21]=c=>o.editor.chain().focus().setTextAlign("justify").run())},o0,10,r0),[[l,n.__("tiptap::tiptap.justify")]]),f.withDirectives(f.createElementVNode("button",{class:"button","aria-label":n.__("tiptap::tiptap.clear"),onClick:t[22]||(t[22]=c=>o.editor.chain().focus().unsetTextAlign().run())},s0,8,i0),[[l,n.__("tiptap::tiptap.clear")]])])):f.createCommentVNode("",!0)]),_:1})])):f.createCommentVNode("",!0),e.horizontalRule?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:12,"aria-label":n.__("tiptap::tiptap.horizontal_rule"),onClick:t[23]||(t[23]=c=>o.editor.chain().focus().setHorizontalRule().run()),class:"button"},l0,8,a0)),[[l,n.__("tiptap::tiptap.horizontal_rule")]]):f.createCommentVNode("",!0),e.undoRedo?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:13,"aria-label":n.__("tiptap::tiptap.undo"),onClick:t[24]||(t[24]=c=>o.editor.chain().focus().undo().run()),class:"button"},u0,8,c0)),[[l,n.__("tiptap::tiptap.undo")]]):f.createCommentVNode("",!0),e.undoRedo?f.withDirectives((f.openBlock(),f.createElementBlock("button",{key:14,"aria-label":n.__("tiptap::tiptap.redo"),onClick:t[25]||(t[25]=c=>o.editor.chain().focus().redo().run()),class:"button"},p0,8,f0)),[[l,n.__("tiptap::tiptap.redo")]]):f.createCommentVNode("",!0)]),_:1},8,["editor","class"])):f.createCommentVNode("",!0)]),f.createVNode(a,{editor:o.editor,class:"min-h-64 h-64",onClick:t[26]||(t[26]=c=>{o.headingOpen=!1,o.alignOpen=!1})},null,8,["editor"]),o.editor&&e.maxChars>0?(f.openBlock(),f.createElementBlock("div",{key:0,class:f.normalizeClass(["w-full",i.charPercentage>90?"text-red-500":i.charPercentage>75?"text-yellow-500":null])},f.toDisplayString(n.__("tiptap::tiptap.character_count",{chars:o.editor.getCharacterCount(),max:e.maxChars})),3)):f.createCommentVNode("",!0)])}var Qu=Io(uy,[["render",d0]]);const h0={components:{Tiptap:Qu},data(){return{bubbleMenu:!1,maxChars:280,content:"

This is tiptap 2 in Voyager II using Vue 3 \u{1F389}

",disabled:!1,bold:!0,italic:!0,strike:!0,underline:!0,code:!0,codeBlock:!0,blockquote:!0,bulletList:!0,orderedList:!0,taskList:!0,heading:!0,textAlign:!0,horizontalRule:!0,undoRedo:!0}}},m0={class:"flex space-x-2"},v0={class:"input-group"},g0=f.createElementVNode("label",{for:"bubble",class:"label"},"Bubble menu",-1),y0={class:"mt-1"},b0={class:"input-group"},k0=f.createElementVNode("label",{for:"maxChars",class:"label"},"Max characters (0 = infinite)",-1),w0={class:"mt-1"},S0={class:"input-group"},x0=f.createElementVNode("label",{for:"disabled",class:"label"},"Disabled",-1),M0={class:"mt-1"},C0={class:"flex flex-wrap space-x-2 mt-4"},E0={class:"input-group"},N0={for:"bold",class:"label"},O0={class:"mt-1"},T0={class:"input-group"},A0={for:"italic",class:"label"},_0={class:"mt-1"},D0={class:"input-group"},R0={for:"strike",class:"label"},V0={class:"mt-1"},I0={class:"input-group"},B0={for:"underline",class:"label"},P0={class:"mt-1"},z0={class:"input-group"},L0={for:"code",class:"label"},F0={class:"mt-1"},H0={class:"input-group"},J0={for:"codeBlock",class:"label"},$0={class:"mt-1"},q0={class:"input-group"},j0={for:"blockquote",class:"label"},W0={class:"mt-1"},K0={class:"input-group"},U0={for:"bulletList",class:"label"},G0={class:"mt-1"},Y0={class:"input-group"},X0={for:"orderedList",class:"label"},Q0={class:"mt-1"},Z0={class:"input-group"},tb={for:"taskList",class:"label"},eb={class:"mt-1"},nb={class:"input-group"},rb={for:"heading",class:"label"},ob={class:"mt-1"},ib={class:"input-group"},sb={for:"textAlign",class:"label"},ab={class:"mt-1"},lb={class:"input-group"},cb={for:"horizontalRule",class:"label"},ub={class:"mt-1"},fb={class:"input-group"},pb={for:"undoRedo",class:"label"},db={class:"mt-1"};function hb(n,t,e,r,o,i){const s=f.resolveComponent("tiptap"),a=f.resolveComponent("collapsible");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(s,{bubbleMenu:o.bubbleMenu,maxChars:o.maxChars,modelValue:o.content,"onUpdate:modelValue":t[0]||(t[0]=l=>o.content=l),disabled:o.disabled,bold:o.bold,italic:o.italic,strike:o.strike,underline:o.underline,code:o.code,codeBlock:o.codeBlock,blockquote:o.blockquote,bulletList:o.bulletList,orderedList:o.orderedList,taskList:o.taskList,heading:o.heading,textAlign:o.textAlign,horizontalRule:o.horizontalRule,undoRedo:o.undoRedo,class:"mb-2"},null,8,["bubbleMenu","maxChars","modelValue","disabled","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"]),f.createVNode(a,{title:"Options"},{default:f.withCtx(()=>[f.createElementVNode("div",m0,[f.createElementVNode("div",v0,[g0,f.createElementVNode("div",y0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[1]||(t[1]=l=>o.bubbleMenu=l),id:"bubble"},null,512),[[f.vModelCheckbox,o.bubbleMenu]])])]),f.createElementVNode("div",b0,[k0,f.createElementVNode("div",w0,[f.withDirectives(f.createElementVNode("input",{type:"number",class:"input","onUpdate:modelValue":t[2]||(t[2]=l=>o.maxChars=l),min:"0",id:"maxChars"},null,512),[[f.vModelText,o.maxChars,void 0,{number:!0}]])])]),f.createElementVNode("div",S0,[x0,f.createElementVNode("div",M0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[3]||(t[3]=l=>o.disabled=l),id:"disabled"},null,512),[[f.vModelCheckbox,o.disabled]])])])]),f.createElementVNode("div",C0,[f.createElementVNode("div",E0,[f.createElementVNode("label",N0,f.toDisplayString(n.__("tiptap::tiptap.bold")),1),f.createElementVNode("div",O0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[4]||(t[4]=l=>o.bold=l),id:"bold"},null,512),[[f.vModelCheckbox,o.bold]])])]),f.createElementVNode("div",T0,[f.createElementVNode("label",A0,f.toDisplayString(n.__("tiptap::tiptap.italic")),1),f.createElementVNode("div",_0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[5]||(t[5]=l=>o.italic=l),id:"italic"},null,512),[[f.vModelCheckbox,o.italic]])])]),f.createElementVNode("div",D0,[f.createElementVNode("label",R0,f.toDisplayString(n.__("tiptap::tiptap.strike")),1),f.createElementVNode("div",V0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[6]||(t[6]=l=>o.strike=l),id:"strike"},null,512),[[f.vModelCheckbox,o.strike]])])]),f.createElementVNode("div",I0,[f.createElementVNode("label",B0,f.toDisplayString(n.__("tiptap::tiptap.underline")),1),f.createElementVNode("div",P0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[7]||(t[7]=l=>o.underline=l),id:"underline"},null,512),[[f.vModelCheckbox,o.underline]])])]),f.createElementVNode("div",z0,[f.createElementVNode("label",L0,f.toDisplayString(n.__("tiptap::tiptap.code")),1),f.createElementVNode("div",F0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[8]||(t[8]=l=>o.code=l),id:"code"},null,512),[[f.vModelCheckbox,o.code]])])]),f.createElementVNode("div",H0,[f.createElementVNode("label",J0,f.toDisplayString(n.__("tiptap::tiptap.code_block")),1),f.createElementVNode("div",$0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[9]||(t[9]=l=>o.codeBlock=l),id:"codeBlock"},null,512),[[f.vModelCheckbox,o.codeBlock]])])]),f.createElementVNode("div",q0,[f.createElementVNode("label",j0,f.toDisplayString(n.__("tiptap::tiptap.blockquote")),1),f.createElementVNode("div",W0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[10]||(t[10]=l=>o.blockquote=l),id:"blockquote"},null,512),[[f.vModelCheckbox,o.blockquote]])])]),f.createElementVNode("div",K0,[f.createElementVNode("label",U0,f.toDisplayString(n.__("tiptap::tiptap.bullet_list")),1),f.createElementVNode("div",G0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[11]||(t[11]=l=>o.bulletList=l),id:"bulletList"},null,512),[[f.vModelCheckbox,o.bulletList]])])]),f.createElementVNode("div",Y0,[f.createElementVNode("label",X0,f.toDisplayString(n.__("tiptap::tiptap.ordered_list")),1),f.createElementVNode("div",Q0,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[12]||(t[12]=l=>o.orderedList=l),id:"orderedList"},null,512),[[f.vModelCheckbox,o.orderedList]])])]),f.createElementVNode("div",Z0,[f.createElementVNode("label",tb,f.toDisplayString(n.__("tiptap::tiptap.task_list")),1),f.createElementVNode("div",eb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[13]||(t[13]=l=>o.taskList=l),id:"taskList"},null,512),[[f.vModelCheckbox,o.taskList]])])]),f.createElementVNode("div",nb,[f.createElementVNode("label",rb,f.toDisplayString(n.__("tiptap::tiptap.heading")),1),f.createElementVNode("div",ob,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[14]||(t[14]=l=>o.heading=l),id:"heading"},null,512),[[f.vModelCheckbox,o.heading]])])]),f.createElementVNode("div",ib,[f.createElementVNode("label",sb,f.toDisplayString(n.__("tiptap::tiptap.text_align")),1),f.createElementVNode("div",ab,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[15]||(t[15]=l=>o.textAlign=l),id:"textAlign"},null,512),[[f.vModelCheckbox,o.textAlign]])])]),f.createElementVNode("div",lb,[f.createElementVNode("label",cb,f.toDisplayString(n.__("tiptap::tiptap.horizontal_rule")),1),f.createElementVNode("div",ub,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[16]||(t[16]=l=>o.horizontalRule=l),id:"horizontalRule"},null,512),[[f.vModelCheckbox,o.horizontalRule]])])]),f.createElementVNode("div",fb,[f.createElementVNode("label",pb,f.toDisplayString(n.__("tiptap::tiptap.undo"))+"/"+f.toDisplayString(n.__("tiptap::tiptap.redo")),1),f.createElementVNode("div",db,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[17]||(t[17]=l=>o.undoRedo=l),id:"undoRedo"},null,512),[[f.vModelCheckbox,o.undoRedo]])])])])]),_:1}),f.createVNode(a,{title:"HTML Output"},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("textarea",{class:"input w-full min-h-64","onUpdate:modelValue":t[18]||(t[18]=l=>o.content=l)},null,512),[[f.vModelText,o.content]])]),_:1})],64)}var mb=Io(h0,[["render",hb]]);const vb={mixins:[voyager.formfieldMixin]},gb={key:1},yb={key:2};function bb(n,t,e,r,o,i){const s=f.resolveComponent("tiptap");return n.action=="query"?f.renderSlot(n.$slots,"default",{key:0}):n.action=="add"||n.action=="edit"?(f.openBlock(),f.createElementBlock("div",gb,[f.createVNode(s,{bubbleMenu:n.options.bubbleMenu,maxChars:n.options.maxChars,modelValue:n.modelValue,"onUpdate:modelValue":t[0]||(t[0]=a=>n.$emit("update:modelValue",a)),bold:n.options.bold,italic:n.options.italic,strike:n.options.strike,underline:n.options.underline,code:n.options.code,codeBlock:n.options.codeBlock,blockquote:n.options.blockquote,bulletList:n.options.bulletList,orderedList:n.options.orderedList,taskList:n.options.taskList,heading:n.options.heading,textAlign:n.options.textAlign,horizontalRule:n.options.horizontalRule,undoRedo:n.options.undoRedo},null,8,["bubbleMenu","maxChars","modelValue","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"])])):n.action=="browse"?(f.openBlock(),f.createElementBlock("div",yb,f.toDisplayString(n.modelValue),1)):f.createCommentVNode("",!0)}var kb=Io(vb,[["render",bb]]);const wb={mixins:[voyager.formfieldBuilderMixin],computed:{defaultListOptions(){return{display_length:150}},defaultViewOptions(){return{bubbleMenu:!1,maxChars:0,bold:!0,italic:!0,strike:!0,underline:!0,code:!0,codeBlock:!0,blockquote:!0,bulletList:!0,orderedList:!0,taskList:!0,heading:!0,textAlign:!0,horizontalRule:!0,undoRedo:!0}}}},Sb={key:0},xb={for:"length",class:"label"},Mb={key:1},Cb={class:"mt-2"},Eb={for:"maxChars",class:"label"},Nb={class:"grid grid-cols-3 lg:grid-cols-2 xl:grid-cols-3 gap-2 mt-2"},Ob={class:"flex items-center space-x-1"},Tb={for:"bubble",class:"label"},Ab={class:"flex items-center space-x-1"},_b={for:"bold",class:"label"},Db={class:"flex items-center space-x-1"},Rb={for:"italic",class:"label"},Vb={class:"flex items-center space-x-1"},Ib={for:"strike",class:"label"},Bb={class:"flex items-center space-x-1"},Pb={for:"underline",class:"label"},zb={class:"flex items-center space-x-1"},Lb={for:"code",class:"label"},Fb={class:"flex items-center space-x-1"},Hb={for:"codeBlock",class:"label"},Jb={class:"flex items-center space-x-1"},$b={for:"blockquote",class:"label"},qb={class:"flex items-center space-x-1"},jb={for:"bulletList",class:"label"},Wb={class:"flex items-center space-x-1"},Kb={for:"orderedList",class:"label"},Ub={class:"flex items-center space-x-1"},Gb={for:"taskList",class:"label"},Yb={class:"flex items-center space-x-1"},Xb={for:"heading",class:"label"},Qb={class:"flex items-center space-x-1"},Zb={for:"textAlign",class:"label"},t1={class:"flex items-center space-x-1"},e1={for:"horizontalRule",class:"label"},n1={class:"flex items-center space-x-1"},r1={for:"undoRedo",class:"label"},o1={key:2};function i1(n,t,e,r,o,i){const s=f.resolveComponent("tiptap");return n.action=="list-options"?(f.openBlock(),f.createElementBlock("div",Sb,[f.createElementVNode("label",xb,f.toDisplayString(n.__("voyager::generic.display_length")),1),f.withDirectives(f.createElementVNode("input",{type:"number",id:"length",class:"input w-full","onUpdate:modelValue":t[0]||(t[0]=a=>n.options.display_length=a)},null,512),[[f.vModelText,n.options.display_length,void 0,{number:!0}]])])):n.action=="view-options"?(f.openBlock(),f.createElementBlock("div",Mb,[f.createElementVNode("div",Cb,[f.createElementVNode("label",Eb,f.toDisplayString(n.__("tiptap::tiptap.max_characters")),1),f.withDirectives(f.createElementVNode("input",{type:"number",class:"input w-full","onUpdate:modelValue":t[1]||(t[1]=a=>n.options.maxChars=a),min:"0",id:"maxChars"},null,512),[[f.vModelText,n.options.maxChars,void 0,{number:!0}]])]),f.createElementVNode("div",Nb,[f.createElementVNode("div",Ob,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[2]||(t[2]=a=>n.options.bubbleMenu=a),id:"bubble"},null,512),[[f.vModelCheckbox,n.options.bubbleMenu]]),f.createElementVNode("label",Tb,f.toDisplayString(n.__("tiptap::tiptap.bubble_menu")),1)]),f.createElementVNode("div",Ab,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[3]||(t[3]=a=>n.options.bold=a),id:"bold"},null,512),[[f.vModelCheckbox,n.options.bold]]),f.createElementVNode("label",_b,f.toDisplayString(n.__("tiptap::tiptap.bold")),1)]),f.createElementVNode("div",Db,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[4]||(t[4]=a=>n.options.italic=a),id:"italic"},null,512),[[f.vModelCheckbox,n.options.italic]]),f.createElementVNode("label",Rb,f.toDisplayString(n.__("tiptap::tiptap.italic")),1)]),f.createElementVNode("div",Vb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[5]||(t[5]=a=>n.options.strike=a),id:"strike"},null,512),[[f.vModelCheckbox,n.options.strike]]),f.createElementVNode("label",Ib,f.toDisplayString(n.__("tiptap::tiptap.strike")),1)]),f.createElementVNode("div",Bb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[6]||(t[6]=a=>n.options.underline=a),id:"underline"},null,512),[[f.vModelCheckbox,n.options.underline]]),f.createElementVNode("label",Pb,f.toDisplayString(n.__("tiptap::tiptap.underline")),1)]),f.createElementVNode("div",zb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[7]||(t[7]=a=>n.options.code=a),id:"code"},null,512),[[f.vModelCheckbox,n.options.code]]),f.createElementVNode("label",Lb,f.toDisplayString(n.__("tiptap::tiptap.code")),1)]),f.createElementVNode("div",Fb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[8]||(t[8]=a=>n.options.codeBlock=a),id:"codeBlock"},null,512),[[f.vModelCheckbox,n.options.codeBlock]]),f.createElementVNode("label",Hb,f.toDisplayString(n.__("tiptap::tiptap.code_block")),1)]),f.createElementVNode("div",Jb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[9]||(t[9]=a=>n.options.blockquote=a),id:"blockquote"},null,512),[[f.vModelCheckbox,n.options.blockquote]]),f.createElementVNode("label",$b,f.toDisplayString(n.__("tiptap::tiptap.blockquote")),1)]),f.createElementVNode("div",qb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[10]||(t[10]=a=>n.options.bulletList=a),id:"bulletList"},null,512),[[f.vModelCheckbox,n.options.bulletList]]),f.createElementVNode("label",jb,f.toDisplayString(n.__("tiptap::tiptap.bullet_list")),1)]),f.createElementVNode("div",Wb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[11]||(t[11]=a=>n.options.orderedList=a),id:"orderedList"},null,512),[[f.vModelCheckbox,n.options.orderedList]]),f.createElementVNode("label",Kb,f.toDisplayString(n.__("tiptap::tiptap.ordered_list")),1)]),f.createElementVNode("div",Ub,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[12]||(t[12]=a=>n.options.taskList=a),id:"taskList"},null,512),[[f.vModelCheckbox,n.options.taskList]]),f.createElementVNode("label",Gb,f.toDisplayString(n.__("tiptap::tiptap.task_list")),1)]),f.createElementVNode("div",Yb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[13]||(t[13]=a=>n.options.heading=a),id:"heading"},null,512),[[f.vModelCheckbox,n.options.heading]]),f.createElementVNode("label",Xb,f.toDisplayString(n.__("tiptap::tiptap.heading")),1)]),f.createElementVNode("div",Qb,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[14]||(t[14]=a=>n.options.textAlign=a),id:"textAlign"},null,512),[[f.vModelCheckbox,n.options.textAlign]]),f.createElementVNode("label",Zb,f.toDisplayString(n.__("tiptap::tiptap.text_align")),1)]),f.createElementVNode("div",t1,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[15]||(t[15]=a=>n.options.horizontalRule=a),id:"horizontalRule"},null,512),[[f.vModelCheckbox,n.options.horizontalRule]]),f.createElementVNode("label",e1,f.toDisplayString(n.__("tiptap::tiptap.horizontal_rule")),1)]),f.createElementVNode("div",n1,[f.withDirectives(f.createElementVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":t[16]||(t[16]=a=>n.options.undoRedo=a),id:"undoRedo"},null,512),[[f.vModelCheckbox,n.options.undoRedo]]),f.createElementVNode("label",r1,f.toDisplayString(n.__("tiptap::tiptap.undo"))+"/"+f.toDisplayString(n.__("tiptap::tiptap.redo")),1)])])])):n.action=="view"?(f.openBlock(),f.createElementBlock("div",o1,[f.createVNode(s,{bubbleMenu:n.options.bubbleMenu,maxChars:n.options.maxChars,value:"''",bold:n.options.bold,italic:n.options.italic,strike:n.options.strike,underline:n.options.underline,code:n.options.code,codeBlock:n.options.codeBlock,blockquote:n.options.blockquote,bulletList:n.options.bulletList,orderedList:n.options.orderedList,taskList:n.options.taskList,heading:n.options.heading,textAlign:n.options.textAlign,horizontalRule:n.options.horizontalRule,undoRedo:n.options.undoRedo},null,8,["bubbleMenu","maxChars","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"])])):f.createCommentVNode("",!0)}var s1=Io(wb,[["render",i1]]);voyager.component("tiptap",Qu),voyager.component("tiptap-demo",mb),voyager.component("tiptap-formfield",kb),voyager.component("tiptap-builder",s1),voyager.addToUI("Tiptap","tiptap-demo")}); diff --git a/package-lock.json b/package-lock.json index 0ec791f..4e0ea22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,35 +8,34 @@ "name": "tiptap-vite", "version": "0.0.0", "dependencies": { - "@tabler/icons": "^1.44.0", - "@tiptap/core": "^2.0.0-beta.141", - "@tiptap/extension-blockquote": "^2.0.0-beta.24", - "@tiptap/extension-bullet-list": "^2.0.0-beta.23", + "@tabler/icons": "^1.46.0", + "@tiptap/core": "^2.0.0-beta.150", + "@tiptap/extension-blockquote": "^2.0.0-beta.26", + "@tiptap/extension-bullet-list": "^2.0.0-beta.24", "@tiptap/extension-character-count": "^2.0.0-beta.18", - "@tiptap/extension-code-block": "^2.0.0-beta.29", + "@tiptap/extension-code-block": "^2.0.0-beta.31", "@tiptap/extension-document": "^2.0.0-beta.15", - "@tiptap/extension-heading": "^2.0.0-beta.23", + "@tiptap/extension-heading": "^2.0.0-beta.24", "@tiptap/extension-history": "^2.0.0-beta.21", "@tiptap/extension-horizontal-rule": "^2.0.0-beta.30", "@tiptap/extension-image": "^2.0.0-beta.24", - "@tiptap/extension-list-item": "^2.0.0-beta.19", - "@tiptap/extension-ordered-list": "^2.0.0-beta.24", - "@tiptap/extension-paragraph": "^2.0.0-beta.22", - "@tiptap/extension-task-item": "^2.0.0-beta.28", - "@tiptap/extension-task-list": "^2.0.0-beta.23", + "@tiptap/extension-list-item": "^2.0.0-beta.20", + "@tiptap/extension-ordered-list": "^2.0.0-beta.25", + "@tiptap/extension-paragraph": "^2.0.0-beta.23", + "@tiptap/extension-task-item": "^2.0.0-beta.30", + "@tiptap/extension-task-list": "^2.0.0-beta.24", "@tiptap/extension-text": "^2.0.0-beta.15", - "@tiptap/extension-text-align": "^2.0.0-beta.28", + "@tiptap/extension-text-align": "^2.0.0-beta.29", "@tiptap/extension-typography": "^2.0.0-beta.19", - "@tiptap/extension-underline": "^2.0.0-beta.21", - "@tiptap/starter-kit": "^2.0.0-beta.143", - "@tiptap/vue-3": "^2.0.0-beta.81", - "vue": "^3.2.22" + "@tiptap/extension-underline": "^2.0.0-beta.22", + "@tiptap/starter-kit": "^2.0.0-beta.153", + "@tiptap/vue-3": "^2.0.0-beta.82" }, "devDependencies": { - "@vitejs/plugin-vue": "^1.10.0", - "@vue/compiler-sfc": "^3.2.22", - "sass": "^1.43.4", - "vite": "^2.6.14" + "@vitejs/plugin-vue": "^1.10.2", + "@vue/compiler-sfc": "^3.2.24", + "sass": "^1.44.0", + "vite": "^2.7.0" } }, "node_modules/@babel/parser": { @@ -51,18 +50,18 @@ } }, "node_modules/@popperjs/core": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz", - "integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.0.tgz", + "integrity": "sha512-zrsUxjLOKAzdewIDRWy9nsV1GQsKBCWaGwsZQlCgr6/q+vjyZhFgqedLfFBuI9anTPEUT4APq9Mu0SZBTzIcGQ==", "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" } }, "node_modules/@tabler/icons": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-1.44.0.tgz", - "integrity": "sha512-g4ShVjf5tkPIC1fsLgQPGlDQzshbVdnIMJXnpkRUGWmETtkE66J3ofT61Uia0ws6XG1pD59vo4PT/qoWB/JZEA==", + "version": "1.46.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-1.46.0.tgz", + "integrity": "sha512-GufZYxw32OcqejSUpn5XdZi7zP/d+tUZH3S+mMlv3AnMn6MStOBKXOxqWYrJ529hjj1m5JHeghwHmHpj3SRJYg==", "funding": { "type": "github", "url": "https://github.com/sponsors/codecalm" @@ -73,9 +72,9 @@ } }, "node_modules/@tiptap/core": { - "version": "2.0.0-beta.141", - "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.141.tgz", - "integrity": "sha512-jfU0zfIpyz9TS8mbWNuKuJb2pXj/RtMkRCvvO7rdYwVshcDLi/s30ZU1tD6MAIea8zm1k0Q6PbN8Xd3G+wefUA==", + "version": "2.0.0-beta.150", + "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.150.tgz", + "integrity": "sha512-uc73pfoC0BaRCte17Yjjzq+7yW4RRyjsprcN81rlehTjHHf1T5Mv2tt0D6rQpXElUwBo8MjzTA9u9UB8K2qcIw==", "dependencies": { "@types/prosemirror-commands": "^1.0.4", "@types/prosemirror-keymap": "^1.0.4", @@ -83,14 +82,14 @@ "@types/prosemirror-schema-list": "^1.0.3", "@types/prosemirror-state": "^1.2.8", "@types/prosemirror-transform": "^1.1.4", - "@types/prosemirror-view": "^1.19.1", + "@types/prosemirror-view": "^1.19.2", "prosemirror-commands": "^1.1.12", "prosemirror-keymap": "^1.1.5", "prosemirror-model": "^1.15.0", "prosemirror-schema-list": "^1.1.6", "prosemirror-state": "^1.3.4", "prosemirror-transform": "^1.3.3", - "prosemirror-view": "^1.23.1" + "prosemirror-view": "^1.23.3" }, "funding": { "type": "github", @@ -98,9 +97,9 @@ } }, "node_modules/@tiptap/extension-blockquote": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.24.tgz", - "integrity": "sha512-u9D/ZOziO4rMBKeLj7JA7fOc9h8wU6zrzVEsX9MbJwmuicoJZ1lIQ9cyrFWwmlfznzuXLaAxm3iZuHt7xxMppQ==", + "version": "2.0.0-beta.26", + "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.26.tgz", + "integrity": "sha512-A6yjcYovONJfOjQFk6vDYXswaCdCtCwjL7w9VTB0R2DLTuJvvRt9DWN0IDcMrj5G+aMgDq4GUUTitv+2Y8krDg==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -110,9 +109,9 @@ } }, "node_modules/@tiptap/extension-bold": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.0-beta.24.tgz", - "integrity": "sha512-2VTCtY2JI0wpDwWT0a2fMFkjbgxDpwD3wvtY3/ndh5pyNX0JQCXtJarFzfZZurWvLNQ8QPRRel73182RBYUOHQ==", + "version": "2.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.0-beta.25.tgz", + "integrity": "sha512-ZNdgFYDxKo8lAp0Pqzu45I0JH3ah8/X5TCYg9zNg3QwLUFT16g2LlWDMUDGT5pH9aXxgtFaEdoVacu0EyhlPnQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -122,12 +121,12 @@ } }, "node_modules/@tiptap/extension-bubble-menu": { - "version": "2.0.0-beta.50", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.50.tgz", - "integrity": "sha512-UYnIaUTbI1K759z3A44dahp/NyHKjSaRvIptMnAv7q312l5n+czGwBcjZo41YUxjLPhnwGk1Siny1V+b5+4yBA==", + "version": "2.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.51.tgz", + "integrity": "sha512-lOC5a2qR6+iBe4INeKB7tM1e5yWvp6Q6SNNlDSm82LG12IpA5qX5EXj5AnNRBrWJX7WYsSZlHuEkV6l4sphtmQ==", "dependencies": { "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.23.1", + "prosemirror-view": "^1.23.3", "tippy.js": "^6.3.7" }, "funding": { @@ -139,9 +138,9 @@ } }, "node_modules/@tiptap/extension-bullet-list": { - "version": "2.0.0-beta.23", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.0-beta.23.tgz", - "integrity": "sha512-ReoUiz9f1IX87RX+GRE+fCaLEzNNwmiP4kli3QH8/qrLK3qxvZYr9N31fUeOHecCctUofPSbQB79B39zSo9Ouw==", + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.0-beta.24.tgz", + "integrity": "sha512-Bn0zh+W51oWUFVXgrq6ei9ll5r0UKq8OMQCVi91y3DfJpKV3DeyG/hN1cpxNI8uzQN15UhDfTYRRXq+WhXKLFQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -164,9 +163,9 @@ } }, "node_modules/@tiptap/extension-code": { - "version": "2.0.0-beta.25", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.25.tgz", - "integrity": "sha512-kXBR4Zp79lpUEfqJtBGv9tO1mj9jFQLMj0iVhj8e8ZporNKei5JfDOY83kwFcKAE60i7tiRDtV3OizpAKMeqDg==", + "version": "2.0.0-beta.26", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.26.tgz", + "integrity": "sha512-QcFWdEFfbJ1n5UFFBD17QPPAJ3J5p/b7XV484u0shCzywO7aNPV32QeHy1z0eMoyZtCbOWf6hg/a7Ugv8IwpHw==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -176,9 +175,9 @@ } }, "node_modules/@tiptap/extension-code-block": { - "version": "2.0.0-beta.29", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.29.tgz", - "integrity": "sha512-IoBJxqZ4F7dApRL3NisvMCBJmzpV0LmfJlFQacgm64Li15dP/QyDuvXpku03gT3y9e4f9Gv/KTKwJizXEVABhw==", + "version": "2.0.0-beta.31", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.31.tgz", + "integrity": "sha512-mT7U4lc9N6ioLamhfyhpGGE8jIi7bzZLcQn9ArSJJu/FBVuAJL48MC6Grupo0OBDQE8dji3kdpUfKjeT/wunkw==", "dependencies": { "prosemirror-state": "^1.3.4" }, @@ -219,12 +218,12 @@ } }, "node_modules/@tiptap/extension-floating-menu": { - "version": "2.0.0-beta.45", - "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.0.0-beta.45.tgz", - "integrity": "sha512-UjAXhdrcVInCydCoRq+9IOEHQC2lR6BSNACFiTzgzObY7aFaNmMus/9MZ/WZKSN3Rw8Mk4lr8PXFP/3zuNqbYA==", + "version": "2.0.0-beta.46", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.0.0-beta.46.tgz", + "integrity": "sha512-f3Ymd1xM4ZjFcGlJerCv1Zvcyz3arm1Q6i3i4IRvs9vAE9yDnQ+FzjpUoXCs9RJDqWBJHBg+k0Uq9z7rKL4reQ==", "dependencies": { "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.23.1", + "prosemirror-view": "^1.23.3", "tippy.js": "^6.3.7" }, "funding": { @@ -264,9 +263,9 @@ } }, "node_modules/@tiptap/extension-heading": { - "version": "2.0.0-beta.23", - "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.0-beta.23.tgz", - "integrity": "sha512-/WLymJjY+MMvee79rWHSKDBGVRw4dbBUMrFLqKLjQQBS1xS8+UW2TYzRrAH6HAH4Tc6WO39ZDbd9K9kc9wqPnA==", + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.0-beta.24.tgz", + "integrity": "sha512-5a3vgdO7Cf2+z7sulCGs/1j23gBcKiZe3pA1FrC5h6blwLu86hA1xnMAVBVNilP9b6c9f3lN9yxMzEWsp6ZEkA==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -319,9 +318,9 @@ } }, "node_modules/@tiptap/extension-italic": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.0-beta.24.tgz", - "integrity": "sha512-pMAWFaLFb0Z0SC5pjoTKzC6m4CQOdUYeVlHvTS/550Z9lf8cqMawQ8H6Yk6brIuANyh7iUi4/zpq4H4rAdUCuw==", + "version": "2.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.0-beta.25.tgz", + "integrity": "sha512-7PvhioTX9baVp5+AmmZU0qna+dFPZCRlSEN/GciH57N77d2uhJ/ZW5iQWTbvy5HBNddQB4Jts1UDIaC7WASrGA==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -331,9 +330,9 @@ } }, "node_modules/@tiptap/extension-list-item": { - "version": "2.0.0-beta.19", - "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.0-beta.19.tgz", - "integrity": "sha512-z/5NrRKwwJc2ZkgoGxRQmA/VENxQugZoxKhUu2qoUdg5cJRcW+ERoKTiY1/AR+4M2k1izNWQMIz3nQNWMx1kQA==", + "version": "2.0.0-beta.20", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.0-beta.20.tgz", + "integrity": "sha512-5IPEspJt38t9ROj4xLUesOVEYlTT/R9Skd9meHRxJQZX1qrzBICs5PC/WRIsnexrvTBhdxpYgCYjpvpsJBlKuQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -343,9 +342,9 @@ } }, "node_modules/@tiptap/extension-ordered-list": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.0-beta.24.tgz", - "integrity": "sha512-pXgwV+vuBAHMBGnUPa8fjxHapGCitfBJ1k8o3XvhotO7243Y7KOfYT7kg6XrY6dmTwCX2WLkIc912PP/E60y3A==", + "version": "2.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.0-beta.25.tgz", + "integrity": "sha512-XmH9Sy5uS02UkLglbwbqqCr0Hp8czhf1IV95YnghVDkyUYZfV/0WI7UqHFIvcCCo16MA4MUvLYWeRB5cc609rQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -355,9 +354,9 @@ } }, "node_modules/@tiptap/extension-paragraph": { - "version": "2.0.0-beta.22", - "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.0-beta.22.tgz", - "integrity": "sha512-BY6GWHlMvGiXLgPHcfZRUHKzMi1jKw3i1JrpMEQ8JLwYD3koI/6UOB/qphwUJkCkIPQXNkZw4/aSBxL9uChRDg==", + "version": "2.0.0-beta.23", + "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.0-beta.23.tgz", + "integrity": "sha512-VWAxyzecErYWk97Kv/Gkghh97zAQTcaVOisEnYYArZAlyYDaYM48qVssAC/vnRRynP2eQxb1EkppbAxE+bMHAA==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -367,9 +366,9 @@ } }, "node_modules/@tiptap/extension-strike": { - "version": "2.0.0-beta.26", - "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.0-beta.26.tgz", - "integrity": "sha512-BA+oqqYOZzRLiMYlHX6BJXlIGaNIR9LObgkHEXAj/JPK7do4wDOcuVaw+dlWS+tzvTebLbC9GYAALfNqVBlTwA==", + "version": "2.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.0-beta.27.tgz", + "integrity": "sha512-2dmCgtesuDdivM/54Q+Y6Tc3JbGz1SkHP6c62piuqBiYLWg3xa16zChZOhfN8szbbQlBgLT6XRTDt3c2Ux+Dug==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -379,9 +378,9 @@ } }, "node_modules/@tiptap/extension-task-item": { - "version": "2.0.0-beta.28", - "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.0.0-beta.28.tgz", - "integrity": "sha512-BucJLBiKUupdUF7k5Gqe73HKPgJddZTISOy+3hERt9XPGwa1iCzjwMB41X9+c8HniBDgSyI2aV0zKTT931xFfg==", + "version": "2.0.0-beta.30", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.0.0-beta.30.tgz", + "integrity": "sha512-56hS7vP/Hgv5R6otEPInTnd8z5n6UCBFm4sbMPA8d7yWWJDskkfuMp9YDEu2zgHZtTghPyGkw3wO6yxouGWlkg==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -391,9 +390,9 @@ } }, "node_modules/@tiptap/extension-task-list": { - "version": "2.0.0-beta.23", - "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.0.0-beta.23.tgz", - "integrity": "sha512-NjAQhtWDtkDpeKtJPItNeLi1fLLVACBFMq2yRCtKBXDGYg2X5w9CYPqXzh8gAIM2qs11wIgS60UtvF2No7Crxg==", + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.0.0-beta.24.tgz", + "integrity": "sha512-zRbf9nwyk39lIarT2NLi9q8vJEe8zd/WBa8TFnehP021ROuPPcssm1irbPhYXjec+bghT/2xclgxKRFVIHGc2A==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -415,9 +414,9 @@ } }, "node_modules/@tiptap/extension-text-align": { - "version": "2.0.0-beta.28", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.0-beta.28.tgz", - "integrity": "sha512-Pv5htzDDxPmH0juRLELa6yZ3nhjRc7VzYEQYmStDsF/4etDgaciGlnYCvIJw7+6EUSaSzY28OizQSVpa9N5r9g==", + "version": "2.0.0-beta.29", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.0-beta.29.tgz", + "integrity": "sha512-FNGpl0tVtgG7AK9kVWF/+CGYHta05NpoME4/j6+vhNlZLBNXRA+AKg7W5T8UxmtaC9yGoJsBs2X8M9eCxWVaEQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -452,9 +451,9 @@ } }, "node_modules/@tiptap/extension-underline": { - "version": "2.0.0-beta.21", - "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.0-beta.21.tgz", - "integrity": "sha512-ZiKD2INkLsnIj0psHHO8A5bk6etjO+U1c0NdZu/m8w/3ef6MZYBxynRoXFHOY7to4Mrz06HBXa0ELZNep/SR6g==", + "version": "2.0.0-beta.22", + "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.0-beta.22.tgz", + "integrity": "sha512-c+tOv4CRBG2pgtAACEsDwvbmM8C89M/CeelTcLLu8zrk+PRy7yj8DKLUtcb9Ybsa7f1Suk6iqyj3dkfxuuvDLw==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -464,28 +463,28 @@ } }, "node_modules/@tiptap/starter-kit": { - "version": "2.0.0-beta.143", - "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.143.tgz", - "integrity": "sha512-3mxSGnVq0R2O/cVfwpZBwQ1f8rNo2TKJoRscurufAftdq1KTxRofmMokWVBDvodivAhJr1gNxEU9jCgP/qJM1w==", - "dependencies": { - "@tiptap/core": "^2.0.0-beta.141", - "@tiptap/extension-blockquote": "^2.0.0-beta.24", - "@tiptap/extension-bold": "^2.0.0-beta.24", - "@tiptap/extension-bullet-list": "^2.0.0-beta.23", - "@tiptap/extension-code": "^2.0.0-beta.25", - "@tiptap/extension-code-block": "^2.0.0-beta.29", + "version": "2.0.0-beta.153", + "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.153.tgz", + "integrity": "sha512-y1vQ5mZEdV/E9URcRHI7n3CuBrtMJZcnU4Qb/Wty29LC3Fek36YH12aiaS5n8hIHWvvWVTEpPTNk6ODpRslxvg==", + "dependencies": { + "@tiptap/core": "^2.0.0-beta.150", + "@tiptap/extension-blockquote": "^2.0.0-beta.26", + "@tiptap/extension-bold": "^2.0.0-beta.25", + "@tiptap/extension-bullet-list": "^2.0.0-beta.24", + "@tiptap/extension-code": "^2.0.0-beta.26", + "@tiptap/extension-code-block": "^2.0.0-beta.31", "@tiptap/extension-document": "^2.0.0-beta.15", "@tiptap/extension-dropcursor": "^2.0.0-beta.25", "@tiptap/extension-gapcursor": "^2.0.0-beta.33", "@tiptap/extension-hard-break": "^2.0.0-beta.30", - "@tiptap/extension-heading": "^2.0.0-beta.23", + "@tiptap/extension-heading": "^2.0.0-beta.24", "@tiptap/extension-history": "^2.0.0-beta.21", "@tiptap/extension-horizontal-rule": "^2.0.0-beta.30", - "@tiptap/extension-italic": "^2.0.0-beta.24", - "@tiptap/extension-list-item": "^2.0.0-beta.19", - "@tiptap/extension-ordered-list": "^2.0.0-beta.24", - "@tiptap/extension-paragraph": "^2.0.0-beta.22", - "@tiptap/extension-strike": "^2.0.0-beta.26", + "@tiptap/extension-italic": "^2.0.0-beta.25", + "@tiptap/extension-list-item": "^2.0.0-beta.20", + "@tiptap/extension-ordered-list": "^2.0.0-beta.25", + "@tiptap/extension-paragraph": "^2.0.0-beta.23", + "@tiptap/extension-strike": "^2.0.0-beta.27", "@tiptap/extension-text": "^2.0.0-beta.15" }, "funding": { @@ -494,14 +493,14 @@ } }, "node_modules/@tiptap/vue-3": { - "version": "2.0.0-beta.81", - "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.0.0-beta.81.tgz", - "integrity": "sha512-TyOMAOWj0BedvieiRfyz8pIE4g1iLL8cP90gv2M/1otm5ofpPJ17SDvBwlm8+ludY0CzlSDN66F94j/JTxFq+g==", + "version": "2.0.0-beta.82", + "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.0.0-beta.82.tgz", + "integrity": "sha512-pAtsPXl9++MwR0ssmhqvALrQlJLGvM+c8QDJt/wkd5ygO0YuX5EroAVKtNU+C96kPusld9dYXprhKVPsyOpMPw==", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.0.0-beta.50", - "@tiptap/extension-floating-menu": "^2.0.0-beta.45", + "@tiptap/extension-bubble-menu": "^2.0.0-beta.51", + "@tiptap/extension-floating-menu": "^2.0.0-beta.46", "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.23.1" + "prosemirror-view": "^1.23.3" }, "funding": { "type": "github", @@ -601,9 +600,9 @@ } }, "node_modules/@types/prosemirror-view": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.19.1.tgz", - "integrity": "sha512-fyQ4NVxAdfISWrE2qT8cpZdosXoH/1JuVYMBs9CdaXPbvi/8R2L2tkkcMRM314piKrO8nfYH5OBZKzP2Ax3jtA==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.19.2.tgz", + "integrity": "sha512-pmh2DuMJzva4D7SxspRKIzkV6FK2o52uAqGjq2dPYcQFPwu4+5RcS1TMjFVCh1R+Ia1Rx8wsCNIId/5+6DB0Bg==", "dependencies": { "@types/prosemirror-model": "*", "@types/prosemirror-state": "*", @@ -611,9 +610,9 @@ } }, "node_modules/@vitejs/plugin-vue": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.10.0.tgz", - "integrity": "sha512-XkSN7lduhQ3z/WMXv2spqt9TCS0znCjnvIGmbud2bxViWWWR4JWXE+x/cQZ/klR0Ug4Ts9eubL7LXAysON5Uvg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.10.2.tgz", + "integrity": "sha512-/QJ0Z9qfhAFtKRY+r57ziY4BSbGUTGsPRMpB/Ron3QPwBZM4OZAZHdTa4a8PafCwU5DTatXG8TMDoP8z+oDqJw==", "dev": true, "engines": { "node": ">=12.0.0" @@ -626,6 +625,7 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.22.tgz", "integrity": "sha512-uAkovrVeTcjzpiM4ECmVaMrv/bjdgAaLzvjcGqQPBEyUrcqsCgccT9fHJ/+hWVGhyMahmBwLqcn4guULNx7sdw==", + "peer": true, "dependencies": { "@babel/parser": "^7.15.0", "@vue/shared": "3.2.22", @@ -637,32 +637,73 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.22.tgz", "integrity": "sha512-VZdsw/VuO1ODs8K7NQwnMQzKITDkIFlYYC03SVnunuf6eNRxBPEonSyqbWNoo6qNaHAEBTG6VVcZC5xC9bAx1g==", + "peer": true, "dependencies": { "@vue/compiler-core": "3.2.22", "@vue/shared": "3.2.22" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.2.22", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.22.tgz", - "integrity": "sha512-tWRQ5ge1tsTDhUwHgueicKJ8rYm6WUVAPTaIpFW3GSwZKcOEJ2rXdfkHFShNVGupeRALz2ET2H84OL0GeRxY0A==", + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.24.tgz", + "integrity": "sha512-YGPcIvVJp2qTPkuT6kT43Eo1xjstyY4bmuiSV31my4bQMBFVR26ANmifUSt759Blok71gK0WzfIZHbcOKYOeKA==", + "dev": true, "dependencies": { "@babel/parser": "^7.15.0", - "@vue/compiler-core": "3.2.22", - "@vue/compiler-dom": "3.2.22", - "@vue/compiler-ssr": "3.2.22", - "@vue/ref-transform": "3.2.22", - "@vue/shared": "3.2.22", + "@vue/compiler-core": "3.2.24", + "@vue/compiler-dom": "3.2.24", + "@vue/compiler-ssr": "3.2.24", + "@vue/ref-transform": "3.2.24", + "@vue/shared": "3.2.24", "estree-walker": "^2.0.2", "magic-string": "^0.25.7", "postcss": "^8.1.10", "source-map": "^0.6.1" } }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-core": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.24.tgz", + "integrity": "sha512-A0SxB2HAggKzP57LDin5gfgWOTwFyGCtQ5MTMNBADnfQYALWnYuC8kMI0DhRSplGTWRvn9Z2DAnG8f35BnojuA==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.24", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-dom": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.24.tgz", + "integrity": "sha512-KQEm8r0JFsrNNIfbD28pcwMvHpcJcwjVR1XWFcD0yyQ8eREd7IXhT7J6j7iNCSE/TIo78NOvkwbyX+lnIm836w==", + "dev": true, + "dependencies": { + "@vue/compiler-core": "3.2.24", + "@vue/shared": "3.2.24" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/compiler-ssr": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.24.tgz", + "integrity": "sha512-E1HHShNsGVWXxs68LDOUuI+Bzak9W/Ier/366aKDBFuwvfwgruwq6abhMfj6pSDZpwZ/PXnfliyl/m7qBSq6gw==", + "dev": true, + "dependencies": { + "@vue/compiler-dom": "3.2.24", + "@vue/shared": "3.2.24" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/@vue/shared": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.24.tgz", + "integrity": "sha512-BUgRiZCkCrqDps5aQ9av05xcge3rn092ztKIh17tHkeEFgP4zfXMQWBA2zfdoCdCEdBL26xtOv+FZYiOp9RUDA==", + "dev": true + }, "node_modules/@vue/compiler-ssr": { "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.22.tgz", "integrity": "sha512-Cl6aoLJtXzzBkk1sKod8S0WBJLts3+ugVC91d22gGpbkw/64WnF12tOZi7Rg54PPLi1NovqyNWPsLH/SAFcu+w==", + "peer": true, "dependencies": { "@vue/compiler-dom": "3.2.22", "@vue/shared": "3.2.22" @@ -672,26 +713,47 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.22.tgz", "integrity": "sha512-xNkLAItjI0xB+lFeDgKCrSItmrHTaAzSnt8LmdSCPQnDyarmzbi/u4ESQnckWvlL7lSRKiEaOvblaNyqAa7OnQ==", + "peer": true, "dependencies": { "@vue/shared": "3.2.22" } }, "node_modules/@vue/ref-transform": { - "version": "3.2.22", - "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.22.tgz", - "integrity": "sha512-qalVWbq5xWWxLZ0L9OroBg/JZhzavQuCcDXblfErxyDEH6Xc5gIJ4feo1SVCICFzhAUgLgQTdSFLpgjBawbFpw==", + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.24.tgz", + "integrity": "sha512-j6oNbsGLvea2rF8GQB9w6q7UFL1So7J+t6ducaMeWPSyjYZ+slWpwPVK6mmyghg5oGqC41R+HC5BV036Y0KhXQ==", + "dev": true, "dependencies": { "@babel/parser": "^7.15.0", - "@vue/compiler-core": "3.2.22", - "@vue/shared": "3.2.22", + "@vue/compiler-core": "3.2.24", + "@vue/shared": "3.2.24", "estree-walker": "^2.0.2", "magic-string": "^0.25.7" } }, + "node_modules/@vue/ref-transform/node_modules/@vue/compiler-core": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.24.tgz", + "integrity": "sha512-A0SxB2HAggKzP57LDin5gfgWOTwFyGCtQ5MTMNBADnfQYALWnYuC8kMI0DhRSplGTWRvn9Z2DAnG8f35BnojuA==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.24", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/ref-transform/node_modules/@vue/shared": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.24.tgz", + "integrity": "sha512-BUgRiZCkCrqDps5aQ9av05xcge3rn092ztKIh17tHkeEFgP4zfXMQWBA2zfdoCdCEdBL26xtOv+FZYiOp9RUDA==", + "dev": true + }, "node_modules/@vue/runtime-core": { "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.22.tgz", "integrity": "sha512-e7WOC55wmHPvmoVUk9VBe/Z9k5bJfWJfVIlkUkiADJn0bOgQD29oh/GS14Kb3aEJXIHLI17Em6+HxNut1sIh7Q==", + "peer": true, "dependencies": { "@vue/reactivity": "3.2.22", "@vue/shared": "3.2.22" @@ -701,6 +763,7 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.22.tgz", "integrity": "sha512-w7VHYJoliLRTLc5beN77wxuOjla4v9wr2FF22xpZFYBmH4U1V7HkYhoHc1BTuNghI15CXT1tNIMhibI1nrQgdw==", + "peer": true, "dependencies": { "@vue/runtime-core": "3.2.22", "@vue/shared": "3.2.22", @@ -711,6 +774,7 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.22.tgz", "integrity": "sha512-jCwbQgKPXiXoH9VS9F7K+gyEvEMrjutannwEZD1R8fQ9szmOTqC+RRbIY3Uf2ibQjZtZ8DV9a4FjxICvd9zZlQ==", + "peer": true, "dependencies": { "@vue/compiler-ssr": "3.2.22", "@vue/shared": "3.2.22" @@ -722,7 +786,8 @@ "node_modules/@vue/shared": { "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.22.tgz", - "integrity": "sha512-qWVav014mpjEtbWbEgl0q9pEyrrIySKum8UVYjwhC6njrKzknLZPvfuYdQyVbApsqr94tf/3dP4pCuZmmjdCWQ==" + "integrity": "sha512-qWVav014mpjEtbWbEgl0q9pEyrrIySKum8UVYjwhC6njrKzknLZPvfuYdQyVbApsqr94tf/3dP4pCuZmmjdCWQ==", + "peer": true }, "node_modules/anymatch": { "version": "3.1.2", @@ -782,7 +847,8 @@ "node_modules/csstype": { "version": "2.6.19", "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.19.tgz", - "integrity": "sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==" + "integrity": "sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==", + "peer": true }, "node_modules/esbuild": { "version": "0.13.13", @@ -1095,6 +1161,12 @@ "node": ">= 0.4.0" } }, + "node_modules/immutable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz", + "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==", + "dev": true + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1334,9 +1406,9 @@ } }, "node_modules/prosemirror-view": { - "version": "1.23.2", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.23.2.tgz", - "integrity": "sha512-iPgRw6tpcN+KH1yKmSnRmDKsJBVkWLFP6laHcz9rh/n0Ndz7YKKCDldtw6FhHBYoWmZeubbhV/rrQW0VCDG9iw==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.23.3.tgz", + "integrity": "sha512-89icyMdXXwxmTxYj0TIuG5M/d0iKeu79tr+PVtC/4qtCOoHrPSPrblJcFOuOWcxGlA/Ei8PqJB4g5HkKR8jWvQ==", "dependencies": { "prosemirror-model": "^1.14.3", "prosemirror-state": "^1.0.0", @@ -1416,12 +1488,13 @@ "integrity": "sha512-ku6MFrwEVSVmXLvy3dYph3LAMNS0890K7fabn+0YIRQ2T96T9F4gkFf0vf0WW0JUraNWwGRtInEpH7yO4tbQZg==" }, "node_modules/sass": { - "version": "1.43.4", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.43.4.tgz", - "integrity": "sha512-/ptG7KE9lxpGSYiXn7Ar+lKOv37xfWsZRtFYal2QHNigyVQDx685VFT/h7ejVr+R8w7H4tmUgtulsKl5YpveOg==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.44.0.tgz", + "integrity": "sha512-0hLREbHFXGQqls/K8X+koeP+ogFRPF4ZqetVB19b7Cst9Er8cOR0rc6RU7MaI4W1JmUShd1BPgPoeqmmgMMYFw==", "dev": true, "dependencies": { - "chokidar": ">=3.0.0 <4.0.0" + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0" }, "bin": { "sass": "sass.js" @@ -1482,15 +1555,15 @@ } }, "node_modules/vite": { - "version": "2.6.14", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.6.14.tgz", - "integrity": "sha512-2HA9xGyi+EhY2MXo0+A2dRsqsAG3eFNEVIo12olkWhOmc8LfiM+eMdrXf+Ruje9gdXgvSqjLI9freec1RUM5EA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.7.0.tgz", + "integrity": "sha512-ZM629j9n6f1Gcr2KsfpLhJ0FRkift4SsTLSvExmNpGJYzyi1JyLOFybz85ShqFP5f4oCfJSblWAma9X8lZg/vA==", "dev": true, "dependencies": { - "esbuild": "^0.13.2", - "postcss": "^8.3.8", + "esbuild": "^0.13.12", + "postcss": "^8.3.11", "resolve": "^1.20.0", - "rollup": "^2.57.0" + "rollup": "^2.59.0" }, "bin": { "vite": "bin/vite.js" @@ -1522,6 +1595,7 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.22.tgz", "integrity": "sha512-KD5nZpXVZquOC6926Xnp3zOvswrUyO9Rya7ZUoxWFQEjFDW4iACtwzubRB4Um2Om9kj6CaJOqAVRDSFlqLpdgw==", + "peer": true, "dependencies": { "@vue/compiler-dom": "3.2.22", "@vue/compiler-sfc": "3.2.22", @@ -1530,6 +1604,37 @@ "@vue/shared": "3.2.22" } }, + "node_modules/vue/node_modules/@vue/compiler-sfc": { + "version": "3.2.22", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.22.tgz", + "integrity": "sha512-tWRQ5ge1tsTDhUwHgueicKJ8rYm6WUVAPTaIpFW3GSwZKcOEJ2rXdfkHFShNVGupeRALz2ET2H84OL0GeRxY0A==", + "peer": true, + "dependencies": { + "@babel/parser": "^7.15.0", + "@vue/compiler-core": "3.2.22", + "@vue/compiler-dom": "3.2.22", + "@vue/compiler-ssr": "3.2.22", + "@vue/ref-transform": "3.2.22", + "@vue/shared": "3.2.22", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7", + "postcss": "^8.1.10", + "source-map": "^0.6.1" + } + }, + "node_modules/vue/node_modules/@vue/ref-transform": { + "version": "3.2.22", + "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.22.tgz", + "integrity": "sha512-qalVWbq5xWWxLZ0L9OroBg/JZhzavQuCcDXblfErxyDEH6Xc5gIJ4feo1SVCICFzhAUgLgQTdSFLpgjBawbFpw==", + "peer": true, + "dependencies": { + "@babel/parser": "^7.15.0", + "@vue/compiler-core": "3.2.22", + "@vue/shared": "3.2.22", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + } + }, "node_modules/w3c-keyname": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.4.tgz", @@ -1543,20 +1648,20 @@ "integrity": "sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA==" }, "@popperjs/core": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz", - "integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==" + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.0.tgz", + "integrity": "sha512-zrsUxjLOKAzdewIDRWy9nsV1GQsKBCWaGwsZQlCgr6/q+vjyZhFgqedLfFBuI9anTPEUT4APq9Mu0SZBTzIcGQ==" }, "@tabler/icons": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-1.44.0.tgz", - "integrity": "sha512-g4ShVjf5tkPIC1fsLgQPGlDQzshbVdnIMJXnpkRUGWmETtkE66J3ofT61Uia0ws6XG1pD59vo4PT/qoWB/JZEA==", + "version": "1.46.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-1.46.0.tgz", + "integrity": "sha512-GufZYxw32OcqejSUpn5XdZi7zP/d+tUZH3S+mMlv3AnMn6MStOBKXOxqWYrJ529hjj1m5JHeghwHmHpj3SRJYg==", "requires": {} }, "@tiptap/core": { - "version": "2.0.0-beta.141", - "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.141.tgz", - "integrity": "sha512-jfU0zfIpyz9TS8mbWNuKuJb2pXj/RtMkRCvvO7rdYwVshcDLi/s30ZU1tD6MAIea8zm1k0Q6PbN8Xd3G+wefUA==", + "version": "2.0.0-beta.150", + "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.150.tgz", + "integrity": "sha512-uc73pfoC0BaRCte17Yjjzq+7yW4RRyjsprcN81rlehTjHHf1T5Mv2tt0D6rQpXElUwBo8MjzTA9u9UB8K2qcIw==", "requires": { "@types/prosemirror-commands": "^1.0.4", "@types/prosemirror-keymap": "^1.0.4", @@ -1564,42 +1669,42 @@ "@types/prosemirror-schema-list": "^1.0.3", "@types/prosemirror-state": "^1.2.8", "@types/prosemirror-transform": "^1.1.4", - "@types/prosemirror-view": "^1.19.1", + "@types/prosemirror-view": "^1.19.2", "prosemirror-commands": "^1.1.12", "prosemirror-keymap": "^1.1.5", "prosemirror-model": "^1.15.0", "prosemirror-schema-list": "^1.1.6", "prosemirror-state": "^1.3.4", "prosemirror-transform": "^1.3.3", - "prosemirror-view": "^1.23.1" + "prosemirror-view": "^1.23.3" } }, "@tiptap/extension-blockquote": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.24.tgz", - "integrity": "sha512-u9D/ZOziO4rMBKeLj7JA7fOc9h8wU6zrzVEsX9MbJwmuicoJZ1lIQ9cyrFWwmlfznzuXLaAxm3iZuHt7xxMppQ==", + "version": "2.0.0-beta.26", + "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.26.tgz", + "integrity": "sha512-A6yjcYovONJfOjQFk6vDYXswaCdCtCwjL7w9VTB0R2DLTuJvvRt9DWN0IDcMrj5G+aMgDq4GUUTitv+2Y8krDg==", "requires": {} }, "@tiptap/extension-bold": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.0-beta.24.tgz", - "integrity": "sha512-2VTCtY2JI0wpDwWT0a2fMFkjbgxDpwD3wvtY3/ndh5pyNX0JQCXtJarFzfZZurWvLNQ8QPRRel73182RBYUOHQ==", + "version": "2.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.0-beta.25.tgz", + "integrity": "sha512-ZNdgFYDxKo8lAp0Pqzu45I0JH3ah8/X5TCYg9zNg3QwLUFT16g2LlWDMUDGT5pH9aXxgtFaEdoVacu0EyhlPnQ==", "requires": {} }, "@tiptap/extension-bubble-menu": { - "version": "2.0.0-beta.50", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.50.tgz", - "integrity": "sha512-UYnIaUTbI1K759z3A44dahp/NyHKjSaRvIptMnAv7q312l5n+czGwBcjZo41YUxjLPhnwGk1Siny1V+b5+4yBA==", + "version": "2.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.51.tgz", + "integrity": "sha512-lOC5a2qR6+iBe4INeKB7tM1e5yWvp6Q6SNNlDSm82LG12IpA5qX5EXj5AnNRBrWJX7WYsSZlHuEkV6l4sphtmQ==", "requires": { "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.23.1", + "prosemirror-view": "^1.23.3", "tippy.js": "^6.3.7" } }, "@tiptap/extension-bullet-list": { - "version": "2.0.0-beta.23", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.0-beta.23.tgz", - "integrity": "sha512-ReoUiz9f1IX87RX+GRE+fCaLEzNNwmiP4kli3QH8/qrLK3qxvZYr9N31fUeOHecCctUofPSbQB79B39zSo9Ouw==", + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.0-beta.24.tgz", + "integrity": "sha512-Bn0zh+W51oWUFVXgrq6ei9ll5r0UKq8OMQCVi91y3DfJpKV3DeyG/hN1cpxNI8uzQN15UhDfTYRRXq+WhXKLFQ==", "requires": {} }, "@tiptap/extension-character-count": { @@ -1609,15 +1714,15 @@ "requires": {} }, "@tiptap/extension-code": { - "version": "2.0.0-beta.25", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.25.tgz", - "integrity": "sha512-kXBR4Zp79lpUEfqJtBGv9tO1mj9jFQLMj0iVhj8e8ZporNKei5JfDOY83kwFcKAE60i7tiRDtV3OizpAKMeqDg==", + "version": "2.0.0-beta.26", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.26.tgz", + "integrity": "sha512-QcFWdEFfbJ1n5UFFBD17QPPAJ3J5p/b7XV484u0shCzywO7aNPV32QeHy1z0eMoyZtCbOWf6hg/a7Ugv8IwpHw==", "requires": {} }, "@tiptap/extension-code-block": { - "version": "2.0.0-beta.29", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.29.tgz", - "integrity": "sha512-IoBJxqZ4F7dApRL3NisvMCBJmzpV0LmfJlFQacgm64Li15dP/QyDuvXpku03gT3y9e4f9Gv/KTKwJizXEVABhw==", + "version": "2.0.0-beta.31", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.31.tgz", + "integrity": "sha512-mT7U4lc9N6ioLamhfyhpGGE8jIi7bzZLcQn9ArSJJu/FBVuAJL48MC6Grupo0OBDQE8dji3kdpUfKjeT/wunkw==", "requires": { "prosemirror-state": "^1.3.4" } @@ -1638,12 +1743,12 @@ } }, "@tiptap/extension-floating-menu": { - "version": "2.0.0-beta.45", - "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.0.0-beta.45.tgz", - "integrity": "sha512-UjAXhdrcVInCydCoRq+9IOEHQC2lR6BSNACFiTzgzObY7aFaNmMus/9MZ/WZKSN3Rw8Mk4lr8PXFP/3zuNqbYA==", + "version": "2.0.0-beta.46", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.0.0-beta.46.tgz", + "integrity": "sha512-f3Ymd1xM4ZjFcGlJerCv1Zvcyz3arm1Q6i3i4IRvs9vAE9yDnQ+FzjpUoXCs9RJDqWBJHBg+k0Uq9z7rKL4reQ==", "requires": { "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.23.1", + "prosemirror-view": "^1.23.3", "tippy.js": "^6.3.7" } }, @@ -1663,9 +1768,9 @@ "requires": {} }, "@tiptap/extension-heading": { - "version": "2.0.0-beta.23", - "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.0-beta.23.tgz", - "integrity": "sha512-/WLymJjY+MMvee79rWHSKDBGVRw4dbBUMrFLqKLjQQBS1xS8+UW2TYzRrAH6HAH4Tc6WO39ZDbd9K9kc9wqPnA==", + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.0-beta.24.tgz", + "integrity": "sha512-5a3vgdO7Cf2+z7sulCGs/1j23gBcKiZe3pA1FrC5h6blwLu86hA1xnMAVBVNilP9b6c9f3lN9yxMzEWsp6ZEkA==", "requires": {} }, "@tiptap/extension-history": { @@ -1692,45 +1797,45 @@ "requires": {} }, "@tiptap/extension-italic": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.0-beta.24.tgz", - "integrity": "sha512-pMAWFaLFb0Z0SC5pjoTKzC6m4CQOdUYeVlHvTS/550Z9lf8cqMawQ8H6Yk6brIuANyh7iUi4/zpq4H4rAdUCuw==", + "version": "2.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.0-beta.25.tgz", + "integrity": "sha512-7PvhioTX9baVp5+AmmZU0qna+dFPZCRlSEN/GciH57N77d2uhJ/ZW5iQWTbvy5HBNddQB4Jts1UDIaC7WASrGA==", "requires": {} }, "@tiptap/extension-list-item": { - "version": "2.0.0-beta.19", - "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.0-beta.19.tgz", - "integrity": "sha512-z/5NrRKwwJc2ZkgoGxRQmA/VENxQugZoxKhUu2qoUdg5cJRcW+ERoKTiY1/AR+4M2k1izNWQMIz3nQNWMx1kQA==", + "version": "2.0.0-beta.20", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.0-beta.20.tgz", + "integrity": "sha512-5IPEspJt38t9ROj4xLUesOVEYlTT/R9Skd9meHRxJQZX1qrzBICs5PC/WRIsnexrvTBhdxpYgCYjpvpsJBlKuQ==", "requires": {} }, "@tiptap/extension-ordered-list": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.0-beta.24.tgz", - "integrity": "sha512-pXgwV+vuBAHMBGnUPa8fjxHapGCitfBJ1k8o3XvhotO7243Y7KOfYT7kg6XrY6dmTwCX2WLkIc912PP/E60y3A==", + "version": "2.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.0-beta.25.tgz", + "integrity": "sha512-XmH9Sy5uS02UkLglbwbqqCr0Hp8czhf1IV95YnghVDkyUYZfV/0WI7UqHFIvcCCo16MA4MUvLYWeRB5cc609rQ==", "requires": {} }, "@tiptap/extension-paragraph": { - "version": "2.0.0-beta.22", - "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.0-beta.22.tgz", - "integrity": "sha512-BY6GWHlMvGiXLgPHcfZRUHKzMi1jKw3i1JrpMEQ8JLwYD3koI/6UOB/qphwUJkCkIPQXNkZw4/aSBxL9uChRDg==", + "version": "2.0.0-beta.23", + "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.0-beta.23.tgz", + "integrity": "sha512-VWAxyzecErYWk97Kv/Gkghh97zAQTcaVOisEnYYArZAlyYDaYM48qVssAC/vnRRynP2eQxb1EkppbAxE+bMHAA==", "requires": {} }, "@tiptap/extension-strike": { - "version": "2.0.0-beta.26", - "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.0-beta.26.tgz", - "integrity": "sha512-BA+oqqYOZzRLiMYlHX6BJXlIGaNIR9LObgkHEXAj/JPK7do4wDOcuVaw+dlWS+tzvTebLbC9GYAALfNqVBlTwA==", + "version": "2.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.0-beta.27.tgz", + "integrity": "sha512-2dmCgtesuDdivM/54Q+Y6Tc3JbGz1SkHP6c62piuqBiYLWg3xa16zChZOhfN8szbbQlBgLT6XRTDt3c2Ux+Dug==", "requires": {} }, "@tiptap/extension-task-item": { - "version": "2.0.0-beta.28", - "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.0.0-beta.28.tgz", - "integrity": "sha512-BucJLBiKUupdUF7k5Gqe73HKPgJddZTISOy+3hERt9XPGwa1iCzjwMB41X9+c8HniBDgSyI2aV0zKTT931xFfg==", + "version": "2.0.0-beta.30", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.0.0-beta.30.tgz", + "integrity": "sha512-56hS7vP/Hgv5R6otEPInTnd8z5n6UCBFm4sbMPA8d7yWWJDskkfuMp9YDEu2zgHZtTghPyGkw3wO6yxouGWlkg==", "requires": {} }, "@tiptap/extension-task-list": { - "version": "2.0.0-beta.23", - "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.0.0-beta.23.tgz", - "integrity": "sha512-NjAQhtWDtkDpeKtJPItNeLi1fLLVACBFMq2yRCtKBXDGYg2X5w9CYPqXzh8gAIM2qs11wIgS60UtvF2No7Crxg==", + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.0.0-beta.24.tgz", + "integrity": "sha512-zRbf9nwyk39lIarT2NLi9q8vJEe8zd/WBa8TFnehP021ROuPPcssm1irbPhYXjec+bghT/2xclgxKRFVIHGc2A==", "requires": {} }, "@tiptap/extension-text": { @@ -1740,9 +1845,9 @@ "requires": {} }, "@tiptap/extension-text-align": { - "version": "2.0.0-beta.28", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.0-beta.28.tgz", - "integrity": "sha512-Pv5htzDDxPmH0juRLELa6yZ3nhjRc7VzYEQYmStDsF/4etDgaciGlnYCvIJw7+6EUSaSzY28OizQSVpa9N5r9g==", + "version": "2.0.0-beta.29", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.0-beta.29.tgz", + "integrity": "sha512-FNGpl0tVtgG7AK9kVWF/+CGYHta05NpoME4/j6+vhNlZLBNXRA+AKg7W5T8UxmtaC9yGoJsBs2X8M9eCxWVaEQ==", "requires": {} }, "@tiptap/extension-text-style": { @@ -1759,46 +1864,46 @@ "requires": {} }, "@tiptap/extension-underline": { - "version": "2.0.0-beta.21", - "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.0-beta.21.tgz", - "integrity": "sha512-ZiKD2INkLsnIj0psHHO8A5bk6etjO+U1c0NdZu/m8w/3ef6MZYBxynRoXFHOY7to4Mrz06HBXa0ELZNep/SR6g==", + "version": "2.0.0-beta.22", + "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.0-beta.22.tgz", + "integrity": "sha512-c+tOv4CRBG2pgtAACEsDwvbmM8C89M/CeelTcLLu8zrk+PRy7yj8DKLUtcb9Ybsa7f1Suk6iqyj3dkfxuuvDLw==", "requires": {} }, "@tiptap/starter-kit": { - "version": "2.0.0-beta.143", - "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.143.tgz", - "integrity": "sha512-3mxSGnVq0R2O/cVfwpZBwQ1f8rNo2TKJoRscurufAftdq1KTxRofmMokWVBDvodivAhJr1gNxEU9jCgP/qJM1w==", + "version": "2.0.0-beta.153", + "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.153.tgz", + "integrity": "sha512-y1vQ5mZEdV/E9URcRHI7n3CuBrtMJZcnU4Qb/Wty29LC3Fek36YH12aiaS5n8hIHWvvWVTEpPTNk6ODpRslxvg==", "requires": { - "@tiptap/core": "^2.0.0-beta.141", - "@tiptap/extension-blockquote": "^2.0.0-beta.24", - "@tiptap/extension-bold": "^2.0.0-beta.24", - "@tiptap/extension-bullet-list": "^2.0.0-beta.23", - "@tiptap/extension-code": "^2.0.0-beta.25", - "@tiptap/extension-code-block": "^2.0.0-beta.29", + "@tiptap/core": "^2.0.0-beta.150", + "@tiptap/extension-blockquote": "^2.0.0-beta.26", + "@tiptap/extension-bold": "^2.0.0-beta.25", + "@tiptap/extension-bullet-list": "^2.0.0-beta.24", + "@tiptap/extension-code": "^2.0.0-beta.26", + "@tiptap/extension-code-block": "^2.0.0-beta.31", "@tiptap/extension-document": "^2.0.0-beta.15", "@tiptap/extension-dropcursor": "^2.0.0-beta.25", "@tiptap/extension-gapcursor": "^2.0.0-beta.33", "@tiptap/extension-hard-break": "^2.0.0-beta.30", - "@tiptap/extension-heading": "^2.0.0-beta.23", + "@tiptap/extension-heading": "^2.0.0-beta.24", "@tiptap/extension-history": "^2.0.0-beta.21", "@tiptap/extension-horizontal-rule": "^2.0.0-beta.30", - "@tiptap/extension-italic": "^2.0.0-beta.24", - "@tiptap/extension-list-item": "^2.0.0-beta.19", - "@tiptap/extension-ordered-list": "^2.0.0-beta.24", - "@tiptap/extension-paragraph": "^2.0.0-beta.22", - "@tiptap/extension-strike": "^2.0.0-beta.26", + "@tiptap/extension-italic": "^2.0.0-beta.25", + "@tiptap/extension-list-item": "^2.0.0-beta.20", + "@tiptap/extension-ordered-list": "^2.0.0-beta.25", + "@tiptap/extension-paragraph": "^2.0.0-beta.23", + "@tiptap/extension-strike": "^2.0.0-beta.27", "@tiptap/extension-text": "^2.0.0-beta.15" } }, "@tiptap/vue-3": { - "version": "2.0.0-beta.81", - "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.0.0-beta.81.tgz", - "integrity": "sha512-TyOMAOWj0BedvieiRfyz8pIE4g1iLL8cP90gv2M/1otm5ofpPJ17SDvBwlm8+ludY0CzlSDN66F94j/JTxFq+g==", + "version": "2.0.0-beta.82", + "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.0.0-beta.82.tgz", + "integrity": "sha512-pAtsPXl9++MwR0ssmhqvALrQlJLGvM+c8QDJt/wkd5ygO0YuX5EroAVKtNU+C96kPusld9dYXprhKVPsyOpMPw==", "requires": { - "@tiptap/extension-bubble-menu": "^2.0.0-beta.50", - "@tiptap/extension-floating-menu": "^2.0.0-beta.45", + "@tiptap/extension-bubble-menu": "^2.0.0-beta.51", + "@tiptap/extension-floating-menu": "^2.0.0-beta.46", "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.23.1" + "prosemirror-view": "^1.23.3" } }, "@types/orderedmap": { @@ -1890,9 +1995,9 @@ } }, "@types/prosemirror-view": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.19.1.tgz", - "integrity": "sha512-fyQ4NVxAdfISWrE2qT8cpZdosXoH/1JuVYMBs9CdaXPbvi/8R2L2tkkcMRM314piKrO8nfYH5OBZKzP2Ax3jtA==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.19.2.tgz", + "integrity": "sha512-pmh2DuMJzva4D7SxspRKIzkV6FK2o52uAqGjq2dPYcQFPwu4+5RcS1TMjFVCh1R+Ia1Rx8wsCNIId/5+6DB0Bg==", "requires": { "@types/prosemirror-model": "*", "@types/prosemirror-state": "*", @@ -1900,9 +2005,9 @@ } }, "@vitejs/plugin-vue": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.10.0.tgz", - "integrity": "sha512-XkSN7lduhQ3z/WMXv2spqt9TCS0znCjnvIGmbud2bxViWWWR4JWXE+x/cQZ/klR0Ug4Ts9eubL7LXAysON5Uvg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.10.2.tgz", + "integrity": "sha512-/QJ0Z9qfhAFtKRY+r57ziY4BSbGUTGsPRMpB/Ron3QPwBZM4OZAZHdTa4a8PafCwU5DTatXG8TMDoP8z+oDqJw==", "dev": true, "requires": {} }, @@ -1910,6 +2015,7 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.22.tgz", "integrity": "sha512-uAkovrVeTcjzpiM4ECmVaMrv/bjdgAaLzvjcGqQPBEyUrcqsCgccT9fHJ/+hWVGhyMahmBwLqcn4guULNx7sdw==", + "peer": true, "requires": { "@babel/parser": "^7.15.0", "@vue/shared": "3.2.22", @@ -1921,32 +2027,75 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.22.tgz", "integrity": "sha512-VZdsw/VuO1ODs8K7NQwnMQzKITDkIFlYYC03SVnunuf6eNRxBPEonSyqbWNoo6qNaHAEBTG6VVcZC5xC9bAx1g==", + "peer": true, "requires": { "@vue/compiler-core": "3.2.22", "@vue/shared": "3.2.22" } }, "@vue/compiler-sfc": { - "version": "3.2.22", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.22.tgz", - "integrity": "sha512-tWRQ5ge1tsTDhUwHgueicKJ8rYm6WUVAPTaIpFW3GSwZKcOEJ2rXdfkHFShNVGupeRALz2ET2H84OL0GeRxY0A==", + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.24.tgz", + "integrity": "sha512-YGPcIvVJp2qTPkuT6kT43Eo1xjstyY4bmuiSV31my4bQMBFVR26ANmifUSt759Blok71gK0WzfIZHbcOKYOeKA==", + "dev": true, "requires": { "@babel/parser": "^7.15.0", - "@vue/compiler-core": "3.2.22", - "@vue/compiler-dom": "3.2.22", - "@vue/compiler-ssr": "3.2.22", - "@vue/ref-transform": "3.2.22", - "@vue/shared": "3.2.22", + "@vue/compiler-core": "3.2.24", + "@vue/compiler-dom": "3.2.24", + "@vue/compiler-ssr": "3.2.24", + "@vue/ref-transform": "3.2.24", + "@vue/shared": "3.2.24", "estree-walker": "^2.0.2", "magic-string": "^0.25.7", "postcss": "^8.1.10", "source-map": "^0.6.1" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.24.tgz", + "integrity": "sha512-A0SxB2HAggKzP57LDin5gfgWOTwFyGCtQ5MTMNBADnfQYALWnYuC8kMI0DhRSplGTWRvn9Z2DAnG8f35BnojuA==", + "dev": true, + "requires": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.24", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.24.tgz", + "integrity": "sha512-KQEm8r0JFsrNNIfbD28pcwMvHpcJcwjVR1XWFcD0yyQ8eREd7IXhT7J6j7iNCSE/TIo78NOvkwbyX+lnIm836w==", + "dev": true, + "requires": { + "@vue/compiler-core": "3.2.24", + "@vue/shared": "3.2.24" + } + }, + "@vue/compiler-ssr": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.24.tgz", + "integrity": "sha512-E1HHShNsGVWXxs68LDOUuI+Bzak9W/Ier/366aKDBFuwvfwgruwq6abhMfj6pSDZpwZ/PXnfliyl/m7qBSq6gw==", + "dev": true, + "requires": { + "@vue/compiler-dom": "3.2.24", + "@vue/shared": "3.2.24" + } + }, + "@vue/shared": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.24.tgz", + "integrity": "sha512-BUgRiZCkCrqDps5aQ9av05xcge3rn092ztKIh17tHkeEFgP4zfXMQWBA2zfdoCdCEdBL26xtOv+FZYiOp9RUDA==", + "dev": true + } } }, "@vue/compiler-ssr": { "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.22.tgz", "integrity": "sha512-Cl6aoLJtXzzBkk1sKod8S0WBJLts3+ugVC91d22gGpbkw/64WnF12tOZi7Rg54PPLi1NovqyNWPsLH/SAFcu+w==", + "peer": true, "requires": { "@vue/compiler-dom": "3.2.22", "@vue/shared": "3.2.22" @@ -1956,26 +2105,49 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.22.tgz", "integrity": "sha512-xNkLAItjI0xB+lFeDgKCrSItmrHTaAzSnt8LmdSCPQnDyarmzbi/u4ESQnckWvlL7lSRKiEaOvblaNyqAa7OnQ==", + "peer": true, "requires": { "@vue/shared": "3.2.22" } }, "@vue/ref-transform": { - "version": "3.2.22", - "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.22.tgz", - "integrity": "sha512-qalVWbq5xWWxLZ0L9OroBg/JZhzavQuCcDXblfErxyDEH6Xc5gIJ4feo1SVCICFzhAUgLgQTdSFLpgjBawbFpw==", + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.24.tgz", + "integrity": "sha512-j6oNbsGLvea2rF8GQB9w6q7UFL1So7J+t6ducaMeWPSyjYZ+slWpwPVK6mmyghg5oGqC41R+HC5BV036Y0KhXQ==", + "dev": true, "requires": { "@babel/parser": "^7.15.0", - "@vue/compiler-core": "3.2.22", - "@vue/shared": "3.2.22", + "@vue/compiler-core": "3.2.24", + "@vue/shared": "3.2.24", "estree-walker": "^2.0.2", "magic-string": "^0.25.7" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.24.tgz", + "integrity": "sha512-A0SxB2HAggKzP57LDin5gfgWOTwFyGCtQ5MTMNBADnfQYALWnYuC8kMI0DhRSplGTWRvn9Z2DAnG8f35BnojuA==", + "dev": true, + "requires": { + "@babel/parser": "^7.15.0", + "@vue/shared": "3.2.24", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/shared": { + "version": "3.2.24", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.24.tgz", + "integrity": "sha512-BUgRiZCkCrqDps5aQ9av05xcge3rn092ztKIh17tHkeEFgP4zfXMQWBA2zfdoCdCEdBL26xtOv+FZYiOp9RUDA==", + "dev": true + } } }, "@vue/runtime-core": { "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.22.tgz", "integrity": "sha512-e7WOC55wmHPvmoVUk9VBe/Z9k5bJfWJfVIlkUkiADJn0bOgQD29oh/GS14Kb3aEJXIHLI17Em6+HxNut1sIh7Q==", + "peer": true, "requires": { "@vue/reactivity": "3.2.22", "@vue/shared": "3.2.22" @@ -1985,6 +2157,7 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.22.tgz", "integrity": "sha512-w7VHYJoliLRTLc5beN77wxuOjla4v9wr2FF22xpZFYBmH4U1V7HkYhoHc1BTuNghI15CXT1tNIMhibI1nrQgdw==", + "peer": true, "requires": { "@vue/runtime-core": "3.2.22", "@vue/shared": "3.2.22", @@ -1995,6 +2168,7 @@ "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.22.tgz", "integrity": "sha512-jCwbQgKPXiXoH9VS9F7K+gyEvEMrjutannwEZD1R8fQ9szmOTqC+RRbIY3Uf2ibQjZtZ8DV9a4FjxICvd9zZlQ==", + "peer": true, "requires": { "@vue/compiler-ssr": "3.2.22", "@vue/shared": "3.2.22" @@ -2003,7 +2177,8 @@ "@vue/shared": { "version": "3.2.22", "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.22.tgz", - "integrity": "sha512-qWVav014mpjEtbWbEgl0q9pEyrrIySKum8UVYjwhC6njrKzknLZPvfuYdQyVbApsqr94tf/3dP4pCuZmmjdCWQ==" + "integrity": "sha512-qWVav014mpjEtbWbEgl0q9pEyrrIySKum8UVYjwhC6njrKzknLZPvfuYdQyVbApsqr94tf/3dP4pCuZmmjdCWQ==", + "peer": true }, "anymatch": { "version": "3.1.2", @@ -2049,7 +2224,8 @@ "csstype": { "version": "2.6.19", "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.19.tgz", - "integrity": "sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==" + "integrity": "sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==", + "peer": true }, "esbuild": { "version": "0.13.13", @@ -2240,6 +2416,12 @@ "function-bind": "^1.1.1" } }, + "immutable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz", + "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==", + "dev": true + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -2436,9 +2618,9 @@ } }, "prosemirror-view": { - "version": "1.23.2", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.23.2.tgz", - "integrity": "sha512-iPgRw6tpcN+KH1yKmSnRmDKsJBVkWLFP6laHcz9rh/n0Ndz7YKKCDldtw6FhHBYoWmZeubbhV/rrQW0VCDG9iw==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.23.3.tgz", + "integrity": "sha512-89icyMdXXwxmTxYj0TIuG5M/d0iKeu79tr+PVtC/4qtCOoHrPSPrblJcFOuOWcxGlA/Ei8PqJB4g5HkKR8jWvQ==", "requires": { "prosemirror-model": "^1.14.3", "prosemirror-state": "^1.0.0", @@ -2500,12 +2682,13 @@ "integrity": "sha512-ku6MFrwEVSVmXLvy3dYph3LAMNS0890K7fabn+0YIRQ2T96T9F4gkFf0vf0WW0JUraNWwGRtInEpH7yO4tbQZg==" }, "sass": { - "version": "1.43.4", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.43.4.tgz", - "integrity": "sha512-/ptG7KE9lxpGSYiXn7Ar+lKOv37xfWsZRtFYal2QHNigyVQDx685VFT/h7ejVr+R8w7H4tmUgtulsKl5YpveOg==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.44.0.tgz", + "integrity": "sha512-0hLREbHFXGQqls/K8X+koeP+ogFRPF4ZqetVB19b7Cst9Er8cOR0rc6RU7MaI4W1JmUShd1BPgPoeqmmgMMYFw==", "dev": true, "requires": { - "chokidar": ">=3.0.0 <4.0.0" + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0" } }, "scheduler": { @@ -2551,28 +2734,62 @@ } }, "vite": { - "version": "2.6.14", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.6.14.tgz", - "integrity": "sha512-2HA9xGyi+EhY2MXo0+A2dRsqsAG3eFNEVIo12olkWhOmc8LfiM+eMdrXf+Ruje9gdXgvSqjLI9freec1RUM5EA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.7.0.tgz", + "integrity": "sha512-ZM629j9n6f1Gcr2KsfpLhJ0FRkift4SsTLSvExmNpGJYzyi1JyLOFybz85ShqFP5f4oCfJSblWAma9X8lZg/vA==", "dev": true, "requires": { - "esbuild": "^0.13.2", + "esbuild": "^0.13.12", "fsevents": "~2.3.2", - "postcss": "^8.3.8", + "postcss": "^8.3.11", "resolve": "^1.20.0", - "rollup": "^2.57.0" + "rollup": "^2.59.0" } }, "vue": { "version": "3.2.22", "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.22.tgz", "integrity": "sha512-KD5nZpXVZquOC6926Xnp3zOvswrUyO9Rya7ZUoxWFQEjFDW4iACtwzubRB4Um2Om9kj6CaJOqAVRDSFlqLpdgw==", + "peer": true, "requires": { "@vue/compiler-dom": "3.2.22", "@vue/compiler-sfc": "3.2.22", "@vue/runtime-dom": "3.2.22", "@vue/server-renderer": "3.2.22", "@vue/shared": "3.2.22" + }, + "dependencies": { + "@vue/compiler-sfc": { + "version": "3.2.22", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.22.tgz", + "integrity": "sha512-tWRQ5ge1tsTDhUwHgueicKJ8rYm6WUVAPTaIpFW3GSwZKcOEJ2rXdfkHFShNVGupeRALz2ET2H84OL0GeRxY0A==", + "peer": true, + "requires": { + "@babel/parser": "^7.15.0", + "@vue/compiler-core": "3.2.22", + "@vue/compiler-dom": "3.2.22", + "@vue/compiler-ssr": "3.2.22", + "@vue/ref-transform": "3.2.22", + "@vue/shared": "3.2.22", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7", + "postcss": "^8.1.10", + "source-map": "^0.6.1" + } + }, + "@vue/ref-transform": { + "version": "3.2.22", + "resolved": "https://registry.npmjs.org/@vue/ref-transform/-/ref-transform-3.2.22.tgz", + "integrity": "sha512-qalVWbq5xWWxLZ0L9OroBg/JZhzavQuCcDXblfErxyDEH6Xc5gIJ4feo1SVCICFzhAUgLgQTdSFLpgjBawbFpw==", + "peer": true, + "requires": { + "@babel/parser": "^7.15.0", + "@vue/compiler-core": "3.2.22", + "@vue/shared": "3.2.22", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + } + } } }, "w3c-keyname": { diff --git a/package.json b/package.json index 8becbfb..12dc283 100644 --- a/package.json +++ b/package.json @@ -6,34 +6,33 @@ "watch": "vite build --mode development --watch" }, "dependencies": { - "@tabler/icons": "^1.44.0", - "@tiptap/core": "^2.0.0-beta.141", - "@tiptap/extension-blockquote": "^2.0.0-beta.24", - "@tiptap/extension-bullet-list": "^2.0.0-beta.23", + "@tabler/icons": "^1.46.0", + "@tiptap/core": "^2.0.0-beta.150", + "@tiptap/extension-blockquote": "^2.0.0-beta.26", + "@tiptap/extension-bullet-list": "^2.0.0-beta.24", "@tiptap/extension-character-count": "^2.0.0-beta.18", - "@tiptap/extension-code-block": "^2.0.0-beta.29", + "@tiptap/extension-code-block": "^2.0.0-beta.31", "@tiptap/extension-document": "^2.0.0-beta.15", - "@tiptap/extension-heading": "^2.0.0-beta.23", + "@tiptap/extension-heading": "^2.0.0-beta.24", "@tiptap/extension-history": "^2.0.0-beta.21", "@tiptap/extension-horizontal-rule": "^2.0.0-beta.30", "@tiptap/extension-image": "^2.0.0-beta.24", - "@tiptap/extension-list-item": "^2.0.0-beta.19", - "@tiptap/extension-ordered-list": "^2.0.0-beta.24", - "@tiptap/extension-paragraph": "^2.0.0-beta.22", - "@tiptap/extension-task-item": "^2.0.0-beta.28", - "@tiptap/extension-task-list": "^2.0.0-beta.23", + "@tiptap/extension-list-item": "^2.0.0-beta.20", + "@tiptap/extension-ordered-list": "^2.0.0-beta.25", + "@tiptap/extension-paragraph": "^2.0.0-beta.23", + "@tiptap/extension-task-item": "^2.0.0-beta.30", + "@tiptap/extension-task-list": "^2.0.0-beta.24", "@tiptap/extension-text": "^2.0.0-beta.15", - "@tiptap/extension-text-align": "^2.0.0-beta.28", + "@tiptap/extension-text-align": "^2.0.0-beta.29", "@tiptap/extension-typography": "^2.0.0-beta.19", - "@tiptap/extension-underline": "^2.0.0-beta.21", - "@tiptap/starter-kit": "^2.0.0-beta.143", - "@tiptap/vue-3": "^2.0.0-beta.81", - "vue": "^3.2.22" + "@tiptap/extension-underline": "^2.0.0-beta.22", + "@tiptap/starter-kit": "^2.0.0-beta.153", + "@tiptap/vue-3": "^2.0.0-beta.82" }, "devDependencies": { - "@vitejs/plugin-vue": "^1.10.0", - "@vue/compiler-sfc": "^3.2.22", - "sass": "^1.43.4", - "vite": "^2.6.14" + "@vitejs/plugin-vue": "^1.10.2", + "@vue/compiler-sfc": "^3.2.24", + "sass": "^1.44.0", + "vite": "^2.7.0" } }