@opengis/richtext 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -3
- package/dist/richtext.css +1 -1
- package/dist/richtext.js +17581 -19070
- package/dist/richtext.umd.cjs +157 -175
- package/package.json +19 -39
package/dist/richtext.umd.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
(function(y,De){typeof exports=="object"&&typeof module<"u"?module.exports=De(require("vue")):typeof define=="function"&&define.amd?define(["vue"],De):(y=typeof globalThis<"u"?globalThis:y||self,y.richtext=De(y.Vue))})(this,function(y){"use strict";function De(t){this.content=t}De.prototype={constructor:De,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new De(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new De(n)},addToStart:function(t,e){return new De([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new De(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new De(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=De.from(t),t.size?new De(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=De.from(t),t.size?new De(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=De.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},De.from=function(t){if(t instanceof De)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new De(e)};function Cu(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=Cu(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function Su(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=Su(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class V{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new V(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new V(r,o)}cutByIndex(e,n){return e==n?V.empty:e==0&&n==this.content.length?this:new V(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new V(o,i)}addToStart(e){return new V([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new V(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Cu(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Su(this,e,n,r)}findIndex(e,n=-1){if(e==0)return fi(0,e);if(e==this.size)return fi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?fi(r+1,s):fi(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return V.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new V(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return V.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new V(n||e,r)}static from(e){if(!e)return V.empty;if(e instanceof V)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new V([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V.empty=new V([],0);const ma={index:0,offset:0};function fi(t,e){return ma.index=t,ma.offset=e,ma}function pi(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!pi(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!pi(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let _e=class ku{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&pi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ku.none;if(e instanceof ku)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};_e.none=[];class hi extends Error{}class W{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Nu(this.content,e+this.openStart,n);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,n){return new W(Tu(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return W.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(V.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new W(e,r,o)}}W.empty=new W(V.empty,0,0);function Tu(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Tu(i.content,e-o-1,n-o-1)))}function Nu(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Nu(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function z0(t,e,n){if(n.openStart>t.depth)throw new hi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hi("Inconsistent open depths");return Au(t,e,n,0)}function Au(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=Au(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return nr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=j0(n,t);return nr(i,Mu(t,s,a,e,r))}else return nr(i,mi(t,e,r))}function Ou(t,e){if(!e.type.compatibleContent(t.type))throw new hi("Cannot join "+e.type.name+" onto "+t.type.name)}function ga(t,e,n){let r=t.node(n);return Ou(r,e.node(n)),r}function tr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function uo(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(tr(t.nodeAfter,r),i++));for(let a=i;a<s;a++)tr(o.child(a),r);e&&e.depth==n&&e.textOffset&&tr(e.nodeBefore,r)}function nr(t,e){return t.type.checkContent(e),t.copy(e)}function Mu(t,e,n,r,o){let i=t.depth>o&&ga(t,e,o+1),s=r.depth>o&&ga(n,r,o+1),a=[];return uo(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(Ou(i,s),tr(nr(i,Mu(t,e,n,r,o+1)),a)):(i&&tr(nr(i,mi(t,e,o+1)),a),uo(e,n,o,a),s&&tr(nr(s,mi(n,r,o+1)),a)),uo(r,null,o,a),new V(a)}function mi(t,e,n){let r=[];if(uo(null,t,n,r),t.depth>n){let o=ga(t,e,n+1);tr(nr(o,mi(t,e,n+1)),r)}return uo(e,null,n,r),new V(r)}function j0(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(V.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class fo{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new gi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new fo(n,r,i)}static resolveCached(e,n){let r=xu.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else xu.set(e,r=new U0);let o=r.elts[r.i]=fo.resolve(e,n);return r.i=(r.i+1)%W0,o}}class U0{constructor(){this.elts=[],this.i=0}}const W0=12,xu=new WeakMap;class gi{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const K0=Object.create(null);let On=class _u{constructor(e,n,r,o=_e.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||V.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&pi(this.attrs,n||e.defaultAttrs||K0)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new _u(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new _u(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return W.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new W(c,o.depth-s,i.depth-s)}replace(e,n,r){return z0(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return fo.resolveCached(this,e)}resolveNoCache(e){return fo.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Lu(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=V.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=V.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};On.prototype.text=void 0;class bi extends On{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Lu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new bi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new bi(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Lu(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class rr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new q0(e,n);if(r.next==null)return rr.empty;let o=Ru(r);r.next&&r.err("Unexpected trailing text");let i=eb(Z0(o));return tb(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return V.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:f}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(f)==-1){o.push(f);let p=i(f,a.concat(u));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
|
|
2
|
-
`)}}rr.empty=new rr(!0);class q0{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ru(t){let e=[];do e.push(G0(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function G0(t){let e=[];do e.push(J0(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function J0(t){let e=Q0(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Y0(t,e);else break;return e}function Pu(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Y0(t,e){let n=Pu(t),r=n;return t.eat(",")&&(t.next!="}"?r=Pu(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function X0(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Q0(t){if(t.eat("(")){let e=Ru(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=X0(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Z0(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Iu(t,e){return e-t}function Du(t,e){let n=[];return r(e),n.sort(Iu);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function eb(t){let e=Object.create(null);return n(Du(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);Du(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new rr(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(Iu);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function tb(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Bu(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Fu(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function $u(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function Vu(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new rb(t,r,e[r]);return n}let Hu=class $0{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Vu(e,r.attrs),this.defaultAttrs=Bu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==rr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Fu(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new On(this,this.computeAttrs(e),V.from(n),_e.setFrom(r))}createChecked(e=null,n,r){return n=V.from(n),this.checkContent(n),new On(this,this.computeAttrs(e),n,_e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=V.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(V.empty,!0);return i?new On(this,e,n.append(i),_e.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){$u(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:_e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new $0(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function nb(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class rb{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?nb(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class yi{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=Vu(e,o.attrs),this.excluded=null;let i=Bu(this.attrs);this.instance=i?new _e(this,i):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,Fu(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new yi(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){$u(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class zu{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=De.from(e.nodes),n.marks=De.from(e.marks||{}),this.nodes=Hu.compile(this.spec.nodes,this),this.marks=yi.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=rr.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?ju(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:ju(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Hu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new bi(r,r.defaultAttrs,e,_e.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return On.fromJSON(this,e)}markFromJSON(e){return _e.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function ju(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function ob(t){return t.tag!=null}function ib(t){return t.style!=null}let Mr=class Eu{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(ob(o))this.tags.push(o);else if(ib(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new qu(this,n,!1);return r.addAll(e,_e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new qu(this,n,!0);return r.addAll(e,_e.none,n.from,n.to),W.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(lb(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Gu(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Gu(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Eu(e,Eu.schemaRules(e)))}};const Uu={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},sb={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wu={ol:!0,ul:!0},po=1,ba=2,ho=4;function Ku(t,e,n){return e!=null?(e?po:0)|(e==="full"?ba:0):t&&t.whitespace=="pre"?po|ba:n&~ho}class wi{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=_e.none,this.match=i||(s&ho?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(V.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&po)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=V.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Uu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qu{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=Ku(null,n.preserveWhitespace,0)|(r?ho:0);o?i=new wi(o.type,o.attrs,_e.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new wi(null,null,_e.none,!0,null,s):i=new wi(e.schema.topNodeType,null,_e.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&ba?"full":this.localPreserveWS||(o.options&po)>0;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)i!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
3
|
-
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let
|
|
4
|
-
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!o||o.length>c.length+a)&&(o=c,i=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=_e.none;for(let a of o.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):Ju(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Ku(e,i,s.options);s.options&ho&&s.content.length==0&&(a|=ho);let l=_e.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Ju(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new wi(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=po)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function ab(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Wu.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function lb(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Gu(t){let e={};for(let n in t)e[n]=t[n];return e}function Ju(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class or{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ya(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=ki(ya(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&ki(ya(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return ki(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new or(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Yu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Yu(e.marks)}}function Yu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ya(t){return t.document||window.document}const Xu=new WeakMap;function cb(t){let e=Xu.get(t);return e===void 0&&Xu.set(t,e=ub(t)),e}function ub(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function ki(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=cb(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),c[f]):l.setAttribute(f,c[f])}}for(let f=u;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:b}=ki(t,p,n,r);if(l.appendChild(m),b){if(a)throw new RangeError("Multiple content holes");a=b}}}return{dom:l,contentDOM:a}}const Qu=65535,Zu=Math.pow(2,16);function db(t,e){return t+e*Zu}function ed(t){return t&Qu}function fb(t){return(t-(t&Qu))/Zu}const td=1,nd=2,_i=4,rd=8;class wa{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&rd)>0}get deletedBefore(){return(this.delInfo&(td|_i))>0}get deletedAfter(){return(this.delInfo&(nd|_i))>0}get deletedAcross(){return(this.delInfo&_i)>0}}class vt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&vt.empty)return vt.empty}recover(e){let n=0,r=ed(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+fb(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+s],f=l+c;if(e<=f){let p=c?e==l?-1:e==f?1:n:n,m=l+o+(p<0?0:u);if(r)return m;let b=e==(n<0?l:f)?null:db(a/3,e-l),k=e==l?nd:e==f?td:_i;return(n<0?e!=l:e!=f)&&(k|=rd),new wa(m,k,b)}o+=u-c}return r?e+o:new wa(e+o,0,null)}touches(e,n){let r=0,o=ed(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new vt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?vt.empty:new vt(e<0?[0,-e,0]:[0,0,e])}}vt.empty=new vt([]);class mo{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new mo(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new mo;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new wa(e,o,null)}}const ka=Object.create(null);class Ye{getMap(){return vt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ka[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in ka)throw new RangeError("Duplicate use of step JSON ID "+e);return ka[e]=n,n.prototype.jsonID=e,n}}class Fe{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Fe(e,null)}static fail(e){return new Fe(null,e)}static fromReplace(e,n,r,o){try{return Fe.ok(e.replace(n,r,o))}catch(i){if(i instanceof hi)return Fe.fail(i.message);throw i}}}function _a(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(_a(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return V.fromArray(r)}class Mn extends Ye{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new W(_a(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,i)}invert(){return new Yt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Mn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Mn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Mn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Mn(n.from,n.to,e.markFromJSON(n.mark))}}Ye.jsonID("addMark",Mn);class Yt extends Ye{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new W(_a(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,r)}invert(){return new Mn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Yt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Yt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Yt(n.from,n.to,e.markFromJSON(n.mark))}}Ye.jsonID("removeMark",Yt);class xn extends Ye{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new W(V.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new xn(this.pos,n.marks[o]);return new xn(this.pos,this.mark)}}return new ir(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new xn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new xn(n.pos,e.markFromJSON(n.mark))}}Ye.jsonID("addNodeMark",xn);class ir extends Ye{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new W(V.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new xn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ir(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ir(n.pos,e.markFromJSON(n.mark))}}Ye.jsonID("removeNodeMark",ir);class ze extends Ye{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Ea(e,this.from,this.to)?Fe.fail("Structure replace would overwrite content"):Fe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new vt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ze(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ze(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ze)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?W.empty:new W(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ze(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?W.empty:new W(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ze(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ze(n.from,n.to,W.fromJSON(e,n.slice),!!n.structure)}}Ye.jsonID("replace",ze);class je extends Ye{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Ea(e,this.from,this.gapFrom)||Ea(e,this.gapTo,this.to)))return Fe.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Fe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Fe.fromReplace(e,this.from,this.to,r):Fe.fail("Content does not fit in gap")}getMap(){return new vt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new je(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new je(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new je(n.from,n.to,n.gapFrom,n.gapTo,W.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ye.jsonID("replaceAround",je);function Ea(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function pb(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),m=Math.min(c+l.nodeSize,n),b=r.addToSet(f);for(let k=0;k<f.length;k++)f[k].isInSet(b)||(s&&s.to==p&&s.mark.eq(f[k])?s.to=m:o.push(s=new Yt(p,m,f[k])));a&&a.to==p?a.to=m:i.push(a=new Mn(p,m,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function hb(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof yi){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],p;for(let m=0;m<o.length;m++){let b=o[m];b.step==i-1&&f.eq(o[m].style)&&(p=b)}p?(p.to=c,p.step=i):o.push({style:f,from:Math.max(a,e),to:c,step:i})}}}),o.forEach(s=>t.step(new Yt(s.from,s.to,s.style)))}function va(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=a+c.nodeSize,f=r.matchType(c.type);if(!f)s.push(new ze(a,u,W.empty));else{r=f;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||t.step(new Yt(a,u,c.marks[p]));if(o&&c.isText&&n.whitespace!="pre"){let p,m=/\r?\n|\r/g,b;for(;p=m.exec(c.text);)b||(b=new W(V.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new ze(a+p.index,a+p.index+p[0].length,b))}}a=u}if(!r.validEnd){let l=r.fillBefore(V.empty,!0);t.replace(a,a,new W(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function mb(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function xr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!mb(o,i,s))break}return null}function gb(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=V.empty,f=0;for(let b=i,k=!1;b>n;b--)k||r.index(b)>0?(k=!0,u=V.from(r.node(b).copy(u)),f++):l--;let p=V.empty,m=0;for(let b=i,k=!1;b>n;b--)k||o.after(b+1)<o.end(b)?(k=!0,p=V.from(o.node(b).copy(p)),m++):c++;t.step(new je(l,c,s,a,new W(u.append(p),f,m),u.size-f,!0))}function Ca(t,e,n=null,r=t){let o=bb(t,e),i=o&&yb(r,e);return i?o.map(od).concat({type:e,attrs:n}).concat(i.map(od)):null}function od(t){return{type:t,attrs:null}}function bb(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function yb(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function wb(t,e,n){let r=V.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=V.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new je(o,i,o,i,new W(r,0,0),n.length,!0))}function kb(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&_b(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let m=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);m&&!b?c=!1:!m&&b&&(c=!0)}c===!1&&sd(t,s,a,i),va(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),f=u.map(a,1),p=u.map(a+s.nodeSize,1);return t.step(new je(f,p,f+1,p-1,new W(V.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&id(t,s,a,i),!1}})}function id(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function sd(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
5
|
-
`))}})}function _b(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function Eb(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new je(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new W(V.from(s),0,0),1,!0))}function fn(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,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(let c=o.depth-1,u=n-2;c>i;c--,u--){let f=o.node(c),p=o.index(c);if(f.type.spec.isolating)return!1;let m=f.content.cutByIndex(p,f.childCount),b=r&&r[u+1];b&&(m=m.replaceChild(0,b.type.create(b.attrs)));let k=r&&r[u]||f;if(!f.canReplace(p+1,f.childCount)||!k.type.validContent(m))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function vb(t,e,n=1,r){let o=t.doc.resolve(e),i=V.empty,s=V.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=V.from(o.node(a).copy(i));let u=r&&r[c];s=V.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new ze(e,e,new W(i.append(s),n,n),!0))}function Ln(t,e){let n=t.resolve(e),r=n.index();return ad(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Cb(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function ad(t,e){return!!(t&&e&&!t.isLeaf&&Cb(t,e))}function Ei(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&ad(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Sb(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(o);u&&!f?r=!1:!u&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);sd(t,u.node(),u.before(),a)}s.inlineContent&&va(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new ze(c,l.map(e+n,-1),W.empty,!0)),r===!0){let u=t.doc.resolve(c);id(t,u.node(),u.before(),t.steps.length)}return t}function Tb(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Nb(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let f=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function vi(t,e,n=e,r=W.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return ld(o,i,r)?new ze(e,n,r):new Ab(o,i,r).fit()}function ld(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Ab{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=V.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=V.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new W(i,s,a);return e>-1?new je(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new ze(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Sa(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(n==1&&(s?c.matchType(s.type)||(f=c.fillBefore(V.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:f};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Sa(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new W(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Sa(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new W(go(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new W(go(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let k=0;k<i.length;k++)this.openFrontierNode(i[k]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:f,type:p}=this.frontier[n];if(o){for(let k=0;k<o.childCount;k++)u.push(o.child(k));f=f.matchFragment(o)}let m=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let k=a.child(c),_=f.matchType(k.type);if(!_)break;c++,(c>1||l==0||k.content.size)&&(f=_,u.push(cd(k.mark(p.allowedMarks(k.marks)),c==1?l:0,c==a.childCount?m:-1)))}let b=c==a.childCount;b||(m=-1),this.placed=bo(this.placed,n,V.from(u)),this.frontier[n].match=f,b&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let k=0,_=a;k<m;k++){let E=_.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),_=E.content}this.unplaced=b?e==0?W.empty:new W(go(s.content,e-1,1),e-1,m<0?s.openEnd:e-1):new W(go(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ta(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Ta(e,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Ta(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=bo(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=bo(this.placed,this.depth,V.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(V.empty,!0);n.childCount&&(this.placed=bo(this.placed,this.frontier.length,n))}}function go(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(go(t.firstChild.content,e-1,n)))}function bo(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(bo(t.lastChild.content,e-1,n)))}function Sa(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function cd(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,cd(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(V.empty,!0)))),t.copy(r)}function Ta(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!Ob(n,i.content,s)?a:null}function Ob(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Mb(t){return t.spec.defining||t.spec.definingForContent}function xb(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(ld(o,i,r))return t.step(new ze(e,n,r));let s=dd(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let p=o.depth,m=o.pos-1;p>0;p--,m--){let b=o.node(p).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==m&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],u=r.openStart;for(let p=r.content,m=0;;m++){let b=p.firstChild;if(c.push(b),m==r.openStart)break;p=b.content}for(let p=u-1;p>=0;p--){let m=c[p],b=Mb(m.type);if(b&&!m.sameMarkup(o.node(Math.abs(a)-1)))u=p;else if(b||!m.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let m=(p+u+1)%(r.openStart+1),b=c[m];if(b)for(let k=0;k<s.length;k++){let _=s[(k+l)%s.length],E=!0;_<0&&(E=!1,_=-_);let N=o.node(_-1),A=o.index(_-1);if(N.canReplaceWith(A,A,b.type,b.marks))return t.replace(o.before(_),E?i.after(_):n,new W(ud(r.content,0,r.openStart,m),m,r.openEnd))}}let f=t.steps.length;for(let p=s.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>f));p--){let m=s[p];m<0||(e=o.before(m),n=i.after(m))}}function ud(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(ud(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(V.empty,!0))}return t}function Lb(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=Tb(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new W(V.from(r),0,0))}function Rb(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=dd(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function dd(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Lr extends Ye{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Fe.fromReplace(e,this.pos,this.pos+1,new W(V.from(o),0,n.isLeaf?0:1))}getMap(){return vt.empty}invert(e){return new Lr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Lr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Lr(n.pos,n.attr,n.value)}}Ye.jsonID("attr",Lr);class yo extends Ye{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Fe.ok(r)}getMap(){return vt.empty}invert(e){return new yo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new yo(n.attr,n.value)}}Ye.jsonID("docAttr",yo);let Rr=class extends Error{};Rr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Rr.prototype=Object.create(Error.prototype),Rr.prototype.constructor=Rr,Rr.prototype.name="TransformError";class Na{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new mo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Rr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=W.empty){let o=vi(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new W(V.from(r),0,0))}delete(e,n){return this.replace(e,n,W.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return xb(this,e,n,r),this}replaceRangeWith(e,n,r){return Lb(this,e,n,r),this}deleteRange(e,n){return Rb(this,e,n),this}lift(e,n){return gb(this,e,n),this}join(e,n=1){return Sb(this,e,n),this}wrap(e,n){return wb(this,e,n),this}setBlockType(e,n=e,r,o=null){return kb(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return Eb(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Lr(e,n,r)),this}setDocAttribute(e,n){return this.step(new yo(e,n)),this}addNodeMark(e,n){return this.step(new xn(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof _e)n.isInSet(r.marks)&&this.step(new ir(e,n));else{let o=r.marks,i,s=[];for(;i=n.isInSet(o);)s.push(new ir(e,i)),o=i.removeFromSet(o);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(e,n=1,r){return vb(this,e,n,r),this}addMark(e,n,r){return pb(this,e,n,r),this}removeMark(e,n,r){return hb(this,e,n,r),this}clearIncompatible(e,n,r){return va(this,e,n,r),this}}const Aa=Object.create(null);class ee{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new fd(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=W.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?W.empty:n),a==0&&md(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),md(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new te(e):Pr(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?Pr(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Pr(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ot(e.node(0))}static atStart(e){return Pr(e,e,0,0,1)||new Ot(e)}static atEnd(e){return Pr(e,e,e.content.size,e.childCount,-1)||new Ot(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Aa[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Aa)throw new RangeError("Duplicate use of selection JSON ID "+e);return Aa[e]=n,n.prototype.jsonID=e,n}getBookmark(){return te.between(this.$anchor,this.$head).getBookmark()}}ee.prototype.visible=!0;class fd{constructor(e,n){this.$from=e,this.$to=n}}let pd=!1;function hd(t){!pd&&!t.parent.inlineContent&&(pd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class te extends ee{constructor(e,n=e){hd(e),hd(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ee.near(r);let o=e.resolve(n.map(this.anchor));return new te(o.parent.inlineContent?o:r,r)}replace(e,n=W.empty){if(super.replace(e,n),n==W.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof te&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ci(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new te(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=ee.findFrom(n,r,!0)||ee.findFrom(n,-r,!0);if(i)n=i.$head;else return ee.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(ee.findFrom(e,-r,!0)||ee.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new te(e,n)}}ee.jsonID("text",te);class Ci{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ci(e.map(this.anchor),e.map(this.head))}resolve(e){return te.between(e.resolve(this.anchor),e.resolve(this.head))}}class Q extends ee{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?ee.near(i):new Q(i)}content(){return new W(V.from(this.node),0,0)}eq(e){return e instanceof Q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Oa(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Q(e.resolve(n.anchor))}static create(e,n){return new Q(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Q.prototype.visible=!1,ee.jsonID("node",Q);class Oa{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ci(r,r):new Oa(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Q.isSelectable(r)?new Q(n):ee.near(n)}}class Ot extends ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=W.empty){if(n==W.empty){e.delete(0,e.doc.content.size);let r=ee.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ot(e)}map(e){return new Ot(e)}eq(e){return e instanceof Ot}getBookmark(){return Pb}}ee.jsonID("all",Ot);const Pb={map(){return this},resolve(t){return new Ot(t)}};function Pr(t,e,n,r,o,i=!1){if(e.inlineContent)return te.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&Q.isSelectable(a))return Q.create(t,n-(o<0?a.nodeSize:0))}else{let l=Pr(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function md(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof ze||o instanceof je))return;let i=t.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(ee.near(t.doc.resolve(s),n))}const gd=1,Si=2,bd=4;class Ib extends Na{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|gd)&~Si,this.storedMarks=null,this}get selectionSet(){return(this.updated&gd)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Si,this}ensureMarks(e){return _e.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Si)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Si,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||_e.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(ee.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=bd,this}get scrolledIntoView(){return(this.updated&bd)>0}}function yd(t,e){return!e||!t?t:t.bind(e)}class wo{constructor(e,n,r){this.name=e,this.init=yd(n.init,r),this.apply=yd(n.apply,r)}}const Db=[new wo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new wo("selection",{init(t,e){return t.selection||ee.atStart(e.doc)},apply(t){return t.selection}}),new wo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new wo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Ma{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Db.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new wo(r.key,r.spec.state,r))})}}class Ir{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let f=0;f<this.config.plugins.length;f++)o.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ir(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new Ib(this)}static create(e){let n=new Ma(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ir(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Ma(this.schema,e.plugins),r=n.fields,o=new Ir(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Ma(e.schema,e.plugins),i=new Ir(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=On.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=ee.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function wd(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=wd(o,e,{})),n[r]=o}return n}class $e{constructor(e){this.spec=e,this.props={},e.props&&wd(e.props,this,this.props),this.key=e.key?e.key.key:kd("plugin")}getState(e){return e[this.key]}}const xa=Object.create(null);function kd(t){return t in xa?t+"$"+ ++xa[t]:(xa[t]=0,t+"$")}class Ue{constructor(e="key"){this.key=kd(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ge=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Dr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let La=null;const pn=function(t,e,n){let r=La||(La=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Bb=function(){La=null},sr=function(t,e,n,r){return n&&(_d(t,e,n,r,-1)||_d(t,e,n,r,1))},Fb=/^(img|br|input|textarea|hr)$/i;function _d(t,e,n,r,o){for(var i;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Mt(t))){let s=t.parentNode;if(!s||s.nodeType!=1||ko(t)||Fb.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ge(t)+(o<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(o<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=o;else return!1;else t=s,e=o<0?Mt(t):0}else return!1}}function Mt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function $b(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Mt(t)}else if(t.parentNode&&!ko(t))e=Ge(t),t=t.parentNode;else return null}}function Vb(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ko(t))e=Ge(t)+1,t=t.parentNode;else return null}}function Hb(t,e,n){for(let r=e==0,o=e==Mt(t);r||o;){if(t==n)return!0;let i=Ge(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==Mt(t)}}function ko(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Ti=function(t){return t.focusNode&&sr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ar(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function zb(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jb(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Mt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Mt(r.startContainer),r.startOffset)}}}const Xt=typeof navigator<"u"?navigator:null,Ed=typeof document<"u"?document:null,Rn=Xt&&Xt.userAgent||"",Ra=/Edge\/(\d+)/.exec(Rn),vd=/MSIE \d/.exec(Rn),Pa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rn),pt=!!(vd||Pa||Ra),Pn=vd?document.documentMode:Pa?+Pa[1]:Ra?+Ra[1]:0,jt=!pt&&/gecko\/(\d+)/i.test(Rn);jt&&+(/Firefox\/(\d+)/.exec(Rn)||[0,0])[1];const Ia=!pt&&/Chrome\/(\d+)/.exec(Rn),Xe=!!Ia,Cd=Ia?+Ia[1]:0,it=!pt&&!!Xt&&/Apple Computer/.test(Xt.vendor),Br=it&&(/Mobile\/\w+/.test(Rn)||!!Xt&&Xt.maxTouchPoints>2),xt=Br||(Xt?/Mac/.test(Xt.platform):!1),Ub=Xt?/Win/.test(Xt.platform):!1,hn=/Android \d/.test(Rn),_o=!!Ed&&"webkitFontSmoothing"in Ed.documentElement.style,Wb=_o?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Kb(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function mn(t,e){return typeof t=="number"?t:t[e]}function qb(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Sd(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=Dr(s);continue}let a=s,l=a==i.body,c=l?Kb(i):qb(a),u=0,f=0;if(e.top<c.top+mn(r,"top")?f=-(c.top-e.top+mn(o,"top")):e.bottom>c.bottom-mn(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+mn(o,"top")-c.top:e.bottom-c.bottom+mn(o,"bottom")),e.left<c.left+mn(r,"left")?u=-(c.left-e.left+mn(o,"left")):e.right>c.right-mn(r,"right")&&(u=e.right-c.right+mn(o,"right")),u||f)if(l)i.defaultView.scrollBy(u,f);else{let m=a.scrollLeft,b=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let k=a.scrollLeft-m,_=a.scrollTop-b;e={left:e.left-k,top:e.top-_,right:e.right-k,bottom:e.bottom-_}}let p=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(p))break;s=p=="absolute"?s.offsetParent:Dr(s)}}function Gb(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:Td(t.dom)}}function Td(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Dr(r));return e}function Jb({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Nd(n,r==0?0:r-e)}function Nd(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Fr=null;function Yb(t){if(t.setActive)return t.setActive();if(Fr)return t.focus(Fr);let e=Td(t);t.focus(Fr==null?{get preventScroll(){return Fr={preventScroll:!0},!0}}:void 0),Fr||(Fr=!1,Nd(e,0))}function Ad(t,e){let n,r=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=pn(u).getClientRects();else continue;for(let m=0;m<p.length;m++){let b=p[m];if(b.top<=s&&b.bottom>=a){s=Math.max(b.bottom,s),a=Math.min(b.top,a);let k=b.left>e.left?b.left-e.left:b.right<e.left?e.left-b.right:0;if(k<r){n=u,r=k,o=k&&n.nodeType==3?{left:b.right<e.left?b.right:b.left,top:e.top}:e,u.nodeType==1&&k&&(i=f+(e.left>=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!l&&b.left<=e.left&&b.right>=e.left&&(l=u,c={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(i=f+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?Xb(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:Ad(n,o)}function Xb(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=In(r,1);if(i.top!=i.bottom&&Da(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function Da(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Qb(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Zb(t,e,n){let{node:r,offset:o}=Ad(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function ey(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function Od(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Da(e,c))return Od(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function ty(t,e){let n=t.dom.ownerDocument,r,o=0,i=jb(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!Da(e,c)||(s=Od(t.dom,e,c),!s))return null}if(it)for(let c=s;r&&c;c=Dr(c))c.draggable&&(r=void 0);if(s=Qb(s,e),r){if(jt&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&o++}let c;_o&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=ey(t,r,o,e))}a==null&&(a=Zb(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Md(t){return t.top<t.bottom||t.left<t.right}function In(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Md(r))return r}return Array.prototype.find.call(n,Md)||t.getBoundingClientRect()}const ny=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function xd(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=_o||jt;if(r.nodeType==3)if(s&&(ny.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=In(pn(r,o,o),n);if(jt&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=In(pn(r,o-1,o-1),-1);if(c.top==l.top){let u=In(pn(r,o,o+1),-1);if(u.top!=l.top)return Eo(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Eo(In(pn(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Mt(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Ba(l.getBoundingClientRect(),!1)}if(i==null&&o<Mt(r)){let l=r.childNodes[o];if(l.nodeType==1)return Ba(l.getBoundingClientRect(),!0)}return Ba(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==Mt(r))){let l=r.childNodes[o-1],c=l.nodeType==3?pn(l,Mt(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Eo(In(c,1),!1)}if(i==null&&o<Mt(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?pn(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Eo(In(c,-1),!0)}return Eo(In(r.nodeType==3?pn(r):r,-n),n>=0)}function Eo(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ba(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Ld(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function ry(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Ld(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=xd(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=pn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const oy=/[\u0590-\u08ac]/;function iy(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!oy.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:Ld(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let m=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:k}=t.domSelectionRange(),_=b&&!m.contains(b.nodeType==1?b:b.parentNode)||l==b&&c==k;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch{}return p!=null&&(a.caretBidiLevel=p),_}):r.pos==r.start()||r.pos==r.end()}let Rd=null,Pd=null,Id=!1;function sy(t,e,n){return Rd==e&&Pd==n?Id:(Rd=e,Pd=n,Id=n=="up"||n=="down"?ry(t,e,n):iy(t,e,n))}const Lt=0,Dd=1,lr=2,Qt=3;class vo{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Lt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Ge(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)for(let s=0;s<o.children.length;s++){let a=o.children[s];if(a.size){o=a;break}}return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>e||s instanceof $d){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Bd&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Ge(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Ge(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let f=a;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=Ge(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){i=Ge(f.dom);break}n+=f.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let m=0,b=0;m<this.children.length;m++){let k=this.children[m],_=b+k.size;if(i>b&&s<_)return k.setSelection(e-b-k.border,n-b-k.border,r,o);b=_}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((jt||it)&&e==n){let{node:m,offset:b}=a;if(m.nodeType==3){if(f=!!(b&&m.nodeValue[b-1]==`
|
|
6
|
-
`),f&&b==m.nodeValue.length)for(let k=m,_;k;k=k.parentNode){if(_=k.nextSibling){_.nodeName=="BR"&&(a=l={node:_.parentNode,offset:Ge(_)+1});break}let E=k.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let k=m.childNodes[b-1];f=k&&(k.nodeName=="BR"||k.contentEditable=="false")}}if(jt&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let m=u.focusNode.childNodes[u.focusOffset];m&&m.contentEditable=="false"&&(o=!0)}if(!(o||f&&it)&&sr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&sr(l.node,l.offset,u.focusNode,u.focusOffset))return;let p=!1;if((c.extend||e==n)&&!f){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>n){let b=a;a=l,l=b}let m=document.createRange();m.setEnd(l.node,l.offset),m.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?lr:Dd,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Qt:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?lr:Qt}r=s}this.dirty=lr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?lr:Dd;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Bd extends vo{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==Lt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ay extends vo{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class cr extends vo{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=or.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new cr(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Qt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Qt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Lt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Lt}}slice(e,n,r){let o=cr.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=$a(i,n,s,r)),e>0&&(i=$a(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Dn extends vo{constructor(e,n,r,o,i,s,a,l,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=or.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let p=u;return u=zd(u,r,n),c?l=new ly(e,n,r,o,u,f||null,p,c,i,s+1):n.isText?new Ni(e,n,r,o,u,p,i):new Dn(e,n,r,o,u,f||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>V.empty)}return e}matchesNode(e,n,r){return this.dirty==Lt&&e.eq(this.node)&&Ai(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new uy(this,s&&s.node,e);py(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?_e.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,f,p)=>{l.syncToMarks(c.marks,r,e);let m;l.findNodeMatch(c,u,f,p)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(m=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,f,m,e)||l.updateNextNode(c,u,f,e,p,o)||l.addNode(c,u,f,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==lr)&&(s&&this.protectLocalComposition(e,s),Vd(this.contentDOM,this.children,e),Br&&hy(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof te)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=my(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new ay(this,i,n,o);e.input.compositionNodes.push(s),this.children=$a(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==Qt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Lt}updateOuterDeco(e){if(Ai(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Hd(this.dom,this.nodeDOM,Fa(this.outerDeco,this.node,n),Fa(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Fd(t,e,n,r,o){zd(r,e,t);let i=new Dn(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ni extends Dn{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==Qt||this.dirty!=Lt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Lt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Lt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Ni(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Qt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class $d extends vo{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Lt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class ly extends Dn{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==Qt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Vd(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=jd(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof cr){let l=r?r.previousSibling:t.lastChild;Vd(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=jd(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Co=function(t){t&&(this.nodeName=t)};Co.prototype=Object.create(null);const ur=[new Co];function Fa(t,e,n){if(t.length==0)return ur;let r=n?ur[0]:new Co,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Co(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new Co(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function Hd(t,e,n,r){if(n==ur&&r==ur)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=ur[0]),o=l}cy(o,a||ur[0],s)}return o}function cy(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function zd(t,e,n){return Hd(t,t,ur,Fa(e,n,t.nodeType!=1))}function Ai(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function jd(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class uy{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=dy(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=Lt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=cr.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==Qt&&s.dom==s.contentDOM&&(s.dirty=lr),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Dn){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,f,p=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Qt&&Ai(n,l.outerDeco));if(!p&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(l,e,n,r,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=lr,f.updateChildren(o,s+1),f.dirty=Lt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Ai(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=Dn.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,o,i){let s=Dn.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new Bd(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof cr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ni)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((it||Xe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new $d(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function dy(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof cr)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function fy(t,e){return t.type.side-e.type.side}function py(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,f;for(;s<o.length&&o[s].to==i;){let _=o[s++];_.widget&&(u?(f||(f=[u])).push(_):u=_)}if(u)if(f){f.sort(fy);for(let _=0;_<f.length;_++)n(f[_],c,!!l)}else n(u,c,!!l);let p,m;if(l)m=-1,p=l,l=null;else if(c<t.childCount)m=c,p=t.child(c++);else break;for(let _=0;_<a.length;_++)a[_].to<=i&&a.splice(_--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let b=i+p.nodeSize;if(p.isText){let _=b;s<o.length&&o[s].from<_&&(_=o[s].from);for(let E=0;E<a.length;E++)a[E].to<_&&(_=a[E].to);_<b&&(l=p.cut(_-i),p=p.cut(0,_-i),b=_,m=-1)}else for(;s<o.length&&o[s].to<b;)s++;let k=p.isInline&&!p.isLeaf?a.filter(_=>!_.inline):a.slice();r(p,k,e.forChild(i,p),m),i=b}}function hy(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function my(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function $a(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Va(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Ti(n)){for(l=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&Q.isSelectable(f)&&o.parent&&!(f.isInline&&Hb(n.focusNode,n.focusOffset,o.dom))){let p=o.posBefore;c=new Q(s==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,p=s;for(let m=0;m<n.rangeCount;m++){let b=n.getRangeAt(m);f=Math.min(f,t.docView.posFromDOM(b.startContainer,b.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(f<0)return null;[l,s]=p==t.state.selection.anchor?[p,f]:[f,p],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=za(t,u,a,f)}return c}function Ud(t){return t.editable?t.hasFocus():Xd(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function gn(t,e=!1){let n=t.state.selection;if(Gd(t,n),!!Ud(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Xe){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&sr(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)by(t);else{let{anchor:r,head:o}=n,i,s;Wd&&!(n instanceof te)&&(n.$from.parent.inlineContent||(i=Kd(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Kd(t,n.to))),t.docView.setSelection(r,o,t,e),Wd&&(i&&qd(i),s&&qd(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&gy(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Wd=it||Xe&&Cd<63;function Kd(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(it&&o&&o.contentEditable=="false")return Ha(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Ha(o);if(i)return Ha(i)}}function Ha(t){return t.contentEditable="true",it&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function qd(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function gy(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Ud(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function by(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,Ge(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&pt&&Pn<=11&&(r.disabled=!0,r.disabled=!1)}function Gd(t,e){if(e instanceof Q){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Jd(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Jd(t)}function Jd(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function za(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||te.between(e,n,r)}function Yd(t){return t.editable&&!t.hasFocus()?!1:Xd(t)}function Xd(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function yy(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return sr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ja(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&ee.findFrom(i,e)}function Bn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Qd(t,e,n){let r=t.state.selection;if(r instanceof te)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return Bn(t,new te(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=ja(t.state,e);return o&&o instanceof Q?Bn(t,o):!1}else if(!(xt&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Q.isSelectable(i)?Bn(t,new Q(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):_o?Bn(t,new te(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Q&&r.node.isInline)return Bn(t,new te(e>0?r.$to:r.$from));{let o=ja(t.state,e);return o?Bn(t,o):!1}}}function Oi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function So(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function $r(t,e){return e<0?wy(t):ky(t)}function wy(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(jt&&n.nodeType==1&&r<Oi(n)&&So(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(So(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Zd(n))break;{let a=n.previousSibling;for(;a&&So(a,-1);)o=n.parentNode,i=Ge(a),a=a.previousSibling;if(a)n=a,r=Oi(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Ua(t,n,r):o&&Ua(t,o,i)}function ky(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Oi(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(So(a,1))i=n,s=++r;else break}else{if(Zd(n))break;{let a=n.nextSibling;for(;a&&So(a,1);)i=a.parentNode,s=Ge(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=Oi(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&Ua(t,i,s)}function Zd(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function _y(t,e){for(;t&&e==t.childNodes.length&&!ko(t);)e=Ge(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Ey(t,e){for(;t&&!e&&!ko(t);)e=Ge(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Ua(t,e,n){if(e.nodeType!=3){let i,s;(s=_y(e,n))?(e=s,n=0):(i=Ey(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Ti(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&gn(t)},50)}function ef(t,e){let n=t.state.doc.resolve(e);if(!(Xe||Ub)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function tf(t,e,n){let r=t.state.selection;if(r instanceof te&&!r.empty||n.indexOf("s")>-1||xt&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=ja(t.state,e);if(s&&s instanceof Q)return Bn(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof Ot?ee.near(s,e):ee.findFrom(s,e);return a?Bn(t,a):!1}return!1}function nf(t,e){if(!(t.state.selection instanceof te))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function rf(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function vy(t){if(!it||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;rf(t,r,"true"),setTimeout(()=>rf(t,r,"false"),20)}return!1}function Cy(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Sy(t,e){let n=e.keyCode,r=Cy(e);if(n==8||xt&&n==72&&r=="c")return nf(t,-1)||$r(t,-1);if(n==46&&!e.shiftKey||xt&&n==68&&r=="c")return nf(t,1)||$r(t,1);if(n==13||n==27)return!0;if(n==37||xt&&n==66&&r=="c"){let o=n==37?ef(t,t.state.selection.from)=="ltr"?-1:1:-1;return Qd(t,o,r)||$r(t,o)}else if(n==39||xt&&n==70&&r=="c"){let o=n==39?ef(t,t.state.selection.from)=="ltr"?1:-1:1;return Qd(t,o,r)||$r(t,o)}else{if(n==38||xt&&n==80&&r=="c")return tf(t,-1,r)||$r(t,-1);if(n==40||xt&&n==78&&r=="c")return vy(t)||tf(t,1,r)||$r(t,1);if(r==(xt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Wa(t,e){t.someProp("transformCopied",m=>{e=m(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let m=r.firstChild;n.push(m.type.name,m.attrs!=m.type.defaultAttrs?m.attrs:null),r=m.content}let s=t.someProp("clipboardSerializer")||or.fromSchema(t.state.schema),a=ff(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=uf[c.nodeName.toLowerCase()]);){for(let m=u.length-1;m>=0;m--){let b=a.createElement(u[m]);for(;l.firstChild;)b.appendChild(l.firstChild);l.appendChild(b),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${f?` -${f}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",m=>m(e,t))||e.content.textBetween(0,e.content.size,`
|
|
7
|
-
|
|
8
|
-
`);return{dom:l,text:
|
|
9
|
-
`))),0,0):W.empty;let f=t.someProp("clipboardTextParser",p=>p(e,o,r,t));if(f)a=f;else{let p=o.marks(),{schema:m}=t.state,b=or.fromSchema(m);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(k=>{let _=s.appendChild(document.createElement("p"));k&&_.appendChild(b.serializeNode(m.text(k,p)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=Oy(n),_o&&My(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Mr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Ty.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)a=xy(cf(a,+u[1],+u[2]),u[4]);else if(a=W.maxOpen(Ny(a.content,o),!0),a.openStart||a.openEnd){let f=0,p=0;for(let m=a.content.firstChild;f<a.openStart&&!m.type.spec.isolating;f++,m=m.firstChild);for(let m=a.content.lastChild;p<a.openEnd&&!m.type.spec.isolating;p++,m=m.lastChild);a=cf(a,f,p)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const Ty=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ny(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&af(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=lf(s[s.length-1],i.length));let u=sf(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return V.from(s)}return t}function sf(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,V.from(t));return t}function af(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=af(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(V.from(sf(n,t,o+1))))}}function lf(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,lf(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(V.empty,!0);return t.copy(n.append(r))}function Ka(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=Ka(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(V.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function cf(t,e,n){return e<t.openStart&&(t=new W(Ka(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new W(Ka(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const uf={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let df=null;function ff(){return df||(df=document.implementation.createHTMLDocument("title"))}let qa=null;function Ay(t){let e=window.trustedTypes;return e?(qa||(qa=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),qa.createHTML(t)):t}function Oy(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=ff().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&uf[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=Ay(t),o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function My(t){let e=t.querySelectorAll(Xe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function xy(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=V.from(l.create(r[a+1],o)),i++,s++}return new W(o,i,s)}const st={},at={},Ly={touchstart:!0,touchmove:!0};class Ry{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Py(t){for(let e in st){let n=st[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Dy(t,r)&&!Ja(t,r)&&(t.editable||!(r.type in at))&&n(t,r)},Ly[e]?{passive:!0}:void 0)}it&&t.dom.addEventListener("input",()=>null),Ga(t)}function Fn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Iy(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ga(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ja(t,r))})}function Ja(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Dy(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function By(t,e){!Ja(t,e)&&st[e.type]&&(t.editable||!(e.type in at))&&st[e.type](t,e)}at.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!hf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(hn&&Xe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Br&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,ar(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Sy(t,n)?n.preventDefault():Fn(t,"key")},at.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},at.keypress=(t,e)=>{let n=e;if(hf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||xt&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof te)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,o,i))&&t.dispatch(i()),n.preventDefault()}};function Mi(t){return{left:t.clientX,top:t.clientY}}function Fy(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Ya(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Vr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function $y(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Q.isSelectable(r)?(Vr(t,new Q(n)),!0):!1}function Vy(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Q&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(Q.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Vr(t,Q.create(t.state.doc,o)),!0):!1}function Hy(t,e,n,r,o){return Ya(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?Vy(t,n):$y(t,n))}function zy(t,e,n,r){return Ya(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function jy(t,e,n,r){return Ya(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||Uy(t,n,r)}function Uy(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Vr(t,te.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Vr(t,te.create(r,a+1,a+1+s.content.size));else if(Q.isSelectable(s))Vr(t,Q.create(r,a));else continue;return!0}}function Xa(t){return xi(t)}const pf=xt?"metaKey":"ctrlKey";st.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Xa(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&Fy(n,t.input.lastClick)&&!n[pf]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=t.posAtCoords(Mi(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Wy(t,s,n,!!r)):(i=="doubleClick"?zy:jy)(t,s.pos,s.inside,n)?n.preventDefault():Fn(t,"pointer"))};class Wy{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[pf],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Q&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&jt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Fn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>gn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Mi(e))),this.updateAllowDefault(e),this.allowDefault||!n?Fn(this.view,"pointer"):Hy(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||it&&this.mightDrag&&!this.mightDrag.node.isAtom||Xe&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Vr(this.view,ee.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Fn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Fn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}st.touchstart=t=>{t.input.lastTouch=Date.now(),Xa(t),Fn(t,"pointer")},st.touchmove=t=>{t.input.lastTouch=Date.now(),Fn(t,"pointer")},st.contextmenu=t=>Xa(t);function hf(t,e){return t.composing?!0:it&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Ky=hn?5e3:-1;at.compositionstart=at.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof te&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),xi(t,!0),t.markCursor=null;else if(xi(t,!e.selection.empty),jt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}mf(t,Ky)},at.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,mf(t,20))};function mf(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>xi(t),e))}function gf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Gy());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function qy(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=$b(e.focusNode,e.focusOffset),r=Vb(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function Gy(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function xi(t,e=!1){if(!(hn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),gf(t),e||t.docView&&t.docView.dirty){let n=Va(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Jy(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const To=pt&&Pn<15||Br&&Wb<604;st.copy=at.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=To?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Wa(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):Jy(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Yy(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Xy(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?No(t,r.value,null,o,e):No(t,r.textContent,r.innerHTML,o,e)},50)}function No(t,e,n,r,o){let i=of(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||W.empty)))return!0;if(!i)return!1;let s=Yy(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bf(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}at.paste=(t,e)=>{let n=e;if(t.composing&&!hn)return;let r=To?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&No(t,bf(r),r.getData("text/html"),o,n)?n.preventDefault():Xy(t,n)};class yf{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Qy=xt?"altKey":"ctrlKey";function wf(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[Qy]}st.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(Mi(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Q?o.to-1:o.to))){if(r&&r.mightDrag)s=Q.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=Q.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=Wa(t,a);(!n.dataTransfer.files.length||!Xe||Cd>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(To?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",To||n.dataTransfer.setData("text/plain",c),t.dragging=new yf(u,wf(t,n),s)},st.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},at.dragover=at.dragenter=(t,e)=>e.preventDefault(),at.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Mi(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",b=>{s=b(s,t)}):s=of(t,bf(n.dataTransfer),To?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&wf(t,n));if(t.someProp("handleDrop",b=>b(t,n,s||W.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Nb(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:b}=r;b?b.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(f?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let m=c.doc.resolve(u);if(f&&Q.isSelectable(s.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Q(m));else{let b=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((k,_,E,N)=>b=N),c.setSelection(za(t,m,c.doc.resolve(b)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},st.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&gn(t)},20))},st.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},st.beforeinput=(t,e)=>{if(Xe&&hn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,ar(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in at)st[t]=at[t];function Ao(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Li{constructor(e,n){this.toDOM=e,this.spec=n||dr,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new lt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Li&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ao(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $n{constructor(e,n){this.attrs=e,this.spec=n||dr}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new lt(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof $n&&Ao(this.attrs,e.attrs)&&Ao(this.spec,e.spec)}static is(e){return e.type instanceof $n}destroy(){}}class Qa{constructor(e,n){this.attrs=e,this.spec=n||dr}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new lt(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof Qa&&Ao(this.attrs,e.attrs)&&Ao(this.spec,e.spec)}destroy(){}}class lt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new lt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new lt(e,e,new Li(n,r))}static inline(e,n,r,o){return new lt(e,n,new $n(r,o))}static node(e,n,r,o){return new lt(e,n,new Qa(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof $n}get widget(){return this.type instanceof Li}}const Hr=[],dr={};class Le{constructor(e,n){this.local=e.length?e:Hr,this.children=n.length?n:Hr}static create(e,n){return n.length?Ri(n,e,0,dr):Qe}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==Qe||e.maps.length==0?this:this.mapInner(e,n,0,0,r||dr)}mapInner(e,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?Zy(this.children,s||[],e,n,r,o,i):s?new Le(s.sort(fr),Hr):Qe}add(e,n){return n.length?this==Qe?Le.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=_f(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,Ri(u,a,c+1,dr)),i+=3}});let s=kf(i?Ef(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Le(s.length?this.local.concat(s).sort(fr):this.local,o||this.children)}remove(e){return e.length==0||this==Qe?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=Qe?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Le(o,r):Qe}forChild(e,n){if(this==Qe)return this;if(n.isLeaf)return Le.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof $n){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new Le(o.sort(fr),Hr);return r?new Vn([a,r]):a}return r||Qe}eq(e){if(this==e)return!0;if(!(e instanceof Le)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Za(this.localsInner(e))}localsInner(e){if(this==Qe)return Hr;if(e.inlineContent||!this.local.some($n.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof $n||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Le.empty=new Le([],[]),Le.removeOverlap=Za;const Qe=Le.empty;class Vn{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,dr));return Vn.from(r)}forChild(e,n){if(n.isLeaf)return Le.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=Qe&&(i instanceof Vn?r=r.concat(i.members):r.push(i))}return Vn.from(r)}eq(e){if(!(e instanceof Vn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Za(r?n:n.sort(fr)):Hr}static from(e){switch(e.length){case 0:return Qe;case 1:return e[0];default:return new Vn(e.every(n=>n instanceof Le)?e:e.reduce((n,r)=>n.concat(r instanceof Le?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Zy(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let f=0;n.maps[c].forEach((p,m,b,k)=>{let _=k-b-(m-p);for(let E=0;E<a.length;E+=3){let N=a[E+1];if(N<0||p>N+u-f)continue;let A=a[E]+u-f;m>=A?a[E+1]=p<=A?-2:-1:p>=u&&_&&(a[E]+=_,a[E+1]+=_)}f+=_}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+i),f=u-o;if(f<0||f>=r.content.size){l=!0;continue}let p=n.map(t[c+1]+i,-1),m=p-o,{index:b,offset:k}=r.content.findIndex(f),_=r.maybeChild(b);if(_&&k==f&&k+_.nodeSize==m){let E=a[c+2].mapInner(n,_,u+1,t[c]+i+1,s);E!=Qe?(a[c]=f,a[c+1]=m,a[c+2]=E):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=ew(a,t,e,n,o,i,s),u=Ri(c,r,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,p=0;f<u.children.length;f+=3){let m=u.children[f];for(;p<a.length&&a[p]<m;)p+=3;a.splice(p,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Le(e.sort(fr),a)}function kf(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new lt(o.from+e,o.to+e,o.type))}return n}function ew(t,e,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,o,c);f?n.push(f):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function _f(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function Ef(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ri(t,e,n,r){let o=[],i=!1;e.forEach((a,l)=>{let c=_f(t,a,l+n);if(c){i=!0;let u=Ri(c,a,n+l+1,r);u!=Qe&&o.push(l,l+a.nodeSize,u)}});let s=kf(i?Ef(t):t,-n).sort(fr);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Le(s,o):Qe}function fr(t,e){return t.from-e.from||t.to-e.to}function Za(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),vf(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),vf(e,o,r.copy(i.from,r.to)));break}}}return e}function vf(t,e,n){for(;e<t.length&&fr(n,t[e])>0;)e++;t.splice(e,0,n)}function el(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Qe&&e.push(r)}),t.cursorWrapper&&e.push(Le.create(t.state.doc,[t.cursorWrapper.deco])),Vn.from(e)}const tw={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},nw=pt&&Pn<=11;class rw{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class ow{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rw,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);pt&&Pn<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),nw&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,tw)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Yd(this.view)){if(this.suppressingSelectionUpdates)return gn(this.view);if(pt&&Pn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=Dr(i))n.add(i);for(let i=e.anchorNode;i;i=Dr(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Yd(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],l);f&&(i=i<0?f.from:Math.min(f.from,i),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(jt&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,p]=u;f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let p of u){let m=p.parentNode;m&&m.nodeName=="LI"&&(!f||aw(e,f)!=m)&&p.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Ti(r)&&(c=Va(e))&&c.eq(ee.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,gn(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),iw(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||gn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(pt&&Pn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:p}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let s=o&&o.parentNode==e.target?Ge(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?Ge(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Cf=new WeakMap,Sf=!1;function iw(t){if(!Cf.has(t)&&(Cf.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=jt,Sf)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Sf=!0}}function Tf(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return sr(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function sw(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return Tf(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Tf(t,n):null}function aw(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function lw(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Ti(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Xe&&t.input.lastKeyCode===8)for(let _=i;_>o;_--){let E=r.childNodes[_-1],N=E.pmViewDesc;if(E.nodeName=="BR"&&!N){i=_;break}if(!N||N.size)break}let f=t.state.doc,p=t.someProp("domParser")||Mr.fromSchema(t.state.schema),m=f.resolve(s),b=null,k=p.parse(r,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:o,to:i,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:cw,context:m});if(c&&c[0].pos!=null){let _=c[0].pos,E=c[1]&&c[1].pos;E==null&&(E=_),b={anchor:_+s,head:E+s}}return{doc:k,sel:b,from:s,to:a}}function cw(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(it&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||it&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const uw=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function dw(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let v=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,S=Va(t,v);if(S&&!t.state.selection.eq(S)){if(Xe&&hn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",M=>M(t,ar(13,"Enter"))))return;let C=t.state.tr.setSelection(S);v=="pointer"?C.setMeta("pointer",!0):v=="key"&&C.scrollIntoView(),i&&C.setMeta("composition",i),t.dispatch(C)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=lw(t,e,n),u=t.state.doc,f=u.slice(c.from,c.to),p,m;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,m="end"):(p=t.state.selection.from,m="start"),t.input.lastKeyCode=null;let b=hw(f.content,c.doc.content,c.from,p,m);if(b&&t.input.domChangeCount++,(Br&&t.input.lastIOSEnter>Date.now()-225||hn)&&o.some(v=>v.nodeType==1&&!uw.test(v.nodeName))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",v=>v(t,ar(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!b)if(r&&l instanceof te&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))b={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let v=Nf(t,t.state.doc,c.sel);if(v&&!v.eq(t.state.selection)){let S=t.state.tr.setSelection(v);i&&S.setMeta("composition",i),t.dispatch(S)}}return}t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof te&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),pt&&Pn<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>c.from&&c.doc.textBetween(b.start-c.from-1,b.start-c.from+1)==" "&&(b.start--,b.endA--,b.endB--);let k=c.doc.resolveNoCache(b.start-c.from),_=c.doc.resolveNoCache(b.endB-c.from),E=u.resolve(b.start),N=k.sameParent(_)&&k.parent.inlineContent&&E.end()>=b.endA,A;if((Br&&t.input.lastIOSEnter>Date.now()-225&&(!N||o.some(v=>v.nodeName=="DIV"||v.nodeName=="P"))||!N&&k.pos<c.doc.content.size&&(!k.sameParent(_)||!k.parent.inlineContent)&&!/\S/.test(c.doc.textBetween(k.pos,_.pos,"",""))&&(A=ee.findFrom(c.doc.resolve(k.pos+1),1,!0))&&A.head>k.pos)&&t.someProp("handleKeyDown",v=>v(t,ar(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>b.start&&pw(u,b.start,b.endA,k,_)&&t.someProp("handleKeyDown",v=>v(t,ar(8,"Backspace")))){hn&&Xe&&t.domObserver.suppressSelectionUpdates();return}Xe&&b.endB==b.start&&(t.input.lastChromeDelete=Date.now()),hn&&!N&&k.start()!=_.start()&&_.parentOffset==0&&k.depth==_.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==b.endA&&(b.endB-=2,_=c.doc.resolveNoCache(b.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(v){return v(t,ar(13,"Enter"))})},20));let d=b.start,g=b.endA,h=v=>{let S=v||t.state.tr.replace(d,g,c.doc.slice(b.start-c.from,b.endB-c.from));if(c.sel){let C=Nf(t,S.doc,c.sel);C&&!(Xe&&t.composing&&C.empty&&(b.start!=b.endB||t.input.lastChromeDelete<Date.now()-100)&&(C.head==d||C.head==S.mapping.map(g)-1)||pt&&C.empty&&C.head==d)&&S.setSelection(C)}return i&&S.setMeta("composition",i),S.scrollIntoView()},w;if(N){if(k.pos==_.pos){pt&&Pn<=11&&k.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>gn(t),20));let v=h(t.state.tr.delete(d,g)),S=u.resolve(b.start).marksAcross(u.resolve(b.endA));S&&v.ensureMarks(S),t.dispatch(v)}else if(b.endA==b.endB&&(w=fw(k.parent.content.cut(k.parentOffset,_.parentOffset),E.parent.content.cut(E.parentOffset,b.endA-E.start())))){let v=h(t.state.tr);w.type=="add"?v.addMark(d,g,w.mark):v.removeMark(d,g,w.mark),t.dispatch(v)}else if(k.parent.child(k.index()).isText&&k.index()==_.index()-(_.textOffset?0:1)){let v=k.parent.textBetween(k.parentOffset,_.parentOffset),S=()=>h(t.state.tr.insertText(v,d,g));t.someProp("handleTextInput",C=>C(t,d,g,v,S))||t.dispatch(S())}}else t.dispatch(h())}function Nf(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:za(t,e.resolve(n.anchor),e.resolve(n.head))}function fw(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(V.from(c).eq(t))return{mark:a,type:s}}function pw(t,e,n,r,o){if(n-e<=o.pos-r.pos||tl(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(tl(i,!0,!0));return!s.parent.isTextblock||s.pos>n||tl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function tl(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function hw(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&Af(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&Af(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function Af(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Of{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ry,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Pf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Lf(this),xf(this),this.nodeViews=Rf(this),this.docView=Fd(this.state.doc,Mf(this),el(this),this.dom,this),this.domObserver=new ow(this,(r,o,i,s)=>dw(this,r,o,i,s)),this.domObserver.start(),Py(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ga(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Pf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(gf(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let m=Rf(this);gw(m,this.nodeViews)&&(this.nodeViews=m,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ga(this),this.editable=Lf(this),xf(this);let l=el(this),c=Mf(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(o.selection))&&(s=!0);let p=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Gb(this);if(s){this.domObserver.stop();let m=f&&(pt||Xe)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&mw(o.selection,e.selection);if(f){let b=Xe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=qy(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Fd(e.doc,c,l,this.dom,this)),b&&!this.trackWrites&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&yy(this))?gn(this,m):(Gd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&Jb(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Q){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Sd(this,n.getBoundingClientRect(),e)}else Sd(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new yf(e.slice,e.move,o<0?void 0:Q.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(pt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Yb(this.dom),gn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ty(this,e)}coordsAtPos(e,n=1){return xd(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return sy(this,n||this.state,e)}pasteHTML(e,n){return No(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return No(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Wa(this,e)}destroy(){this.docView&&(Iy(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],el(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Bb())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return By(this,e)}domSelectionRange(){let e=this.domSelection();return e?it&&this.root.nodeType===11&&zb(this.dom.ownerDocument)==this.dom&&sw(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Of.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Mf(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[lt.node(0,t.state.doc.content.size,e)]}function xf(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:lt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Lf(t){return!t.someProp("editable",e=>e(t.state)===!1)}function mw(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Rf(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function gw(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Pf(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Hn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Pi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},bw=typeof navigator<"u"&&/Mac/.test(navigator.platform),yw=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Je=0;Je<10;Je++)Hn[48+Je]=Hn[96+Je]=String(Je);for(var Je=1;Je<=24;Je++)Hn[Je+111]="F"+Je;for(var Je=65;Je<=90;Je++)Hn[Je]=String.fromCharCode(Je+32),Pi[Je]=String.fromCharCode(Je);for(var nl in Hn)Pi.hasOwnProperty(nl)||(Pi[nl]=Hn[nl]);function ww(t){var e=bw&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||yw&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Pi:Hn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const kw=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),_w=typeof navigator<"u"&&/Win/.test(navigator.platform);function Ew(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))kw?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function vw(t){let e=Object.create(null);for(let n in t)e[Ew(n)]=t[n];return e}function rl(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Cw(t){return new $e({props:{handleKeyDown:ol(t)}})}function ol(t){let e=vw(t);return function(n,r){let o=ww(r),i,s=e[rl(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[rl(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(_w&&r.ctrlKey&&r.altKey)&&(i=Hn[r.keyCode])&&i!=o){let a=e[rl(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const il=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function If(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Df=(t,e,n)=>{let r=If(t,n);if(!r)return!1;let o=sl(r);if(!o){let s=r.blockRange(),a=s&&xr(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(Wf(t,o,e,-1))return!0;if(r.parent.content.size==0&&(zr(i,"end")||Q.isSelectable(i)))for(let s=r.depth;;s--){let a=vi(t.doc,r.before(s),r.after(s),W.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(zr(i,"end")?ee.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Q.create(l.doc,o.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},Sw=(t,e,n)=>{let r=If(t,n);if(!r)return!1;let o=sl(r);return o?Bf(t,o,e):!1},Tw=(t,e,n)=>{let r=$f(t,n);if(!r)return!1;let o=al(r);return o?Bf(t,o,e):!1};function Bf(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=vi(t.doc,i,l,W.empty);if(!c||c.from!=i||c instanceof ze&&c.slice.size>=l-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(te.create(u.doc,i)),n(u.scrollIntoView())}return!0}function zr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Ff=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=sl(r)}let s=i&&i.nodeBefore;return!s||!Q.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Q.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function sl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function $f(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Vf=(t,e,n)=>{let r=$f(t,n);if(!r)return!1;let o=al(r);if(!o)return!1;let i=o.nodeAfter;if(Wf(t,o,e,1))return!0;if(r.parent.content.size==0&&(zr(i,"start")||Q.isSelectable(i))){let s=vi(t.doc,r.before(),r.after(),W.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(zr(i,"start")?ee.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Q.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Hf=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=al(r)}let s=i&&i.nodeAfter;return!s||!Q.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Q.create(t.doc,i.pos)).scrollIntoView()),!0)};function al(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Nw=(t,e)=>{let n=t.selection,r=n instanceof Q,o;if(r){if(n.node.isTextblock||!Ln(t.doc,n.from))return!1;o=n.from}else if(o=Ei(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(Q.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},Aw=(t,e)=>{let n=t.selection,r;if(n instanceof Q){if(n.node.isTextblock||!Ln(t.doc,n.to))return!1;r=n.to}else if(r=Ei(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Ow=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&xr(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},zf=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
10
|
-
`).scrollIntoView()),!0)};function ll(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Mw=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=ll(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ee.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},jf=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Ot||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=ll(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(te.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},Uf=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(fn(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&xr(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function xw(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Q&&e.selection.node.isBlock)return!r.parentOffset||!fn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,a,l=!1,c=!1;for(let m=r.depth;;m--)if(r.node(m).isBlock){l=r.end(m)==r.pos+(r.depth-m),c=r.start(m)==r.pos-(r.depth-m),a=ll(r.node(m-1).contentMatchAt(r.indexAfter(m-1))),i.unshift(l&&a?{type:a}:null),s=m;break}else{if(m==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof te||e.selection instanceof Ot)&&u.deleteSelection();let f=u.mapping.map(r.pos),p=fn(u.doc,f,i.length,i);if(p||(i[0]=a?{type:a}:null,p=fn(u.doc,f,i.length,i)),!p)return!1;if(u.split(f,i.length,i),!l&&c&&r.node(s).type!=a){let m=u.mapping.map(r.before(s)),b=u.doc.resolve(m);a&&r.node(s-1).canReplaceWith(b.index(),b.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const Lw=xw(),Rw=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(Q.create(t.doc,o))),!0)};function Pw(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Ln(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Wf(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&Pw(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let m=e.pos+i.nodeSize,b=V.empty;for(let E=s.length-1;E>=0;E--)b=V.from(s[E].create(null,b));b=V.from(o.copy(b));let k=t.tr.step(new je(e.pos-1,m,e.pos,m,new W(b,1,0),s.length,!0)),_=k.doc.resolve(m+2*s.length);_.nodeAfter&&_.nodeAfter.type==o.type&&Ln(k.doc,_.pos)&&k.join(_.pos),n(k.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:ee.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),p=f&&xr(f);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(f,p).scrollIntoView()),!0;if(c&&zr(i,"start",!0)&&zr(o,"end")){let m=o,b=[];for(;b.push(m),!m.isTextblock;)m=m.lastChild;let k=i,_=1;for(;!k.isTextblock;k=k.firstChild)_++;if(m.canReplace(m.childCount,m.childCount,k.content)){if(n){let E=V.empty;for(let A=b.length-1;A>=0;A--)E=V.from(b[A].copy(E));let N=t.tr.step(new je(e.pos-b.length,e.pos+i.nodeSize,e.pos+_,e.pos+i.nodeSize-_,new W(E,b.length,0),0,!0));n(N.scrollIntoView())}return!0}}return!1}function Kf(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(te.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const Iw=Kf(-1),Dw=Kf(1);function Bw(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Ca(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function qf(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(s,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),f=u.index();o=u.parent.canReplaceWith(f,f+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(a,l,t,e)}r(i.scrollIntoView())}return!0}}function cl(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}cl(il,Df,Ff),cl(il,Vf,Hf),cl(zf,jf,Uf,Lw),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Fw(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return $w(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function $w(t,e,n,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);i=new gi(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new gi(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=Ca(i,n,r,e);return a?(t&&Vw(t,e,a,o,n),!0):!1}function Vw(t,e,n,r,o){let i=V.empty;for(let u=n.length-1;u>=0;u--)i=V.from(n[u].type.create(n[u].attrs,i));t.step(new je(e.start-(r?2:0),e.end,e.start,e.end,new W(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,f=e.endIndex,p=!0;u<f;u++,p=!1)!p&&fn(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function Hw(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?zw(e,n,t,i):jw(e,n,i):!0:!1}}function zw(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new je(i-1,s,i,s,new W(V.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new gi(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=xr(r);if(a==null)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return Ln(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function jw(t,e,n){let r=t.tr,o=n.parent;for(let m=n.end,b=n.endIndex-1,k=n.startIndex;b>k;b--)m-=o.child(b).nodeSize,r.delete(m-1,m+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?V.empty:V.from(o))))return!1;let f=i.pos,p=f+s.nodeSize;return r.step(new je(f-(a?1:0),p+(l?1:0),f+1,p-1,new W((a?V.empty:V.from(o.copy(V.empty))).append(l?V.empty:V.from(o.copy(V.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Uw(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=V.from(c?t.create():null),f=new W(V.from(t.create(null,V.from(a.type.create(null,u)))),c?3:1,0),p=i.start,m=i.end;n(e.tr.step(new je(p-(c?3:1),m,p,m,f,1,!0)).scrollIntoView())}return!0}}function Ii(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class Di{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const f=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,m])=>[p,(...k)=>{const _=this.buildProps(c,n),E=m(...k)(_);return a.push(E),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:Ii({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class Ww{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}once(e,n){const r=(...o)=>{this.off(e,r),n.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function J(t,e,n){return t.config[e]===void 0&&t.parent?J(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?J(t.parent,e,n):null}):t.config[e]}function Bi(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Gf(t){const e=[],{nodeExtensions:n,markExtensions:r}=Bi(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},l=J(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,m])=>{e.push({type:f,name:p,attribute:{...i,...m}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=J(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,f])=>{const p={...i,...f};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,e.push({type:s.name,name:u,attribute:p})})}),e}function We(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ce(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?i.split(" "):[],l=r[o]?r[o].split(" "):[],c=a.filter(u=>!l.includes(u));r[o]=[...l,...c].join(" ")}else if(o==="style"){const a=i?i.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[f,p]=u.split(":").map(m=>m.trim());c.set(f,p)}),a.forEach(u=>{const[f,p]=u.split(":").map(m=>m.trim());c.set(f,p)}),r[o]=Array.from(c.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[o]=i}),r},{})}function ul(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Ce(n,r),{})}function Jf(t){return typeof t=="function"}function ie(t,e=void 0,...n){return Jf(t)?e?t.bind(e)(...n):t(...n):t}function Kw(t={}){return Object.keys(t).length===0&&t.constructor===Object}function qw(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Yf(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):qw(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function Xf(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Kw(n)?!1:n!=null))}function Gw(t,e){var n;const r=Gf(t),{nodeExtensions:o,markExtensions:i}=Bi(t),s=(n=o.find(c=>J(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const u=r.filter(E=>E.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((E,N)=>{const A=J(N,"extendNodeSchema",f);return{...E,...A?A(c):{}}},{}),m=Xf({...p,content:ie(J(c,"content",f)),marks:ie(J(c,"marks",f)),group:ie(J(c,"group",f)),inline:ie(J(c,"inline",f)),atom:ie(J(c,"atom",f)),selectable:ie(J(c,"selectable",f)),draggable:ie(J(c,"draggable",f)),code:ie(J(c,"code",f)),whitespace:ie(J(c,"whitespace",f)),linebreakReplacement:ie(J(c,"linebreakReplacement",f)),defining:ie(J(c,"defining",f)),isolating:ie(J(c,"isolating",f)),attrs:Object.fromEntries(u.map(E=>{var N;return[E.name,{default:(N=E?.attribute)===null||N===void 0?void 0:N.default}]}))}),b=ie(J(c,"parseHTML",f));b&&(m.parseDOM=b.map(E=>Yf(E,u)));const k=J(c,"renderHTML",f);k&&(m.toDOM=E=>k({node:E,HTMLAttributes:ul(E,u)}));const _=J(c,"renderText",f);return _&&(m.toText=_),[c.name,m]})),l=Object.fromEntries(i.map(c=>{const u=r.filter(_=>_.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((_,E)=>{const N=J(E,"extendMarkSchema",f);return{..._,...N?N(c):{}}},{}),m=Xf({...p,inclusive:ie(J(c,"inclusive",f)),excludes:ie(J(c,"excludes",f)),group:ie(J(c,"group",f)),spanning:ie(J(c,"spanning",f)),code:ie(J(c,"code",f)),attrs:Object.fromEntries(u.map(_=>{var E;return[_.name,{default:(E=_?.attribute)===null||E===void 0?void 0:E.default}]}))}),b=ie(J(c,"parseHTML",f));b&&(m.parseDOM=b.map(_=>Yf(_,u)));const k=J(c,"renderHTML",f);return k&&(m.toDOM=_=>k({mark:_,HTMLAttributes:ul(_,u)})),[c.name,m]}));return new zu({topNode:s,nodes:a,marks:l})}function dl(t,e){return e.nodes[t]||e.marks[t]||null}function Qf(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function fl(t,e){const n=or.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const Jw=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var l,c;const u=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function pl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Fi{constructor(e){this.find=e.find,this.handler=e.handler}}const Yw=(t,e)=>{if(pl(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function $i(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const f=Jw(c)+i;return s.forEach(p=>{if(u)return;const m=Yw(f,p.find);if(!m)return;const b=l.state.tr,k=Ii({state:l.state,transaction:b}),_={from:r-(m[0].length-i.length),to:o},{commands:E,chain:N,can:A}=new Di({editor:n,state:k});p.handler({state:k,range:_,match:m,commands:E,chain:N,can:A})===null||!b.steps.length||(b.setMeta(a,{transform:b,from:r,to:o,text:i}),l.dispatch(b),u=!0)}),u}function Xw(t){const{editor:e,rules:n}=t,r=new $e({state:{init(){return null},apply(o,i,s){const a=o.getMeta(r);if(a)return a;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=fl(V.from(u),s.schema);const{from:f}=l,p=f+u.length;$i({editor:e,from:f,to:p,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return $i({editor:e,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&$i({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?$i({editor:e,from:s.pos,to:s.pos,text:`
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,o,(l,c,u,f)=>{var p;l.isBlock&&c>r&&(a+=i);const m=s?.[l.type.name];if(m)return u&&(a+=m({node:l,pos:c,parent:u,index:f,range:e})),!1;l.isText&&(a+=(p=l?.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,o-c))}),a}function hl(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const sk=Ke.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new $e({key:new Ue("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos)),l=hl(n);return Zf(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),ak=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),lk=(t=!1)=>({commands:e})=>e.setContent("",t),ck=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,f=c.resolve(u.map(l)),p=c.resolve(u.map(l+a.nodeSize)),m=f.blockRange(p);if(!m)return;const b=xr(m);if(a.type.isTextblock){const{defaultType:k}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(m.start,k)}(b||b===0)&&e.lift(m,b)})}),!0},uk=t=>e=>t(e),dk=()=>({state:t,dispatch:e})=>jf(t,e),fk=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new te(r.doc.resolve(s-1))),!0},pk=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const a=o.before(i),l=o.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1},hk=t=>({tr:e,state:n,dispatch:r})=>{const o=We(t,n.schema),i=e.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);e.delete(l,c).scrollIntoView()}return!0}return!1},mk=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},gk=()=>({state:t,dispatch:e})=>il(t,e),bk=()=>({commands:t})=>t.keyboardShortcut("Enter"),yk=()=>({state:t,dispatch:e})=>Mw(t,e);function zi(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:pl(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function ep(t,e,n={}){return t.find(r=>r.type===e&&zi(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function tp(t,e,n={}){return!!ep(t,e,n)}function ml(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(u=>u.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(u=>u.type===e)||(n=n||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!ep([...o.node.marks],e,n)))return;let s=o.index,a=t.start()+o.offset,l=s+1,c=a+o.node.nodeSize;for(;s>0&&tp([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&tp([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function zn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const wk=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=zn(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const f=ml(l,i,e);if(f&&f.from<=c&&f.to>=u){const p=te.create(s,f.from,f.to);n.setSelection(p)}}return!0},kk=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function gl(t){return t instanceof te}function bn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function np(t,e=null){if(!e)return null;const n=ee.atStart(t),r=ee.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,i=r.to;return e==="all"?te.create(t,bn(0,o,i),bn(t.content.size,o,i)):te.create(t,bn(e,o,i),bn(e,o,i))}function bl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const _k=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{bl()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!gl(n.state.selection))return s(),!0;const a=np(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},Ek=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),vk=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),rp=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&rp(r)}return t};function ji(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return rp(n)}function Ui(t,e,n){if(t instanceof On||t instanceof V)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return V.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Ui("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new zu({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Mr.fromSchema(l).parseSlice(ji(t),n.parseOptions):Mr.fromSchema(l).parse(ji(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Mr.fromSchema(e);return n.slice?i.parseSlice(ji(t),n.parseOptions).content:i.parse(ji(t),n.parseOptions)}return Ui("",e,n)}function Ck(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof ze||o instanceof je))return;const i=t.mapping.maps[r];let s=0;i.forEach((a,l,c,u)=>{s===0&&(s=u)}),t.setSelection(ee.near(t.doc.resolve(s),n))}const Sk=t=>!("type"in t),Tk=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=Ui(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(b){return i.emit("contentError",{editor:i,error:b,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,f=!0;if((Sk(a)?a:[a]).forEach(b=>{b.check(),u=u?b.isText&&b.marks.length===0:!1,f=f?b.isBlock:!1}),l===c&&f){const{parent:b}=r.doc.resolve(l);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(l-=1,c+=1)}let m;if(u){if(Array.isArray(e))m=e.map(b=>b.text||"").join("");else if(e instanceof V){let b="";e.forEach(k=>{k.text&&(b+=k.text)}),m=b}else typeof e=="object"&&e&&e.text?m=e.text:m=e;r.insertText(m,l,c)}else m=a,r.replaceWith(l,c,m);n.updateSelection&&Ck(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:m}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:m})}return!0},Nk=()=>({state:t,dispatch:e})=>Nw(t,e),Ak=()=>({state:t,dispatch:e})=>Aw(t,e),Ok=()=>({state:t,dispatch:e})=>Df(t,e),Mk=()=>({state:t,dispatch:e})=>Vf(t,e),xk=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ei(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Lk=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ei(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Rk=()=>({state:t,dispatch:e})=>Sw(t,e),Pk=()=>({state:t,dispatch:e})=>Tw(t,e);function op(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Ik(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))bl()||op()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}const Dk=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=Ik(t).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=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l?.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function Oo(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?We(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(f,p)=>{if(f.isText)return;const m=Math.max(r,p),b=Math.min(o,p+f.nodeSize);a.push({node:f,from:m,to:b})});const l=o-r,c=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>zi(f.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((f,p)=>f+p.to-p.from,0)>=l}const Bk=(t,e={})=>({state:n,dispatch:r})=>{const o=We(t,n.schema);return Oo(n,o,e)?Ow(n,r):!1},Fk=()=>({state:t,dispatch:e})=>Uf(t,e),$k=t=>({state:e,dispatch:n})=>{const r=We(t,e.schema);return Hw(r)(e,n)},Vk=()=>({state:t,dispatch:e})=>zf(t,e);function Wi(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function ip(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const Hk=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Wi(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=We(t,r.schema)),a==="mark"&&(s=zn(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,ip(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&n.addMark(u,u+c.nodeSize,s.create(ip(f.attrs,e)))})})}),!0):!1},zk=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),jk=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),Uk=()=>({state:t,dispatch:e})=>Ff(t,e),Wk=()=>({state:t,dispatch:e})=>Hf(t,e),Kk=()=>({state:t,dispatch:e})=>Rw(t,e),qk=()=>({state:t,dispatch:e})=>Dw(t,e),Gk=()=>({state:t,dispatch:e})=>Iw(t,e);function yl(t,e,n={},r={}){return Ui(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const Jk=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:u}=i;if(n.preserveWhitespace!=="full"){const f=yl(t,o.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function wl(t,e){const n=zn(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function Yk(t,e){const n=new Na(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Xk(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Qk(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,i)=>{n(o)&&r.push({node:o,pos:i})}),r}function sp(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function kl(t){return e=>sp(e.$from,t)}function ap(t,e){const n={from:0,to:t.content.size};return Zf(t,n,e)}function Zk(t,e){const n=We(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function lp(t,e){const n=Wi(typeof e=="string"?e:e.name,t.schema);return n==="node"?Zk(t,e):n==="mark"?wl(t,e):{}}function e1(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function t1(t){const e=e1(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function n1(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(i).map(a,-1),u=e.slice(i).map(l),f=e.invert().map(c,-1),p=e.invert().map(u);r.push({oldRange:{from:f,to:p},newRange:{from:c,to:u}})})}),t1(r)}function _l(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=ml(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Ki(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function El(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?zn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>i?i.name===f.type.name:!0).find(f=>zi(f.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:f,$to:p})=>{const m=f.pos,b=p.pos;t.doc.nodesBetween(m,b,(k,_)=>{if(!k.isText&&!k.marks.length)return;const E=Math.max(m,_),N=Math.min(b,_+k.nodeSize),A=N-E;s+=A,a.push(...k.marks.map(d=>({mark:d,from:E,to:N})))})}),s===0)return!1;const l=a.filter(f=>i?i.name===f.mark.type.name:!0).filter(f=>zi(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),c=a.filter(f=>i?f.mark.type!==i&&f.mark.type.excludes(i):!0).reduce((f,p)=>f+p.to-p.from,0);return(l>0?l+c:l)>=s}function r1(t,e,n={}){if(!e)return Oo(t,null,n)||El(t,null,n);const r=Wi(e,t.schema);return r==="node"?Oo(t,e,n):r==="mark"?El(t,e,n):!1}function cp(t,e){const{nodeExtensions:n}=Bi(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=ie(J(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function vl(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(vl(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function o1(t){return t instanceof Q}function up(t,e,n){const o=t.state.doc.content.size,i=bn(e,0,o),s=bn(n,0,o),a=t.coordsAtPos(i),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),p=Math.max(a.right,l.right),m=p-f,b=u-c,E={top:c,bottom:u,left:f,right:p,width:m,height:b,x:f,y:c};return{...E,toJSON:()=>E}}function i1(t,e,n){var r;const{selection:o}=e;let i=null;if(gl(o)&&(i=o.$cursor),i){const a=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,f,p)=>{if(c)return!1;if(u.isInline){const m=!p||p.type.allowsMarkType(n),b=!!n.isInSet(u.marks)||!u.marks.some(k=>k.type.excludes(n));c=m&&b}return!c}),c})}const s1=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=zn(t,r.schema);if(o)if(s){const c=wl(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(p,m)=>{const b=Math.max(m,u),k=Math.min(m+p.nodeSize,f);p.marks.find(E=>E.type===l)?p.marks.forEach(E=>{l===E.type&&n.addMark(b,k,l.create({...E.attrs,...e}))}):n.addMark(b,k,l.create(e))})});return i1(r,n,l)},a1=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),l1=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=We(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:a})=>qf(i,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>qf(i,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},c1=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=bn(t,0,r.content.size),i=Q.create(r,o);e.setSelection(i)}return!0},u1=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=te.atStart(r).from,a=te.atEnd(r).to,l=bn(o,s,a),c=bn(i,s,a),u=te.create(r,l,c);e.setSelection(u)}return!0},d1=t=>({state:e,dispatch:n})=>{const r=We(t,e.schema);return Uw(r)(e,n)};function dp(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}const f1=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=Ki(c,a.node().type.name,a.node().attrs);if(i instanceof Q&&i.node.isBlock)return!a.parentOffset||!fn(s,a.pos)?!1:(r&&(t&&dp(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:Xk(a.node(-1).contentMatchAt(a.indexAfter(-1)));let m=f&&p?[{type:p,attrs:u}]:void 0,b=fn(e.doc,e.mapping.map(a.pos),1,m);if(!m&&!b&&fn(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(b=!0,m=p?[{type:p,attrs:u}]:void 0),r){if(b&&(i instanceof te&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,m),p&&!f&&!a.parentOffset&&a.parent.type!==p)){const k=e.mapping.map(a.before()),_=e.doc.resolve(k);a.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&dp(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return b},p1=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=We(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==a)return!1;const p=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let E=V.empty;const N=l.index(-1)?1:l.index(-2)?2:3;for(let v=l.depth-N;v>=l.depth-3;v-=1)E=V.from(l.node(v).copy(E));const A=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,d={...Ki(p,l.node().type.name,l.node().attrs),...e},g=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(d))||void 0;E=E.append(V.from(a.createAndFill(null,g)||void 0));const h=l.before(l.depth-(N-1));n.replace(h,l.after(-A),new W(E,4-N,0));let w=-1;n.doc.nodesBetween(h,n.doc.content.size,(v,S)=>{if(w>-1)return!1;v.isTextblock&&v.content.size===0&&(w=S+1)}),w>-1&&n.setSelection(te.near(n.doc.resolve(w))),n.scrollIntoView()}return!0}const m=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,b={...Ki(p,f.type.name,f.attrs),...e},k={...Ki(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const _=m?[{type:a,attrs:b},{type:m,attrs:k}]:[{type:a,attrs:b}];if(!fn(n.doc,l.pos,2))return!1;if(o){const{selection:E,storedMarks:N}=r,{splittableMarks:A}=i.extensionManager,d=N||E.$to.parentOffset&&E.$from.marks();if(n.split(l.pos,2,_).scrollIntoView(),!d||!o)return!0;const g=d.filter(h=>A.includes(h.type.name));n.ensureMarks(g)}return!0},Cl=(t,e)=>{const n=kl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Ln(t.doc,n.pos)&&t.join(n.pos),!0},Sl=(t,e)=>{const n=kl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Ln(t.doc,r)&&t.join(r),!0};var h1=Object.freeze({__proto__:null,blur:ak,clearContent:lk,clearNodes:ck,command:uk,createParagraphNear:dk,cut:fk,deleteCurrentNode:pk,deleteNode:hk,deleteRange:mk,deleteSelection:gk,enter:bk,exitCode:yk,extendMarkRange:wk,first:kk,focus:_k,forEach:Ek,insertContent:vk,insertContentAt:Tk,joinBackward:Ok,joinDown:Ak,joinForward:Mk,joinItemBackward:xk,joinItemForward:Lk,joinTextblockBackward:Rk,joinTextblockForward:Pk,joinUp:Nk,keyboardShortcut:Dk,lift:Bk,liftEmptyBlock:Fk,liftListItem:$k,newlineInCode:Vk,resetAttributes:Hk,scrollIntoView:zk,selectAll:jk,selectNodeBackward:Uk,selectNodeForward:Wk,selectParentNode:Kk,selectTextblockEnd:qk,selectTextblockStart:Gk,setContent:Jk,setMark:s1,setMeta:a1,setNode:l1,setNodeSelection:c1,setTextSelection:u1,sinkListItem:d1,splitBlock:f1,splitListItem:p1,toggleList:(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:f,splittableMarks:p}=o.extensionManager,m=We(t,s.schema),b=We(e,s.schema),{selection:k,storedMarks:_}=s,{$from:E,$to:N}=k,A=E.blockRange(N),d=_||k.$to.parentOffset&&k.$from.marks();if(!A)return!1;const g=kl(h=>cp(h.type.name,f))(k);if(A.depth>=1&&g&&A.depth-g.depth<=1){if(g.node.type===m)return c.liftListItem(b);if(cp(g.node.type.name,f)&&m.validContent(g.node.content)&&a)return l().command(()=>(i.setNodeMarkup(g.pos,m),!0)).command(()=>Cl(i,m)).command(()=>Sl(i,m)).run()}return!n||!d||!a?l().command(()=>u().wrapInList(m,r)?!0:c.clearNodes()).wrapInList(m,r).command(()=>Cl(i,m)).command(()=>Sl(i,m)).run():l().command(()=>{const h=u().wrapInList(m,r),w=d.filter(v=>p.includes(v.type.name));return i.ensureMarks(w),h?!0:c.clearNodes()}).wrapInList(m,r).command(()=>Cl(i,m)).command(()=>Sl(i,m)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=zn(t,r.schema);return El(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=We(t,r.schema),s=We(e,r.schema),a=Oo(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=We(t,n.schema);return Oo(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=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,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=zn(t,r.schema),{$from:c,empty:u,ranges:f}=a;if(!o)return!0;if(u&&s){let{from:p,to:m}=a;const b=(i=c.marks().find(_=>_.type===l))===null||i===void 0?void 0:i.attrs,k=ml(c,l,b);k&&(p=k.from,m=k.to),n.removeMark(p,m,l)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Wi(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=We(t,r.schema)),a==="mark"&&(s=zn(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let f,p,m,b;n.selection.empty?r.doc.nodesBetween(c,u,(k,_)=>{i&&i===k.type&&(m=Math.max(_,c),b=Math.min(_+k.nodeSize,u),f=_,p=k)}):r.doc.nodesBetween(c,u,(k,_)=>{_<c&&i&&i===k.type&&(m=Math.max(_,c),b=Math.min(_+k.nodeSize,u),f=_,p=k),_>=c&&_<=u&&(i&&i===k.type&&n.setNodeMarkup(_,void 0,{...k.attrs,...e}),s&&k.marks.length&&k.marks.forEach(E=>{if(s===E.type){const N=Math.max(_,c),A=Math.min(_+k.nodeSize,u);n.addMark(N,A,s.create({...E.attrs,...e}))}}))}),p&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(k=>{s===k.type&&n.addMark(m,b,s.create({...k.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=We(t,n.schema);return Bw(o,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const o=We(t,n.schema);return Fw(o,e)(n,r)}});const m1=Ke.create({name:"commands",addCommands(){return{...h1}}}),g1=Ke.create({name:"drop",addProseMirrorPlugins(){return[new $e({key:new Ue("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),b1=Ke.create({name:"editable",addProseMirrorPlugins(){return[new $e({key:new Ue("editable"),props:{editable:()=>this.editor.options.editable}})]}}),y1=Ke.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new $e({key:new Ue("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),w1=Ke.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:f}=l,{pos:p,parent:m}=f,b=f.parent.isTextblock&&p>0?a.doc.resolve(p-1):f,k=b.parent.type.spec.isolating,_=f.pos-f.parentOffset,E=k&&b.parent.childCount===1?_===f.pos:ee.atStart(c).from===p;return!u||!m.type.isTextblock||m.textContent.length||!E||E&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return bl()||op()?i:o},addProseMirrorPlugins(){return[new $e({key:new Ue("clearDocument"),appendTransaction:(t,e,n)=>{const r=t.some(k=>k.docChanged)&&!e.doc.eq(n.doc),o=t.some(k=>k.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,l=ee.atStart(e.doc).from,c=ee.atEnd(e.doc).to;if(i||!(s===l&&a===c)||!vl(n.doc))return;const p=n.tr,m=Ii({state:n,transaction:p}),{commands:b}=new Di({editor:this.editor,state:m});if(b.clearNodes(),!!p.steps.length)return p}})]}}),k1=Ke.create({name:"paste",addProseMirrorPlugins(){return[new $e({key:new Ue("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_1=Ke.create({name:"tabindex",addProseMirrorPlugins(){return[new $e({key:new Ue("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class pr{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new pr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new pr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new pr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+(i?0:1),a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;const l=new pr(a,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new pr(a,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(i[l]!==n[l])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(n);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(l=>n[l]===s.node.attrs[l])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const E1=`.ProseMirror {
|
|
1
|
+
(function(p,Ce){typeof exports=="object"&&typeof module<"u"?module.exports=Ce(require("vue")):typeof define=="function"&&define.amd?define(["vue"],Ce):(p=typeof globalThis<"u"?globalThis:p||self,p.richtext=Ce(p.Vue))})(this,(function(p){"use strict";function Ce(t){this.content=t}Ce.prototype={constructor:Ce,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new Ce(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ce(n)},addToStart:function(t,e){return new Ce([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ce(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new Ce(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ce.from(t),t.size?new Ce(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ce.from(t),t.size?new Ce(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ce.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},Ce.from=function(t){if(t instanceof Ce)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ce(e)};function Nl(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let i=0;o.text[i]==s.text[i];i++)n++;return n}if(o.content.size||s.content.size){let i=Nl(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function Ml(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let i=t.child(--o),a=e.child(--s),l=i.nodeSize;if(i==a){n-=l,r-=l;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let c=0,d=Math.min(i.text.length,a.text.length);for(;c<d&&i.text[i.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(i.content.size||a.content.size){let c=Ml(i.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class I{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,s){for(let i=0,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;if(c>e&&r(l,o+a,s||null,i)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,o+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(i?i=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new I(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let s=0,i=0;i<n;s++){let a=this.content[s],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),o+=a.nodeSize),i=l}return new I(r,o)}cutByIndex(e,n){return e==n?I.empty:e==0&&n==this.content.length?this:new I(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new I(o,s)}addToStart(e){return new I([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new I(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Nl(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ml(this,e,n,r)}findIndex(e){if(e==0)return so(0,e);if(e==this.size)return so(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),s=r+o.nodeSize;if(s>=e)return s==e?so(n+1,s):so(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return I.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new I(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return I.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new I(n||e,r)}static from(e){if(!e)return I.empty;if(e instanceof I)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new I([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}I.empty=new I([],0);const Gs={index:0,offset:0};function so(t,e){return Gs.index=t,Gs.offset=e,Gs}function io(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!io(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!io(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let de=class Sl{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&io(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Sl.none;if(e instanceof Sl)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};de.none=[];class ao extends Error{}class H{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Ol(this.content,e+this.openStart,n);return r&&new H(r,this.openStart,this.openEnd)}removeBetween(e,n){return new H(Al(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return H.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new H(I.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new H(e,r,o)}}H.empty=new H(I.empty,0,0);function Al(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(o==e||s.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(Al(s.content,e-o-1,n-o-1)))}function Ol(t,e,n,r){let{index:o,offset:s}=t.findIndex(e),i=t.maybeChild(o);if(s==e||i.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Ol(i.content,e-s-1,n,i);return a&&t.replaceChild(o,i.copy(a))}function Vp(t,e,n){if(n.openStart>t.depth)throw new ao("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ao("Inconsistent open depths");return Ll(t,e,n,0)}function Ll(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let i=Ll(t,e,n,r+1);return s.copy(s.content.replaceChild(o,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,a=i.content;return kn(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=$p(n,t);return kn(s,Pl(t,i,a,e,r))}else return kn(s,lo(t,e,r))}function Il(t,e){if(!e.type.compatibleContent(t.type))throw new ao("Cannot join "+e.type.name+" onto "+t.type.name)}function qs(t,e,n){let r=t.node(n);return Il(r,e.node(n)),r}function yn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function gr(t,e,n,r){let o=(e||t).node(n),s=0,i=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(yn(t.nodeAfter,r),s++));for(let a=s;a<i;a++)yn(o.child(a),r);e&&e.depth==n&&e.textOffset&&yn(e.nodeBefore,r)}function kn(t,e){return t.type.checkContent(e),t.copy(e)}function Pl(t,e,n,r,o){let s=t.depth>o&&qs(t,e,o+1),i=r.depth>o&&qs(n,r,o+1),a=[];return gr(null,t,o,a),s&&i&&e.index(o)==n.index(o)?(Il(s,i),yn(kn(s,Pl(t,e,n,r,o+1)),a)):(s&&yn(kn(s,lo(t,e,o+1)),a),gr(e,n,o,a),i&&yn(kn(i,lo(n,r,o+1)),a)),gr(r,null,o,a),new I(a)}function lo(t,e,n){let r=[];if(gr(null,t,n,r),t.depth>n){let o=qs(t,e,n+1);yn(kn(o,lo(t,e,n+1)),r)}return gr(e,null,n,r),new I(r)}function $p(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)o=e.node(s).copy(I.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class br{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return de.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let s=r.marks;for(var i=0;i<s.length;i++)s[i].type.spec.inclusive===!1&&(!o||!s[i].isInSet(o.marks))&&(s=s[i--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new co(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,s=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(s),c=s-l;if(r.push(i,a,o+l),!c||(i=i.child(a),i.isText))break;s=c-1,o+=l+1}return new br(n,r,s)}static resolveCached(e,n){let r=Rl.get(e);if(r)for(let s=0;s<r.elts.length;s++){let i=r.elts[s];if(i.pos==n)return i}else Rl.set(e,r=new zp);let o=r.elts[r.i]=br.resolve(e,n);return r.i=(r.i+1)%Hp,o}}class zp{constructor(){this.elts=[],this.i=0}}const Hp=12,Rl=new WeakMap;class co{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const jp=Object.create(null);let Kt=class Tl{constructor(e,n,r,o=de.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||I.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&io(this.attrs,n||e.defaultAttrs||jp)&&de.sameSet(this.marks,r||de.none)}copy(e=null){return e==this.content?this:new Tl(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Tl(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return H.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),a=o.start(i),c=o.node(i).content.cut(o.pos-a,s.pos-a);return new H(c,o.depth-i,s.depth-i)}replace(e,n,r){return Vp(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return br.resolveCached(this,e)}resolveNoCache(e){return br.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Dl(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=I.empty,o=0,s=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,o,s),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),i=s&&s.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=de.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!de.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=I.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,o,r);return s.type.checkAttrs(s.attrs),s}};Kt.prototype.text=void 0;class uo extends Kt{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Dl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new uo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new uo(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Dl(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class wn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Up(e,n);if(r.next==null)return wn.empty;let o=Bl(r);r.next&&r.err("Unexpected trailing text");let s=Xp(Yp(o));return Qp(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let s=n;o&&s<r;s++)o=o.matchType(e.child(s).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function s(i,a){let l=i.matchFragment(e,r);if(l&&(!n||l.validEnd))return I.from(a.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:d,next:f}=i.next[c];if(!(d.isText||d.hasRequiredAttrs())&&o.indexOf(f)==-1){o.push(f);let h=s(f,a.concat(d));if(h)return h}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),s=o.match;if(s.matchType(e)){let i=[];for(let a=o;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:a,next:l}=s.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let s=o+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)s+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return s}).join(`
|
|
2
|
+
`)}}wn.empty=new wn(!0);class Up{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Bl(t){let e=[];do e.push(Wp(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Wp(t){let e=[];do e.push(Kp(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Kp(t){let e=Jp(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Gp(t,e);else break;return e}function Fl(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Gp(t,e){let n=Fl(t),r=n;return t.eat(",")&&(t.next!="}"?r=Fl(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function qp(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let i=n[s];i.isInGroup(e)&&o.push(i)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Jp(t){if(t.eat("(")){let e=Bl(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=qp(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Yp(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,a,l){let c={term:l,to:a};return e[i].push(c),c}function o(i,a){i.forEach(l=>l.to=a)}function s(i,a){if(i.type=="choice")return i.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(i.type=="seq")for(let l=0;;l++){let c=s(i.exprs[l],a);if(l==i.exprs.length-1)return c;o(c,a=n())}else if(i.type=="star"){let l=n();return r(a,l),o(s(i.expr,l),l),[r(l)]}else if(i.type=="plus"){let l=n();return o(s(i.expr,a),l),o(s(i.expr,l),l),[r(l)]}else{if(i.type=="opt")return[r(a)].concat(s(i.expr,a));if(i.type=="range"){let l=a;for(let c=0;c<i.min;c++){let d=n();o(s(i.expr,l),d),l=d}if(i.max==-1)o(s(i.expr,l),l);else for(let c=i.min;c<i.max;c++){let d=n();r(l,d),o(s(i.expr,l),d),l=d}return[r(l)]}else{if(i.type=="name")return[r(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function Vl(t,e){return e-t}function $l(t,e){let n=[];return r(e),n.sort(Vl);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let i=0;i<s.length;i++){let{term:a,to:l}=s[i];!a&&n.indexOf(l)==-1&&r(l)}}}function Xp(t){let e=Object.create(null);return n($l(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<o.length;d++)o[d][0]==a&&(c=o[d][1]);$l(t,l).forEach(d=>{c||o.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let s=e[r.join(",")]=new wn(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let a=o[i][1].sort(Vl);s.next.push({type:o[i][0],next:e[a.join(",")]||n(a)})}return s}}function Qp(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];i.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function zl(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Hl(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function jl(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let s=t[o];s.validate&&s.validate(e[o])}}function Ul(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new em(t,r,e[r]);return n}let Wl=class Pp{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Ul(e,r.attrs),this.defaultAttrs=zl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Hl(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Kt(this,this.computeAttrs(e),I.from(n),de.setFrom(r))}createChecked(e=null,n,r){return n=I.from(n),this.checkContent(n),new Kt(this,this.computeAttrs(e),n,de.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=I.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(I.empty,!0);return s?new Kt(this,e,n.append(s),de.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){jl(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:de.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,i)=>r[s]=new Pp(s,n,i));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Zp(t,e,n){let r=n.split("|");return o=>{let s=o===null?"null":typeof o;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class em{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Zp(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class fo{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=Ul(e,o.attrs),this.excluded=null;let s=zl(this.attrs);this.instance=s?new de(this,s):null}create(e=null){return!e&&this.instance?this.instance:new de(this,Hl(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new fo(s,o++,n,i)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){jl(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Kl{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Ce.from(e.nodes),n.marks=Ce.from(e.marks||{}),this.nodes=Wl.compile(this.spec.nodes,this),this.marks=fo.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],i=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[i]||(r[i]=wn.parse(i,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Gl(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:Gl(this,i.split(" "))}this.nodeFromJSON=o=>Kt.fromJSON(this,o),this.markFromJSON=o=>de.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Wl){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new uo(r,r.defaultAttrs,e,de.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Gl(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],i=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function tm(t){return t.tag!=null}function nm(t){return t.style!=null}let Wn=class xl{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(tm(o))this.tags.push(o);else if(nm(o)){let s=/[^=]*/.exec(o.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=e.nodes[o.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Xl(this,n,!1);return r.addAll(e,de.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Xl(this,n,!0);return r.addAll(e,de.none,n.from,n.to),H.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(sm(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let i=s.getAttrs(e);if(i===!1)continue;s.attrs=i||void 0}return s}}}matchStyle(e,n,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let i=this.styles[s],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(i.getAttrs){let l=i.getAttrs(n);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.priority,i=0;for(;i<n.length;i++){let a=n[i];if((a.priority==null?50:a.priority)<s)break}n.splice(i,0,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(i=>{r(i=Ql(i)),i.mark||i.ignore||i.clearMark||(i.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(i=>{r(i=Ql(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new xl(e,xl.schemaRules(e)))}};const ql={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},rm={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Jl={ol:!0,ul:!0},yr=1,Js=2,kr=4;function Yl(t,e,n){return e!=null?(e?yr:0)|(e==="full"?Js:0):t&&t.whitespace=="pre"?yr|Js:n&~kr}class ho{constructor(e,n,r,o,s,i){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=i,this.content=[],this.activeMarks=de.none,this.match=s||(i&kr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(I.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&yr)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=I.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(I.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ql.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Xl{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,i=Yl(null,n.preserveWhitespace,0)|(r?kr:0);o?s=new ho(o.type,o.attrs,de.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new ho(null,null,de.none,!0,null,i):s=new ho(e.schema.topNodeType,null,de.none,!0,null,i),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,s=o.options&Js?"full":this.localPreserveWS||(o.options&yr)>0;if(s==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
3
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=o.content[o.content.length-1],a=e.previousSibling;(!i||a&&a.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),a;Jl.hasOwnProperty(i)&&this.parser.normalizeLists&&om(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:rm.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(ql.hasOwnProperty(i))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(s),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let s=this.parser.matchedStyles[o],i=r.getPropertyValue(s);if(i)for(let a=void 0;;){let l=this.parser.matchStyle(s,i,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let s,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(i,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let i=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];i!=a;i=i.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(i,n);this.findAtPoint(e,s)}findPlace(e,n,r){let o,s;for(let i=this.open,a=0;i>=0;i--){let l=this.nodes[i],c=l.findWrapping(e);if(c&&(!o||o.length>c.length+a)&&(o=c,s=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!o)return null;this.sync(s);for(let i=0;i<o.length;i++)n=this.enterInner(o[i],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let i=de.none;for(let a of o.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):Zl(a.type,e.type))&&(i=a.addToSet(i));return s.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,o)),s}enterInner(e,n,r,o=!1,s){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let a=Yl(e,s,i.options);i.options&kr&&i.content.length==0&&(a|=kr);let l=de.none;return r=r.filter(c=>(i.type?i.type.allowsMarkType(c.type):Zl(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new ho(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=yr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(o?0:1),i=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(i(a-1,l))return!0;return!1}else{let d=l>0||l==0&&o?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function om(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Jl.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function sm(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ql(t){let e={};for(let n in t)e[n]=t[n];return e}function Zl(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||s.indexOf(d)<0&&i(d))return!0}};if(i(o.contentMatch))return!0}}class _n{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ys(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let a=0,l=0;for(;a<s.length&&l<i.marks.length;){let c=i.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)o=s.pop()[1];for(;l<i.marks.length;){let c=i.marks[l++],d=this.serializeMark(c,i.isInline,n);d&&(s.push([c,o]),o.appendChild(d.dom),o=d.contentDOM||d.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=po(Ys(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&po(Ys(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return po(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new _n(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=ec(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return ec(e.marks)}}function ec(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ys(t){return t.document||window.document}const tc=new WeakMap;function im(t){let e=tc.get(t);return e===void 0&&tc.set(t,e=am(t)),e}function am(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function po(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],s;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=im(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let h=f.indexOf(" ");h>0?l.setAttributeNS(f.slice(0,h),f.slice(h+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=d;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:y}=po(t,h,n,r);if(l.appendChild(m),y){if(a)throw new RangeError("Multiple content holes");a=y}}}return{dom:l,contentDOM:a}}const nc=65535,rc=Math.pow(2,16);function lm(t,e){return t+e*rc}function oc(t){return t&nc}function cm(t){return(t-(t&nc))/rc}const sc=1,ic=2,mo=4,ac=8;class Xs{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&ac)>0}get deletedBefore(){return(this.delInfo&(sc|mo))>0}get deletedAfter(){return(this.delInfo&(ic|mo))>0}get deletedAcross(){return(this.delInfo&mo)>0}}class st{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&st.empty)return st.empty}recover(e){let n=0,r=oc(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+cm(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,s=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+s],d=this.ranges[a+i],f=l+c;if(e<=f){let h=c?e==l?-1:e==f?1:n:n,m=l+o+(h<0?0:d);if(r)return m;let y=e==(n<0?l:f)?null:lm(a/3,e-l),w=e==l?ic:e==f?sc:mo;return(n<0?e!=l:e!=f)&&(w|=ac),new Xs(m,w,y)}o+=d-c}return r?e+o:new Xs(e+o,0,null)}touches(e,n){let r=0,o=oc(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],d=l+c;if(e<=d&&a==o*3)return!0;r+=this.ranges[a+i]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let i=this.ranges[o],a=i-(this.inverted?s:0),l=i+(this.inverted?0:s),c=this.ranges[o+n],d=this.ranges[o+r];e(a,a+c,l,l+d),s+=d-c}}invert(){return new st(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?st.empty:new st(e<0?[0,-e,0]:[0,0,e])}}st.empty=new st([]);class wr{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new wr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new wr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let s=this.from;s<this.to;s++){let i=this._maps[s],a=i.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Xs(e,o,null)}}const Qs=Object.create(null);class Ue{getMap(){return st.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Qs[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Qs)throw new RangeError("Duplicate use of step JSON ID "+e);return Qs[e]=n,n.prototype.jsonID=e,n}}class Ne{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ne(e,null)}static fail(e){return new Ne(null,e)}static fromReplace(e,n,r,o){try{return Ne.ok(e.replace(n,r,o))}catch(s){if(s instanceof ao)return Ne.fail(s.message);throw s}}}function Zs(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(Zs(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return I.fromArray(r)}class Gt extends Ue{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new H(Zs(n.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return Ne.fromReplace(e,this.from,this.to,s)}invert(){return new yt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Gt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Gt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Gt(n.from,n.to,e.markFromJSON(n.mark))}}Ue.jsonID("addMark",Gt);class yt extends Ue{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new H(Zs(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Ne.fromReplace(e,this.from,this.to,r)}invert(){return new Gt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new yt(n.pos,r.pos,this.mark)}merge(e){return e instanceof yt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new yt(n.from,n.to,e.markFromJSON(n.mark))}}Ue.jsonID("removeMark",yt);class qt extends Ue{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ne.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ne.fromReplace(e,this.pos,this.pos+1,new H(I.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new qt(this.pos,n.marks[o]);return new qt(this.pos,this.mark)}}return new En(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new qt(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qt(n.pos,e.markFromJSON(n.mark))}}Ue.jsonID("addNodeMark",qt);class En extends Ue{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ne.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ne.fromReplace(e,this.pos,this.pos+1,new H(I.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new qt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new En(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new En(n.pos,e.markFromJSON(n.mark))}}Ue.jsonID("removeNodeMark",En);class Ie extends Ue{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&ei(e,this.from,this.to)?Ne.fail("Structure replace would overwrite content"):Ne.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new st([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ie(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Ie(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ie)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?H.empty:new H(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ie(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?H.empty:new H(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ie(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ie(n.from,n.to,H.fromJSON(e,n.slice),!!n.structure)}}Ue.jsonID("replace",Ie);class Pe extends Ue{constructor(e,n,r,o,s,i,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=a}apply(e){if(this.structure&&(ei(e,this.from,this.gapFrom)||ei(e,this.gapTo,this.to)))return Ne.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ne.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ne.fromReplace(e,this.from,this.to,r):Ne.fail("Content does not fit in gap")}getMap(){return new st([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Pe(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new Pe(n.pos,r.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Pe(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ue.jsonID("replaceAround",Pe);function ei(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let i=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,o--}}return!1}function dm(t,e,n,r){let o=[],s=[],i,a;t.doc.nodesBetween(e,n,(l,c,d)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let h=Math.max(c,e),m=Math.min(c+l.nodeSize,n),y=r.addToSet(f);for(let w=0;w<f.length;w++)f[w].isInSet(y)||(i&&i.to==h&&i.mark.eq(f[w])?i.to=m:o.push(i=new yt(h,m,f[w])));a&&a.to==h?a.to=m:s.push(a=new Gt(h,m,r))}}),o.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function um(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,a)=>{if(!i.isInline)return;s++;let l=null;if(r instanceof fo){let c=i.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(i.marks)&&(l=[r]):l=i.marks;if(l&&l.length){let c=Math.min(a+i.nodeSize,n);for(let d=0;d<l.length;d++){let f=l[d],h;for(let m=0;m<o.length;m++){let y=o[m];y.step==s-1&&f.eq(o[m].style)&&(h=y)}h?(h.to=c,h.step=s):o.push({style:f,from:Math.max(a,e),to:c,step:s})}}}),o.forEach(i=>t.step(new yt(i.from,i.to,i.style)))}function ti(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),i=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),d=a+c.nodeSize,f=r.matchType(c.type);if(!f)i.push(new Ie(a,d,H.empty));else{r=f;for(let h=0;h<c.marks.length;h++)n.allowsMarkType(c.marks[h].type)||t.step(new yt(a,d,c.marks[h]));if(o&&c.isText&&n.whitespace!="pre"){let h,m=/\r?\n|\r/g,y;for(;h=m.exec(c.text);)y||(y=new H(I.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),i.push(new Ie(a+h.index,a+h.index+h[0].length,y))}}a=d}if(!r.validEnd){let l=r.fillBefore(I.empty,!0);t.replace(a,a,new H(l,0,0))}for(let l=i.length-1;l>=0;l--)t.step(i[l])}function fm(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Kn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),s=t.$from.index(r),i=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(s,i,n))return r;if(r==0||o.type.spec.isolating||!fm(o,s,i))break}return null}function hm(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),a=o.after(s+1),l=i,c=a,d=I.empty,f=0;for(let y=s,w=!1;y>n;y--)w||r.index(y)>0?(w=!0,d=I.from(r.node(y).copy(d)),f++):l--;let h=I.empty,m=0;for(let y=s,w=!1;y>n;y--)w||o.after(y+1)<o.end(y)?(w=!0,h=I.from(o.node(y).copy(h)),m++):c++;t.step(new Pe(l,c,i,a,new H(d.append(h),f,m),d.size-f,!0))}function ni(t,e,n=null,r=t){let o=pm(t,e),s=o&&mm(r,e);return s?o.map(lc).concat({type:e,attrs:n}).concat(s.map(lc)):null}function lc(t){return{type:t,attrs:null}}function pm(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let i=s.length?s[0]:e;return n.canReplaceWith(r,o,i)?s:null}function mm(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),i=e.contentMatch.findWrapping(s.type);if(!i)return null;let l=(i.length?i[i.length-1]:e).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:i}function gm(t,e,n){let r=I.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let a=n[i].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=I.from(n[i].type.create(n[i].attrs,r))}let o=e.start,s=e.end;t.step(new Pe(o,s,o,s,new H(r,0,0),n.length,!0))}function bm(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(i,a)=>{let l=typeof o=="function"?o(i):o;if(i.isTextblock&&!i.hasMarkup(r,l)&&ym(t.doc,t.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let m=r.whitespace=="pre",y=!!r.contentMatch.matchType(r.schema.linebreakReplacement);m&&!y?c=!1:!m&&y&&(c=!0)}c===!1&&dc(t,i,a,s),ti(t,t.mapping.slice(s).map(a,1),r,void 0,c===null);let d=t.mapping.slice(s),f=d.map(a,1),h=d.map(a+i.nodeSize,1);return t.step(new Pe(f,h,f+1,h-1,new H(I.from(r.create(l,null,i.marks)),0,0),1,!0)),c===!0&&cc(t,i,a,s),!1}})}function cc(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let i,a=/\r?\n|\r/g;for(;i=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+s+i.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function dc(t,e,n,r){e.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+s);t.replaceWith(i,i+1,e.type.schema.text(`
|
|
5
|
+
`))}})}function ym(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function km(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let i=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,i);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Pe(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new H(I.from(i),0,0),1,!0))}function Pt(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,i=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!i.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>s;c--,d--){let f=o.node(c),h=o.index(c);if(f.type.spec.isolating)return!1;let m=f.content.cutByIndex(h,f.childCount),y=r&&r[d+1];y&&(m=m.replaceChild(0,y.type.create(y.attrs)));let w=r&&r[d]||f;if(!f.canReplace(h+1,f.childCount)||!w.type.validContent(m))return!1}let a=o.indexAfter(s),l=r&&r[0];return o.node(s).canReplaceWith(a,a,l?l.type:o.node(s+1).type)}function wm(t,e,n=1,r){let o=t.doc.resolve(e),s=I.empty,i=I.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){s=I.from(o.node(a).copy(s));let d=r&&r[c];i=I.from(d?d.type.create(d.attrs,i):o.node(a).copy(i))}t.step(new Ie(e,e,new H(s.append(i),n,n),!0))}function Jt(t,e){let n=t.resolve(e),r=n.index();return uc(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function _m(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let s=e.child(o),i=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(i),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function uc(t,e){return!!(t&&e&&!t.isLeaf&&_m(t,e))}function go(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,a=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),a++,i=r.node(o).maybeChild(a)):(s=r.node(o).maybeChild(a-1),i=r.node(o+1)),s&&!s.isTextblock&&uc(s,i)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Em(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),i=s.node().type;if(o&&i.inlineContent){let d=i.whitespace=="pre",f=!!i.contentMatch.matchType(o);d&&!f?r=!1:!d&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);dc(t,d.node(),d.before(),a)}i.inlineContent&&ti(t,e+n-1,i,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Ie(c,l.map(e+n,-1),H.empty,!0)),r===!0){let d=t.doc.resolve(c);cc(t,d.node(),d.before(),t.steps.length)}return t}function Cm(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function fc(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let i=r.depth;i>=0;i--){let a=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,l=r.index(i)+(a>0?1:0),c=r.node(i),d=!1;if(s==1)d=c.canReplace(l,l,o);else{let f=c.contentMatchAt(l).findWrapping(o.firstChild.type);d=f&&c.canReplaceWith(l,l,f[0])}if(d)return a==0?r.pos:a<0?r.before(i+1):r.after(i+1)}return null}function bo(t,e,n=e,r=H.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return hc(o,s,r)?new Ie(e,n,r):new vm(o,s,r).fit()}function hc(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class vm{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=I.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=I.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let s=this.placed,i=r.depth,a=o.depth;for(;i&&a&&s.childCount==1;)s=s.firstChild.content,i--,a--;let l=new H(s,i,a);return e>-1?new Pe(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ie(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=ri(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,f=null;if(n==1&&(i?c.matchType(i.type)||(f=c.fillBefore(I.from(i),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:f};if(n==2&&i&&(d=c.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:d};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=ri(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new H(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=ri(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new H(_r(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new H(_r(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let w=0;w<s.length;w++)this.openFrontierNode(s[w]);let i=this.unplaced,a=r?r.content:i.content,l=i.openStart-e,c=0,d=[],{match:f,type:h}=this.frontier[n];if(o){for(let w=0;w<o.childCount;w++)d.push(o.child(w));f=f.matchFragment(o)}let m=a.size+e-(i.content.size-i.openEnd);for(;c<a.childCount;){let w=a.child(c),E=f.matchType(w.type);if(!E)break;c++,(c>1||l==0||w.content.size)&&(f=E,d.push(pc(w.mark(h.allowedMarks(w.marks)),c==1?l:0,c==a.childCount?m:-1)))}let y=c==a.childCount;y||(m=-1),this.placed=Er(this.placed,n,I.from(d)),this.frontier[n].match=f,y&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,E=a;w<m;w++){let _=E.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),E=_.content}this.unplaced=y?e==0?H.empty:new H(_r(i.content,e-1,1),e-1,m<0?i.openEnd:e-1):new H(_r(i.content,e,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!oi(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),i=oi(e,n,o,r,s);if(i){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=oi(e,a,c,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:i,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Er(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Er(this.placed,this.depth,I.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(I.empty,!0);n.childCount&&(this.placed=Er(this.placed,this.frontier.length,n))}}function _r(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(_r(t.firstChild.content,e-1,n)))}function Er(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Er(t.lastChild.content,e-1,n)))}function ri(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function pc(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,pc(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(I.empty,!0)))),t.copy(r)}function oi(t,e,n,r,o){let s=t.node(e),i=o?t.indexAfter(e):t.index(e);if(i==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,i);return a&&!Sm(n,s.content,i)?a:null}function Sm(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Tm(t){return t.spec.defining||t.spec.definingForContent}function xm(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(hc(o,s,r))return t.step(new Ie(e,n,r));let i=gc(o,t.doc.resolve(n));i[i.length-1]==0&&i.pop();let a=-(o.depth+1);i.unshift(a);for(let h=o.depth,m=o.pos-1;h>0;h--,m--){let y=o.node(h).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;i.indexOf(h)>-1?a=h:o.before(h)==m&&i.splice(1,0,-h)}let l=i.indexOf(a),c=[],d=r.openStart;for(let h=r.content,m=0;;m++){let y=h.firstChild;if(c.push(y),m==r.openStart)break;h=y.content}for(let h=d-1;h>=0;h--){let m=c[h],y=Tm(m.type);if(y&&!m.sameMarkup(o.node(Math.abs(a)-1)))d=h;else if(y||!m.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let m=(h+d+1)%(r.openStart+1),y=c[m];if(y)for(let w=0;w<i.length;w++){let E=i[(w+l)%i.length],_=!0;E<0&&(_=!1,E=-E);let x=o.node(E-1),A=o.index(E-1);if(x.canReplaceWith(A,A,y.type,y.marks))return t.replace(o.before(E),_?s.after(E):n,new H(mc(r.content,0,r.openStart,m),m,r.openEnd))}}let f=t.steps.length;for(let h=i.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let m=i[h];m<0||(e=o.before(m),n=s.after(m))}}function mc(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(mc(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),i=s.fillBefore(t).append(t);t=i.append(s.matchFragment(i).fillBefore(I.empty,!0))}return t}function Nm(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=Cm(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new H(I.from(r),0,0))}function Mm(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),s=gc(r,o);for(let i=0;i<s.length;i++){let a=s[i],l=i==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return t.delete(r.before(i),n);t.delete(e,n)}function gc(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class Gn extends Ue{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ne.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Ne.fromReplace(e,this.pos,this.pos+1,new H(I.from(o),0,n.isLeaf?0:1))}getMap(){return st.empty}invert(e){return new Gn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Gn(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Gn(n.pos,n.attr,n.value)}}Ue.jsonID("attr",Gn);class Cr extends Ue{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Ne.ok(r)}getMap(){return st.empty}invert(e){return new Cr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Cr(n.attr,n.value)}}Ue.jsonID("docAttr",Cr);let qn=class extends Error{};qn=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},qn.prototype=Object.create(Error.prototype),qn.prototype.constructor=qn,qn.prototype.name="TransformError";class si{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new wr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new qn(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=H.empty){let o=bo(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new H(I.from(r),0,0))}delete(e,n){return this.replace(e,n,H.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return xm(this,e,n,r),this}replaceRangeWith(e,n,r){return Nm(this,e,n,r),this}deleteRange(e,n){return Mm(this,e,n),this}lift(e,n){return hm(this,e,n),this}join(e,n=1){return Em(this,e,n),this}wrap(e,n){return gm(this,e,n),this}setBlockType(e,n=e,r,o=null){return bm(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return km(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Gn(e,n,r)),this}setDocAttribute(e,n){return this.step(new Cr(e,n)),this}addNodeMark(e,n){return this.step(new qt(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof de)n.isInSet(r.marks)&&this.step(new En(e,n));else{let o=r.marks,s,i=[];for(;s=n.isInSet(o);)i.push(new En(e,s)),o=s.removeFromSet(o);for(let a=i.length-1;a>=0;a--)this.step(i[a])}return this}split(e,n=1,r){return wm(this,e,n,r),this}addMark(e,n,r){return dm(this,e,n,r),this}removeMark(e,n,r){return um(this,e,n,r),this}clearIncompatible(e,n,r){return ti(this,e,n,r),this}}const ii=Object.create(null);class X{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new bc(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=H.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:c}=i[a],d=e.mapping.slice(s);e.replaceRange(d.map(l.pos),d.map(c.pos),a?H.empty:n),a==0&&wc(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:i,$to:a}=o[s],l=e.mapping.slice(r),c=l.map(i.pos),d=l.map(a.pos);s?e.deleteRange(c,d):(e.replaceRangeWith(c,d,n),wc(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Y(e):Jn(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let i=n<0?Jn(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Jn(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(i)return i}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new it(e.node(0))}static atStart(e){return Jn(e,e,0,0,1)||new it(e)}static atEnd(e){return Jn(e,e,e.content.size,e.childCount,-1)||new it(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ii[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in ii)throw new RangeError("Duplicate use of selection JSON ID "+e);return ii[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Y.between(this.$anchor,this.$head).getBookmark()}}X.prototype.visible=!0;class bc{constructor(e,n){this.$from=e,this.$to=n}}let yc=!1;function kc(t){!yc&&!t.parent.inlineContent&&(yc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Y extends X{constructor(e,n=e){kc(e),kc(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return X.near(r);let o=e.resolve(n.map(this.anchor));return new Y(o.parent.inlineContent?o:r,r)}replace(e,n=H.empty){if(super.replace(e,n),n==H.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Y&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new yo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Y(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let s=X.findFrom(n,r,!0)||X.findFrom(n,-r,!0);if(s)n=s.$head;else return X.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(X.findFrom(e,-r,!0)||X.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Y(e,n)}}X.jsonID("text",Y);class yo{constructor(e,n){this.anchor=e,this.head=n}map(e){return new yo(e.map(this.anchor),e.map(this.head))}resolve(e){return Y.between(e.resolve(this.anchor),e.resolve(this.head))}}class J extends X{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=e.resolve(o);return r?X.near(s):new J(s)}content(){return new H(I.from(this.node),0,0)}eq(e){return e instanceof J&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ai(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new J(e.resolve(n.anchor))}static create(e,n){return new J(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}J.prototype.visible=!1,X.jsonID("node",J);class ai{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new yo(r,r):new ai(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&J.isSelectable(r)?new J(n):X.near(n)}}class it extends X{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=H.empty){if(n==H.empty){e.delete(0,e.doc.content.size);let r=X.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new it(e)}map(e){return new it(e)}eq(e){return e instanceof it}getBookmark(){return Am}}X.jsonID("all",it);const Am={map(){return this},resolve(t){return new it(t)}};function Jn(t,e,n,r,o,s=!1){if(e.inlineContent)return Y.create(t,n);for(let i=r-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let a=e.child(i);if(a.isAtom){if(!s&&J.isSelectable(a))return J.create(t,n-(o<0?a.nodeSize:0))}else{let l=Jn(t,a,n+o,o<0?a.childCount:0,o,s);if(l)return l}n+=a.nodeSize*o}return null}function wc(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Ie||o instanceof Pe))return;let s=t.mapping.maps[r],i;s.forEach((a,l,c,d)=>{i==null&&(i=d)}),t.setSelection(X.near(t.doc.resolve(i),n))}const _c=1,ko=2,Ec=4;class Om extends si{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|_c)&~ko,this.storedMarks=null,this}get selectionSet(){return(this.updated&_c)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ko,this}ensureMarks(e){return de.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ko)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ko,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||de.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let i=this.doc.resolve(n);s=r==n?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),this.selection.empty||this.setSelection(X.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ec,this}get scrolledIntoView(){return(this.updated&Ec)>0}}function Cc(t,e){return!e||!t?t:t.bind(e)}class vr{constructor(e,n,r){this.name=e,this.init=Cc(n.init,r),this.apply=Cc(n.apply,r)}}const Lm=[new vr("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new vr("selection",{init(t,e){return t.selection||X.atStart(e.doc)},apply(t){return t.selection}}),new vr("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new vr("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class li{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Lm.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new vr(r.key,r.spec.state,r))})}}class Yn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let s=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let l=o?o[i].n:0,c=o?o[i].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(d&&r.filterTransaction(d,i)){if(d.setMeta("appendedTransaction",e),!o){o=[];for(let f=0;f<this.config.plugins.length;f++)o.push(f<i?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}o&&(o[i]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Yn(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new Om(this)}static create(e){let n=new li(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Yn(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new li(this.schema,e.plugins),r=n.fields,o=new Yn(n);for(let s=0;s<r.length;s++){let i=r[s].name;o[i]=this.hasOwnProperty(i)?this[i]:r[s].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],s=o.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new li(e.schema,e.plugins),s=new Yn(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=Kt.fromJSON(e.schema,n.doc);else if(i.name=="selection")s.selection=X.fromJSON(s.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==i.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[i.name]=c.fromJSON.call(l,e,n[a],s);return}}s[i.name]=i.init(e,s)}}),s}}function vc(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=vc(o,e,{})),n[r]=o}return n}class ge{constructor(e){this.spec=e,this.props={},e.props&&vc(e.props,this,this.props),this.key=e.key?e.key.key:Sc("plugin")}getState(e){return e[this.key]}}const ci=Object.create(null);function Sc(t){return t in ci?t+"$"+ ++ci[t]:(ci[t]=0,t+"$")}class ve{constructor(e="key"){this.key=Sc(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const He=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Xn=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let di=null;const Rt=function(t,e,n){let r=di||(di=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Im=function(){di=null},Cn=function(t,e,n,r){return n&&(Tc(t,e,n,r,-1)||Tc(t,e,n,r,1))},Pm=/^(img|br|input|textarea|hr)$/i;function Tc(t,e,n,r,o){for(var s;;){if(t==n&&e==r)return!0;if(e==(o<0?0:ct(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Sr(t)||Pm.test(t.nodeName)||t.contentEditable=="false")return!1;e=He(t)+(o<0?0:1),t=i}else if(t.nodeType==1){let i=t.childNodes[e+(o<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((s=i.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=o;else return!1;else t=i,e=o<0?ct(t):0}else return!1}}function ct(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Rm(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=ct(t)}else if(t.parentNode&&!Sr(t))e=He(t),t=t.parentNode;else return null}}function Dm(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Sr(t))e=He(t)+1,t=t.parentNode;else return null}}function Bm(t,e,n){for(let r=e==0,o=e==ct(t);r||o;){if(t==n)return!0;let s=He(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==ct(t)}}function Sr(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const wo=function(t){return t.focusNode&&Cn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function vn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Fm(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Vm(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(ct(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(ct(r.startContainer),r.startOffset)}}}const vt=typeof navigator<"u"?navigator:null,xc=typeof document<"u"?document:null,Yt=vt&&vt.userAgent||"",ui=/Edge\/(\d+)/.exec(Yt),Nc=/MSIE \d/.exec(Yt),fi=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yt),tt=!!(Nc||fi||ui),Xt=Nc?document.documentMode:fi?+fi[1]:ui?+ui[1]:0,dt=!tt&&/gecko\/(\d+)/i.test(Yt);dt&&+(/Firefox\/(\d+)/.exec(Yt)||[0,0])[1];const hi=!tt&&/Chrome\/(\d+)/.exec(Yt),We=!!hi,Mc=hi?+hi[1]:0,Xe=!tt&&!!vt&&/Apple Computer/.test(vt.vendor),Qn=Xe&&(/Mobile\/\w+/.test(Yt)||!!vt&&vt.maxTouchPoints>2),ut=Qn||(vt?/Mac/.test(vt.platform):!1),$m=vt?/Win/.test(vt.platform):!1,Dt=/Android \d/.test(Yt),Tr=!!xc&&"webkitFontSmoothing"in xc.documentElement.style,zm=Tr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Hm(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Bt(t,e){return typeof t=="number"?t:t[e]}function jm(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Ac(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let i=n||t.dom;i;){if(i.nodeType!=1){i=Xn(i);continue}let a=i,l=a==s.body,c=l?Hm(s):jm(a),d=0,f=0;if(e.top<c.top+Bt(r,"top")?f=-(c.top-e.top+Bt(o,"top")):e.bottom>c.bottom-Bt(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Bt(o,"top")-c.top:e.bottom-c.bottom+Bt(o,"bottom")),e.left<c.left+Bt(r,"left")?d=-(c.left-e.left+Bt(o,"left")):e.right>c.right-Bt(r,"right")&&(d=e.right-c.right+Bt(o,"right")),d||f)if(l)s.defaultView.scrollBy(d,f);else{let m=a.scrollLeft,y=a.scrollTop;f&&(a.scrollTop+=f),d&&(a.scrollLeft+=d);let w=a.scrollLeft-m,E=a.scrollTop-y;e={left:e.left-w,top:e.top-E,right:e.right-w,bottom:e.bottom-E}}let h=l?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(h))break;i=h=="absolute"?i.offsetParent:Xn(i)}}function Um(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,i=n+1;i<Math.min(innerHeight,e.bottom);i+=5){let a=t.root.elementFromPoint(s,i);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:Oc(t.dom)}}function Oc(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Xn(r));return e}function Wm({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Lc(n,r==0?0:r-e)}function Lc(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Zn=null;function Km(t){if(t.setActive)return t.setActive();if(Zn)return t.focus(Zn);let e=Oc(t);t.focus(Zn==null?{get preventScroll(){return Zn={preventScroll:!0},!0}}:void 0),Zn||(Zn=!1,Lc(e,0))}function Ic(t,e){let n,r=2e8,o,s=0,i=e.top,a=e.top,l,c;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let h;if(d.nodeType==1)h=d.getClientRects();else if(d.nodeType==3)h=Rt(d).getClientRects();else continue;for(let m=0;m<h.length;m++){let y=h[m];if(y.top<=i&&y.bottom>=a){i=Math.max(y.bottom,i),a=Math.min(y.top,a);let w=y.left>e.left?y.left-e.left:y.right<e.left?e.left-y.right:0;if(w<r){n=d,r=w,o=w&&n.nodeType==3?{left:y.right<e.left?y.right:y.left,top:e.top}:e,d.nodeType==1&&w&&(s=f+(e.left>=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!l&&y.left<=e.left&&y.right>=e.left&&(l=d,c={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(s=f+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?Gm(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:Ic(n,o)}function Gm(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=Qt(r,1);if(s.top!=s.bottom&&pi(e,s))return{node:t,offset:o+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function pi(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function qm(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Jm(t,e,n){let{node:r,offset:o}=Ic(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();s=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function Ym(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!i&&l.left>r.left||l.top>r.top?o=a.posBefore:(!i&&l.right<r.left||l.bottom<r.top)&&(o=a.posAfter),i=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function Pc(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let i=t.childNodes[s];if(i.nodeType==1){let a=i.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(pi(e,c))return Pc(i,e,c)}}if((s=(s+1)%r)==o)break}return t}function Xm(t,e){let n=t.dom.ownerDocument,r,o=0,s=Vm(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let c=t.dom.getBoundingClientRect();if(!pi(e,c)||(i=Pc(t.dom,e,c),!i))return null}if(Xe)for(let c=i;r&&c;c=Xn(c))c.draggable&&(r=void 0);if(i=qm(i,e),r){if(dt&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let d=r.childNodes[o],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&o++}let c;Tr&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=Ym(t,r,o,e))}a==null&&(a=Jm(t,i,e));let l=t.docView.nearestDesc(i,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Rc(t){return t.top<t.bottom||t.left<t.right}function Qt(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Rc(r))return r}return Array.prototype.find.call(n,Rc)||t.getBoundingClientRect()}const Qm=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Dc(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=Tr||dt;if(r.nodeType==3)if(i&&(Qm.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=Qt(Rt(r,o,o),n);if(dt&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Qt(Rt(r,o-1,o-1),-1);if(c.top==l.top){let d=Qt(Rt(r,o,o+1),-1);if(d.top!=l.top)return xr(d,d.left<c.left)}}return l}else{let l=o,c=o,d=n<0?1:-1;return n<0&&!o?(c++,d=-1):n>=0&&o==r.nodeValue.length?(l--,d=1):n<0?l--:c++,xr(Qt(Rt(r,l,c),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==ct(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return mi(l.getBoundingClientRect(),!1)}if(s==null&&o<ct(r)){let l=r.childNodes[o];if(l.nodeType==1)return mi(l.getBoundingClientRect(),!0)}return mi(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==ct(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Rt(l,ct(l)-(i?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return xr(Qt(c,1),!1)}if(s==null&&o<ct(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Rt(l,0,i?0:1):l.nodeType==1?l:null:null;if(c)return xr(Qt(c,-1),!0)}return xr(Qt(r.nodeType==3?Rt(r):r,-n),n>=0)}function xr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function mi(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Bc(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function Zm(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Bc(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let i=Dc(t,o.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Rt(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(n=="up"?i.top-d.top>(d.bottom-i.top)*2:d.bottom-i.bottom>(i.bottom-d.top)*2))return!1}}return!0})}const eg=/[\u0590-\u08ac]/;function tg(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,a=t.domSelection();return a?!eg.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:i:Bc(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let m=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:y,focusOffset:w}=t.domSelectionRange(),E=y&&!m.contains(y.nodeType==1?y:y.parentNode)||l==y&&c==w;try{a.collapse(d,f),l&&(l!=d||c!=f)&&a.extend&&a.extend(l,c)}catch{}return h!=null&&(a.caretBidiLevel=h),E}):r.pos==r.start()||r.pos==r.end()}let Fc=null,Vc=null,$c=!1;function ng(t,e,n){return Fc==e&&Vc==n?$c:(Fc=e,Vc=n,$c=n=="up"||n=="down"?Zm(t,e,n):tg(t,e,n))}const ft=0,zc=1,Sn=2,St=3;class Nr{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=ft,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,i;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(i)+i.size:this.posAtStart}else{let s,i;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(i):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>He(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let s=this.getDesc(o),i;if(s&&(!n||s.node))if(r&&(i=s.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)for(let i=0;i<o.children.length;i++){let a=o.children[i];if(a.size){o=a;break}}return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let i=this.children[r],a=s+i.size;if(a>e||i instanceof Uc){o=e-s;break}s=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Hc&&s.side>=0;r--);if(n<=0){let s,i=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,i=!1);return s&&n&&i&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?He(s.dom)+1:0}}else{let s,i=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,i=!1);return s&&i&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?He(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let i=r,a=0;;a++){let l=this.children[a],c=i+l.size;if(o==-1&&e<=c){let d=i+l.border;if(e>=d&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=i;for(let f=a;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){o=He(h.dom)+1;break}e-=h.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let d=a+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=He(f.dom);break}n+=f.size}s==-1&&(s=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let s=Math.min(e,n),i=Math.max(e,n);for(let m=0,y=0;m<this.children.length;m++){let w=this.children[m],E=y+w.size;if(s>y&&i<E)return w.setSelection(e-y-w.border,n-y-w.border,r,o);y=E}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),f=!1;if((dt||Xe)&&e==n){let{node:m,offset:y}=a;if(m.nodeType==3){if(f=!!(y&&m.nodeValue[y-1]==`
|
|
6
|
+
`),f&&y==m.nodeValue.length)for(let w=m,E;w;w=w.parentNode){if(E=w.nextSibling){E.nodeName=="BR"&&(a=l={node:E.parentNode,offset:He(E)+1});break}let _=w.pmViewDesc;if(_&&_.node&&_.node.isBlock)break}}else{let w=m.childNodes[y-1];f=w&&(w.nodeName=="BR"||w.contentEditable=="false")}}if(dt&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let m=d.focusNode.childNodes[d.focusOffset];m&&m.contentEditable=="false"&&(o=!0)}if(!(o||f&&Xe)&&Cn(a.node,a.offset,d.anchorNode,d.anchorOffset)&&Cn(l.node,l.offset,d.focusNode,d.focusOffset))return;let h=!1;if((c.extend||e==n)&&!(f&&dt)){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let y=a;a=l,l=y}let m=document.createRange();m.setEnd(l.node,l.offset),m.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let s=this.children[o],i=r+s.size;if(r==i?e<=i&&n>=r:e<i&&n>r){let a=r+s.border,l=i-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==i?Sn:zc,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=St:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Sn:St}r=i}this.dirty=Sn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Sn:zc;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Hc extends Nr{constructor(e,n,r,o){let s,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(i.nodeType!=1){let a=document.createElement("span");a.appendChild(i),i=a}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==ft&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class rg extends Nr{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Tn extends Nr{constructor(e,n,r,o,s){super(e,[],r,o),this.mark=n,this.spec=s}static create(e,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return(!i||!i.dom)&&(i=_n.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Tn(e,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&St||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=St&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ft){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ft}}slice(e,n,r){let o=Tn.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=bi(s,n,i,r)),e>0&&(s=bi(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=o;return o.children=s,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Zt extends Nr{constructor(e,n,r,o,s,i,a,l,c){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,s,i){let a=s.nodeViews[n.type.name],l,c=a&&a(n,s,()=>{if(!l)return i;if(l.parent)return l.parent.posBeforeChild(l)},r,o),d=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=_n.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let h=d;return d=Gc(d,r,n),c?l=new og(e,n,r,o,d,f||null,h,c,s,i+1):n.isText?new _o(e,n,r,o,d,h,s):new Zt(e,n,r,o,d,f||null,h,s,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>I.empty)}return e}matchesNode(e,n,r){return this.dirty==ft&&e.eq(this.node)&&Eo(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,s=e.composing?this.localCompositionInfo(e,n):null,i=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new ig(this,i&&i.node,e);cg(this.node,this.innerDeco,(c,d,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&l.syncToMarks(d==this.node.childCount?de.none:this.node.child(d).marks,r,e),l.placeWidget(c,e,o)},(c,d,f,h)=>{l.syncToMarks(c.marks,r,e);let m;l.findNodeMatch(c,d,f,h)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(m=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,d,f,m,e)||l.updateNextNode(c,d,f,e,h,o)||l.addNode(c,d,f,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Sn)&&(i&&this.protectLocalComposition(e,i),Wc(this.contentDOM,this.children,e),Qn&&dg(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Y)||r<n||o>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let i=s.nodeValue,a=ug(this.node.content,i,r-n,o-n);return a<0?null:{node:s,pos:a,text:i}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new rg(this,s,n,o);e.input.compositionNodes.push(i),this.children=bi(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==St||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=ft}updateOuterDeco(e){if(Eo(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Kc(this.dom,this.nodeDOM,gi(this.outerDeco,this.node,n),gi(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function jc(t,e,n,r,o){Gc(r,e,t);let s=new Zt(void 0,t,e,n,r,r,r,o,0);return s.contentDOM&&s.updateChildren(o,0),s}class _o extends Zt{constructor(e,n,r,o,s,i,a){super(e,n,r,o,s,null,i,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==St||this.dirty!=ft&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ft||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=ft,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),s=document.createTextNode(o.text);return new _o(this.parent,o,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=St)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Uc extends Nr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ft&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class og extends Zt{constructor(e,n,r,o,s,i,a,l,c,d){super(e,n,r,o,s,i,a,c,d),this.spec=l}update(e,n,r,o){if(this.dirty==St)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Wc(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],a=i.dom;if(a.parentNode==t){for(;a!=r;)r=qc(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(i instanceof Tn){let l=r?r.previousSibling:t.lastChild;Wc(i.contentDOM,i.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=qc(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Mr=function(t){t&&(this.nodeName=t)};Mr.prototype=Object.create(null);const xn=[new Mr];function gi(t,e,n){if(t.length==0)return xn;let r=n?xn[0]:new Mr,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new Mr(i.nodeName));for(let a in i){let l=i[a];l!=null&&(n&&o.length==1&&o.push(r=new Mr(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function Kc(t,e,n,r){if(n==xn&&r==xn)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],a=n[s];if(s){let l;a&&a.nodeName==i.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==i.nodeName||(l=document.createElement(i.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=xn[0]),o=l}sg(o,a||xn[0],i)}return o}function sg(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function Gc(t,e,n){return Kc(t,t,xn,gi(e,n,t.nodeType!=1))}function Eo(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function qc(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class ig{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=ag(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,s=this.stack.length>>1,i=Math.min(s,e.length);for(;o<i&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=ft,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Tn.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,o){let s=-1,i;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,n,r))s=this.top.children.indexOf(i,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let i=this.top.children[o];return i.dirty==St&&i.dom==i.contentDOM&&(i.dirty=Sn),i.update(e,n,r,s)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,s,i){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Zt){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let d=l.dom,f,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=St&&Eo(n,l.outerDeco));if(!h&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(l,e,n,r,o,i)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Sn,f.updateChildren(o,i+1),f.dirty=ft),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,i){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Eo(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=Zt.create(this.top,n,r,o,s,i);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,o,s){let i=Zt.create(this.top,e,n,r,o,s);i.contentDOM&&i.updateChildren(o,s+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let s=new Hc(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Tn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof _o)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Xe||We)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new Uc(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function ag(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Tn)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,s.set(a,o),i.push(a)}}return{index:o,matched:s,matches:i.reverse()}}function lg(t,e){return t.type.side-e.type.side}function cg(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,o,e.forChild(s,d),c),s+=d.nodeSize}return}let i=0,a=[],l=null;for(let c=0;;){let d,f;for(;i<o.length&&o[i].to==s;){let E=o[i++];E.widget&&(d?(f||(f=[d])).push(E):d=E)}if(d)if(f){f.sort(lg);for(let E=0;E<f.length;E++)n(f[E],c,!!l)}else n(d,c,!!l);let h,m;if(l)m=-1,h=l,l=null;else if(c<t.childCount)m=c,h=t.child(c++);else break;for(let E=0;E<a.length;E++)a[E].to<=s&&a.splice(E--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)a.push(o[i++]);let y=s+h.nodeSize;if(h.isText){let E=y;i<o.length&&o[i].from<E&&(E=o[i].from);for(let _=0;_<a.length;_++)a[_].to<E&&(E=a[_].to);E<y&&(l=h.cut(E-s),h=h.cut(0,E-s),y=E,m=-1)}else for(;i<o.length&&o[i].to<y;)i++;let w=h.isInline&&!h.isLeaf?a.filter(E=>!E.inline):a.slice();r(h,w,e.forChild(s,h),m),s=y}}function dg(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function ug(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),a=s;if(s+=i.nodeSize,!i.isText)continue;let l=i.text;for(;o<t.childCount;){let c=t.child(o++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function bi(t,e,n,r,o){let s=[];for(let i=0,a=0;i<t.length;i++){let l=t[i],c=a,d=a+=l.size;c>=n||d<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,r)),o&&(s.push(o),o=void 0),d>n&&s.push(l.slice(n-c,l.size,r)))}return s}function yi(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,i=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let a=r.resolve(i),l,c;if(wo(n)){for(l=i;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&J.isSelectable(f)&&o.parent&&!(f.isInline&&Bm(n.focusNode,n.focusOffset,o.dom))){let h=o.posBefore;c=new J(i==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=i,h=i;for(let m=0;m<n.rangeCount;m++){let y=n.getRangeAt(m);f=Math.min(f,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(f<0)return null;[l,i]=h==t.state.selection.anchor?[h,f]:[f,h],a=r.resolve(i)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;c=wi(t,d,a,f)}return c}function Jc(t){return t.editable?t.hasFocus():nd(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ft(t,e=!1){let n=t.state.selection;if(Zc(t,n),!!Jc(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&We){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Cn(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)hg(t);else{let{anchor:r,head:o}=n,s,i;Yc&&!(n instanceof Y)&&(n.$from.parent.inlineContent||(s=Xc(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=Xc(t,n.to))),t.docView.setSelection(r,o,t,e),Yc&&(s&&Qc(s),i&&Qc(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&fg(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Yc=Xe||We&&Mc<63;function Xc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Xe&&o&&o.contentEditable=="false")return ki(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return ki(o);if(s)return ki(s)}}function ki(t){return t.contentEditable="true",Xe&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Qc(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function fg(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Jc(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function hg(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,He(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&tt&&Xt<=11&&(n.disabled=!0,n.disabled=!1)}function Zc(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(ed(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else ed(t)}function ed(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function wi(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Y.between(e,n,r)}function td(t){return t.editable&&!t.hasFocus()?!1:nd(t)}function nd(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function pg(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Cn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function _i(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&X.findFrom(s,e)}function en(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function rd(t,e,n){let r=t.state.selection;if(r instanceof Y)if(n.indexOf("s")>-1){let{$head:o}=r,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let i=t.state.doc.resolve(o.pos+s.nodeSize*(e<0?-1:1));return en(t,new Y(r.$anchor,i))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=_i(t.state,e);return o&&o instanceof J?en(t,o):!1}else if(!(ut&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,i;if(!s||s.isText)return!1;let a=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(a))&&!i.contentDOM?J.isSelectable(s)?en(t,new J(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):Tr?en(t,new Y(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return en(t,new Y(e>0?r.$to:r.$from));{let o=_i(t.state,e);return o?en(t,o):!1}}}function Co(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ar(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function er(t,e){return e<0?mg(t):gg(t)}function mg(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(dt&&n.nodeType==1&&r<Co(n)&&Ar(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Ar(a,-1))o=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(od(n))break;{let a=n.previousSibling;for(;a&&Ar(a,-1);)o=n.parentNode,s=He(a),a=a.previousSibling;if(a)n=a,r=Co(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?Ei(t,n,r):o&&Ei(t,o,s)}function gg(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Co(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Ar(a,1))s=n,i=++r;else break}else{if(od(n))break;{let a=n.nextSibling;for(;a&&Ar(a,1);)s=a.parentNode,i=He(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=Co(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&Ei(t,s,i)}function od(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function bg(t,e){for(;t&&e==t.childNodes.length&&!Sr(t);)e=He(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function yg(t,e){for(;t&&!e&&!Sr(t);)e=He(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Ei(t,e,n){if(e.nodeType!=3){let s,i;(i=bg(e,n))?(e=i,n=0):(s=yg(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(wo(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Ft(t)},50)}function sd(t,e){let n=t.state.doc.resolve(e);if(!(We||$m)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left<o.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function id(t,e,n){let r=t.state.selection;if(r instanceof Y&&!r.empty||n.indexOf("s")>-1||ut&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=_i(t.state,e);if(i&&i instanceof J)return en(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,a=r instanceof it?X.near(i,e):X.findFrom(i,e);return a?en(t,a):!1}return!1}function ad(t,e){if(!(t.state.selection instanceof Y))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let i=t.state.tr;return e<0?i.delete(n.pos-s.nodeSize,n.pos):i.delete(n.pos,n.pos+s.nodeSize),t.dispatch(i),!0}return!1}function ld(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function kg(t){if(!Xe||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;ld(t,r,"true"),setTimeout(()=>ld(t,r,"false"),20)}return!1}function wg(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function _g(t,e){let n=e.keyCode,r=wg(e);if(n==8||ut&&n==72&&r=="c")return ad(t,-1)||er(t,-1);if(n==46&&!e.shiftKey||ut&&n==68&&r=="c")return ad(t,1)||er(t,1);if(n==13||n==27)return!0;if(n==37||ut&&n==66&&r=="c"){let o=n==37?sd(t,t.state.selection.from)=="ltr"?-1:1:-1;return rd(t,o,r)||er(t,o)}else if(n==39||ut&&n==70&&r=="c"){let o=n==39?sd(t,t.state.selection.from)=="ltr"?1:-1:1;return rd(t,o,r)||er(t,o)}else{if(n==38||ut&&n==80&&r=="c")return id(t,-1,r)||er(t,-1);if(n==40||ut&&n==78&&r=="c")return kg(t)||id(t,1,r)||er(t,1);if(r==(ut?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ci(t,e){t.someProp("transformCopied",m=>{e=m(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let m=r.firstChild;n.push(m.type.name,m.attrs!=m.type.defaultAttrs?m.attrs:null),r=m.content}let i=t.someProp("clipboardSerializer")||_n.fromSchema(t.state.schema),a=gd(),l=a.createElement("div");l.appendChild(i.serializeFragment(r,{document:a}));let c=l.firstChild,d,f=0;for(;c&&c.nodeType==1&&(d=pd[c.nodeName.toLowerCase()]);){for(let m=d.length-1;m>=0;m--){let y=a.createElement(d[m]);for(;l.firstChild;)y.appendChild(l.firstChild);l.appendChild(y),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${s}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",m=>m(e,t))||e.content.textBetween(0,e.content.size,`
|
|
7
|
+
|
|
8
|
+
`);return{dom:l,text:h,slice:e}}function cd(t,e,n,r,o){let s=o.parent.type.spec.code,i,a;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,s||r,t)}),s)return a=new H(I.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
9
|
+
`))),0,0),t.someProp("transformPasted",h=>{a=h(a,t,!0)}),a;let f=t.someProp("clipboardTextParser",h=>h(e,o,r,t));if(f)a=f;else{let h=o.marks(),{schema:m}=t.state,y=_n.fromSchema(m);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(w=>{let E=i.appendChild(document.createElement("p"));w&&E.appendChild(y.serializeNode(m.text(w,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),i=Sg(n),Tr&&Tg(i);let c=i&&i.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let h=i.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;i=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Wn.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(l||d),context:o,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!Eg.test(h.parentNode.nodeName)?{ignore:!0}:null}})),d)a=xg(hd(a,+d[1],+d[2]),d[4]);else if(a=H.maxOpen(Cg(a.content,o),!0),a.openStart||a.openEnd){let f=0,h=0;for(let m=a.content.firstChild;f<a.openStart&&!m.type.spec.isolating;f++,m=m.firstChild);for(let m=a.content.lastChild;h<a.openEnd&&!m.type.spec.isolating;h++,m=m.lastChild);a=hd(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t,l)}),a}const Eg=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Cg(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),s,i=[];if(t.forEach(a=>{if(!i)return;let l=o.findWrapping(a.type),c;if(!l)return i=null;if(c=i.length&&s.length&&ud(l,s,a,i[i.length-1],0))i[i.length-1]=c;else{i.length&&(i[i.length-1]=fd(i[i.length-1],s.length));let d=dd(a,l);i.push(d),o=o.matchType(d.type),s=l}}),i)return I.from(i)}return t}function dd(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,I.from(t));return t}function ud(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=ud(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(I.from(dd(n,t,o+1))))}}function fd(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,fd(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(I.empty,!0);return t.copy(n.append(r))}function vi(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,a=i.content;return t.childCount>1&&(s=0),o<r-1&&(a=vi(a,e,n,r,o+1,s)),o>=n&&(a=e<0?i.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(i.contentMatchAt(i.childCount).fillBefore(I.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(a))}function hd(t,e,n){return e<t.openStart&&(t=new H(vi(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new H(vi(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const pd={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let md=null;function gd(){return md||(md=document.implementation.createHTMLDocument("title"))}let Si=null;function vg(t){let e=window.trustedTypes;return e?(Si||(Si=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Si.createHTML(t)):t}function Sg(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=gd().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&pd[r[1].toLowerCase()])&&(t=o.map(s=>"<"+s+">").join("")+t+o.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=vg(t),o)for(let s=0;s<o.length;s++)n=n.querySelector(o[s])||n;return n}function Tg(t){let e=t.querySelectorAll(We?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function xg(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:s,openEnd:i}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=I.from(l.create(r[a+1],o)),s++,i++}return new H(o,s,i)}const Qe={},Ze={},Ng={touchstart:!0,touchmove:!0};class Mg{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Ag(t){for(let e in Qe){let n=Qe[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Lg(t,r)&&!xi(t,r)&&(t.editable||!(r.type in Ze))&&n(t,r)},Ng[e]?{passive:!0}:void 0)}Xe&&t.dom.addEventListener("input",()=>null),Ti(t)}function tn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Og(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ti(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>xi(t,r))})}function xi(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Lg(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Ig(t,e){!xi(t,e)&&Qe[e.type]&&(t.editable||!(e.type in Ze))&&Qe[e.type](t,e)}Ze.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!yd(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Dt&&We&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Qn&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,vn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||_g(t,n)?n.preventDefault():tn(t,"key")},Ze.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},Ze.keypress=(t,e)=>{let n=e;if(yd(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ut&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Y)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o,s))&&t.dispatch(s()),n.preventDefault()}};function vo(t){return{left:t.clientX,top:t.clientY}}function Pg(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Ni(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(t.someProp(e,a=>i>s.depth?a(t,n,s.nodeAfter,s.before(i),o,!0):a(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function tr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Rg(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(tr(t,new J(n)),!0):!1}function Dg(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof J&&(r=n.node);let s=t.state.doc.resolve(e);for(let i=s.depth+1;i>0;i--){let a=i>s.depth?s.nodeAfter:s.node(i);if(J.isSelectable(a)){r&&n.$from.depth>0&&i>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(i);break}}return o!=null?(tr(t,J.create(t.state.doc,o)),!0):!1}function Bg(t,e,n,r,o){return Ni(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?Dg(t,n):Rg(t,n))}function Fg(t,e,n,r){return Ni(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function Vg(t,e,n,r){return Ni(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||$g(t,n,r)}function $g(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(tr(t,Y.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let i=s>o.depth?o.nodeAfter:o.node(s),a=o.before(s);if(i.inlineContent)tr(t,Y.create(r,a+1,a+1+i.content.size));else if(J.isSelectable(i))tr(t,J.create(r,a));else continue;return!0}}function Mi(t){return So(t)}const bd=ut?"metaKey":"ctrlKey";Qe.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Mi(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&Pg(n,t.input.lastClick)&&!n[bd]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button};let i=t.posAtCoords(vo(n));i&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new zg(t,i,n,!!r)):(s=="doubleClick"?Fg:Vg)(t,i.pos,i.inside,n)?n.preventDefault():tn(t,"pointer"))};class zg{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[bd],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let d=e.state.doc.resolve(n.pos);s=d.parent,i=d.depth?d.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof J&&c.from<=i&&c.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&dt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),tn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ft(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(vo(e))),this.updateAllowDefault(e),this.allowDefault||!n?tn(this.view,"pointer"):Bg(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Xe&&this.mightDrag&&!this.mightDrag.node.isAtom||We&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(tr(this.view,X.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):tn(this.view,"pointer")}move(e){this.updateAllowDefault(e),tn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Qe.touchstart=t=>{t.input.lastTouch=Date.now(),Mi(t),tn(t,"pointer")},Qe.touchmove=t=>{t.input.lastTouch=Date.now(),tn(t,"pointer")},Qe.contextmenu=t=>Mi(t);function yd(t,e){return t.composing?!0:Xe&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Hg=Dt?5e3:-1;Ze.compositionstart=Ze.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Y&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),So(t,!0),t.markCursor=null;else if(So(t,!e.selection.empty),dt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let i=s<0?o.lastChild:o.childNodes[s-1];if(!i)break;if(i.nodeType==3){let a=t.domSelection();a&&a.collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}kd(t,Hg)},Ze.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,kd(t,20))};function kd(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>So(t),e))}function wd(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Ug());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function jg(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Rm(e.focusNode,e.focusOffset),r=Dm(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return r}}return n||r}function Ug(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function So(t,e=!1){if(!(Dt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),wd(t),e||t.docView&&t.docView.dirty){let n=yi(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Wg(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Or=tt&&Xt<15||Qn&&zm<604;Qe.copy=Ze.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=Or?null:n.clipboardData,i=r.content(),{dom:a,text:l}=Ci(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):Wg(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Kg(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Gg(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Lr(t,r.value,null,o,e):Lr(t,r.textContent,r.innerHTML,o,e)},50)}function Lr(t,e,n,r,o){let s=cd(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,s||H.empty)))return!0;if(!s)return!1;let i=Kg(s),a=i?t.state.tr.replaceSelectionWith(i,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function _d(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ze.paste=(t,e)=>{let n=e;if(t.composing&&!Dt)return;let r=Or?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Lr(t,_d(r),r.getData("text/html"),o,n)?n.preventDefault():Gg(t,n)};class Ed{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const qg=ut?"altKey":"ctrlKey";function Cd(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[qg]}Qe.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(vo(n)),i;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof J?o.to-1:o.to))){if(r&&r.mightDrag)i=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(i=J.create(t.state.doc,f.posBefore))}}let a=(i||t.state.selection).content(),{dom:l,text:c,slice:d}=Ci(t,a);(!n.dataTransfer.files.length||!We||Mc>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Or?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Or||n.dataTransfer.setData("text/plain",c),t.dragging=new Ed(d,Cd(t,n),i)},Qe.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},Ze.dragover=Ze.dragenter=(t,e)=>e.preventDefault(),Ze.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(vo(n));if(!o)return;let s=t.state.doc.resolve(o.pos),i=r&&r.slice;i?t.someProp("transformPasted",y=>{i=y(i,t,!1)}):i=cd(t,_d(n.dataTransfer),Or?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&Cd(t,n));if(t.someProp("handleDrop",y=>y(t,n,i||H.empty,a))){n.preventDefault();return}if(!i)return;n.preventDefault();let l=i?fc(t.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let c=t.state.tr;if(a){let{node:y}=r;y?y.replace(c):c.deleteSelection()}let d=c.mapping.map(l),f=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=c.doc;if(f?c.replaceRangeWith(d,d,i.content.firstChild):c.replaceRange(d,d,i),c.doc.eq(h))return;let m=c.doc.resolve(d);if(f&&J.isSelectable(i.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new J(m));else{let y=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((w,E,_,x)=>y=x),c.setSelection(wi(t,m,c.doc.resolve(y)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Qe.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ft(t)},20))},Qe.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Qe.beforeinput=(t,e)=>{if(We&&Dt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,vn(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Ze)Qe[t]=Ze[t];function Ir(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class To{constructor(e,n){this.toDOM=e,this.spec=n||Nn,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:i}=e.mapResult(n.from+o,this.side<0?-1:1);return i?null:new Re(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof To&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ir(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class nn{constructor(e,n){this.attrs=e,this.spec=n||Nn}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,i=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=i?null:new Re(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof nn&&Ir(this.attrs,e.attrs)&&Ir(this.spec,e.spec)}static is(e){return e.type instanceof nn}destroy(){}}class Ai{constructor(e,n){this.attrs=e,this.spec=n||Nn}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let i=e.mapResult(n.to+o,-1);return i.deleted||i.pos<=s.pos?null:new Re(s.pos-r,i.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof Ai&&Ir(this.attrs,e.attrs)&&Ir(this.spec,e.spec)}destroy(){}}class Re{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Re(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Re(e,e,new To(n,r))}static inline(e,n,r,o){return new Re(e,n,new nn(r,o))}static node(e,n,r,o){return new Re(e,n,new Ai(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof nn}get widget(){return this.type instanceof To}}const nr=[],Nn={};class fe{constructor(e,n){this.local=e.length?e:nr,this.children=n.length?n:nr}static create(e,n){return n.length?xo(n,e,0,Nn):Ke}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,s){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,n-a,r,o+a,s)}}map(e,n,r){return this==Ke||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Nn)}mapInner(e,n,r,o,s){let i;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(i||(i=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?Jg(this.children,i||[],e,n,r,o,s):i?new fe(i.sort(Mn),nr):Ke}add(e,n){return n.length?this==Ke?fe.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((a,l)=>{let c=l+r,d;if(d=Sd(n,a,c)){for(o||(o=this.children.slice());s<o.length&&o[s]<l;)s+=3;o[s]==l?o[s+2]=o[s+2].addInner(a,d,c+1):o.splice(s,0,l,l+a.nodeSize,xo(d,a,c+1,Nn)),s+=3}});let i=vd(s?Td(n):n,-r);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new fe(i.length?this.local.concat(i).sort(Mn):this.local,o||this.children)}remove(e){return e.length==0||this==Ke?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let i,a=r[s]+n,l=r[s+1]+n;for(let d=0,f;d<e.length;d++)(f=e[d])&&f.from>a&&f.to<l&&(e[d]=null,(i||(i=[])).push(f));if(!i)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(i,a+1);c!=Ke?r[s+2]=c:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,i;s<e.length;s++)if(i=e[s])for(let a=0;a<o.length;a++)o[a].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new fe(o,r):Ke}forChild(e,n){if(this==Ke)return this;if(n.isLeaf)return fe.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,i=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<i&&l.to>s&&l.type instanceof nn){let c=Math.max(s,l.from)-s,d=Math.min(i,l.to)-s;c<d&&(o||(o=[])).push(l.copy(c,d))}}if(o){let a=new fe(o.sort(Mn),nr);return r?new rn([a,r]):a}return r||Ke}eq(e){if(this==e)return!0;if(!(e instanceof fe)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Oi(this.localsInner(e))}localsInner(e){if(this==Ke)return nr;if(e.inlineContent||!this.local.some(nn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof nn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}fe.empty=new fe([],[]),fe.removeOverlap=Oi;const Ke=fe.empty;class rn{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Nn));return rn.from(r)}forChild(e,n){if(n.isLeaf)return fe.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=Ke&&(s instanceof rn?r=r.concat(s.members):r.push(s))}return rn.from(r)}eq(e){if(!(e instanceof rn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let i=0;i<s.length;i++)n.push(s[i])}}return n?Oi(r?n:n.sort(Mn)):nr}static from(e){switch(e.length){case 0:return Ke;case 1:return e[0];default:return new rn(e.every(n=>n instanceof fe)?e:e.reduce((n,r)=>n.concat(r instanceof fe?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Jg(t,e,n,r,o,s,i){let a=t.slice();for(let c=0,d=s;c<n.maps.length;c++){let f=0;n.maps[c].forEach((h,m,y,w)=>{let E=w-y-(m-h);for(let _=0;_<a.length;_+=3){let x=a[_+1];if(x<0||h>x+d-f)continue;let A=a[_]+d-f;m>=A?a[_+1]=h<=A?-2:-1:h>=d&&E&&(a[_]+=E,a[_+1]+=E)}f+=E}),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=n.map(t[c]+s),f=d-o;if(f<0||f>=r.content.size){l=!0;continue}let h=n.map(t[c+1]+s,-1),m=h-o,{index:y,offset:w}=r.content.findIndex(f),E=r.maybeChild(y);if(E&&w==f&&w+E.nodeSize==m){let _=a[c+2].mapInner(n,E,d+1,t[c]+s+1,i);_!=Ke?(a[c]=f,a[c+1]=m,a[c+2]=_):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=Yg(a,t,e,n,o,s,i),d=xo(c,r,0,i);e=d.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,h=0;f<d.children.length;f+=3){let m=d.children[f];for(;h<a.length&&a[h]<m;)h+=3;a.splice(h,0,d.children[f],d.children[f+1],d.children[f+2])}}return new fe(e.sort(Mn),a)}function vd(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Re(o.from+e,o.to+e,o.type))}return n}function Yg(t,e,n,r,o,s,i){function a(l,c){for(let d=0;d<l.local.length;d++){let f=l.local[d].map(r,o,c);f?n.push(f):i.onRemove&&i.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function Sd(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,i;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function Td(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function xo(t,e,n,r){let o=[],s=!1;e.forEach((a,l)=>{let c=Sd(t,a,l+n);if(c){s=!0;let d=xo(c,a,n+l+1,r);d!=Ke&&o.push(l,l+a.nodeSize,d)}});let i=vd(s?Td(t):t,-n).sort(Mn);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||(r.onRemove&&r.onRemove(i[a].spec),i.splice(a--,1));return i.length||o.length?new fe(i,o):Ke}function Mn(t,e){return t.from-e.from||t.to-e.to}function Oi(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),xd(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),xd(e,o,r.copy(s.from,r.to)));break}}}return e}function xd(t,e,n){for(;e<t.length&&Mn(n,t[e])>0;)e++;t.splice(e,0,n)}function Li(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ke&&e.push(r)}),t.cursorWrapper&&e.push(fe.create(t.state.doc,[t.cursorWrapper.deco])),rn.from(e)}const Xg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Qg=tt&&Xt<=11;class Zg{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class e0{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Zg,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);tt&&Xt<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),Qg&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Xg)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(td(this.view)){if(this.suppressingSelectionUpdates)return Ft(this.view);if(tt&&Xt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Cn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Xn(s))n.add(s);for(let s=e.anchorNode;s;s=Xn(s))if(n.has(s)){r=s;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&td(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let f=this.registerMutation(n[d],l);f&&(s=s<0?f.from:Math.min(f.from,s),i=i<0?f.to:Math.max(f.to,i),f.typeOver&&(a=!0))}if(dt&&l.length){let d=l.filter(f=>f.nodeName=="BR");if(d.length==2){let[f,h]=d;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of d){let m=h.parentNode;m&&m.nodeName=="LI"&&(!f||r0(e,f)!=m)&&h.remove()}}}let c=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&wo(r)&&(c=yi(e))&&c.eq(X.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ft(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),t0(e)),this.handleDOMChange(s,i,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ft(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let f=e.addedNodes[d];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(tt&&Xt<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:f,nextSibling:h}=e.addedNodes[d];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h)}let i=o&&o.parentNode==e.target?He(o)+1:0,a=r.localPosFromDOM(e.target,i,-1),l=s&&s.parentNode==e.target?He(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Nd=new WeakMap,Md=!1;function t0(t){if(!Nd.has(t)&&(Nd.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=dt,Md)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Md=!0}}function Ad(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return Cn(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function n0(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return Ad(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Ad(t,n):null}function r0(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function o0(t,e,n){let{node:r,fromOffset:o,toOffset:s,from:i,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],wo(l)||c.push({node:l.focusNode,offset:l.focusOffset})),We&&t.input.lastKeyCode===8)for(let E=s;E>o;E--){let _=r.childNodes[E-1],x=_.pmViewDesc;if(_.nodeName=="BR"&&!x){s=E;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||Wn.fromSchema(t.state.schema),m=f.resolve(i),y=null,w=h.parse(r,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:o,to:s,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:s0,context:m});if(c&&c[0].pos!=null){let E=c[0].pos,_=c[1]&&c[1].pos;_==null&&(_=E),y={anchor:E+i,head:_+i}}return{doc:w,sel:y,from:i,to:a}}function s0(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Xe&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Xe&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const i0=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function a0(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let k=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,C=yi(t,k);if(C&&!t.state.selection.eq(C)){if(We&&Dt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",v=>v(t,vn(13,"Enter"))))return;let T=t.state.tr.setSelection(C);k=="pointer"?T.setMeta("pointer",!0):k=="key"&&T.scrollIntoView(),s&&T.setMeta("composition",s),t.dispatch(T)}return}let i=t.state.doc.resolve(e),a=i.sharedDepth(n);e=i.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=o0(t,e,n),d=t.state.doc,f=d.slice(c.from,c.to),h,m;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,m="end"):(h=t.state.selection.from,m="start"),t.input.lastKeyCode=null;let y=d0(f.content,c.doc.content,c.from,h,m);if(y&&t.input.domChangeCount++,(Qn&&t.input.lastIOSEnter>Date.now()-225||Dt)&&o.some(k=>k.nodeType==1&&!i0.test(k.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",k=>k(t,vn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&l instanceof Y&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))y={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let k=Od(t,t.state.doc,c.sel);if(k&&!k.eq(t.state.selection)){let C=t.state.tr.setSelection(k);s&&C.setMeta("composition",s),t.dispatch(C)}}return}t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Y&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),tt&&Xt<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>c.from&&c.doc.textBetween(y.start-c.from-1,y.start-c.from+1)==" "&&(y.start--,y.endA--,y.endB--);let w=c.doc.resolveNoCache(y.start-c.from),E=c.doc.resolveNoCache(y.endB-c.from),_=d.resolve(y.start),x=w.sameParent(E)&&w.parent.inlineContent&&_.end()>=y.endA;if((Qn&&t.input.lastIOSEnter>Date.now()-225&&(!x||o.some(k=>k.nodeName=="DIV"||k.nodeName=="P"))||!x&&w.pos<c.doc.content.size&&(!w.sameParent(E)||!w.parent.inlineContent)&&w.pos<E.pos&&!/\S/.test(c.doc.textBetween(w.pos,E.pos,"","")))&&t.someProp("handleKeyDown",k=>k(t,vn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&c0(d,y.start,y.endA,w,E)&&t.someProp("handleKeyDown",k=>k(t,vn(8,"Backspace")))){Dt&&We&&t.domObserver.suppressSelectionUpdates();return}We&&y.endB==y.start&&(t.input.lastChromeDelete=Date.now()),Dt&&!x&&w.start()!=E.start()&&E.parentOffset==0&&w.depth==E.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==y.endA&&(y.endB-=2,E=c.doc.resolveNoCache(y.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(k){return k(t,vn(13,"Enter"))})},20));let A=y.start,u=y.endA,b=k=>{let C=k||t.state.tr.replace(A,u,c.doc.slice(y.start-c.from,y.endB-c.from));if(c.sel){let T=Od(t,C.doc,c.sel);T&&!(We&&t.composing&&T.empty&&(y.start!=y.endB||t.input.lastChromeDelete<Date.now()-100)&&(T.head==A||T.head==C.mapping.map(u)-1)||tt&&T.empty&&T.head==A)&&C.setSelection(T)}return s&&C.setMeta("composition",s),C.scrollIntoView()},g;if(x){if(w.pos==E.pos){tt&&Xt<=11&&w.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ft(t),20));let k=b(t.state.tr.delete(A,u)),C=d.resolve(y.start).marksAcross(d.resolve(y.endA));C&&k.ensureMarks(C),t.dispatch(k)}else if(y.endA==y.endB&&(g=l0(w.parent.content.cut(w.parentOffset,E.parentOffset),_.parent.content.cut(_.parentOffset,y.endA-_.start())))){let k=b(t.state.tr);g.type=="add"?k.addMark(A,u,g.mark):k.removeMark(A,u,g.mark),t.dispatch(k)}else if(w.parent.child(w.index()).isText&&w.index()==E.index()-(E.textOffset?0:1)){let k=w.parent.textBetween(w.parentOffset,E.parentOffset),C=()=>b(t.state.tr.insertText(k,A,u));t.someProp("handleTextInput",T=>T(t,A,u,k,C))||t.dispatch(C())}}else t.dispatch(b())}function Od(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:wi(t,e.resolve(n.anchor),e.resolve(n.head))}function l0(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,a,l;for(let d=0;d<r.length;d++)o=r[d].removeFromSet(o);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(o.length==1&&s.length==0)a=o[0],i="add",l=d=>d.mark(a.addToSet(d.marks));else if(o.length==0&&s.length==1)a=s[0],i="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(I.from(c).eq(t))return{mark:a,type:i}}function c0(t,e,n,r,o){if(n-e<=o.pos-r.pos||Ii(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(Ii(s,!0,!0));return!i.parent.isTextblock||i.pos>n||Ii(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function Ii(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function d0(t,e,n,r,o){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:i,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,s-Math.min(i,a));r-=i+l-s}if(i<s&&t.size<e.size){let l=r<=s&&r>=i?s-r:0;s-=l,s&&s<e.size&&Ld(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-i),i=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&Ld(t.textBetween(s-1,s+1))&&(s+=l?1:-1),i=s+(i-a),a=s}return{start:s,endA:i,endB:a}}function Ld(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Id{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Mg,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Fd),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Dd(this),Rd(this),this.nodeViews=Bd(this),this.docView=jc(this.state.doc,Pd(this),Li(this),this.dom,this),this.domObserver=new e0(this,(r,o,s,i)=>a0(this,r,o,s,i)),this.domObserver.start(),Ag(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ti(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Fd),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,s=!1,i=!1;e.storedMarks&&this.composing&&(wd(this),i=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let m=Bd(this);f0(m,this.nodeViews)&&(this.nodeViews=m,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ti(this),this.editable=Dd(this),Rd(this);let l=Li(this),c=Pd(this),d=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=s||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(o.selection))&&(i=!0);let h=d=="preserve"&&i&&this.dom.style.overflowAnchor==null&&Um(this);if(i){this.domObserver.stop();let m=f&&(tt||We)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&u0(o.selection,e.selection);if(f){let y=We?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=jg(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=jc(e.doc,c,l,this.dom,this)),y&&!this.trackWrites&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&pg(this))?Ft(this,m):(Zc(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():h&&Wm(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Ac(this,n.getBoundingClientRect(),e)}else Ac(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(o=s)}this.dragging=new Ed(e.slice,e.move,o<0?void 0:J.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let i=0;i<this.directPlugins.length;i++){let a=this.directPlugins[i].props[e];if(a!=null&&(o=n?n(a):a))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let a=s[i].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(tt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Km(this.dom),Ft(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Xm(this,e)}coordsAtPos(e,n=1){return Dc(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return ng(this,n||this.state,e)}pasteHTML(e,n){return Lr(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Lr(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ci(this,e)}destroy(){this.docView&&(Og(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Li(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Im())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Ig(this,e)}domSelectionRange(){let e=this.domSelection();return e?Xe&&this.root.nodeType===11&&Fm(this.dom.ownerDocument)==this.dom&&n0(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Id.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Pd(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Re.node(0,t.state.doc.content.size,e)]}function Rd(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Re.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Dd(t){return!t.someProp("editable",e=>e(t.state)===!1)}function u0(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Bd(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function f0(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Fd(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var on={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},No={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},h0=typeof navigator<"u"&&/Mac/.test(navigator.platform),p0=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),je=0;je<10;je++)on[48+je]=on[96+je]=String(je);for(var je=1;je<=24;je++)on[je+111]="F"+je;for(var je=65;je<=90;je++)on[je]=String.fromCharCode(je+32),No[je]=String.fromCharCode(je);for(var Pi in on)No.hasOwnProperty(Pi)||(No[Pi]=on[Pi]);function m0(t){var e=h0&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||p0&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?No:on)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const g0=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),b0=typeof navigator<"u"&&/Win/.test(navigator.platform);function y0(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))g0?i=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),i&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function k0(t){let e=Object.create(null);for(let n in t)e[y0(n)]=t[n];return e}function Ri(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function w0(t){return new ge({props:{handleKeyDown:Di(t)}})}function Di(t){let e=k0(t);return function(n,r){let o=m0(r),s,i=e[Ri(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[Ri(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(b0&&r.ctrlKey&&r.altKey)&&(s=on[r.keyCode])&&s!=o){let a=e[Ri(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Bi=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Vd(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const $d=(t,e,n)=>{let r=Vd(t,n);if(!r)return!1;let o=Fi(r);if(!o){let i=r.blockRange(),a=i&&Kn(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}let s=o.nodeBefore;if(Jd(t,o,e,-1))return!0;if(r.parent.content.size==0&&(rr(s,"end")||J.isSelectable(s)))for(let i=r.depth;;i--){let a=bo(t.doc,r.before(i),r.after(i),H.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(rr(s,"end")?X.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):J.create(l.doc,o.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(i==1||r.node(i-1).childCount>1)break}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},_0=(t,e,n)=>{let r=Vd(t,n);if(!r)return!1;let o=Fi(r);return o?zd(t,o,e):!1},E0=(t,e,n)=>{let r=jd(t,n);if(!r)return!1;let o=Vi(r);return o?zd(t,o,e):!1};function zd(t,e,n){let r=e.nodeBefore,o=r,s=e.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let d=o.lastChild;if(!d)return!1;o=d}let i=e.nodeAfter,a=i,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=bo(t.doc,s,l,H.empty);if(!c||c.from!=s||c instanceof Ie&&c.slice.size>=l-s)return!1;if(n){let d=t.tr.step(c);d.setSelection(Y.create(d.doc,s)),n(d.scrollIntoView())}return!0}function rr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Hd=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=Fi(r)}let i=s&&s.nodeBefore;return!i||!J.isSelectable(i)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function Fi(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function jd(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Ud=(t,e,n)=>{let r=jd(t,n);if(!r)return!1;let o=Vi(r);if(!o)return!1;let s=o.nodeAfter;if(Jd(t,o,e,1))return!0;if(r.parent.content.size==0&&(rr(s,"start")||J.isSelectable(s))){let i=bo(t.doc,r.before(),r.after(),H.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(rr(s,"start")?X.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):J.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},Wd=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Vi(r)}let i=s&&s.nodeAfter;return!i||!J.isSelectable(i)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,s.pos)).scrollIntoView()),!0)};function Vi(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const C0=(t,e)=>{let n=t.selection,r=n instanceof J,o;if(r){if(n.node.isTextblock||!Jt(t.doc,n.from))return!1;o=n.from}else if(o=go(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(J.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},v0=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!Jt(t.doc,n.to))return!1;r=n.to}else if(r=go(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},S0=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&Kn(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},Kd=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
10
|
+
`).scrollIntoView()),!0)};function $i(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const T0=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),i=$i(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,i.createAndFill());l.setSelection(X.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Gd=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof it||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=$i(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let i=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(i,s.createAndFill());a.setSelection(Y.create(a.doc,i+1)),e(a.scrollIntoView())}return!0},qd=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Pt(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Kn(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function x0(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof J&&e.selection.node.isBlock)return!r.parentOffset||!Pt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],i,a,l=!1,c=!1;for(let m=r.depth;;m--)if(r.node(m).isBlock){l=r.end(m)==r.pos+(r.depth-m),c=r.start(m)==r.pos-(r.depth-m),a=$i(r.node(m-1).contentMatchAt(r.indexAfter(m-1))),s.unshift(l&&a?{type:a}:null),i=m;break}else{if(m==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof Y||e.selection instanceof it)&&d.deleteSelection();let f=d.mapping.map(r.pos),h=Pt(d.doc,f,s.length,s);if(h||(s[0]=a?{type:a}:null,h=Pt(d.doc,f,s.length,s)),!h)return!1;if(d.split(f,s.length,s),!l&&c&&r.node(i).type!=a){let m=d.mapping.map(r.before(i)),y=d.doc.resolve(m);a&&r.node(i-1).canReplaceWith(y.index(),y.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(i)),a)}return n&&n(d.scrollIntoView()),!0}}const N0=x0(),M0=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(J.create(t.doc,o))),!0)};function A0(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||Jt(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Jd(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,i,a,l=o.type.spec.isolating||s.type.spec.isolating;if(!l&&A0(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(i=(a=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&a.matchType(i[0]||s.type).validEnd){if(n){let m=e.pos+s.nodeSize,y=I.empty;for(let _=i.length-1;_>=0;_--)y=I.from(i[_].create(null,y));y=I.from(o.copy(y));let w=t.tr.step(new Pe(e.pos-1,m,e.pos,m,new H(y,1,0),i.length,!0)),E=w.doc.resolve(m+2*i.length);E.nodeAfter&&E.nodeAfter.type==o.type&&Jt(w.doc,E.pos)&&w.join(E.pos),n(w.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:X.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),h=f&&Kn(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(c&&rr(s,"start",!0)&&rr(o,"end")){let m=o,y=[];for(;y.push(m),!m.isTextblock;)m=m.lastChild;let w=s,E=1;for(;!w.isTextblock;w=w.firstChild)E++;if(m.canReplace(m.childCount,m.childCount,w.content)){if(n){let _=I.empty;for(let A=y.length-1;A>=0;A--)_=I.from(y[A].copy(_));let x=t.tr.step(new Pe(e.pos-y.length,e.pos+s.nodeSize,e.pos+E,e.pos+s.nodeSize-E,new H(_,y.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function Yd(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(Y.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const O0=Yd(-1),L0=Yd(1);function I0(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),a=i&&ni(i,t,e);return a?(r&&r(n.tr.wrap(i,a).scrollIntoView()),!0):!1}}function Xd(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:i},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(i,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let d=n.doc.resolve(c),f=d.index();o=d.parent.canReplaceWith(f,f+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[i];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function zi(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}zi(Bi,$d,Hd),zi(Bi,Ud,Wd),zi(Kd,Gd,qd,N0),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function P0(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let a=r?n.tr:null;return R0(a,i,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function R0(t,e,n,r=null){let o=!1,s=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=i.resolve(e.start-2);s=new co(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new co(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=ni(s,n,r,e);return a?(t&&D0(t,e,a,o,n),!0):!1}function D0(t,e,n,r,o){let s=I.empty;for(let d=n.length-1;d>=0;d--)s=I.from(n[d].type.create(n[d].attrs,s));t.step(new Pe(e.start-(r?2:0),e.end,e.start,e.end,new H(s,0,0),n.length,!0));let i=0;for(let d=0;d<n.length;d++)n[d].type==o&&(i=d+1);let a=n.length-i,l=e.start+n.length-(r?2:0),c=e.parent;for(let d=e.startIndex,f=e.endIndex,h=!0;d<f;d++,h=!1)!h&&Pt(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function B0(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,i=>i.childCount>0&&i.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?F0(e,n,t,s):V0(e,n,s):!0:!1}}function F0(t,e,n,r){let o=t.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new Pe(s-1,i,s,i,new H(I.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new co(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const a=Kn(r);if(a==null)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(s,-1)-1);return Jt(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function V0(t,e,n){let r=t.tr,o=n.parent;for(let m=n.end,y=n.endIndex-1,w=n.startIndex;y>w;y--)m-=o.child(y).nodeSize,r.delete(m-1,m+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=s.node(-1),d=s.index(-1);if(!c.canReplace(d+(a?0:1),d+1,i.content.append(l?I.empty:I.from(o))))return!1;let f=s.pos,h=f+i.nodeSize;return r.step(new Pe(f-(a?1:0),h+(l?1:0),f+1,h-1,new H((a?I.empty:I.from(o.copy(I.empty))).append(l?I.empty:I.from(o.copy(I.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function $0(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let i=s.startIndex;if(i==0)return!1;let a=s.parent,l=a.child(i-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,d=I.from(c?t.create():null),f=new H(I.from(t.create(null,I.from(a.type.create(null,d)))),c?3:1,0),h=s.start,m=s.end;n(e.tr.step(new Pe(h-(c?3:1),m,h,m,f,1,!0)).scrollIntoView())}return!0}}var z0=Object.defineProperty,Qd=(t,e)=>{for(var n in e)z0(t,n,{get:e[n],enumerable:!0})};function Mo(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}var Ao=class{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:n}=this,{view:r}=e,{tr:o}=n,s=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([i,a])=>[i,(...c)=>{const d=a(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i=[],a=!!t,l=t||o.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),i.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(n).map(([f,h])=>[f,(...y)=>{const w=this.buildProps(l,e),E=h(...y)(w);return i.push(E),d}])),run:c};return d}createCan(t){const{rawCommands:e,state:n}=this,r=!1,o=t||n.tr,s=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i={tr:t,editor:r,view:s,state:Mo({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)(i)]))}};return i}},H0=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function Zd(t,e){const n=new si(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}var eu=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&eu(r)}return t};function Oo(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return eu(n)}function Pr(t,e,n){if(t instanceof Kt||t instanceof I)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return I.fromArray(t.map(a=>e.nodeFromJSON(a)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),Pr("",e,n)}if(o){if(n.errorOnInvalidContent){let i=!1,a="";const l=new Kl({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(i=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Wn.fromSchema(l).parseSlice(Oo(t),n.parseOptions):Wn.fromSchema(l).parse(Oo(t),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Wn.fromSchema(e);return n.slice?s.parseSlice(Oo(t),n.parseOptions).content:s.parse(Oo(t),n.parseOptions)}return Pr("",e,n)}function Hi(t,e,n={},r={}){return Pr(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function j0(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function U0(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function tu(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Lo(t){return e=>tu(e.$from,t)}function q(t,e,n){return t.config[e]===void 0&&t.parent?q(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?q(t.parent,e,n):null}):t.config[e]}function ji(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=q(e,"addExtensions",n);return r?[e,...ji(r())]:e}).flat(10)}function Ui(t,e){const n=_n.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function nu(t){return typeof t=="function"}function ie(t,e=void 0,...n){return nu(t)?e?t.bind(e)(...n):t(...n):t}function W0(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Rr(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function ru(t){const e=[],{nodeExtensions:n,markExtensions:r}=Rr(t),o=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage,extensions:o},l=q(i,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(f=>{Object.entries(d.attributes).forEach(([h,m])=>{e.push({type:f,name:h,attribute:{...s,...m}})})})})}),o.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},l=q(i,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([d,f])=>{const h={...s,...f};typeof h?.default=="function"&&(h.default=h.default()),h?.isRequired&&h?.default===void 0&&delete h.default,e.push({type:i.name,name:d,attribute:h})})}),e}function ae(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}if(o==="class"){const a=s?String(s).split(" "):[],l=r[o]?r[o].split(" "):[],c=a.filter(d=>!l.includes(d));r[o]=[...l,...c].join(" ")}else if(o==="style"){const a=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[f,h]=d.split(":").map(m=>m.trim());c.set(f,h)}),a.forEach(d=>{const[f,h]=d.split(":").map(m=>m.trim());c.set(f,h)}),r[o]=Array.from(c.entries()).map(([d,f])=>`${d}: ${f}`).join("; ")}else r[o]=s}),r},{})}function Io(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ae(n,r),{})}function K0(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function ou(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(n):K0(n.getAttribute(i.name));return a==null?s:{...s,[i.name]:a}},{});return{...r,...o}}}}function su(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&W0(n)?!1:n!=null))}function G0(t,e){var n;const r=ru(t),{nodeExtensions:o,markExtensions:s}=Rr(t),i=(n=o.find(c=>q(c,"topNode")))==null?void 0:n.name,a=Object.fromEntries(o.map(c=>{const d=r.filter(_=>_.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((_,x)=>{const A=q(x,"extendNodeSchema",f);return{..._,...A?A(c):{}}},{}),m=su({...h,content:ie(q(c,"content",f)),marks:ie(q(c,"marks",f)),group:ie(q(c,"group",f)),inline:ie(q(c,"inline",f)),atom:ie(q(c,"atom",f)),selectable:ie(q(c,"selectable",f)),draggable:ie(q(c,"draggable",f)),code:ie(q(c,"code",f)),whitespace:ie(q(c,"whitespace",f)),linebreakReplacement:ie(q(c,"linebreakReplacement",f)),defining:ie(q(c,"defining",f)),isolating:ie(q(c,"isolating",f)),attrs:Object.fromEntries(d.map(_=>{var x,A;return[_.name,{default:(x=_?.attribute)==null?void 0:x.default,validate:(A=_?.attribute)==null?void 0:A.validate}]}))}),y=ie(q(c,"parseHTML",f));y&&(m.parseDOM=y.map(_=>ou(_,d)));const w=q(c,"renderHTML",f);w&&(m.toDOM=_=>w({node:_,HTMLAttributes:Io(_,d)}));const E=q(c,"renderText",f);return E&&(m.toText=E),[c.name,m]})),l=Object.fromEntries(s.map(c=>{const d=r.filter(E=>E.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((E,_)=>{const x=q(_,"extendMarkSchema",f);return{...E,...x?x(c):{}}},{}),m=su({...h,inclusive:ie(q(c,"inclusive",f)),excludes:ie(q(c,"excludes",f)),group:ie(q(c,"group",f)),spanning:ie(q(c,"spanning",f)),code:ie(q(c,"code",f)),attrs:Object.fromEntries(d.map(E=>{var _,x;return[E.name,{default:(_=E?.attribute)==null?void 0:_.default,validate:(x=E?.attribute)==null?void 0:x.validate}]}))}),y=ie(q(c,"parseHTML",f));y&&(m.parseDOM=y.map(E=>ou(E,d)));const w=q(c,"renderHTML",f);return w&&(m.toDOM=E=>w({mark:E,HTMLAttributes:Io(E,d)})),[c.name,m]}));return new Kl({topNode:i,nodes:a,marks:l})}function q0(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Wi(t){return t.sort((n,r)=>{const o=q(n,"priority")||100,s=q(r,"priority")||100;return o>s?-1:o<s?1:0})}function iu(t){const e=Wi(ji(t)),n=q0(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function au(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
|
|
11
|
+
|
|
12
|
+
`,textSerializers:i={}}=n||{};let a="";return t.nodesBetween(r,o,(l,c,d,f)=>{var h;l.isBlock&&c>r&&(a+=s);const m=i?.[l.type.name];if(m)return d&&(a+=m({node:l,pos:c,parent:d,index:f,range:e})),!1;l.isText&&(a+=(h=l?.text)==null?void 0:h.slice(Math.max(r,c)-c,o-c))}),a}function J0(t,e){const n={from:0,to:t.content.size};return au(t,n,e)}function lu(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function Vt(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function cu(t,e){const n=Vt(e,t.schema),{from:r,to:o,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{i.push(...l.marks)});const a=i.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function Me(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Y0(t,e){const n=Me(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,a=>{s.push(a)});const i=s.reverse().find(a=>a.type.name===n.name);return i?{...i.attrs}:{}}function Po(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function du(t,e){const n=Po(typeof e=="string"?e:e.name,t.schema);return n==="node"?Y0(t,e):n==="mark"?cu(t,e):{}}function X0(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function Q0(t){const e=X0(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,i)=>i!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function uu(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const i=[];if(o.ranges.length)o.forEach((a,l)=>{i.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;i.push({from:a,to:l})}i.forEach(({from:a,to:l})=>{const c=e.slice(s).map(a,-1),d=e.slice(s).map(l),f=e.invert().map(c,-1),h=e.invert().map(d);r.push({oldRange:{from:f,to:h},newRange:{from:c,to:d}})})}),Q0(r)}function Ki(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Ro(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Ki(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function fu(t,e,n={}){return t.find(r=>r.type===e&&Ro(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function hu(t,e,n={}){return!!fu(t,e,n)}function Gi(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(d=>d.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(d=>d.type===e)||(n=n||((r=o.node.marks[0])==null?void 0:r.attrs),!fu([...o.node.marks],e,n)))return;let i=o.index,a=t.start()+o.offset,l=i+1,c=a+o.node.nodeSize;for(;i>0&&hu([...t.parent.child(i-1).marks],e,n);)i-=1,a-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&hu([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function qi(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),i=Gi(s,o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,s)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(i=>({from:s,to:s+o.nodeSize,mark:i})))}),r}var Z0=(t,e,n,r=20)=>{const o=t.doc.resolve(n);let s=r,i=null;for(;s>0&&i===null;){const a=o.node(s);a?.type.name===e?i=a:s-=1}return[i,s]};function Ji(t,e){return e.nodes[t]||e.marks[t]||null}function Do(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}var eb=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,a)=>{var l,c;const d=((c=(l=o.type.spec).toText)==null?void 0:c.call(l,{node:o,pos:s,parent:i,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-s))}),n};function Yi(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?Vt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>Ro(f.attrs,n,{strict:!1}));let i=0;const a=[];if(o.forEach(({$from:f,$to:h})=>{const m=f.pos,y=h.pos;t.doc.nodesBetween(m,y,(w,E)=>{if(!w.isText&&!w.marks.length)return;const _=Math.max(m,E),x=Math.min(y,E+w.nodeSize),A=x-_;i+=A,a.push(...w.marks.map(u=>({mark:u,from:_,to:x})))})}),i===0)return!1;const l=a.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>Ro(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),c=a.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,h)=>f+h.to-h.from,0);return(l>0?l+c:l)>=i}function sn(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?Me(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(f,h)=>{if(f.isText)return;const m=Math.max(r,h),y=Math.min(o,h+f.nodeSize);a.push({node:f,from:m,to:y})});const l=o-r,c=a.filter(f=>i?i.name===f.node.type.name:!0).filter(f=>Ro(f.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((f,h)=>f+h.to-h.from,0)>=l}function tb(t,e,n={}){if(!e)return sn(t,null,n)||Yi(t,null,n);const r=Po(e,t.schema);return r==="node"?sn(t,e,n):r==="mark"?Yi(t,e,n):!1}var nb=(t,e)=>{const{$from:n,$to:r,$anchor:o}=t.selection;if(e){const s=Lo(a=>a.type.name===e)(t.selection);if(!s)return!1;const i=t.doc.resolve(s.pos+1);return o.pos+1===i.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},rb=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function pu(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function mu(t,e){const{nodeExtensions:n}=Rr(e),r=n.find(i=>i.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=ie(q(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function Bo(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(Bo(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function gu(t){return t instanceof J}function bu(t){return t instanceof Y}function An(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function yu(t,e=null){if(!e)return null;const n=X.atStart(t),r=X.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?Y.create(t,An(0,o,s),An(t.content.size,o,s)):Y.create(t,An(e,o,s),An(e,o,s))}function ob(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Ie||o instanceof Pe))return;const s=t.mapping.maps[r];let i=0;s.forEach((a,l,c,d)=>{i===0&&(i=d)}),t.setSelection(X.near(t.doc.resolve(i),n))}var Fo=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},sb=(t,e)=>{if(Ki(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Vo(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let d=!1;const f=eb(c)+s;return i.forEach(h=>{if(d)return;const m=sb(f,h.find);if(!m)return;const y=l.state.tr,w=Mo({state:l.state,transaction:y}),E={from:r-(m[0].length-s.length),to:o},{commands:_,chain:x,can:A}=new Ao({editor:n,state:w});h.handler({state:w,range:E,match:m,commands:_,chain:x,can:A})===null||!y.steps.length||(h.undoable&&y.setMeta(a,{transform:y,from:r,to:o,text:s}),l.dispatch(y),d=!0)}),d}function ib(t){const{editor:e,rules:n}=t,r=new ge({state:{init(){return null},apply(o,s,i){const a=o.getMeta(r);if(a)return a;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=Ui(I.from(d),i.schema);const{from:f}=l,h=f+d.length;Vo({editor:e,from:f,to:h,text:d,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,i,a){return Vo({editor:e,from:s,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&Vo({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:i}=o.state.selection;return i?Vo({editor:e,from:i.pos,to:i.pos,text:`
|
|
13
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function ab(t){return Object.prototype.toString.call(t).slice(8,-1)}function $o(t){return ab(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ku(t,e){const n={...t};return $o(t)&&$o(e)&&Object.keys(e).forEach(r=>{$o(e[r])&&$o(t[r])?n[r]=ku(t[r],e[r]):n[r]=e[r]}),n}var Xi=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...ie(q(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ie(q(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>ku(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},kt=class Rp extends Xi{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new Rp(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const i=o.marks();if(!!!i.find(c=>c?.type.name===n.name))return!1;const l=i.find(c=>c?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function lb(t){return typeof t=="number"}var cb=class{constructor(t){this.find=t.find,this.handler=t.handler}},db=(t,e,n)=>{if(Ki(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const s=[o.text];return s.index=o.index,s.input=t,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(o.replaceWith)),s}):[]};function ub(t){const{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:a}=t,{commands:l,chain:c,can:d}=new Ao({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,o,(m,y)=>{var w,E,_,x,A;if((E=(w=m.type)==null?void 0:w.spec)!=null&&E.code||!(m.isText||m.isTextblock||m.isInline))return;const u=(A=(x=(_=m.content)==null?void 0:_.size)!=null?x:m.nodeSize)!=null?A:0,b=Math.max(r,y),g=Math.min(o,y+u);if(b>=g)return;const k=m.isText?m.text||"":m.textBetween(b-y,g-y,void 0,"");db(k,s.find,i).forEach(T=>{if(T.index===void 0)return;const v=b+T.index+1,O=v+T[0].length,R={from:n.tr.mapping.map(v),to:n.tr.mapping.map(O)},B=s.handler({state:n,range:R,match:T,commands:l,chain:c,can:d,pasteEvent:i,dropEvent:a});f.push(B)})}),f.every(m=>m!==null)}var zo=null,fb=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function hb(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:f,to:h,rule:m,pasteEvt:y})=>{const w=d.tr,E=Mo({state:d,transaction:w});if(!(!ub({editor:e,state:E,from:Math.max(f-1,0),to:h.b-1,rule:m,pasteEvent:y,dropEvent:a})||!w.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,w}};return n.map(d=>new ge({view(f){const h=y=>{var w;r=(w=f.dom.parentElement)!=null&&w.contains(y.target)?f.dom.parentElement:null,r&&(zo=e)},m=()=>{zo&&(zo=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",m),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",m)}}},props:{handleDOMEvents:{drop:(f,h)=>{if(s=r===f.dom.parentElement,a=h,!s){const m=zo;m?.isEditable&&setTimeout(()=>{const y=m.state.selection;y&&m.commands.deleteRange({from:y.from,to:y.to})},10)}return!1},paste:(f,h)=>{var m;const y=(m=h.clipboardData)==null?void 0:m.getData("text/html");return i=h,o=!!y?.includes("data-pm-slice"),!1}}},appendTransaction:(f,h,m)=>{const y=f[0],w=y.getMeta("uiEvent")==="paste"&&!o,E=y.getMeta("uiEvent")==="drop"&&!s,_=y.getMeta("applyPasteRules"),x=!!_;if(!w&&!E&&!x)return;if(x){let{text:b}=_;typeof b=="string"?b=b:b=Ui(I.from(b),m.schema);const{from:g}=_,k=g+b.length,C=fb(b);return l({rule:d,state:m,from:g,to:{b:k},pasteEvt:C})}const A=h.doc.content.findDiffStart(m.doc.content),u=h.doc.content.findDiffEnd(m.doc.content);if(!(!lb(A)||!u||A===u.b))return l({rule:d,state:m,from:A,to:u,pasteEvt:i})}}))}var Ho=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=iu(t),this.schema=G0(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ji(e.name,this.schema)},r=q(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Wi([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Ji(r.name,this.schema)},s=[],i=q(r,"addKeyboardShortcuts",o);let a={};if(r.type==="mark"&&q(r,"exitable",o)&&(a.ArrowRight=()=>kt.handleExit({editor:t,mark:r})),i){const h=Object.fromEntries(Object.entries(i()).map(([m,y])=>[m,()=>y({editor:t})]));a={...a,...h}}const l=w0(a);s.push(l);const c=q(r,"addInputRules",o);if(pu(r,t.options.enableInputRules)&&c){const h=c();if(h&&h.length){const m=ib({editor:t,rules:h}),y=Array.isArray(m)?m:[m];s.push(...y)}}const d=q(r,"addPasteRules",o);if(pu(r,t.options.enablePasteRules)&&d){const h=d();if(h&&h.length){const m=hb({editor:t,rules:h});s.push(...m)}}const f=q(r,"addProseMirrorPlugins",o);if(f){const h=f();s.push(...h)}return s})}get attributes(){return ru(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Rr(this.extensions);return Object.fromEntries(e.filter(n=>!!q(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Me(n.name,this.schema)},s=q(n,"addNodeView",o);if(!s)return[];const i=(a,l,c,d,f)=>{const h=Io(a,r);return s()({node:a,view:l,getPos:c,decorations:d,innerDecorations:f,editor:t,extension:n,HTMLAttributes:h})};return[n.name,i]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Rr(this.extensions);return Object.fromEntries(e.filter(n=>!!q(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Vt(n.name,this.schema)},s=q(n,"addMarkView",o);if(!s)return[];const i=(a,l,c)=>{const d=Io(a,r);return s()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:f=>{Ny(a,t,f)}})};return[n.name,i]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ji(e.name,this.schema)};e.type==="mark"&&((n=ie(q(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const o=q(e,"onBeforeCreate",r),s=q(e,"onCreate",r),i=q(e,"onUpdate",r),a=q(e,"onSelectionUpdate",r),l=q(e,"onTransaction",r),c=q(e,"onFocus",r),d=q(e,"onBlur",r),f=q(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),i&&this.editor.on("update",i),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}};Ho.resolve=iu,Ho.sort=Wi,Ho.flatten=ji;var pb={};Qd(pb,{ClipboardTextSerializer:()=>wu,Commands:()=>Su,Delete:()=>Tu,Drop:()=>xu,Editable:()=>Nu,FocusEvents:()=>Au,Keymap:()=>Ou,Paste:()=>Lu,Tabindex:()=>Iu,focusEventsPluginKey:()=>Mu});var le=class Dp extends Xi{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new Dp(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},wu=le.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ge({key:new ve("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:s}=o,i=Math.min(...s.map(d=>d.$from.pos)),a=Math.max(...s.map(d=>d.$to.pos)),l=lu(n);return au(r,{from:i,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),_u={};Qd(_u,{blur:()=>mb,clearContent:()=>gb,clearNodes:()=>bb,command:()=>yb,createParagraphNear:()=>kb,cut:()=>wb,deleteCurrentNode:()=>_b,deleteNode:()=>Eb,deleteRange:()=>Cb,deleteSelection:()=>vb,enter:()=>Sb,exitCode:()=>Tb,extendMarkRange:()=>xb,first:()=>Nb,focus:()=>Ab,forEach:()=>Ob,insertContent:()=>Lb,insertContentAt:()=>Pb,joinBackward:()=>Bb,joinDown:()=>Db,joinForward:()=>Fb,joinItemBackward:()=>Vb,joinItemForward:()=>$b,joinTextblockBackward:()=>zb,joinTextblockForward:()=>Hb,joinUp:()=>Rb,keyboardShortcut:()=>Ub,lift:()=>Wb,liftEmptyBlock:()=>Kb,liftListItem:()=>Gb,newlineInCode:()=>qb,resetAttributes:()=>Jb,scrollIntoView:()=>Yb,selectAll:()=>Xb,selectNodeBackward:()=>Qb,selectNodeForward:()=>Zb,selectParentNode:()=>ey,selectTextblockEnd:()=>ty,selectTextblockStart:()=>ny,setContent:()=>ry,setMark:()=>sy,setMeta:()=>iy,setNode:()=>ay,setNodeSelection:()=>ly,setTextSelection:()=>cy,sinkListItem:()=>dy,splitBlock:()=>uy,splitListItem:()=>fy,toggleList:()=>hy,toggleMark:()=>py,toggleNode:()=>my,toggleWrap:()=>gy,undoInputRule:()=>by,unsetAllMarks:()=>yy,unsetMark:()=>ky,updateAttributes:()=>wy,wrapIn:()=>_y,wrapInList:()=>Ey});var mb=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),gb=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),bb=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:i})=>{t.doc.nodesBetween(s.pos,i.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:d}=e,f=c.resolve(d.map(l)),h=c.resolve(d.map(l+a.nodeSize)),m=f.blockRange(h);if(!m)return;const y=Kn(m);if(a.type.isTextblock){const{defaultType:w}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(m.start,w)}(y||y===0)&&e.lift(m,y)})}),!0},yb=t=>e=>t(e),kb=()=>({state:t,dispatch:e})=>Gd(t,e),wb=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const i=r.mapping.map(e);return r.insert(i,s.content),r.setSelection(new Y(r.doc.resolve(Math.max(i-1,0)))),!0},_b=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const a=o.before(s),l=o.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},Eb=t=>({tr:e,state:n,dispatch:r})=>{const o=Me(t,n.schema),s=e.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o){if(r){const l=s.before(i),c=s.after(i);e.delete(l,c).scrollIntoView()}return!0}return!1},Cb=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},vb=()=>({state:t,dispatch:e})=>Bi(t,e),Sb=()=>({commands:t})=>t.keyboardShortcut("Enter"),Tb=()=>({state:t,dispatch:e})=>T0(t,e),xb=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const s=Vt(t,r.schema),{doc:i,selection:a}=n,{$from:l,from:c,to:d}=a;if(o){const f=Gi(l,s,e);if(f&&f.from<=c&&f.to>=d){const h=Y.create(i,f.from,f.to);n.setSelection(h)}}return!0},Nb=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Mb(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Qi(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ab=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(Qi()||Mb())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!bu(n.state.selection))return i(),!0;const a=yu(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},Ob=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),Lb=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Ib=t=>!("type"in t),Pb=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{var i;if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=E=>{s.emit("contentError",{editor:s,error:E,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Pr(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(E){l(E)}try{a=Pr(e,s.schema,{parseOptions:c,errorOnInvalidContent:(i=n.errorOnInvalidContent)!=null?i:s.options.enableContentCheck})}catch(E){return l(E),!1}let{from:d,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},h=!0,m=!0;if((Ib(a)?a:[a]).forEach(E=>{E.check(),h=h?E.isText&&E.marks.length===0:!1,m=m?E.isBlock:!1}),d===f&&m){const{parent:E}=r.doc.resolve(d);E.isTextblock&&!E.type.spec.code&&!E.childCount&&(d-=1,f+=1)}let w;if(h){if(Array.isArray(e))w=e.map(E=>E.text||"").join("");else if(e instanceof I){let E="";e.forEach(_=>{_.text&&(E+=_.text)}),w=E}else typeof e=="object"&&e&&e.text?w=e.text:w=e;r.insertText(w,d,f)}else{w=a;const E=r.doc.resolve(d),_=E.node(),x=E.parentOffset===0,A=_.isText||_.isTextblock,u=_.content.size>0;x&&A&&u&&(d=Math.max(0,d-1)),r.replaceWith(d,f,w)}n.updateSelection&&ob(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:w}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:w})}return!0},Rb=()=>({state:t,dispatch:e})=>C0(t,e),Db=()=>({state:t,dispatch:e})=>v0(t,e),Bb=()=>({state:t,dispatch:e})=>$d(t,e),Fb=()=>({state:t,dispatch:e})=>Ud(t,e),Vb=()=>({state:t,dispatch:e,tr:n})=>{try{const r=go(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},$b=()=>({state:t,dispatch:e,tr:n})=>{try{const r=go(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},zb=()=>({state:t,dispatch:e})=>_0(t,e),Hb=()=>({state:t,dispatch:e})=>E0(t,e);function Eu(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function jb(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Qi()||Eu()?i=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var Ub=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=jb(t).split(/-(?!$)/),i=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l?.steps.forEach(c=>{const d=c.map(r.mapping);d&&o&&r.maybeStep(d)}),!0},Wb=(t,e={})=>({state:n,dispatch:r})=>{const o=Me(t,n.schema);return sn(n,o,e)?S0(n,r):!1},Kb=()=>({state:t,dispatch:e})=>qd(t,e),Gb=t=>({state:e,dispatch:n})=>{const r=Me(t,e.schema);return B0(r)(e,n)},qb=()=>({state:t,dispatch:e})=>Kd(t,e);function Cu(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var Jb=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=Po(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Me(t,r.schema)),a==="mark"&&(i=Vt(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{s&&s===c.type&&n.setNodeMarkup(d,void 0,Cu(c.attrs,e)),i&&c.marks.length&&c.marks.forEach(f=>{i===f.type&&n.addMark(d,d+c.nodeSize,i.create(Cu(f.attrs,e)))})})}),!0):!1},Yb=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Xb=()=>({tr:t,dispatch:e})=>{if(e){const n=new it(t.doc);t.setSelection(n)}return!0},Qb=()=>({state:t,dispatch:e})=>Hd(t,e),Zb=()=>({state:t,dispatch:e})=>Wd(t,e),ey=()=>({state:t,dispatch:e})=>M0(t,e),ty=()=>({state:t,dispatch:e})=>L0(t,e),ny=()=>({state:t,dispatch:e})=>O0(t,e),ry=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:i,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const c=Hi(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return i&&s.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n),!0}return i&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function oy(t,e,n){var r;const{selection:o}=e;let s=null;if(bu(o)&&(s=o.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(c=>c.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,f,h)=>{if(c)return!1;if(d.isInline){const m=!h||h.type.allowsMarkType(n),y=!!n.isInSet(d.marks)||!d.marks.some(w=>w.type.excludes(n));c=m&&y}return!c}),c})}var sy=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:a}=s,l=Vt(t,r.schema);if(o)if(i){const c=cu(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const d=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(d,f,(h,m)=>{const y=Math.max(m,d),w=Math.min(m+h.nodeSize,f);h.marks.find(_=>_.type===l)?h.marks.forEach(_=>{l===_.type&&n.addMark(y,w,l.create({..._.attrs,...e}))}):n.addMark(y,w,l.create(e))})});return oy(r,n,l)},iy=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),ay=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=Me(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:a})=>Xd(s,{...i,...e})(n)?!0:a.clearNodes()).command(({state:a})=>Xd(s,{...i,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ly=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=An(t,0,r.content.size),s=J.create(r,o);e.setSelection(s)}return!0},cy=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,i=Y.atStart(r).from,a=Y.atEnd(r).to,l=An(o,i,a),c=An(s,i,a),d=Y.create(r,l,c);e.setSelection(d)}return!0},dy=t=>({state:e,dispatch:n})=>{const r=Me(t,e.schema);return $0(r)(e,n)};function vu(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}var uy=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:a,$to:l}=s,c=o.extensionManager.attributes,d=Do(c,a.node().type.name,a.node().attrs);if(s instanceof J&&s.node.isBlock)return!a.parentOffset||!Pt(i,a.pos)?!1:(r&&(t&&vu(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:j0(a.node(-1).contentMatchAt(a.indexAfter(-1)));let m=f&&h?[{type:h,attrs:d}]:void 0,y=Pt(e.doc,e.mapping.map(a.pos),1,m);if(!m&&!y&&Pt(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(y=!0,m=h?[{type:h,attrs:d}]:void 0),r){if(y&&(s instanceof Y&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,m),h&&!f&&!a.parentOffset&&a.parent.type!==h)){const w=e.mapping.map(a.before()),E=e.doc.resolve(w);a.node(-1).canReplaceWith(E.index(),E.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&vu(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return y},fy=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const a=Me(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==a)return!1;const h=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let _=I.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let C=l.depth-x;C>=l.depth-3;C-=1)_=I.from(l.node(C).copy(_));const A=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,u={...Do(h,l.node().type.name,l.node().attrs),...e},b=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill(u))||void 0;_=_.append(I.from(a.createAndFill(null,b)||void 0));const g=l.before(l.depth-(x-1));n.replace(g,l.after(-A),new H(_,4-x,0));let k=-1;n.doc.nodesBetween(g,n.doc.content.size,(C,T)=>{if(k>-1)return!1;C.isTextblock&&C.content.size===0&&(k=T+1)}),k>-1&&n.setSelection(Y.near(n.doc.resolve(k))),n.scrollIntoView()}return!0}const m=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,y={...Do(h,f.type.name,f.attrs),...e},w={...Do(h,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const E=m?[{type:a,attrs:y},{type:m,attrs:w}]:[{type:a,attrs:y}];if(!Pt(n.doc,l.pos,2))return!1;if(o){const{selection:_,storedMarks:x}=r,{splittableMarks:A}=s.extensionManager,u=x||_.$to.parentOffset&&_.$from.marks();if(n.split(l.pos,2,E).scrollIntoView(),!u||!o)return!0;const b=u.filter(g=>A.includes(g.type.name));n.ensureMarks(b)}return!0},Zi=(t,e)=>{const n=Lo(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Jt(t.doc,n.pos)&&t.join(n.pos),!0},ea=(t,e)=>{const n=Lo(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Jt(t.doc,r)&&t.join(r),!0},hy=(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:f,splittableMarks:h}=o.extensionManager,m=Me(t,i.schema),y=Me(e,i.schema),{selection:w,storedMarks:E}=i,{$from:_,$to:x}=w,A=_.blockRange(x),u=E||w.$to.parentOffset&&w.$from.marks();if(!A)return!1;const b=Lo(g=>mu(g.type.name,f))(w);if(A.depth>=1&&b&&A.depth-b.depth<=1){if(b.node.type===m)return c.liftListItem(y);if(mu(b.node.type.name,f)&&m.validContent(b.node.content)&&a)return l().command(()=>(s.setNodeMarkup(b.pos,m),!0)).command(()=>Zi(s,m)).command(()=>ea(s,m)).run()}return!n||!u||!a?l().command(()=>d().wrapInList(m,r)?!0:c.clearNodes()).wrapInList(m,r).command(()=>Zi(s,m)).command(()=>ea(s,m)).run():l().command(()=>{const g=d().wrapInList(m,r),k=u.filter(C=>h.includes(C.type.name));return s.ensureMarks(k),g?!0:c.clearNodes()}).wrapInList(m,r).command(()=>Zi(s,m)).command(()=>ea(s,m)).run()},py=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=Vt(t,r.schema);return Yi(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},my=(t,e,n={})=>({state:r,commands:o})=>{const s=Me(t,r.schema),i=Me(e,r.schema),a=sn(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(i,l):o.setNode(s,{...l,...n})},gy=(t,e={})=>({state:n,commands:r})=>{const o=Me(t,n.schema);return sn(n,o,e)?r.lift(o):r.wrapIn(o,e)},by=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const i=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)i.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=i.doc.resolve(s.from).marks();i.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else i.delete(s.from,s.to)}return!0}}return!1},yy=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},ky=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,l=Vt(t,r.schema),{$from:c,empty:d,ranges:f}=a;if(!o)return!0;if(d&&i){let{from:h,to:m}=a;const y=(s=c.marks().find(E=>E.type===l))==null?void 0:s.attrs,w=Gi(c,l,y);w&&(h=w.from,m=w.to),n.removeMark(h,m,l)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},wy=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=Po(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Me(t,r.schema)),a==="mark"&&(i=Vt(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;let f,h,m,y;n.selection.empty?r.doc.nodesBetween(c,d,(w,E)=>{s&&s===w.type&&(m=Math.max(E,c),y=Math.min(E+w.nodeSize,d),f=E,h=w)}):r.doc.nodesBetween(c,d,(w,E)=>{E<c&&s&&s===w.type&&(m=Math.max(E,c),y=Math.min(E+w.nodeSize,d),f=E,h=w),E>=c&&E<=d&&(s&&s===w.type&&n.setNodeMarkup(E,void 0,{...w.attrs,...e}),i&&w.marks.length&&w.marks.forEach(_=>{if(i===_.type){const x=Math.max(E,c),A=Math.min(E+w.nodeSize,d);n.addMark(x,A,i.create({..._.attrs,...e}))}}))}),h&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...h.attrs,...e}),i&&h.marks.length&&h.marks.forEach(w=>{i===w.type&&n.addMark(m,y,i.create({...w.attrs,...e}))}))}),!0):!1},_y=(t,e={})=>({state:n,dispatch:r})=>{const o=Me(t,n.schema);return I0(o,e)(n,r)},Ey=(t,e={})=>({state:n,dispatch:r})=>{const o=Me(t,n.schema);return P0(o,e)(n,r)},Su=le.create({name:"commands",addCommands(){return{..._u}}}),Tu=le.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const s=()=>{var i,a,l,c;if((c=(l=(a=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?c:t.getMeta("y-sync$"))return;const d=Zd(t.before,[t,...e]);uu(d).forEach(m=>{d.mapping.mapResult(m.oldRange.from).deletedAfter&&d.mapping.mapResult(m.oldRange.to).deletedBefore&&d.before.nodesBetween(m.oldRange.from,m.oldRange.to,(y,w)=>{const E=w+y.nodeSize-2,_=m.oldRange.from<=w&&E<=m.oldRange.to;this.editor.emit("delete",{type:"node",node:y,from:w,to:E,newFrom:d.mapping.map(w),newTo:d.mapping.map(E),deletedRange:m.oldRange,newRange:m.newRange,partial:!_,editor:this.editor,transaction:t,combinedTransform:d})})});const h=d.mapping;d.steps.forEach((m,y)=>{var w,E;if(m instanceof yt){const _=h.slice(y).map(m.from,-1),x=h.slice(y).map(m.to),A=h.invert().map(_,-1),u=h.invert().map(x),b=(w=d.doc.nodeAt(_-1))==null?void 0:w.marks.some(k=>k.eq(m.mark)),g=(E=d.doc.nodeAt(x))==null?void 0:E.marks.some(k=>k.eq(m.mark));this.editor.emit("delete",{type:"mark",mark:m.mark,from:m.from,to:m.to,deletedRange:{from:A,to:u},newRange:{from:_,to:x},partial:!!(g||b),editor:this.editor,transaction:t,combinedTransform:d})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(s,0):s()}}),xu=le.create({name:"drop",addProseMirrorPlugins(){return[new ge({key:new ve("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),Nu=le.create({name:"editable",addProseMirrorPlugins(){return[new ge({key:new ve("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Mu=new ve("focusEvents"),Au=le.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ge({key:Mu,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Ou=le.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:f}=l,{pos:h,parent:m}=f,y=f.parent.isTextblock&&h>0?a.doc.resolve(h-1):f,w=y.parent.type.spec.isolating,E=f.pos-f.parentOffset,_=w&&y.parent.childCount===1?E===f.pos:X.atStart(c).from===h;return!d||!m.type.isTextblock||m.textContent.length||!_||_&&f.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Qi()||Eu()?s:o},addProseMirrorPlugins(){return[new ge({key:new ve("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(w=>w.getMeta("composition")))return;const r=t.some(w=>w.docChanged)&&!e.doc.eq(n.doc),o=t.some(w=>w.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:i,to:a}=e.selection,l=X.atStart(e.doc).from,c=X.atEnd(e.doc).to;if(s||!(i===l&&a===c)||!Bo(n.doc))return;const h=n.tr,m=Mo({state:n,transaction:h}),{commands:y}=new Ao({editor:this.editor,state:m});if(y.clearNodes(),!!h.steps.length)return h}})]}}),Lu=le.create({name:"paste",addProseMirrorPlugins(){return[new ge({key:new ve("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Iu=le.create({name:"tabindex",addProseMirrorPlugins(){return[new ge({key:new ve("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Cy=class mr{constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new mr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new mr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new mr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,i=this.pos+r+(s?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(i);if(!o&&a.depth<=this.depth)return;const l=new mr(a,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new mr(a,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const s=o.node.attrs,i=Object.keys(n);for(let a=0;a<i.length;a+=1){const l=i[a];if(s[l]!==n[l])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const s=Object.keys(n);return this.children.forEach(i=>{r&&o.length>0||(i.node.type.name===e&&s.every(l=>n[l]===i.node.attrs[l])&&o.push(i),!(r&&o.length>0)&&(o=o.concat(i.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},vy=`.ProseMirror {
|
|
14
14
|
position: relative;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -80,244 +80,205 @@ img.ProseMirror-separator {
|
|
|
80
80
|
|
|
81
81
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
82
82
|
display: block;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
`,textSerializers:r={}}=e||{};return ap(this.state.doc,{blockSeparator:n,textSerializers:{...hl(this.schema),...r}})}get isEmpty(){return vl(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new pr(n,this)}get $doc(){return this.$pos(0)}};function hr(t){return new Fi({find:t.find,handler:({state:e,range:n,match:r})=>{const o=ie(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(_l(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(k=>k===t.type&&k!==m.mark.type)).filter(m=>m.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+l,c);const p=n.from+l+s.length;i.addMark(n.from+l,p,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function S1(t){return new Fi({find:t.find,handler:({state:e,range:n,match:r})=>{const o=ie(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let a=n.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];i.insertText(f,s+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function Tl(t){return new Fi({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=ie(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function Mo(t){return new Fi({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=ie(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Ca(l,t.type,i);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:m}=t.editor.extensionManager,b=p||f.$to.parentOffset&&f.$from.marks();if(b){const k=b.filter(_=>m.includes(_.type.name));s.ensureMarks(k)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(f,i).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Ln(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let ct=class vu{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new vu(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Hi(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new vu(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ie(J(n,"addOptions",{name:n.name})),n.storage=ie(J(n,"addStorage",{name:n.name,options:n.options})),n}};function jn(t){return new ek({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=ie(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),f=n.from+l.indexOf(a),p=f+a.length;if(_l(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(_=>_===t.type&&_!==b.mark.type)).filter(b=>b.to>f).length)return null;p<n.to&&s.delete(p,n.to),f>n.from&&s.delete(n.from+u,f),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}var mt="top",Rt="bottom",Pt="right",gt="left",Nl="auto",xo=[mt,Rt,Pt,gt],Ur="start",Lo="end",T1="clippingParents",fp="viewport",Ro="popper",N1="reference",pp=xo.reduce(function(t,e){return t.concat([e+"-"+Ur,e+"-"+Lo])},[]),hp=[].concat(xo,[Nl]).reduce(function(t,e){return t.concat([e,e+"-"+Ur,e+"-"+Lo])},[]),A1="beforeRead",O1="read",M1="afterRead",x1="beforeMain",L1="main",R1="afterMain",P1="beforeWrite",I1="write",D1="afterWrite",B1=[A1,O1,M1,x1,L1,R1,P1,I1,D1];function Zt(t){return t?(t.nodeName||"").toLowerCase():null}function Ct(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function mr(t){var e=Ct(t).Element;return t instanceof e||t instanceof Element}function It(t){var e=Ct(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Al(t){if(typeof ShadowRoot>"u")return!1;var e=Ct(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function F1(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!It(i)||!Zt(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 $1(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!It(o)||!Zt(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const mp={name:"applyStyles",enabled:!0,phase:"write",fn:F1,effect:$1,requires:["computeStyles"]};function en(t){return t.split("-")[0]}var gr=Math.max,qi=Math.min,Wr=Math.round;function Ol(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function gp(){return!/^((?!chrome|android).)*safari/i.test(Ol())}function Kr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&It(t)&&(o=t.offsetWidth>0&&Wr(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Wr(r.height)/t.offsetHeight||1);var s=mr(t)?Ct(t):window,a=s.visualViewport,l=!gp()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,f=r.width/o,p=r.height/i;return{width:f,height:p,top:u,right:c+f,bottom:u+p,left:c,x:c,y:u}}function Ml(t){var e=Kr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function bp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Al(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function yn(t){return Ct(t).getComputedStyle(t)}function V1(t){return["table","td","th"].indexOf(Zt(t))>=0}function Un(t){return((mr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gi(t){return Zt(t)==="html"?t:t.assignedSlot||t.parentNode||(Al(t)?t.host:null)||Un(t)}function yp(t){return!It(t)||yn(t).position==="fixed"?null:t.offsetParent}function H1(t){var e=/firefox/i.test(Ol()),n=/Trident/i.test(Ol());if(n&&It(t)){var r=yn(t);if(r.position==="fixed")return null}var o=Gi(t);for(Al(o)&&(o=o.host);It(o)&&["html","body"].indexOf(Zt(o))<0;){var i=yn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Po(t){for(var e=Ct(t),n=yp(t);n&&V1(n)&&yn(n).position==="static";)n=yp(n);return n&&(Zt(n)==="html"||Zt(n)==="body"&&yn(n).position==="static")?e:n||H1(t)||e}function xl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Io(t,e,n){return gr(t,qi(e,n))}function z1(t,e,n){var r=Io(t,e,n);return r>n?n:r}function wp(){return{top:0,right:0,bottom:0,left:0}}function kp(t){return Object.assign({},wp(),t)}function _p(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var j1=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,kp(typeof e!="number"?e:_p(e,xo))};function U1(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=en(n.placement),l=xl(a),c=[gt,Pt].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var f=j1(o.padding,n),p=Ml(i),m=l==="y"?mt:gt,b=l==="y"?Rt:Pt,k=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],_=s[l]-n.rects.reference[l],E=Po(i),N=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,A=k/2-_/2,d=f[m],g=N-p[u]-f[b],h=N/2-p[u]/2+A,w=Io(d,h,g),v=l;n.modifiersData[r]=(e={},e[v]=w,e.centerOffset=w-h,e)}}function W1(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||bp(e.elements.popper,o)&&(e.elements.arrow=o))}const K1={name:"arrow",enabled:!0,phase:"main",fn:U1,effect:W1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qr(t){return t.split("-")[1]}var q1={top:"auto",right:"auto",bottom:"auto",left:"auto"};function G1(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:Wr(n*o)/o||0,y:Wr(r*o)/o||0}}function Ep(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,p=s.x,m=p===void 0?0:p,b=s.y,k=b===void 0?0:b,_=typeof u=="function"?u({x:m,y:k}):{x:m,y:k};m=_.x,k=_.y;var E=s.hasOwnProperty("x"),N=s.hasOwnProperty("y"),A=gt,d=mt,g=window;if(c){var h=Po(n),w="clientHeight",v="clientWidth";if(h===Ct(n)&&(h=Un(n),yn(h).position!=="static"&&a==="absolute"&&(w="scrollHeight",v="scrollWidth")),h=h,o===mt||(o===gt||o===Pt)&&i===Lo){d=Rt;var S=f&&h===g&&g.visualViewport?g.visualViewport.height:h[w];k-=S-r.height,k*=l?1:-1}if(o===gt||(o===mt||o===Rt)&&i===Lo){A=Pt;var C=f&&h===g&&g.visualViewport?g.visualViewport.width:h[v];m-=C-r.width,m*=l?1:-1}}var M=Object.assign({position:a},c&&q1),P=u===!0?G1({x:m,y:k},Ct(n)):{x:m,y:k};if(m=P.x,k=P.y,l){var D;return Object.assign({},M,(D={},D[d]=N?"0":"",D[A]=E?"0":"",D.transform=(g.devicePixelRatio||1)<=1?"translate("+m+"px, "+k+"px)":"translate3d("+m+"px, "+k+"px, 0)",D))}return Object.assign({},M,(e={},e[d]=N?k+"px":"",e[A]=E?m+"px":"",e.transform="",e))}function J1(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:en(e.placement),variation:qr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ep(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ep(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Y1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:J1,data:{}};var Ji={passive:!0};function X1(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=Ct(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Ji)}),a&&l.addEventListener("resize",n.update,Ji),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Ji)}),a&&l.removeEventListener("resize",n.update,Ji)}}const Q1={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:X1,data:{}};var Z1={left:"right",right:"left",bottom:"top",top:"bottom"};function Yi(t){return t.replace(/left|right|bottom|top/g,function(e){return Z1[e]})}var e_={start:"end",end:"start"};function vp(t){return t.replace(/start|end/g,function(e){return e_[e]})}function Ll(t){var e=Ct(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Rl(t){return Kr(Un(t)).left+Ll(t).scrollLeft}function t_(t,e){var n=Ct(t),r=Un(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=gp();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Rl(t),y:l}}function n_(t){var e,n=Un(t),r=Ll(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=gr(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=gr(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Rl(t),l=-r.scrollTop;return yn(o||n).direction==="rtl"&&(a+=gr(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Pl(t){var e=yn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Cp(t){return["html","body","#document"].indexOf(Zt(t))>=0?t.ownerDocument.body:It(t)&&Pl(t)?t:Cp(Gi(t))}function Do(t,e){var n;e===void 0&&(e=[]);var r=Cp(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=Ct(r),s=o?[i].concat(i.visualViewport||[],Pl(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(Do(Gi(s)))}function Il(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function r_(t,e){var n=Kr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Sp(t,e,n){return e===fp?Il(t_(t,n)):mr(e)?r_(e,n):Il(n_(Un(t)))}function o_(t){var e=Do(Gi(t)),n=["absolute","fixed"].indexOf(yn(t).position)>=0,r=n&&It(t)?Po(t):t;return mr(r)?e.filter(function(o){return mr(o)&&bp(o,r)&&Zt(o)!=="body"}):[]}function i_(t,e,n,r){var o=e==="clippingParents"?o_(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=Sp(t,c,r);return l.top=gr(u.top,l.top),l.right=qi(u.right,l.right),l.bottom=qi(u.bottom,l.bottom),l.left=gr(u.left,l.left),l},Sp(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Tp(t){var e=t.reference,n=t.element,r=t.placement,o=r?en(r):null,i=r?qr(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case mt:l={x:s,y:e.y-n.height};break;case Rt:l={x:s,y:e.y+e.height};break;case Pt:l={x:e.x+e.width,y:a};break;case gt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?xl(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Ur:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Lo:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Bo(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?T1:a,c=n.rootBoundary,u=c===void 0?fp:c,f=n.elementContext,p=f===void 0?Ro:f,m=n.altBoundary,b=m===void 0?!1:m,k=n.padding,_=k===void 0?0:k,E=kp(typeof _!="number"?_:_p(_,xo)),N=p===Ro?N1:Ro,A=t.rects.popper,d=t.elements[b?N:p],g=i_(mr(d)?d:d.contextElement||Un(t.elements.popper),l,u,s),h=Kr(t.elements.reference),w=Tp({reference:h,element:A,placement:o}),v=Il(Object.assign({},A,w)),S=p===Ro?v:h,C={top:g.top-S.top+E.top,bottom:S.bottom-g.bottom+E.bottom,left:g.left-S.left+E.left,right:S.right-g.right+E.right},M=t.modifiersData.offset;if(p===Ro&&M){var P=M[o];Object.keys(C).forEach(function(D){var F=[Pt,Rt].indexOf(D)>=0?1:-1,$=[mt,Rt].indexOf(D)>=0?"y":"x";C[D]+=P[$]*F})}return C}function s_(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?hp:l,u=qr(r),f=u?a?pp:pp.filter(function(b){return qr(b)===u}):xo,p=f.filter(function(b){return c.indexOf(b)>=0});p.length===0&&(p=f);var m=p.reduce(function(b,k){return b[k]=Bo(t,{placement:k,boundary:o,rootBoundary:i,padding:s})[en(k)],b},{});return Object.keys(m).sort(function(b,k){return m[b]-m[k]})}function a_(t){if(en(t)===Nl)return[];var e=Yi(t);return[vp(t),e,vp(e)]}function l_(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,p=n.altBoundary,m=n.flipVariations,b=m===void 0?!0:m,k=n.allowedAutoPlacements,_=e.options.placement,E=en(_),N=E===_,A=l||(N||!b?[Yi(_)]:a_(_)),d=[_].concat(A).reduce(function(Oe,fe){return Oe.concat(en(fe)===Nl?s_(e,{placement:fe,boundary:u,rootBoundary:f,padding:c,flipVariations:b,allowedAutoPlacements:k}):fe)},[]),g=e.rects.reference,h=e.rects.popper,w=new Map,v=!0,S=d[0],C=0;C<d.length;C++){var M=d[C],P=en(M),D=qr(M)===Ur,F=[mt,Rt].indexOf(P)>=0,$=F?"width":"height",T=Bo(e,{placement:M,boundary:u,rootBoundary:f,altBoundary:p,padding:c}),I=F?D?Pt:gt:D?Rt:mt;g[$]>h[$]&&(I=Yi(I));var U=Yi(I),q=[];if(i&&q.push(T[P]<=0),a&&q.push(T[I]<=0,T[U]<=0),q.every(function(Oe){return Oe})){S=M,v=!1;break}w.set(M,q)}if(v)for(var Z=b?3:1,G=function(fe){var we=d.find(function(Me){var ke=w.get(Me);if(ke)return ke.slice(0,fe).every(function(_t){return _t})});if(we)return S=we,"break"},he=Z;he>0;he--){var Te=G(he);if(Te==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}const c_={name:"flip",enabled:!0,phase:"main",fn:l_,requiresIfExists:["offset"],data:{_skip:!1}};function Np(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ap(t){return[mt,Pt,Rt,gt].some(function(e){return t[e]>=0})}function u_(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=Bo(e,{elementContext:"reference"}),a=Bo(e,{altBoundary:!0}),l=Np(s,r),c=Np(a,o,i),u=Ap(l),f=Ap(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const d_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:u_};function f_(t,e,n){var r=en(t),o=[gt,mt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[gt,Pt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function p_(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=hp.reduce(function(u,f){return u[f]=f_(f,e.rects,i),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const h_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:p_};function m_(t){var e=t.state,n=t.name;e.modifiersData[n]=Tp({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const g_={name:"popperOffsets",enabled:!0,phase:"read",fn:m_,data:{}};function b_(t){return t==="x"?"y":"x"}function y_(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,p=n.tether,m=p===void 0?!0:p,b=n.tetherOffset,k=b===void 0?0:b,_=Bo(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),E=en(e.placement),N=qr(e.placement),A=!N,d=xl(E),g=b_(d),h=e.modifiersData.popperOffsets,w=e.rects.reference,v=e.rects.popper,S=typeof k=="function"?k(Object.assign({},e.rects,{placement:e.placement})):k,C=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(h){if(i){var D,F=d==="y"?mt:gt,$=d==="y"?Rt:Pt,T=d==="y"?"height":"width",I=h[d],U=I+_[F],q=I-_[$],Z=m?-v[T]/2:0,G=N===Ur?w[T]:v[T],he=N===Ur?-v[T]:-w[T],Te=e.elements.arrow,Oe=m&&Te?Ml(Te):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:wp(),we=fe[F],Me=fe[$],ke=Io(0,w[T],Oe[T]),_t=A?w[T]/2-Z-ke-we-C.mainAxis:G-ke-we-C.mainAxis,ot=A?-w[T]/2+Z+ke+Me+C.mainAxis:he+ke+Me+C.mainAxis,At=e.elements.arrow&&Po(e.elements.arrow),Vt=At?d==="y"?At.clientTop||0:At.clientLeft||0:0,Et=(D=M?.[d])!=null?D:0,dn=I+_t-Et-Vt,Ht=I+ot-Et,Jt=Io(m?qi(U,dn):U,I,m?gr(q,Ht):q);h[d]=Jt,P[d]=Jt-I}if(a){var Sn,O=d==="x"?mt:gt,x=d==="x"?Rt:Pt,H=h[g],Y=g==="y"?"height":"width",ve=H+_[O],me=H-_[x],le=[mt,gt].indexOf(E)!==-1,R=(Sn=M?.[g])!=null?Sn:0,z=le?ve:H-w[Y]-v[Y]-R+C.altAxis,ce=le?H+w[Y]+v[Y]-R-C.altAxis:me,Ne=m&&le?z1(z,H,ce):Io(m?z:ve,H,m?ce:me);h[g]=Ne,P[g]=Ne-H}e.modifiersData[r]=P}}const w_={name:"preventOverflow",enabled:!0,phase:"main",fn:y_,requiresIfExists:["offset"]};function k_(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function __(t){return t===Ct(t)||!It(t)?Ll(t):k_(t)}function E_(t){var e=t.getBoundingClientRect(),n=Wr(e.width)/t.offsetWidth||1,r=Wr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function v_(t,e,n){n===void 0&&(n=!1);var r=It(e),o=It(e)&&E_(e),i=Un(e),s=Kr(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Zt(e)!=="body"||Pl(i))&&(a=__(e)),It(e)?(l=Kr(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=Rl(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function C_(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function S_(t){var e=C_(t);return B1.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function T_(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function N_(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Op={placement:"bottom",modifiers:[],strategy:"absolute"};function Mp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function A_(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Op:o;return function(a,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Op,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],p=!1,m={state:u,setOptions:function(E){var N=typeof E=="function"?E(u.options):E;k(),u.options=Object.assign({},i,u.options,N),u.scrollParents={reference:mr(a)?Do(a):a.contextElement?Do(a.contextElement):[],popper:Do(l)};var A=S_(N_([].concat(r,u.options.modifiers)));return u.orderedModifiers=A.filter(function(d){return d.enabled}),b(),m.update()},forceUpdate:function(){if(!p){var E=u.elements,N=E.reference,A=E.popper;if(Mp(N,A)){u.rects={reference:v_(N,Po(A),u.options.strategy==="fixed"),popper:Ml(A)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(C){return u.modifiersData[C.name]=Object.assign({},C.data)});for(var d=0;d<u.orderedModifiers.length;d++){if(u.reset===!0){u.reset=!1,d=-1;continue}var g=u.orderedModifiers[d],h=g.fn,w=g.options,v=w===void 0?{}:w,S=g.name;typeof h=="function"&&(u=h({state:u,options:v,name:S,instance:m})||u)}}}},update:T_(function(){return new Promise(function(_){m.forceUpdate(),_(u)})}),destroy:function(){k(),p=!0}};if(!Mp(a,l))return m;m.setOptions(c).then(function(_){!p&&c.onFirstUpdate&&c.onFirstUpdate(_)});function b(){u.orderedModifiers.forEach(function(_){var E=_.name,N=_.options,A=N===void 0?{}:N,d=_.effect;if(typeof d=="function"){var g=d({state:u,name:E,instance:m,options:A}),h=function(){};f.push(g||h)}})}function k(){f.forEach(function(_){return _()}),f=[]}return m}}var O_=[Q1,g_,Y1,mp,h_,c_,w_,K1,d_],M_=A_({defaultModifiers:O_}),x_="tippy-box",xp="tippy-content",L_="tippy-backdrop",Lp="tippy-arrow",Rp="tippy-svg-arrow",br={passive:!0,capture:!0},Pp=function(){return document.body};function R_(t,e){return{}.hasOwnProperty.call(t,e)}function Dl(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Bl(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Ip(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Dp(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function P_(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function I_(t){return t.split(/\s+/).filter(Boolean)}function Gr(t){return[].concat(t)}function Bp(t,e){t.indexOf(e)===-1&&t.push(e)}function D_(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function B_(t){return t.split("-")[0]}function Xi(t){return[].slice.call(t)}function Fp(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Fo(){return document.createElement("div")}function $o(t){return["Element","Fragment"].some(function(e){return Bl(t,e)})}function F_(t){return Bl(t,"NodeList")}function $_(t){return Bl(t,"MouseEvent")}function V_(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function H_(t){return $o(t)?[t]:F_(t)?Xi(t):Array.isArray(t)?t:Xi(document.querySelectorAll(t))}function Fl(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function $p(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function z_(t){var e,n=Gr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function j_(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=B_(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=c==="bottom"?u.top.y:0,p=c==="top"?u.bottom.y:0,m=c==="right"?u.left.x:0,b=c==="left"?u.right.x:0,k=i.top-r+f>l,_=r-i.bottom-p>l,E=i.left-n+m>l,N=n-i.right-b>l;return k||_||E||N})}function $l(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function Vp(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var tn={isTouch:!1},Hp=0;function U_(){tn.isTouch||(tn.isTouch=!0,window.performance&&document.addEventListener("mousemove",zp))}function zp(){var t=performance.now();t-Hp<20&&(tn.isTouch=!1,document.removeEventListener("mousemove",zp)),Hp=t}function W_(){var t=document.activeElement;if(V_(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function K_(){document.addEventListener("touchstart",U_,br),window.addEventListener("blur",W_)}var q_=typeof window<"u"&&typeof document<"u",G_=q_?!!window.msCrypto:!1;function Jr(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function jp(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function J_(t){return jp(`
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
101
|
-
|
|
102
|
-
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
103
|
-
|
|
104
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Y(){return Xi(h.querySelectorAll("[data-tippy-root]"))}function ve(B){d.clearDelayTimeouts(),B&&U("onTrigger",[d,B]),fe();var X=T(!0),re=C(),ge=re[0],pe=re[1];tn.isTouch&&ge==="hold"&&pe&&(X=pe),X?r=setTimeout(function(){d.show()},X):d.show()}function me(B){if(d.clearDelayTimeouts(),U("onUntrigger",[d,B]),!d.state.isVisible){we();return}if(!(d.props.trigger.indexOf("mouseenter")>=0&&d.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&s)){var X=T(!1);X?o=setTimeout(function(){d.state.isVisible&&d.hide()},X):i=requestAnimationFrame(function(){d.hide()})}}function le(){d.state.isEnabled=!0}function R(){d.hide(),d.state.isEnabled=!1}function z(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function ce(B){if(process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("setProps")),!d.state.isDestroyed){U("onBeforeUpdate",[d,B]),Vt();var X=d.props,re=qp(t,Object.assign({},X,Fp(B),{ignoreAttributes:!0}));d.props=re,At(),X.interactiveDebounce!==re.interactiveDebounce&&(G(),b=Dp(dn,re.interactiveDebounce)),X.triggerTarget&&!re.triggerTarget?Gr(X.triggerTarget).forEach(function(ge){ge.removeAttribute("aria-expanded")}):re.triggerTarget&&t.removeAttribute("aria-expanded"),Z(),I(),w&&w(X,re),d.popperInstance&&(O(),Y().forEach(function(ge){requestAnimationFrame(ge._tippy.popperInstance.forceUpdate)})),U("onAfterUpdate",[d,B])}}function Ne(B){d.setProps({content:B})}function Tn(){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("show"));var B=d.state.isVisible,X=d.state.isDestroyed,re=!d.state.isEnabled,ge=tn.isTouch&&!d.props.touch,pe=Dl(d.props.duration,0,St.duration);if(!(B||X||re||ge)&&!D().hasAttribute("disabled")&&(U("onShow",[d],!1),d.props.onShow(d)!==!1)){if(d.state.isVisible=!0,P()&&(h.style.visibility="visible"),I(),fe(),d.state.isMounted||(h.style.transition="none"),P()){var ft=$(),zt=ft.box,lo=ft.content;Fl([zt,lo],0)}p=function(){var Or;if(!(!d.state.isVisible||c)){if(c=!0,h.offsetHeight,h.style.transition=d.props.moveTransition,P()&&d.props.animation){var yu=$(),fa=yu.box,co=yu.content;Fl([fa,co],pe),$p([fa,co],"visible")}q(),Z(),Bp(jl,d),(Or=d.popperInstance)==null||Or.forceUpdate(),U("onMount",[d]),d.props.animation&&P()&&ke(pe,function(){d.state.isShown=!0,U("onShown",[d])})}},H()}}function ao(){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("hide"));var B=!d.state.isVisible,X=d.state.isDestroyed,re=!d.state.isEnabled,ge=Dl(d.props.duration,1,St.duration);if(!(B||X||re)&&(U("onHide",[d],!1),d.props.onHide(d)!==!1)){if(d.state.isVisible=!1,d.state.isShown=!1,c=!1,s=!1,P()&&(h.style.visibility="hidden"),G(),we(),I(!0),P()){var pe=$(),ft=pe.box,zt=pe.content;d.props.animation&&(Fl([ft,zt],ge),$p([ft,zt],"hidden"))}q(),Z(),d.props.animation?P()&&Me(ge,d.unmount):d.unmount()}}function er(B){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("hideWithInteractivity")),F().addEventListener("mousemove",b),Bp(Qi,b),b(B)}function Nn(){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("unmount")),d.state.isVisible&&d.hide(),d.state.isMounted&&(x(),Y().forEach(function(B){B._tippy.unmount()}),h.parentNode&&h.parentNode.removeChild(h),jl=jl.filter(function(B){return B!==d}),d.state.isMounted=!1,U("onHidden",[d]))}function bu(){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("destroy")),!d.state.isDestroyed&&(d.clearDelayTimeouts(),d.unmount(),Vt(),delete t._tippy,d.state.isDestroyed=!0,U("onDestroy",[d]))}}function Yr(t,e){e===void 0&&(e={});var n=St.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(X_(t),Gp(e,n)),K_();var r=Object.assign({},e,{plugins:n}),o=H_(t);if(process.env.NODE_ENV!=="production"){var i=$o(r.content),s=o.length>1;wn(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
105
|
-
|
|
106
|
-
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
107
|
-
|
|
108
|
-
`,`1) content: element.innerHTML
|
|
109
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(l,c){var u=c&&oE(c,r);return u&&l.push(u),l},[]);return $o(t)?a[0]:a}Yr.defaultProps=St,Yr.setDefaultProps=eE,Yr.currentInput=tn,Object.assign({},mp,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Yr.setDefaultProps({render:Xp});class iE{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:i=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:f,selection:p}=l,{empty:m}=p,b=!f.textBetween(c,u).length&&gl(l.selection),k=this.element.contains(document.activeElement);return!(!(a.hasFocus()||k)||m||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||a?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!l?.selection.eq(a.state.selection),u=!l?.doc.eq(a.state.doc);!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var f,p,m;const{state:b,composing:k}=a,{selection:_}=b;if(k||!l&&!c)return;this.createTooltip();const{ranges:N}=_,A=Math.min(...N.map(h=>h.$from.pos)),d=Math.max(...N.map(h=>h.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,element:this.element,view:a,state:b,oldState:u,from:A,to:d}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((m=this.tippyOptions)===null||m===void 0?void 0:m.getReferenceClientRect)||(()=>{if(o1(b.selection)){let h=a.nodeDOM(A);if(h){const w=h.dataset.nodeViewWrapper?h:h.querySelector("[data-node-view-wrapper]");if(w&&(h=w.firstChild),h)return h.getBoundingClientRect()}}return up(a,A,d)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=i,s&&(this.shouldShow=s),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:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Yr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const i=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,i,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.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 Qp=t=>new $e({key:typeof t.pluginKey=="string"?new Ue(t.pluginKey):t.pluginKey,view:e=>new iE({view:e,...t})});Ke.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Qp({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class sE{getTextContent(e){return ap(e,{textSerializers:hl(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:l}=a,{$anchor:c,empty:u}=l,f=c.depth===1,p=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent&&c.parent.childCount===0&&!this.getTextContent(c.parent);return!(!s.hasFocus()||!u||!f||!p||!this.editor.isEditable)},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?.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||s?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,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:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Yr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,o,i;const{state:s}=e,{doc:a,selection:l}=s,{from:c,to:u}=l;if(n&&n.doc.eq(a)&&n.selection.eq(l))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:((i=this.tippyOptions)===null||i===void 0?void 0:i.getReferenceClientRect)||(()=>up(e,c,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Zp=t=>new $e({key:typeof t.pluginKey=="string"?new Ue(t.pluginKey):t.pluginKey,view:e=>new sE({view:e,...t})});Ke.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Zp({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),y.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=y.ref(null);return y.onMounted(()=>{const{updateDelay:r,editor:o,pluginKey:i,shouldShow:s,tippyOptions:a}=t;o.registerPlugin(Qp({updateDelay:r,editor:o,element:n.value,pluginKey:i,shouldShow:s,tippyOptions:a}))}),y.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=t;o.unregisterPlugin(r)}),()=>{var r;return y.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function eh(t){return y.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class aE extends C1{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=eh(this.view.state),this.reactiveExtensionStorage=eh(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),y.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const th=y.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=y.ref(),n=y.getCurrentInstance();return y.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&y.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const o=y.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:o}),r.createNodeViews()})}),y.onBeforeUnmount(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return y.h("div",{ref:t=>{this.rootEl=t}})}});y.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=y.ref(null);return y.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:i,shouldShow:s}=t;o.registerPlugin(Zp({pluginKey:r,editor:o,element:n.value,tippyOptions:i,shouldShow:s}))}),y.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=t;o.unregisterPlugin(r)}),()=>{var r;return y.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),y.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return y.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),y.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return y.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const nh=(t={})=>{const e=y.shallowRef();return y.onMounted(()=>{e.value=new aE(t)}),y.onBeforeUnmount(()=>{var n,r,o;const i=(n=e.value)===null||n===void 0?void 0:n.options.element,s=i?.cloneNode(!0);(r=i?.parentNode)===null||r===void 0||r.replaceChild(s,i),(o=e.value)===null||o===void 0||o.destroy()}),e},lE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,cE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,uE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,dE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,rh=ht.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[hr({find:lE,type:this.type}),hr({find:uE,type:this.type})]},addPasteRules(){return[jn({find:cE,type:this.type}),jn({find:dE,type:this.type})]}}),fE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,pE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,hE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,mE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,oh=ht.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[hr({find:fE,type:this.type}),hr({find:hE,type:this.type})]},addPasteRules(){return[jn({find:pE,type:this.type}),jn({find:mE,type:this.type})]}}),gE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,bE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ih=ht.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[hr({find:gE,type:this.type})]},addPasteRules(){return[jn({find:bE,type:this.type})]}}),yE=/(^|[^`])`([^`]+)`(?!`)/,wE=/(^|[^`])`([^`]+)`(?!`)/g,sh=ht.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[hr({find:yE,type:this.type})]},addPasteRules(){return[jn({find:wE,type:this.type})]}}),kE=/^```([a-z]+)?[\s\n]$/,_E=/^~~~([a-z]+)?[\s\n]$/,ah=ct.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Ce(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
110
|
-
|
|
111
|
-
`);return!i||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const a=o.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(ee.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Tl({find:kE,type:this.type,getAttributes:t=>({language:t[1]})}),Tl({find:_E,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new $e({key:new Ue("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o?.mode;if(!n||!i)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
|
|
112
|
-
`));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(te.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),EE="listItem",lh="textStyle",ch=/^\s*([-+*])\s$/,uh=ct.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(EE,this.editor.getAttributes(lh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Mo({find:ch,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mo({find:ch,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(lh),editor:this.editor})),[t]}}),vE="listItem",dh="textStyle",fh=/^(\d+)\.\s$/,ph=ct.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Ce(this.options.HTMLAttributes,n),0]:["ol",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(vE,this.editor.getAttributes(dh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Mo({find:fh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mo({find:fh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(dh)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),hh=ct.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ce(this.options.HTMLAttributes,t),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)}}}),CE=/^\s*>\s$/,mh=ct.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Mo({find:CE,type:this.type})]}}),gh=ct.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ce(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
113
|
-
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=n;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 e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const f=l.filter(p=>a.includes(p.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Zi=200,qe=function(){};qe.prototype.append=function(e){return e.length?(e=qe.from(e),!this.length&&e||e.length<Zi&&this.leafAppend(e)||this.length<Zi&&e.leafPrepend(this)||this.appendInner(e)):this},qe.prototype.prepend=function(e){return e.length?qe.from(e).append(this):this},qe.prototype.appendInner=function(e){return new SE(this,e)},qe.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?qe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},qe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},qe.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},qe.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o},qe.from=function(e){return e instanceof qe?e:e&&e.length?new bh(e):qe.empty};var bh=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Zi)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Zi)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qe);qe.empty=new bh([]);var SE=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},e.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<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qe);const TE=500;class Ut{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((f,p)=>{if(!f.step){o||(o=this.remapping(r,p+1),i=o.maps.length),i--,u.push(f);return}if(o){u.push(new nn(f.map));let m=f.step.map(o.slice(i)),b;m&&s.maybeStep(m).doc&&(b=s.mapping.maps[s.mapping.maps.length-1],c.push(new nn(b,void 0,void 0,c.length+u.length))),i--,b&&o.appendMap(b,i)}else s.maybeStep(f.step);if(f.selection)return a=o?f.selection.map(o.slice(i)):f.selection,l=new Ut(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),p=new nn(e.mapping.maps[u],f,n),m;(m=l&&l.merge(p))&&(p=m,u?i.pop():a=a.slice(0,a.length-1)),i.push(p),n&&(s++,n=void 0),o||(l=p)}let c=s-r.depth;return c>AE&&(a=NE(a,c),s-=c),new Ut(a.append(i),s)}remapping(e,n){let r=new mo;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ut(this.items.append(e.map(n=>new nn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},o);let l=n;this.items.forEach(p=>{let m=i.getMirror(--l);if(m==null)return;s=Math.min(s,m);let b=i.maps[m];if(p.step){let k=e.steps[m].invert(e.docs[m]),_=p.selection&&p.selection.map(i.slice(l+1,m));_&&a++,r.push(new nn(b,k,_))}else r.push(new nn(b))},o);let c=[];for(let p=n;p<s;p++)c.push(new nn(i.maps[p]));let u=this.items.slice(0,o).append(c).append(r),f=new Ut(u,a);return f.emptyItemCount()>TE&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let f=new nn(c.invert(),l,u),p,m=o.length-1;(p=o.length&&o[m].merge(f))?o[m]=p:o.push(f)}}else s.map&&r--},this.items.length,0),new Ut(qe.from(o.reverse()),i)}}Ut.empty=new Ut(qe.empty,0);function NE(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class nn{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new nn(n.getMap().invert(),n,this.selection)}}}class Wn{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const AE=20;function OE(t,e,n,r){let o=n.getMeta(yr),i;if(o)return o.historyState;n.getMeta(LE)&&(t=new Wn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(yr))return s.getMeta(yr).redo?new Wn(t.done.addTransform(n,void 0,r,es(e)),t.undone,yh(n.mapping.maps),t.prevTime,t.prevComposition):new Wn(t.done,t.undone.addTransform(n,void 0,r,es(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!ME(n,t.prevRanges)),c=s?Ul(t.prevRanges,n.mapping):yh(n.mapping.maps);return new Wn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,es(e)),Ut.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Wn(t.done.rebased(n,i),t.undone.rebased(n,i),Ul(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Wn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ul(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function ME(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function yh(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function Ul(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function xE(t,e,n){let r=es(e),o=yr.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),l=new Wn(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(yr,{redo:n,historyState:l})}let Wl=!1,wh=null;function es(t){let e=t.plugins;if(wh!=e){Wl=!1,wh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Wl=!0;break}}return Wl}const yr=new Ue("history"),LE=new Ue("closeHistory");function RE(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new $e({key:yr,state:{init(){return new Wn(Ut.empty,Ut.empty,null,0,-1)},apply(e,n,r){return OE(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?_h:r=="historyRedo"?Eh:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function kh(t,e){return(n,r)=>{let o=yr.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=xE(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const _h=kh(!1,!0),Eh=kh(!0,!0),vh=Ke.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>_h(t,e),redo:()=>({state:t,dispatch:e})=>Eh(t,e)}},addProseMirrorPlugins(){return[RE(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),PE=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,IE=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Ch=ht.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[hr({find:PE,type:this.type})]},addPasteRules(){return[jn({find:IE,type:this.type})]}}),Sh=ht.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Th=ht.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Nh=ht.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),DE="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",BE="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Xr=(t,e)=>{for(const n in e)t[n]=e[n];return t},Kl="numeric",ql="ascii",Gl="alpha",Ho="asciinumeric",zo="alphanumeric",Jl="domain",Ah="emoji",FE="scheme",$E="slashscheme",Yl="whitespace";function VE(t,e){return t in e||(e[t]=[]),e[t]}function wr(t,e,n){e[Kl]&&(e[Ho]=!0,e[zo]=!0),e[ql]&&(e[Ho]=!0,e[Gl]=!0),e[Ho]&&(e[zo]=!0),e[Gl]&&(e[zo]=!0),e[zo]&&(e[Jl]=!0),e[Ah]&&(e[Jl]=!0);for(const r in e){const o=VE(r,n);o.indexOf(t)<0&&o.push(t)}}function HE(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function bt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}bt.groups={},bt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||bt.groups;let o;return e&&e.j?o=e:(o=new bt(e),n&&r&&wr(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(t[s]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||bt.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new bt,Xr(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new bt,i){if(r)if(s.t&&typeof s.t=="string"){const l=Xr(HE(s.t,r),n);wr(i,l,r)}else n&&wr(i,n,r);s.t=i}return o.j[t]=s,s}};const se=(t,e,n,r,o)=>t.ta(e,n,r,o),Re=(t,e,n,r,o)=>t.tr(e,n,r,o),Oh=(t,e,n,r,o)=>t.ts(e,n,r,o),j=(t,e,n,r,o)=>t.tt(e,n,r,o),kn="WORD",Xl="UWORD",Mh="ASCIINUMERICAL",xh="ALPHANUMERICAL",jo="LOCALHOST",Ql="TLD",Zl="UTLD",ts="SCHEME",Qr="SLASH_SCHEME",ec="NUM",tc="WS",nc="NL",Uo="OPENBRACE",Wo="CLOSEBRACE",ns="OPENBRACKET",rs="CLOSEBRACKET",is="OPENPAREN",ss="CLOSEPAREN",as="OPENANGLEBRACKET",ls="CLOSEANGLEBRACKET",cs="FULLWIDTHLEFTPAREN",us="FULLWIDTHRIGHTPAREN",ds="LEFTCORNERBRACKET",fs="RIGHTCORNERBRACKET",ps="LEFTWHITECORNERBRACKET",hs="RIGHTWHITECORNERBRACKET",ms="FULLWIDTHLESSTHAN",gs="FULLWIDTHGREATERTHAN",bs="AMPERSAND",ys="APOSTROPHE",ws="ASTERISK",Kn="AT",ks="BACKSLASH",_s="BACKTICK",Es="CARET",qn="COLON",rc="COMMA",vs="DOLLAR",rn="DOT",Cs="EQUALS",oc="EXCLAMATION",Dt="HYPHEN",Ko="PERCENT",Ss="PIPE",Ts="PLUS",Ns="POUND",qo="QUERY",ic="QUOTE",Lh="FULLWIDTHMIDDLEDOT",sc="SEMI",on="SLASH",Go="TILDE",As="UNDERSCORE",Rh="EMOJI",Os="SYM";var Ph=Object.freeze({__proto__:null,ALPHANUMERICAL:xh,AMPERSAND:bs,APOSTROPHE:ys,ASCIINUMERICAL:Mh,ASTERISK:ws,AT:Kn,BACKSLASH:ks,BACKTICK:_s,CARET:Es,CLOSEANGLEBRACKET:ls,CLOSEBRACE:Wo,CLOSEBRACKET:rs,CLOSEPAREN:ss,COLON:qn,COMMA:rc,DOLLAR:vs,DOT:rn,EMOJI:Rh,EQUALS:Cs,EXCLAMATION:oc,FULLWIDTHGREATERTHAN:gs,FULLWIDTHLEFTPAREN:cs,FULLWIDTHLESSTHAN:ms,FULLWIDTHMIDDLEDOT:Lh,FULLWIDTHRIGHTPAREN:us,HYPHEN:Dt,LEFTCORNERBRACKET:ds,LEFTWHITECORNERBRACKET:ps,LOCALHOST:jo,NL:nc,NUM:ec,OPENANGLEBRACKET:as,OPENBRACE:Uo,OPENBRACKET:ns,OPENPAREN:is,PERCENT:Ko,PIPE:Ss,PLUS:Ts,POUND:Ns,QUERY:qo,QUOTE:ic,RIGHTCORNERBRACKET:fs,RIGHTWHITECORNERBRACKET:hs,SCHEME:ts,SEMI:sc,SLASH:on,SLASH_SCHEME:Qr,SYM:Os,TILDE:Go,TLD:Ql,UNDERSCORE:As,UTLD:Zl,UWORD:Xl,WORD:kn,WS:tc});const _n=/[a-z]/,Jo=new RegExp("\\p{L}","u"),ac=new RegExp("\\p{Emoji}","u"),En=/\d/,lc=/\s/,Ih="\r",cc=`
|
|
114
|
-
`,zE="️",jE="",uc="";let Ms=null,xs=null;function UE(t=[]){const e={};bt.groups=e;const n=new bt;Ms==null&&(Ms=Bh(DE)),xs==null&&(xs=Bh(BE)),j(n,"'",ys),j(n,"{",Uo),j(n,"}",Wo),j(n,"[",ns),j(n,"]",rs),j(n,"(",is),j(n,")",ss),j(n,"<",as),j(n,">",ls),j(n,"(",cs),j(n,")",us),j(n,"「",ds),j(n,"」",fs),j(n,"『",ps),j(n,"』",hs),j(n,"<",ms),j(n,">",gs),j(n,"&",bs),j(n,"*",ws),j(n,"@",Kn),j(n,"`",_s),j(n,"^",Es),j(n,":",qn),j(n,",",rc),j(n,"$",vs),j(n,".",rn),j(n,"=",Cs),j(n,"!",oc),j(n,"-",Dt),j(n,"%",Ko),j(n,"|",Ss),j(n,"+",Ts),j(n,"#",Ns),j(n,"?",qo),j(n,'"',ic),j(n,"/",on),j(n,";",sc),j(n,"~",Go),j(n,"_",As),j(n,"\\",ks),j(n,"・",Lh);const r=Re(n,En,ec,{[Kl]:!0});Re(r,En,r);const o=Re(r,_n,Mh,{[Ho]:!0}),i=Re(r,Jo,xh,{[zo]:!0}),s=Re(n,_n,kn,{[ql]:!0});Re(s,En,o),Re(s,_n,s),Re(o,En,o),Re(o,_n,o);const a=Re(n,Jo,Xl,{[Gl]:!0});Re(a,_n),Re(a,En,i),Re(a,Jo,a),Re(i,En,i),Re(i,_n),Re(i,Jo,i);const l=j(n,cc,nc,{[Yl]:!0}),c=j(n,Ih,tc,{[Yl]:!0}),u=Re(n,lc,tc,{[Yl]:!0});j(n,uc,u),j(c,cc,l),j(c,uc,u),Re(c,lc,u),j(u,Ih),j(u,cc),Re(u,lc,u),j(u,uc,u);const f=Re(n,ac,Rh,{[Ah]:!0});j(f,"#"),Re(f,ac,f),j(f,zE,f);const p=j(f,jE);j(p,"#"),Re(p,ac,f);const m=[[_n,s],[En,o]],b=[[_n,null],[Jo,a],[En,i]];for(let k=0;k<Ms.length;k++)Gn(n,Ms[k],Ql,kn,m);for(let k=0;k<xs.length;k++)Gn(n,xs[k],Zl,Xl,b);wr(Ql,{tld:!0,ascii:!0},e),wr(Zl,{utld:!0,alpha:!0},e),Gn(n,"file",ts,kn,m),Gn(n,"mailto",ts,kn,m),Gn(n,"http",Qr,kn,m),Gn(n,"https",Qr,kn,m),Gn(n,"ftp",Qr,kn,m),Gn(n,"ftps",Qr,kn,m),wr(ts,{scheme:!0,ascii:!0},e),wr(Qr,{slashscheme:!0,ascii:!0},e),t=t.sort((k,_)=>k[0]>_[0]?1:-1);for(let k=0;k<t.length;k++){const _=t[k][0],N=t[k][1]?{[FE]:!0}:{[$E]:!0};_.indexOf("-")>=0?N[Jl]=!0:_n.test(_)?En.test(_)?N[Ho]=!0:N[ql]=!0:N[Kl]=!0,Oh(n,_,_,N)}return Oh(n,"localhost",jo,{ascii:!0}),n.jd=new bt(Os),{start:n,tokens:Xr({groups:e},Ph)}}function Dh(t,e){const n=WE(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,f=-1,p=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(f=0,p=0,u=a):f>=0&&(f+=n[s].length,p++),c+=n[s].length,i+=n[s].length,s++;i-=f,s-=p,c-=f,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function WE(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Gn(t,e,n,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new bt(r),i.jr=o.slice(),t.j[l]=i),t=i}return i=new bt(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Bh(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Yo={defaultProtocol:"http",events:null,format:Fh,formatHref:Fh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function dc(t,e=null){let n=Xr({},Yo);t&&(n=Xr(n,t instanceof dc?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}dc.prototype={o:Yo,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Yo[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Fh(t){return t}function $h(t,e){this.t="token",this.v=t,this.tk=e}$h.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Yo.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Xr(s,u),{tagName:o,attributes:s,content:i,eventListeners:f}}};function Ls(t,e){class n extends $h{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Vh=Ls("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Hh=Ls("text"),KE=Ls("nl"),Rs=Ls("url",{isLink:!0,toHref(t=Yo.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==jo&&t[1].t===qn}}),Bt=t=>new bt(t);function qE({groups:t}){const e=t.domain.concat([bs,ws,Kn,ks,_s,Es,vs,Cs,Dt,ec,Ko,Ss,Ts,Ns,on,Os,Go,As]),n=[ys,qn,rc,rn,oc,Ko,qo,ic,sc,as,ls,Uo,Wo,rs,ns,is,ss,cs,us,ds,fs,ps,hs,ms,gs],r=[bs,ys,ws,ks,_s,Es,vs,Cs,Dt,Uo,Wo,Ko,Ss,Ts,Ns,qo,on,Os,Go,As],o=Bt(),i=j(o,Go);se(i,r,i),se(i,t.domain,i);const s=Bt(),a=Bt(),l=Bt();se(o,t.domain,s),se(o,t.scheme,a),se(o,t.slashscheme,l),se(s,r,i),se(s,t.domain,s);const c=j(s,Kn);j(i,Kn,c),j(a,Kn,c),j(l,Kn,c);const u=j(i,rn);se(u,r,i),se(u,t.domain,i);const f=Bt();se(c,t.domain,f),se(f,t.domain,f);const p=j(f,rn);se(p,t.domain,f);const m=Bt(Vh);se(p,t.tld,m),se(p,t.utld,m),j(c,jo,m);const b=j(f,Dt);j(b,Dt,b),se(b,t.domain,f),se(m,t.domain,f),j(m,rn,p),j(m,Dt,b);const k=j(m,qn);se(k,t.numeric,Vh);const _=j(s,Dt),E=j(s,rn);j(_,Dt,_),se(_,t.domain,s),se(E,r,i),se(E,t.domain,s);const N=Bt(Rs);se(E,t.tld,N),se(E,t.utld,N),se(N,t.domain,s),se(N,r,i),j(N,rn,E),j(N,Dt,_),j(N,Kn,c);const A=j(N,qn),d=Bt(Rs);se(A,t.numeric,d);const g=Bt(Rs),h=Bt();se(g,e,g),se(g,n,h),se(h,e,g),se(h,n,h),j(N,on,g),j(d,on,g);const w=j(a,qn),v=j(l,qn),S=j(v,on),C=j(S,on);se(a,t.domain,s),j(a,rn,E),j(a,Dt,_),se(l,t.domain,s),j(l,rn,E),j(l,Dt,_),se(w,t.domain,g),j(w,on,g),j(w,qo,g),se(C,t.domain,g),se(C,e,g),j(C,on,g);const M=[[Uo,Wo],[ns,rs],[is,ss],[as,ls],[cs,us],[ds,fs],[ps,hs],[ms,gs]];for(let P=0;P<M.length;P++){const[D,F]=M[P],$=j(g,D);j(h,D,$),j($,F,g);const T=Bt(Rs);se($,e,T);const I=Bt();se($,n),se(T,e,T),se(T,n,I),se(I,e,T),se(I,n,I),j(T,F,g),j(I,F,g)}return j(o,jo,N),j(o,nc,KE),{start:o,tokens:Ph}}function GE(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,u=0,f=null,p=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(p=0,f=a):p>=0&&p++,o++,u++;if(p<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(fc(Hh,e,s)),s=[]),o-=p,u-=p;const m=f.t,b=n.slice(o-u,o);i.push(fc(m,e,b))}}return s.length>0&&i.push(fc(Hh,e,s)),i}function fc(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const JE=typeof console<"u"&&console&&console.warn||(()=>{}),YE="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ae={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function XE(){return bt.groups={},Ae.scanner=null,Ae.parser=null,Ae.tokenQueue=[],Ae.pluginQueue=[],Ae.customSchemes=[],Ae.initialized=!1,Ae}function zh(t,e=!1){if(Ae.initialized&&JE(`linkifyjs: already initialized - will not register custom scheme "${t}" ${YE}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
83
|
+
}`;function Sy(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}var Ty=class extends H0{constructor(e={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:o})=>{throw o},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:o,slice:s,moved:i})=>this.options.onDrop(o,s,i)),this.on("paste",({event:o,slice:s})=>this.options.onPaste(o,s)),this.on("delete",this.options.onDelete);const n=this.createDoc(),r=yu(n,this.options.autofocus);this.editorState=Yn.create({doc:n,schema:this.schema,selection:r||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}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&&typeof document<"u"&&(this.css=Sy(vy,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,n)=>{if(n==="state")return this.editorState;if(n in e)return Reflect.get(e,n);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${n}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,n){const r=nu(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;r=r.filter(a=>!a.key.startsWith(i))}),n.length===r.length)return;const o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[Nu,wu.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:n.blockSeparator}),Su,Au,Ou,Iu,xu,Lu,Tu].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s?.type));this.extensionManager=new Ho(o,this)}createCommandManager(){this.commandManager=new Ao({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Hi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(n){if(!(n instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(n.message))throw n;this.emit("contentError",{editor:this,error:n,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),e=Hi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var n;this.editorView=new Id(e,{...this.options.editorProps,attributes:{role:"textbox",...(n=this.options.editorProps)==null?void 0:n.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.prependClass(),this.injectCSS();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(d=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(d)});return}const{state:n,transactions:r}=this.state.applyTransaction(e),o=!this.state.selection.eq(n.selection),s=r.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),!s)return;this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:r.slice(1)}),o&&this.emit("selectionUpdate",{editor:this,transaction:e});const a=r.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=a?.getMeta("focus"),c=a?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:a}),c&&this.emit("blur",{editor:this,event:c.event,transaction:a}),!(e.getMeta("preventUpdate")||!r.some(d=>d.docChanged)||i.doc.eq(n.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:r.slice(1)})}getAttributes(e){return du(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return tb(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ui(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
84
|
+
|
|
85
|
+
`,textSerializers:r={}}=e||{};return J0(this.state.doc,{blockSeparator:n,textSerializers:{...lu(this.schema),...r}})}get isEmpty(){return Bo(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,n;return(n=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?n:!0}$node(e,n){var r;return((r=this.$doc)==null?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)==null?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Cy(n,this)}get $doc(){return this.$pos(0)}};function On(t){return new Fo({find:t.find,handler:({state:e,range:n,match:r})=>{const o=ie(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],a=r[0];if(i){const l=a.search(/\S/),c=n.from+a.indexOf(i),d=c+i.length;if(qi(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(w=>w===t.type&&w!==m.mark.type)).filter(m=>m.to>c).length)return null;d<n.to&&s.delete(d,n.to),c>n.from&&s.delete(n.from+l,c);const h=n.from+l+i.length;s.addMark(n.from+l,h,t.type.create(o||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function Pu(t){return new Fo({find:t.find,handler:({state:e,range:n,match:r})=>{const o=ie(t.getAttributes,void 0,r)||{},{tr:s}=e,i=n.from;let a=n.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=i+c;d>a?d=a:a=d+r[1].length;const f=r[0][r[0].length-1];s.insertText(f,i+r[0].length-1),s.replaceWith(d,a,l)}else if(r[0]){const c=t.type.isInline?i:i-1;s.insert(c,t.type.create(o)).delete(s.mapping.map(i),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function ta(t){return new Fo({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=ie(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function or(t){return new Fo({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const s=ie(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),l=i.doc.resolve(n.from).blockRange(),c=l&&ni(l,t.type,s);if(!c)return null;if(i.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:m}=t.editor.extensionManager,y=h||f.$to.parentOffset&&f.$from.marks();if(y){const w=y.filter(E=>m.includes(E.type.name));i.ensureMarks(w)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(f,s).run()}const d=i.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Jt(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&i.join(n.from-1)},undoable:t.undoable})}function xy(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof J){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let o=r.depth;for(;o>=0;){const s=r.index(o);if(r.node(o).contentMatchAt(s).matchType(e))return!0;o-=1}return!1}function Ny(t,e,n={}){const{state:r}=e,{doc:o,tr:s}=r,i=t;o.descendants((a,l)=>{const c=s.mapping.map(l),d=s.mapping.map(l)+a.nodeSize;let f=null;if(a.marks.forEach(m=>{if(m!==i)return!1;f=m}),!f)return;let h=!1;if(Object.keys(n).forEach(m=>{n[m]!==f.attrs[m]&&(h=!0)}),h){const m=t.type.create({...t.attrs,...n});s.removeMark(c,d,t.type),s.addMark(c,d,m)}}),s.docChanged&&e.view.dispatch(s)}var De=class Bp extends Xi{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new Bp(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function an(t){return new cb({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const s=ie(t.getAttributes,void 0,r,o);if(s===!1||s===null)return null;const{tr:i}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const d=l.search(/\S/),f=n.from+l.indexOf(a),h=f+a.length;if(qi(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(E=>E===t.type&&E!==y.mark.type)).filter(y=>y.to>f).length)return null;h<n.to&&i.delete(h,n.to),f>n.from&&i.delete(n.from+d,f),c=n.from+d+a.length,i.addMark(n.from+d,c,t.type.create(s||{})),i.removeStoredMark(t.type)}}})}function Ru(t){return p.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var My=class extends Ty{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=Ru(this.view.state),this.reactiveExtensionStorage=Ru(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),p.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){const n=super.registerPlugin(t,e);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(t){const e=super.unregisterPlugin(t);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},Du=p.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=p.ref(),n=p.getCurrentInstance();return p.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&p.nextTick(()=>{var o;if(!e.value||!((o=r.view.dom)!=null&&o.firstChild))return;const s=p.unref(e.value);e.value.append(r.view.dom),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:s}),r.createNodeViews()})}),p.onBeforeUnmount(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return p.h("div",{ref:t=>{this.rootEl=t}})}});p.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return p.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),p.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return p.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)==null?void 0:e.call(t))}});var Bu=(t={})=>{const e=p.shallowRef();return p.onMounted(()=>{e.value=new My(t)}),p.onBeforeUnmount(()=>{var n,r,o;const s=(n=e.value)==null?void 0:n.view.dom,i=s?.cloneNode(!0);(r=s?.parentNode)==null||r.replaceChild(i,s),(o=e.value)==null||o.destroy()}),e};p.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return p.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});var Ay=20,Fu=(t,e=0)=>{const n=[];return!t.children.length||e>Ay||Array.from(t.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(...Fu(r,e+1))}),n},Oy=t=>{if(!t.children.length)return;const e=Fu(t);e&&e.forEach(n=>{var r,o;const s=n.getAttribute("style"),i=(o=(r=n.parentElement)==null?void 0:r.closest("span"))==null?void 0:o.getAttribute("style");n.setAttribute("style",`${i};${s}`)})},Ly=kt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&Oy(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),Iy=le.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const r=n.split(";").map(o=>o.trim()).filter(Boolean);for(let o=r.length-1;o>=0;o-=1){const s=r[o].split(":");if(s.length>=2){const i=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(i==="background-color")return a.replace(/['"]+/g,"")}}}return(e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),Py=le.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const r=n.split(";").map(o=>o.trim()).filter(Boolean);for(let o=r.length-1;o>=0;o-=1){const s=r[o].split(":");if(s.length>=2){const i=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(i==="color")return a.replace(/['"]+/g,"")}}}return(e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),Ry=le.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),Dy=le.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),By=le.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}}),Vu=le.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(Iy.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(Py.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(Ry.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(Dy.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(By.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(Ly.configure(this.options.textStyle)),t}}),na,ra;if(typeof WeakMap<"u"){let t=new WeakMap;na=e=>t.get(e),ra=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;na=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},ra=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var we=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let s=r+1,i=o+1;for(let a=1;s<this.width&&this.map[e+a]==n;a++)s++;for(let a=1;i<this.height&&this.map[e+this.width*a]==n;a++)i++;return{left:r,top:o,right:s,bottom:i}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:s,bottom:i}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(n<0?s==0:i==this.height)?null:this.map[r+this.width*(n<0?s-1:i)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:s}=this.findCell(t),{left:i,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,i),top:Math.min(o,l),right:Math.max(r,a),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const s=r*this.width+o,i=this.map[s];n[i]||(n[i]=!0,!(o==t.left&&o&&this.map[s-1]==i||r==t.top&&r&&this.map[s-this.width]==i)&&e.push(i))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const s=o+n.child(r).nodeSize;if(r==t){let i=e+t*this.width;const a=(t+1)*this.width;for(;i<a&&this.map[i]<o;)i++;return i==a?s-1:this.map[i]}o=s}}static get(t){return na(t)||ra(t,Fy(t))}};function Fy(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Vy(t),n=t.childCount,r=[];let o=0,s=null;const i=[];for(let c=0,d=e*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){const f=t.child(c);d++;for(let y=0;;y++){for(;o<r.length&&r[o]!=0;)o++;if(y==f.childCount)break;const w=f.child(y),{colspan:E,rowspan:_,colwidth:x}=w.attrs;for(let A=0;A<_;A++){if(A+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:d,n:_-A});break}const u=o+A*e;for(let b=0;b<E;b++){r[u+b]==0?r[u+b]=d:(s||(s=[])).push({type:"collision",row:c,pos:d,n:E-b});const g=x&&x[b];if(g){const k=(u+b)%e*2,C=i[k];C==null||C!=g&&i[k+1]==1?(i[k]=g,i[k+1]=1):C==g&&i[k+1]++}}}o+=E,d+=w.nodeSize}const h=(c+1)*e;let m=0;for(;o<h;)r[o++]==0&&m++;m&&(s||(s=[])).push({type:"missing",row:c,n:m}),d++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new we(e,n,r,s);let l=!1;for(let c=0;!l&&c<i.length;c+=2)i[c]!=null&&i[c+1]<n&&(l=!0);return l&&$y(a,i,t),a}function Vy(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let s=0;if(n)for(let i=0;i<r;i++){const a=t.child(i);for(let l=0;l<a.childCount;l++){const c=a.child(l);i+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let i=0;i<o.childCount;i++){const a=o.child(i);s+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function $y(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];if(r[s])continue;r[s]=!0;const i=n.nodeAt(s);if(!i)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=i.attrs;for(let c=0;c<l.colspan;c++){const d=(o+c)%t.width,f=e[d*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((a||(a=zy(l)))[c]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function zy(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Ge(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var ln=new ve("selectingCells");function sr(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Hy(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function wt(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function jo(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=sr(e.$head)||jy(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function jy(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function oa(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Uy(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function sa(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function $u(t,e,n){const r=t.node(-1),o=we.get(r),s=t.start(-1),i=o.nextCell(t.pos-s,e,n);return i==null?null:t.node(0).resolve(s+i)}function Ln(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function zu(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function Wy(t,e,n){const r=Ge(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var he=class Wt extends X{constructor(e,n=e){const r=e.node(-1),o=we.get(r),s=e.start(-1),i=o.rectBetween(e.pos-s,n.pos-s),a=e.node(0),l=o.cellsInRect(i).filter(d=>d!=n.pos-s);l.unshift(n.pos-s);const c=l.map(d=>{const f=r.nodeAt(d);if(!f)throw RangeError(`No cell with offset ${d} found`);const h=s+d+1;return new bc(a.resolve(h),a.resolve(h+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(oa(r)&&oa(o)&&sa(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Wt.rowSelection(r,o):s&&this.isColSelection()?Wt.colSelection(r,o):new Wt(r,o)}return Y.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=we.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},i=[];for(let l=o.top;l<o.bottom;l++){const c=[];for(let d=l*n.width+o.left,f=o.left;f<o.right;f++,d++){const h=n.map[d];if(s[h])continue;s[h]=!0;const m=n.findCell(h);let y=e.nodeAt(h);if(!y)throw RangeError(`No cell with offset ${h} found`);const w=o.left-m.left,E=m.right-o.right;if(w>0||E>0){let _=y.attrs;if(w>0&&(_=Ln(_,0,w)),E>0&&(_=Ln(_,_.colspan-E,E)),m.left<o.left){if(y=y.type.createAndFill(_),!y)throw RangeError(`Could not create cell with attrs ${JSON.stringify(_)}`)}else y=y.type.create(_,y.content)}if(m.top<o.top||m.bottom>o.bottom){const _={...y.attrs,rowspan:Math.min(m.bottom,o.bottom)-Math.max(m.top,o.top)};m.top<o.top?y=y.type.createAndFill(_):y=y.type.create(_,y.content)}c.push(y)}i.push(e.child(l).copy(I.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:i;return new H(I.from(a),1,1)}replace(e,n=H.empty){const r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){const{$from:a,$to:l}=o[i],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),i?H.empty:n)}const s=X.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new H(I.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=we.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let i=0;i<s.length;i++)e(n.nodeAt(s[i]),o+s[i])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=we.get(r),s=e.start(-1),i=o.findCell(e.pos-s),a=o.findCell(n.pos-s),l=e.node(0);return i.top<=a.top?(i.top>0&&(e=l.resolve(s+o.map[i.left])),a.bottom<o.height&&(n=l.resolve(s+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(s+o.map[a.left])),i.bottom<o.height&&(e=l.resolve(s+o.map[o.width*(o.height-1)+i.right-1]))),new Wt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=we.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const i=o+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,a)==n.width}eq(e){return e instanceof Wt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=we.get(r),s=e.start(-1),i=o.findCell(e.pos-s),a=o.findCell(n.pos-s),l=e.node(0);return i.left<=a.left?(i.left>0&&(e=l.resolve(s+o.map[i.top*o.width])),a.right<o.width&&(n=l.resolve(s+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(s+o.map[a.top*o.width])),i.right<o.width&&(e=l.resolve(s+o.map[o.width*(i.top+1)-1]))),new Wt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Wt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Wt(e.resolve(n),e.resolve(r))}getBookmark(){return new Ky(this.$anchorCell.pos,this.$headCell.pos)}};he.prototype.visible=!1,X.jsonID("cell",he);var Ky=class Fp{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Fp(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&sa(n,r)?new he(n,r):X.near(r,1)}};function Gy(t){if(!(t.selection instanceof he))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Re.node(r,r+n.nodeSize,{class:"selectedCell"}))}),fe.create(t.doc,e)}function qy({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function Jy({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function Yy(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,i;if(r instanceof J&&(i=r.node.type.spec.tableRole)){if(i=="cell"||i=="header_cell")s=he.create(o,r.from);else if(i=="row"){const a=o.resolve(r.from+1);s=he.rowSelection(a,a)}else if(!n){const a=we.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];s=he.create(o,l+1,c)}}else r instanceof Y&&qy(r)?s=Y.create(o,r.from):r instanceof Y&&Jy(r)&&(s=Y.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var Xy=new ve("fix-tables");function Hu(t,e,n,r){const o=t.childCount,s=e.childCount;e:for(let i=0,a=0;i<s;i++){const l=e.child(i);for(let c=a,d=Math.min(o,i+3);c<d;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<o&&t.child(a).sameMarkup(l)?Hu(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function ju(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=Qy(t,o,s,n))};return e?e.doc!=t.doc&&Hu(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Qy(t,e,n,r){const o=we.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let l=0;l<o.height;l++)s.push(0);for(let l=0;l<o.problems.length;l++){const c=o.problems[l];if(c.type=="collision"){const d=e.nodeAt(c.pos);if(!d)continue;const f=d.attrs;for(let h=0;h<f.rowspan;h++)s[c.row+h]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Ln(f,f.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const d=e.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const d=e.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const d=r.mapping.map(n);r.delete(d,d+e.nodeSize)}}let i,a;for(let l=0;l<s.length;l++)s[l]&&(i==null&&(i=l),a=l);for(let l=0,c=n+1;l<o.height;l++){const d=e.child(l),f=c+d.nodeSize,h=s[l];if(h>0){let m="cell";d.firstChild&&(m=d.firstChild.type.spec.tableRole);const y=[];for(let E=0;E<h;E++){const _=Ge(t.schema)[m].createAndFill();_&&y.push(_)}const w=(l==0||i==l-1)&&a==l?c+1:f-1;r.insert(r.mapping.map(w),y)}c=f}return r.setMeta(Xy,{fixTables:!0})}function Tt(t){const e=t.selection,n=jo(t),r=n.node(-1),o=n.start(-1),s=we.get(r);return{...e instanceof he?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function Uu(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;Wy(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let i=0;i<e.height;i++){const a=i*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,zu(c.attrs,o-e.colCount(l))),i+=c.attrs.rowspan-1}else{const l=s==null?Ge(r.type.schema).cell:r.nodeAt(e.map[a+s]).type,c=e.positionAt(i,o,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function Zy(t,e){if(!wt(t))return!1;if(e){const n=Tt(t);e(Uu(t.tr,n,n.left))}return!0}function e1(t,e){if(!wt(t))return!1;if(e){const n=Tt(t);e(Uu(t.tr,n,n.right))}return!0}function t1(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let i=0;i<e.height;){const a=i*e.width+o,l=e.map[a],c=n.nodeAt(l),d=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(s).map(r+l),null,Ln(d,o-e.colCount(l)));else{const f=t.mapping.slice(s).map(r+l);t.delete(f,f+c.nodeSize)}i+=d.rowspan}}function n1(t,e){if(!wt(t))return!1;if(e){const n=Tt(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;t1(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=we.get(s)}e(r)}return!0}function r1(t,e,n){var r;const o=Ge(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function Wu(t,{map:e,tableStart:n,table:r},o){var s;let i=n;for(let c=0;c<o;c++)i+=r.child(c).nodeSize;const a=[];let l=o>0?-1:0;r1(e,r,o+l)&&(l=o==0||o==e.height?null:0);for(let c=0,d=e.width*o;c<e.width;c++,d++)if(o>0&&o<e.height&&e.map[d]==e.map[d-e.width]){const f=e.map[d],h=r.nodeAt(f).attrs;t.setNodeMarkup(n+f,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{const f=l==null?Ge(r.type.schema).cell:(s=r.nodeAt(e.map[d+l*e.width]))==null?void 0:s.type,h=f?.createAndFill();h&&a.push(h)}return t.insert(i,Ge(r.type.schema).row.create(null,a)),t}function o1(t,e){if(!wt(t))return!1;if(e){const n=Tt(t);e(Wu(t.tr,n,n.top))}return!0}function s1(t,e){if(!wt(t))return!1;if(e){const n=Tt(t);e(Wu(t.tr,n,n.bottom))}return!0}function i1(t,{map:e,table:n,tableStart:r},o){let s=0;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;const i=s+n.child(o).nodeSize,a=t.mapping.maps.length;t.delete(s+r,i+r);const l=new Set;for(let c=0,d=o*e.width;c<e.width;c++,d++){const f=e.map[d];if(!l.has(f)){if(l.add(f),o>0&&f==e.map[d-e.width]){const h=n.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(o<e.height&&f==e.map[d+e.width]){const h=n.nodeAt(f),m=h.attrs,y=h.type.create({...m,rowspan:h.attrs.rowspan-1},h.content),w=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(a).map(r+w),y),c+=m.colspan-1}}}}function a1(t,e){if(!wt(t))return!1;if(e){const n=Tt(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;i1(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=we.get(n.table)}e(r)}return!0}function Ku(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function l1({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,i=(r.bottom-1)*t+r.left,a=o+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[a]==n[a+1])return!0;s+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[i]==n[i+t])return!0;o++,i++}return!1}function Gu(t,e){const n=t.selection;if(!(n instanceof he)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Tt(t),{map:o}=r;if(l1(o,r))return!1;if(e){const s=t.tr,i={};let a=I.empty,l,c;for(let d=r.top;d<r.bottom;d++)for(let f=r.left;f<r.right;f++){const h=o.map[d*o.width+f],m=r.table.nodeAt(h);if(!(i[h]||!m))if(i[h]=!0,l==null)l=h,c=m;else{Ku(m)||(a=a.append(m.content));const y=s.mapping.map(h+r.tableStart);s.delete(y,y+m.nodeSize)}}if(l==null||c==null)return!0;if(s.setNodeMarkup(l+r.tableStart,null,{...zu(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const d=l+1+c.content.size,f=Ku(c)?l+1:d;s.replaceWith(f+r.tableStart,d+r.tableStart,a)}s.setSelection(new he(s.doc.resolve(l+r.tableStart))),e(s)}return!0}function qu(t,e){const n=Ge(t.schema);return c1(({node:r})=>n[r.type.spec.tableRole])(t,e)}function c1(t){return(e,n)=>{var r;const o=e.selection;let s,i;if(o instanceof he){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{if(s=Hy(o.$from),!s)return!1;i=(r=sr(o.$from))==null?void 0:r.pos}if(s==null||i==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let a=s.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const d=Tt(e),f=e.tr;for(let m=0;m<d.right-d.left;m++)l.push(c?{...a,colwidth:c&&c[m]?[c[m]]:null}:a);let h;for(let m=d.top;m<d.bottom;m++){let y=d.map.positionAt(m,d.left,d.table);m==d.top&&(y+=s.nodeSize);for(let w=d.left,E=0;w<d.right;w++,E++)w==d.left&&m==d.top||f.insert(h=f.mapping.map(y+d.tableStart,1),t({node:s,row:m,col:w}).createAndFill(l[E]))}f.setNodeMarkup(i,t({node:s,row:d.top,col:d.left}),l[0]),o instanceof he&&f.setSelection(new he(f.doc.resolve(o.$anchorCell.pos),h?f.doc.resolve(h):void 0)),n(f)}return!0}}function d1(t,e){return function(n,r){if(!wt(n))return!1;const o=jo(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof he?n.selection.forEachCell((i,a)=>{i.attrs[t]!==e&&s.setNodeMarkup(a,null,{...i.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function u1(t){return function(e,n){if(!wt(e))return!1;if(n){const r=Ge(e.schema),o=Tt(e),s=e.tr,i=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=i.map(l=>o.table.nodeAt(l));for(let l=0;l<i.length;l++)a[l].type==r.header_cell&&s.setNodeMarkup(o.tableStart+i[l],r.cell,a[l].attrs);if(s.steps.length==0)for(let l=0;l<i.length;l++)s.setNodeMarkup(o.tableStart+i[l],r.header_cell,a[l].attrs);n(s)}return!0}}function Ju(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function Dr(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?u1(t):function(n,r){if(!wt(n))return!1;if(r){const o=Ge(n.schema),s=Tt(n),i=n.tr,a=Ju("row",s,o),l=Ju("column",s,o),d=(t==="column"?a:t==="row"?l:!1)?1:0,f=t=="column"?{left:0,top:d,right:1,bottom:s.map.height}:t=="row"?{left:d,top:0,right:s.map.width,bottom:1}:s,h=t=="column"?l?o.cell:o.header_cell:t=="row"?a?o.cell:o.header_cell:o.cell;s.map.cellsInRect(f).forEach(m=>{const y=m+s.tableStart,w=i.doc.nodeAt(y);w&&i.setNodeMarkup(y,h,w.attrs)}),r(i)}return!0}}Dr("row",{useDeprecatedLogic:!0}),Dr("column",{useDeprecatedLogic:!0});var f1=Dr("cell",{useDeprecatedLogic:!0});function h1(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),i=s.lastChild;if(i)return o-1-i.nodeSize;o-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function Yu(t){return function(e,n){if(!wt(e))return!1;const r=h1(jo(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Y.between(o,Uy(o))).scrollIntoView())}return!0}}function p1(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Uo(t,e){const n=t.selection;if(!(n instanceof he))return!1;if(e){const r=t.tr,o=Ge(t.schema).cell.createAndFill().content;n.forEachCell((s,i)=>{s.content.eq(o)||r.replace(r.mapping.map(i+1),r.mapping.map(i+s.nodeSize-1),new H(o,0,0))}),r.docChanged&&e(r)}return!0}function m1(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),s=o.type.spec.tableRole,i=o.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const d=l?0:Math.max(0,n-1),f=l<e.childCount-1?0:Math.max(0,r-1);(d||f)&&(c=ia(Ge(i).row,new H(c,d,f)).content),a.push(c)}else if(s=="cell"||s=="header_cell")a.push(n||r?ia(Ge(i).row,new H(e,n,r)).content:e);else return null;return g1(i,a)}function g1(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let i=s.childCount-1;i>=0;i--){const{rowspan:a,colspan:l}=s.child(i).attrs;for(let c=o;c<o+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(I.empty),n[o]<r){const s=Ge(t).cell.createAndFill(),i=[];for(let a=n[o];a<r;a++)i.push(s);e[o]=e[o].append(I.from(i))}return{height:e.length,width:r,rows:e}}function ia(t,e){const n=t.createAndFill();return new si(n).replace(0,n.content.size,e).doc}function b1({width:t,height:e,rows:n},r,o){if(t!=r){const s=[],i=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let d=s[a]||0,f=0;d<r;f++){let h=l.child(f%l.childCount);d+h.attrs.colspan>r&&(h=h.type.createChecked(Ln(h.attrs,h.attrs.colspan,d+h.attrs.colspan-r),h.content)),c.push(h),d+=h.attrs.colspan;for(let m=1;m<h.attrs.rowspan;m++)s[a+m]=(s[a+m]||0)+h.attrs.colspan}i.push(I.from(c))}n=i,t=r}if(e!=o){const s=[];for(let i=0,a=0;i<o;i++,a++){const l=[],c=n[a%e];for(let d=0;d<c.childCount;d++){let f=c.child(d);i+f.attrs.rowspan>o&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,o-f.attrs.rowspan)},f.content)),l.push(f)}s.push(I.from(l))}n=s,e=o}return{width:t,height:e,rows:n}}function y1(t,e,n,r,o,s,i){const a=t.doc.type.schema,l=Ge(a);let c,d;if(o>e.width)for(let f=0,h=0;f<e.height;f++){const m=n.child(f);h+=m.nodeSize;const y=[];let w;m.lastChild==null||m.lastChild.type==l.cell?w=c||(c=l.cell.createAndFill()):w=d||(d=l.header_cell.createAndFill());for(let E=e.width;E<o;E++)y.push(w);t.insert(t.mapping.slice(i).map(h-1+r),y)}if(s>e.height){const f=[];for(let y=0,w=(e.height-1)*e.width;y<Math.max(e.width,o);y++){const E=y>=e.width?!1:n.nodeAt(e.map[w+y]).type==l.header_cell;f.push(E?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const h=l.row.create(null,I.from(f)),m=[];for(let y=e.height;y<s;y++)m.push(h);t.insert(t.mapping.slice(i).map(r+n.nodeSize-2),m)}return!!(c||d)}function Xu(t,e,n,r,o,s,i,a){if(i==0||i==e.height)return!1;let l=!1;for(let c=o;c<s;c++){const d=i*e.width+c,f=e.map[d];if(e.map[d-e.width]==f){l=!0;const h=n.nodeAt(f),{top:m,left:y}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...h.attrs,rowspan:i-m}),t.insert(t.mapping.slice(a).map(e.positionAt(i,y,n)),h.type.createAndFill({...h.attrs,rowspan:m+h.attrs.rowspan-i})),c+=h.attrs.colspan-1}}return l}function Qu(t,e,n,r,o,s,i,a){if(i==0||i==e.width)return!1;let l=!1;for(let c=o;c<s;c++){const d=c*e.width+i,f=e.map[d];if(e.map[d-1]==f){l=!0;const h=n.nodeAt(f),m=e.colCount(f),y=t.mapping.slice(a).map(f+r);t.setNodeMarkup(y,null,Ln(h.attrs,i-m,h.attrs.colspan-(i-m))),t.insert(y+h.nodeSize,h.type.createAndFill(Ln(h.attrs,0,i-m))),c+=h.attrs.rowspan-1}}return l}function Zu(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let i=we.get(s);const{top:a,left:l}=r,c=l+o.width,d=a+o.height,f=t.tr;let h=0;function m(){if(s=n?f.doc.nodeAt(n-1):f.doc,!s)throw new Error("No table found");i=we.get(s),h=f.mapping.maps.length}y1(f,i,s,n,c,d,h)&&m(),Xu(f,i,s,n,l,c,a,h)&&m(),Xu(f,i,s,n,l,c,d,h)&&m(),Qu(f,i,s,n,a,d,l,h)&&m(),Qu(f,i,s,n,a,d,c,h)&&m();for(let y=a;y<d;y++){const w=i.positionAt(y,l,s),E=i.positionAt(y,c,s);f.replace(f.mapping.slice(h).map(w+n),f.mapping.slice(h).map(E+n),new H(o.rows[y-a],0,0))}m(),f.setSelection(new he(f.doc.resolve(n+i.positionAt(a,l,s)),f.doc.resolve(n+i.positionAt(d-1,c-1,s)))),e(f)}var k1=Di({ArrowLeft:Ko("horiz",-1),ArrowRight:Ko("horiz",1),ArrowUp:Ko("vert",-1),ArrowDown:Ko("vert",1),"Shift-ArrowLeft":Go("horiz",-1),"Shift-ArrowRight":Go("horiz",1),"Shift-ArrowUp":Go("vert",-1),"Shift-ArrowDown":Go("vert",1),Backspace:Uo,"Mod-Backspace":Uo,Delete:Uo,"Mod-Delete":Uo});function Wo(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ko(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof he)return Wo(n,r,X.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const i=ef(o,t,e);if(i==null)return!1;if(t=="horiz")return Wo(n,r,X.near(n.doc.resolve(s.head+e),e));{const a=n.doc.resolve(i),l=$u(a,t,e);let c;return l?c=X.near(l,1):e<0?c=X.near(n.doc.resolve(a.before(-1)),-1):c=X.near(n.doc.resolve(a.after(-1)),1),Wo(n,r,c)}}}function Go(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let i;if(s instanceof he)i=s;else{const l=ef(o,t,e);if(l==null)return!1;i=new he(n.doc.resolve(l))}const a=$u(i.$headCell,t,e);return a?Wo(n,r,new he(i.$anchorCell,a)):!1}}function w1(t,e){const n=t.state.doc,r=sr(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new he(r))),!0):!1}function _1(t,e,n){if(!wt(t.state))return!1;let r=m1(n);const o=t.state.selection;if(o instanceof he){r||(r={width:1,height:1,rows:[I.from(ia(Ge(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=we.get(s).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=b1(r,a.right-a.left,a.bottom-a.top),Zu(t.state,t.dispatch,i,a,r),!0}else if(r){const s=jo(t.state),i=s.start(-1);return Zu(t.state,t.dispatch,i,we.get(s.node(-1)).findCell(s.pos-i),r),!0}else return!1}function E1(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=tf(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof he)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=sr(t.state.selection.$anchor))!=null&&((n=aa(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(l,c){let d=aa(t,c);const f=ln.getState(t.state)==null;if(!d||!sa(l,d))if(f)d=l;else return;const h=new he(l,d);if(f||!t.state.selection.eq(h)){const m=t.state.tr.setSelection(h);f&&m.setMeta(ln,l.pos),t.dispatch(m)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",a),ln.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ln,-1))}function a(l){const c=l,d=ln.getState(t.state);let f;if(d!=null)f=t.state.doc.resolve(d);else if(tf(t,c.target)!=r&&(f=aa(t,e),!f))return i();f&&s(f,c)}t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",a)}function ef(t,e,n){if(!(t.state.selection instanceof Y))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const a=r.before(o),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function tf(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function aa(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?sr(t.state.doc.resolve(n.pos)):null}var C1=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),la(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,la(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function la(t,e,n,r,o,s){var i;let a=0,l=!0,c=e.firstChild;const d=t.firstChild;if(d){for(let f=0,h=0;f<d.childCount;f++){const{colspan:m,colwidth:y}=d.child(f).attrs;for(let w=0;w<m;w++,h++){const E=o==h?s:y&&y[w],_=E?E+"px":"";if(a+=E||r,E||(l=!1),c)c.style.width!=_&&(c.style.width=_),c=c.nextSibling;else{const x=document.createElement("col");x.style.width=_,e.appendChild(x)}}}for(;c;){const f=c.nextSibling;(i=c.parentNode)==null||i.removeChild(c),c=f}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var at=new ve("tableColumnResizing");function v1({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=C1,lastColumnResizable:o=!0}={}){const s=new ge({key:at,state:{init(i,a){var l,c;const d=(c=(l=s.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,f=Ge(a.schema).table.name;return r&&d&&(d[f]=(h,m)=>new r(h,n,m)),new S1(-1,!1)},apply(i,a){return a.apply(i)}},props:{attributes:i=>{const a=at.getState(i);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(i,a)=>{T1(i,a,t,o)},mouseleave:i=>{x1(i)},mousedown:(i,a)=>{N1(i,a,e,n)}},decorations:i=>{const a=at.getState(i);if(a&&a.activeHandle>-1)return I1(i,a.activeHandle)},nodeViews:{}}});return s}var S1=class Ks{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(at);if(r&&r.setHandle!=null)return new Ks(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Ks(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return oa(e.doc.resolve(o))||(o=-1),new Ks(o,n.dragging)}return n}};function T1(t,e,n,r){if(!t.editable)return;const o=at.getState(t.state);if(o&&!o.dragging){const s=A1(e.target);let i=-1;if(s){const{left:a,right:l}=s.getBoundingClientRect();e.clientX-a<=n?i=nf(t,e,"left",n):l-e.clientX<=n&&(i=nf(t,e,"right",n))}if(i!=o.activeHandle){if(!r&&i!==-1){const a=t.state.doc.resolve(i),l=a.node(-1),c=we.get(l),d=a.start(-1);if(c.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==c.width-1)return}of(t,i)}}}function x1(t){if(!t.editable)return;const e=at.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&of(t,-1)}function N1(t,e,n,r){var o;if(!t.editable)return!1;const s=(o=t.dom.ownerDocument.defaultView)!=null?o:window,i=at.getState(t.state);if(!i||i.activeHandle==-1||i.dragging)return!1;const a=t.state.doc.nodeAt(i.activeHandle),l=M1(t,i.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(at,{setDragging:{startX:e.clientX,startWidth:l}}));function c(f){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",d);const h=at.getState(t.state);h?.dragging&&(O1(t,h.activeHandle,rf(h.dragging,f,n)),t.dispatch(t.state.tr.setMeta(at,{setDragging:null})))}function d(f){if(!f.which)return c(f);const h=at.getState(t.state);if(h&&h.dragging){const m=rf(h.dragging,f,n);sf(t,h.activeHandle,m,r)}}return sf(t,i.activeHandle,l,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",d),e.preventDefault(),!0}function M1(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const s=t.domAtPos(e);let a=s.node.childNodes[s.offset].offsetWidth,l=n;if(r)for(let c=0;c<n;c++)r[c]&&(a-=r[c],l--);return a/l}function A1(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function nf(t,e,n,r){const o=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!s)return-1;const{pos:i}=s,a=sr(t.state.doc.resolve(i));if(!a)return-1;if(n=="right")return a.pos;const l=we.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function rf(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function of(t,e){t.dispatch(t.state.tr.setMeta(at,{setHandle:e}))}function O1(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=we.get(o),i=r.start(-1),a=s.colCount(r.pos-i)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<s.height;c++){const d=c*s.width+a;if(c&&s.map[d]==s.map[d-s.width])continue;const f=s.map[d],h=o.nodeAt(f).attrs,m=h.colspan==1?0:a-s.colCount(f);if(h.colwidth&&h.colwidth[m]==n)continue;const y=h.colwidth?h.colwidth.slice():L1(h.colspan);y[m]=n,l.setNodeMarkup(i+f,null,{...h,colwidth:y})}l.docChanged&&t.dispatch(l)}function sf(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),i=o.start(-1),a=we.get(s).colCount(o.pos-i)+o.nodeAfter.attrs.colspan-1;let l=t.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&la(s,l.firstChild,l,r,a,n)}function L1(t){return Array(t).fill(0)}function I1(t,e){var n;const r=[],o=t.doc.resolve(e),s=o.node(-1);if(!s)return fe.empty;const i=we.get(s),a=o.start(-1),l=i.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){const d=l+c*i.width;if((l==i.width-1||i.map[d]!=i.map[d+1])&&(c==0||i.map[d]!=i.map[d-i.width])){const f=i.map[d],h=a+f+s.nodeAt(f).nodeSize-1,m=document.createElement("div");m.className="column-resize-handle",(n=at.getState(t))!=null&&n.dragging&&r.push(Re.node(a+f,a+f+s.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(Re.widget(h,m))}}return fe.create(t.doc,r)}function P1({allowTableNodeSelection:t=!1}={}){return new ge({key:ln,state:{init(){return null},apply(e,n){const r=e.getMeta(ln);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:Gy,handleDOMEvents:{mousedown:E1},createSelectionBetween(e){return ln.getState(e.state)!=null?e.state.selection:null},handleTripleClick:w1,handleKeyDown:k1,handlePaste:_1},appendTransaction(e,n,r){return Yy(r,ju(r,n),t)}})}var R1=De.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var e,n;const r=t.getAttribute("colwidth"),o=r?r.split(",").map(s=>parseInt(s,10)):null;if(!o){const s=(e=t.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),i=Array.from(((n=t.parentElement)==null?void 0:n.children)||[]).indexOf(t);if(i&&i>-1&&s&&s[i]){const a=s[i].getAttribute("width");return a?[parseInt(a,10)]:null}}return o}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",ae(this.options.HTMLAttributes,t),0]}}),D1=De.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",ae(this.options.HTMLAttributes,t),0]}}),B1=De.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",ae(this.options.HTMLAttributes,t),0]}});function ca(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function af(t,e,n,r,o,s){var i;let a=0,l=!0,c=e.firstChild;const d=t.firstChild;if(d!==null)for(let f=0,h=0;f<d.childCount;f+=1){const{colspan:m,colwidth:y}=d.child(f).attrs;for(let w=0;w<m;w+=1,h+=1){const E=o===h?s:y&&y[w],_=E?`${E}px`:"";if(a+=E||r,E||(l=!1),c){if(c.style.width!==_){const[x,A]=ca(r,E);c.style.setProperty(x,A)}c=c.nextSibling}else{const x=document.createElement("col"),[A,u]=ca(r,E);x.style.setProperty(A,u),e.appendChild(x)}}}for(;c;){const f=c.nextSibling;(i=c.parentNode)==null||i.removeChild(c),c=f}l?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var F1=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),af(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,af(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function V1(t,e,n,r){let o=0,s=!0;const i=[],a=t.firstChild;if(!a)return{};for(let f=0,h=0;f<a.childCount;f+=1){const{colspan:m,colwidth:y}=a.child(f).attrs;for(let w=0;w<m;w+=1,h+=1){const E=n===h?r:y&&y[w];o+=E||e,E||(s=!1);const[_,x]=ca(e,E);i.push(["col",{style:`${_}: ${x}`}])}}const l=s?`${o}px`:"",c=s?"":`${o}px`;return{colgroup:["colgroup",{},...i],tableWidth:l,tableMinWidth:c}}function lf(t,e){return t.createAndFill()}function $1(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function z1(t,e,n,r,o){const s=$1(t),i=[],a=[];for(let c=0;c<n;c+=1){const d=lf(s.cell);if(d&&a.push(d),r){const f=lf(s.header_cell);f&&i.push(f)}}const l=[];for(let c=0;c<e;c+=1)l.push(s.row.createChecked(null,r&&c===0?i:a));return s.table.createChecked(null,l)}function H1(t){return t instanceof he}var qo=({editor:t})=>{const{selection:e}=t.state;if(!H1(e))return!1;let n=0;const r=tu(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},j1=De.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:F1,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=V1(t,this.options.cellMinWidth);return["table",ae(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const i=z1(s.schema,t,e,n);if(o){const a=r.selection.from+1;r.replaceSelectionWith(i).scrollIntoView().setSelection(Y.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Zy(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>e1(t,e),deleteColumn:()=>({state:t,dispatch:e})=>n1(t,e),addRowBefore:()=>({state:t,dispatch:e})=>o1(t,e),addRowAfter:()=>({state:t,dispatch:e})=>s1(t,e),deleteRow:()=>({state:t,dispatch:e})=>a1(t,e),deleteTable:()=>({state:t,dispatch:e})=>p1(t,e),mergeCells:()=>({state:t,dispatch:e})=>Gu(t,e),splitCell:()=>({state:t,dispatch:e})=>qu(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Dr("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Dr("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>f1(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Gu(t,e)?!0:qu(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>d1(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Yu(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Yu(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&ju(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=he.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:qo,"Mod-Backspace":qo,Delete:qo,"Mod-Delete":qo}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[v1({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],P1({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ie(q(t,"tableRole",e))}}}),cf=le.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(j1.configure(this.options.table)),this.options.tableCell!==!1&&t.push(R1.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(D1.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(B1.configure(this.options.tableRow)),t}}),U1=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,W1=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,df=kt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[On({find:U1,type:this.type})]},addPasteRules(){return[an({find:W1,type:this.type})]}}),uf=kt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),ff=kt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),Jo=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},K1=/^\s*>\s$/,G1=De.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Jo("blockquote",{...ae(this.options.HTMLAttributes,t),children:Jo("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[or({find:K1,type:this.type})]}}),q1=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,J1=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Y1=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,X1=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Q1=kt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Jo("strong",{...ae(this.options.HTMLAttributes,t),children:Jo("slot",{})})},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[On({find:q1,type:this.type}),On({find:Y1,type:this.type})]},addPasteRules(){return[an({find:J1,type:this.type}),an({find:X1,type:this.type})]}}),Z1=/(^|[^`])`([^`]+)`(?!`)$/,ek=/(^|[^`])`([^`]+)`(?!`)/g,tk=kt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[On({find:Z1,type:this.type})]},addPasteRules(){return[an({find:ek,type:this.type})]}}),nk=/^```([a-z]+)?[\s\n]$/,rk=/^~~~([a-z]+)?[\s\n]$/,ok=De.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ae(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{if(!this.options.enableTabIndentation)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(r.parent.type!==this.type)return!1;const s=" ".repeat(this.options.tabSize);return o?t.commands.insertContent(s):t.commands.command(({tr:i})=>{const{from:a,to:l}=n,f=e.doc.textBetween(a,l,`
|
|
86
|
+
`,`
|
|
87
|
+
`).split(`
|
|
88
|
+
`).map(h=>s+h).join(`
|
|
89
|
+
`);return i.replaceWith(a,l,e.schema.text(f)),!0})},"Shift-Tab":({editor:t})=>{if(!this.options.enableTabIndentation)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;return r.parent.type!==this.type?!1:o?t.commands.command(({tr:s})=>{var i;const{pos:a}=r,l=r.start(),c=r.end(),f=e.doc.textBetween(l,c,`
|
|
90
|
+
`,`
|
|
91
|
+
`).split(`
|
|
92
|
+
`);let h=0,m=0;const y=a-l;for(let u=0;u<f.length;u+=1){if(m+f[u].length>=y){h=u;break}m+=f[u].length+1}const E=((i=f[h].match(/^ */))==null?void 0:i[0])||"",_=Math.min(E.length,this.options.tabSize);if(_===0)return!0;let x=l;for(let u=0;u<h;u+=1)x+=f[u].length+1;return s.delete(x,x+_),a-x<=_&&s.setSelection(Y.create(s.doc,x)),!0}):t.commands.command(({tr:s})=>{const{from:i,to:a}=n,d=e.doc.textBetween(i,a,`
|
|
93
|
+
`,`
|
|
94
|
+
`).split(`
|
|
95
|
+
`).map(f=>{var h;const m=((h=f.match(/^ */))==null?void 0:h[0])||"",y=Math.min(m.length,this.options.tabSize);return f.slice(y)}).join(`
|
|
96
|
+
`);return s.replaceWith(i,a,e.schema.text(d)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
|
|
97
|
+
|
|
98
|
+
`);return!s||!i?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const a=o.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(X.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[ta({find:nk,type:this.type,getAttributes:t=>({language:t[1]})}),ta({find:rk,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ge({key:new ve("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o?.mode;if(!n||!s)return!1;const{tr:i,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
|
|
99
|
+
`));return i.replaceSelectionWith(this.type.create({language:s},l)),i.selection.$from.parent.type!==this.type&&i.setSelection(Y.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),sk=De.create({name:"doc",topNode:!0,content:"block+"}),ik=De.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ae(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
100
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:a}=r.extensionManager,l=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&i){const f=l.filter(h=>a.includes(h.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),hf=De.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ae(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>ta({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),ak=De.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ae(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!xy(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,o=t();return gu(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:i})=>{var a;if(i){const{$to:l}=s.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(Y.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(J.create(s.doc,l.pos)):s.setSelection(Y.create(s.doc,l.pos));else{const d=(a=l.parent.type.contentMatch.defaultType)==null?void 0:a.create();d&&(s.insert(c,d),s.setSelection(Y.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Pu({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ck=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,dk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,uk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,fk=kt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[On({find:lk,type:this.type}),On({find:dk,type:this.type})]},addPasteRules(){return[an({find:ck,type:this.type}),an({find:uk,type:this.type})]}});const hk="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",pk="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",da="numeric",ua="ascii",fa="alpha",Br="asciinumeric",Fr="alphanumeric",ha="domain",pf="emoji",mk="scheme",gk="slashscheme",pa="whitespace";function bk(t,e){return t in e||(e[t]=[]),e[t]}function In(t,e,n){e[da]&&(e[Br]=!0,e[Fr]=!0),e[ua]&&(e[Br]=!0,e[fa]=!0),e[Br]&&(e[Fr]=!0),e[fa]&&(e[Fr]=!0),e[Fr]&&(e[ha]=!0),e[pf]&&(e[ha]=!0);for(const r in e){const o=bk(r,n);o.indexOf(t)<0&&o.push(t)}}function yk(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function nt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}nt.groups={},nt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],s=e.jr[r][1];if(s&&o.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||nt.groups;let o;return e&&e.j?o=e:(o=new nt(e),n&&r&&In(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const s=t.length;if(!s)return o;for(let i=0;i<s-1;i++)o=o.tt(t[i]);return o.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||nt.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const s=e;let i,a=o.go(t);if(a?(i=new nt,Object.assign(i.j,a.j),i.jr.push.apply(i.jr,a.jr),i.jd=a.jd,i.t=a.t):i=new nt,s){if(r)if(i.t&&typeof i.t=="string"){const l=Object.assign(yk(i.t,r),n);In(s,l,r)}else n&&In(s,n,r);i.t=s}return o.j[t]=i,i}};const ee=(t,e,n,r,o)=>t.ta(e,n,r,o),_e=(t,e,n,r,o)=>t.tr(e,n,r,o),mf=(t,e,n,r,o)=>t.ts(e,n,r,o),$=(t,e,n,r,o)=>t.tt(e,n,r,o),$t="WORD",ma="UWORD",gf="ASCIINUMERICAL",bf="ALPHANUMERICAL",Vr="LOCALHOST",ga="TLD",ba="UTLD",Yo="SCHEME",ir="SLASH_SCHEME",ya="NUM",ka="WS",wa="NL",$r="OPENBRACE",zr="CLOSEBRACE",Xo="OPENBRACKET",Qo="CLOSEBRACKET",Zo="OPENPAREN",es="CLOSEPAREN",ts="OPENANGLEBRACKET",ns="CLOSEANGLEBRACKET",rs="FULLWIDTHLEFTPAREN",ss="FULLWIDTHRIGHTPAREN",is="LEFTCORNERBRACKET",as="RIGHTCORNERBRACKET",ls="LEFTWHITECORNERBRACKET",cs="RIGHTWHITECORNERBRACKET",ds="FULLWIDTHLESSTHAN",us="FULLWIDTHGREATERTHAN",fs="AMPERSAND",hs="APOSTROPHE",ps="ASTERISK",cn="AT",ms="BACKSLASH",gs="BACKTICK",bs="CARET",dn="COLON",_a="COMMA",ys="DOLLAR",xt="DOT",ks="EQUALS",Ea="EXCLAMATION",ht="HYPHEN",Hr="PERCENT",ws="PIPE",_s="PLUS",Es="POUND",jr="QUERY",Ca="QUOTE",yf="FULLWIDTHMIDDLEDOT",va="SEMI",Nt="SLASH",Ur="TILDE",Cs="UNDERSCORE",kf="EMOJI",vs="SYM";var wf=Object.freeze({__proto__:null,ALPHANUMERICAL:bf,AMPERSAND:fs,APOSTROPHE:hs,ASCIINUMERICAL:gf,ASTERISK:ps,AT:cn,BACKSLASH:ms,BACKTICK:gs,CARET:bs,CLOSEANGLEBRACKET:ns,CLOSEBRACE:zr,CLOSEBRACKET:Qo,CLOSEPAREN:es,COLON:dn,COMMA:_a,DOLLAR:ys,DOT:xt,EMOJI:kf,EQUALS:ks,EXCLAMATION:Ea,FULLWIDTHGREATERTHAN:us,FULLWIDTHLEFTPAREN:rs,FULLWIDTHLESSTHAN:ds,FULLWIDTHMIDDLEDOT:yf,FULLWIDTHRIGHTPAREN:ss,HYPHEN:ht,LEFTCORNERBRACKET:is,LEFTWHITECORNERBRACKET:ls,LOCALHOST:Vr,NL:wa,NUM:ya,OPENANGLEBRACKET:ts,OPENBRACE:$r,OPENBRACKET:Xo,OPENPAREN:Zo,PERCENT:Hr,PIPE:ws,PLUS:_s,POUND:Es,QUERY:jr,QUOTE:Ca,RIGHTCORNERBRACKET:as,RIGHTWHITECORNERBRACKET:cs,SCHEME:Yo,SEMI:va,SLASH:Nt,SLASH_SCHEME:ir,SYM:vs,TILDE:Ur,TLD:ga,UNDERSCORE:Cs,UTLD:ba,UWORD:ma,WORD:$t,WS:ka});const zt=/[a-z]/,Wr=new RegExp("\\p{L}","u"),Sa=new RegExp("\\p{Emoji}","u"),Ht=/\d/,Ta=/\s/,_f="\r",xa=`
|
|
101
|
+
`,kk="️",wk="",Na="";let Ss=null,Ts=null;function _k(t=[]){const e={};nt.groups=e;const n=new nt;Ss==null&&(Ss=Cf(hk)),Ts==null&&(Ts=Cf(pk)),$(n,"'",hs),$(n,"{",$r),$(n,"}",zr),$(n,"[",Xo),$(n,"]",Qo),$(n,"(",Zo),$(n,")",es),$(n,"<",ts),$(n,">",ns),$(n,"(",rs),$(n,")",ss),$(n,"「",is),$(n,"」",as),$(n,"『",ls),$(n,"』",cs),$(n,"<",ds),$(n,">",us),$(n,"&",fs),$(n,"*",ps),$(n,"@",cn),$(n,"`",gs),$(n,"^",bs),$(n,":",dn),$(n,",",_a),$(n,"$",ys),$(n,".",xt),$(n,"=",ks),$(n,"!",Ea),$(n,"-",ht),$(n,"%",Hr),$(n,"|",ws),$(n,"+",_s),$(n,"#",Es),$(n,"?",jr),$(n,'"',Ca),$(n,"/",Nt),$(n,";",va),$(n,"~",Ur),$(n,"_",Cs),$(n,"\\",ms),$(n,"・",yf);const r=_e(n,Ht,ya,{[da]:!0});_e(r,Ht,r);const o=_e(r,zt,gf,{[Br]:!0}),s=_e(r,Wr,bf,{[Fr]:!0}),i=_e(n,zt,$t,{[ua]:!0});_e(i,Ht,o),_e(i,zt,i),_e(o,Ht,o),_e(o,zt,o);const a=_e(n,Wr,ma,{[fa]:!0});_e(a,zt),_e(a,Ht,s),_e(a,Wr,a),_e(s,Ht,s),_e(s,zt),_e(s,Wr,s);const l=$(n,xa,wa,{[pa]:!0}),c=$(n,_f,ka,{[pa]:!0}),d=_e(n,Ta,ka,{[pa]:!0});$(n,Na,d),$(c,xa,l),$(c,Na,d),_e(c,Ta,d),$(d,_f),$(d,xa),_e(d,Ta,d),$(d,Na,d);const f=_e(n,Sa,kf,{[pf]:!0});$(f,"#"),_e(f,Sa,f),$(f,kk,f);const h=$(f,wk);$(h,"#"),_e(h,Sa,f);const m=[[zt,i],[Ht,o]],y=[[zt,null],[Wr,a],[Ht,s]];for(let w=0;w<Ss.length;w++)un(n,Ss[w],ga,$t,m);for(let w=0;w<Ts.length;w++)un(n,Ts[w],ba,ma,y);In(ga,{tld:!0,ascii:!0},e),In(ba,{utld:!0,alpha:!0},e),un(n,"file",Yo,$t,m),un(n,"mailto",Yo,$t,m),un(n,"http",ir,$t,m),un(n,"https",ir,$t,m),un(n,"ftp",ir,$t,m),un(n,"ftps",ir,$t,m),In(Yo,{scheme:!0,ascii:!0},e),In(ir,{slashscheme:!0,ascii:!0},e),t=t.sort((w,E)=>w[0]>E[0]?1:-1);for(let w=0;w<t.length;w++){const E=t[w][0],x=t[w][1]?{[mk]:!0}:{[gk]:!0};E.indexOf("-")>=0?x[ha]=!0:zt.test(E)?Ht.test(E)?x[Br]=!0:x[ua]=!0:x[da]=!0,mf(n,E,E,x)}return mf(n,"localhost",Vr,{ascii:!0}),n.jd=new nt(vs),{start:n,tokens:Object.assign({groups:e},wf)}}function Ef(t,e){const n=Ek(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let a=t,l=null,c=0,d=null,f=-1,h=-1;for(;i<r&&(l=a.go(n[i]));)a=l,a.accepts()?(f=0,h=0,d=a):f>=0&&(f+=n[i].length,h++),c+=n[i].length,s+=n[i].length,i++;s-=f,i-=h,c-=f,o.push({t:d.t,v:e.slice(s-c,s),s:s-c,e:s})}return o}function Ek(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),s,i=o<55296||o>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(i),r+=i.length}return e}function un(t,e,n,r,o){let s;const i=e.length;for(let a=0;a<i-1;a++){const l=e[a];t.j[l]?s=t.j[l]:(s=new nt(r),s.jr=o.slice(),t.j[l]=s),t=s}return s=new nt(n),s.jr=o.slice(),t.j[e[i-1]]=s,s}function Cf(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let s=0;for(;o.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let i=parseInt(t.substring(r,r+s),10);i>0;i--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Kr={defaultProtocol:"http",events:null,format:vf,formatHref:vf,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ma(t,e=null){let n=Object.assign({},Kr);t&&(n=Object.assign(n,t instanceof Ma?t.o:t));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Ma.prototype={o:Kr,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Kr[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function vf(t){return t}function Sf(t,e){this.t="token",this.v=t,this.tk=e}Sf.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Kr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),s=this.toFormattedString(t),i={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return i.href=r,a&&(i.class=a),l&&(i.target=l),c&&(i.rel=c),d&&Object.assign(i,d),{tagName:o,attributes:i,content:s,eventListeners:f}}};function xs(t,e){class n extends Sf{constructor(o,s){super(o,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Tf=xs("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),xf=xs("text"),Ck=xs("nl"),Ns=xs("url",{isLink:!0,toHref(t=Kr.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Vr&&t[1].t===dn}}),pt=t=>new nt(t);function vk({groups:t}){const e=t.domain.concat([fs,ps,cn,ms,gs,bs,ys,ks,ht,ya,Hr,ws,_s,Es,Nt,vs,Ur,Cs]),n=[hs,dn,_a,xt,Ea,Hr,jr,Ca,va,ts,ns,$r,zr,Qo,Xo,Zo,es,rs,ss,is,as,ls,cs,ds,us],r=[fs,hs,ps,ms,gs,bs,ys,ks,ht,$r,zr,Hr,ws,_s,Es,jr,Nt,vs,Ur,Cs],o=pt(),s=$(o,Ur);ee(s,r,s),ee(s,t.domain,s);const i=pt(),a=pt(),l=pt();ee(o,t.domain,i),ee(o,t.scheme,a),ee(o,t.slashscheme,l),ee(i,r,s),ee(i,t.domain,i);const c=$(i,cn);$(s,cn,c),$(a,cn,c),$(l,cn,c);const d=$(s,xt);ee(d,r,s),ee(d,t.domain,s);const f=pt();ee(c,t.domain,f),ee(f,t.domain,f);const h=$(f,xt);ee(h,t.domain,f);const m=pt(Tf);ee(h,t.tld,m),ee(h,t.utld,m),$(c,Vr,m);const y=$(f,ht);$(y,ht,y),ee(y,t.domain,f),ee(m,t.domain,f),$(m,xt,h),$(m,ht,y);const w=$(m,dn);ee(w,t.numeric,Tf);const E=$(i,ht),_=$(i,xt);$(E,ht,E),ee(E,t.domain,i),ee(_,r,s),ee(_,t.domain,i);const x=pt(Ns);ee(_,t.tld,x),ee(_,t.utld,x),ee(x,t.domain,i),ee(x,r,s),$(x,xt,_),$(x,ht,E),$(x,cn,c);const A=$(x,dn),u=pt(Ns);ee(A,t.numeric,u);const b=pt(Ns),g=pt();ee(b,e,b),ee(b,n,g),ee(g,e,b),ee(g,n,g),$(x,Nt,b),$(u,Nt,b);const k=$(a,dn),C=$(l,dn),T=$(C,Nt),v=$(T,Nt);ee(a,t.domain,i),$(a,xt,_),$(a,ht,E),ee(l,t.domain,i),$(l,xt,_),$(l,ht,E),ee(k,t.domain,b),$(k,Nt,b),$(k,jr,b),ee(v,t.domain,b),ee(v,e,b),$(v,Nt,b);const O=[[$r,zr],[Xo,Qo],[Zo,es],[ts,ns],[rs,ss],[is,as],[ls,cs],[ds,us]];for(let R=0;R<O.length;R++){const[B,D]=O[R],V=$(b,B);$(g,B,V),$(V,D,b);const S=pt(Ns);ee(V,e,S);const P=pt();ee(V,n),ee(S,e,S),ee(S,n,P),ee(P,e,S),ee(P,n,P),$(S,D,b),$(P,D,b)}return $(o,Vr,x),$(o,wa,Ck),{start:o,tokens:wf}}function Sk(t,e,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let a=t,l=null,c=null,d=0,f=null,h=-1;for(;o<r&&!(l=a.go(n[o].t));)i.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(h=0,f=a):h>=0&&h++,o++,d++;if(h<0)o-=d,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(Aa(xf,e,i)),i=[]),o-=h,d-=h;const m=f.t,y=n.slice(o-d,o);s.push(Aa(m,e,y))}}return i.length>0&&s.push(Aa(xf,e,i)),s}function Aa(t,e,n){const r=n[0].s,o=n[n.length-1].e,s=e.slice(r,o);return new t(s,n)}const Tk=typeof console<"u"&&console&&console.warn||(()=>{}),xk="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",me={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Nk(){return nt.groups={},me.scanner=null,me.parser=null,me.tokenQueue=[],me.pluginQueue=[],me.customSchemes=[],me.initialized=!1,me}function Nf(t,e=!1){if(me.initialized&&Tk(`linkifyjs: already initialized - will not register custom scheme "${t}" ${xk}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
115
102
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
116
103
|
2. Cannot start or end with "-"
|
|
117
|
-
3. "-" cannot repeat`);Ae.customSchemes.push([t,e])}function QE(){Ae.scanner=UE(Ae.customSchemes);for(let t=0;t<Ae.tokenQueue.length;t++)Ae.tokenQueue[t][1]({scanner:Ae.scanner});Ae.parser=qE(Ae.scanner.tokens);for(let t=0;t<Ae.pluginQueue.length;t++)Ae.pluginQueue[t][1]({scanner:Ae.scanner,parser:Ae.parser});return Ae.initialized=!0,Ae}function pc(t){return Ae.initialized||QE(),GE(Ae.parser.start,t,Dh(Ae.scanner.start,t))}pc.scan=Dh;function jh(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new dc(n),o=pc(t),i=[];for(let s=0;s<o.length;s++){const a=o[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}function ZE(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function ev(t){return new $e({key:new Ue("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=Yk(n.doc,[...e]);if(n1(a).forEach(({newRange:c})=>{const u=Qk(r.doc,c,m=>m.isTextblock);let f,p;if(u.length>1?(f=u[0],p=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(f=u[0],p=r.doc.textBetween(f.pos,c.to,void 0," ")),f&&p){const m=p.split(" ").filter(E=>E!=="");if(m.length<=0)return!1;const b=m[m.length-1],k=f.pos+p.lastIndexOf(b);if(!b)return!1;const _=pc(b).map(E=>E.toObject(t.defaultProtocol));if(!ZE(_))return!1;_.filter(E=>E.isLink).map(E=>({...E,from:k+E.start+1,to:k+E.end+1})).filter(E=>r.schema.marks.code?!r.doc.rangeHasMark(E.from,E.to,r.schema.marks.code):!0).filter(E=>t.validate(E.value)).filter(E=>t.shouldAutoLink(E.value)).forEach(E=>{_l(E.from,E.to,r.doc).some(N=>N.mark.type===t.type)||s.addMark(E.from,E.to,t.type.create({href:E.href}))})}}),!!s.steps.length)return s}})}function tv(t){return new $e({key:new Ue("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(p=>p.nodeName==="A"))return!1;const l=lp(e.state,t.type.name),c=r.target,u=(o=c?.href)!==null&&o!==void 0?o:l.href,f=(i=c?.target)!==null&&i!==void 0?i:l.target;return c&&u?(window.open(u,f),!0):!1}}})}function nv(t){return new $e({key:new Ue("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=jh(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const rv=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function kr(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(rv,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Uh=ht.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){zh(t);return}zh(t.scheme,t.optionalSlashes)})},onDestroy(){XE()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!kr(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!kr(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!kr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ce(this.options.HTMLAttributes,t),0]:["a",Ce(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!kr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!kr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[jn({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=jh(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!kr(s,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(ev({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!kr(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(tv({type:this.type})),this.options.linkOnPaste&&t.push(nv({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Wh=ht.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=wl(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),Kh=Ke.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),ov=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,qh=ct.create({name:"image",addOptions(){return{inline:!1,allowBase64:!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:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Ce(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[S1({find:ov,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var hc,mc;if(typeof WeakMap<"u"){let t=new WeakMap;hc=e=>t.get(e),mc=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;hc=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},mc=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var Pe=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let i=r+1,s=o+1;for(let a=1;i<this.width&&this.map[e+a]==n;a++)i++;for(let a=1;s<this.height&&this.map[e+this.width*a]==n;a++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?i==0:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:i}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(o,l),right:Math.max(r,a),bottom:Math.max(i,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,!(o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==t){let s=e+t*this.width;const a=(t+1)*this.width;for(;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}}static get(t){return hc(t)||mc(t,iv(t))}};function iv(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=sv(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const f=t.child(c);u++;for(let b=0;;b++){for(;o<r.length&&r[o]!=0;)o++;if(b==f.childCount)break;const k=f.child(b),{colspan:_,rowspan:E,colwidth:N}=k.attrs;for(let A=0;A<E;A++){if(A+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:E-A});break}const d=o+A*e;for(let g=0;g<_;g++){r[d+g]==0?r[d+g]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:_-g});const h=N&&N[g];if(h){const w=(d+g)%e*2,v=s[w];v==null||v!=h&&s[w+1]==1?(s[w]=h,s[w+1]=1):v==h&&s[w+1]++}}}o+=_,u+=k.nodeSize}const p=(c+1)*e;let m=0;for(;o<p;)r[o++]==0&&m++;m&&(i||(i=[])).push({type:"missing",row:c,n:m}),u++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const a=new Pe(e,n,r,i);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&av(a,s,t),a}function sv(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let s=0;s<r;s++){const a=t.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const a=o.child(s);i+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function av(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const u=(o+c)%t.width,f=e[u*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((a||(a=lv(l)))[c]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function lv(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Ze(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var Jn=new Ue("selectingCells");function Zr(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function cv(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Wt(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Ps(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Zr(e.$head)||uv(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function uv(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function gc(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function dv(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function bc(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Gh(t,e,n){const r=t.node(-1),o=Pe.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return s==null?null:t.node(0).resolve(i+s)}function _r(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function Jh(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function fv(t,e,n){const r=Ze(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Se=class An extends ee{constructor(e,n=e){const r=e.node(-1),o=Pe.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),a=e.node(0),l=o.cellsInRect(s).filter(u=>u!=n.pos-i);l.unshift(n.pos-i);const c=l.map(u=>{const f=r.nodeAt(u);if(!f)throw RangeError(`No cell with offset ${u} found`);const p=i+u+1;return new fd(a.resolve(p),a.resolve(p+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(gc(r)&&gc(o)&&bc(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?An.rowSelection(r,o):i&&this.isColSelection()?An.colSelection(r,o):new An(r,o)}return te.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=Pe.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let l=o.top;l<o.bottom;l++){const c=[];for(let u=l*n.width+o.left,f=o.left;f<o.right;f++,u++){const p=n.map[u];if(i[p])continue;i[p]=!0;const m=n.findCell(p);let b=e.nodeAt(p);if(!b)throw RangeError(`No cell with offset ${p} found`);const k=o.left-m.left,_=m.right-o.right;if(k>0||_>0){let E=b.attrs;if(k>0&&(E=_r(E,0,k)),_>0&&(E=_r(E,E.colspan-_,_)),m.left<o.left){if(b=b.type.createAndFill(E),!b)throw RangeError(`Could not create cell with attrs ${JSON.stringify(E)}`)}else b=b.type.create(E,b.content)}if(m.top<o.top||m.bottom>o.bottom){const E={...b.attrs,rowspan:Math.min(m.bottom,o.bottom)-Math.max(m.top,o.top)};m.top<o.top?b=b.type.createAndFill(E):b=b.type.create(E,b.content)}c.push(b)}s.push(e.child(l).copy(V.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new W(V.from(a),1,1)}replace(e,n=W.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:a,$to:l}=o[s],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),s?W.empty:n)}const i=ee.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new W(V.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Pe.get(n),o=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let s=0;s<i.length;s++)e(n.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=Pe.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new An(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Pe.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(o,i)>0)return!1;const s=o+this.$anchorCell.nodeAfter.attrs.colspan,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(e){return e instanceof An&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=Pe.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(n=l.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=l.resolve(i+o.map[o.width*(s.top+1)-1]))),new An(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new An(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new An(e.resolve(n),e.resolve(r))}getBookmark(){return new pv(this.$anchorCell.pos,this.$headCell.pos)}};Se.prototype.visible=!1,ee.jsonID("cell",Se);var pv=class V0{constructor(e,n){this.anchor=e,this.head=n}map(e){return new V0(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&bc(n,r)?new Se(n,r):ee.near(r,1)}};function hv(t){if(!(t.selection instanceof Se))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(lt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Le.create(t.doc,e)}function mv({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function gv({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let o=e.depth;o>0;o--){const i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}return n!==r&&e.parentOffset===0}function bv(t,e,n){const r=(e||t).selection,o=(e||t).doc;let i,s;if(r instanceof Q&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=Se.create(o,r.from);else if(s=="row"){const a=o.resolve(r.from+1);i=Se.rowSelection(a,a)}else if(!n){const a=Pe.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];i=Se.create(o,l+1,c)}}else r instanceof te&&mv(r)?i=te.create(o,r.from):r instanceof te&&gv(r)&&(i=te.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var yv=new Ue("fix-tables");function Yh(t,e,n,r){const o=t.childCount,i=e.childCount;e:for(let s=0,a=0;s<i;s++){const l=e.child(s);for(let c=a,u=Math.min(o,s+3);c<u;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<o&&t.child(a).sameMarkup(l)?Yh(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function Xh(t,e){let n;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(n=wv(t,o,i,n))};return e?e.doc!=t.doc&&Yh(e.doc,t.doc,0,r):t.doc.descendants(r),n}function wv(t,e,n,r){const o=Pe.get(e);if(!o.problems)return r;r||(r=t.tr);const i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){const c=o.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const f=u.attrs;for(let p=0;p<f.rowspan;p++)i[c.row+p]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,_r(f,f.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+e.nodeSize)}}let s,a;for(let l=0;l<i.length;l++)i[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<o.height;l++){const u=e.child(l),f=c+u.nodeSize,p=i[l];if(p>0){let m="cell";u.firstChild&&(m=u.firstChild.type.spec.tableRole);const b=[];for(let _=0;_<p;_++){const E=Ze(t.schema)[m].createAndFill();E&&b.push(E)}const k=(l==0||s==l-1)&&a==l?c+1:f-1;r.insert(r.mapping.map(k),b)}c=f}return r.setMeta(yv,{fixTables:!0})}function sn(t){const e=t.selection,n=Ps(t),r=n.node(-1),o=n.start(-1),i=Pe.get(r);return{...e instanceof Se?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function Qh(t,{map:e,tableStart:n,table:r},o){let i=o>0?-1:0;fv(e,r,o+i)&&(i=o==0||o==e.width?null:0);for(let s=0;s<e.height;s++){const a=s*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,Jh(c.attrs,o-e.colCount(l))),s+=c.attrs.rowspan-1}else{const l=i==null?Ze(r.type.schema).cell:r.nodeAt(e.map[a+i]).type,c=e.positionAt(s,o,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function kv(t,e){if(!Wt(t))return!1;if(e){const n=sn(t);e(Qh(t.tr,n,n.left))}return!0}function _v(t,e){if(!Wt(t))return!1;if(e){const n=sn(t);e(Qh(t.tr,n,n.right))}return!0}function Ev(t,{map:e,table:n,tableStart:r},o){const i=t.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+o,l=e.map[a],c=n.nodeAt(l),u=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(i).map(r+l),null,_r(u,o-e.colCount(l)));else{const f=t.mapping.slice(i).map(r+l);t.delete(f,f+c.nodeSize)}s+=u.rowspan}}function vv(t,e){if(!Wt(t))return!1;if(e){const n=sn(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;Ev(r,n,o),o!=n.left;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=Pe.get(i)}e(r)}return!0}function Cv(t,e,n){var r;const o=Ze(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((r=e.nodeAt(t.map[i+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function Zh(t,{map:e,tableStart:n,table:r},o){var i;let s=n;for(let c=0;c<o;c++)s+=r.child(c).nodeSize;const a=[];let l=o>0?-1:0;Cv(e,r,o+l)&&(l=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const f=e.map[u],p=r.nodeAt(f).attrs;t.setNodeMarkup(n+f,null,{...p,rowspan:p.rowspan+1}),c+=p.colspan-1}else{const f=l==null?Ze(r.type.schema).cell:(i=r.nodeAt(e.map[u+l*e.width]))==null?void 0:i.type,p=f?.createAndFill();p&&a.push(p)}return t.insert(s,Ze(r.type.schema).row.create(null,a)),t}function Sv(t,e){if(!Wt(t))return!1;if(e){const n=sn(t);e(Zh(t.tr,n,n.top))}return!0}function Tv(t,e){if(!Wt(t))return!1;if(e){const n=sn(t);e(Zh(t.tr,n,n.bottom))}return!0}function Nv(t,{map:e,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const s=i+n.child(o).nodeSize,a=t.mapping.maps.length;t.delete(i+r,s+r);const l=new Set;for(let c=0,u=o*e.width;c<e.width;c++,u++){const f=e.map[u];if(!l.has(f)){if(l.add(f),o>0&&f==e.map[u-e.width]){const p=n.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(o<e.height&&f==e.map[u+e.width]){const p=n.nodeAt(f),m=p.attrs,b=p.type.create({...m,rowspan:p.attrs.rowspan-1},p.content),k=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(a).map(r+k),b),c+=m.colspan-1}}}}function Av(t,e){if(!Wt(t))return!1;if(e){const n=sn(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;Nv(r,n,o),o!=n.top;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=Pe.get(n.table)}e(r)}return!0}function em(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function Ov({width:t,height:e,map:n},r){let o=r.top*t+r.left,i=o,s=(r.bottom-1)*t+r.left,a=o+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[i]==n[i-1]||r.right<t&&n[a]==n[a+1])return!0;i+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[s]==n[s+t])return!0;o++,s++}return!1}function tm(t,e){const n=t.selection;if(!(n instanceof Se)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=sn(t),{map:o}=r;if(Ov(o,r))return!1;if(e){const i=t.tr,s={};let a=V.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let f=r.left;f<r.right;f++){const p=o.map[u*o.width+f],m=r.table.nodeAt(p);if(!(s[p]||!m))if(s[p]=!0,l==null)l=p,c=m;else{em(m)||(a=a.append(m.content));const b=i.mapping.map(p+r.tableStart);i.delete(b,b+m.nodeSize)}}if(l==null||c==null)return!0;if(i.setNodeMarkup(l+r.tableStart,null,{...Jh(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const u=l+1+c.content.size,f=em(c)?l+1:u;i.replaceWith(f+r.tableStart,u+r.tableStart,a)}i.setSelection(new Se(i.doc.resolve(l+r.tableStart))),e(i)}return!0}function nm(t,e){const n=Ze(t.schema);return Mv(({node:r})=>n[r.type.spec.tableRole])(t,e)}function Mv(t){return(e,n)=>{var r;const o=e.selection;let i,s;if(o instanceof Se){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{if(i=cv(o.$from),!i)return!1;s=(r=Zr(o.$from))==null?void 0:r.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let a=i.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=sn(e),f=e.tr;for(let m=0;m<u.right-u.left;m++)l.push(c?{...a,colwidth:c&&c[m]?[c[m]]:null}:a);let p;for(let m=u.top;m<u.bottom;m++){let b=u.map.positionAt(m,u.left,u.table);m==u.top&&(b+=i.nodeSize);for(let k=u.left,_=0;k<u.right;k++,_++)k==u.left&&m==u.top||f.insert(p=f.mapping.map(b+u.tableStart,1),t({node:i,row:m,col:k}).createAndFill(l[_]))}f.setNodeMarkup(s,t({node:i,row:u.top,col:u.left}),l[0]),o instanceof Se&&f.setSelection(new Se(f.doc.resolve(o.$anchorCell.pos),p?f.doc.resolve(p):void 0)),n(f)}return!0}}function xv(t,e){return function(n,r){if(!Wt(n))return!1;const o=Ps(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const i=n.tr;n.selection instanceof Se?n.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&i.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(i)}return!0}}function Lv(t){return function(e,n){if(!Wt(e))return!1;if(n){const r=Ze(e.schema),o=sn(e),i=e.tr,s=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(l=>o.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[l],r.cell,a[l].attrs);if(i.steps.length==0)for(let l=0;l<s.length;l++)i.setNodeMarkup(o.tableStart+s[l],r.header_cell,a[l].attrs);n(i)}return!0}}function rm(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function Xo(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Lv(t):function(n,r){if(!Wt(n))return!1;if(r){const o=Ze(n.schema),i=sn(n),s=n.tr,a=rm("row",i,o),l=rm("column",i,o),u=(t==="column"?a:t==="row"?l:!1)?1:0,f=t=="column"?{left:0,top:u,right:1,bottom:i.map.height}:t=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,p=t=="column"?l?o.cell:o.header_cell:t=="row"?a?o.cell:o.header_cell:o.cell;i.map.cellsInRect(f).forEach(m=>{const b=m+i.tableStart,k=s.doc.nodeAt(b);k&&s.setNodeMarkup(b,p,k.attrs)}),r(s)}return!0}}Xo("row",{useDeprecatedLogic:!0}),Xo("column",{useDeprecatedLogic:!0});var Rv=Xo("cell",{useDeprecatedLogic:!0});function Pv(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const i=t.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const i=n.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function om(t){return function(e,n){if(!Wt(e))return!1;const r=Pv(Ps(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(te.between(o,dv(o))).scrollIntoView())}return!0}}function Iv(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Is(t,e){const n=t.selection;if(!(n instanceof Se))return!1;if(e){const r=t.tr,o=Ze(t.schema).cell.createAndFill().content;n.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new W(o,0,0))}),r.docChanged&&e(r)}return!0}function Dv(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,a=[];if(i=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,n-1),f=l<e.childCount-1?0:Math.max(0,r-1);(u||f)&&(c=yc(Ze(s).row,new W(c,u,f)).content),a.push(c)}else if(i=="cell"||i=="header_cell")a.push(n||r?yc(Ze(s).row,new W(e,n,r)).content:e);else return null;return Bv(s,a)}function Bv(t,e){const n=[];for(let o=0;o<e.length;o++){const i=e[o];for(let s=i.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=i.child(s).attrs;for(let c=o;c<o+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(V.empty),n[o]<r){const i=Ze(t).cell.createAndFill(),s=[];for(let a=n[o];a<r;a++)s.push(i);e[o]=e[o].append(V.from(s))}return{height:e.length,width:r,rows:e}}function yc(t,e){const n=t.createAndFill();return new Na(n).replace(0,n.content.size,e).doc}function Fv({width:t,height:e,rows:n},r,o){if(t!=r){const i=[],s=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let u=i[a]||0,f=0;u<r;f++){let p=l.child(f%l.childCount);u+p.attrs.colspan>r&&(p=p.type.createChecked(_r(p.attrs,p.attrs.colspan,u+p.attrs.colspan-r),p.content)),c.push(p),u+=p.attrs.colspan;for(let m=1;m<p.attrs.rowspan;m++)i[a+m]=(i[a+m]||0)+p.attrs.colspan}s.push(V.from(c))}n=s,t=r}if(e!=o){const i=[];for(let s=0,a=0;s<o;s++,a++){const l=[],c=n[a%e];for(let u=0;u<c.childCount;u++){let f=c.child(u);s+f.attrs.rowspan>o&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,o-f.attrs.rowspan)},f.content)),l.push(f)}i.push(V.from(l))}n=i,e=o}return{width:t,height:e,rows:n}}function $v(t,e,n,r,o,i,s){const a=t.doc.type.schema,l=Ze(a);let c,u;if(o>e.width)for(let f=0,p=0;f<e.height;f++){const m=n.child(f);p+=m.nodeSize;const b=[];let k;m.lastChild==null||m.lastChild.type==l.cell?k=c||(c=l.cell.createAndFill()):k=u||(u=l.header_cell.createAndFill());for(let _=e.width;_<o;_++)b.push(k);t.insert(t.mapping.slice(s).map(p-1+r),b)}if(i>e.height){const f=[];for(let b=0,k=(e.height-1)*e.width;b<Math.max(e.width,o);b++){const _=b>=e.width?!1:n.nodeAt(e.map[k+b]).type==l.header_cell;f.push(_?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,V.from(f)),m=[];for(let b=e.height;b<i;b++)m.push(p);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),m)}return!!(c||u)}function im(t,e,n,r,o,i,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=o;c<i;c++){const u=s*e.width+c,f=e.map[u];if(e.map[u-e.width]==f){l=!0;const p=n.nodeAt(f),{top:m,left:b}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...p.attrs,rowspan:s-m}),t.insert(t.mapping.slice(a).map(e.positionAt(s,b,n)),p.type.createAndFill({...p.attrs,rowspan:m+p.attrs.rowspan-s})),c+=p.attrs.colspan-1}}return l}function sm(t,e,n,r,o,i,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=o;c<i;c++){const u=c*e.width+s,f=e.map[u];if(e.map[u-1]==f){l=!0;const p=n.nodeAt(f),m=e.colCount(f),b=t.mapping.slice(a).map(f+r);t.setNodeMarkup(b,null,_r(p.attrs,s-m,p.attrs.colspan-(s-m))),t.insert(b+p.nodeSize,p.type.createAndFill(_r(p.attrs,0,s-m))),c+=p.attrs.rowspan-1}}return l}function am(t,e,n,r,o){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let s=Pe.get(i);const{top:a,left:l}=r,c=l+o.width,u=a+o.height,f=t.tr;let p=0;function m(){if(i=n?f.doc.nodeAt(n-1):f.doc,!i)throw new Error("No table found");s=Pe.get(i),p=f.mapping.maps.length}$v(f,s,i,n,c,u,p)&&m(),im(f,s,i,n,l,c,a,p)&&m(),im(f,s,i,n,l,c,u,p)&&m(),sm(f,s,i,n,a,u,l,p)&&m(),sm(f,s,i,n,a,u,c,p)&&m();for(let b=a;b<u;b++){const k=s.positionAt(b,l,i),_=s.positionAt(b,c,i);f.replace(f.mapping.slice(p).map(k+n),f.mapping.slice(p).map(_+n),new W(o.rows[b-a],0,0))}m(),f.setSelection(new Se(f.doc.resolve(n+s.positionAt(a,l,i)),f.doc.resolve(n+s.positionAt(u-1,c-1,i)))),e(f)}var Vv=ol({ArrowLeft:Bs("horiz",-1),ArrowRight:Bs("horiz",1),ArrowUp:Bs("vert",-1),ArrowDown:Bs("vert",1),"Shift-ArrowLeft":Fs("horiz",-1),"Shift-ArrowRight":Fs("horiz",1),"Shift-ArrowUp":Fs("vert",-1),"Shift-ArrowDown":Fs("vert",1),Backspace:Is,"Mod-Backspace":Is,Delete:Is,"Mod-Delete":Is});function Ds(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Bs(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof Se)return Ds(n,r,ee.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const s=lm(o,t,e);if(s==null)return!1;if(t=="horiz")return Ds(n,r,ee.near(n.doc.resolve(i.head+e),e));{const a=n.doc.resolve(s),l=Gh(a,t,e);let c;return l?c=ee.near(l,1):e<0?c=ee.near(n.doc.resolve(a.before(-1)),-1):c=ee.near(n.doc.resolve(a.after(-1)),1),Ds(n,r,c)}}}function Fs(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof Se)s=i;else{const l=lm(o,t,e);if(l==null)return!1;s=new Se(n.doc.resolve(l))}const a=Gh(s.$headCell,t,e);return a?Ds(n,r,new Se(s.$anchorCell,a)):!1}}function Hv(t,e){const n=t.state.doc,r=Zr(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Se(r))),!0):!1}function zv(t,e,n){if(!Wt(t.state))return!1;let r=Dv(n);const o=t.state.selection;if(o instanceof Se){r||(r={width:1,height:1,rows:[V.from(yc(Ze(t.state.schema).cell,n))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),a=Pe.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=Fv(r,a.right-a.left,a.bottom-a.top),am(t.state,t.dispatch,s,a,r),!0}else if(r){const i=Ps(t.state),s=i.start(-1);return am(t.state,t.dispatch,s,Pe.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function jv(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=cm(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Se)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Zr(t.state.selection.$anchor))!=null&&((n=wc(t,e))==null?void 0:n.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(l,c){let u=wc(t,c);const f=Jn.getState(t.state)==null;if(!u||!bc(l,u))if(f)u=l;else return;const p=new Se(l,u);if(f||!t.state.selection.eq(p)){const m=t.state.tr.setSelection(p);f&&m.setMeta(Jn,l.pos),t.dispatch(m)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),Jn.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Jn,-1))}function a(l){const c=l,u=Jn.getState(t.state);let f;if(u!=null)f=t.state.doc.resolve(u);else if(cm(t,c.target)!=r&&(f=wc(t,e),!f))return s();f&&i(f,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function lm(t,e,n){if(!(t.state.selection instanceof te))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const a=r.before(o),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function cm(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function wc(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Zr(t.state.doc.resolve(n.pos)):null}var Uv=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),kc(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,kc(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function kc(t,e,n,r,o,i){var s;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let f=0,p=0;f<u.childCount;f++){const{colspan:m,colwidth:b}=u.child(f).attrs;for(let k=0;k<m;k++,p++){const _=o==p?i:b&&b[k],E=_?_+"px":"";if(a+=_||r,_||(l=!1),c)c.style.width!=E&&(c.style.width=E),c=c.nextSibling;else{const N=document.createElement("col");N.style.width=E,e.appendChild(N)}}}for(;c;){const f=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=f}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var Tt=new Ue("tableColumnResizing");function Wv({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=Uv,lastColumnResizable:o=!0}={}){const i=new $e({key:Tt,state:{init(s,a){var l,c;const u=(c=(l=i.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,f=Ze(a.schema).table.name;return r&&u&&(u[f]=(p,m)=>new r(p,n,m)),new Kv(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=Tt.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{qv(s,a,t,o)},mouseleave:s=>{Gv(s)},mousedown:(s,a)=>{Jv(s,a,e,n)}},decorations:s=>{const a=Tt.getState(s);if(a&&a.activeHandle>-1)return eC(s,a.activeHandle)},nodeViews:{}}});return i}var Kv=class ha{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Tt);if(r&&r.setHandle!=null)return new ha(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new ha(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return gc(e.doc.resolve(o))||(o=-1),new ha(o,n.dragging)}return n}};function qv(t,e,n,r){if(!t.editable)return;const o=Tt.getState(t.state);if(o&&!o.dragging){const i=Xv(e.target);let s=-1;if(i){const{left:a,right:l}=i.getBoundingClientRect();e.clientX-a<=n?s=um(t,e,"left",n):l-e.clientX<=n&&(s=um(t,e,"right",n))}if(s!=o.activeHandle){if(!r&&s!==-1){const a=t.state.doc.resolve(s),l=a.node(-1),c=Pe.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}fm(t,s)}}}function Gv(t){if(!t.editable)return;const e=Tt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&fm(t,-1)}function Jv(t,e,n,r){var o;if(!t.editable)return!1;const i=(o=t.dom.ownerDocument.defaultView)!=null?o:window,s=Tt.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=t.state.doc.nodeAt(s.activeHandle),l=Yv(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(Tt,{setDragging:{startX:e.clientX,startWidth:l}}));function c(f){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",u);const p=Tt.getState(t.state);p?.dragging&&(Qv(t,p.activeHandle,dm(p.dragging,f,n)),t.dispatch(t.state.tr.setMeta(Tt,{setDragging:null})))}function u(f){if(!f.which)return c(f);const p=Tt.getState(t.state);if(p&&p.dragging){const m=dm(p.dragging,f,n);pm(t,p.activeHandle,m,r)}}return pm(t,s.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",u),e.preventDefault(),!0}function Yv(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=t.domAtPos(e);let a=i.node.childNodes[i.offset].offsetWidth,l=n;if(r)for(let c=0;c<n;c++)r[c]&&(a-=r[c],l--);return a/l}function Xv(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function um(t,e,n,r){const o=n=="right"?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,a=Zr(t.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=Pe.get(a.node(-1)),c=a.start(-1),u=l.map.indexOf(a.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function dm(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function fm(t,e){t.dispatch(t.state.tr.setMeta(Tt,{setHandle:e}))}function Qv(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),i=Pe.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<i.height;c++){const u=c*i.width+a;if(c&&i.map[u]==i.map[u-i.width])continue;const f=i.map[u],p=o.nodeAt(f).attrs,m=p.colspan==1?0:a-i.colCount(f);if(p.colwidth&&p.colwidth[m]==n)continue;const b=p.colwidth?p.colwidth.slice():Zv(p.colspan);b[m]=n,l.setNodeMarkup(s+f,null,{...p,colwidth:b})}l.docChanged&&t.dispatch(l)}function pm(t,e,n,r){const o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=Pe.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let l=t.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&kc(i,l.firstChild,l,r,a,n)}function Zv(t){return Array(t).fill(0)}function eC(t,e){var n;const r=[],o=t.doc.resolve(e),i=o.node(-1);if(!i)return Le.empty;const s=Pe.get(i),a=o.start(-1),l=s.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=l+c*s.width;if((l==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){const f=s.map[u],p=a+f+i.nodeAt(f).nodeSize-1,m=document.createElement("div");m.className="column-resize-handle",(n=Tt.getState(t))!=null&&n.dragging&&r.push(lt.node(a+f,a+f+i.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(lt.widget(p,m))}}return Le.create(t.doc,r)}function tC({allowTableNodeSelection:t=!1}={}){return new $e({key:Jn,state:{init(){return null},apply(e,n){const r=e.getMeta(Jn);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:i}=e.mapping.mapResult(n);return o?null:i}},props:{decorations:hv,handleDOMEvents:{mousedown:jv},createSelectionBetween(e){return Jn.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Hv,handleKeyDown:Vv,handlePaste:zv},appendTransaction(e,n,r){return bv(r,Xh(r,n),t)}})}function _c(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function hm(t,e,n,r,o,i){var s;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u!==null)for(let f=0,p=0;f<u.childCount;f+=1){const{colspan:m,colwidth:b}=u.child(f).attrs;for(let k=0;k<m;k+=1,p+=1){const _=o===p?i:b&&b[k],E=_?`${_}px`:"";if(a+=_||r,_||(l=!1),c){if(c.style.width!==E){const[N,A]=_c(r,_);c.style.setProperty(N,A)}c=c.nextSibling}else{const N=document.createElement("col"),[A,d]=_c(r,_);N.style.setProperty(A,d),e.appendChild(N)}}}for(;c;){const f=c.nextSibling;(s=c.parentNode)===null||s===void 0||s.removeChild(c),c=f}l?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}class nC{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),hm(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,hm(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function rC(t,e,n,r){let o=0,i=!0;const s=[],a=t.firstChild;if(!a)return{};for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:m,colwidth:b}=a.child(f).attrs;for(let k=0;k<m;k+=1,p+=1){const _=n===p?r:b&&b[k];o+=_||e,_||(i=!1);const[E,N]=_c(e,_);s.push(["col",{style:`${E}: ${N}`}])}}const l=i?`${o}px`:"",c=i?"":`${o}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function mm(t,e){return t.createAndFill()}function oC(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function iC(t,e,n,r,o){const i=oC(t),s=[],a=[];for(let c=0;c<n;c+=1){const u=mm(i.cell);if(u&&a.push(u),r){const f=mm(i.header_cell);f&&s.push(f)}}const l=[];for(let c=0;c<e;c+=1)l.push(i.row.createChecked(null,r&&c===0?s:a));return i.table.createChecked(null,l)}function sC(t){return t instanceof Se}const $s=({editor:t})=>{const{selection:e}=t.state;if(!sC(e))return!1;let n=0;const r=sp(e.ranges[0].$from,i=>i.type.name==="table");return r?.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},gm=ct.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:nC,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=rC(t,this.options.cellMinWidth);return["table",Ce(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const s=iC(i.schema,t,e,n);if(o){const a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(te.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>kv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>_v(t,e),deleteColumn:()=>({state:t,dispatch:e})=>vv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Sv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Tv(t,e),deleteRow:()=>({state:t,dispatch:e})=>Av(t,e),deleteTable:()=>({state:t,dispatch:e})=>Iv(t,e),mergeCells:()=>({state:t,dispatch:e})=>tm(t,e),splitCell:()=>({state:t,dispatch:e})=>nm(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Xo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Xo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>Rv(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>tm(t,e)?!0:nm(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>xv(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>om(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>om(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Xh(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Se.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:$s,"Mod-Backspace":$s,Delete:$s,"Mod-Delete":$s}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Wv({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],tC({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ie(J(t,"tableRole",e))}}}),bm=Ke.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:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},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")}}}),ym=ct.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Ce(this.options.HTMLAttributes,t),0]}}),wm=ct.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Ce(this.options.HTMLAttributes,t),0]}}),km=ct.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Ce(this.options.HTMLAttributes,t),0]}}),_m=ct.create({name:"doc",topNode:!0,content:"block+"});class Ie extends ee{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ie.valid(r)?new Ie(r):ee.near(r)}content(){return W.empty}eq(e){return e instanceof Ie&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ie(e.resolve(n.pos))}getBookmark(){return new Ec(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!aC(e)||!lC(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ie.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if(Ie.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!Q.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if(Ie.valid(a))return a}return null}}}Ie.prototype.visible=!1,Ie.findFrom=Ie.findGapCursorFrom,ee.jsonID("gapcursor",Ie);class Ec{constructor(e){this.pos=e}map(e){return new Ec(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ie.valid(n)?new Ie(n):ee.near(n)}}function aC(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function lC(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function cC(){return new $e({props:{decorations:pC,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ie.valid(n)?new Ie(n):null},handleClick:dC,handleKeyDown:uC,handleDOMEvents:{beforeinput:fC}}})}const uC=ol({ArrowLeft:Vs("horiz",-1),ArrowRight:Vs("horiz",1),ArrowUp:Vs("vert",-1),ArrowDown:Vs("vert",1)});function Vs(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof te){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Ie.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new Ie(c))),!0):!1}}function dC(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ie.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Q.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ie(r))),!0)}function fC(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ie))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=V.empty;for(let s=r.length-1;s>=0;s--)o=V.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new W(o,0,0));return i.setSelection(te.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function pC(t){if(!(t.selection instanceof Ie))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Le.create(t.doc,[lt.widget(t.selection.head,e,{key:"gapcursor"})])}const Em=Ke.create({name:"gapCursor",addProseMirrorPlugins(){return[cC()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ie(J(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),vm=ct.create({name:"text",group:"inline"}),Cm=Ke.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),et=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},hC={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function mC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleBlockquote&&i.toggleBlockquote(...s)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const gC=et(hC,[["render",mC]]),bC={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function yC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleBulletList&&i.toggleBulletList(...s)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const wC=et(bC,[["render",yC]]),kC={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function _C(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleOrderedList&&i.toggleOrderedList(...s)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const EC=et(kC,[["render",_C]]),vC={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function CC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleCodeBlock&&i.toggleCodeBlock(...s)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const SC=et(vC,[["render",CC]]),TC={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function NC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleBold&&i.toggleBold(...s)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("bold")}])},e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),y.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const AC=et(TC,[["render",NC]]),OC={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function MC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleItalic&&i.toggleItalic(...s)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("italic")}])},e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),y.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const xC=et(OC,[["render",MC]]),Qo=async(t,e,n,r=10)=>{if(!e||!n)return;await y.nextTick();const o=await n?.getBoundingClientRect(),i=await e?.getBoundingClientRect();if(!i||!o)return;const s=await parseInt(e?.getBoundingClientRect()?.height),a=await parseInt(e?.getBoundingClientRect()?.width),l=await parseInt(n?.getBoundingClientRect()?.height),c=await parseInt(n?.getBoundingClientRect()?.width),u=await window.innerHeight,f=await window.innerWidth;let p=0,m=0;const b=i.bottom+r+l;switch(t){case"top":i.top-o.height-r<0?p=i.top-o.height+r+l+s:p=i.top-o.height-r,f>c+i.right+30?m=i.left-o.width/2+i.width/2:m=f-30-c;break;case"bottom":u>b?p=i.bottom+r:p=i.bottom-r-l-s,m=i.left-o.width/2+i.width/2;break;case"left":p=i.top-o.height/2+i.height/2,i.left-o.width-r>0?m=i.left-o.width-r:m=10;break;case"right":p=i.top-o.height/2+i.height/2,f-a>c?m=i.right+r:m=f-30-c;break;case"top-right":i.top-o.height-r<0?p=i.top-o.height+r+l+s:p=i.top-o.height-r,f-a>c?m=i.right+r:m=f-30-c;break;case"top-left":i.top-o.height-r<0?p=i.top-o.height+r+l+s:p=i.top-o.height-r,i.left-o.width-r>0?m=i.left-o.width-r:m=10;break;case"top-start":i.top-o.height-r<0?p=i.top-o.height+r+l+s:p=i.top-o.height-r,i.left>0?m=i.left:m=10;break;case"bottom-right":u>b?p=i.bottom+r:p=i.bottom-r-l-s,f-a>c?m=i.left:m=f-30-c;break;case"bottom-left":u>b?p=i.bottom+r:p=i.bottom-r-l-s,i.left>0?m=i.right-c:m=10;break;case"bottom-start":u>b?p=i.bottom+r:p=i.bottom-r-l-s,i.left>0?m=i.left:m=10;break}p+l>u?p=u-l-r:p<0&&(p=r),m+c>f?m=f-c-r:m<0&&(m=r),n instanceof HTMLElement&&(n.style.top=`${p}px`,n.style.left=`${m}px`,n.style.position="fixed")},LC={class:"text-center"},RC={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Zo={__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"#modal"}},emits:["isvisible"],setup(t,{expose:e,emit:n}){const r=t,o=n,i=y.ref(!1),s=y.ref([]),a=y.ref(null),l=y.ref(null),c=y.ref(null);y.watch(i,A=>{A?(u(),window.addEventListener("resize",()=>Qo(r.placement,l.value,c.value)),Qo(r.placement,l.value,c.value)):window.removeEventListener("resize",()=>Qo(r.placement,l.value,c.value)),o("isvisible",A)}),y.onMounted(()=>{window.addEventListener("click",_),window.addEventListener("popstate",E),window.addEventListener("scroll",N,!0),u()}),y.onBeforeUnmount(()=>{window.removeEventListener("click",_),window.removeEventListener("popstate",E),f()});const u=()=>{let A=a.value;for(;A&&A!==document.body;)(A.scrollHeight>A.clientHeight||A.scrollWidth>A.clientWidth)&&(A.addEventListener("scroll",k),s.value.push(A)),A=A.parentElement;document.body&&(document.body.addEventListener("scroll",k),s.value.push(document.body))},f=()=>{s.value.forEach(A=>{A.removeEventListener("scroll",k)}),s.value=[]},p=()=>{i.value=!0,Qo(r.placement,l.value,c.value)},m=()=>{i.value=!1},b=async()=>{await Qo(r.placement,l.value,c.value),i.value=!i.value},k=()=>{i.value=!1},_=A=>{if(!A){i.value=!1;return}l.value?.contains(A.target)||c.value?.contains(A.target)||(i.value=!1)},E=()=>{i.value&&(i.value=!1)},N=A=>{i.value&&c.value&&!c.value.contains(A.target)&&(i.value=!1)};return e({togglePopover:b}),(A,d)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"popover",ref:a,class:"vs-popover inline-block"},[y.createElementVNode("div",LC,[t.trigger==="click"?(y.openBlock(),y.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:b,class:y.normalizeClass({"pointer-events-none":t.disabled})},[y.renderSlot(A.$slots,"reference",{},()=>[d[0]||(d[0]=y.createElementVNode("button",null,"Click me!",-1))])],2)):y.createCommentVNode("",!0),t.trigger==="hover"?(y.openBlock(),y.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:p,onMouseleave:m,class:y.normalizeClass({"pointer-events-none":t.disabled})},[y.renderSlot(A.$slots,"reference",{},()=>[d[1]||(d[1]=y.createElementVNode("button",null,"Click me!",-1))])],34)):y.createCommentVNode("",!0),(y.openBlock(),y.createBlock(y.Teleport,{to:t.teleport},[y.createVNode(y.Transition,{name:"fade"},{default:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["vsTailwind vs-popover__content",t.placement]),ref_key:"contentPop",ref:c,style:y.normalizeStyle({width:t.width?t.width+"px":"fit-content",zIndex:10002})},[y.createElementVNode("div",RC,[y.renderSlot(A.$slots,"default",{},()=>[d[2]||(d[2]=y.createElementVNode("span",null,"Popover content",-1))])])],6),[[y.vShow,i.value]])]),_:3})],8,["to"]))])],512))}},PC={class:"w-[30px] h-[30px] rounded-full hover:bg-gray-100 justify-center items-center relative flex"},IC={class:"flex w-[160px] flex-wrap gap-[4px]"},DC=["onClick"],BC={__name:"vs-editor-color",props:{editor:Object},setup(t){const e=t,n=y.ref("popover"),r=y.ref("#000000"),o=y.ref(["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]),i=s=>{e.editor&&(e.editor.chain().focus().setColor(s).run(),r.value=s,n.value&&n.value.togglePopover())};return(s,a)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",PC,[a[0]||(a[0]=y.createElementVNode("svg",{class:"text-gray-500",height:"16",width:"16","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"})],-1)),y.createElementVNode("span",{class:"absolute h-[2px] w-[40%] bottom-[10px] left-[9px]",style:y.normalizeStyle({backgroundColor:r.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("ul",IC,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(o.value,l=>(y.openBlock(),y.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:y.normalizeStyle({backgroundColor:l}),onClick:c=>i(l),key:l},null,12,DC))),128))])])]),_:1},512))}},FC={__name:"vs-editor-underline",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(r,o)=>(y.openBlock(),y.createElementBlock("button",{onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},o[0]||(o[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),y.createElementVNode("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)]),2))}},$C={__name:"vs-editor-strike",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(r,o)=>(y.openBlock(),y.createElementBlock("button",{onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},o[0]||(o[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M5 12l14 0"}),y.createElementVNode("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)]),2))}},VC={props:{visible:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","onClose"],name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){return!!this.$slots?.footer},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:t}){t==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")},closeByClickBack(t,e){e&&t.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},HC={key:0,class:"vsTailwind ui-dialog__wrapper"},zC={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},jC={class:"font-medium text-gray-800 dark:text-[#ffffff]"},UC={class:"ui-dialog__content p-4"},WC={key:0,class:"flex justify-end gap-x-2"};function KC(t,e,n,r,o,i){return y.openBlock(),y.createBlock(y.Teleport,{to:"#modal"},[n.visible?(y.openBlock(),y.createElementBlock("div",HC,[y.createElementVNode("div",{onMousedown:e[1]||(e[1]=s=>i.closeByClickBack(s,n.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},[y.createVNode(y.Transition,{name:"content",appear:""},{default:y.withCtx(()=>[y.createElementVNode("div",{class:y.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[i.checkSize]])},[y.createElementVNode("div",zC,[y.createElementVNode("h3",jC,y.toDisplayString(n.title),1),y.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...s)=>i.handleClose&&i.handleClose(...s))},e[2]||(e[2]=[y.createElementVNode("span",{class:"sr-only"},"Close",-1),y.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M18 6 6 18"}),y.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),y.createElementVNode("div",UC,[y.renderSlot(t.$slots,"default",{},void 0,!0)]),i.hasSlot?(y.openBlock(),y.createElementBlock("div",WC,[y.renderSlot(t.$slots,"footer",{handleClose:i.handleClose},void 0,!0)])):y.createCommentVNode("",!0)],2)]),_:3})],32)])):y.createCommentVNode("",!0)])}const qC=et(VC,[["render",KC],["__scopeId","data-v-6d4e684d"]]),GC={},JC={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function YC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",JC,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),y.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const XC=et(GC,[["render",YC]]),QC={},ZC={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function eS(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",ZC,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),y.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const tS=et(QC,[["render",eS]]),nS={},rS={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function oS(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",rS,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),y.createElementVNode("path",{d:"M3 7l9 6l9 -6"},null,-1)]))}const iS=et(nS,[["render",oS]]),sS=y.defineComponent({components:{IconClose:XC,IconSearch:tS,IconEmail:iS},props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){if((this.style?.size||this.size)==="xs")return"h-[32px] text-sm";if((this.style?.size||this.size)==="md")return"h-[38px] text-sm";this.style?.size||this.size},value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:t}=await this.$refs;await t.focus()}}}),aS={class:"vs-form-text relative bg-white rounded-lg"},lS={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},cS=["disabled","type","placeholder"];function uS(t,e,n,r,o,i){const s=y.resolveComponent("IconClose"),a=y.resolveComponent("IconSearch"),l=y.resolveComponent("IconEmail");return y.openBlock(),y.createElementBlock("div",aS,[t.clearable&&t.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>t.clearInput&&t.clearInput(...c))},[y.createVNode(s,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),t.icon&&t.icon==="search"?(y.openBlock(),y.createElementBlock("div",{key:1,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",t.iconStylePosition])},[y.createVNode(a,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):t.icon&&t.icon==="email"?(y.openBlock(),y.createElementBlock("div",lS,[y.createVNode(l,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(y.openBlock(),y.createElementBlock("i",{key:3,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+t.icon,t.iconStylePosition]])},null,2)),t.clearable&&t.value?(y.openBlock(),y.createElementBlock("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...c)=>t.clearInput&&t.clearInput(...c))},[y.createVNode(s,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("input",y.mergeProps({ref:"vsText",disabled:t.disabled,type:t.type,onInput:e[2]||(e[2]=(...c)=>t.handleInput&&t.handleInput(...c)),placeholder:t.placeholder,"onUpdate:modelValue":e[3]||(e[3]=c=>t.value=c)},t.style?.attrs||t.attrs||{},{onFocus:e[4]||(e[4]=(...c)=>t.handleFocus&&t.handleFocus(...c)),onBlur:e[5]||(e[5]=(...c)=>t.handleBlur&&t.handleBlur(...c)),class:[[t.inputStyle,t.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,cS),[[y.vModelDynamic,t.value]])])}const Sm=et(sS,[["render",uS],["__scopeId","data-v-00f5150b"]]);/*!
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
`,NS="\u2028",AS="\u2029";function OS(t){const e=t;let n=0,r=1,o=1,i=0;const s=w=>e[w]===TS&&e[w+1]===ut,a=w=>e[w]===ut,l=w=>e[w]===AS,c=w=>e[w]===NS,u=w=>s(w)||a(w)||l(w)||c(w),f=()=>n,p=()=>r,m=()=>o,b=()=>i,k=w=>s(w)||l(w)||c(w)?ut:e[w],_=()=>k(n),E=()=>k(n+i);function N(){return i=0,u(n)&&(r++,o=0),s(n)&&n++,n++,o++,e[n]}function A(){return s(n+i)&&i++,i++,e[n+i]}function d(){n=0,r=1,o=1,i=0}function g(w=0){i=w}function h(){const w=n+i;for(;w!==n;)N();i=0}return{index:f,line:p,column:m,peekOffset:b,charAt:k,currentChar:_,currentPeek:E,next:N,peek:A,reset:d,resetPeek:g,skipToPeek:h}}const Xn=void 0,MS=".",xm="'",xS="tokenizer";function LS(t,e={}){const n=e.location!==!1,r=OS(t),o=()=>r.index(),i=()=>kS(r.line(),r.column(),r.index()),s=i(),a=o(),l={currentType:13,offset:a,startLoc:s,endLoc:s,lastType:13,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(O,x,H,...Y){const ve=c();if(x.column+=H,x.offset+=H,u){const me=n?Nc(ve.startLoc,x):null,le=to(O,me,{domain:xS,args:Y});u(le)}}function p(O,x,H){O.endLoc=i(),O.currentType=x;const Y={type:x};return n&&(Y.loc=Nc(O.startLoc,O.endLoc)),H!=null&&(Y.value=H),Y}const m=O=>p(O,13);function b(O,x){return O.currentChar()===x?(O.next(),x):(f(ne.EXPECTED_TOKEN,i(),0,x),"")}function k(O){let x="";for(;O.currentPeek()===vn||O.currentPeek()===ut;)x+=O.currentPeek(),O.peek();return x}function _(O){const x=k(O);return O.skipToPeek(),x}function E(O){if(O===Xn)return!1;const x=O.charCodeAt(0);return x>=97&&x<=122||x>=65&&x<=90||x===95}function N(O){if(O===Xn)return!1;const x=O.charCodeAt(0);return x>=48&&x<=57}function A(O,x){const{currentType:H}=x;if(H!==2)return!1;k(O);const Y=E(O.currentPeek());return O.resetPeek(),Y}function d(O,x){const{currentType:H}=x;if(H!==2)return!1;k(O);const Y=O.currentPeek()==="-"?O.peek():O.currentPeek(),ve=N(Y);return O.resetPeek(),ve}function g(O,x){const{currentType:H}=x;if(H!==2)return!1;k(O);const Y=O.currentPeek()===xm;return O.resetPeek(),Y}function h(O,x){const{currentType:H}=x;if(H!==7)return!1;k(O);const Y=O.currentPeek()===".";return O.resetPeek(),Y}function w(O,x){const{currentType:H}=x;if(H!==8)return!1;k(O);const Y=E(O.currentPeek());return O.resetPeek(),Y}function v(O,x){const{currentType:H}=x;if(!(H===7||H===11))return!1;k(O);const Y=O.currentPeek()===":";return O.resetPeek(),Y}function S(O,x){const{currentType:H}=x;if(H!==9)return!1;const Y=()=>{const me=O.currentPeek();return me==="{"?E(O.peek()):me==="@"||me==="|"||me===":"||me==="."||me===vn||!me?!1:me===ut?(O.peek(),Y()):M(O,!1)},ve=Y();return O.resetPeek(),ve}function C(O){k(O);const x=O.currentPeek()==="|";return O.resetPeek(),x}function M(O,x=!0){const H=(ve=!1,me="")=>{const le=O.currentPeek();return le==="{"||le==="@"||!le?ve:le==="|"?!(me===vn||me===ut):le===vn?(O.peek(),H(!0,vn)):le===ut?(O.peek(),H(!0,ut)):!0},Y=H();return x&&O.resetPeek(),Y}function P(O,x){const H=O.currentChar();return H===Xn?Xn:x(H)?(O.next(),H):null}function D(O){const x=O.charCodeAt(0);return x>=97&&x<=122||x>=65&&x<=90||x>=48&&x<=57||x===95||x===36}function F(O){return P(O,D)}function $(O){const x=O.charCodeAt(0);return x>=97&&x<=122||x>=65&&x<=90||x>=48&&x<=57||x===95||x===36||x===45}function T(O){return P(O,$)}function I(O){const x=O.charCodeAt(0);return x>=48&&x<=57}function U(O){return P(O,I)}function q(O){const x=O.charCodeAt(0);return x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102}function Z(O){return P(O,q)}function G(O){let x="",H="";for(;x=U(O);)H+=x;return H}function he(O){let x="";for(;;){const H=O.currentChar();if(H==="{"||H==="}"||H==="@"||H==="|"||!H)break;if(H===vn||H===ut)if(M(O))x+=H,O.next();else{if(C(O))break;x+=H,O.next()}else x+=H,O.next()}return x}function Te(O){_(O);let x="",H="";for(;x=T(O);)H+=x;return O.currentChar()===Xn&&f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),H}function Oe(O){_(O);let x="";return O.currentChar()==="-"?(O.next(),x+=`-${G(O)}`):x+=G(O),O.currentChar()===Xn&&f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),x}function fe(O){return O!==xm&&O!==ut}function we(O){_(O),b(O,"'");let x="",H="";for(;x=P(O,fe);)x==="\\"?H+=Me(O):H+=x;const Y=O.currentChar();return Y===ut||Y===Xn?(f(ne.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Y===ut&&(O.next(),b(O,"'")),H):(b(O,"'"),H)}function Me(O){const x=O.currentChar();switch(x){case"\\":case"'":return O.next(),`\\${x}`;case"u":return ke(O,x,4);case"U":return ke(O,x,6);default:return f(ne.UNKNOWN_ESCAPE_SEQUENCE,i(),0,x),""}}function ke(O,x,H){b(O,x);let Y="";for(let ve=0;ve<H;ve++){const me=Z(O);if(!me){f(ne.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${x}${Y}${O.currentChar()}`);break}Y+=me}return`\\${x}${Y}`}function _t(O){return O!=="{"&&O!=="}"&&O!==vn&&O!==ut}function ot(O){_(O);let x="",H="";for(;x=P(O,_t);)H+=x;return H}function At(O){let x="",H="";for(;x=F(O);)H+=x;return H}function Vt(O){const x=H=>{const Y=O.currentChar();return Y==="{"||Y==="@"||Y==="|"||Y==="("||Y===")"||!Y||Y===vn?H:(H+=Y,O.next(),x(H))};return x("")}function Et(O){_(O);const x=b(O,"|");return _(O),x}function dn(O,x){let H=null;switch(O.currentChar()){case"{":return x.braceNest>=1&&f(ne.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),O.next(),H=p(x,2,"{"),_(O),x.braceNest++,H;case"}":return x.braceNest>0&&x.currentType===2&&f(ne.EMPTY_PLACEHOLDER,i(),0),O.next(),H=p(x,3,"}"),x.braceNest--,x.braceNest>0&&_(O),x.inLinked&&x.braceNest===0&&(x.inLinked=!1),H;case"@":return x.braceNest>0&&f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),H=Ht(O,x)||m(x),x.braceNest=0,H;default:{let ve=!0,me=!0,le=!0;if(C(O))return x.braceNest>0&&f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),H=p(x,1,Et(O)),x.braceNest=0,x.inLinked=!1,H;if(x.braceNest>0&&(x.currentType===4||x.currentType===5||x.currentType===6))return f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),x.braceNest=0,Jt(O,x);if(ve=A(O,x))return H=p(x,4,Te(O)),_(O),H;if(me=d(O,x))return H=p(x,5,Oe(O)),_(O),H;if(le=g(O,x))return H=p(x,6,we(O)),_(O),H;if(!ve&&!me&&!le)return H=p(x,12,ot(O)),f(ne.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,H.value),_(O),H;break}}return H}function Ht(O,x){const{currentType:H}=x;let Y=null;const ve=O.currentChar();switch((H===7||H===8||H===11||H===9)&&(ve===ut||ve===vn)&&f(ne.INVALID_LINKED_FORMAT,i(),0),ve){case"@":return O.next(),Y=p(x,7,"@"),x.inLinked=!0,Y;case".":return _(O),O.next(),p(x,8,".");case":":return _(O),O.next(),p(x,9,":");default:return C(O)?(Y=p(x,1,Et(O)),x.braceNest=0,x.inLinked=!1,Y):h(O,x)||v(O,x)?(_(O),Ht(O,x)):w(O,x)?(_(O),p(x,11,At(O))):S(O,x)?(_(O),ve==="{"?dn(O,x)||Y:p(x,10,Vt(O))):(H===7&&f(ne.INVALID_LINKED_FORMAT,i(),0),x.braceNest=0,x.inLinked=!1,Jt(O,x))}}function Jt(O,x){let H={type:13};if(x.braceNest>0)return dn(O,x)||m(x);if(x.inLinked)return Ht(O,x)||m(x);switch(O.currentChar()){case"{":return dn(O,x)||m(x);case"}":return f(ne.UNBALANCED_CLOSING_BRACE,i(),0),O.next(),p(x,3,"}");case"@":return Ht(O,x)||m(x);default:{if(C(O))return H=p(x,1,Et(O)),x.braceNest=0,x.inLinked=!1,H;if(M(O))return p(x,0,he(O));break}}return H}function Sn(){const{currentType:O,offset:x,startLoc:H,endLoc:Y}=l;return l.lastType=O,l.lastOffset=x,l.lastStartLoc=H,l.lastEndLoc=Y,l.offset=o(),l.startLoc=i(),r.currentChar()===Xn?p(l,13):Jt(r,l)}return{nextToken:Sn,currentOffset:o,currentPosition:i,context:c}}const RS="parser",PS=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function IS(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function DS(t={}){const e=t.location!==!1,{onError:n}=t;function r(E,N,A,d,...g){const h=E.currentPosition();if(h.offset+=d,h.column+=d,n){const w=e?Nc(A,h):null,v=to(N,w,{domain:RS,args:g});n(v)}}function o(E,N,A){const d={type:E};return e&&(d.start=N,d.end=N,d.loc={start:A,end:A}),d}function i(E,N,A,d){e&&(E.end=N,E.loc&&(E.loc.end=A))}function s(E,N){const A=E.context(),d=o(3,A.offset,A.startLoc);return d.value=N,i(d,E.currentOffset(),E.currentPosition()),d}function a(E,N){const A=E.context(),{lastOffset:d,lastStartLoc:g}=A,h=o(5,d,g);return h.index=parseInt(N,10),E.nextToken(),i(h,E.currentOffset(),E.currentPosition()),h}function l(E,N){const A=E.context(),{lastOffset:d,lastStartLoc:g}=A,h=o(4,d,g);return h.key=N,E.nextToken(),i(h,E.currentOffset(),E.currentPosition()),h}function c(E,N){const A=E.context(),{lastOffset:d,lastStartLoc:g}=A,h=o(9,d,g);return h.value=N.replace(PS,IS),E.nextToken(),i(h,E.currentOffset(),E.currentPosition()),h}function u(E){const N=E.nextToken(),A=E.context(),{lastOffset:d,lastStartLoc:g}=A,h=o(8,d,g);return N.type!==11?(r(E,ne.UNEXPECTED_EMPTY_LINKED_MODIFIER,A.lastStartLoc,0),h.value="",i(h,d,g),{nextConsumeToken:N,node:h}):(N.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,ln(N)),h.value=N.value||"",i(h,E.currentOffset(),E.currentPosition()),{node:h})}function f(E,N){const A=E.context(),d=o(7,A.offset,A.startLoc);return d.value=N,i(d,E.currentOffset(),E.currentPosition()),d}function p(E){const N=E.context(),A=o(6,N.offset,N.startLoc);let d=E.nextToken();if(d.type===8){const g=u(E);A.modifier=g.node,d=g.nextConsumeToken||E.nextToken()}switch(d.type!==9&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),d=E.nextToken(),d.type===2&&(d=E.nextToken()),d.type){case 10:d.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),A.key=f(E,d.value||"");break;case 4:d.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),A.key=l(E,d.value||"");break;case 5:d.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),A.key=a(E,d.value||"");break;case 6:d.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),A.key=c(E,d.value||"");break;default:{r(E,ne.UNEXPECTED_EMPTY_LINKED_KEY,N.lastStartLoc,0);const g=E.context(),h=o(7,g.offset,g.startLoc);return h.value="",i(h,g.offset,g.startLoc),A.key=h,i(A,g.offset,g.startLoc),{nextConsumeToken:d,node:A}}}return i(A,E.currentOffset(),E.currentPosition()),{node:A}}function m(E){const N=E.context(),A=N.currentType===1?E.currentOffset():N.offset,d=N.currentType===1?N.endLoc:N.startLoc,g=o(2,A,d);g.items=[];let h=null;do{const S=h||E.nextToken();switch(h=null,S.type){case 0:S.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(S)),g.items.push(s(E,S.value||""));break;case 5:S.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(S)),g.items.push(a(E,S.value||""));break;case 4:S.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(S)),g.items.push(l(E,S.value||""));break;case 6:S.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(S)),g.items.push(c(E,S.value||""));break;case 7:{const C=p(E);g.items.push(C.node),h=C.nextConsumeToken||null;break}}}while(N.currentType!==13&&N.currentType!==1);const w=N.currentType===1?N.lastOffset:E.currentOffset(),v=N.currentType===1?N.lastEndLoc:E.currentPosition();return i(g,w,v),g}function b(E,N,A,d){const g=E.context();let h=d.items.length===0;const w=o(1,N,A);w.cases=[],w.cases.push(d);do{const v=m(E);h||(h=v.items.length===0),w.cases.push(v)}while(g.currentType!==13);return h&&r(E,ne.MUST_HAVE_MESSAGES_IN_PLURAL,A,0),i(w,E.currentOffset(),E.currentPosition()),w}function k(E){const N=E.context(),{offset:A,startLoc:d}=N,g=m(E);return N.currentType===13?g:b(E,A,d,g)}function _(E){const N=LS(E,He({},t)),A=N.context(),d=o(0,A.offset,A.startLoc);return e&&d.loc&&(d.loc.source=E),d.body=k(N),t.onCacheKey&&(d.cacheKey=t.onCacheKey(E)),A.currentType!==13&&r(N,ne.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,E[A.offset]||""),i(d,N.currentOffset(),N.currentPosition()),d}return{parse:_}}function ln(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function BS(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Lm(t,e){for(let n=0;n<t.length;n++)Ac(t[n],e)}function Ac(t,e){switch(t.type){case 1:Lm(t.cases,e),e.helper("plural");break;case 2:Lm(t.items,e);break;case 6:{Ac(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function FS(t,e={}){const n=BS(t);n.helper("normalize"),t.body&&Ac(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function $S(t){const e=t.body;return e.type===2?Rm(e):e.cases.forEach(n=>Rm(n)),t}function Rm(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Cc(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const VS="minifier";function no(t){switch(t.t=t.type,t.type){case 0:{const e=t;no(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)no(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)no(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;no(e.key),e.k=e.key,delete e.key,e.modifier&&(no(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:if(process.env.NODE_ENV!=="production")throw to(ne.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:VS,args:[t.type]})}delete t.type}const HS="parser";function zS(t,e){const{filename:n,breakLineCode:r,needIndent:o}=e,i=e.location!==!1,s={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};i&&t.loc&&(s.source=t.loc.source);const a=()=>s;function l(k,_){s.code+=k}function c(k,_=!0){const E=_?r:"";l(o?E+" ".repeat(k):E)}function u(k=!0){const _=++s.indentLevel;k&&c(_)}function f(k=!0){const _=--s.indentLevel;k&&c(_)}function p(){c(s.indentLevel)}return{context:a,push:l,indent:u,deindent:f,newline:p,helper:k=>`_${k}`,needIndent:()=>s.needIndent}}function jS(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),ro(t,e.key),e.modifier?(t.push(", "),ro(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function US(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const o=e.items.length;for(let i=0;i<o&&(ro(t,e.items[i]),i!==o-1);i++)t.push(", ");t.deindent(r()),t.push("])")}function WS(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const o=e.cases.length;for(let i=0;i<o&&(ro(t,e.cases[i]),i!==o-1);i++)t.push(", ");t.deindent(r()),t.push("])")}}function KS(t,e){e.body?ro(t,e.body):t.push("null")}function ro(t,e){const{helper:n}=t;switch(e.type){case 0:KS(t,e);break;case 1:WS(t,e);break;case 2:US(t,e);break;case 6:jS(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:if(process.env.NODE_ENV!=="production")throw to(ne.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:HS,args:[e.type]})}}const qS=(t,e={})=>{const n=K(e.mode)?e.mode:"normal",r=K(e.filename)?e.filename:"message.intl";e.sourceMap;const o=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
*/function JS(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vr().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ft(t){return ue(t)&&Oc(t)===0&&(qt(t,"b")||qt(t,"body"))}const Pm=["b","body"];function YS(t){return Qn(t,Pm)}const Im=["c","cases"];function XS(t){return Qn(t,Im,[])}const Dm=["s","static"];function QS(t){return Qn(t,Dm)}const Bm=["i","items"];function ZS(t){return Qn(t,Bm,[])}const Fm=["t","type"];function Oc(t){return Qn(t,Fm)}const $m=["v","value"];function Ws(t,e){const n=Qn(t,$m);if(n!=null)return n;throw ei(e)}const Vm=["m","modifier"];function eT(t){return Qn(t,Vm)}const Hm=["k","key"];function tT(t){const e=Qn(t,Hm);if(e)return e;throw ei(6)}function Qn(t,e,n){for(let r=0;r<e.length;r++){const o=e[r];if(qt(t,o)&&t[o]!=null)return t[o]}return n}const zm=[...Pm,...Im,...Dm,...Bm,...Hm,...Vm,...$m,...Fm];function ei(t){return new Error(`unhandled node type: ${t}`)}function Mc(t){return n=>nT(n,t)}function nT(t,e){const n=YS(e);if(n==null)throw ei(0);if(Oc(n)===1){const i=XS(n);return t.plural(i.reduce((s,a)=>[...s,jm(t,a)],[]))}else return jm(t,n)}function jm(t,e){const n=QS(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=ZS(e).reduce((o,i)=>[...o,xc(t,i)],[]);return t.normalize(r)}}function xc(t,e){const n=Oc(e);switch(n){case 3:return Ws(e,n);case 9:return Ws(e,n);case 4:{const r=e;if(qt(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(qt(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw ei(n)}case 5:{const r=e;if(qt(r,"i")&&Ve(r.i))return t.interpolate(t.list(r.i));if(qt(r,"index")&&Ve(r.index))return t.interpolate(t.list(r.index));throw ei(n)}case 6:{const r=e,o=eT(r),i=tT(r);return t.linked(xc(t,i),o?xc(t,o):void 0,t.type)}case 7:return Ws(e,n);case 8:return Ws(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const rT="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function oT(t,e){e&&SS(t)&&Yn(Hs(rT,{source:t}))}const iT=t=>t;let Ks=be();function sT(t,e={}){let n=!1;const r=e.onError||vS;return e.onError=o=>{n=!0,r(o)},{...GS(t,e),detectError:n}}function aT(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&K(t)){const n=de(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&oT(t,n);const o=(e.onCacheKey||iT)(t),i=Ks[o];if(i)return i;const{ast:s,detectError:a}=sT(t,{...e,location:process.env.NODE_ENV!=="production",jit:!0}),l=Mc(s);return a?l:Ks[o]=l}else{if(process.env.NODE_ENV!=="production"&&!Ft(t))return Yn(`the message that is resolve with key '${e.key}' is not supported for jit compilation`),()=>t;const n=t.cacheKey;if(n){const r=Ks[n];return r||(Ks[n]=Mc(t))}else return Mc(t)}}let ti=null;function lT(t){ti=t}function cT(t,e,n){ti&&ti.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const uT=dT("function:translate");function dT(t){return e=>ti&&ti.emit(t,e)}const tt={INVALID_ARGUMENT:_S,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},fT=24;function Cn(t){return to(t,null,process.env.NODE_ENV!=="production"?{messages:pT}:void 0)}const pT={[tt.INVALID_ARGUMENT]:"Invalid arguments",[tt.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[tt.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[tt.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[tt.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[tt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[tt.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function Lc(t,e){return e.locale!=null?Um(e.locale):Um(t.locale)}let Rc;function Um(t){if(K(t))return t;if(Ee(t)){if(t.resolvedOnce&&Rc!=null)return Rc;if(t.constructor.name==="Function"){const e=t();if(bS(e))throw Cn(tt.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Rc=e}else throw Cn(tt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Cn(tt.NOT_SUPPORT_LOCALE_TYPE)}function hT(t,e,n){return[...new Set([n,...xe(e)?e:ue(e)?Object.keys(e):K(e)?[e]:[n]])]}function Wm(t,e,n){const r=K(n)?n:ni,o=t;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(r);if(!i){i=[];let s=[n];for(;xe(s);)s=Km(i,s,e);const a=xe(e)||!ae(e)?e:e.default?e.default:null;s=K(a)?[a]:a,xe(s)&&Km(i,s,!1),o.__localeChainCache.set(r,i)}return i}function Km(t,e,n){let r=!0;for(let o=0;o<e.length&&de(r);o++){const i=e[o];K(i)&&(r=mT(t,e[o],n))}return r}function mT(t,e,n){let r;const o=e.split("-");do{const i=o.join("-");r=gT(t,i,n),o.splice(-1,1)}while(o.length&&r===!0);return r}function gT(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const o=e.replace(/!/g,"");t.push(o),(xe(n)||ae(n))&&n[o]&&(r=n[o])}return r}const Zn=[];Zn[0]={w:[0],i:[3,0],"[":[4],o:[7]},Zn[1]={w:[1],".":[2],"[":[4],o:[7]},Zn[2]={w:[2],i:[3,0],0:[3,0]},Zn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Zn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Zn[5]={"'":[4,0],o:8,l:[5,0]},Zn[6]={'"':[4,0],o:8,l:[6,0]};const bT=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function yT(t){return bT.test(t)}function wT(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function kT(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function _T(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:yT(e)?wT(e):"*"+e}function ET(t){const e=[];let n=-1,r=0,o=0,i,s,a,l,c,u,f;const p=[];p[0]=()=>{s===void 0?s=a:s+=a},p[1]=()=>{s!==void 0&&(e.push(s),s=void 0)},p[2]=()=>{p[0](),o++},p[3]=()=>{if(o>0)o--,r=4,p[0]();else{if(o=0,s===void 0||(s=_T(s),s===!1))return!1;p[1]()}};function m(){const b=t[n+1];if(r===5&&b==="'"||r===6&&b==='"')return n++,a="\\"+b,p[0](),!0}for(;r!==null;)if(n++,i=t[n],!(i==="\\"&&m())){if(l=kT(i),f=Zn[r],c=f[l]||f.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=p[c[1]],u&&(a=i,u()===!1))))return;if(r===7)return e}}const qm=new Map;function vT(t,e){return ue(t)?t[e]:null}function CT(t,e){if(!ue(t))return null;let n=qm.get(e);if(n||(n=ET(e),n&&qm.set(e,n)),!n)return null;const r=n.length;let o=t,i=0;for(;i<r;){const s=n[i];if(zm.includes(s)&&Ft(o))return null;const a=o[s];if(a===void 0||Ee(o))return null;o=a,i++}return o}const yt={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},ST=8,TT={[yt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[yt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[yt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[yt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[yt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[yt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[yt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Cr(t,...e){return Hs(TT[t],...e)}const NT="11.1.7",qs=-1,ni="en-US",Gs="",Gm=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function AT(){return{upper:(t,e)=>e==="text"&&K(t)?t.toUpperCase():e==="vnode"&&ue(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&K(t)?t.toLowerCase():e==="vnode"&&ue(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&K(t)?Gm(t):e==="vnode"&&ue(t)&&"__v_isVNode"in t?Gm(t.children):t}}let Jm;function OT(t){Jm=t}let Ym;function MT(t){Ym=t}let Xm;function xT(t){Xm=t}let Qm=null;const LT=t=>{Qm=t},RT=()=>Qm;let Zm=null;const eg=t=>{Zm=t},PT=()=>Zm;let tg=0;function IT(t={}){const e=Ee(t.onWarn)?t.onWarn:Yn,n=K(t.version)?t.version:NT,r=K(t.locale)||Ee(t.locale)?t.locale:ni,o=Ee(r)?ni:r,i=xe(t.fallbackLocale)||ae(t.fallbackLocale)||K(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:o,s=ae(t.messages)?t.messages:Pc(o),a=ae(t.datetimeFormats)?t.datetimeFormats:Pc(o),l=ae(t.numberFormats)?t.numberFormats:Pc(o),c=He(be(),t.modifiers,AT()),u=t.pluralRules||be(),f=Ee(t.missing)?t.missing:null,p=de(t.missingWarn)||eo(t.missingWarn)?t.missingWarn:!0,m=de(t.fallbackWarn)||eo(t.fallbackWarn)?t.fallbackWarn:!0,b=!!t.fallbackFormat,k=!!t.unresolving,_=Ee(t.postTranslation)?t.postTranslation:null,E=ae(t.processor)?t.processor:null,N=de(t.warnHtmlMessage)?t.warnHtmlMessage:!0,A=!!t.escapeParameter,d=Ee(t.messageCompiler)?t.messageCompiler:Jm;process.env.NODE_ENV!=="production"&&Ee(t.messageCompiler)&&Sc(Cr(yt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const g=Ee(t.messageResolver)?t.messageResolver:Ym||vT,h=Ee(t.localeFallbacker)?t.localeFallbacker:Xm||hT,w=ue(t.fallbackContext)?t.fallbackContext:void 0,v=t,S=ue(v.__datetimeFormatters)?v.__datetimeFormatters:new Map,C=ue(v.__numberFormatters)?v.__numberFormatters:new Map,M=ue(v.__meta)?v.__meta:{};tg++;const P={version:n,cid:tg,locale:r,fallbackLocale:i,messages:s,modifiers:c,pluralRules:u,missing:f,missingWarn:p,fallbackWarn:m,fallbackFormat:b,unresolving:k,postTranslation:_,processor:E,warnHtmlMessage:N,escapeParameter:A,messageCompiler:d,messageResolver:g,localeFallbacker:h,fallbackContext:w,onWarn:e,__meta:M};return P.datetimeFormats=a,P.numberFormats=l,P.__datetimeFormatters=S,P.__numberFormatters=C,process.env.NODE_ENV!=="production"&&(P.__v_emitter=v.__v_emitter!=null?v.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&cT(P,n,M),P}const Pc=t=>({[t]:be()});function Js(t,e){return t instanceof RegExp?t.test(e):t}function ng(t,e){return t instanceof RegExp?t.test(e):t}function Ic(t,e,n,r,o){const{missing:i,onWarn:s}=t;if(process.env.NODE_ENV!=="production"){const a=t.__v_emitter;a&&a.emit("missing",{locale:n,key:e,type:o,groupId:`${o}:${e}`})}if(i!==null){const a=i(t,n,e,o);return K(a)?a:e}else return process.env.NODE_ENV!=="production"&&ng(r,e)&&s(Cr(yt.NOT_FOUND_KEY,{key:e,locale:n})),e}function ri(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function rg(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function DT(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(rg(t,e[r]))return!0;return!1}const og=typeof Intl<"u",ig={dateTimeFormat:og&&typeof Intl.DateTimeFormat<"u",numberFormat:og&&typeof Intl.NumberFormat<"u"};function sg(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:i,localeFallbacker:s}=t,{__datetimeFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!ig.dateTimeFormat)return i(Cr(yt.CANNOT_FORMAT_DATE)),Gs;const[l,c,u,f]=Dc(...e),p=de(u.missingWarn)?u.missingWarn:t.missingWarn,m=de(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,b=!!u.part,k=Lc(t,u),_=s(t,o,k);if(!K(l)||l==="")return new Intl.DateTimeFormat(k,f).format(c);let E={},N,A=null,d=k,g=null;const h="datetime format";for(let S=0;S<_.length;S++){if(N=g=_[S],process.env.NODE_ENV!=="production"&&k!==N&&Js(m,l)&&i(Cr(yt.FALLBACK_TO_DATE_FORMAT,{key:l,target:N})),process.env.NODE_ENV!=="production"&&k!==N){const C=t.__v_emitter;C&&C.emit("fallback",{type:h,key:l,from:d,to:g,groupId:`${h}:${l}`})}if(E=n[N]||{},A=E[l],ae(A))break;Ic(t,l,N,p,h),d=g}if(!ae(A)||!K(N))return r?qs:l;let w=`${N}__${l}`;zs(f)||(w=`${w}__${JSON.stringify(f)}`);let v=a.get(w);return v||(v=new Intl.DateTimeFormat(N,He({},A,f)),a.set(w,v)),b?v.formatToParts(c):v.format(c)}const ag=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Dc(...t){const[e,n,r,o]=t,i=be();let s=be(),a;if(K(e)){const l=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!l)throw Cn(tt.INVALID_ISO_DATE_ARGUMENT);const c=l[3]?l[3].trim().startsWith("T")?`${l[1].trim()}${l[3].trim()}`:`${l[1].trim()}T${l[3].trim()}`:l[1].trim();a=new Date(c);try{a.toISOString()}catch{throw Cn(tt.INVALID_ISO_DATE_ARGUMENT)}}else if(hS(e)){if(isNaN(e.getTime()))throw Cn(tt.INVALID_DATE_ARGUMENT);a=e}else if(Ve(e))a=e;else throw Cn(tt.INVALID_ARGUMENT);return K(n)?i.key=n:ae(n)&&Object.keys(n).forEach(l=>{ag.includes(l)?s[l]=n[l]:i[l]=n[l]}),K(r)?i.locale=r:ae(r)&&(s=r),ae(o)&&(s=o),[i.key||"",a,i,s]}function lg(t,e,n){const r=t;for(const o in n){const i=`${e}__${o}`;r.__datetimeFormatters.has(i)&&r.__datetimeFormatters.delete(i)}}function cg(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:i,localeFallbacker:s}=t,{__numberFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!ig.numberFormat)return i(Cr(yt.CANNOT_FORMAT_NUMBER)),Gs;const[l,c,u,f]=Bc(...e),p=de(u.missingWarn)?u.missingWarn:t.missingWarn,m=de(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,b=!!u.part,k=Lc(t,u),_=s(t,o,k);if(!K(l)||l==="")return new Intl.NumberFormat(k,f).format(c);let E={},N,A=null,d=k,g=null;const h="number format";for(let S=0;S<_.length;S++){if(N=g=_[S],process.env.NODE_ENV!=="production"&&k!==N&&Js(m,l)&&i(Cr(yt.FALLBACK_TO_NUMBER_FORMAT,{key:l,target:N})),process.env.NODE_ENV!=="production"&&k!==N){const C=t.__v_emitter;C&&C.emit("fallback",{type:h,key:l,from:d,to:g,groupId:`${h}:${l}`})}if(E=n[N]||{},A=E[l],ae(A))break;Ic(t,l,N,p,h),d=g}if(!ae(A)||!K(N))return r?qs:l;let w=`${N}__${l}`;zs(f)||(w=`${w}__${JSON.stringify(f)}`);let v=a.get(w);return v||(v=new Intl.NumberFormat(N,He({},A,f)),a.set(w,v)),b?v.formatToParts(c):v.format(c)}const ug=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Bc(...t){const[e,n,r,o]=t,i=be();let s=be();if(!Ve(e))throw Cn(tt.INVALID_ARGUMENT);const a=e;return K(n)?i.key=n:ae(n)&&Object.keys(n).forEach(l=>{ug.includes(l)?s[l]=n[l]:i[l]=n[l]}),K(r)?i.locale=r:ae(r)&&(s=r),ae(o)&&(s=o),[i.key||"",a,i,s]}function dg(t,e,n){const r=t;for(const o in n){const i=`${e}__${o}`;r.__numberFormatters.has(i)&&r.__numberFormatters.delete(i)}}const BT=t=>t,FT=t=>"",$T="text",VT=t=>t.length===0?"":Cc(t),HT=yS;function fg(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function zT(t){const e=Ve(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Ve(t.named.count)||Ve(t.named.n))?Ve(t.named.count)?t.named.count:Ve(t.named.n)?t.named.n:e:e}function jT(t,e){e.count||(e.count=t),e.n||(e.n=t)}function UT(t={}){const e=t.locale,n=zT(t),r=ue(t.pluralRules)&&K(e)&&Ee(t.pluralRules[e])?t.pluralRules[e]:fg,o=ue(t.pluralRules)&&K(e)&&Ee(t.pluralRules[e])?fg:void 0,i=E=>E[r(n,E.length,o)],s=t.list||[],a=E=>s[E],l=t.named||be();Ve(t.pluralIndex)&&jT(n,l);const c=E=>l[E];function u(E,N){const A=Ee(t.messages)?t.messages(E,!!N):ue(t.messages)?t.messages[E]:!1;return A||(t.parent?t.parent.message(E):FT)}const f=E=>t.modifiers?t.modifiers[E]:BT,p=ae(t.processor)&&Ee(t.processor.normalize)?t.processor.normalize:VT,m=ae(t.processor)&&Ee(t.processor.interpolate)?t.processor.interpolate:HT,b=ae(t.processor)&&K(t.processor.type)?t.processor.type:$T,_={list:a,named:c,plural:i,linked:(E,...N)=>{const[A,d]=N;let g="text",h="";N.length===1?ue(A)?(h=A.modifier||h,g=A.type||g):K(A)&&(h=A||h):N.length===2&&(K(A)&&(h=A||h),K(d)&&(g=d||g));const w=u(E,!0)(_),v=g==="vnode"&&xe(w)&&h?w[0]:w;return h?f(h)(v,g):v},message:u,type:b,interpolate:m,normalize:p,values:He(be(),s,l)};return _}const pg=()=>"",$t=t=>Ee(t);function hg(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:i,fallbackLocale:s,messages:a}=t,[l,c]=Fc(...e),u=de(c.missingWarn)?c.missingWarn:t.missingWarn,f=de(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,p=de(c.escapeParameter)?c.escapeParameter:t.escapeParameter,m=!!c.resolvedMessage,b=K(c.default)||de(c.default)?de(c.default)?i?l:()=>l:c.default:n?i?l:()=>l:null,k=n||b!=null&&(K(b)||Ee(b)),_=Lc(t,c);p&&WT(c);let[E,N,A]=m?[l,_,a[_]||be()]:mg(t,l,_,s,f,u),d=E,g=l;if(!m&&!(K(d)||Ft(d)||$t(d))&&k&&(d=b,g=d),!m&&(!(K(d)||Ft(d)||$t(d))||!K(N)))return o?qs:l;if(process.env.NODE_ENV!=="production"&&K(d)&&t.messageCompiler==null)return Yn(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${l}'.`),l;let h=!1;const w=()=>{h=!0},v=$t(d)?d:gg(t,l,N,d,g,w);if(h)return d;const S=JT(t,N,A,c),C=UT(S),M=KT(t,v,C),P=r?r(M,l):M;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const D={timestamp:Date.now(),key:K(l)?l:$t(d)?d.key:"",locale:N||($t(d)?d.locale:""),format:K(d)?d:$t(d)?d.source:"",message:P};D.meta=He({},t.__meta,RT()||{}),uT(D)}return P}function WT(t){xe(t.list)?t.list=t.list.map(e=>K(e)?Nm(e):e):ue(t.named)&&Object.keys(t.named).forEach(e=>{K(t.named[e])&&(t.named[e]=Nm(t.named[e]))})}function mg(t,e,n,r,o,i){const{messages:s,onWarn:a,messageResolver:l,localeFallbacker:c}=t,u=c(t,r,n);let f=be(),p,m=null,b=n,k=null;const _="translate";for(let E=0;E<u.length;E++){if(p=k=u[E],process.env.NODE_ENV!=="production"&&n!==p&&!rg(n,p)&&Js(o,e)&&a(Cr(yt.FALLBACK_TO_TRANSLATE,{key:e,target:p})),process.env.NODE_ENV!=="production"&&n!==p){const g=t.__v_emitter;g&&g.emit("fallback",{type:_,key:e,from:b,to:k,groupId:`${_}:${e}`})}f=s[p]||be();let N=null,A,d;if(process.env.NODE_ENV!=="production"&&Kt&&(N=window.performance.now(),A="intlify-message-resolve-start",d="intlify-message-resolve-end",Nt&&Nt(A)),(m=l(f,e))===null&&(m=f[e]),process.env.NODE_ENV!=="production"&&Kt){const g=window.performance.now(),h=t.__v_emitter;h&&N&&m&&h.emit("message-resolve",{type:"message-resolve",key:e,message:m,time:g-N,groupId:`${_}:${e}`}),A&&d&&Nt&&Er&&(Nt(d),Er("intlify message resolve",A,d))}if(K(m)||Ft(m)||$t(m))break;if(!DT(p,u)){const g=Ic(t,e,p,i,_);g!==e&&(m=g)}b=k}return[m,p,f]}function gg(t,e,n,r,o,i){const{messageCompiler:s,warnHtmlMessage:a}=t;if($t(r)){const p=r;return p.locale=p.locale||n,p.key=p.key||e,p}if(s==null){const p=()=>r;return p.locale=n,p.key=e,p}let l=null,c,u;process.env.NODE_ENV!=="production"&&Kt&&(l=window.performance.now(),c="intlify-message-compilation-start",u="intlify-message-compilation-end",Nt&&Nt(c));const f=s(r,qT(t,n,o,r,a,i));if(process.env.NODE_ENV!=="production"&&Kt){const p=window.performance.now(),m=t.__v_emitter;m&&l&&m.emit("message-compilation",{type:"message-compilation",message:r,time:p-l,groupId:`translate:${e}`}),c&&u&&Nt&&Er&&(Nt(u),Er("intlify message compilation",c,u))}return f.locale=n,f.key=e,f.source=r,f}function KT(t,e,n){let r=null,o,i;process.env.NODE_ENV!=="production"&&Kt&&(r=window.performance.now(),o="intlify-message-evaluation-start",i="intlify-message-evaluation-end",Nt&&Nt(o));const s=e(n);if(process.env.NODE_ENV!=="production"&&Kt){const a=window.performance.now(),l=t.__v_emitter;l&&r&&l.emit("message-evaluation",{type:"message-evaluation",value:s,time:a-r,groupId:`translate:${e.key}`}),o&&i&&Nt&&Er&&(Nt(i),Er("intlify message evaluation",o,i))}return s}function Fc(...t){const[e,n,r]=t,o=be();if(!K(e)&&!Ve(e)&&!$t(e)&&!Ft(e))throw Cn(tt.INVALID_ARGUMENT);const i=Ve(e)?String(e):($t(e),e);return Ve(n)?o.plural=n:K(n)?o.default=n:ae(n)&&!zs(n)?o.named=n:xe(n)&&(o.list=n),Ve(r)?o.plural=r:K(r)?o.default=r:ae(r)&&He(o,r),[i,o]}function qT(t,e,n,r,o,i){return{locale:e,key:n,warnHtmlMessage:o,onError:s=>{if(i&&i(s),process.env.NODE_ENV!=="production"){const a=GT(r),l=`Message compilation error: ${s.message}`,c=s.location&&a&&wS(a,s.location.start.offset,s.location.end.offset),u=t.__v_emitter;u&&a&&u.emit("compile-error",{message:a,error:s.message,start:s.location&&s.location.start.offset,end:s.location&&s.location.end.offset,groupId:`translate:${n}`}),console.error(c?`${l}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[cn.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function ii(t,...e){return Hs(a3[t],...e)}function si(t){if(!ue(t)||Ft(t))return t;for(const e in t)if(qt(t,e))if(!e.includes("."))ue(t[e])&&si(t[e]);else{const n=e.split("."),r=n.length-1;let o=t,i=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in o||(o[n[s]]=be()),!ue(o[n[s]])){process.env.NODE_ENV!=="production"&&Yn(ii(cn.IGNORE_OBJ_FLATTEN,{key:n[s]})),i=!0;break}o=o[n[s]]}if(i||(Ft(o)?zm.includes(n[r])||delete t[e]:(o[n[r]]=t[e],delete t[e])),!Ft(o)){const s=o[n[r]];ue(s)&&si(s)}}return t}function Uc(t,e){const{messages:n,__i18n:r,messageResolver:o,flatJson:i}=e,s=ae(n)?n:xe(r)?be():{[t]:be()};if(xe(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(s[l]=s[l]||be(),Us(c,s[l])):Us(c,s)}else K(a)&&Us(JSON.parse(a),s)}),o==null&&i)for(const a in s)qt(s,a)&&si(s[a]);return s}function kg(t){return t.type}function _g(t,e,n){let r=ue(e.messages)?e.messages:be();"__i18nGlobal"in n&&(r=Uc(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(i=>{t.mergeLocaleMessage(i,r[i])});{if(ue(e.datetimeFormats)){const i=Object.keys(e.datetimeFormats);i.length&&i.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(ue(e.numberFormats)){const i=Object.keys(e.numberFormats);i.length&&i.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function Eg(t){return y.createVNode(y.Text,null,t,0)}const vg="__INTLIFY_META__",Cg=()=>[],l3=()=>!1;let Sg=0;function Tg(t){return(e,n,r,o)=>t(n,r,y.getCurrentInstance()||void 0,o)}const c3=()=>{const t=y.getCurrentInstance();let e=null;return t&&(e=kg(t)[vg])?{[vg]:e}:null};function Wc(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,o=t.flatJson,i=Kt?y.ref:y.shallowRef;let s=de(t.inheritLocale)?t.inheritLocale:!0;const a=i(e&&s?e.locale.value:K(t.locale)?t.locale:ni),l=i(e&&s?e.fallbackLocale.value:K(t.fallbackLocale)||xe(t.fallbackLocale)||ae(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:a.value),c=i(Uc(a.value,t)),u=i(ae(t.datetimeFormats)?t.datetimeFormats:{[a.value]:{}}),f=i(ae(t.numberFormats)?t.numberFormats:{[a.value]:{}});let p=e?e.missingWarn:de(t.missingWarn)||eo(t.missingWarn)?t.missingWarn:!0,m=e?e.fallbackWarn:de(t.fallbackWarn)||eo(t.fallbackWarn)?t.fallbackWarn:!0,b=e?e.fallbackRoot:de(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,_=Ee(t.missing)?t.missing:null,E=Ee(t.missing)?Tg(t.missing):null,N=Ee(t.postTranslation)?t.postTranslation:null,A=e?e.warnHtmlMessage:de(t.warnHtmlMessage)?t.warnHtmlMessage:!0,d=!!t.escapeParameter;const g=e?e.modifiers:ae(t.modifiers)?t.modifiers:{};let h=t.pluralRules||e&&e.pluralRules,w;w=(()=>{r&&eg(null);const R={version:o3,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:g,pluralRules:h,missing:E===null?void 0:E,missingWarn:p,fallbackWarn:m,fallbackFormat:k,unresolving:!0,postTranslation:N===null?void 0:N,warnHtmlMessage:A,escapeParameter:d,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};R.datetimeFormats=u.value,R.numberFormats=f.value,R.__datetimeFormatters=ae(w)?w.__datetimeFormatters:void 0,R.__numberFormatters=ae(w)?w.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(R.__v_emitter=ae(w)?w.__v_emitter:void 0);const z=IT(R);return r&&eg(z),z})(),ri(w,a.value,l.value);function S(){return[a.value,l.value,c.value,u.value,f.value]}const C=y.computed({get:()=>a.value,set:R=>{w.locale=R,a.value=R}}),M=y.computed({get:()=>l.value,set:R=>{w.fallbackLocale=R,l.value=R,ri(w,a.value,R)}}),P=y.computed(()=>c.value),D=y.computed(()=>u.value),F=y.computed(()=>f.value);function $(){return Ee(N)?N:null}function T(R){N=R,w.postTranslation=R}function I(){return _}function U(R){R!==null&&(E=Tg(R)),_=R,w.missing=E}function q(R,z){return R!=="translate"||!z.resolvedMessage}const Z=(R,z,ce,Ne,Tn,ao)=>{S();let er;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(w.fallbackContext=e?PT():void 0),er=R(w)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(w.fallbackContext=void 0)}if(ce!=="translate exists"&&Ve(er)&&er===qs||ce==="translate exists"&&!er){const[Nn,bu]=z();if(process.env.NODE_ENV!=="production"&&e&&K(Nn)&&q(ce,bu)&&(b&&(Js(m,Nn)||ng(p,Nn))&&Yn(ii(cn.FALLBACK_TO_ROOT,{key:Nn,type:ce})),process.env.NODE_ENV!=="production")){const{__v_emitter:B}=w;B&&b&&B.emit("fallback",{type:ce,key:Nn,to:"global",groupId:`${ce}:${Nn}`})}return e&&b?Ne(e):Tn(Nn)}else{if(ao(er))return er;throw dt(ye.UNEXPECTED_RETURN_TYPE)}};function G(...R){return Z(z=>Reflect.apply(hg,null,[z,...R]),()=>Fc(...R),"translate",z=>Reflect.apply(z.t,z,[...R]),z=>z,z=>K(z))}function he(...R){const[z,ce,Ne]=R;if(Ne&&!ue(Ne))throw dt(ye.INVALID_ARGUMENT);return G(z,ce,He({resolvedMessage:!0},Ne||{}))}function Te(...R){return Z(z=>Reflect.apply(sg,null,[z,...R]),()=>Dc(...R),"datetime format",z=>Reflect.apply(z.d,z,[...R]),()=>Gs,z=>K(z)||xe(z))}function Oe(...R){return Z(z=>Reflect.apply(cg,null,[z,...R]),()=>Bc(...R),"number format",z=>Reflect.apply(z.n,z,[...R]),()=>Gs,z=>K(z)||xe(z))}function fe(R){return R.map(z=>K(z)||Ve(z)||de(z)?Eg(String(z)):z)}const Me={normalize:fe,interpolate:R=>R,type:"vnode"};function ke(...R){return Z(z=>{let ce;const Ne=z;try{Ne.processor=Me,ce=Reflect.apply(hg,null,[Ne,...R])}finally{Ne.processor=null}return ce},()=>Fc(...R),"translate",z=>z[Vc](...R),z=>[Eg(z)],z=>xe(z))}function _t(...R){return Z(z=>Reflect.apply(cg,null,[z,...R]),()=>Bc(...R),"number format",z=>z[zc](...R),Cg,z=>K(z)||xe(z))}function ot(...R){return Z(z=>Reflect.apply(sg,null,[z,...R]),()=>Dc(...R),"datetime format",z=>z[Hc](...R),Cg,z=>K(z)||xe(z))}function At(R){h=R,w.pluralRules=h}function Vt(R,z){return Z(()=>{if(!R)return!1;const ce=K(z)?z:a.value,Ne=Ht(ce),Tn=w.messageResolver(Ne,R);return Ft(Tn)||$t(Tn)||K(Tn)},()=>[R],"translate exists",ce=>Reflect.apply(ce.te,ce,[R,z]),l3,ce=>de(ce))}function Et(R){let z=null;const ce=Wm(w,l.value,a.value);for(let Ne=0;Ne<ce.length;Ne++){const Tn=c.value[ce[Ne]]||{},ao=w.messageResolver(Tn,R);if(ao!=null){z=ao;break}}return z}function dn(R){const z=Et(R);return z??(e?e.tm(R)||{}:{})}function Ht(R){return c.value[R]||{}}function Jt(R,z){if(o){const ce={[R]:z};for(const Ne in ce)qt(ce,Ne)&&si(ce[Ne]);z=ce[R]}c.value[R]=z,w.messages=c.value}function Sn(R,z){c.value[R]=c.value[R]||{};const ce={[R]:z};if(o)for(const Ne in ce)qt(ce,Ne)&&si(ce[Ne]);z=ce[R],Us(z,c.value[R]),w.messages=c.value}function O(R){return u.value[R]||{}}function x(R,z){u.value[R]=z,w.datetimeFormats=u.value,lg(w,R,z)}function H(R,z){u.value[R]=He(u.value[R]||{},z),w.datetimeFormats=u.value,lg(w,R,z)}function Y(R){return f.value[R]||{}}function ve(R,z){f.value[R]=z,w.numberFormats=f.value,dg(w,R,z)}function me(R,z){f.value[R]=He(f.value[R]||{},z),w.numberFormats=f.value,dg(w,R,z)}Sg++,e&&Kt&&(y.watch(e.locale,R=>{s&&(a.value=R,w.locale=R,ri(w,a.value,l.value))}),y.watch(e.fallbackLocale,R=>{s&&(l.value=R,w.fallbackLocale=R,ri(w,a.value,l.value))}));const le={id:Sg,locale:C,fallbackLocale:M,get inheritLocale(){return s},set inheritLocale(R){s=R,R&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,ri(w,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:P,get modifiers(){return g},get pluralRules(){return h||{}},get isGlobal(){return r},get missingWarn(){return p},set missingWarn(R){p=R,w.missingWarn=p},get fallbackWarn(){return m},set fallbackWarn(R){m=R,w.fallbackWarn=m},get fallbackRoot(){return b},set fallbackRoot(R){b=R},get fallbackFormat(){return k},set fallbackFormat(R){k=R,w.fallbackFormat=k},get warnHtmlMessage(){return A},set warnHtmlMessage(R){A=R,w.warnHtmlMessage=R},get escapeParameter(){return d},set escapeParameter(R){d=R,w.escapeParameter=R},t:G,getLocaleMessage:Ht,setLocaleMessage:Jt,mergeLocaleMessage:Sn,getPostTranslationHandler:$,setPostTranslationHandler:T,getMissingHandler:I,setMissingHandler:U,[yg]:At};return le.datetimeFormats=D,le.numberFormats=F,le.rt=he,le.te=Vt,le.tm=dn,le.d=Te,le.n=Oe,le.getDateTimeFormat=O,le.setDateTimeFormat=x,le.mergeDateTimeFormat=H,le.getNumberFormat=Y,le.setNumberFormat=ve,le.mergeNumberFormat=me,le[wg]=n,le[Vc]=ke,le[Hc]=ot,le[zc]=_t,process.env.NODE_ENV!=="production"&&(le[Sr]=R=>{w.__v_emitter=R},le[oi]=()=>{w.__v_emitter=void 0}),le}const Ng="vue-i18n: composer properties",Kc={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},u3={"vue-i18n-resource-inspector":"Search for scopes ..."},d3={"vue-i18n-timeline":16764185};let qc;async function f3(t,e){return new Promise((n,r)=>{try{r3({id:"vue-devtools-plugin-vue-i18n",label:Kc["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[Ng],app:t},o=>{qc=o,o.on.visitComponentTree(({componentInstance:s,treeNode:a})=>{p3(s,a,e)}),o.on.inspectComponent(({componentInstance:s,instanceData:a})=>{s.vnode.el&&s.vnode.el.__VUE_I18N__&&a&&(e.mode==="legacy"?s.vnode.el.__VUE_I18N__!==e.global.__composer&&Og(a,s.vnode.el.__VUE_I18N__):Og(a,s.vnode.el.__VUE_I18N__))}),o.addInspector({id:"vue-i18n-resource-inspector",label:Kc["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:u3["vue-i18n-resource-inspector"]}),o.on.getInspectorTree(s=>{s.app===t&&s.inspectorId==="vue-i18n-resource-inspector"&&y3(s,e)});const i=new Map;o.on.getInspectorState(async s=>{if(s.app===t&&s.inspectorId==="vue-i18n-resource-inspector")if(o.unhighlightElement(),k3(s,e),s.nodeId==="global"){if(!i.has(s.app)){const[a]=await o.getComponentInstances(s.app);i.set(s.app,a)}o.highlightElement(i.get(s.app))}else{const a=w3(s.nodeId,e);a&&o.highlightElement(a)}}),o.on.editInspectorState(s=>{s.app===t&&s.inspectorId==="vue-i18n-resource-inspector"&&E3(s,e)}),o.addTimelineLayer({id:"vue-i18n-timeline",label:Kc["vue-i18n-timeline"],color:d3["vue-i18n-timeline"]}),n(!0)})}catch(o){console.error(o),r(!1)}})}function Ag(t){return t.type.name||t.type.displayName||t.type.__file||"Anonymous"}function p3(t,e,n){const r=n.mode==="composition"?n.global:n.global.__composer;if(t&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&t.vnode.el.__VUE_I18N__!==r){const o={label:`i18n (${Ag(t)} Scope)`,textColor:0,backgroundColor:16764185};e.tags.push(o)}}function Og(t,e){const n=Ng;t.state.push({type:n,key:"locale",editable:!0,value:e.locale.value}),t.state.push({type:n,key:"availableLocales",editable:!1,value:e.availableLocales}),t.state.push({type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value}),t.state.push({type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}),t.state.push({type:n,key:"messages",editable:!1,value:Gc(e.messages.value)}),t.state.push({type:n,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}),t.state.push({type:n,key:"numberFormats",editable:!1,value:e.numberFormats.value})}function Gc(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];Ee(r)&&"source"in r?e[n]=b3(r):Ft(r)&&r.loc&&r.loc.source?e[n]=r.loc.source:ue(r)?e[n]=Gc(r):e[n]=r}),e}const h3={"<":"<",">":">",'"':""","&":"&"};function m3(t){return t.replace(/[<>"&]/g,g3)}function g3(t){return h3[t]||t}function b3(t){return{_custom:{type:"function",display:`<span>ƒ</span> ${t.source?`("${m3(t.source)}")`:"(?)"}`}}}function y3(t,e){t.rootNodes.push({id:"global",label:"Global Scope"});const n=e.mode==="composition"?e.global:e.global.__composer;for(const[r,o]of e.__instances){const i=e.mode==="composition"?o:o.__composer;n!==i&&t.rootNodes.push({id:i.id.toString(),label:`${Ag(r)} Scope`})}}function w3(t,e){let n=null;if(t!=="global"){for(const[r,o]of e.__instances.entries())if(o.id.toString()===t){n=r;break}}return n}function Mg(t,e){if(t==="global")return e.mode==="composition"?e.global:e.global.__composer;{const n=Array.from(e.__instances.values()).find(r=>r.id.toString()===t);return n?e.mode==="composition"?n:n.__composer:null}}function k3(t,e){const n=Mg(t.nodeId,e);return n&&(t.state=_3(n)),null}function _3(t){const e={},n="Locale related info",r=[{type:n,key:"locale",editable:!0,value:t.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:t.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}];e[n]=r;const o="Locale messages info",i=[{type:o,key:"messages",editable:!1,value:Gc(t.messages.value)}];e[o]=i;{const s="Datetime formats info",a=[{type:s,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}];e[s]=a;const l="Datetime formats info",c=[{type:l,key:"numberFormats",editable:!1,value:t.numberFormats.value}];e[l]=c}return e}function ai(t,e){if(qc){let n;e&&"groupId"in e&&(n=e.groupId,delete e.groupId),qc.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:t,groupId:n,time:Date.now(),meta:{},data:e||{},logType:t==="compile-error"?"error":t==="fallback"||t==="missing"?"warning":"default"}})}}function E3(t,e){const n=Mg(t.nodeId,e);if(n){const[r]=t.path;r==="locale"&&K(t.state.value)?n.locale.value=t.state.value:r==="fallbackLocale"&&(K(t.state.value)||xe(t.state.value)||ue(t.state.value))?n.fallbackLocale.value=t.state.value:r==="inheritLocale"&&de(t.state.value)&&(n.inheritLocale=t.state.value)}}function v3(t){const e=K(t.locale)?t.locale:ni,n=K(t.fallbackLocale)||xe(t.fallbackLocale)||ae(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=Ee(t.missing)?t.missing:void 0,o=de(t.silentTranslationWarn)||eo(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,i=de(t.silentFallbackWarn)||eo(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,s=de(t.fallbackRoot)?t.fallbackRoot:!0,a=!!t.formatFallbackMessages,l=ae(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,u=Ee(t.postTranslation)?t.postTranslation:void 0,f=K(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,p=!!t.escapeParameterHtml,m=de(t.sync)?t.sync:!0;let b=t.messages;if(ae(t.sharedMessages)){const g=t.sharedMessages;b=Object.keys(g).reduce((w,v)=>{const S=w[v]||(w[v]={});return He(S,g[v]),w},b||{})}const{__i18n:k,__root:_,__injectWithOption:E}=t,N=t.datetimeFormats,A=t.numberFormats,d=t.flatJson;return{locale:e,fallbackLocale:n,messages:b,flatJson:d,datetimeFormats:N,numberFormats:A,missing:r,missingWarn:o,fallbackWarn:i,fallbackRoot:s,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:u,warnHtmlMessage:f,escapeParameter:p,messageResolver:t.messageResolver,inheritLocale:m,__i18n:k,__root:_,__injectWithOption:E}}function Jc(t={}){const e=Wc(v3(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(o){e.locale.value=o},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(o){e.fallbackLocale.value=o},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(o){e.setMissingHandler(o)},get silentTranslationWarn(){return de(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(o){e.missingWarn=de(o)?!o:o},get silentFallbackWarn(){return de(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(o){e.fallbackWarn=de(o)?!o:o},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(o){e.fallbackFormat=o},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(o){e.setPostTranslationHandler(o)},get sync(){return e.inheritLocale},set sync(o){e.inheritLocale=o},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){e.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(o){e.escapeParameter=o},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...o){return Reflect.apply(e.t,e,[...o])},rt(...o){return Reflect.apply(e.rt,e,[...o])},te(o,i){return e.te(o,i)},tm(o){return e.tm(o)},getLocaleMessage(o){return e.getLocaleMessage(o)},setLocaleMessage(o,i){e.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){e.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(e.d,e,[...o])},getDateTimeFormat(o){return e.getDateTimeFormat(o)},setDateTimeFormat(o,i){e.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){e.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(e.n,e,[...o])},getNumberFormat(o){return e.getNumberFormat(o)},setNumberFormat(o,i){e.setNumberFormat(o,i)},mergeNumberFormat(o,i){e.mergeNumberFormat(o,i)}};return r.__extender=n,process.env.NODE_ENV!=="production"&&(r.__enableEmitter=o=>{const i=e;i[Sr]&&i[Sr](o)},r.__disableEmitter=()=>{const o=e;o[oi]&&o[oi]()}),r}function C3(t,e,n){return{beforeCreate(){const r=y.getCurrentInstance();if(!r)throw dt(ye.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=e,this===this.$root)this.$i18n=xg(t,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Jc(i);const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=xg(t,o);else{this.$i18n=Jc({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=t;o.__i18nGlobal&&_g(e,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,s)=>this.$i18n.te(i,s),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(r,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const r=this.$i18n;this.$el.__VUE_I18N__=r.__composer;const o=this.__v_emitter=Tc();r.__enableEmitter&&r.__enableEmitter(o),o.on("*",ai)}},unmounted(){const r=y.getCurrentInstance();if(!r)throw dt(ye.UNEXPECTED_ERROR);const o=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",ai),delete this.__v_emitter),this.$i18n&&(o.__disableEmitter&&o.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(r),delete this.$i18n}}}function xg(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[yg](e.pluralizationRules||t.pluralizationRules);const n=Uc(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const Yc={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function S3({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,o)=>[...r,...o.type===y.Fragment?o.children:[o]],[]):e.reduce((n,r)=>{const o=t[r];return o&&(n[r]=o()),n},be())}function Lg(){return y.Fragment}const Rg=y.defineComponent({name:"i18n-t",props:He({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Ve(t)||!isNaN(t)}},Yc),setup(t,e){const{slots:n,attrs:r}=e,o=t.i18n||Ys({useScope:t.scope,__useComponent:!0});return()=>{const i=Object.keys(n).filter(f=>f[0]!=="_"),s=be();t.locale&&(s.locale=t.locale),t.plural!==void 0&&(s.plural=K(t.plural)?+t.plural:t.plural);const a=S3(e,i),l=o[Vc](t.keypath,a,s),c=He(be(),r),u=K(t.tag)||ue(t.tag)?t.tag:Lg();return y.h(u,c,l)}}});function T3(t){return xe(t)&&!K(t[0])}function Pg(t,e,n,r){const{slots:o,attrs:i}=e;return()=>{const s={part:!0};let a=be();t.locale&&(s.locale=t.locale),K(t.format)?s.key=t.format:ue(t.format)&&(K(t.format.key)&&(s.key=t.format.key),a=Object.keys(t.format).reduce((p,m)=>n.includes(m)?He(be(),p,{[m]:t.format[m]}):p,be()));const l=r(t.value,s,a);let c=[s.key];xe(l)?c=l.map((p,m)=>{const b=o[p.type],k=b?b({[p.type]:p.value,index:m,parts:l}):[p.value];return T3(k)&&(k[0].key=`${p.type}-${m}`),k}):K(l)&&(c=[l]);const u=He(be(),i),f=K(t.tag)||ue(t.tag)?t.tag:Lg();return y.h(f,u,c)}}const Ig=y.defineComponent({name:"i18n-n",props:He({value:{type:Number,required:!0},format:{type:[String,Object]}},Yc),setup(t,e){const n=t.i18n||Ys({useScope:t.scope,__useComponent:!0});return Pg(t,e,ug,(...r)=>n[zc](...r))}});function N3(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function A3(t){const e=s=>{process.env.NODE_ENV!=="production"&&Sc(ii(cn.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:a,value:l}=s;if(!a||!a.$)throw dt(ye.UNEXPECTED_ERROR);const c=N3(t,a.$),u=Dg(l);return[Reflect.apply(c.t,c,[...Bg(u)]),c]};return{created:(s,a)=>{const[l,c]=e(a);Kt&&t.global===c&&(s.__i18nWatcher=y.watch(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),s.__composer=c,s.textContent=l},unmounted:s=>{Kt&&s.__i18nWatcher&&(s.__i18nWatcher(),s.__i18nWatcher=void 0,delete s.__i18nWatcher),s.__composer&&(s.__composer=void 0,delete s.__composer)},beforeUpdate:(s,{value:a})=>{if(s.__composer){const l=s.__composer,c=Dg(a);s.textContent=Reflect.apply(l.t,l,[...Bg(c)])}},getSSRProps:s=>{const[a]=e(s);return{textContent:a}}}}function Dg(t){if(K(t))return{path:t};if(ae(t)){if(!("path"in t))throw dt(ye.REQUIRED_VALUE,"path");return t}else throw dt(ye.INVALID_VALUE)}function Bg(t){const{path:e,locale:n,args:r,choice:o,plural:i}=t,s={},a=r||{};return K(n)&&(s.locale=n),Ve(o)&&(s.plural=o),Ve(i)&&(s.plural=i),[e,a,s]}function O3(t,e,...n){const r=ae(n[0])?n[0]:{};(de(r.globalInstall)?r.globalInstall:!0)&&([Rg.name,"I18nT"].forEach(i=>t.component(i,Rg)),[Ig.name,"I18nN"].forEach(i=>t.component(i,Ig)),[$g.name,"I18nD"].forEach(i=>t.component(i,$g))),t.directive("t",A3(e))}const M3=an("global-vue-i18n");function x3(t={}){const e=__VUE_I18N_LEGACY_API__&&de(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&e&&Sc(ii(cn.DEPRECATE_LEGACY_MODE));const n=de(t.globalInjection)?t.globalInjection:!0,r=new Map,[o,i]=L3(t,e),s=an(process.env.NODE_ENV!=="production"?"vue-i18n":"");function a(f){return r.get(f)||null}function l(f,p){r.set(f,p)}function c(f){r.delete(f)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(f,...p){if(process.env.NODE_ENV!=="production"&&(f.__VUE_I18N__=u),f.__VUE_I18N_SYMBOL__=s,f.provide(f.__VUE_I18N_SYMBOL__,u),ae(p[0])){const k=p[0];u.__composerExtend=k.__composerExtend,u.__vueI18nExtend=k.__vueI18nExtend}let m=null;!e&&n&&(m=V3(f,u.global)),__VUE_I18N_FULL_INSTALL__&&O3(f,u,...p),__VUE_I18N_LEGACY_API__&&e&&f.mixin(C3(i,i.__composer,u));const b=f.unmount;if(f.unmount=()=>{m&&m(),u.dispose(),b()},process.env.NODE_ENV!=="production"){if(!await f3(f,u))throw dt(ye.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const _=Tc();if(e){const E=i;E.__enableEmitter&&E.__enableEmitter(_)}else{const E=i;E[Sr]&&E[Sr](_)}_.on("*",ai)}},get global(){return i},dispose(){o.stop()},__instances:r,__getInstance:a,__setInstance:l,__deleteInstance:c};return u}function Ys(t={}){const e=y.getCurrentInstance();if(e==null)throw dt(ye.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw dt(ye.NOT_INSTALLED);const n=R3(e),r=I3(n),o=kg(e),i=P3(t,o);if(i==="global")return _g(r,t,o),r;if(i==="parent"){let l=D3(n,e,t.__useComponent);return l==null&&(process.env.NODE_ENV!=="production"&&Yn(ii(cn.NOT_FOUND_PARENT_SCOPE)),l=r),l}const s=n;let a=s.__getInstance(e);if(a==null){const l=He({},t);"__i18n"in o&&(l.__i18n=o.__i18n),r&&(l.__root=r),a=Wc(l),s.__composerExtend&&(a[jc]=s.__composerExtend(a)),F3(s,e,a),s.__setInstance(e,a)}else if(process.env.NODE_ENV!=="production"&&i==="local")throw dt(ye.DUPLICATE_USE_I18N_CALLING);return a}function L3(t,e){const n=y.effectScope(),r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>Jc(t)):n.run(()=>Wc(t));if(r==null)throw dt(ye.UNEXPECTED_ERROR);return[n,r]}function R3(t){const e=y.inject(t.isCE?M3:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw dt(t.isCE?ye.NOT_INSTALLED_WITH_PROVIDE:ye.UNEXPECTED_ERROR);return e}function P3(t,e){return zs(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function I3(t){return t.mode==="composition"?t.global:t.global.__composer}function D3(t,e,n=!1){let r=null;const o=e.root;let i=B3(e,n);for(;i!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const a=s.__getInstance(i);a!=null&&(r=a.__composer,n&&r&&!r[wg]&&(r=null))}if(r!=null||o===i)break;i=i.parent}return r}function B3(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function F3(t,e,n){let r=null;y.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=Tc();const o=n;o[Sr]&&o[Sr](r),r.on("*",ai)}},e),y.onUnmounted(()=>{const o=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",ai),o[oi]&&o[oi](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const i=o[jc];i&&(i(),delete o[jc])},e)}const $3=["locale","fallbackLocale","availableLocales"],Fg=["t","rt","d","n","tm","te"];function V3(t,e){const n=Object.create(null);return $3.forEach(o=>{const i=Object.getOwnPropertyDescriptor(e,o);if(!i)throw dt(ye.UNEXPECTED_ERROR);const s=y.isRef(i.value)?{get(){return i.value.value},set(a){i.value.value=a}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,s)}),t.config.globalProperties.$i18n=n,Fg.forEach(o=>{const i=Object.getOwnPropertyDescriptor(e,o);if(!i||!i.value)throw dt(ye.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${o}`,i)}),()=>{delete t.config.globalProperties.$i18n,Fg.forEach(o=>{delete t.config.globalProperties[`$${o}`]})}}const $g=y.defineComponent({name:"i18n-d",props:He({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Yc),setup(t,e){const n=t.i18n||Ys({useScope:t.scope,__useComponent:!0});return Pg(t,e,ag,(...r)=>n[Hc](...r))}});if(i3(),OT(aT),MT(CT),xT(Wm),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=vr();t.__INTLIFY__=!0,lT(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const H3={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},z3={__name:"vs-editor-link",props:{editor:Object},setup(t){const{t:e}=Ys(),n=t,r=y.ref(!1),o=y.ref(""),i=()=>{n.editor.chain().focus().toggleLink({href:o.value}).run(),r.value=!1,o.value=""};return(s,a)=>(y.openBlock(),y.createElementBlock(y.Fragment,null,[y.createElementVNode("button",{onClick:a[0]||(a[0]=l=>r.value=!0),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},a[4]||(a[4]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])),y.createVNode(qC,{title:y.unref(e)("tiptap.linkTitle"),visible:r.value,"onUpdate:visible":a[3]||(a[3]=l=>r.value=l),size:"small"},{footer:y.withCtx(()=>[y.createElementVNode("div",H3,[y.createElementVNode("button",{style:{border:"1px solid #000"},onClick:a[2]||(a[2]=l=>{r.value=!1,o.value=""}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},y.toDisplayString(y.unref(e)("tiptap.cancel")),1),y.createElementVNode("button",{onClick:i,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},y.toDisplayString(y.unref(e)("tiptap.create")),1)])]),default:y.withCtx(()=>[y.createVNode(Sm,{modelValue:o.value,"onUpdate:modelValue":a[1]||(a[1]=l=>o.value=l),placeholder:y.unref(e)("tiptap.linkTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["title","visible"])],64))}},j3={class:"flex flex-col gap-[2px] p-[2px]"},U3=["onClick"],W3={__name:"vs-editor-table",props:{editor:Object},setup(t){const{$t:e}=y.getCurrentInstance().proxy,n=t,r=y.ref(!1),o=y.ref("popover"),i=()=>{n.editor&&(n.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),o.value.togglePopover())},s=()=>{n.editor&&(n.editor.chain().focus().addColumnAfter().run(),o.value.togglePopover())},a=()=>{n.editor&&(n.editor.chain().focus().addRowAfter().run(),o.value.togglePopover())},l=()=>{n.editor&&(n.editor.chain().focus().deleteColumn().run(),o.value.togglePopover())},c=()=>{n.editor&&(n.editor.chain().focus().deleteRow().run(),o.value.togglePopover())},u=()=>{n.editor&&(n.editor.chain().focus().deleteTable().run(),o.value.togglePopover())},f=[{text:e("tiptap.createTable"),function:i},{text:e("tiptap.addColumn"),function:s},{text:e("tiptap.addRow"),function:a},{text:e("tiptap.deleteColumn"),function:l},{text:e("tiptap.deleteRow"),function:c},{text:e("tiptap.deleteTable"),function:u}];return(p,m)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:m[0]||(m[0]=b=>r.value=b)},{reference:y.withCtx(()=>[y.createElementVNode("button",{class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},m[1]||(m[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),y.createElementVNode("path",{d:"M3 10h18"}),y.createElementVNode("path",{d:"M10 3v18"})],-1)]),2)]),default:y.withCtx(()=>[y.createElementVNode("div",j3,[(y.openBlock(),y.createElementBlock(y.Fragment,null,y.renderList(f,(b,k)=>y.createElementVNode("button",{key:k,onClick:b?.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},y.toDisplayString(b.text),9,U3)),64))])]),_:1},512))}},K3={},q3={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function G3(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",q3,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M8 12l8 0"},null,-1),y.createElementVNode("path",{d:"M6 18l12 0"},null,-1)]))}const J3=et(K3,[["render",G3]]),Y3={},X3={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function Q3(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",X3,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M10 12l10 0"},null,-1),y.createElementVNode("path",{d:"M6 18l14 0"},null,-1)]))}const Z3=et(Y3,[["render",Q3]]),eN={},tN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function nN(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",tN,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M4 12l10 0"},null,-1),y.createElementVNode("path",{d:"M4 18l14 0"},null,-1)]))}const Vg={left:et(eN,[["render",nN]]),center:J3,right:Z3},rN={class:"flex gap-[4px] p-1"},oN=["onClick"],iN={__name:"vs-editor-align",props:{editor:Object},setup(t){const e=t,n=y.ref(!1),r=y.ref("popover"),o=y.ref("left"),i=y.computed(()=>e.editor?.isActive({textAlign:"left"})),s=y.computed(()=>e.editor?.isActive({textAlign:"right"})),a=y.computed(()=>e.editor?.isActive({textAlign:"center"})),l=u=>{e.editor&&e.editor.chain().focus().setTextAlign(u).run()},c=y.ref([{id:"left",isActive:i},{id:"center",isActive:a},{id:"right",isActive:s}]);return(u,f)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:r,placement:"bottom",onIsvisible:f[0]||(f[0]=p=>n.value=p)},{reference:y.withCtx(()=>[y.createElementVNode("button",{class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(Vg)[o.value]),{height:"16",width:"16"}))],2)]),default:y.withCtx(()=>[y.createElementVNode("div",rN,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(c.value,p=>(y.openBlock(),y.createElementBlock("button",{class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":p?.isActive}]),key:p?.id,onClick:m=>l(p?.id)},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(Vg)[p?.id]),{height:"16",width:"16"}))],10,oN))),128))])]),_:1},512))}},sN={class:"flex flex-col gap-[2px] p-[2px]"},aN=["onClick"],lN={__name:"vs-editor-type-tag",props:{editor:Object},setup(t){const{$t:e}=y.getCurrentInstance().proxy,n=t,r=y.ref(!1),o=y.ref("popover"),i=()=>{n.editor&&(n.editor?.chain().focus().setParagraph().run(),o.value.togglePopover())},s=l=>{n.editor&&(n.editor?.chain().focus().toggleHeading({level:l}).run(),o.value.togglePopover())},a=[{text:"Заголовок 1",id:1,style:"font-[700] text-[30px]"},{text:"Заголовок 2",id:2,style:"font-[700] text-[26px]"},{text:"Заголовок 3",id:3,style:"font-[700] text-[22px]"},{text:"Заголовок 4",id:4,style:"font-[700] text-[18px]"},{text:"Заголовок 5",id:5,style:"font-[500] text-[16px]"},{text:"Заголовок 6",id:6,style:"font-[400] text-[14px]"}];return(l,c)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:c[0]||(c[0]=u=>r.value=u)},{reference:y.withCtx(()=>[y.createElementVNode("button",{class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},c[1]||(c[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 7v-2h13v2"}),y.createElementVNode("path",{d:"M10 5v14"}),y.createElementVNode("path",{d:"M12 19h-4"}),y.createElementVNode("path",{d:"M15 13v-1h6v1"}),y.createElementVNode("path",{d:"M18 12v7"}),y.createElementVNode("path",{d:"M17 19h2"})],-1)]),2)]),default:y.withCtx(()=>[y.createElementVNode("div",sN,[y.createElementVNode("button",{onClick:i,class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[t.editor?.isActive("paragraph")?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)("tiptap.paragraph")),3),(y.openBlock(),y.createElementBlock(y.Fragment,null,y.renderList(a,(u,f)=>y.createElementVNode("button",{key:f,onClick:p=>s(u?.id),class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[u?.style,t.editor?.isActive("heading",{level:u?.id})?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)(`tiptap.heading${u?.id}`)),11,aN)),64))])]),_:1},512))}},cN={},uN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function dN(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",uN,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const fN=et(cN,[["render",dN]]),pN={components:{VsText:Sm},events:["update:modelValue"],props:{modelValue:{type:String,default:()=>"#000000"},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}}},hN={class:"flex items-center w-full"},mN=["disabled"];function gN(t,e,n,r,o,i){const s=y.resolveComponent("vs-text");return y.openBlock(),y.createElementBlock("div",hN,[y.withDirectives(y.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.value=a),type:"color",class:y.normalizeClass(["w-10 h-10 py-[2px] px-[3px] dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",n.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:n.disabled},null,10,mN),[[y.vModelText,i.value]]),n.isTextInputShown?(y.openBlock(),y.createBlock(s,{key:0,modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=a=>i.value=a),class:"ml-2 w-full",disabled:n.disabled,clearable:n.clearable},null,8,["modelValue","disabled","clearable"])):y.createCommentVNode("",!0)])}const bN=et(pN,[["render",gN]]),yN={class:"w-[30px] h-[30px] rounded-full hover:bg-gray-100 justify-center items-center relative flex"},wN={class:"w-[160px]"},kN={class:"flex gap-[4px] mb-[8px]"},_N={class:"flex w-[160px] flex-wrap gap-[4px]"},EN=["onClick"],Hg={bold:AC,italic:xC,color:BC,color_picker:{__name:"vs-editor-colorpicker",props:{editor:Object},setup(t){const e=t,n=y.ref("popover"),r=y.ref("#000000"),o=y.ref("#000000"),i=y.ref(["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]),s=l=>{e.editor&&(e.editor.chain().focus().setColor(l).run(),o.value=l,n.value&&n.value.togglePopover())},a=()=>{s(r.value),r.value=""};return(l,c)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",yN,[c[1]||(c[1]=y.createElementVNode("svg",{class:"text-gray-500",height:"16",width:"16","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"})],-1)),y.createElementVNode("span",{class:"absolute h-[2px] w-[40%] bottom-[10px] left-[9px]",style:y.normalizeStyle({backgroundColor:o.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",wN,[y.createElementVNode("div",kN,[y.createVNode(bN,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:a,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(fN,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("ul",_N,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,u=>(y.openBlock(),y.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:y.normalizeStyle({backgroundColor:u}),onClick:f=>s(u),key:u},null,12,EN))),128))])])]),_:1},512))}},bullet_list:wC,ordered_list:EC,blockquote:gC,codeblock:SC,underline:FC,strike:$C,link:z3,table:W3,text_align:iN,type_tag:lN};function zg(t,e){return function(){return t.apply(e,arguments)}}const{toString:vN}=Object.prototype,{getPrototypeOf:Xc}=Object,{iterator:Xs,toStringTag:jg}=Symbol,Qs=(t=>e=>{const n=vN.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Gt=t=>(t=t.toLowerCase(),e=>Qs(e)===t),Zs=t=>e=>typeof e===t,{isArray:io}=Array,li=Zs("undefined");function CN(t){return t!==null&&!li(t)&&t.constructor!==null&&!li(t.constructor)&&wt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ug=Gt("ArrayBuffer");function SN(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ug(t.buffer),e}const TN=Zs("string"),wt=Zs("function"),Wg=Zs("number"),ea=t=>t!==null&&typeof t=="object",NN=t=>t===!0||t===!1,ta=t=>{if(Qs(t)!=="object")return!1;const e=Xc(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(jg in t)&&!(Xs in t)},AN=Gt("Date"),ON=Gt("File"),MN=Gt("Blob"),xN=Gt("FileList"),LN=t=>ea(t)&&wt(t.pipe),RN=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||wt(t.append)&&((e=Qs(t))==="formdata"||e==="object"&&wt(t.toString)&&t.toString()==="[object FormData]"))},PN=Gt("URLSearchParams"),[IN,DN,BN,FN]=["ReadableStream","Request","Response","Headers"].map(Gt),$N=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ci(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),io(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(r=0;r<s;r++)a=i[r],e.call(null,t[a],a,t)}}function Kg(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const Tr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qg=t=>!li(t)&&t!==Tr;function Qc(){const{caseless:t}=qg(this)&&this||{},e={},n=(r,o)=>{const i=t&&Kg(e,o)||o;ta(e[i])&&ta(r)?e[i]=Qc(e[i],r):ta(r)?e[i]=Qc({},r):io(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&ci(arguments[r],n);return e}const VN=(t,e,n,{allOwnKeys:r}={})=>(ci(e,(o,i)=>{n&&wt(o)?t[i]=zg(o,n):t[i]=o},{allOwnKeys:r}),t),HN=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),zN=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},jN=(t,e,n,r)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&Xc(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},UN=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},WN=t=>{if(!t)return null;if(io(t))return t;let e=t.length;if(!Wg(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},KN=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Xc(Uint8Array)),qN=(t,e)=>{const r=(t&&t[Xs]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},GN=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},JN=Gt("HTMLFormElement"),YN=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Gg=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),XN=Gt("RegExp"),Jg=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ci(n,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(r[i]=s||o)}),Object.defineProperties(t,r)},QN=t=>{Jg(t,(e,n)=>{if(wt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(wt(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ZN=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return io(t)?r(t):r(String(t).split(e)),n},eA=()=>{},tA=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function nA(t){return!!(t&&wt(t.append)&&t[jg]==="FormData"&&t[Xs])}const rA=t=>{const e=new Array(10),n=(r,o)=>{if(ea(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const i=io(r)?[]:{};return ci(r,(s,a)=>{const l=n(s,o+1);!li(l)&&(i[a]=l)}),e[o]=void 0,i}}return r};return n(t,0)},oA=Gt("AsyncFunction"),iA=t=>t&&(ea(t)||wt(t))&&wt(t.then)&&wt(t.catch),Yg=((t,e)=>t?setImmediate:e?((n,r)=>(Tr.addEventListener("message",({source:o,data:i})=>{o===Tr&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Tr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wt(Tr.postMessage)),sA=typeof queueMicrotask<"u"?queueMicrotask.bind(Tr):typeof process<"u"&&process.nextTick||Yg,L={isArray:io,isArrayBuffer:Ug,isBuffer:CN,isFormData:RN,isArrayBufferView:SN,isString:TN,isNumber:Wg,isBoolean:NN,isObject:ea,isPlainObject:ta,isReadableStream:IN,isRequest:DN,isResponse:BN,isHeaders:FN,isUndefined:li,isDate:AN,isFile:ON,isBlob:MN,isRegExp:XN,isFunction:wt,isStream:LN,isURLSearchParams:PN,isTypedArray:KN,isFileList:xN,forEach:ci,merge:Qc,extend:VN,trim:$N,stripBOM:HN,inherits:zN,toFlatObject:jN,kindOf:Qs,kindOfTest:Gt,endsWith:UN,toArray:WN,forEachEntry:qN,matchAll:GN,isHTMLForm:JN,hasOwnProperty:Gg,hasOwnProp:Gg,reduceDescriptors:Jg,freezeMethods:QN,toObjectSet:ZN,toCamelCase:YN,noop:eA,toFiniteNumber:tA,findKey:Kg,global:Tr,isContextDefined:qg,isSpecCompliantForm:nA,toJSONObject:rA,isAsyncFn:oA,isThenable:iA,setImmediate:Yg,asap:sA,isIterable:t=>t!=null&&wt(t[Xs])};function oe(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}L.inherits(oe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.status}}});const Xg=oe.prototype,Qg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Qg[t]={value:t}}),Object.defineProperties(oe,Qg),Object.defineProperty(Xg,"isAxiosError",{value:!0}),oe.from=(t,e,n,r,o,i)=>{const s=Object.create(Xg);return L.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),oe.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const aA=null;function Zc(t){return L.isPlainObject(t)||L.isArray(t)}function Zg(t){return L.endsWith(t,"[]")?t.slice(0,-2):t}function e0(t,e,n){return t?t.concat(e).map(function(o,i){return o=Zg(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function lA(t){return L.isArray(t)&&!t.some(Zc)}const cA=L.toFlatObject(L,{},null,function(e){return/^is[A-Z]/.test(e)});function na(t,e,n){if(!L.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,_){return!L.isUndefined(_[k])});const r=n.metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&L.isSpecCompliantForm(e);if(!L.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(L.isDate(b))return b.toISOString();if(L.isBoolean(b))return b.toString();if(!l&&L.isBlob(b))throw new oe("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(b)||L.isTypedArray(b)?l&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,k,_){let E=b;if(b&&!_&&typeof b=="object"){if(L.endsWith(k,"{}"))k=r?k:k.slice(0,-2),b=JSON.stringify(b);else if(L.isArray(b)&&lA(b)||(L.isFileList(b)||L.endsWith(k,"[]"))&&(E=L.toArray(b)))return k=Zg(k),E.forEach(function(A,d){!(L.isUndefined(A)||A===null)&&e.append(s===!0?e0([k],d,i):s===null?k:k+"[]",c(A))}),!1}return Zc(b)?!0:(e.append(e0(_,k,i),c(b)),!1)}const f=[],p=Object.assign(cA,{defaultVisitor:u,convertValue:c,isVisitable:Zc});function m(b,k){if(!L.isUndefined(b)){if(f.indexOf(b)!==-1)throw Error("Circular reference detected in "+k.join("."));f.push(b),L.forEach(b,function(E,N){(!(L.isUndefined(E)||E===null)&&o.call(e,E,L.isString(N)?N.trim():N,k,p))===!0&&m(E,k?k.concat(N):[N])}),f.pop()}}if(!L.isObject(t))throw new TypeError("data must be an object");return m(t),e}function t0(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function eu(t,e){this._pairs=[],t&&na(t,this,e)}const n0=eu.prototype;n0.append=function(e,n){this._pairs.push([e,n])},n0.toString=function(e){const n=e?function(r){return e.call(this,r,t0)}:t0;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function uA(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function r0(t,e,n){if(!e)return t;const r=n&&n.encode||uA;L.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(e,n):i=L.isURLSearchParams(e)?e.toString():new eu(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class o0{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,function(r){r!==null&&e(r)})}}const i0={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dA={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:eu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},tu=typeof window<"u"&&typeof document<"u",nu=typeof navigator=="object"&&navigator||void 0,fA=tu&&(!nu||["ReactNative","NativeScript","NS"].indexOf(nu.product)<0),pA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hA=tu&&window.location.href||"http://localhost",nt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tu,hasStandardBrowserEnv:fA,hasStandardBrowserWebWorkerEnv:pA,navigator:nu,origin:hA},Symbol.toStringTag,{value:"Module"})),...dA};function mA(t,e){return na(t,new nt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return nt.isNode&&L.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function gA(t){return L.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function bA(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}function s0(t){function e(n,r,o,i){let s=n[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=i>=n.length;return s=!s&&L.isArray(o)?o.length:s,l?(L.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!L.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&L.isArray(o[s])&&(o[s]=bA(o[s])),!a)}if(L.isFormData(t)&&L.isFunction(t.entries)){const n={};return L.forEachEntry(t,(r,o)=>{e(gA(r),o,n,0)}),n}return null}function yA(t,e,n){if(L.isString(t))try{return(e||JSON.parse)(t),L.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const ui={transitional:i0,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=L.isObject(e);if(i&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return o?JSON.stringify(s0(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e)||L.isReadableStream(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return mA(e,this.formSerializer).toString();if((a=L.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return na(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),yA(e)):e}],transformResponse:[function(e){const n=this.transitional||ui.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(L.isResponse(e)||L.isReadableStream(e))return e;if(e&&L.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?oe.from(a,oe.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nt.classes.FormData,Blob:nt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],t=>{ui.headers[t]={}});const wA=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kA=t=>{const e={};let n,r,o;return t&&t.split(`
|
|
139
|
-
`
|
|
140
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[a0]=this[a0]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=di(s);r[a]||(CA(o,s),r[a]=!0)}return L.isArray(e)?e.forEach(i):i(e),this}};kt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(kt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),L.freezeMethods(kt);function ou(t,e){const n=this||ui,r=e||n,o=kt.from(r.headers);let i=r.data;return L.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function l0(t){return!!(t&&t.__CANCEL__)}function so(t,e,n){oe.call(this,t??"canceled",oe.ERR_CANCELED,e,n),this.name="CanceledError"}L.inherits(so,oe,{__CANCEL__:!0});function c0(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new oe("Request failed with status code "+n.status,[oe.ERR_BAD_REQUEST,oe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function SA(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function TA(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[i];s||(s=c),n[o]=l,r[o]=c;let f=i,p=0;for(;f!==o;)p+=n[f++],f=f%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),c-s<e)return;const m=u&&c-u;return m?Math.round(p*1e3/m):void 0}}function NA(t,e){let n=0,r=1e3/e,o,i;const s=(c,u=Date.now())=>{n=u,o=null,i&&(clearTimeout(i),i=null),t.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?s(c,u):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},r-f)))},()=>o&&s(o)]}const oa=(t,e,n=3)=>{let r=0;const o=TA(50,250);return NA(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,l=s-r,c=o(l),u=s<=a;r=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(f)},n)},u0=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},d0=t=>(...e)=>L.asap(()=>t(...e)),AA=nt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,nt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(nt.origin),nt.navigator&&/(msie|trident)/i.test(nt.navigator.userAgent)):()=>!0,OA=nt.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];L.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),L.isString(r)&&s.push("path="+r),L.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function MA(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function xA(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function f0(t,e,n){let r=!MA(e);return t&&(r||n==!1)?xA(t,e):e}const p0=t=>t instanceof kt?{...t}:t;function Nr(t,e){e=e||{};const n={};function r(c,u,f,p){return L.isPlainObject(c)&&L.isPlainObject(u)?L.merge.call({caseless:p},c,u):L.isPlainObject(u)?L.merge({},u):L.isArray(u)?u.slice():u}function o(c,u,f,p){if(L.isUndefined(u)){if(!L.isUndefined(c))return r(void 0,c,f,p)}else return r(c,u,f,p)}function i(c,u){if(!L.isUndefined(u))return r(void 0,u)}function s(c,u){if(L.isUndefined(u)){if(!L.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u,f)=>o(p0(c),p0(u),f,!0)};return L.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||o,p=f(t[u],e[u],u);L.isUndefined(p)&&f!==a||(n[u]=p)}),n}const h0=t=>{const e=Nr({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;e.headers=s=kt.from(s),e.url=r0(f0(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(L.isFormData(n)){if(nt.hasStandardBrowserEnv||nt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(nt.hasStandardBrowserEnv&&(r&&L.isFunction(r)&&(r=r(e)),r||r!==!1&&AA(e.url))){const c=o&&i&&OA.read(i);c&&s.set(o,c)}return e},LA=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=h0(t);let i=o.data;const s=kt.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,f,p,m,b;function k(){m&&m(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function E(){if(!_)return;const A=kt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),g={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:A,config:t,request:_};c0(function(w){n(w),k()},function(w){r(w),k()},g),_=null}"onloadend"in _?_.onloadend=E:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(E)},_.onabort=function(){_&&(r(new oe("Request aborted",oe.ECONNABORTED,t,_)),_=null)},_.onerror=function(){r(new oe("Network Error",oe.ERR_NETWORK,t,_)),_=null},_.ontimeout=function(){let d=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const g=o.transitional||i0;o.timeoutErrorMessage&&(d=o.timeoutErrorMessage),r(new oe(d,g.clarifyTimeoutError?oe.ETIMEDOUT:oe.ECONNABORTED,t,_)),_=null},i===void 0&&s.setContentType(null),"setRequestHeader"in _&&L.forEach(s.toJSON(),function(d,g){_.setRequestHeader(g,d)}),L.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),c&&([p,b]=oa(c,!0),_.addEventListener("progress",p)),l&&_.upload&&([f,m]=oa(l),_.upload.addEventListener("progress",f),_.upload.addEventListener("loadend",m)),(o.cancelToken||o.signal)&&(u=A=>{_&&(r(!A||A.type?new so(null,t,_):A),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const N=SA(o.url);if(N&&nt.protocols.indexOf(N)===-1){r(new oe("Unsupported protocol "+N+":",oe.ERR_BAD_REQUEST,t));return}_.send(i||null)})},RA=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const i=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof oe?u:new so(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,i(new oe(`timeout ${e} of ms exceeded`,oe.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),t=null)};t.forEach(c=>c.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>L.asap(a),l}},PA=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},IA=async function*(t,e){for await(const n of DA(t))yield*PA(n,e)},DA=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},m0=(t,e,n,r)=>{const o=IA(t,e);let i=0,s,a=l=>{s||(s=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let f=u.byteLength;if(n){let p=i+=f;n(p)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},ia=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",g0=ia&&typeof ReadableStream=="function",BA=ia&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),b0=(t,...e)=>{try{return!!t(...e)}catch{return!1}},FA=g0&&b0(()=>{let t=!1;const e=new Request(nt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),y0=64*1024,iu=g0&&b0(()=>L.isReadableStream(new Response("").body)),sa={stream:iu&&(t=>t.body)};ia&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!sa[e]&&(sa[e]=L.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new oe(`Response type '${e}' is not supported`,oe.ERR_NOT_SUPPORT,r)})})})(new Response);const $A=async t=>{if(t==null)return 0;if(L.isBlob(t))return t.size;if(L.isSpecCompliantForm(t))return(await new Request(nt.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(L.isArrayBufferView(t)||L.isArrayBuffer(t))return t.byteLength;if(L.isURLSearchParams(t)&&(t=t+""),L.isString(t))return(await BA(t)).byteLength},VA=async(t,e)=>{const n=L.toFiniteNumber(t.getContentLength());return n??$A(e)},su={http:aA,xhr:LA,fetch:ia&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:p}=h0(t);c=c?(c+"").toLowerCase():"text";let m=RA([o,i&&i.toAbortSignal()],s),b;const k=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let _;try{if(l&&FA&&n!=="get"&&n!=="head"&&(_=await VA(u,r))!==0){let g=new Request(e,{method:"POST",body:r,duplex:"half"}),h;if(L.isFormData(r)&&(h=g.headers.get("content-type"))&&u.setContentType(h),g.body){const[w,v]=u0(_,oa(d0(l)));r=m0(g.body,y0,w,v)}}L.isString(f)||(f=f?"include":"omit");const E="credentials"in Request.prototype;b=new Request(e,{...p,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:E?f:void 0});let N=await fetch(b,p);const A=iu&&(c==="stream"||c==="response");if(iu&&(a||A&&k)){const g={};["status","statusText","headers"].forEach(S=>{g[S]=N[S]});const h=L.toFiniteNumber(N.headers.get("content-length")),[w,v]=a&&u0(h,oa(d0(a),!0))||[];N=new Response(m0(N.body,y0,w,()=>{v&&v(),k&&k()}),g)}c=c||"text";let d=await sa[L.findKey(sa,c)||"text"](N,t);return!A&&k&&k(),await new Promise((g,h)=>{c0(g,h,{data:d,headers:kt.from(N.headers),status:N.status,statusText:N.statusText,config:t,request:b})})}catch(E){throw k&&k(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new oe("Network Error",oe.ERR_NETWORK,t,b),{cause:E.cause||E}):oe.from(E,E&&E.code,t,b)}})};L.forEach(su,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const w0=t=>`- ${t}`,HA=t=>L.isFunction(t)||t===null||t===!1,k0={getAdapter:t=>{t=L.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){n=t[i];let s;if(r=n,!HA(n)&&(r=su[(s=String(n)).toLowerCase()],r===void 0))throw new oe(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since :
|
|
141
|
-
`+i.map(w0).join(`
|
|
142
|
-
`):" "+w0(i[0]):"as no adapter specified";throw new oe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:su};function au(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new so(null,t)}function _0(t){return au(t),t.headers=kt.from(t.headers),t.data=ou.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),k0.getAdapter(t.adapter||ui.adapter)(t).then(function(r){return au(t),r.data=ou.call(t,t.transformResponse,r),r.headers=kt.from(r.headers),r},function(r){return l0(r)||(au(t),r&&r.response&&(r.response.data=ou.call(t,t.transformResponse,r.response),r.response.headers=kt.from(r.response.headers))),Promise.reject(r)})}const E0="1.10.0",aa={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{aa[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const v0={};aa.transitional=function(e,n,r){function o(i,s){return"[Axios v"+E0+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new oe(o(s," has been removed"+(n?" in "+n:"")),oe.ERR_DEPRECATED);return n&&!v0[s]&&(v0[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}},aa.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function zA(t,e,n){if(typeof t!="object")throw new oe("options must be an object",oe.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const a=t[i],l=a===void 0||s(a,i,t);if(l!==!0)throw new oe("option "+i+" must be "+l,oe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new oe("Unknown option "+i,oe.ERR_BAD_OPTION)}}const la={assertOptions:zA,validators:aa},un=la.validators;let Ar=class{constructor(e){this.defaults=e||{},this.interceptors={request:new o0,response:new o0}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
143
|
-
`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Nr(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&la.assertOptions(r,{silentJSONParsing:un.transitional(un.boolean),forcedJSONParsing:un.transitional(un.boolean),clarifyTimeoutError:un.transitional(un.boolean)},!1),o!=null&&(L.isFunction(o)?n.paramsSerializer={serialize:o}:la.assertOptions(o,{encode:un.function,serialize:un.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),la.assertOptions(n,{baseUrl:un.spelling("baseURL"),withXsrfToken:un.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&L.merge(i.common,i[n.method]);i&&L.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),n.headers=kt.concat(s,i);const a=[];let l=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(n)===!1||(l=l&&k.synchronous,a.unshift(k.fulfilled,k.rejected))});const c=[];this.interceptors.response.forEach(function(k){c.push(k.fulfilled,k.rejected)});let u,f=0,p;if(!l){const b=[_0.bind(this),void 0];for(b.unshift.apply(b,a),b.push.apply(b,c),p=b.length,u=Promise.resolve(n);f<p;)u=u.then(b[f++],b[f++]);return u}p=a.length;let m=n;for(f=0;f<p;){const b=a[f++],k=a[f++];try{m=b(m)}catch(_){k.call(this,_);break}}try{u=_0.call(this,m)}catch(b){return Promise.reject(b)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=Nr(this.defaults,e);const n=f0(e.baseURL,e.url,e.allowAbsoluteUrls);return r0(n,e.params,e.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(e){Ar.prototype[e]=function(n,r){return this.request(Nr(r||{},{method:e,url:n,data:(r||{}).data}))}}),L.forEach(["post","put","patch"],function(e){function n(r){return function(i,s,a){return this.request(Nr(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Ar.prototype[e]=n(),Ar.prototype[e+"Form"]=n(!0)});let jA=class H0{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new so(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new H0(function(o){e=o}),cancel:e}}};function UA(t){return function(n){return t.apply(null,n)}}function WA(t){return L.isObject(t)&&t.isAxiosError===!0}const lu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(lu).forEach(([t,e])=>{lu[e]=t});function C0(t){const e=new Ar(t),n=zg(Ar.prototype.request,e);return L.extend(n,Ar.prototype,e,{allOwnKeys:!0}),L.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return C0(Nr(t,o))},n}const Be=C0(ui);Be.Axios=Ar,Be.CanceledError=so,Be.CancelToken=jA,Be.isCancel=l0,Be.VERSION=E0,Be.toFormData=na,Be.AxiosError=oe,Be.Cancel=Be.CanceledError,Be.all=function(e){return Promise.all(e)},Be.spread=UA,Be.isAxiosError=WA,Be.mergeConfig=Nr,Be.AxiosHeaders=kt,Be.formToJSON=t=>s0(L.isHTMLForm(t)?new FormData(t):t),Be.getAdapter=k0.getAdapter,Be.HttpStatusCode=lu,Be.default=Be;const{Axios:oM,AxiosError:iM,CanceledError:sM,isCancel:aM,CancelToken:lM,VERSION:cM,all:uM,Cancel:dM,isAxiosError:fM,spread:pM,toFormData:hM,AxiosHeaders:mM,HttpStatusCode:gM,formToJSON:bM,getAdapter:yM,mergeConfig:wM}=Be,KA=async t=>{try{const e=new FormData;e.append("unique","true"),e.append("file",t);const{data:n}=await Be.post("/file/upload/uploads?id=&form=&table=",e);return n?.result}catch(e){console.error(e)}},S0=async(t,e)=>{const n=e.clipboardData?.items;if(n){const r=e.clipboardData?.getData("text/html"),o=e.clipboardData?.getData("text/plain");if(r){const{state:i,dispatch:s}=t,{tr:a}=i,l=Mr.fromSchema(t.state.schema),c=new DOMParser().parseFromString(r,"text/html").body,u=l.parse(c),f=a.replaceSelectionWith(u);return s(f),e.preventDefault(),!0}if(o){const{state:i,dispatch:s}=t,{tr:a}=i,l=a.insertText(o,i.selection.from,i.selection.to);return s(l),e.preventDefault(),!0}for(let i=0;i<n.length;i++){const s=n[i];if(s.type.startsWith("image/")){const a=s.getAsFile();if(a){const l=await KA(a),{schema:c}=t.state,u=c.nodes.image.create({src:l?.file_path}),f=t.state.tr.replaceSelectionWith(u);return t.dispatch(f),e.preventDefault(),!0}}}}return!1},qA=ct.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ce(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Tl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),GA={1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"},T0=qA.extend({addOptions(){return{...this.parent?.(),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){return{...this.parent?.(),level:{default:1,renderHTML:t=>{const e=t.level||1;return{class:`heading-level-${e}`,style:GA[e-1]}}}}}}),N0=ct.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}).configure({HTMLAttributes:{style:"min-height: 1rem;"}}),JA={class:"bg-white border border border-solid border-gray-200 rounded-xl"},YA={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},XA={__name:"vs-richtext",props:{modelValue:{type:String,default:()=>""},height:{type:String,default:()=>"300px"},toolbar:{type:Array,default:()=>["bold","italic","underline","text_align","color","color_picker","blockquote","bullet_list","ordered_list","codeblock","text_more","strike","link","table"]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=nh({content:n.modelValue,extensions:[_m,vm,rh,oh,ih,sh,ah,uh,ph,hh,mh,gh,vh,N0,Sh,Cm,Wh,Nh,Ch,Th,T0,Em,Kh,bm.configure({types:["heading","paragraph"]}),qh,gm.configure({HTMLAttributes:{class:"editor-content"},resizable:!0}),km,wm,ym,Uh.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0})],editorProps:{handlePaste:S0}}),i=y.computed(()=>n.toolbar.map(a=>Hg[a]));y.watch(()=>n.modelValue,a=>{if(o.value){const l=a||"",c=o.value.getHTML();l!==c&&o.value.commands.setContent(l)}},{immediate:!0}),y.watch(o,a=>{a&&o.value.on("update",l=>{const c=l.editor.getHTML();c!==n.modelValue&&r("update:modelValue",c==='<p style="min-height: 1rem;"></p>'?null:c)})});const s=()=>{o.value&&!o.value.isFocused&&o.value.commands.focus()};return(a,l)=>(y.openBlock(),y.createElementBlock("div",JA,[y.createElementVNode("div",YA,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,c=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(c),{editor:y.unref(o)},null,8,["editor"]))),256))]),y.createElementVNode("div",{onClick:s,class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800",style:y.normalizeStyle({height:t.height})},[y.createVNode(y.unref(th),{editor:y.unref(o),class:"relative w-full"},null,8,["editor"])],4)]))}};function QA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ca={exports:{}},ZA=ca.exports,A0;function eO(){return A0||(A0=1,function(t){(function(){function e(d){var g={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(d===!1)return JSON.parse(JSON.stringify(g));var h={};for(var w in g)g.hasOwnProperty(w)&&(h[w]=g[w].defaultValue);return h}function n(){var d=e(!0),g={};for(var h in d)d.hasOwnProperty(h)&&(g[h]=!0);return g}var r={},o={},i={},s=e(!0),a="vanilla",l={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:n()};r.helper={},r.extensions={},r.setOption=function(d,g){return s[d]=g,this},r.getOption=function(d){return s[d]},r.getOptions=function(){return s},r.resetOptions=function(){s=e(!0)},r.setFlavor=function(d){if(!l.hasOwnProperty(d))throw Error(d+" flavor was not found");r.resetOptions();var g=l[d];a=d;for(var h in g)g.hasOwnProperty(h)&&(s[h]=g[h])},r.getFlavor=function(){return a},r.getFlavorOptions=function(d){if(l.hasOwnProperty(d))return l[d]},r.getDefaultOptions=function(d){return e(d)},r.subParser=function(d,g){if(r.helper.isString(d))if(typeof g<"u")o[d]=g;else{if(o.hasOwnProperty(d))return o[d];throw Error("SubParser named "+d+" not registered!")}},r.extension=function(d,g){if(!r.helper.isString(d))throw Error("Extension 'name' must be a string");if(d=r.helper.stdExtName(d),r.helper.isUndefined(g)){if(!i.hasOwnProperty(d))throw Error("Extension named "+d+" is not registered!");return i[d]}else{typeof g=="function"&&(g=g()),r.helper.isArray(g)||(g=[g]);var h=c(g,d);if(h.valid)i[d]=g;else throw Error(h.error)}},r.getAllExtensions=function(){return i},r.removeExtension=function(d){delete i[d]},r.resetExtensions=function(){i={}};function c(d,g){var h=g?"Error in "+g+" extension->":"Error in unnamed extension",w={valid:!0,error:""};r.helper.isArray(d)||(d=[d]);for(var v=0;v<d.length;++v){var S=h+" sub-extension "+v+": ",C=d[v];if(typeof C!="object")return w.valid=!1,w.error=S+"must be an object, but "+typeof C+" given",w;if(!r.helper.isString(C.type))return w.valid=!1,w.error=S+'property "type" must be a string, but '+typeof C.type+" given",w;var M=C.type=C.type.toLowerCase();if(M==="language"&&(M=C.type="lang"),M==="html"&&(M=C.type="output"),M!=="lang"&&M!=="output"&&M!=="listener")return w.valid=!1,w.error=S+"type "+M+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',w;if(M==="listener"){if(r.helper.isUndefined(C.listeners))return w.valid=!1,w.error=S+'. Extensions of type "listener" must have a property called "listeners"',w}else if(r.helper.isUndefined(C.filter)&&r.helper.isUndefined(C.regex))return w.valid=!1,w.error=S+M+' extensions must define either a "regex" property or a "filter" method',w;if(C.listeners){if(typeof C.listeners!="object")return w.valid=!1,w.error=S+'"listeners" property must be an object but '+typeof C.listeners+" given",w;for(var P in C.listeners)if(C.listeners.hasOwnProperty(P)&&typeof C.listeners[P]!="function")return w.valid=!1,w.error=S+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+P+" must be a function but "+typeof C.listeners[P]+" given",w}if(C.filter){if(typeof C.filter!="function")return w.valid=!1,w.error=S+'"filter" must be a function, but '+typeof C.filter+" given",w}else if(C.regex){if(r.helper.isString(C.regex)&&(C.regex=new RegExp(C.regex,"g")),!(C.regex instanceof RegExp))return w.valid=!1,w.error=S+'"regex" property must either be a string or a RegExp object, but '+typeof C.regex+" given",w;if(r.helper.isUndefined(C.replace))return w.valid=!1,w.error=S+'"regex" extensions must implement a replace string or function',w}}return w}r.validateExtension=function(d){var g=c(d,null);return g.valid?!0:(console.warn(g.error),!1)},r.hasOwnProperty("helper")||(r.helper={}),r.helper.isString=function(d){return typeof d=="string"||d instanceof String},r.helper.isFunction=function(d){var g={};return d&&g.toString.call(d)==="[object Function]"},r.helper.isArray=function(d){return Array.isArray(d)},r.helper.isUndefined=function(d){return typeof d>"u"},r.helper.forEach=function(d,g){if(r.helper.isUndefined(d))throw new Error("obj param is required");if(r.helper.isUndefined(g))throw new Error("callback param is required");if(!r.helper.isFunction(g))throw new Error("callback param must be a function/closure");if(typeof d.forEach=="function")d.forEach(g);else if(r.helper.isArray(d))for(var h=0;h<d.length;h++)g(d[h],h,d);else if(typeof d=="object")for(var w in d)d.hasOwnProperty(w)&&g(d[w],w,d);else throw new Error("obj does not seem to be an array or an iterable object")},r.helper.stdExtName=function(d){return d.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()};function u(d,g){var h=g.charCodeAt(0);return"¨E"+h+"E"}r.helper.escapeCharactersCallback=u,r.helper.escapeCharacters=function(d,g,h){var w="(["+g.replace(/([\[\]\\])/g,"\\$1")+"])";h&&(w="\\\\"+w);var v=new RegExp(w,"g");return d=d.replace(v,u),d},r.helper.unescapeHTMLEntities=function(d){return d.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var f=function(d,g,h,w){var v=w||"",S=v.indexOf("g")>-1,C=new RegExp(g+"|"+h,"g"+v.replace(/g/g,"")),M=new RegExp(g,v.replace(/g/g,"")),P=[],D,F,$,T,I;do for(D=0;$=C.exec(d);)if(M.test($[0]))D++||(F=C.lastIndex,T=F-$[0].length);else if(D&&!--D){I=$.index+$[0].length;var U={left:{start:T,end:F},match:{start:F,end:$.index},right:{start:$.index,end:I},wholeMatch:{start:T,end:I}};if(P.push(U),!S)return P}while(D&&(C.lastIndex=F));return P};r.helper.matchRecursiveRegExp=function(d,g,h,w){for(var v=f(d,g,h,w),S=[],C=0;C<v.length;++C)S.push([d.slice(v[C].wholeMatch.start,v[C].wholeMatch.end),d.slice(v[C].match.start,v[C].match.end),d.slice(v[C].left.start,v[C].left.end),d.slice(v[C].right.start,v[C].right.end)]);return S},r.helper.replaceRecursiveRegExp=function(d,g,h,w,v){if(!r.helper.isFunction(g)){var S=g;g=function(){return S}}var C=f(d,h,w,v),M=d,P=C.length;if(P>0){var D=[];C[0].wholeMatch.start!==0&&D.push(d.slice(0,C[0].wholeMatch.start));for(var F=0;F<P;++F)D.push(g(d.slice(C[F].wholeMatch.start,C[F].wholeMatch.end),d.slice(C[F].match.start,C[F].match.end),d.slice(C[F].left.start,C[F].left.end),d.slice(C[F].right.start,C[F].right.end))),F<P-1&&D.push(d.slice(C[F].wholeMatch.end,C[F+1].wholeMatch.start));C[P-1].wholeMatch.end<d.length&&D.push(d.slice(C[P-1].wholeMatch.end)),M=D.join("")}return M},r.helper.regexIndexOf=function(d,g,h){if(!r.helper.isString(d))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(!(g instanceof RegExp))throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var w=d.substring(h||0).search(g);return w>=0?w+(h||0):w},r.helper.splitAtIndex=function(d,g){if(!r.helper.isString(d))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[d.substring(0,g),d.substring(g)]},r.helper.encodeEmailAddress=function(d){var g=[function(h){return"&#"+h.charCodeAt(0)+";"},function(h){return"&#x"+h.charCodeAt(0).toString(16)+";"},function(h){return h}];return d=d.replace(/./g,function(h){if(h==="@")h=g[Math.floor(Math.random()*2)](h);else{var w=Math.random();h=w>.9?g[2](h):w>.45?g[1](h):g[0](h)}return h}),d},r.helper.padEnd=function(g,h,w){return h=h>>0,w=String(w||" "),g.length>h?String(g):(h=h-g.length,h>w.length&&(w+=w.repeat(h/w.length)),String(g)+w.slice(0,h))},typeof console>"u"&&(console={warn:function(d){alert(d)},log:function(d){alert(d)},error:function(d){throw d}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:`<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`},r.Converter=function(d){var g={},h=[],w=[],v={},S=a,C={parsed:{},raw:"",format:""};M();function M(){d=d||{};for(var T in s)s.hasOwnProperty(T)&&(g[T]=s[T]);if(typeof d=="object")for(var I in d)d.hasOwnProperty(I)&&(g[I]=d[I]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof d+" was passed instead.");g.extensions&&r.helper.forEach(g.extensions,P)}function P(T,I){if(I=I||null,r.helper.isString(T))if(T=r.helper.stdExtName(T),I=T,r.extensions[T]){console.warn("DEPRECATION WARNING: "+T+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),D(r.extensions[T],T);return}else if(!r.helper.isUndefined(i[T]))T=i[T];else throw Error('Extension "'+T+'" could not be loaded. It was either not found or is not a valid extension.');typeof T=="function"&&(T=T()),r.helper.isArray(T)||(T=[T]);var U=c(T,I);if(!U.valid)throw Error(U.error);for(var q=0;q<T.length;++q){switch(T[q].type){case"lang":h.push(T[q]);break;case"output":w.push(T[q]);break}if(T[q].hasOwnProperty("listeners"))for(var Z in T[q].listeners)T[q].listeners.hasOwnProperty(Z)&&F(Z,T[q].listeners[Z])}}function D(T,I){typeof T=="function"&&(T=T(new r.Converter)),r.helper.isArray(T)||(T=[T]);var U=c(T,I);if(!U.valid)throw Error(U.error);for(var q=0;q<T.length;++q)switch(T[q].type){case"lang":h.push(T[q]);break;case"output":w.push(T[q]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}function F(T,I){if(!r.helper.isString(T))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof T+" given");if(typeof I!="function")throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof I+" given");v.hasOwnProperty(T)||(v[T]=[]),v[T].push(I)}function $(T){var I=T.match(/^\s*/)[0].length,U=new RegExp("^\\s{0,"+I+"}","gm");return T.replace(U,"")}this._dispatch=function(I,U,q,Z){if(v.hasOwnProperty(I))for(var G=0;G<v[I].length;++G){var he=v[I][G](I,U,this,q,Z);he&&typeof he<"u"&&(U=he)}return U},this.listen=function(T,I){return F(T,I),this},this.makeHtml=function(T){if(!T)return T;var I={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:h,outputModifiers:w,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return T=T.replace(/¨/g,"¨T"),T=T.replace(/\$/g,"¨D"),T=T.replace(/\r\n/g,`
|
|
144
|
-
`),T=T.replace(/\r/g,`
|
|
145
|
-
`),T=T.replace(/\u00A0/g," "),g.smartIndentationFix&&(T=$(T)),T=`
|
|
146
|
-
|
|
147
|
-
`+T+`
|
|
148
|
-
|
|
149
|
-
`,T=r.subParser("detab")(T,g,I),T=T.replace(/^[ \t]+$/mg,""),r.helper.forEach(h,function(U){T=r.subParser("runExtension")(U,T,g,I)}),T=r.subParser("metadata")(T,g,I),T=r.subParser("hashPreCodeTags")(T,g,I),T=r.subParser("githubCodeBlocks")(T,g,I),T=r.subParser("hashHTMLBlocks")(T,g,I),T=r.subParser("hashCodeTags")(T,g,I),T=r.subParser("stripLinkDefinitions")(T,g,I),T=r.subParser("blockGamut")(T,g,I),T=r.subParser("unhashHTMLSpans")(T,g,I),T=r.subParser("unescapeSpecialChars")(T,g,I),T=T.replace(/¨D/g,"$$"),T=T.replace(/¨T/g,"¨"),T=r.subParser("completeHTMLDocument")(T,g,I),r.helper.forEach(w,function(U){T=r.subParser("runExtension")(U,T,g,I)}),C=I.metadata,T},this.makeMarkdown=this.makeMd=function(T,I){if(T=T.replace(/\r\n/g,`
|
|
150
|
-
`),T=T.replace(/\r/g,`
|
|
151
|
-
`),T=T.replace(/>[ \t]+</,">¨NBSP;<"),!I)if(window&&window.document)I=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var U=I.createElement("div");U.innerHTML=T;var q={preList:Oe(U)};Te(U);for(var Z=U.childNodes,G="",he=0;he<Z.length;he++)G+=r.subParser("makeMarkdown.node")(Z[he],q);function Te(fe){for(var we=0;we<fe.childNodes.length;++we){var Me=fe.childNodes[we];Me.nodeType===3?!/\S/.test(Me.nodeValue)&&!/^[ ]+$/.test(Me.nodeValue)?(fe.removeChild(Me),--we):(Me.nodeValue=Me.nodeValue.split(`
|
|
152
|
-
`).join(" "),Me.nodeValue=Me.nodeValue.replace(/(\s)+/g,"$1")):Me.nodeType===1&&Te(Me)}}function Oe(fe){for(var we=fe.querySelectorAll("pre"),Me=[],ke=0;ke<we.length;++ke)if(we[ke].childElementCount===1&&we[ke].firstChild.tagName.toLowerCase()==="code"){var _t=we[ke].firstChild.innerHTML.trim(),ot=we[ke].firstChild.getAttribute("data-language")||"";if(ot==="")for(var At=we[ke].firstChild.className.split(" "),Vt=0;Vt<At.length;++Vt){var Et=At[Vt].match(/^language-(.+)$/);if(Et!==null){ot=Et[1];break}}_t=r.helper.unescapeHTMLEntities(_t),Me.push(_t),we[ke].outerHTML='<precode language="'+ot+'" precodenum="'+ke.toString()+'"></precode>'}else Me.push(we[ke].innerHTML),we[ke].innerHTML="",we[ke].setAttribute("prenum",ke.toString());return Me}return G},this.setOption=function(T,I){g[T]=I},this.getOption=function(T){return g[T]},this.getOptions=function(){return g},this.addExtension=function(T,I){I=I||null,P(T,I)},this.useExtension=function(T){P(T)},this.setFlavor=function(T){if(!l.hasOwnProperty(T))throw Error(T+" flavor was not found");var I=l[T];S=T;for(var U in I)I.hasOwnProperty(U)&&(g[U]=I[U])},this.getFlavor=function(){return S},this.removeExtension=function(T){r.helper.isArray(T)||(T=[T]);for(var I=0;I<T.length;++I){for(var U=T[I],q=0;q<h.length;++q)h[q]===U&&h.splice(q,1);for(var Z=0;Z<w.length;++Z)w[Z]===U&&w.splice(Z,1)}},this.getAllExtensions=function(){return{language:h,output:w}},this.getMetadata=function(T){return T?C.raw:C.parsed},this.getMetadataFormat=function(){return C.format},this._setMetadataPair=function(T,I){C.parsed[T]=I},this._setMetadataFormat=function(T){C.format=T},this._setMetadataRaw=function(T){C.raw=T}},r.subParser("anchors",function(d,g,h){d=h.converter._dispatch("anchors.before",d,g,h);var w=function(v,S,C,M,P,D,F){if(r.helper.isUndefined(F)&&(F=""),C=C.toLowerCase(),v.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)M="";else if(!M)if(C||(C=S.toLowerCase().replace(/ ?\n/g," ")),M="#"+C,!r.helper.isUndefined(h.gUrls[C]))M=h.gUrls[C],r.helper.isUndefined(h.gTitles[C])||(F=h.gTitles[C]);else return v;M=M.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var $='<a href="'+M+'"';return F!==""&&F!==null&&(F=F.replace(/"/g,"""),F=F.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),$+=' title="'+F+'"'),g.openLinksInNewWindow&&!/^#/.test(M)&&($+=' rel="noopener noreferrer" target="¨E95Eblank"'),$+=">"+S+"</a>",$};return d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,w),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,w),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,w),d=d.replace(/\[([^\[\]]+)]()()()()()/g,w),g.ghMentions&&(d=d.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(v,S,C,M,P){if(C==="\\")return S+M;if(!r.helper.isString(g.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var D=g.ghMentionsLink.replace(/\{u}/g,P),F="";return g.openLinksInNewWindow&&(F=' rel="noopener noreferrer" target="¨E95Eblank"'),S+'<a href="'+D+'"'+F+">"+M+"</a>"})),d=h.converter._dispatch("anchors.after",d,g,h),d});var p=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,m=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,b=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,k=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,E=function(d){return function(g,h,w,v,S,C,M){w=w.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var P=w,D="",F="",$=h||"",T=M||"";return/^www\./i.test(w)&&(w=w.replace(/^www\./i,"http://www.")),d.excludeTrailingPunctuationFromURLs&&C&&(D=C),d.openLinksInNewWindow&&(F=' rel="noopener noreferrer" target="¨E95Eblank"'),$+'<a href="'+w+'"'+F+">"+P+"</a>"+D+T}},N=function(d,g){return function(h,w,v){var S="mailto:";return w=w||"",v=r.subParser("unescapeSpecialChars")(v,d,g),d.encodeEmails?(S=r.helper.encodeEmailAddress(S+v),v=r.helper.encodeEmailAddress(v)):S=S+v,w+'<a href="'+S+'">'+v+"</a>"}};r.subParser("autoLinks",function(d,g,h){return d=h.converter._dispatch("autoLinks.before",d,g,h),d=d.replace(b,E(g)),d=d.replace(_,N(g,h)),d=h.converter._dispatch("autoLinks.after",d,g,h),d}),r.subParser("simplifiedAutoLinks",function(d,g,h){return g.simplifiedAutoLink&&(d=h.converter._dispatch("simplifiedAutoLinks.before",d,g,h),g.excludeTrailingPunctuationFromURLs?d=d.replace(m,E(g)):d=d.replace(p,E(g)),d=d.replace(k,N(g,h)),d=h.converter._dispatch("simplifiedAutoLinks.after",d,g,h)),d}),r.subParser("blockGamut",function(d,g,h){return d=h.converter._dispatch("blockGamut.before",d,g,h),d=r.subParser("blockQuotes")(d,g,h),d=r.subParser("headers")(d,g,h),d=r.subParser("horizontalRule")(d,g,h),d=r.subParser("lists")(d,g,h),d=r.subParser("codeBlocks")(d,g,h),d=r.subParser("tables")(d,g,h),d=r.subParser("hashHTMLBlocks")(d,g,h),d=r.subParser("paragraphs")(d,g,h),d=h.converter._dispatch("blockGamut.after",d,g,h),d}),r.subParser("blockQuotes",function(d,g,h){d=h.converter._dispatch("blockQuotes.before",d,g,h),d=d+`
|
|
153
|
-
|
|
154
|
-
`;var w=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return g.splitAdjacentBlockquotes&&(w=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),d=d.replace(w,function(v){return v=v.replace(/^[ \t]*>[ \t]?/gm,""),v=v.replace(/¨0/g,""),v=v.replace(/^[ \t]+$/gm,""),v=r.subParser("githubCodeBlocks")(v,g,h),v=r.subParser("blockGamut")(v,g,h),v=v.replace(/(^|\n)/g,"$1 "),v=v.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(S,C){var M=C;return M=M.replace(/^ /mg,"¨0"),M=M.replace(/¨0/g,""),M}),r.subParser("hashBlock")(`<blockquote>
|
|
155
|
-
`+v+`
|
|
156
|
-
</blockquote>`,g,h)}),d=h.converter._dispatch("blockQuotes.after",d,g,h),d}),r.subParser("codeBlocks",function(d,g,h){d=h.converter._dispatch("codeBlocks.before",d,g,h),d+="¨0";var w=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return d=d.replace(w,function(v,S,C){var M=S,P=C,D=`
|
|
157
|
-
`;return M=r.subParser("outdent")(M,g,h),M=r.subParser("encodeCode")(M,g,h),M=r.subParser("detab")(M,g,h),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,""),g.omitExtraWLInCodeBlocks&&(D=""),M="<pre><code>"+M+D+"</code></pre>",r.subParser("hashBlock")(M,g,h)+P}),d=d.replace(/¨0/,""),d=h.converter._dispatch("codeBlocks.after",d,g,h),d}),r.subParser("codeSpans",function(d,g,h){return d=h.converter._dispatch("codeSpans.before",d,g,h),typeof d>"u"&&(d=""),d=d.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(w,v,S,C){var M=C;return M=M.replace(/^([ \t]*)/g,""),M=M.replace(/[ \t]*$/g,""),M=r.subParser("encodeCode")(M,g,h),M=v+"<code>"+M+"</code>",M=r.subParser("hashHTMLSpans")(M,g,h),M}),d=h.converter._dispatch("codeSpans.after",d,g,h),d}),r.subParser("completeHTMLDocument",function(d,g,h){if(!g.completeHTMLDocument)return d;d=h.converter._dispatch("completeHTMLDocument.before",d,g,h);var w="html",v=`<!DOCTYPE HTML>
|
|
158
|
-
`,S="",C=`<meta charset="utf-8">
|
|
159
|
-
`,M="",P="";typeof h.metadata.parsed.doctype<"u"&&(v="<!DOCTYPE "+h.metadata.parsed.doctype+`>
|
|
160
|
-
`,w=h.metadata.parsed.doctype.toString().toLowerCase(),(w==="html"||w==="html5")&&(C='<meta charset="utf-8">'));for(var D in h.metadata.parsed)if(h.metadata.parsed.hasOwnProperty(D))switch(D.toLowerCase()){case"doctype":break;case"title":S="<title>"+h.metadata.parsed.title+`</title>
|
|
161
|
-
`;break;case"charset":w==="html"||w==="html5"?C='<meta charset="'+h.metadata.parsed.charset+`">
|
|
162
|
-
`:C='<meta name="charset" content="'+h.metadata.parsed.charset+`">
|
|
163
|
-
`;break;case"language":case"lang":M=' lang="'+h.metadata.parsed[D]+'"',P+='<meta name="'+D+'" content="'+h.metadata.parsed[D]+`">
|
|
164
|
-
`;break;default:P+='<meta name="'+D+'" content="'+h.metadata.parsed[D]+`">
|
|
165
|
-
`}return d=v+"<html"+M+`>
|
|
104
|
+
3. "-" cannot repeat`);me.customSchemes.push([t,e])}function Mk(){me.scanner=_k(me.customSchemes);for(let t=0;t<me.tokenQueue.length;t++)me.tokenQueue[t][1]({scanner:me.scanner});me.parser=vk(me.scanner.tokens);for(let t=0;t<me.pluginQueue.length;t++)me.pluginQueue[t][1]({scanner:me.scanner,parser:me.parser});return me.initialized=!0,me}function Oa(t){return me.initialized||Mk(),Sk(me.parser.start,t,Ef(me.scanner.start,t))}Oa.scan=Ef;function Mf(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Ma(n),o=Oa(t),s=[];for(let i=0;i<o.length;i++){const a=o[i];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}var La="[\0- -\u2029 ]",Ak=new RegExp(La),Ok=new RegExp(`${La}$`),Lk=new RegExp(La,"g");function Ik(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function Pk(t){return new ge({key:new ve("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!o||s)return;const{tr:i}=r,a=Zd(n.doc,[...e]);if(uu(a).forEach(({newRange:c})=>{const d=U0(r.doc,c,m=>m.isTextblock);let f,h;if(d.length>1)f=d[0],h=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(d.length){const m=r.doc.textBetween(c.from,c.to," "," ");if(!Ok.test(m))return;f=d[0],h=r.doc.textBetween(f.pos,c.to,void 0," ")}if(f&&h){const m=h.split(Ak).filter(Boolean);if(m.length<=0)return!1;const y=m[m.length-1],w=f.pos+h.lastIndexOf(y);if(!y)return!1;const E=Oa(y).map(_=>_.toObject(t.defaultProtocol));if(!Ik(E))return!1;E.filter(_=>_.isLink).map(_=>({..._,from:w+_.start+1,to:w+_.end+1})).filter(_=>r.schema.marks.code?!r.doc.rangeHasMark(_.from,_.to,r.schema.marks.code):!0).filter(_=>t.validate(_.value)).filter(_=>t.shouldAutoLink(_.value)).forEach(_=>{qi(_.from,_.to,r.doc).some(x=>x.mark.type===t.type)||i.addMark(_.from,_.to,t.type.create({href:_.href}))})}}),!!i.steps.length)return i}})}function Rk(t){return new ge({key:new ve("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,s;if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let d=r.target;const f=[];for(;d.nodeName!=="DIV";)f.push(d),d=d.parentNode;i=f.find(h=>h.nodeName==="A")}if(!i)return!1;const a=du(e.state,t.type.name),l=(o=i?.href)!=null?o:a.href,c=(s=i?.target)!=null?s:a.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),i&&l?(window.open(l,c),!0):!1}}})}function Dk(t){return new ge({key:new ve("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:s}=o,{empty:i}=s;if(i)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=Mf(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function Pn(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(Lk,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Ia=kt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Nf(t);return}Nf(t.scheme,t.optionalSlashes)})},onDestroy(){Nk()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Pn(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Pn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Pn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ae(this.options.HTMLAttributes,t),0]:["a",ae(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Pn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Pn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[an({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=Mf(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:i=>!!Pn(i,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(Pk({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Pn(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(Rk({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(Dk({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Bk=Object.defineProperty,Fk=(t,e)=>{for(var n in e)Bk(t,n,{get:e[n],enumerable:!0})},Vk="listItem",Af="textStyle",Of=/^\s*([-+*])\s$/,Lf=De.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Vk,this.editor.getAttributes(Af)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=or({find:Of,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=or({find:Of,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Af),editor:this.editor})),[t]}}),If=De.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ae(this.options.HTMLAttributes,t),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)}}}),$k={};Fk($k,{findListItemPos:()=>Gr,getNextListDepth:()=>Pa,handleBackspace:()=>Ra,handleDelete:()=>Da,hasListBefore:()=>Pf,hasListItemAfter:()=>zk,hasListItemBefore:()=>Rf,listItemHasSubList:()=>Df,nextListIsDeeper:()=>Bf,nextListIsHigher:()=>Ff});var Gr=(t,e)=>{const{$from:n}=e.selection,r=Me(t,e.schema);let o=null,s=n.depth,i=n.pos,a=null;for(;s>0&&a===null;)o=n.node(s),o.type===r?a=s:(s-=1,i-=1);return a===null?null:{$pos:e.doc.resolve(i),depth:a}},Pa=(t,e)=>{const n=Gr(t,e);if(!n)return!1;const[,r]=Z0(e,t,n.$pos.pos+4);return r},Pf=(t,e,n)=>{const{$anchor:r}=t.selection,o=Math.max(0,r.pos-2),s=t.doc.resolve(o).node();return!(!s||!n.includes(s.type.name))},Rf=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-2);return!(o.index()===0||((n=o.nodeBefore)==null?void 0:n.type.name)!==t)},Df=(t,e,n)=>{if(!n)return!1;const r=Me(t,e.schema);let o=!1;return n.descendants(s=>{s.type===r&&(o=!0)}),o},Ra=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!sn(t.state,e)&&Pf(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((h,m)=>{h.type.name===e&&c.push({node:h,pos:m})});const d=c.at(-1);if(!d)return!1;const f=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},f.end()).joinForward().run()}if(!sn(t.state,e)||!rb(t.state))return!1;const r=Gr(e,t.state);if(!r)return!1;const s=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),i=Df(e,t.state,s);return Rf(e,t.state)&&!i?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},Bf=(t,e)=>{const n=Pa(t,e),r=Gr(t,e);return!r||!n?!1:n>r.depth},Ff=(t,e)=>{const n=Pa(t,e),r=Gr(t,e);return!r||!n?!1:n<r.depth},Da=(t,e)=>{if(!sn(t.state,e)||!nb(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:Bf(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():Ff(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},zk=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-r.parentOffset-2);return!(o.index()===o.parent.childCount-1||((n=o.nodeAfter)==null?void 0:n.type.name)!==t)},Vf=le.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Da(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Da(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Ra(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Ra(t,n,r)&&(e=!0)}),e}}}}),Hk="listItem",$f="textStyle",zf=/^(\d+)\.\s$/,Hf=De.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ae(this.options.HTMLAttributes,n),0]:["ol",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Hk,this.editor.getAttributes($f)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=or({find:zf,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=or({find:zf,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($f)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),jk=/^\s*(\[([( |x])?\])\s$/,Uk=De.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ae(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),s=document.createElement("label"),i=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var f,h;a.ariaLabel=((h=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:h.call(f,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return c(t),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const m=n();if(typeof m!="number")return!1;const y=h.doc.nodeAt(m);return h.setNodeMarkup(m,void 0,{...y?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{o.setAttribute(d,f)}),o.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,s.append(a,i),o.append(s,l),Object.entries(e).forEach(([d,f])=>{o.setAttribute(d,f)}),{dom:o,contentDOM:l,update:d=>d.type!==this.type?!1:(o.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d),!0)}}},addInputRules(){return[or({find:jk,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Wk=De.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ae(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});le.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(Lf.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(If.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Vf.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Hf.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Uk.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Wk.configure(this.options.taskList)),t}});var jf=De.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Kk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Gk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,qk=kt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[On({find:Kk,type:this.type})]},addPasteRules(){return[an({find:Gk,type:this.type})]}}),Jk=De.create({name:"text",group:"inline"}),Yk=kt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Xk(t={}){return new ge({view(e){return new Qk(e,t)}})}class Qk{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=i=>{this[o](i)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,o=this.editorView.dom,s=o.getBoundingClientRect(),i=s.width/o.offsetWidth,a=s.height/o.offsetHeight;if(n){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let m=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(m){let y=m.getBoundingClientRect(),w=f?y.bottom:y.top;f&&h&&(w=(w+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let E=this.width/2*a;r={left:y.left,right:y.right,top:w-E,bottom:w+E}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*i;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let 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;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let f=l.getBoundingClientRect(),h=f.width/l.offsetWidth,m=f.height/l.offsetHeight;c=f.left-l.scrollLeft*h,d=f.top-l.scrollTop*m}this.element.style.left=(r.left-c)/i+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!s){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=fc(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ee extends X{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ee.valid(r)?new Ee(r):X.near(r)}content(){return H.empty}eq(e){return e instanceof Ee&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ee(e.resolve(n.pos))}getBookmark(){return new Ba(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!Zk(e)||!ew(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ee.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let a=e.node(i);if(n>0?e.indexAfter(i)<a.childCount:e.index(i)>0){s=a.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=n;let l=e.doc.resolve(o);if(Ee.valid(l))return l}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!J.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let a=e.doc.resolve(o);if(Ee.valid(a))return a}return null}}}Ee.prototype.visible=!1,Ee.findFrom=Ee.findGapCursorFrom,X.jsonID("gapcursor",Ee);class Ba{constructor(e){this.pos=e}map(e){return new Ba(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ee.valid(n)?new Ee(n):X.near(n)}}function Zk(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function ew(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function tw(){return new ge({props:{decorations:sw,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ee.valid(n)?new Ee(n):null},handleClick:rw,handleKeyDown:nw,handleDOMEvents:{beforeinput:ow}}})}const nw=Di({ArrowLeft:Ms("horiz",-1),ArrowRight:Ms("horiz",1),ArrowUp:Ms("vert",-1),ArrowDown:Ms("vert",1)});function Ms(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,a=e>0?i.$to:i.$from,l=i.empty;if(i instanceof Y){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Ee.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new Ee(c))),!0):!1}}function rw(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ee.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&J.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ee(r))),!0)}function ow(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ee))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=I.empty;for(let i=r.length-1;i>=0;i--)o=I.from(r[i].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new H(o,0,0));return s.setSelection(Y.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function sw(t){if(!(t.selection instanceof Ee))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",fe.create(t.doc,[Re.widget(t.selection.head,e,{key:"gapcursor"})])}var As=200,Be=function(){};Be.prototype.append=function(e){return e.length?(e=Be.from(e),!this.length&&e||e.length<As&&this.leafAppend(e)||this.length<As&&e.leafPrepend(this)||this.appendInner(e)):this},Be.prototype.prepend=function(e){return e.length?Be.from(e).append(this):this},Be.prototype.appendInner=function(e){return new iw(this,e)},Be.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Be.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Be.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Be.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Be.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,i){return o.push(e(s,i))},n,r),o},Be.from=function(e){return e instanceof Be?e:e&&e.length?new Uf(e):Be.empty};var Uf=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,i,a){for(var l=s;l<i;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,i,a){for(var l=s-1;l>=i;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=As)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=As)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(Be);Be.empty=new Uf([]);var iw=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,s,i){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(s,a),i)===!1||s>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,s)-a,i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(s,a)-a,i+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(o,a),s,i)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(Be);const aw=500;class _t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,a,l,c=[],d=[];return this.items.forEach((f,h)=>{if(!f.step){o||(o=this.remapping(r,h+1),s=o.maps.length),s--,d.push(f);return}if(o){d.push(new Mt(f.map));let m=f.step.map(o.slice(s)),y;m&&i.maybeStep(m).doc&&(y=i.mapping.maps[i.mapping.maps.length-1],c.push(new Mt(y,void 0,void 0,c.length+d.length))),s--,y&&o.appendMap(y,s)}else i.maybeStep(f.step);if(f.selection)return a=o?f.selection.map(o.slice(s)):f.selection,l=new _t(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:a}}addTransform(e,n,r,o){let s=[],i=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let f=e.steps[d].invert(e.docs[d]),h=new Mt(e.mapping.maps[d],f,n),m;(m=l&&l.merge(h))&&(h=m,d?s.pop():a=a.slice(0,a.length-1)),s.push(h),n&&(i++,n=void 0),o||(l=h)}let c=i-r.depth;return c>cw&&(a=lw(a,c),i-=c),new _t(a.append(s),i)}remapping(e,n){let r=new wr;return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,n),r}addMaps(e){return this.eventCount==0?this:new _t(this.items.append(e.map(n=>new Mt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},o);let l=n;this.items.forEach(h=>{let m=s.getMirror(--l);if(m==null)return;i=Math.min(i,m);let y=s.maps[m];if(h.step){let w=e.steps[m].invert(e.docs[m]),E=h.selection&&h.selection.map(s.slice(l+1,m));E&&a++,r.push(new Mt(y,w,E))}else r.push(new Mt(y))},o);let c=[];for(let h=n;h<i;h++)c.push(new Mt(s.maps[h]));let d=this.items.slice(0,o).append(c).append(r),f=new _t(d,a);return f.emptyItemCount()>aw&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((i,a)=>{if(a>=e)o.push(i),i.selection&&s++;else if(i.step){let l=i.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=i.selection&&i.selection.map(n.slice(r));d&&s++;let f=new Mt(c.invert(),l,d),h,m=o.length-1;(h=o.length&&o[m].merge(f))?o[m]=h:o.push(f)}}else i.map&&r--},this.items.length,0),new _t(Be.from(o.reverse()),s)}}_t.empty=new _t(Be.empty,0);function lw(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Mt{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Mt(n.getMap().invert(),n,this.selection)}}}class fn{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const cw=20;function dw(t,e,n,r){let o=n.getMeta(Rn),s;if(o)return o.historyState;n.getMeta(hw)&&(t=new fn(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(Rn))return i.getMeta(Rn).redo?new fn(t.done.addTransform(n,void 0,r,Os(e)),t.undone,Wf(n.mapping.maps),t.prevTime,t.prevComposition):new fn(t.done,t.undone.addTransform(n,void 0,r,Os(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!i&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!uw(n,t.prevRanges)),c=i?Fa(t.prevRanges,n.mapping):Wf(n.mapping.maps);return new fn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Os(e)),_t.empty,c,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new fn(t.done.rebased(n,s),t.undone.rebased(n,s),Fa(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new fn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Fa(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function uw(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function Wf(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,i)=>e.push(s,i));return e}function Fa(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function fw(t,e,n){let r=Os(e),o=Rn.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let i=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),l=new fn(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(i).setMeta(Rn,{redo:n,historyState:l})}let Va=!1,Kf=null;function Os(t){let e=t.plugins;if(Kf!=e){Va=!1,Kf=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Va=!0;break}}return Va}const Rn=new ve("history"),hw=new ve("closeHistory");function pw(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ge({key:Rn,state:{init(){return new fn(_t.empty,_t.empty,null,0,-1)},apply(e,n,r){return dw(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?qf:r=="historyRedo"?Jf:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function Gf(t,e){return(n,r)=>{let o=Rn.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=fw(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const qf=Gf(!1,!0),Jf=Gf(!0,!0);le.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new ge({key:new ve("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const i=s-o,a=0,l=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(a,l);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=s-r,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>r)}})]}});var mw=le.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Xk(this.options)]}});le.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new ge({key:new ve("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return fe.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(o>=c&&o<=c+l.nodeSize-1))return!1;i+=1});let a=0;return t.descendants((l,c)=>{if(l.isText||!(o>=c&&o<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&i-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(Re.node(c,c+l.nodeSize,{class:this.options.className}))}),fe.create(t,s)}}})]}});var gw=le.create({name:"gapCursor",addProseMirrorPlugins(){return[tw()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ie(q(t,"allowGapCursor",n)))!=null?e:null}}});le.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ge({key:new ve("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((i,a)=>{const l=r>=a&&r<=a+i.nodeSize,c=!i.isLeaf&&Bo(i);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];s&&d.push(this.options.emptyEditorClass);const f=Re.node(a,a+i.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:a,hasAnchor:l}):this.options.placeholder});o.push(f)}return this.options.includeChildren}),fe.create(t,o)}}})]}}),le.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new ge({key:new ve("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||gu(n.selection)||t.view.dragging?null:fe.create(n.doc,[Re.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function Yf({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var bw=le.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const t=new ve(this.name),e=Object.entries(this.editor.schema.nodes).map(([,n])=>n).filter(n=>(this.options.notAfter||[]).concat(this.options.node).includes(n.name));return[new ge({key:t,appendTransaction:(n,r,o)=>{const{doc:s,tr:i,schema:a}=o,l=t.getState(o),c=s.content.size,d=a.nodes[this.options.node];if(l)return i.insert(c,d.create())},state:{init:(n,r)=>{const o=r.tr.doc.lastChild;return!Yf({node:o,types:e})},apply:(n,r)=>{if(!n.docChanged)return r;const o=n.doc.lastChild;return!Yf({node:o,types:e})}}})]}}),yw=le.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>qf(t,e),redo:()=>({state:t,dispatch:e})=>Jf(t,e)}},addProseMirrorPlugins(){return[pw(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Xf=le.create({name:"starterKit",addExtensions(){var t,e,n,r;const o=[];return this.options.bold!==!1&&o.push(Q1.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(G1.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(Lf.configure(this.options.bulletList)),this.options.code!==!1&&o.push(tk.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(ok.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(sk.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(mw.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(gw.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(ik.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(hf.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(yw.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(ak.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(fk.configure(this.options.italic)),this.options.listItem!==!1&&o.push(If.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(Vf.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&o.push(Ia.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(Hf.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(jf.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(qk.configure(this.options.strike)),this.options.text!==!1&&o.push(Jk.configure(this.options.text)),this.options.underline!==!1&&o.push(Yk.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(bw.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),kw=Xf,ww=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Qf=De.create({name:"image",addOptions(){return{inline:!1,allowBase64:!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},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ae(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Pu({find:ww,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Zf=le.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},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")}}});const ye=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},_w={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function Ew(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Blockquote",onClick:e[0]||(e[0]=(...i)=>s.toggleBlockquote&&s.toggleBlockquote(...i)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...e[1]||(e[1]=[p.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)])])}const Cw=ye(_w,[["render",Ew]]),vw={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function Sw(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Bullet List",onClick:e[0]||(e[0]=(...i)=>s.toggleBulletList&&s.toggleBulletList(...i)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[p.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)])])}const Tw=ye(vw,[["render",Sw]]),xw={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function Nw(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Ordered List",onClick:e[0]||(e[0]=(...i)=>s.toggleOrderedList&&s.toggleOrderedList(...i)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[p.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)])])}const Mw=ye(xw,[["render",Nw]]),Aw={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function Ow(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Code Block",onClick:e[0]||(e[0]=(...i)=>s.toggleCodeBlock&&s.toggleCodeBlock(...i)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)])])}const Lw=ye(Aw,[["render",Ow]]),Iw={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.commands.toggleBold()}}};function Pw(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Bold Text",onClick:e[0]||(e[0]=(...i)=>s.toggleBold&&s.toggleBold(...i)),class:p.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("bold")}])},[...e[1]||(e[1]=[p.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),p.createElementVNode("span",{class:"sr-only"},"Bold",-1)])],2)}const Rw=ye(Iw,[["render",Pw]]),Dw={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function Bw(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Italic Text",onClick:e[0]||(e[0]=(...i)=>s.toggleItalic&&s.toggleItalic(...i)),class:p.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("italic")}])},[...e[1]||(e[1]=[p.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),p.createElementVNode("span",{class:"sr-only"},"Italic",-1)])],2)}const Fw=ye(Dw,[["render",Bw]]),Vw={__name:"vs-editor-underline",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(r,o)=>(p.openBlock(),p.createElementBlock("button",{title:"Underline",onClick:n,class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...o[0]||(o[0]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),p.createElementVNode("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)])],2))}},$w={__name:"vs-editor-strike",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(r,o)=>(p.openBlock(),p.createElementBlock("button",{title:"Strikethrough",onClick:n,class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...o[0]||(o[0]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.createElementVNode("path",{d:"M5 12l14 0"}),p.createElementVNode("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)])],2))}},zw={props:{visible:{type:Boolean,default:()=>!1},modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","update:modelValue","onClose","confirm","cancel"],inheritAttrs:!1,name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){return!!this.$slots?.footer},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:t}){t==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("update:modelValue",!1),this.$emit("onClose")},handleConfirm(){this.$emit("confirm"),this.handleClose()},handleCancel(){this.$emit("cancel"),this.handleClose()},closeByClickBack(t,e){e&&t.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},Hw={key:0,class:"vsTailwind ui-dialog__wrapper"},jw={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Uw={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Ww={class:"ui-dialog__content p-4"},Kw={key:0,class:"flex justify-end gap-x-2"};function Gw(t,e,n,r,o,s){return p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[n.visible||n.modelValue?(p.openBlock(),p.createElementBlock("div",Hw,[p.createElementVNode("div",{onMousedown:e[1]||(e[1]=i=>s.closeByClickBack(i,n.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},[p.createVNode(p.Transition,{name:"content",appear:""},{default:p.withCtx(()=>[p.createElementVNode("div",{class:p.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[s.checkSize]])},[p.createElementVNode("div",jw,[p.createElementVNode("h3",Uw,p.toDisplayString(n.title),1),p.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...i)=>s.handleClose&&s.handleClose(...i))},[...e[2]||(e[2]=[p.createElementVNode("span",{class:"sr-only"},"Close",-1),p.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("path",{d:"M18 6 6 18"}),p.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),p.createElementVNode("div",Ww,[p.renderSlot(t.$slots,"default",{},void 0,!0)]),s.hasSlot?(p.openBlock(),p.createElementBlock("div",Kw,[p.renderSlot(t.$slots,"footer",{handleClose:s.handleClose,handleConfirm:s.handleConfirm,handleCancel:s.handleCancel},void 0,!0)])):p.createCommentVNode("",!0)],2)]),_:3})],32)])):p.createCommentVNode("",!0)])}const eh=ye(zw,[["render",Gw],["__scopeId","data-v-479158fb"]]),qw={},Jw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function Yw(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("svg",Jw,[...e[0]||(e[0]=[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),p.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),p.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Xw=ye(qw,[["render",Yw]]),Qw={},Zw={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function e_(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("svg",Zw,[...e[0]||(e[0]=[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),p.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),p.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const t_=ye(Qw,[["render",e_]]),n_={},r_={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function o_(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("svg",r_,[...e[0]||(e[0]=[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),p.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),p.createElementVNode("path",{d:"M3 7l9 6l9 -6"},null,-1)])])}const s_=ye(n_,[["render",o_]]),i_=p.defineComponent({components:{IconClose:Xw,IconSearch:t_,IconEmail:s_},inheritAttrs:!1,props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){if((this.style?.size||this.size)==="xs")return"h-[32px] text-sm";if((this.style?.size||this.size)==="md")return"h-[38px] text-sm";this.style?.size||this.size},value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:t}=await this.$refs;await t.focus()}}}),a_={class:"vs-form-text relative bg-white rounded-lg"},l_={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},c_=["disabled","type","placeholder"];function d_(t,e,n,r,o,s){const i=p.resolveComponent("IconClose"),a=p.resolveComponent("IconSearch"),l=p.resolveComponent("IconEmail");return p.openBlock(),p.createElementBlock("div",a_,[t.clearable&&t.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>t.clearInput&&t.clearInput(...c))},[p.createVNode(i,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):p.createCommentVNode("",!0),t.icon&&t.icon==="search"?(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",t.iconStylePosition])},[p.createVNode(a,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):t.icon&&t.icon==="email"?(p.openBlock(),p.createElementBlock("div",l_,[p.createVNode(l,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(p.openBlock(),p.createElementBlock("i",{key:3,class:p.normalizeClass(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+t.icon,t.iconStylePosition]])},null,2)),t.clearable&&t.value?(p.openBlock(),p.createElementBlock("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...c)=>t.clearInput&&t.clearInput(...c))},[p.createVNode(i,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):p.createCommentVNode("",!0),p.withDirectives(p.createElementVNode("input",p.mergeProps({ref:"vsText",disabled:t.disabled,type:t.type,onInput:e[2]||(e[2]=(...c)=>t.handleInput&&t.handleInput(...c)),placeholder:t.placeholder,"onUpdate:modelValue":e[3]||(e[3]=c=>t.value=c)},t.style?.attrs||t.attrs||{},{onFocus:e[4]||(e[4]=(...c)=>t.handleFocus&&t.handleFocus(...c)),onBlur:e[5]||(e[5]=(...c)=>t.handleBlur&&t.handleBlur(...c)),class:[[t.inputStyle,t.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,c_),[[p.vModelDynamic,t.value]])])}const th=ye(i_,[["render",d_],["__scopeId","data-v-749b581f"]]);function $a(){const t=p.ref("en");return{t:n=>({en:{type_tag:"Type Tag",heading_1:"Heading 1",heading_2:"Heading 2",heading_3:"Heading 3",paragraph:"Paragraph",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",mergeCells:"Merge Cells",splitCells:"Split Cells",linkTitle:"Enter Link"},uk:{type_tag:"Тип тегу",heading_1:"Заголовок 1",heading_2:"Заголовок 2",heading_3:"Заголовок 3",paragraph:"Параграф",createTable:"Створити Таблицю",addColumn:"Додати Колону",addRow:"Додати Рядок",deleteColumn:"Вилучити Колону",deleteRow:"Вилучити Рядок",deleteTable:"Вилучити Таблицю",mergeCells:"Об'єднати Клітинки",splitCells:"Розділити Клітинки",linkTitle:"Введіть Посилання"}})[t.value]?.[n]||n,locale:t}}const u_={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},f_=Object.assign({inheritAttrs:!1},{__name:"vs-editor-link",props:{editor:Object},setup(t){const{t:e}=$a(),n=t,r=p.ref(!1),o=p.ref(""),s=()=>{n.editor.chain().focus().toggleLink({href:o.value}).run(),r.value=!1,o.value=""};return(i,a)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("button",{title:"Link",onClick:a[0]||(a[0]=l=>r.value=!0),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...a[4]||(a[4]=[p.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])]),p.createVNode(eh,{title:p.unref(e)("linkTitle"),visible:r.value,"onUpdate:visible":a[3]||(a[3]=l=>r.value=l),size:"small"},{footer:p.withCtx(()=>[p.createElementVNode("div",u_,[p.createElementVNode("button",{style:{border:"1px solid #000"},onClick:a[2]||(a[2]=l=>{r.value=!1,o.value=""}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},p.toDisplayString(p.unref(e)("cancel")),1),p.createElementVNode("button",{onClick:s,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},p.toDisplayString(p.unref(e)("create")),1)])]),default:p.withCtx(()=>[p.createVNode(th,{modelValue:o.value,"onUpdate:modelValue":a[1]||(a[1]=l=>o.value=l),placeholder:p.unref(e)("linkTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["title","visible"])],64))}}),qr=async(t,e,n,r=10)=>{if(!e||!n)return;await p.nextTick();const o=await n?.getBoundingClientRect(),s=await e?.getBoundingClientRect();if(!s||!o)return;const i=await parseInt(e?.getBoundingClientRect()?.height),a=await parseInt(e?.getBoundingClientRect()?.width),l=await parseInt(n?.getBoundingClientRect()?.height),c=await parseInt(n?.getBoundingClientRect()?.width),d=await window.innerHeight,f=await window.innerWidth;let h=0,m=0;const y=s.bottom+r+l;switch(t){case"top":s.top-o.height-r<0?h=s.top-o.height+r+l+i:h=s.top-o.height-r,f>c+s.right+30?m=s.left-o.width/2+s.width/2:m=f-30-c;break;case"bottom":d>y?h=s.bottom+r:h=s.bottom-r-l-i,m=s.left-o.width/2+s.width/2;break;case"left":h=s.top-o.height/2+s.height/2,s.left-o.width-r>0?m=s.left-o.width-r:m=10;break;case"right":h=s.top-o.height/2+s.height/2,f-a>c?m=s.right+r:m=f-30-c;break;case"top-right":s.top-o.height-r<0?h=s.top-o.height+r+l+i:h=s.top-o.height-r,f-a>c?m=s.right+r:m=f-30-c;break;case"top-left":s.top-o.height-r<0?h=s.top-o.height+r+l+i:h=s.top-o.height-r,s.left-o.width-r>0?m=s.left-o.width-r:m=10;break;case"top-start":s.top-o.height-r<0?h=s.top-o.height+r+l+i:h=s.top-o.height-r,s.left>0?m=s.left:m=10;break;case"bottom-right":d>y?h=s.bottom+r:h=s.bottom-r-l-i,f-a>c?m=s.left:m=f-30-c;break;case"bottom-left":d>y?h=s.bottom+r:h=s.bottom-r-l-i,s.left>0?m=s.right-c:m=10;break;case"bottom-start":d>y?h=s.bottom+r:h=s.bottom-r-l-i,s.left>0?m=s.left:m=10;break}h+l>d?h=d-l-r:h<0&&(h=r),m+c>f?m=f-c-r:m<0&&(m=r),n instanceof HTMLElement&&(n.style.top=`${h}px`,n.style.left=`${m}px`,n.style.position="fixed")},h_={class:"text-center"},p_={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},hn=Object.assign({inheritAttrs:!1},{__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"body"}},emits:["isvisible"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=p.ref(!1),i=p.ref([]),a=p.ref(null),l=p.ref(null),c=p.ref(null);p.watch(s,A=>{A?(d(),window.addEventListener("resize",()=>qr(r.placement,l.value,c.value)),qr(r.placement,l.value,c.value)):window.removeEventListener("resize",()=>qr(r.placement,l.value,c.value)),o("isvisible",A)}),p.onMounted(()=>{window.addEventListener("click",E),window.addEventListener("popstate",_),window.addEventListener("scroll",x,!0),d()}),p.onBeforeUnmount(()=>{window.removeEventListener("click",E),window.removeEventListener("popstate",_),f()});const d=()=>{let A=a.value;for(;A&&A!==document.body;)(A.scrollHeight>A.clientHeight||A.scrollWidth>A.clientWidth)&&(A.addEventListener("scroll",w),i.value.push(A)),A=A.parentElement;document.body&&(document.body.addEventListener("scroll",w),i.value.push(document.body))},f=()=>{i.value.forEach(A=>{A.removeEventListener("scroll",w)}),i.value=[]},h=()=>{s.value=!0,qr(r.placement,l.value,c.value)},m=()=>{s.value=!1},y=async()=>{await qr(r.placement,l.value,c.value),s.value=!s.value},w=()=>{s.value=!1},E=A=>{if(!A){s.value=!1;return}l.value?.contains(A.target)||c.value?.contains(A.target)||(s.value=!1)},_=()=>{s.value&&(s.value=!1)},x=A=>{s.value&&c.value&&!c.value.contains(A.target)&&(s.value=!1)};return e({togglePopover:y}),(A,u)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"popover",ref:a,class:"vs-popover inline-block"},[p.createElementVNode("div",h_,[t.trigger==="click"?(p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:y,class:p.normalizeClass({"pointer-events-none":t.disabled})},[p.renderSlot(A.$slots,"reference",{},()=>[u[0]||(u[0]=p.createElementVNode("button",null,"Click me!",-1))])],2)):p.createCommentVNode("",!0),t.trigger==="hover"?(p.openBlock(),p.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:h,onMouseleave:m,class:p.normalizeClass({"pointer-events-none":t.disabled})},[p.renderSlot(A.$slots,"reference",{},()=>[u[1]||(u[1]=p.createElementVNode("button",null,"Click me!",-1))])],34)):p.createCommentVNode("",!0),(p.openBlock(),p.createBlock(p.Teleport,{to:t.teleport},[p.createVNode(p.Transition,{name:"fade"},{default:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{class:p.normalizeClass(["vsTailwind vs-popover__content",t.placement]),ref_key:"contentPop",ref:c,style:p.normalizeStyle({width:t.width?t.width+"px":"fit-content",zIndex:10002})},[p.createElementVNode("div",p_,[p.renderSlot(A.$slots,"default",{},()=>[u[2]||(u[2]=p.createElementVNode("span",null,"Popover content",-1))])])],6),[[p.vShow,s.value]])]),_:3})],8,["to"]))])],512))}}),m_={class:"flex flex-col gap-[2px] p-[2px]"},g_=["onClick"],b_={__name:"vs-editor-table",props:{editor:Object},setup(t){const{t:e}=$a(),n=t,r=p.ref(!1),o=p.ref("popover"),s=()=>{n.editor&&(n.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),o.value.togglePopover())},i=()=>{n.editor&&(n.editor.chain().focus().addColumnAfter().run(),o.value.togglePopover())},a=()=>{n.editor&&(n.editor.chain().focus().addRowAfter().run(),o.value.togglePopover())},l=()=>{n.editor&&(n.editor.chain().focus().deleteColumn().run(),o.value.togglePopover())},c=()=>{n.editor&&(n.editor.chain().focus().deleteRow().run(),o.value.togglePopover())},d=()=>{n.editor&&(n.editor.chain().focus().deleteTable().run(),o.value.togglePopover())},f=()=>{n.editor&&(n.editor.chain().focus().mergeCells().run(),o.value.togglePopover())},h=()=>{n.editor&&(n.editor.chain().focus().splitCell().run(),o.value.togglePopover())},m=p.computed(()=>[{text:e("createTable"),function:s},{text:e("addColumn"),function:i},{text:e("addRow"),function:a},{text:e("deleteColumn"),function:l},{text:e("deleteRow"),function:c},{text:e("deleteTable"),function:d},{text:e("mergeCells"),function:f},{text:e("splitCells"),function:h}]);return(y,w)=>(p.openBlock(),p.createBlock(hn,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:w[0]||(w[0]=E=>r.value=E)},{reference:p.withCtx(()=>[p.createElementVNode("button",{title:"Table",class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...w[1]||(w[1]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),p.createElementVNode("path",{d:"M3 10h18"}),p.createElementVNode("path",{d:"M10 3v18"})],-1)])],2)]),default:p.withCtx(()=>[p.createElementVNode("div",m_,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(m.value,(E,_)=>(p.openBlock(),p.createElementBlock("button",{key:_,onClick:E?.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},p.toDisplayString(E.text),9,g_))),128))])]),_:1},512))}},y_={},k_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function w_(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("svg",k_,[...e[0]||(e[0]=[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),p.createElementVNode("path",{d:"M4 6l16 0"},null,-1),p.createElementVNode("path",{d:"M8 12l8 0"},null,-1),p.createElementVNode("path",{d:"M6 18l12 0"},null,-1)])])}const __=ye(y_,[["render",w_]]),E_={},C_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function v_(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("svg",C_,[...e[0]||(e[0]=[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),p.createElementVNode("path",{d:"M4 6l16 0"},null,-1),p.createElementVNode("path",{d:"M10 12l10 0"},null,-1),p.createElementVNode("path",{d:"M6 18l14 0"},null,-1)])])}const S_=ye(E_,[["render",v_]]),T_={},x_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function N_(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("svg",x_,[...e[0]||(e[0]=[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),p.createElementVNode("path",{d:"M4 6l16 0"},null,-1),p.createElementVNode("path",{d:"M4 12l10 0"},null,-1),p.createElementVNode("path",{d:"M4 18l14 0"},null,-1)])])}const M_=ye(T_,[["render",N_]]),A_={},O_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-justify"};function L_(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("svg",O_,[...e[0]||(e[0]=[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),p.createElementVNode("path",{d:"M4 6h16"},null,-1),p.createElementVNode("path",{d:"M4 12h16"},null,-1),p.createElementVNode("path",{d:"M4 18h16"},null,-1)])])}const nh={left:M_,center:__,right:S_,justify:ye(A_,[["render",L_]])},I_={class:"flex gap-[4px] p-1"},P_=["title","onClick"],R_={__name:"vs-editor-align",props:{editor:Object},setup(t){const e=t,n=p.ref(!1),r=p.ref("popover"),o=p.ref("left"),s=p.computed(()=>e.editor?.isActive("left")),i=p.computed(()=>e.editor?.isActive("right")),a=p.computed(()=>e.editor?.isActive("center")),l=p.computed(()=>e.editor?.isActive("justify")),c=f=>{e.editor&&e.editor.chain().focus().setTextAlign(f).run()},d=p.ref([{id:"left",isActive:s},{id:"center",isActive:a},{id:"right",isActive:i},{id:"justify",isActive:l}]);return(f,h)=>(p.openBlock(),p.createBlock(hn,{ref_key:"popover",ref:r,placement:"bottom",onIsvisible:h[0]||(h[0]=m=>n.value=m)},{reference:p.withCtx(()=>[p.createElementVNode("button",{title:"Text Align",class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(p.unref(nh)[o.value]),{height:"16",width:"16"}))],2)]),default:p.withCtx(()=>[p.createElementVNode("div",I_,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(d.value,m=>(p.openBlock(),p.createElementBlock("button",{title:"Text align "+m?.id,class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":m?.isActive}]),key:m?.id,onClick:y=>c(m?.id)},[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(p.unref(nh)[m?.id]),{height:"16",width:"16"}))],10,P_))),128))])]),_:1},512))}},D_={class:"flex flex-col gap-[2px] p-[2px]"},B_=["onClick"],F_={__name:"vs-editor-type-tag",props:{editor:Object},setup(t){const{t:e}=$a(),n=t,r=p.ref(!1),o=p.ref("popover"),s=()=>{n.editor&&(n.editor?.chain().focus().setParagraph().run(),o.value.togglePopover())},i=l=>{n.editor&&(n.editor?.chain().focus().toggleHeading({level:l}).run(),o.value.togglePopover())},a=p.computed(()=>[{text:e("richtext.heading1"),id:1,style:"font-[700] text-[30px]"},{text:e("richtext.heading2"),id:2,style:"font-[700] text-[26px]"},{text:e("richtext.heading3"),id:3,style:"font-[700] text-[22px]"},{text:e("richtext.heading4"),id:4,style:"font-[700] text-[18px]"},{text:e("richtext.heading5"),id:5,style:"font-[500] text-[16px]"},{text:e("richtext.heading6"),id:6,style:"font-[400] text-[14px]"}]);return(l,c)=>(p.openBlock(),p.createBlock(hn,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:c[0]||(c[0]=d=>r.value=d)},{reference:p.withCtx(()=>[p.createElementVNode("button",{title:"Type Tag",class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...c[1]||(c[1]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.createElementVNode("path",{d:"M3 7v-2h13v2"}),p.createElementVNode("path",{d:"M10 5v14"}),p.createElementVNode("path",{d:"M12 19h-4"}),p.createElementVNode("path",{d:"M15 13v-1h6v1"}),p.createElementVNode("path",{d:"M18 12v7"}),p.createElementVNode("path",{d:"M17 19h2"})],-1)])],2)]),default:p.withCtx(()=>[p.createElementVNode("div",D_,[p.createElementVNode("button",{onClick:s,class:p.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[t.editor?.isActive("paragraph")?"bg-gray-100":""]])},p.toDisplayString(p.unref(e)("richtext.paragraph")),3),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(a.value,(d,f)=>(p.openBlock(),p.createElementBlock("button",{key:f,onClick:h=>i(d?.id),class:p.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[d?.style,t.editor?.isActive("heading",{level:d?.id})?"bg-gray-100":""]])},p.toDisplayString(p.unref(e)(`richtext.heading${d?.id}`)),11,B_))),128))])]),_:1},512))}},V_={},$_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function z_(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("svg",$_,[...e[0]||(e[0]=[p.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),p.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Jr=ye(V_,[["render",z_]]),H_={components:{VsText:th},inheritAttrs:!1,events:["update:modelValue"],props:{modelValue:{type:String},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}}},j_={class:"flex items-center w-full max-w-[182px]"},U_=["disabled"];function W_(t,e,n,r,o,s){const i=p.resolveComponent("vs-text");return p.openBlock(),p.createElementBlock("div",j_,[p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>s.value=a),type:"color",class:p.normalizeClass(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",n.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:n.disabled},null,10,U_),[[p.vModelText,s.value]]),n.isTextInputShown?(p.openBlock(),p.createBlock(i,{key:0,modelValue:s.value,"onUpdate:modelValue":e[1]||(e[1]=a=>s.value=a),class:"ml-2 w-full",disabled:n.disabled,clearable:n.clearable},null,8,["modelValue","disabled","clearable"])):p.createCommentVNode("",!0)])}const rh=ye(H_,[["render",W_]]),K_={title:"Text Color",class:"flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},G_={class:"flex gap-[4px] mb-[8px]"},q_={class:"grid grid-rows-3 grid-cols-7"},J_={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},Y_=["onClick","title"],X_={__name:"vs-editor-color",props:{editor:Object},setup(t){const e=t,n=p.ref("popover"),r=p.ref("#000000"),o=p.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),s=l=>{e.editor&&(e.editor.chain().focus().setColor(l).run(),r.value=l,n.value&&n.value.togglePopover())},i=()=>{s(r.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple","#FFFFFF":"White","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(p.openBlock(),p.createBlock(hn,{ref_key:"popover",ref:n,placement:"bottom"},{reference:p.withCtx(()=>[p.createElementVNode("button",K_,[c[1]||(c[1]=p.createElementVNode("span",{class:"leading-none"},"A",-1)),p.createElementVNode("span",{class:"block h-1 w-5",style:p.normalizeStyle({backgroundColor:r.value})},null,4)])]),default:p.withCtx(()=>[p.createElementVNode("div",null,[p.createElementVNode("div",G_,[p.createVNode(rh,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d)},null,8,["modelValue"]),p.createElementVNode("button",{onClick:i,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[p.createVNode(Jr,{class:"h-[24px] w-[24px] text-white"})])]),p.createElementVNode("div",q_,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(o.value,d=>(p.openBlock(),p.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[p.createElementVNode("div",J_,[p.createElementVNode("button",{class:"flex items-center justify-center w-full h-full",style:p.normalizeStyle({backgroundColor:d}),onClick:f=>s(d),title:a(d)},[r.value===d?(p.openBlock(),p.createBlock(Jr,{key:0,class:"h-5 w-5 text-gray-500"})):p.createCommentVNode("",!0)],12,Y_)])]))),128))])])]),_:1},512))}},Q_={title:"Background Color",class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},Z_={class:"flex gap-[4px] mb-[8px]"},eE={class:"grid grid-rows-3 grid-cols-7"},tE={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},nE=["onClick","title"],rE=["onClick","title"],oE={__name:"vs-editor-background-color",props:{editor:Object},setup(t){const e=t,n=p.ref("popover"),r=p.ref("transparent"),o=p.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),s=l=>{e.editor&&(e.editor.chain().focus().setBackgroundColor(l).run(),r.value=l,n.value&&n.value.togglePopover())},i=()=>{s(r.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple",transparent:"Transparent","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(p.openBlock(),p.createBlock(hn,{ref_key:"popover",ref:n,placement:"bottom"},{reference:p.withCtx(()=>[p.createElementVNode("button",Q_,[c[2]||(c[2]=p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"}),p.createElementVNode("path",{d:"m5 2 5 5"}),p.createElementVNode("path",{d:"M2 13h15"}),p.createElementVNode("path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"})],-1)),p.createElementVNode("span",{class:"block h-1 w-5",style:p.normalizeStyle({backgroundColor:r.value})},null,4)])]),default:p.withCtx(()=>[p.createElementVNode("div",null,[p.createElementVNode("div",Z_,[p.createVNode(rh,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=d=>r.value=d)},null,8,["modelValue"]),p.createElementVNode("button",{onClick:i,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[p.createVNode(Jr,{class:"h-[24px] w-[24px] text-white"})])]),p.createElementVNode("div",eE,[p.createElementVNode("button",{onClick:c[1]||(c[1]=d=>s("transparent")),class:"col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"},[...c[3]||(c[3]=[p.createElementVNode("svg",{fill:"#000000",width:"16",height:"16",viewBox:"0 0 52 52","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),p.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),p.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[p.createElementVNode("path",{d:"M48.5,5.6,46.4,3.5a1.67,1.67,0,0,0-2.4.3L32.59,15.21c-.77-1.3-1.51-2.61-2.21-4a36.5,36.5,0,0,1-3.15-8.36c-.13-.53-.39-.91-1-.89s-.86.4-1,.93c-.06.26-.11.51-.17.76A48.3,48.3,0,0,1,21,13.7,97.47,97.47,0,0,1,14.13,25a16,16,0,0,0-3,11.12c0,.14,0,.29.06.43L3.8,44a1.87,1.87,0,0,0-.3,2.4l2.1,2.1A1.67,1.67,0,0,0,8,48.2L48.2,8A1.67,1.67,0,0,0,48.5,5.6Z"}),p.createElementVNode("path",{d:"M38.42,23.79l-22,22.31A14.47,14.47,0,0,0,26.22,50a15.48,15.48,0,0,0,7-1.44c4.94-2.51,8.11-6.4,8.94-12A15.22,15.22,0,0,0,39,24.66C38.87,24.44,38.58,24,38.42,23.79Z"})])],-1),p.createElementVNode("p",null,"no color",-1)])]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(o.value,d=>(p.openBlock(),p.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[p.createElementVNode("div",tE,[d!=="transparent"?(p.openBlock(),p.createElementBlock("button",{key:0,class:"flex items-center justify-center w-full h-full",style:p.normalizeStyle({backgroundColor:d}),onClick:f=>s(d),title:a(d)},[r.value===d?(p.openBlock(),p.createBlock(Jr,{key:0,class:"h-5 w-5 text-gray-500"})):p.createCommentVNode("",!0)],12,nE)):p.createCommentVNode("",!0),d==="transparent"?(p.openBlock(),p.createElementBlock("button",{key:1,class:"flex items-center justify-center w-full h-full",onClick:f=>s(d),title:a(d)},[r.value===d?(p.openBlock(),p.createBlock(Jr,{key:0,class:"h-5 w-5 text-gray-500"})):p.createCommentVNode("",!0)],8,rE)):p.createCommentVNode("",!0)])]))),128))])])]),_:1},512))}},sE={__name:"vs-editor-highlight",props:{editor:Object},setup(t){const e=t,n=p.computed(()=>e.editor?.isActive("highlight")),r=()=>{e.editor&&e.editor.chain().focus().toggleHighlight().run()};return(o,s)=>(p.openBlock(),p.createElementBlock("button",{title:"Highlight",onClick:r,class:p.normalizeClass(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex",{"bg-gray-200":n.value}])},[...s[0]||(s[0]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("path",{d:"m9 11-6 6v3h9l3-3"}),p.createElementVNode("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})],-1)])],2))}},iE={class:"truncate"},aE={class:"w-[200px]"},lE={class:"max-h-[200px] overflow-y-auto"},cE=["onClick"],dE={__name:"vs-editor-font-family",props:{editor:Object},setup(t){const e=t,n=p.ref("popover"),r=p.ref(!1),o=p.ref([{label:"Arial",value:"Arial, sans-serif"},{label:"Helvetica",value:"Helvetica, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Comic Sans MS",value:"Comic Sans MS, cursive"},{label:"Impact",value:"Impact, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Palatino",value:"Palatino, serif"}]),s=p.computed(()=>{if(!e.editor)return"Arial, sans-serif";for(const c of o.value)if(e.editor.isActive("textStyle",{fontFamily:c.value}))return c.value;return"Arial, sans-serif"}),i=p.computed(()=>o.value.find(d=>d.value===s.value)?.label||"Arial"),a=c=>e.editor?e.editor.isActive("textStyle",{fontFamily:c}):!1,l=c=>{e.editor&&(e.editor.chain().focus().setFontFamily(c).run(),n.value&&n.value.togglePopover())};return(c,d)=>(p.openBlock(),p.createBlock(hn,{ref_key:"popover",ref:n,placement:"bottom",onIsvisible:d[0]||(d[0]=f=>r.value=f)},{reference:p.withCtx(()=>[p.createElementVNode("button",{title:"Font Family",class:p.normalizeClass(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm",[r.value?"bg-gray-100 text-gray-900":"text-gray-700"]]),style:p.normalizeStyle({fontFamily:s.value})},[p.createElementVNode("span",iE,p.toDisplayString(i.value),1),d[1]||(d[1]=p.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))],6)]),default:p.withCtx(()=>[p.createElementVNode("div",aE,[p.createElementVNode("ul",lE,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(o.value,f=>(p.openBlock(),p.createElementBlock("li",{key:f.value,class:p.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",{"bg-gray-100":a(f.value)}]),style:p.normalizeStyle({fontFamily:f.value}),onClick:h=>l(f.value)},p.toDisplayString(f.label),15,cE))),128))])])]),_:1},512))}},uE={class:"w-[120px]"},fE={class:"max-h-[200px] overflow-y-auto"},hE=["onClick"],pE={__name:"vs-editor-font-size",props:{editor:Object},setup(t){const e=t,n=p.ref("popover"),r=p.ref("14px"),o=p.ref([{label:"8px",value:"8px"},{label:"9px",value:"9px"},{label:"10px",value:"10px"},{label:"11px",value:"11px"},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"36px",value:"36px"},{label:"48px",value:"48px"},{label:"72px",value:"72px"}]),s=i=>{e.editor&&(e.editor.chain().focus().setFontSize(i).run(),r.value=i,n.value&&n.value.togglePopover())};return(i,a)=>(p.openBlock(),p.createBlock(hn,{ref_key:"popover",ref:n,placement:"bottom"},{reference:p.withCtx(()=>[...a[0]||(a[0]=[p.createElementVNode("button",{title:"Font Size",class:"h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1"},[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-alarge-small-icon lucide-a-large-small"},[p.createElementVNode("path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"}),p.createElementVNode("path",{d:"M15.697 14h5.606"}),p.createElementVNode("path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"}),p.createElementVNode("path",{d:"M3.304 13h6.392"})]),p.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("polyline",{points:"6,9 12,15 18,9"})])],-1)])]),default:p.withCtx(()=>[p.createElementVNode("div",uE,[p.createElementVNode("ul",fE,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(o.value,l=>(p.openBlock(),p.createElementBlock("li",{key:l.value,class:"px-3 py-2 hover:bg-gray-100 cursor-pointer",onClick:c=>s(l.value)},p.toDisplayString(l.label),9,hE))),128))])])]),_:1},512))}},mE={props:{editor:Object},methods:{toggleSuperscript(){this.editor&&this.editor.commands.toggleSuperscript()}}};function gE(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Superscript",onClick:e[0]||(e[0]=(...i)=>s.toggleSuperscript&&s.toggleSuperscript(...i)),class:p.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("superscript")}])},[...e[1]||(e[1]=[p.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript-icon lucide-superscript"><path d="m4 19 8-8"></path><path d="m12 19-8-8"></path><path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"></path></svg><span class="sr-only">Superscript</span>',2)])],2)}const bE=ye(mE,[["render",gE]]),yE={props:{editor:Object},methods:{toggleSubscript(){this.editor&&this.editor.commands.toggleSubscript()}}};function kE(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Subscript",onClick:e[0]||(e[0]=(...i)=>s.toggleSubscript&&s.toggleSubscript(...i)),class:p.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("subscript")}])},[...e[1]||(e[1]=[p.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-subscript-icon lucide-subscript"><path d="m4 5 8 8"></path><path d="m12 5-8 8"></path><path d="M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07"></path></svg><span class="sr-only">Subscript</span>',2)])],2)}const wE=ye(yE,[["render",kE]]),_E={title:"Heading",class:"h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"},EE={class:"truncate"},CE={class:"max-h-[200px] overflow-y-auto"},vE=["onClick"],SE=ye({__name:"vs-editor-heading",props:{editor:Object},setup(t){const e=t,n=p.ref("popover"),r=p.ref([{label:"Heading 1",value:1},{label:"Heading 2",value:2},{label:"Heading 3",value:3},{label:"Heading 4",value:4},{label:"Heading 5",value:5},{label:"Heading 6",value:6}]),o=p.computed(()=>{if(!e.editor)return"Paragraph";for(let l=1;l<=6;l++)if(e.editor.isActive("heading",{level:l}))return`H ${l}`;return"P"}),s=l=>({1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"})[l]||"",i=l=>{e.editor&&(e.editor.chain().focus().setHeading({level:l}).run(),n.value&&n.value.togglePopover())},a=()=>{e.editor&&(e.editor.chain().focus().setParagraph().run(),n.value&&n.value.togglePopover())};return(l,c)=>(p.openBlock(),p.createBlock(hn,{ref_key:"popover",ref:n,placement:"bottom"},{reference:p.withCtx(()=>[p.createElementVNode("button",_E,[p.createElementVNode("span",EE,p.toDisplayString(o.value),1),c[0]||(c[0]=p.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))])]),default:p.withCtx(()=>[p.createElementVNode("div",null,[p.createElementVNode("ul",CE,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.value,d=>(p.openBlock(),p.createElementBlock("li",{key:d.value,class:p.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",`heading-level-${d.value}`]),style:p.normalizeStyle(s(d.value)),onClick:f=>i(d.value)},p.toDisplayString(d.label),15,vE))),128)),p.createElementVNode("li",{class:"px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",onClick:a}," Paragraph ")])])]),_:1},512))}},[["__scopeId","data-v-ef7c378e"]]),TE={props:{editor:Object},methods:{clearFormatting(){this.editor&&this.editor.commands.unsetAllMarks()}}};function xE(t,e,n,r,o,s){return p.openBlock(),p.createElementBlock("button",{title:"Clear Formatting",onClick:e[0]||(e[0]=(...i)=>s.clearFormatting&&s.clearFormatting(...i)),class:"h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[p.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-remove-formatting-icon lucide-remove-formatting"><path d="M4 7V4h16v3"></path><path d="M5 20h6"></path><path d="M13 4 8 20"></path><path d="m15 15 5 5"></path><path d="m20 15-5 5"></path></svg><span class="sr-only">Clear Formatting</span>',2)])])}const NE=ye(TE,[["render",xE]]),ME={class:"relative"},AE={class:"space-y-4"},OE={key:0,class:"mt-4"},LE=["src","alt","title"],IE={key:0,class:"text-sm text-red-500"},PE=Object.assign({inheritAttrs:!1},{__name:"vs-editor-image",props:{editor:{type:Object,required:!0}},setup(t){const e=t,n=p.ref(!1),r=p.ref(!1),o=p.ref({src:"",alt:"",title:""}),s=()=>{o.value={src:"",alt:"",title:""},r.value=!1,n.value=!0},i=()=>{n.value=!1,r.value=!1},a=()=>{if(!o.value.src){alert("Please enter an image URL");return}e.editor&&e.editor.chain().focus().setImage({src:o.value.src,alt:o.value.alt||"",title:o.value.title||""}).run(),i()},l=()=>{a()},c=()=>{i()};return p.watch(()=>o.value.src,()=>{r.value=!1}),(d,f)=>(p.openBlock(),p.createElementBlock("div",ME,[p.createElementVNode("button",{onClick:s,class:p.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",t.editor?.isActive("image")?"bg-gray-200 text-gray-900":""]),title:"Add Image"},[...f[5]||(f[5]=[p.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"></rect><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path></svg><span class="sr-only">Add Image</span>',2)])],2),p.createVNode(eh,{modelValue:n.value,"onUpdate:modelValue":f[4]||(f[4]=h=>n.value=h),title:"Add Image"},{footer:p.withCtx(()=>[p.createElementVNode("button",{onClick:c,type:"button",class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Cancel "),p.createElementVNode("button",{onClick:l,type:"button",class:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Add Image ")]),default:p.withCtx(()=>[p.createElementVNode("div",AE,[p.createElementVNode("div",null,[f[6]||(f[6]=p.createElementVNode("label",{for:"imageUrl",class:"block text-sm font-medium text-gray-700 mb-1"}," Image URL ",-1)),p.withDirectives(p.createElementVNode("input",{id:"imageUrl","onUpdate:modelValue":f[0]||(f[0]=h=>o.value.src=h),type:"url",placeholder:"https://example.com/image.png",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:""},null,512),[[p.vModelText,o.value.src]])]),p.createElementVNode("div",null,[f[7]||(f[7]=p.createElementVNode("label",{for:"imageAlt",class:"block text-sm font-medium text-gray-700 mb-1"}," Alt Text ",-1)),p.withDirectives(p.createElementVNode("input",{id:"imageAlt","onUpdate:modelValue":f[1]||(f[1]=h=>o.value.alt=h),type:"text",placeholder:"Description of the image",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[p.vModelText,o.value.alt]])]),p.createElementVNode("div",null,[f[8]||(f[8]=p.createElementVNode("label",{for:"imageTitle",class:"block text-sm font-medium text-gray-700 mb-1"}," Title (optional) ",-1)),p.withDirectives(p.createElementVNode("input",{id:"imageTitle","onUpdate:modelValue":f[2]||(f[2]=h=>o.value.title=h),type:"text",placeholder:"Image title",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[p.vModelText,o.value.title]])]),o.value.src?(p.openBlock(),p.createElementBlock("div",OE,[f[9]||(f[9]=p.createElementVNode("p",{class:"text-sm text-gray-600 mb-2"},"Preview:",-1)),p.withDirectives(p.createElementVNode("img",{src:o.value.src,alt:o.value.alt||"Image preview",title:o.value.title,class:"max-w-full h-auto max-h-32 rounded border",onError:f[3]||(f[3]=h=>r.value=!0)},null,40,LE),[[p.vShow,!r.value]]),r.value?(p.openBlock(),p.createElementBlock("p",IE," Failed to load image preview ")):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)])]),_:1},8,["modelValue"])]))}}),RE={class:"flex items-center"},DE=["disabled"],BE=["disabled"],FE=ye(Object.assign({inheritAttrs:!1},{__name:"vs-editor-history",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor?.can().undo()&&e.editor.chain().focus().undo().run()},r=()=>{e.editor?.can().redo()&&e.editor.chain().focus().redo().run()};return(o,s)=>(p.openBlock(),p.createElementBlock("div",RE,[p.createElementVNode("button",{onClick:n,class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200",[t.editor?.can().undo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!t.editor?.can().undo(),title:"Undo (Ctrl+Z)"},[...s[0]||(s[0]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("path",{d:"M3 7v6h6"}),p.createElementVNode("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)])],10,DE),p.createElementVNode("button",{onClick:r,class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.can().redo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!t.editor?.can().redo(),title:"Redo (Ctrl+Y)"},[...s[1]||(s[1]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("path",{d:"M21 7v6h-6"}),p.createElementVNode("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13"})],-1)])],10,BE)]))}}),[["__scopeId","data-v-b5a7cc5a"]]),VE={class:"relative"},oh={bold:Rw,italic:Fw,color:X_,background_color:oE,highlight:sE,bullet_list:Tw,ordered_list:Mw,blockquote:Cw,codeblock:Lw,underline:Vw,strike:$w,link:f_,table:b_,text_align:R_,type_tag:F_,font_family:dE,font_size:pE,superscript:bE,subscript:wE,heading:SE,clear_formatting:NE,image:PE,history:FE,help:ye(Object.assign({inheritAttrs:!1},{__name:"vs-editor-help",props:{editor:Object},setup(t){const e=p.ref(!1),n=p.ref(null),r=()=>{e.value=!e.value},o=()=>{e.value=!1};return(s,i)=>(p.openBlock(),p.createElementBlock("div",VE,[p.createElementVNode("button",{ref_key:"helpButton",ref:n,onClick:r,class:p.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500",[e.value?"bg-gray-100 text-gray-900":"text-gray-500"]]),title:"Markdown Shortcuts Help"},[...i[1]||(i[1]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),p.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),p.createElementVNode("line",{x1:"12",x2:"12.01",y1:"17",y2:"17"})],-1)])],2),e.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:o},[p.createElementVNode("div",{class:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",onClick:i[0]||(i[0]=p.withModifiers(()=>{},["stop"]))},[p.createElementVNode("div",{class:"p-6"},[p.createElementVNode("div",{class:"flex justify-between items-center mb-4"},[i[3]||(i[3]=p.createElementVNode("h2",{class:"text-xl font-semibold text-gray-900"},"Common Markdown Syntax & Shortcuts",-1)),p.createElementVNode("button",{onClick:o,class:"text-gray-400 hover:text-gray-600 transition-colors"},[...i[2]||(i[2]=[p.createElementVNode("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),i[4]||(i[4]=p.createStaticVNode('<div class="space-y-6" data-v-155e282c><div data-v-155e282c><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-155e282c>Markdown Syntax</h3><div class="overflow-x-auto" data-v-155e282c><table class="w-full border-collapse" data-v-155e282c><thead data-v-155e282c><tr class="bg-gray-50" data-v-155e282c><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Example</th></tr></thead><tbody class="text-sm" data-v-155e282c><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>_italic text_</code></td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>###### Heading 6</code></td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>1. First item</code>). </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Start with a greater-than sign (>) followed by a space. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>`</code>). </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Images</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c></code> syntax. </td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Links</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-155e282c> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-155e282c><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-155e282c>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-155e282c><table class="w-full border-collapse" data-v-155e282c><thead data-v-155e282c><tr class="bg-gray-50" data-v-155e282c><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-155e282c>Action</th></tr></thead><tbody class="text-sm" data-v-155e282c><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Select all text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Apply bold formatting</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Copy selected text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Apply italic formatting</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Save the current document</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Paste copied text</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Cut selected text</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Redo the last action</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Redo the last action</td></tr><tr data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Undo the last action</td></tr><tr class="bg-gray-25" data-v-155e282c><td class="border border-gray-200 px-3 py-2 font-medium" data-v-155e282c><code class="bg-gray-100 px-2 py-1 rounded" data-v-155e282c>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-155e282c>Undo the last action</td></tr></tbody></table></div></div></div>',1))])])])):p.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-155e282c"]]),horizontal_rule:{__name:"vs-editor-horizontal-rule",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().setHorizontalRule().run()};return(r,o)=>(p.openBlock(),p.createElementBlock("button",{title:"Horizontal Rule",onClick:n,class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},[...o[0]||(o[0]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("line",{x1:"3",x2:"21",y1:"12",y2:"12"})],-1)])]))}},fullscreen:{__name:"vs-editor-fullscreen",props:{editor:Object},emits:["toggle-fullscreen"],setup(t,{emit:e}){const n=e,r=()=>{n("toggle-fullscreen")};return(o,s)=>(p.openBlock(),p.createElementBlock("button",{title:"Fullscreen",onClick:r,class:"w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"},[...s[0]||(s[0]=[p.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[p.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})],-1)])]))}}},$E=async t=>{try{const e=new FormData;return e.append("unique","true"),e.append("file",t),(await(await fetch("/file/upload/uploads?id=&form=&table=",{method:"POST",body:e})).json())?.result}catch(e){console.error(e)}},sh=async(t,e)=>{const n=e.clipboardData?.items;if(n){const r=e.clipboardData?.getData("text/html"),o=e.clipboardData?.getData("text/plain");if(r){const{state:s,dispatch:i}=t,{tr:a}=s,l=Wn.fromSchema(t.state.schema),c=new DOMParser().parseFromString(r,"text/html").body,d=l.parse(c),f=a.replaceSelectionWith(d);return i(f),e.preventDefault(),!0}if(o){const{state:s,dispatch:i}=t,{tr:a}=s,l=a.insertText(o,s.selection.from,s.selection.to);return i(l),e.preventDefault(),!0}for(let s=0;s<n.length;s++){const i=n[s];if(i.type.startsWith("image/")){const a=i.getAsFile();if(a){const l=await $E(a),{schema:c}=t.state,d=c.nodes.image.create({src:l?.file_path}),f=t.state.tr.replaceSelectionWith(d);return t.dispatch(f),e.preventDefault(),!0}}}}return!1},zE={1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"},ih=hf.extend({addOptions(){return{...this.parent?.(),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){return{...this.parent?.(),level:{default:1,renderHTML:t=>{const e=t.level||1;return{class:`heading-level-${e}`,style:zE[e-1]}}}}}}),ah=jf.configure({HTMLAttributes:{style:"min-height: 1rem;"}}),Ls={basic:["history","bold","italic","underline","strike","text_align","bullet_list","ordered_list","link","image","clear_formatting","help"],default:["heading","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","codeblock","table","link","image","horizontal_rule","clear_formatting","fullscreen","help"],full:["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","horizontal_rule","superscript","subscript","clear_formatting","fullscreen","help"]},HE={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},jE=Object.assign({inheritAttrs:!1},{__name:"vs-richtext",props:p.mergeModels({modelValue:{type:String,default:()=>""},height:{type:String,default:()=>"300px"},toolbar:{type:[Array,String],default:()=>"default"}},{modelValue:{},modelModifiers:{}}),emits:p.mergeModels(["update:modelValue"],["update:modelValue"]),setup(t){const e=t,n=p.ref(!1),r=p.useModel(t,"modelValue"),o=()=>{n.value=!n.value};let s=!1;const i=Bu({content:e.modelValue,extensions:[Xf.configure({history:{depth:100,newGroupDelay:500},code:{HTMLAttributes:{class:"editor-code"}},codeBlock:{HTMLAttributes:{class:"editor-codeblock"}},paragraph:!1,heading:!1,link:!1}),ff,uf,Vu,ah,ih,df,Qf,Zf.configure({types:["heading","paragraph"]}),Ia.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0}),cf.configure({table:{HTMLAttributes:{class:"editor-content"},resizable:!0}})],editorProps:{handlePaste:sh}}),a=p.computed(()=>typeof e.toolbar=="string"?Ls[e.toolbar]||Ls.default:e.toolbar),l=p.computed(()=>a.value.map(f=>oh[f]).filter(Boolean)),c=p.computed(()=>i.value);p.watch(()=>e.modelValue,f=>{if(i.value&&!s){const h=f||"",m=i.value.getHTML();h!==m&&h!=="<p></p>"&&i.value.commands.setContent(h,!1)}},{immediate:!0}),p.watch(i,f=>{f&&i.value.on("update",h=>{if(!s){s=!0;const m=h.editor.getHTML();m!==e.modelValue&&m!=="<p></p>"&&(r.value=m),setTimeout(()=>{s=!1},10)}})});const d=()=>{i.value&&!i.value.isFocused&&i.value.commands.focus()};return(f,h)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["bg-white border border border-solid border-gray-200 rounded-xl",{"fixed left-0 right-0 top-0 bottom-0 z-[100000]":n.value}])},[p.createElementVNode("div",HE,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(l.value,m=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:m},[p.unref(i)?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(m),{key:0,editor:c.value,onToggleFullscreen:o},null,40,["editor"])):p.createCommentVNode("",!0)],64))),128))]),p.createElementVNode("div",{onClick:d,class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800",style:p.normalizeStyle({height:t.height})},[p.createVNode(p.unref(Du),{editor:p.unref(i),class:"relative w-full"},null,8,["editor"])],4)],2))}});function UE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Is={exports:{}},WE=Is.exports,lh;function KE(){return lh||(lh=1,(function(t){(function(){function e(u){var b={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(u===!1)return JSON.parse(JSON.stringify(b));var g={};for(var k in b)b.hasOwnProperty(k)&&(g[k]=b[k].defaultValue);return g}function n(){var u=e(!0),b={};for(var g in u)u.hasOwnProperty(g)&&(b[g]=!0);return b}var r={},o={},s={},i=e(!0),a="vanilla",l={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:n()};r.helper={},r.extensions={},r.setOption=function(u,b){return i[u]=b,this},r.getOption=function(u){return i[u]},r.getOptions=function(){return i},r.resetOptions=function(){i=e(!0)},r.setFlavor=function(u){if(!l.hasOwnProperty(u))throw Error(u+" flavor was not found");r.resetOptions();var b=l[u];a=u;for(var g in b)b.hasOwnProperty(g)&&(i[g]=b[g])},r.getFlavor=function(){return a},r.getFlavorOptions=function(u){if(l.hasOwnProperty(u))return l[u]},r.getDefaultOptions=function(u){return e(u)},r.subParser=function(u,b){if(r.helper.isString(u))if(typeof b<"u")o[u]=b;else{if(o.hasOwnProperty(u))return o[u];throw Error("SubParser named "+u+" not registered!")}},r.extension=function(u,b){if(!r.helper.isString(u))throw Error("Extension 'name' must be a string");if(u=r.helper.stdExtName(u),r.helper.isUndefined(b)){if(!s.hasOwnProperty(u))throw Error("Extension named "+u+" is not registered!");return s[u]}else{typeof b=="function"&&(b=b()),r.helper.isArray(b)||(b=[b]);var g=c(b,u);if(g.valid)s[u]=b;else throw Error(g.error)}},r.getAllExtensions=function(){return s},r.removeExtension=function(u){delete s[u]},r.resetExtensions=function(){s={}};function c(u,b){var g=b?"Error in "+b+" extension->":"Error in unnamed extension",k={valid:!0,error:""};r.helper.isArray(u)||(u=[u]);for(var C=0;C<u.length;++C){var T=g+" sub-extension "+C+": ",v=u[C];if(typeof v!="object")return k.valid=!1,k.error=T+"must be an object, but "+typeof v+" given",k;if(!r.helper.isString(v.type))return k.valid=!1,k.error=T+'property "type" must be a string, but '+typeof v.type+" given",k;var O=v.type=v.type.toLowerCase();if(O==="language"&&(O=v.type="lang"),O==="html"&&(O=v.type="output"),O!=="lang"&&O!=="output"&&O!=="listener")return k.valid=!1,k.error=T+"type "+O+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',k;if(O==="listener"){if(r.helper.isUndefined(v.listeners))return k.valid=!1,k.error=T+'. Extensions of type "listener" must have a property called "listeners"',k}else if(r.helper.isUndefined(v.filter)&&r.helper.isUndefined(v.regex))return k.valid=!1,k.error=T+O+' extensions must define either a "regex" property or a "filter" method',k;if(v.listeners){if(typeof v.listeners!="object")return k.valid=!1,k.error=T+'"listeners" property must be an object but '+typeof v.listeners+" given",k;for(var R in v.listeners)if(v.listeners.hasOwnProperty(R)&&typeof v.listeners[R]!="function")return k.valid=!1,k.error=T+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+R+" must be a function but "+typeof v.listeners[R]+" given",k}if(v.filter){if(typeof v.filter!="function")return k.valid=!1,k.error=T+'"filter" must be a function, but '+typeof v.filter+" given",k}else if(v.regex){if(r.helper.isString(v.regex)&&(v.regex=new RegExp(v.regex,"g")),!(v.regex instanceof RegExp))return k.valid=!1,k.error=T+'"regex" property must either be a string or a RegExp object, but '+typeof v.regex+" given",k;if(r.helper.isUndefined(v.replace))return k.valid=!1,k.error=T+'"regex" extensions must implement a replace string or function',k}}return k}r.validateExtension=function(u){var b=c(u,null);return b.valid?!0:(console.warn(b.error),!1)},r.hasOwnProperty("helper")||(r.helper={}),r.helper.isString=function(u){return typeof u=="string"||u instanceof String},r.helper.isFunction=function(u){var b={};return u&&b.toString.call(u)==="[object Function]"},r.helper.isArray=function(u){return Array.isArray(u)},r.helper.isUndefined=function(u){return typeof u>"u"},r.helper.forEach=function(u,b){if(r.helper.isUndefined(u))throw new Error("obj param is required");if(r.helper.isUndefined(b))throw new Error("callback param is required");if(!r.helper.isFunction(b))throw new Error("callback param must be a function/closure");if(typeof u.forEach=="function")u.forEach(b);else if(r.helper.isArray(u))for(var g=0;g<u.length;g++)b(u[g],g,u);else if(typeof u=="object")for(var k in u)u.hasOwnProperty(k)&&b(u[k],k,u);else throw new Error("obj does not seem to be an array or an iterable object")},r.helper.stdExtName=function(u){return u.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()};function d(u,b){var g=b.charCodeAt(0);return"¨E"+g+"E"}r.helper.escapeCharactersCallback=d,r.helper.escapeCharacters=function(u,b,g){var k="(["+b.replace(/([\[\]\\])/g,"\\$1")+"])";g&&(k="\\\\"+k);var C=new RegExp(k,"g");return u=u.replace(C,d),u},r.helper.unescapeHTMLEntities=function(u){return u.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var f=function(u,b,g,k){var C=k||"",T=C.indexOf("g")>-1,v=new RegExp(b+"|"+g,"g"+C.replace(/g/g,"")),O=new RegExp(b,C.replace(/g/g,"")),R=[],B,D,V,S,P;do for(B=0;V=v.exec(u);)if(O.test(V[0]))B++||(D=v.lastIndex,S=D-V[0].length);else if(B&&!--B){P=V.index+V[0].length;var U={left:{start:S,end:D},match:{start:D,end:V.index},right:{start:V.index,end:P},wholeMatch:{start:S,end:P}};if(R.push(U),!T)return R}while(B&&(v.lastIndex=D));return R};r.helper.matchRecursiveRegExp=function(u,b,g,k){for(var C=f(u,b,g,k),T=[],v=0;v<C.length;++v)T.push([u.slice(C[v].wholeMatch.start,C[v].wholeMatch.end),u.slice(C[v].match.start,C[v].match.end),u.slice(C[v].left.start,C[v].left.end),u.slice(C[v].right.start,C[v].right.end)]);return T},r.helper.replaceRecursiveRegExp=function(u,b,g,k,C){if(!r.helper.isFunction(b)){var T=b;b=function(){return T}}var v=f(u,g,k,C),O=u,R=v.length;if(R>0){var B=[];v[0].wholeMatch.start!==0&&B.push(u.slice(0,v[0].wholeMatch.start));for(var D=0;D<R;++D)B.push(b(u.slice(v[D].wholeMatch.start,v[D].wholeMatch.end),u.slice(v[D].match.start,v[D].match.end),u.slice(v[D].left.start,v[D].left.end),u.slice(v[D].right.start,v[D].right.end))),D<R-1&&B.push(u.slice(v[D].wholeMatch.end,v[D+1].wholeMatch.start));v[R-1].wholeMatch.end<u.length&&B.push(u.slice(v[R-1].wholeMatch.end)),O=B.join("")}return O},r.helper.regexIndexOf=function(u,b,g){if(!r.helper.isString(u))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(!(b instanceof RegExp))throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var k=u.substring(g||0).search(b);return k>=0?k+(g||0):k},r.helper.splitAtIndex=function(u,b){if(!r.helper.isString(u))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[u.substring(0,b),u.substring(b)]},r.helper.encodeEmailAddress=function(u){var b=[function(g){return"&#"+g.charCodeAt(0)+";"},function(g){return"&#x"+g.charCodeAt(0).toString(16)+";"},function(g){return g}];return u=u.replace(/./g,function(g){if(g==="@")g=b[Math.floor(Math.random()*2)](g);else{var k=Math.random();g=k>.9?b[2](g):k>.45?b[1](g):b[0](g)}return g}),u},r.helper.padEnd=function(b,g,k){return g=g>>0,k=String(k||" "),b.length>g?String(b):(g=g-b.length,g>k.length&&(k+=k.repeat(g/k.length)),String(b)+k.slice(0,g))},typeof console>"u"&&(console={warn:function(u){alert(u)},log:function(u){alert(u)},error:function(u){throw u}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:`<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`},r.Converter=function(u){var b={},g=[],k=[],C={},T=a,v={parsed:{},raw:"",format:""};O();function O(){u=u||{};for(var S in i)i.hasOwnProperty(S)&&(b[S]=i[S]);if(typeof u=="object")for(var P in u)u.hasOwnProperty(P)&&(b[P]=u[P]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof u+" was passed instead.");b.extensions&&r.helper.forEach(b.extensions,R)}function R(S,P){if(P=P||null,r.helper.isString(S))if(S=r.helper.stdExtName(S),P=S,r.extensions[S]){console.warn("DEPRECATION WARNING: "+S+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),B(r.extensions[S],S);return}else if(!r.helper.isUndefined(s[S]))S=s[S];else throw Error('Extension "'+S+'" could not be loaded. It was either not found or is not a valid extension.');typeof S=="function"&&(S=S()),r.helper.isArray(S)||(S=[S]);var U=c(S,P);if(!U.valid)throw Error(U.error);for(var K=0;K<S.length;++K){switch(S[K].type){case"lang":g.push(S[K]);break;case"output":k.push(S[K]);break}if(S[K].hasOwnProperty("listeners"))for(var Z in S[K].listeners)S[K].listeners.hasOwnProperty(Z)&&D(Z,S[K].listeners[Z])}}function B(S,P){typeof S=="function"&&(S=S(new r.Converter)),r.helper.isArray(S)||(S=[S]);var U=c(S,P);if(!U.valid)throw Error(U.error);for(var K=0;K<S.length;++K)switch(S[K].type){case"lang":g.push(S[K]);break;case"output":k.push(S[K]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}function D(S,P){if(!r.helper.isString(S))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof S+" given");if(typeof P!="function")throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof P+" given");C.hasOwnProperty(S)||(C[S]=[]),C[S].push(P)}function V(S){var P=S.match(/^\s*/)[0].length,U=new RegExp("^\\s{0,"+P+"}","gm");return S.replace(U,"")}this._dispatch=function(P,U,K,Z){if(C.hasOwnProperty(P))for(var G=0;G<C[P].length;++G){var Oe=C[P][G](P,U,this,K,Z);Oe&&typeof Oe<"u"&&(U=Oe)}return U},this.listen=function(S,P){return D(S,P),this},this.makeHtml=function(S){if(!S)return S;var P={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:g,outputModifiers:k,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return S=S.replace(/¨/g,"¨T"),S=S.replace(/\$/g,"¨D"),S=S.replace(/\r\n/g,`
|
|
105
|
+
`),S=S.replace(/\r/g,`
|
|
106
|
+
`),S=S.replace(/\u00A0/g," "),b.smartIndentationFix&&(S=V(S)),S=`
|
|
107
|
+
|
|
108
|
+
`+S+`
|
|
109
|
+
|
|
110
|
+
`,S=r.subParser("detab")(S,b,P),S=S.replace(/^[ \t]+$/mg,""),r.helper.forEach(g,function(U){S=r.subParser("runExtension")(U,S,b,P)}),S=r.subParser("metadata")(S,b,P),S=r.subParser("hashPreCodeTags")(S,b,P),S=r.subParser("githubCodeBlocks")(S,b,P),S=r.subParser("hashHTMLBlocks")(S,b,P),S=r.subParser("hashCodeTags")(S,b,P),S=r.subParser("stripLinkDefinitions")(S,b,P),S=r.subParser("blockGamut")(S,b,P),S=r.subParser("unhashHTMLSpans")(S,b,P),S=r.subParser("unescapeSpecialChars")(S,b,P),S=S.replace(/¨D/g,"$$"),S=S.replace(/¨T/g,"¨"),S=r.subParser("completeHTMLDocument")(S,b,P),r.helper.forEach(k,function(U){S=r.subParser("runExtension")(U,S,b,P)}),v=P.metadata,S},this.makeMarkdown=this.makeMd=function(S,P){if(S=S.replace(/\r\n/g,`
|
|
111
|
+
`),S=S.replace(/\r/g,`
|
|
112
|
+
`),S=S.replace(/>[ \t]+</,">¨NBSP;<"),!P)if(window&&window.document)P=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var U=P.createElement("div");U.innerHTML=S;var K={preList:et(U)};Fe(U);for(var Z=U.childNodes,G="",Oe=0;Oe<Z.length;Oe++)G+=r.subParser("makeMarkdown.node")(Z[Oe],K);function Fe(Se){for(var Ve=0;Ve<Se.childNodes.length;++Ve){var $e=Se.childNodes[Ve];$e.nodeType===3?!/\S/.test($e.nodeValue)&&!/^[ ]+$/.test($e.nodeValue)?(Se.removeChild($e),--Ve):($e.nodeValue=$e.nodeValue.split(`
|
|
113
|
+
`).join(" "),$e.nodeValue=$e.nodeValue.replace(/(\s)+/g,"$1")):$e.nodeType===1&&Fe($e)}}function et(Se){for(var Ve=Se.querySelectorAll("pre"),$e=[],ze=0;ze<Ve.length;++ze)if(Ve[ze].childElementCount===1&&Ve[ze].firstChild.tagName.toLowerCase()==="code"){var $n=Ve[ze].firstChild.innerHTML.trim(),gn=Ve[ze].firstChild.getAttribute("data-language")||"";if(gn==="")for(var hr=Ve[ze].firstChild.className.split(" "),zn=0;zn<hr.length;++zn){var bn=hr[zn].match(/^language-(.+)$/);if(bn!==null){gn=bn[1];break}}$n=r.helper.unescapeHTMLEntities($n),$e.push($n),Ve[ze].outerHTML='<precode language="'+gn+'" precodenum="'+ze.toString()+'"></precode>'}else $e.push(Ve[ze].innerHTML),Ve[ze].innerHTML="",Ve[ze].setAttribute("prenum",ze.toString());return $e}return G},this.setOption=function(S,P){b[S]=P},this.getOption=function(S){return b[S]},this.getOptions=function(){return b},this.addExtension=function(S,P){P=P||null,R(S,P)},this.useExtension=function(S){R(S)},this.setFlavor=function(S){if(!l.hasOwnProperty(S))throw Error(S+" flavor was not found");var P=l[S];T=S;for(var U in P)P.hasOwnProperty(U)&&(b[U]=P[U])},this.getFlavor=function(){return T},this.removeExtension=function(S){r.helper.isArray(S)||(S=[S]);for(var P=0;P<S.length;++P){for(var U=S[P],K=0;K<g.length;++K)g[K]===U&&g.splice(K,1);for(var Z=0;Z<k.length;++Z)k[Z]===U&&k.splice(Z,1)}},this.getAllExtensions=function(){return{language:g,output:k}},this.getMetadata=function(S){return S?v.raw:v.parsed},this.getMetadataFormat=function(){return v.format},this._setMetadataPair=function(S,P){v.parsed[S]=P},this._setMetadataFormat=function(S){v.format=S},this._setMetadataRaw=function(S){v.raw=S}},r.subParser("anchors",function(u,b,g){u=g.converter._dispatch("anchors.before",u,b,g);var k=function(C,T,v,O,R,B,D){if(r.helper.isUndefined(D)&&(D=""),v=v.toLowerCase(),C.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)O="";else if(!O)if(v||(v=T.toLowerCase().replace(/ ?\n/g," ")),O="#"+v,!r.helper.isUndefined(g.gUrls[v]))O=g.gUrls[v],r.helper.isUndefined(g.gTitles[v])||(D=g.gTitles[v]);else return C;O=O.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var V='<a href="'+O+'"';return D!==""&&D!==null&&(D=D.replace(/"/g,"""),D=D.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),V+=' title="'+D+'"'),b.openLinksInNewWindow&&!/^#/.test(O)&&(V+=' rel="noopener noreferrer" target="¨E95Eblank"'),V+=">"+T+"</a>",V};return u=u.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,k),u=u.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,k),u=u.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,k),u=u.replace(/\[([^\[\]]+)]()()()()()/g,k),b.ghMentions&&(u=u.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(C,T,v,O,R){if(v==="\\")return T+O;if(!r.helper.isString(b.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var B=b.ghMentionsLink.replace(/\{u}/g,R),D="";return b.openLinksInNewWindow&&(D=' rel="noopener noreferrer" target="¨E95Eblank"'),T+'<a href="'+B+'"'+D+">"+O+"</a>"})),u=g.converter._dispatch("anchors.after",u,b,g),u});var h=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,m=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,y=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,w=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,E=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,_=function(u){return function(b,g,k,C,T,v,O){k=k.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var R=k,B="",D="",V=g||"",S=O||"";return/^www\./i.test(k)&&(k=k.replace(/^www\./i,"http://www.")),u.excludeTrailingPunctuationFromURLs&&v&&(B=v),u.openLinksInNewWindow&&(D=' rel="noopener noreferrer" target="¨E95Eblank"'),V+'<a href="'+k+'"'+D+">"+R+"</a>"+B+S}},x=function(u,b){return function(g,k,C){var T="mailto:";return k=k||"",C=r.subParser("unescapeSpecialChars")(C,u,b),u.encodeEmails?(T=r.helper.encodeEmailAddress(T+C),C=r.helper.encodeEmailAddress(C)):T=T+C,k+'<a href="'+T+'">'+C+"</a>"}};r.subParser("autoLinks",function(u,b,g){return u=g.converter._dispatch("autoLinks.before",u,b,g),u=u.replace(y,_(b)),u=u.replace(E,x(b,g)),u=g.converter._dispatch("autoLinks.after",u,b,g),u}),r.subParser("simplifiedAutoLinks",function(u,b,g){return b.simplifiedAutoLink&&(u=g.converter._dispatch("simplifiedAutoLinks.before",u,b,g),b.excludeTrailingPunctuationFromURLs?u=u.replace(m,_(b)):u=u.replace(h,_(b)),u=u.replace(w,x(b,g)),u=g.converter._dispatch("simplifiedAutoLinks.after",u,b,g)),u}),r.subParser("blockGamut",function(u,b,g){return u=g.converter._dispatch("blockGamut.before",u,b,g),u=r.subParser("blockQuotes")(u,b,g),u=r.subParser("headers")(u,b,g),u=r.subParser("horizontalRule")(u,b,g),u=r.subParser("lists")(u,b,g),u=r.subParser("codeBlocks")(u,b,g),u=r.subParser("tables")(u,b,g),u=r.subParser("hashHTMLBlocks")(u,b,g),u=r.subParser("paragraphs")(u,b,g),u=g.converter._dispatch("blockGamut.after",u,b,g),u}),r.subParser("blockQuotes",function(u,b,g){u=g.converter._dispatch("blockQuotes.before",u,b,g),u=u+`
|
|
114
|
+
|
|
115
|
+
`;var k=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return b.splitAdjacentBlockquotes&&(k=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),u=u.replace(k,function(C){return C=C.replace(/^[ \t]*>[ \t]?/gm,""),C=C.replace(/¨0/g,""),C=C.replace(/^[ \t]+$/gm,""),C=r.subParser("githubCodeBlocks")(C,b,g),C=r.subParser("blockGamut")(C,b,g),C=C.replace(/(^|\n)/g,"$1 "),C=C.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(T,v){var O=v;return O=O.replace(/^ /mg,"¨0"),O=O.replace(/¨0/g,""),O}),r.subParser("hashBlock")(`<blockquote>
|
|
116
|
+
`+C+`
|
|
117
|
+
</blockquote>`,b,g)}),u=g.converter._dispatch("blockQuotes.after",u,b,g),u}),r.subParser("codeBlocks",function(u,b,g){u=g.converter._dispatch("codeBlocks.before",u,b,g),u+="¨0";var k=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return u=u.replace(k,function(C,T,v){var O=T,R=v,B=`
|
|
118
|
+
`;return O=r.subParser("outdent")(O,b,g),O=r.subParser("encodeCode")(O,b,g),O=r.subParser("detab")(O,b,g),O=O.replace(/^\n+/g,""),O=O.replace(/\n+$/g,""),b.omitExtraWLInCodeBlocks&&(B=""),O="<pre><code>"+O+B+"</code></pre>",r.subParser("hashBlock")(O,b,g)+R}),u=u.replace(/¨0/,""),u=g.converter._dispatch("codeBlocks.after",u,b,g),u}),r.subParser("codeSpans",function(u,b,g){return u=g.converter._dispatch("codeSpans.before",u,b,g),typeof u>"u"&&(u=""),u=u.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(k,C,T,v){var O=v;return O=O.replace(/^([ \t]*)/g,""),O=O.replace(/[ \t]*$/g,""),O=r.subParser("encodeCode")(O,b,g),O=C+"<code>"+O+"</code>",O=r.subParser("hashHTMLSpans")(O,b,g),O}),u=g.converter._dispatch("codeSpans.after",u,b,g),u}),r.subParser("completeHTMLDocument",function(u,b,g){if(!b.completeHTMLDocument)return u;u=g.converter._dispatch("completeHTMLDocument.before",u,b,g);var k="html",C=`<!DOCTYPE HTML>
|
|
119
|
+
`,T="",v=`<meta charset="utf-8">
|
|
120
|
+
`,O="",R="";typeof g.metadata.parsed.doctype<"u"&&(C="<!DOCTYPE "+g.metadata.parsed.doctype+`>
|
|
121
|
+
`,k=g.metadata.parsed.doctype.toString().toLowerCase(),(k==="html"||k==="html5")&&(v='<meta charset="utf-8">'));for(var B in g.metadata.parsed)if(g.metadata.parsed.hasOwnProperty(B))switch(B.toLowerCase()){case"doctype":break;case"title":T="<title>"+g.metadata.parsed.title+`</title>
|
|
122
|
+
`;break;case"charset":k==="html"||k==="html5"?v='<meta charset="'+g.metadata.parsed.charset+`">
|
|
123
|
+
`:v='<meta name="charset" content="'+g.metadata.parsed.charset+`">
|
|
124
|
+
`;break;case"language":case"lang":O=' lang="'+g.metadata.parsed[B]+'"',R+='<meta name="'+B+'" content="'+g.metadata.parsed[B]+`">
|
|
125
|
+
`;break;default:R+='<meta name="'+B+'" content="'+g.metadata.parsed[B]+`">
|
|
126
|
+
`}return u=C+"<html"+O+`>
|
|
166
127
|
<head>
|
|
167
|
-
`+
|
|
128
|
+
`+T+v+R+`</head>
|
|
168
129
|
<body>
|
|
169
|
-
`+
|
|
130
|
+
`+u.trim()+`
|
|
170
131
|
</body>
|
|
171
|
-
</html>`,
|
|
172
|
-
`;return
|
|
132
|
+
</html>`,u=g.converter._dispatch("completeHTMLDocument.after",u,b,g),u}),r.subParser("detab",function(u,b,g){return u=g.converter._dispatch("detab.before",u,b,g),u=u.replace(/\t(?=\t)/g," "),u=u.replace(/\t/g,"¨A¨B"),u=u.replace(/¨B(.+?)¨A/g,function(k,C){for(var T=C,v=4-T.length%4,O=0;O<v;O++)T+=" ";return T}),u=u.replace(/¨A/g," "),u=u.replace(/¨B/g,""),u=g.converter._dispatch("detab.after",u,b,g),u}),r.subParser("ellipsis",function(u,b,g){return b.ellipsis&&(u=g.converter._dispatch("ellipsis.before",u,b,g),u=u.replace(/\.\.\./g,"…"),u=g.converter._dispatch("ellipsis.after",u,b,g)),u}),r.subParser("emoji",function(u,b,g){if(!b.emoji)return u;u=g.converter._dispatch("emoji.before",u,b,g);var k=/:([\S]+?):/g;return u=u.replace(k,function(C,T){return r.helper.emojis.hasOwnProperty(T)?r.helper.emojis[T]:C}),u=g.converter._dispatch("emoji.after",u,b,g),u}),r.subParser("encodeAmpsAndAngles",function(u,b,g){return u=g.converter._dispatch("encodeAmpsAndAngles.before",u,b,g),u=u.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),u=u.replace(/<(?![a-z\/?$!])/gi,"<"),u=u.replace(/</g,"<"),u=u.replace(/>/g,">"),u=g.converter._dispatch("encodeAmpsAndAngles.after",u,b,g),u}),r.subParser("encodeBackslashEscapes",function(u,b,g){return u=g.converter._dispatch("encodeBackslashEscapes.before",u,b,g),u=u.replace(/\\(\\)/g,r.helper.escapeCharactersCallback),u=u.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,r.helper.escapeCharactersCallback),u=g.converter._dispatch("encodeBackslashEscapes.after",u,b,g),u}),r.subParser("encodeCode",function(u,b,g){return u=g.converter._dispatch("encodeCode.before",u,b,g),u=u.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,r.helper.escapeCharactersCallback),u=g.converter._dispatch("encodeCode.after",u,b,g),u}),r.subParser("escapeSpecialCharsWithinTagAttributes",function(u,b,g){u=g.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",u,b,g);var k=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,C=/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return u=u.replace(k,function(T){return T.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),u=u.replace(C,function(T){return T.replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),u=g.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",u,b,g),u}),r.subParser("githubCodeBlocks",function(u,b,g){return b.ghCodeBlocks?(u=g.converter._dispatch("githubCodeBlocks.before",u,b,g),u+="¨0",u=u.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(k,C,T,v){var O=b.omitExtraWLInCodeBlocks?"":`
|
|
133
|
+
`;return v=r.subParser("encodeCode")(v,b,g),v=r.subParser("detab")(v,b,g),v=v.replace(/^\n+/g,""),v=v.replace(/\n+$/g,""),v="<pre><code"+(T?' class="'+T+" language-"+T+'"':"")+">"+v+O+"</code></pre>",v=r.subParser("hashBlock")(v,b,g),`
|
|
173
134
|
|
|
174
|
-
¨G`+(
|
|
135
|
+
¨G`+(g.ghCodeBlocks.push({text:k,codeblock:v})-1)+`G
|
|
175
136
|
|
|
176
|
-
`}),
|
|
137
|
+
`}),u=u.replace(/¨0/,""),g.converter._dispatch("githubCodeBlocks.after",u,b,g)):u}),r.subParser("hashBlock",function(u,b,g){return u=g.converter._dispatch("hashBlock.before",u,b,g),u=u.replace(/(^\n+|\n+$)/g,""),u=`
|
|
177
138
|
|
|
178
|
-
¨K`+(
|
|
139
|
+
¨K`+(g.gHtmlBlocks.push(u)-1)+`K
|
|
179
140
|
|
|
180
|
-
`,
|
|
181
|
-
`),
|
|
141
|
+
`,u=g.converter._dispatch("hashBlock.after",u,b,g),u}),r.subParser("hashCodeTags",function(u,b,g){u=g.converter._dispatch("hashCodeTags.before",u,b,g);var k=function(C,T,v,O){var R=v+r.subParser("encodeCode")(T,b,g)+O;return"¨C"+(g.gHtmlSpans.push(R)-1)+"C"};return u=r.helper.replaceRecursiveRegExp(u,k,"<code\\b[^>]*>","</code>","gim"),u=g.converter._dispatch("hashCodeTags.after",u,b,g),u}),r.subParser("hashElement",function(u,b,g){return function(k,C){var T=C;return T=T.replace(/\n\n/g,`
|
|
142
|
+
`),T=T.replace(/^\n/,""),T=T.replace(/\n+$/g,""),T=`
|
|
182
143
|
|
|
183
|
-
¨K`+(
|
|
144
|
+
¨K`+(g.gHtmlBlocks.push(T)-1)+`K
|
|
184
145
|
|
|
185
|
-
`,
|
|
146
|
+
`,T}}),r.subParser("hashHTMLBlocks",function(u,b,g){u=g.converter._dispatch("hashHTMLBlocks.before",u,b,g);var k=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],C=function(S,P,U,K){var Z=S;return U.search(/\bmarkdown\b/)!==-1&&(Z=U+g.converter.makeHtml(P)+K),`
|
|
186
147
|
|
|
187
|
-
¨K`+(
|
|
148
|
+
¨K`+(g.gHtmlBlocks.push(Z)-1)+`K
|
|
188
149
|
|
|
189
|
-
`};
|
|
150
|
+
`};b.backslashEscapesHTMLTags&&(u=u.replace(/\\<(\/?[^>]+?)>/g,function(S,P){return"<"+P+">"}));for(var T=0;T<k.length;++T)for(var v,O=new RegExp("^ {0,3}(<"+k[T]+"\\b[^>]*>)","im"),R="<"+k[T]+"\\b[^>]*>",B="</"+k[T]+">";(v=r.helper.regexIndexOf(u,O))!==-1;){var D=r.helper.splitAtIndex(u,v),V=r.helper.replaceRecursiveRegExp(D[1],C,R,B,"im");if(V===D[1])break;u=D[0].concat(V)}return u=u.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(u,b,g)),u=r.helper.replaceRecursiveRegExp(u,function(S){return`
|
|
190
151
|
|
|
191
|
-
¨K`+(
|
|
152
|
+
¨K`+(g.gHtmlBlocks.push(S)-1)+`K
|
|
192
153
|
|
|
193
|
-
`},"^ {0,3}<!--","-->","gm"),
|
|
154
|
+
`},"^ {0,3}<!--","-->","gm"),u=u.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(u,b,g)),u=g.converter._dispatch("hashHTMLBlocks.after",u,b,g),u}),r.subParser("hashHTMLSpans",function(u,b,g){u=g.converter._dispatch("hashHTMLSpans.before",u,b,g);function k(C){return"¨C"+(g.gHtmlSpans.push(C)-1)+"C"}return u=u.replace(/<[^>]+?\/>/gi,function(C){return k(C)}),u=u.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(C){return k(C)}),u=u.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(C){return k(C)}),u=u.replace(/<[^>]+?>/gi,function(C){return k(C)}),u=g.converter._dispatch("hashHTMLSpans.after",u,b,g),u}),r.subParser("unhashHTMLSpans",function(u,b,g){u=g.converter._dispatch("unhashHTMLSpans.before",u,b,g);for(var k=0;k<g.gHtmlSpans.length;++k){for(var C=g.gHtmlSpans[k],T=0;/¨C(\d+)C/.test(C);){var v=RegExp.$1;if(C=C.replace("¨C"+v+"C",g.gHtmlSpans[v]),T===10){console.error("maximum nesting of 10 spans reached!!!");break}++T}u=u.replace("¨C"+k+"C",C)}return u=g.converter._dispatch("unhashHTMLSpans.after",u,b,g),u}),r.subParser("hashPreCodeTags",function(u,b,g){u=g.converter._dispatch("hashPreCodeTags.before",u,b,g);var k=function(C,T,v,O){var R=v+r.subParser("encodeCode")(T,b,g)+O;return`
|
|
194
155
|
|
|
195
|
-
¨G`+(
|
|
156
|
+
¨G`+(g.ghCodeBlocks.push({text:C,codeblock:R})-1)+`G
|
|
196
157
|
|
|
197
|
-
`};return
|
|
198
|
-
`),
|
|
158
|
+
`};return u=r.helper.replaceRecursiveRegExp(u,k,"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),u=g.converter._dispatch("hashPreCodeTags.after",u,b,g),u}),r.subParser("headers",function(u,b,g){u=g.converter._dispatch("headers.before",u,b,g);var k=isNaN(parseInt(b.headerLevelStart))?1:parseInt(b.headerLevelStart),C=b.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,T=b.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;u=u.replace(C,function(R,B){var D=r.subParser("spanGamut")(B,b,g),V=b.noHeaderId?"":' id="'+O(B)+'"',S=k,P="<h"+S+V+">"+D+"</h"+S+">";return r.subParser("hashBlock")(P,b,g)}),u=u.replace(T,function(R,B){var D=r.subParser("spanGamut")(B,b,g),V=b.noHeaderId?"":' id="'+O(B)+'"',S=k+1,P="<h"+S+V+">"+D+"</h"+S+">";return r.subParser("hashBlock")(P,b,g)});var v=b.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;u=u.replace(v,function(R,B,D){var V=D;b.customizedHeaderId&&(V=D.replace(/\s?\{([^{]+?)}\s*$/,""));var S=r.subParser("spanGamut")(V,b,g),P=b.noHeaderId?"":' id="'+O(D)+'"',U=k-1+B.length,K="<h"+U+P+">"+S+"</h"+U+">";return r.subParser("hashBlock")(K,b,g)});function O(R){var B,D;if(b.customizedHeaderId){var V=R.match(/\{([^{]+?)}\s*$/);V&&V[1]&&(R=V[1])}return B=R,r.helper.isString(b.prefixHeaderId)?D=b.prefixHeaderId:b.prefixHeaderId===!0?D="section-":D="",b.rawPrefixHeaderId||(B=D+B),b.ghCompatibleHeaderId?B=B.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():b.rawHeaderId?B=B.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():B=B.replace(/[^\w]/g,"").toLowerCase(),b.rawPrefixHeaderId&&(B=D+B),g.hashLinkCounts[B]?B=B+"-"+g.hashLinkCounts[B]++:g.hashLinkCounts[B]=1,B}return u=g.converter._dispatch("headers.after",u,b,g),u}),r.subParser("horizontalRule",function(u,b,g){u=g.converter._dispatch("horizontalRule.before",u,b,g);var k=r.subParser("hashBlock")("<hr />",b,g);return u=u.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,k),u=u.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,k),u=u.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,k),u=g.converter._dispatch("horizontalRule.after",u,b,g),u}),r.subParser("images",function(u,b,g){u=g.converter._dispatch("images.before",u,b,g);var k=/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,C=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,T=/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,v=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,O=/!\[([^\[\]]+)]()()()()()/g;function R(D,V,S,P,U,K,Z,G){return P=P.replace(/\s/g,""),B(D,V,S,P,U,K,Z,G)}function B(D,V,S,P,U,K,Z,G){var Oe=g.gUrls,Fe=g.gTitles,et=g.gDimensions;if(S=S.toLowerCase(),G||(G=""),D.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)P="";else if(P===""||P===null)if((S===""||S===null)&&(S=V.toLowerCase().replace(/ ?\n/g," ")),P="#"+S,!r.helper.isUndefined(Oe[S]))P=Oe[S],r.helper.isUndefined(Fe[S])||(G=Fe[S]),r.helper.isUndefined(et[S])||(U=et[S].width,K=et[S].height);else return D;V=V.replace(/"/g,""").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),P=P.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var Se='<img src="'+P+'" alt="'+V+'"';return G&&r.helper.isString(G)&&(G=G.replace(/"/g,""").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),Se+=' title="'+G+'"'),U&&K&&(U=U==="*"?"auto":U,K=K==="*"?"auto":K,Se+=' width="'+U+'"',Se+=' height="'+K+'"'),Se+=" />",Se}return u=u.replace(v,B),u=u.replace(T,R),u=u.replace(C,B),u=u.replace(k,B),u=u.replace(O,B),u=g.converter._dispatch("images.after",u,b,g),u}),r.subParser("italicsAndBold",function(u,b,g){u=g.converter._dispatch("italicsAndBold.before",u,b,g);function k(C,T,v){return T+C+v}return b.literalMidWordUnderscores?(u=u.replace(/\b___(\S[\s\S]*?)___\b/g,function(C,T){return k(T,"<strong><em>","</em></strong>")}),u=u.replace(/\b__(\S[\s\S]*?)__\b/g,function(C,T){return k(T,"<strong>","</strong>")}),u=u.replace(/\b_(\S[\s\S]*?)_\b/g,function(C,T){return k(T,"<em>","</em>")})):(u=u.replace(/___(\S[\s\S]*?)___/g,function(C,T){return/\S$/.test(T)?k(T,"<strong><em>","</em></strong>"):C}),u=u.replace(/__(\S[\s\S]*?)__/g,function(C,T){return/\S$/.test(T)?k(T,"<strong>","</strong>"):C}),u=u.replace(/_([^\s_][\s\S]*?)_/g,function(C,T){return/\S$/.test(T)?k(T,"<em>","</em>"):C})),b.literalMidWordAsterisks?(u=u.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(C,T,v){return k(v,T+"<strong><em>","</em></strong>")}),u=u.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(C,T,v){return k(v,T+"<strong>","</strong>")}),u=u.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(C,T,v){return k(v,T+"<em>","</em>")})):(u=u.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(C,T){return/\S$/.test(T)?k(T,"<strong><em>","</em></strong>"):C}),u=u.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(C,T){return/\S$/.test(T)?k(T,"<strong>","</strong>"):C}),u=u.replace(/\*([^\s*][\s\S]*?)\*/g,function(C,T){return/\S$/.test(T)?k(T,"<em>","</em>"):C})),u=g.converter._dispatch("italicsAndBold.after",u,b,g),u}),r.subParser("lists",function(u,b,g){function k(v,O){g.gListLevel++,v=v.replace(/\n{2,}$/,`
|
|
159
|
+
`),v+="¨0";var R=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,B=/\n[ \t]*\n(?!¨0)/.test(v);return b.disableForced4SpacesIndentedSublists&&(R=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),v=v.replace(R,function(D,V,S,P,U,K,Z){Z=Z&&Z.trim()!=="";var G=r.subParser("outdent")(U,b,g),Oe="";return K&&b.tasklists&&(Oe=' class="task-list-item" style="list-style-type: none;"',G=G.replace(/^[ \t]*\[(x|X| )?]/m,function(){var Fe='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return Z&&(Fe+=" checked"),Fe+=">",Fe})),G=G.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(Fe){return"¨A"+Fe}),V||G.search(/\n{2,}/)>-1?(G=r.subParser("githubCodeBlocks")(G,b,g),G=r.subParser("blockGamut")(G,b,g)):(G=r.subParser("lists")(G,b,g),G=G.replace(/\n$/,""),G=r.subParser("hashHTMLBlocks")(G,b,g),G=G.replace(/\n\n+/g,`
|
|
199
160
|
|
|
200
|
-
`),
|
|
201
|
-
`,G}),
|
|
161
|
+
`),B?G=r.subParser("paragraphs")(G,b,g):G=r.subParser("spanGamut")(G,b,g)),G=G.replace("¨A",""),G="<li"+Oe+">"+G+`</li>
|
|
162
|
+
`,G}),v=v.replace(/¨0/g,""),g.gListLevel--,O&&(v=v.replace(/\s+$/,"")),v}function C(v,O){if(O==="ol"){var R=v.match(/^ *(\d+)\./);if(R&&R[1]!=="1")return' start="'+R[1]+'"'}return""}function T(v,O,R){var B=b.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,D=b.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,V=O==="ul"?B:D,S="";if(v.search(V)!==-1)(function U(K){var Z=K.search(V),G=C(v,O);Z!==-1?(S+=`
|
|
202
163
|
|
|
203
|
-
<`+
|
|
204
|
-
`+
|
|
205
|
-
`,
|
|
164
|
+
<`+O+G+`>
|
|
165
|
+
`+k(K.slice(0,Z),!!R)+"</"+O+`>
|
|
166
|
+
`,O=O==="ul"?"ol":"ul",V=O==="ul"?B:D,U(K.slice(Z))):S+=`
|
|
206
167
|
|
|
207
|
-
<`+
|
|
208
|
-
`+
|
|
209
|
-
`})(
|
|
168
|
+
<`+O+G+`>
|
|
169
|
+
`+k(K,!!R)+"</"+O+`>
|
|
170
|
+
`})(v);else{var P=C(v,O);S=`
|
|
210
171
|
|
|
211
|
-
<`+
|
|
212
|
-
`+
|
|
213
|
-
`}return
|
|
214
|
-
`),
|
|
215
|
-
`)):
|
|
216
|
-
`),
|
|
217
|
-
`}function
|
|
218
|
-
`}function
|
|
172
|
+
<`+O+P+`>
|
|
173
|
+
`+k(v,!!R)+"</"+O+`>
|
|
174
|
+
`}return S}return u=g.converter._dispatch("lists.before",u,b,g),u+="¨0",g.gListLevel?u=u.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(v,O,R){var B=R.search(/[*+-]/g)>-1?"ul":"ol";return T(O,B,!0)}):u=u.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(v,O,R,B){var D=B.search(/[*+-]/g)>-1?"ul":"ol";return T(R,D,!1)}),u=u.replace(/¨0/,""),u=g.converter._dispatch("lists.after",u,b,g),u}),r.subParser("metadata",function(u,b,g){if(!b.metadata)return u;u=g.converter._dispatch("metadata.before",u,b,g);function k(C){g.metadata.raw=C,C=C.replace(/&/g,"&").replace(/"/g,"""),C=C.replace(/\n {4}/g," "),C.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(T,v,O){return g.metadata.parsed[v]=O,""})}return u=u.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(C,T,v){return k(v),"¨M"}),u=u.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(C,T,v){return T&&(g.metadata.format=T),k(v),"¨M"}),u=u.replace(/¨M/g,""),u=g.converter._dispatch("metadata.after",u,b,g),u}),r.subParser("outdent",function(u,b,g){return u=g.converter._dispatch("outdent.before",u,b,g),u=u.replace(/^(\t|[ ]{1,4})/gm,"¨0"),u=u.replace(/¨0/g,""),u=g.converter._dispatch("outdent.after",u,b,g),u}),r.subParser("paragraphs",function(u,b,g){u=g.converter._dispatch("paragraphs.before",u,b,g),u=u.replace(/^\n+/g,""),u=u.replace(/\n+$/g,"");for(var k=u.split(/\n{2,}/g),C=[],T=k.length,v=0;v<T;v++){var O=k[v];O.search(/¨(K|G)(\d+)\1/g)>=0?C.push(O):O.search(/\S/)>=0&&(O=r.subParser("spanGamut")(O,b,g),O=O.replace(/^([ \t]*)/g,"<p>"),O+="</p>",C.push(O))}for(T=C.length,v=0;v<T;v++){for(var R="",B=C[v],D=!1;/¨(K|G)(\d+)\1/.test(B);){var V=RegExp.$1,S=RegExp.$2;V==="K"?R=g.gHtmlBlocks[S]:D?R=r.subParser("encodeCode")(g.ghCodeBlocks[S].text,b,g):R=g.ghCodeBlocks[S].codeblock,R=R.replace(/\$/g,"$$$$"),B=B.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,R),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(B)&&(D=!0)}C[v]=B}return u=C.join(`
|
|
175
|
+
`),u=u.replace(/^\n+/g,""),u=u.replace(/\n+$/g,""),g.converter._dispatch("paragraphs.after",u,b,g)}),r.subParser("runExtension",function(u,b,g,k){if(u.filter)b=u.filter(b,k.converter,g);else if(u.regex){var C=u.regex;C instanceof RegExp||(C=new RegExp(C,"g")),b=b.replace(C,u.replace)}return b}),r.subParser("spanGamut",function(u,b,g){return u=g.converter._dispatch("spanGamut.before",u,b,g),u=r.subParser("codeSpans")(u,b,g),u=r.subParser("escapeSpecialCharsWithinTagAttributes")(u,b,g),u=r.subParser("encodeBackslashEscapes")(u,b,g),u=r.subParser("images")(u,b,g),u=r.subParser("anchors")(u,b,g),u=r.subParser("autoLinks")(u,b,g),u=r.subParser("simplifiedAutoLinks")(u,b,g),u=r.subParser("emoji")(u,b,g),u=r.subParser("underline")(u,b,g),u=r.subParser("italicsAndBold")(u,b,g),u=r.subParser("strikethrough")(u,b,g),u=r.subParser("ellipsis")(u,b,g),u=r.subParser("hashHTMLSpans")(u,b,g),u=r.subParser("encodeAmpsAndAngles")(u,b,g),b.simpleLineBreaks?/\n\n¨K/.test(u)||(u=u.replace(/\n+/g,`<br />
|
|
176
|
+
`)):u=u.replace(/ +\n/g,`<br />
|
|
177
|
+
`),u=g.converter._dispatch("spanGamut.after",u,b,g),u}),r.subParser("strikethrough",function(u,b,g){function k(C){return b.simplifiedAutoLink&&(C=r.subParser("simplifiedAutoLinks")(C,b,g)),"<del>"+C+"</del>"}return b.strikethrough&&(u=g.converter._dispatch("strikethrough.before",u,b,g),u=u.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(C,T){return k(T)}),u=g.converter._dispatch("strikethrough.after",u,b,g)),u}),r.subParser("stripLinkDefinitions",function(u,b,g){var k=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,C=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;u+="¨0";var T=function(v,O,R,B,D,V,S){return O=O.toLowerCase(),u.toLowerCase().split(O).length-1<2?v:(R.match(/^data:.+?\/.+?;base64,/)?g.gUrls[O]=R.replace(/\s/g,""):g.gUrls[O]=r.subParser("encodeAmpsAndAngles")(R,b,g),V?V+S:(S&&(g.gTitles[O]=S.replace(/"|'/g,""")),b.parseImgDimensions&&B&&D&&(g.gDimensions[O]={width:B,height:D}),""))};return u=u.replace(C,T),u=u.replace(k,T),u=u.replace(/¨0/,""),u}),r.subParser("tables",function(u,b,g){if(!b.tables)return u;var k=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,C=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function T(D){return/^:[ \t]*--*$/.test(D)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(D)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(D)?' style="text-align:center;"':""}function v(D,V){var S="";return D=D.trim(),(b.tablesHeaderId||b.tableHeaderId)&&(S=' id="'+D.replace(/ /g,"_").toLowerCase()+'"'),D=r.subParser("spanGamut")(D,b,g),"<th"+S+V+">"+D+`</th>
|
|
178
|
+
`}function O(D,V){var S=r.subParser("spanGamut")(D,b,g);return"<td"+V+">"+S+`</td>
|
|
179
|
+
`}function R(D,V){for(var S=`<table>
|
|
219
180
|
<thead>
|
|
220
181
|
<tr>
|
|
221
|
-
`,
|
|
182
|
+
`,P=D.length,U=0;U<P;++U)S+=D[U];for(S+=`</tr>
|
|
222
183
|
</thead>
|
|
223
184
|
<tbody>
|
|
224
|
-
`,U=0;U
|
|
225
|
-
`;for(var
|
|
226
|
-
`}return
|
|
185
|
+
`,U=0;U<V.length;++U){S+=`<tr>
|
|
186
|
+
`;for(var K=0;K<P;++K)S+=V[U][K];S+=`</tr>
|
|
187
|
+
`}return S+=`</tbody>
|
|
227
188
|
</table>
|
|
228
|
-
`,
|
|
229
|
-
`);for(
|
|
189
|
+
`,S}function B(D){var V,S=D.split(`
|
|
190
|
+
`);for(V=0;V<S.length;++V)/^ {0,3}\|/.test(S[V])&&(S[V]=S[V].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(S[V])&&(S[V]=S[V].replace(/\|[ \t]*$/,"")),S[V]=r.subParser("codeSpans")(S[V],b,g);var P=S[0].split("|").map(function(Se){return Se.trim()}),U=S[1].split("|").map(function(Se){return Se.trim()}),K=[],Z=[],G=[],Oe=[];for(S.shift(),S.shift(),V=0;V<S.length;++V)S[V].trim()!==""&&K.push(S[V].split("|").map(function(Se){return Se.trim()}));if(P.length<U.length)return D;for(V=0;V<U.length;++V)G.push(T(U[V]));for(V=0;V<P.length;++V)r.helper.isUndefined(G[V])&&(G[V]=""),Z.push(v(P[V],G[V]));for(V=0;V<K.length;++V){for(var Fe=[],et=0;et<Z.length;++et)r.helper.isUndefined(K[V][et]),Fe.push(O(K[V][et],G[et]));Oe.push(Fe)}return R(Z,Oe)}return u=g.converter._dispatch("tables.before",u,b,g),u=u.replace(/\\(\|)/g,r.helper.escapeCharactersCallback),u=u.replace(k,B),u=u.replace(C,B),u=g.converter._dispatch("tables.after",u,b,g),u}),r.subParser("underline",function(u,b,g){return b.underline&&(u=g.converter._dispatch("underline.before",u,b,g),b.literalMidWordUnderscores?(u=u.replace(/\b___(\S[\s\S]*?)___\b/g,function(k,C){return"<u>"+C+"</u>"}),u=u.replace(/\b__(\S[\s\S]*?)__\b/g,function(k,C){return"<u>"+C+"</u>"})):(u=u.replace(/___(\S[\s\S]*?)___/g,function(k,C){return/\S$/.test(C)?"<u>"+C+"</u>":k}),u=u.replace(/__(\S[\s\S]*?)__/g,function(k,C){return/\S$/.test(C)?"<u>"+C+"</u>":k})),u=u.replace(/(_)/g,r.helper.escapeCharactersCallback),u=g.converter._dispatch("underline.after",u,b,g)),u}),r.subParser("unescapeSpecialChars",function(u,b,g){return u=g.converter._dispatch("unescapeSpecialChars.before",u,b,g),u=u.replace(/¨E(\d+)E/g,function(k,C){var T=parseInt(C);return String.fromCharCode(T)}),u=g.converter._dispatch("unescapeSpecialChars.after",u,b,g),u}),r.subParser("makeMarkdown.blockquote",function(u,b){var g="";if(u.hasChildNodes())for(var k=u.childNodes,C=k.length,T=0;T<C;++T){var v=r.subParser("makeMarkdown.node")(k[T],b);v!==""&&(g+=v)}return g=g.trim(),g="> "+g.split(`
|
|
230
191
|
`).join(`
|
|
231
|
-
> `),
|
|
232
|
-
`+
|
|
192
|
+
> `),g}),r.subParser("makeMarkdown.codeBlock",function(u,b){var g=u.getAttribute("language"),k=u.getAttribute("precodenum");return"```"+g+`
|
|
193
|
+
`+b.preList[k]+"\n```"}),r.subParser("makeMarkdown.codeSpan",function(u){return"`"+u.innerHTML+"`"}),r.subParser("makeMarkdown.emphasis",function(u,b){var g="";if(u.hasChildNodes()){g+="*";for(var k=u.childNodes,C=k.length,T=0;T<C;++T)g+=r.subParser("makeMarkdown.node")(k[T],b);g+="*"}return g}),r.subParser("makeMarkdown.header",function(u,b,g){var k=new Array(g+1).join("#"),C="";if(u.hasChildNodes()){C=k+" ";for(var T=u.childNodes,v=T.length,O=0;O<v;++O)C+=r.subParser("makeMarkdown.node")(T[O],b)}return C}),r.subParser("makeMarkdown.hr",function(){return"---"}),r.subParser("makeMarkdown.image",function(u){var b="";return u.hasAttribute("src")&&(b+="+">",u.hasAttribute("width")&&u.hasAttribute("height")&&(b+=" ="+u.getAttribute("width")+"x"+u.getAttribute("height")),u.hasAttribute("title")&&(b+=' "'+u.getAttribute("title")+'"'),b+=")"),b}),r.subParser("makeMarkdown.links",function(u,b){var g="";if(u.hasChildNodes()&&u.hasAttribute("href")){var k=u.childNodes,C=k.length;g="[";for(var T=0;T<C;++T)g+=r.subParser("makeMarkdown.node")(k[T],b);g+="](",g+="<"+u.getAttribute("href")+">",u.hasAttribute("title")&&(g+=' "'+u.getAttribute("title")+'"'),g+=")"}return g}),r.subParser("makeMarkdown.list",function(u,b,g){var k="";if(!u.hasChildNodes())return"";for(var C=u.childNodes,T=C.length,v=u.getAttribute("start")||1,O=0;O<T;++O)if(!(typeof C[O].tagName>"u"||C[O].tagName.toLowerCase()!=="li")){var R="";g==="ol"?R=v.toString()+". ":R="- ",k+=R+r.subParser("makeMarkdown.listItem")(C[O],b),++v}return k+=`
|
|
233
194
|
<!-- -->
|
|
234
|
-
`,
|
|
195
|
+
`,k.trim()}),r.subParser("makeMarkdown.listItem",function(u,b){for(var g="",k=u.childNodes,C=k.length,T=0;T<C;++T)g+=r.subParser("makeMarkdown.node")(k[T],b);return/\n$/.test(g)?g=g.split(`
|
|
235
196
|
`).join(`
|
|
236
197
|
`).replace(/^ {4}$/gm,"").replace(/\n\n+/g,`
|
|
237
198
|
|
|
238
|
-
`):
|
|
239
|
-
`,
|
|
199
|
+
`):g+=`
|
|
200
|
+
`,g}),r.subParser("makeMarkdown.node",function(u,b,g){g=g||!1;var k="";if(u.nodeType===3)return r.subParser("makeMarkdown.txt")(u,b);if(u.nodeType===8)return"<!--"+u.data+`-->
|
|
240
201
|
|
|
241
|
-
`;if(
|
|
202
|
+
`;if(u.nodeType!==1)return"";var C=u.tagName.toLowerCase();switch(C){case"h1":g||(k=r.subParser("makeMarkdown.header")(u,b,1)+`
|
|
242
203
|
|
|
243
|
-
`);break;case"h2":
|
|
204
|
+
`);break;case"h2":g||(k=r.subParser("makeMarkdown.header")(u,b,2)+`
|
|
244
205
|
|
|
245
|
-
`);break;case"h3":
|
|
206
|
+
`);break;case"h3":g||(k=r.subParser("makeMarkdown.header")(u,b,3)+`
|
|
246
207
|
|
|
247
|
-
`);break;case"h4":
|
|
208
|
+
`);break;case"h4":g||(k=r.subParser("makeMarkdown.header")(u,b,4)+`
|
|
248
209
|
|
|
249
|
-
`);break;case"h5":
|
|
210
|
+
`);break;case"h5":g||(k=r.subParser("makeMarkdown.header")(u,b,5)+`
|
|
250
211
|
|
|
251
|
-
`);break;case"h6":
|
|
212
|
+
`);break;case"h6":g||(k=r.subParser("makeMarkdown.header")(u,b,6)+`
|
|
252
213
|
|
|
253
|
-
`);break;case"p":
|
|
214
|
+
`);break;case"p":g||(k=r.subParser("makeMarkdown.paragraph")(u,b)+`
|
|
254
215
|
|
|
255
|
-
`);break;case"blockquote":
|
|
216
|
+
`);break;case"blockquote":g||(k=r.subParser("makeMarkdown.blockquote")(u,b)+`
|
|
256
217
|
|
|
257
|
-
`);break;case"hr":
|
|
218
|
+
`);break;case"hr":g||(k=r.subParser("makeMarkdown.hr")(u,b)+`
|
|
258
219
|
|
|
259
|
-
`);break;case"ol":
|
|
220
|
+
`);break;case"ol":g||(k=r.subParser("makeMarkdown.list")(u,b,"ol")+`
|
|
260
221
|
|
|
261
|
-
`);break;case"ul":
|
|
222
|
+
`);break;case"ul":g||(k=r.subParser("makeMarkdown.list")(u,b,"ul")+`
|
|
262
223
|
|
|
263
|
-
`);break;case"precode":
|
|
224
|
+
`);break;case"precode":g||(k=r.subParser("makeMarkdown.codeBlock")(u,b)+`
|
|
264
225
|
|
|
265
|
-
`);break;case"pre":
|
|
226
|
+
`);break;case"pre":g||(k=r.subParser("makeMarkdown.pre")(u,b)+`
|
|
266
227
|
|
|
267
|
-
`);break;case"table":
|
|
228
|
+
`);break;case"table":g||(k=r.subParser("makeMarkdown.table")(u,b)+`
|
|
268
229
|
|
|
269
|
-
`);break;case"code":
|
|
230
|
+
`);break;case"code":k=r.subParser("makeMarkdown.codeSpan")(u,b);break;case"em":case"i":k=r.subParser("makeMarkdown.emphasis")(u,b);break;case"strong":case"b":k=r.subParser("makeMarkdown.strong")(u,b);break;case"del":k=r.subParser("makeMarkdown.strikethrough")(u,b);break;case"a":k=r.subParser("makeMarkdown.links")(u,b);break;case"img":k=r.subParser("makeMarkdown.image")(u,b);break;default:k=u.outerHTML+`
|
|
270
231
|
|
|
271
|
-
`}return
|
|
272
|
-
`}return
|
|
273
|
-
`;)e--;return t.substring(0,e)}var
|
|
232
|
+
`}return k}),r.subParser("makeMarkdown.paragraph",function(u,b){var g="";if(u.hasChildNodes())for(var k=u.childNodes,C=k.length,T=0;T<C;++T)g+=r.subParser("makeMarkdown.node")(k[T],b);return g=g.trim(),g}),r.subParser("makeMarkdown.pre",function(u,b){var g=u.getAttribute("prenum");return"<pre>"+b.preList[g]+"</pre>"}),r.subParser("makeMarkdown.strikethrough",function(u,b){var g="";if(u.hasChildNodes()){g+="~~";for(var k=u.childNodes,C=k.length,T=0;T<C;++T)g+=r.subParser("makeMarkdown.node")(k[T],b);g+="~~"}return g}),r.subParser("makeMarkdown.strong",function(u,b){var g="";if(u.hasChildNodes()){g+="**";for(var k=u.childNodes,C=k.length,T=0;T<C;++T)g+=r.subParser("makeMarkdown.node")(k[T],b);g+="**"}return g}),r.subParser("makeMarkdown.table",function(u,b){var g="",k=[[],[]],C=u.querySelectorAll("thead>tr>th"),T=u.querySelectorAll("tbody>tr"),v,O;for(v=0;v<C.length;++v){var R=r.subParser("makeMarkdown.tableCell")(C[v],b),B="---";if(C[v].hasAttribute("style")){var D=C[v].getAttribute("style").toLowerCase().replace(/\s/g,"");switch(D){case"text-align:left;":B=":---";break;case"text-align:right;":B="---:";break;case"text-align:center;":B=":---:";break}}k[0][v]=R.trim(),k[1][v]=B}for(v=0;v<T.length;++v){var V=k.push([])-1,S=T[v].getElementsByTagName("td");for(O=0;O<C.length;++O){var P=" ";typeof S[O]<"u"&&(P=r.subParser("makeMarkdown.tableCell")(S[O],b)),k[V].push(P)}}var U=3;for(v=0;v<k.length;++v)for(O=0;O<k[v].length;++O){var K=k[v][O].length;K>U&&(U=K)}for(v=0;v<k.length;++v){for(O=0;O<k[v].length;++O)v===1?k[v][O].slice(-1)===":"?k[v][O]=r.helper.padEnd(k[v][O].slice(-1),U-1,"-")+":":k[v][O]=r.helper.padEnd(k[v][O],U,"-"):k[v][O]=r.helper.padEnd(k[v][O],U);g+="| "+k[v].join(" | ")+` |
|
|
233
|
+
`}return g.trim()}),r.subParser("makeMarkdown.tableCell",function(u,b){var g="";if(!u.hasChildNodes())return"";for(var k=u.childNodes,C=k.length,T=0;T<C;++T)g+=r.subParser("makeMarkdown.node")(k[T],b,!0);return g.trim()}),r.subParser("makeMarkdown.txt",function(u){var b=u.nodeValue;return b=b.replace(/ +/g," "),b=b.replace(/¨NBSP;/g," "),b=r.helper.unescapeHTMLEntities(b),b=b.replace(/([*_~|`])/g,"\\$1"),b=b.replace(/^(\s*)>/g,"\\$1>"),b=b.replace(/^#/gm,"\\#"),b=b.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),b=b.replace(/^( {0,3}\d+)\./gm,"$1\\."),b=b.replace(/^( {0,3})([+-])/gm,"$1\\$2"),b=b.replace(/]([\s]*)\(/g,"\\]$1\\("),b=b.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),b});var A=this;t.exports?t.exports=r:A.showdown=r}).call(WE)})(Is)),Is.exports}var GE=KE();const qE=UE(GE);function JE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t}function za(t,e){return Array(e+1).join(t)}function YE(t){return t.replace(/^\n*/,"")}function XE(t){for(var e=t.length;e>0&&t[e-1]===`
|
|
234
|
+
`;)e--;return t.substring(0,e)}var QE=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Ha(t){return ja(t,QE)}var ch=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function dh(t){return ja(t,ch)}function ZE(t){return fh(t,ch)}var uh=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function eC(t){return ja(t,uh)}function tC(t){return fh(t,uh)}function ja(t,e){return e.indexOf(t.nodeName)>=0}function fh(t,e){return t.getElementsByTagName&&e.some(function(n){return t.getElementsByTagName(n).length})}var qe={};qe.paragraph={filter:"p",replacement:function(t){return`
|
|
274
235
|
|
|
275
236
|
`+t+`
|
|
276
237
|
|
|
277
|
-
`}},
|
|
278
|
-
`}},
|
|
238
|
+
`}},qe.lineBreak={filter:"br",replacement:function(t,e,n){return n.br+`
|
|
239
|
+
`}},qe.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(t,e,n){var r=Number(e.nodeName.charAt(1));if(n.headingStyle==="setext"&&r<3){var o=za(r===1?"=":"-",t.length);return`
|
|
279
240
|
|
|
280
241
|
`+t+`
|
|
281
242
|
`+o+`
|
|
282
243
|
|
|
283
244
|
`}else return`
|
|
284
245
|
|
|
285
|
-
`+
|
|
246
|
+
`+za("#",r)+" "+t+`
|
|
286
247
|
|
|
287
|
-
`}},
|
|
248
|
+
`}},qe.blockquote={filter:"blockquote",replacement:function(t){return t=t.replace(/^\n+|\n+$/g,""),t=t.replace(/^/gm,"> "),`
|
|
288
249
|
|
|
289
250
|
`+t+`
|
|
290
251
|
|
|
291
|
-
`}},
|
|
252
|
+
`}},qe.list={filter:["ul","ol"],replacement:function(t,e){var n=e.parentNode;return n.nodeName==="LI"&&n.lastElementChild===e?`
|
|
292
253
|
`+t:`
|
|
293
254
|
|
|
294
255
|
`+t+`
|
|
295
256
|
|
|
296
|
-
`}},
|
|
257
|
+
`}},qe.listItem={filter:"li",replacement:function(t,e,n){var r=n.bulletListMarker+" ",o=e.parentNode;if(o.nodeName==="OL"){var s=o.getAttribute("start"),i=Array.prototype.indexOf.call(o.children,e);r=(s?Number(s)+i:i+1)+". "}return t=t.replace(/^\n+/,"").replace(/\n+$/,`
|
|
297
258
|
`).replace(/\n/gm,`
|
|
298
|
-
|
|
299
|
-
`:"")}},
|
|
259
|
+
`+" ".repeat(r.length)),r+t+(e.nextSibling&&!/\n$/.test(t)?`
|
|
260
|
+
`:"")}},qe.indentedCodeBlock={filter:function(t,e){return e.codeBlockStyle==="indented"&&t.nodeName==="PRE"&&t.firstChild&&t.firstChild.nodeName==="CODE"},replacement:function(t,e,n){return`
|
|
300
261
|
|
|
301
262
|
`+e.firstChild.textContent.replace(/\n/g,`
|
|
302
263
|
`)+`
|
|
303
264
|
|
|
304
|
-
`}},
|
|
265
|
+
`}},qe.fencedCodeBlock={filter:function(t,e){return e.codeBlockStyle==="fenced"&&t.nodeName==="PRE"&&t.firstChild&&t.firstChild.nodeName==="CODE"},replacement:function(t,e,n){for(var r=e.firstChild.getAttribute("class")||"",o=(r.match(/language-(\S+)/)||[null,""])[1],s=e.firstChild.textContent,i=n.fence.charAt(0),a=3,l=new RegExp("^"+i+"{3,}","gm"),c;c=l.exec(s);)c[0].length>=a&&(a=c[0].length+1);var d=za(i,a);return`
|
|
305
266
|
|
|
306
|
-
`+
|
|
307
|
-
`+
|
|
308
|
-
`+
|
|
267
|
+
`+d+o+`
|
|
268
|
+
`+s.replace(/\n$/,"")+`
|
|
269
|
+
`+d+`
|
|
309
270
|
|
|
310
|
-
`}},
|
|
271
|
+
`}},qe.horizontalRule={filter:"hr",replacement:function(t,e,n){return`
|
|
311
272
|
|
|
312
273
|
`+n.hr+`
|
|
313
274
|
|
|
314
|
-
`}},
|
|
275
|
+
`}},qe.inlineLink={filter:function(t,e){return e.linkStyle==="inlined"&&t.nodeName==="A"&&t.getAttribute("href")},replacement:function(t,e){var n=e.getAttribute("href");n&&(n=n.replace(/([()])/g,"\\$1"));var r=Ps(e.getAttribute("title"));return r&&(r=' "'+r.replace(/"/g,'\\"')+'"'),"["+t+"]("+n+r+")"}},qe.referenceLink={filter:function(t,e){return e.linkStyle==="referenced"&&t.nodeName==="A"&&t.getAttribute("href")},replacement:function(t,e,n){var r=e.getAttribute("href"),o=Ps(e.getAttribute("title"));o&&(o=' "'+o+'"');var s,i;switch(n.linkReferenceStyle){case"collapsed":s="["+t+"][]",i="["+t+"]: "+r+o;break;case"shortcut":s="["+t+"]",i="["+t+"]: "+r+o;break;default:var a=this.references.length+1;s="["+t+"]["+a+"]",i="["+a+"]: "+r+o}return this.references.push(i),s},references:[],append:function(t){var e="";return this.references.length&&(e=`
|
|
315
276
|
|
|
316
277
|
`+this.references.join(`
|
|
317
278
|
`)+`
|
|
318
279
|
|
|
319
|
-
`,this.references=[]),e}},
|
|
320
|
-
`):""}function
|
|
280
|
+
`,this.references=[]),e}},qe.emphasis={filter:["em","i"],replacement:function(t,e,n){return t.trim()?n.emDelimiter+t+n.emDelimiter:""}},qe.strong={filter:["strong","b"],replacement:function(t,e,n){return t.trim()?n.strongDelimiter+t+n.strongDelimiter:""}},qe.code={filter:function(t){var e=t.previousSibling||t.nextSibling,n=t.parentNode.nodeName==="PRE"&&!e;return t.nodeName==="CODE"&&!n},replacement:function(t){if(!t)return"";t=t.replace(/\r?\n|\r/g," ");for(var e=/^`|^ .*?[^ ].* $|`$/.test(t)?" ":"",n="`",r=t.match(/`+/gm)||[];r.indexOf(n)!==-1;)n=n+"`";return n+e+t+e+n}},qe.image={filter:"img",replacement:function(t,e){var n=Ps(e.getAttribute("alt")),r=e.getAttribute("src")||"",o=Ps(e.getAttribute("title")),s=o?' "'+o+'"':"";return r?"":""}};function Ps(t){return t?t.replace(/(\n+\s*)+/g,`
|
|
281
|
+
`):""}function hh(t){this.options=t,this._keep=[],this._remove=[],this.blankRule={replacement:t.blankReplacement},this.keepReplacement=t.keepReplacement,this.defaultRule={replacement:t.defaultReplacement},this.array=[];for(var e in t.rules)this.array.push(t.rules[e])}hh.prototype={add:function(t,e){this.array.unshift(e)},keep:function(t){this._keep.unshift({filter:t,replacement:this.keepReplacement})},remove:function(t){this._remove.unshift({filter:t,replacement:function(){return""}})},forNode:function(t){if(t.isBlank)return this.blankRule;var e;return(e=Ua(this.array,t,this.options))||(e=Ua(this._keep,t,this.options))||(e=Ua(this._remove,t,this.options))?e:this.defaultRule},forEach:function(t){for(var e=0;e<this.array.length;e++)t(this.array[e],e)}};function Ua(t,e,n){for(var r=0;r<t.length;r++){var o=t[r];if(nC(o,e,n))return o}}function nC(t,e,n){var r=t.filter;if(typeof r=="string"){if(r===e.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(e.nodeName.toLowerCase())>-1)return!0}else if(typeof r=="function"){if(r.call(t,e,n))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function rC(t){var e=t.element,n=t.isBlock,r=t.isVoid,o=t.isPre||function(f){return f.nodeName==="PRE"};if(!(!e.firstChild||o(e))){for(var s=null,i=!1,a=null,l=ph(a,e,o);l!==e;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!s||/ $/.test(s.data))&&!i&&c[0]===" "&&(c=c.substr(1)),!c){l=Wa(l);continue}l.data=c,s=l}else if(l.nodeType===1)n(l)||l.nodeName==="BR"?(s&&(s.data=s.data.replace(/ $/,"")),s=null,i=!1):r(l)||o(l)?(s=null,i=!0):s&&(i=!1);else{l=Wa(l);continue}var d=ph(a,l,o);a=l,l=d}s&&(s.data=s.data.replace(/ $/,""),s.data||Wa(s))}}function Wa(t){var e=t.nextSibling||t.parentNode;return t.parentNode.removeChild(t),e}function ph(t,e,n){return t&&t.parentNode===e||n(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}var Ka=typeof window<"u"?window:{};function oC(){var t=Ka.DOMParser,e=!1;try{new t().parseFromString("","text/html")&&(e=!0)}catch{}return e}function sC(){var t=function(){};return iC()?t.prototype.parseFromString=function(e){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(e),n.close(),n}:t.prototype.parseFromString=function(e){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(e),n.close(),n},t}function iC(){var t=!1;try{document.implementation.createHTMLDocument("").open()}catch{Ka.ActiveXObject&&(t=!0)}return t}var aC=oC()?Ka.DOMParser:sC();function lC(t,e){var n;if(typeof t=="string"){var r=cC().parseFromString('<x-turndown id="turndown-root">'+t+"</x-turndown>","text/html");n=r.getElementById("turndown-root")}else n=t.cloneNode(!0);return rC({element:n,isBlock:Ha,isVoid:dh,isPre:e.preformattedCode?dC:null}),n}var Ga;function cC(){return Ga=Ga||new aC,Ga}function dC(t){return t.nodeName==="PRE"||t.nodeName==="CODE"}function uC(t,e){return t.isBlock=Ha(t),t.isCode=t.nodeName==="CODE"||t.parentNode.isCode,t.isBlank=fC(t),t.flankingWhitespace=hC(t,e),t}function fC(t){return!dh(t)&&!eC(t)&&/^\s*$/i.test(t.textContent)&&!ZE(t)&&!tC(t)}function hC(t,e){if(t.isBlock||e.preformattedCode&&t.isCode)return{leading:"",trailing:""};var n=pC(t.textContent);return n.leadingAscii&&mh("left",t,e)&&(n.leading=n.leadingNonAscii),n.trailingAscii&&mh("right",t,e)&&(n.trailing=n.trailingNonAscii),{leading:n.leading,trailing:n.trailing}}function pC(t){var e=t.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:e[1],leadingAscii:e[2],leadingNonAscii:e[3],trailing:e[4],trailingNonAscii:e[5],trailingAscii:e[6]}}function mh(t,e,n){var r,o,s;return t==="left"?(r=e.previousSibling,o=/ $/):(r=e.nextSibling,o=/^ /),r&&(r.nodeType===3?s=o.test(r.nodeValue):n.preformattedCode&&r.nodeName==="CODE"?s=!1:r.nodeType===1&&!Ha(r)&&(s=o.test(r.textContent))),s}var mC=Array.prototype.reduce,gC=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Rs(t){if(!(this instanceof Rs))return new Rs(t);var e={rules:qe,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(n,r){return r.isBlock?`
|
|
321
282
|
|
|
322
283
|
`:""},keepReplacement:function(n,r){return r.isBlock?`
|
|
323
284
|
|
|
@@ -327,6 +288,27 @@ About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guid
|
|
|
327
288
|
|
|
328
289
|
`+n+`
|
|
329
290
|
|
|
330
|
-
`:n}};this.options=
|
|
291
|
+
`:n}};this.options=JE({},e,t),this.rules=new hh(this.options)}Rs.prototype={turndown:function(t){if(!kC(t))throw new TypeError(t+" is not a string, or an element/document/fragment node.");if(t==="")return"";var e=gh.call(this,new lC(t,this.options));return bC.call(this,e)},use:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.use(t[e]);else if(typeof t=="function")t(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(t,e){return this.rules.add(t,e),this},keep:function(t){return this.rules.keep(t),this},remove:function(t){return this.rules.remove(t),this},escape:function(t){return gC.reduce(function(e,n){return e.replace(n[0],n[1])},t)}};function gh(t){var e=this;return mC.call(t.childNodes,function(n,r){r=new uC(r,e.options);var o="";return r.nodeType===3?o=r.isCode?r.nodeValue:e.escape(r.nodeValue):r.nodeType===1&&(o=yC.call(e,r)),bh(n,o)},"")}function bC(t){var e=this;return this.rules.forEach(function(n){typeof n.append=="function"&&(t=bh(t,n.append(e.options)))}),t.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function yC(t){var e=this.rules.forNode(t),n=gh.call(this,t),r=t.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+e.replacement(n,t,this.options)+r.trailing}function bh(t,e){var n=XE(t),r=YE(e),o=Math.max(t.length-n.length,e.length-r.length),s=`
|
|
331
292
|
|
|
332
|
-
`.substring(0,o);return n+
|
|
293
|
+
`.substring(0,o);return n+s+r}function kC(t){return t!=null&&(typeof t=="string"||t.nodeType&&(t.nodeType===1||t.nodeType===9||t.nodeType===11))}const wC={class:"bg-white border border border-solid border-gray-200 rounded-xl"},_C={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},EC=Object.assign({inheritAttrs:!1},{__name:"vs-richtext-md",props:{modelValue:{type:String,default:()=>""},toolbar:{type:[Array,String],default:()=>"default"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=new qE.Converter({tables:!0,strikethrough:!0,tasklists:!0,ghCodeBlocks:!0}),s=Bu({content:'<p class="min-h-[1rem]"></p>',extensions:[kw.configure({history:{depth:100,newGroupDelay:500},code:{HTMLAttributes:{class:"editor-code"}},codeBlock:{HTMLAttributes:{class:"editor-codeblock"}},paragraph:!1,heading:!1,link:!1}),Vu,cf.configure({HTMLAttributes:{class:"editor-content"},resizable:!0}),ah,ih,ff,df,uf,Zf.configure({types:["heading","paragraph"]}),Ia.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0}),Qf],editorProps:{handlePaste:sh}}),i=p.computed(()=>typeof n.toolbar=="string"?Ls[n.toolbar]||Ls.default:n.toolbar),a=p.computed(()=>i.value.map(f=>oh[f]).filter(Boolean)),l=p.computed(()=>s.value);let c=!1;p.watch(()=>n.modelValue,f=>{if(s.value&&!c){const h=f||"",m=o.makeHtml(h),y=s.value.getHTML();m!==y&&m!=="<p></p>"&&s.value.commands.setContent(m,!1)}},{immediate:!0}),p.watch(s,f=>{f&&f.on("update",()=>{if(!c){c=!0;const h=f.getHTML();if(h&&h!=="<p></p>"&&h!=='<p style="min-height: 1rem;"></p>'){const y=new Rs().turndown(h);y!==n.modelValue&&r("update:modelValue",y)}setTimeout(()=>{c=!1},10)}})});const d=()=>{s.value&&!s.value.isFocused&&s.value.commands.focus()};return(f,h)=>(p.openBlock(),p.createElementBlock("div",wC,[p.createElementVNode("div",_C,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(a.value,m=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:m},[p.unref(s)?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(m),{key:0,editor:l.value},null,8,["editor"])):p.createCommentVNode("",!0)],64))),128))]),p.createElementVNode("div",{onClick:d,class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[p.createVNode(p.unref(Du),{editor:p.unref(s),class:"relative w-full"},null,8,["editor"])])]))}});/*!
|
|
294
|
+
* shared v11.1.12
|
|
295
|
+
* (c) 2025 kazuya kawaguchi
|
|
296
|
+
* Released under the MIT License.
|
|
297
|
+
*/function At(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const yh={};function qa(t){yh[t]||(yh[t]=!0,At(t))}const Et=typeof window<"u";let lt,Dn;if(process.env.NODE_ENV!=="production"){const t=Et&&window.performance;t&&t.mark&&t.measure&&t.clearMarks&&t.clearMeasures&&(lt=e=>{t.mark(e)},Dn=(e,n,r)=>{t.measure(e,n,r),t.clearMarks(n),t.clearMarks(r)})}const CC=/\{([0-9a-zA-Z]+)\}/g;function Ds(t,...e){return e.length===1&&ne(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(CC,(n,r)=>e.hasOwnProperty(r)?e[r]:"")}const Ot=(t,e=!1)=>e?Symbol.for(t):Symbol(t),vC=(t,e,n)=>SC({l:t,k:e,s:n}),SC=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Ae=t=>typeof t=="number"&&isFinite(t),TC=t=>Ja(t)==="[object Date]",ar=t=>Ja(t)==="[object RegExp]",Bs=t=>te(t)&&Object.keys(t).length===0,Le=Object.assign,xC=Object.create,ce=(t=null)=>xC(t);let kh;const Bn=()=>kh||(kh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:ce());function wh(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function _h(t){return t.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function NC(t){return t=t.replace(/(\w+)\s*=\s*"([^"]*)"/g,(r,o,s)=>`${o}="${_h(s)}"`),t=t.replace(/(\w+)\s*=\s*'([^']*)'/g,(r,o,s)=>`${o}='${_h(s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(t)&&(process.env.NODE_ENV!=="production"&&At("Potentially dangerous event handlers detected in translation. Consider removing onclick, onerror, etc. from your translation messages."),t=t.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(r=>{t=t.replace(r,"$1javascript:")}),t}const MC=Object.prototype.hasOwnProperty;function Ct(t,e){return MC.call(t,e)}const ke=Array.isArray,ue=t=>typeof t=="function",j=t=>typeof t=="string",re=t=>typeof t=="boolean",ne=t=>t!==null&&typeof t=="object",AC=t=>ne(t)&&ue(t.then)&&ue(t.catch),Eh=Object.prototype.toString,Ja=t=>Eh.call(t),te=t=>Ja(t)==="[object Object]",OC=t=>t==null?"":ke(t)||te(t)&&t.toString===Eh?JSON.stringify(t,null,2):String(t);function Ya(t,e=""){return t.reduce((n,r,o)=>o===0?n+r:n+e+r,"")}const Ch=2;function LC(t,e=0,n=t.length){const r=t.split(/\r?\n/);let o=0;const s=[];for(let i=0;i<r.length;i++)if(o+=r[i].length+1,o>=e){for(let a=i-Ch;a<=i+Ch||n>o;a++){if(a<0||a>=r.length)continue;const l=a+1;s.push(`${l}${" ".repeat(3-String(l).length)}| ${r[a]}`);const c=r[a].length;if(a===i){const d=e-(o-c)+1,f=Math.max(1,n>o?c-d:n-e);s.push(" | "+" ".repeat(d)+"^".repeat(f))}else if(a>i){if(n>o){const d=Math.max(Math.min(n-o,c),1);s.push(" | "+"^".repeat(d))}o+=c+1}}break}return s.join(`
|
|
298
|
+
`)}function Xa(){const t=new Map;return{events:t,on(n,r){const o=t.get(n);o&&o.push(r)||t.set(n,[r])},off(n,r){const o=t.get(n);o&&o.splice(o.indexOf(r)>>>0,1)},emit(n,r){(t.get(n)||[]).slice().map(o=>o(r)),(t.get("*")||[]).slice().map(o=>o(n,r))}}}const Fs=t=>!ne(t)||ke(t);function Vs(t,e){if(Fs(t)||Fs(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:o}=n.pop();Object.keys(r).forEach(s=>{s!=="__proto__"&&(ne(r[s])&&!ne(o[s])&&(o[s]=Array.isArray(r[s])?[]:ce()),Fs(o[s])||Fs(r[s])?o[s]=r[s]:n.push({src:r[s],des:o[s]}))})}}/*!
|
|
299
|
+
* message-compiler v11.1.12
|
|
300
|
+
* (c) 2025 kazuya kawaguchi
|
|
301
|
+
* Released under the MIT License.
|
|
302
|
+
*/function IC(t,e,n){return{line:t,column:e,offset:n}}function Qa(t,e,n){return{start:t,end:e}}const Q={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},PC=17,RC={[Q.EXPECTED_TOKEN]:"Expected token: '{0}'",[Q.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[Q.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[Q.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[Q.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[Q.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[Q.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[Q.EMPTY_PLACEHOLDER]:"Empty placeholder",[Q.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[Q.INVALID_LINKED_FORMAT]:"Invalid linked format",[Q.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[Q.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[Q.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[Q.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[Q.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[Q.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function lr(t,e,n={}){const{domain:r,messages:o,args:s}=n,i=process.env.NODE_ENV!=="production"?Ds((o||RC)[t]||"",...s||[]):t,a=new SyntaxError(String(i));return a.code=t,e&&(a.location=e),a.domain=r,a}function DC(t){throw t}const BC=/<\/?[\w\s="/.':;#-\/]+>/,FC=t=>BC.test(t),Lt=" ",VC="\r",Je=`
|
|
303
|
+
`,$C="\u2028",zC="\u2029";function HC(t){const e=t;let n=0,r=1,o=1,s=0;const i=k=>e[k]===VC&&e[k+1]===Je,a=k=>e[k]===Je,l=k=>e[k]===zC,c=k=>e[k]===$C,d=k=>i(k)||a(k)||l(k)||c(k),f=()=>n,h=()=>r,m=()=>o,y=()=>s,w=k=>i(k)||l(k)||c(k)?Je:e[k],E=()=>w(n),_=()=>w(n+s);function x(){return s=0,d(n)&&(r++,o=0),i(n)&&n++,n++,o++,e[n]}function A(){return i(n+s)&&s++,s++,e[n+s]}function u(){n=0,r=1,o=1,s=0}function b(k=0){s=k}function g(){const k=n+s;for(;k!==n;)x();s=0}return{index:f,line:h,column:m,peekOffset:y,charAt:w,currentChar:E,currentPeek:_,next:x,peek:A,reset:u,resetPeek:b,skipToPeek:g}}const jt=void 0,jC=".",vh="'",UC="tokenizer";function WC(t,e={}){const n=e.location!==!1,r=HC(t),o=()=>r.index(),s=()=>IC(r.line(),r.column(),r.index()),i=s(),a=o(),l={currentType:13,offset:a,startLoc:i,endLoc:i,lastType:13,lastOffset:a,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:d}=e;function f(N,M,F,...W){const be=c();if(M.column+=F,M.offset+=F,d){const Te=n?Qa(be.startLoc,M):null,oe=lr(N,Te,{domain:UC,args:W});d(oe)}}function h(N,M,F){N.endLoc=s(),N.currentType=M;const W={type:M};return n&&(W.loc=Qa(N.startLoc,N.endLoc)),F!=null&&(W.value=F),W}const m=N=>h(N,13);function y(N,M){return N.currentChar()===M?(N.next(),M):(f(Q.EXPECTED_TOKEN,s(),0,M),"")}function w(N){let M="";for(;N.currentPeek()===Lt||N.currentPeek()===Je;)M+=N.currentPeek(),N.peek();return M}function E(N){const M=w(N);return N.skipToPeek(),M}function _(N){if(N===jt)return!1;const M=N.charCodeAt(0);return M>=97&&M<=122||M>=65&&M<=90||M===95}function x(N){if(N===jt)return!1;const M=N.charCodeAt(0);return M>=48&&M<=57}function A(N,M){const{currentType:F}=M;if(F!==2)return!1;w(N);const W=_(N.currentPeek());return N.resetPeek(),W}function u(N,M){const{currentType:F}=M;if(F!==2)return!1;w(N);const W=N.currentPeek()==="-"?N.peek():N.currentPeek(),be=x(W);return N.resetPeek(),be}function b(N,M){const{currentType:F}=M;if(F!==2)return!1;w(N);const W=N.currentPeek()===vh;return N.resetPeek(),W}function g(N,M){const{currentType:F}=M;if(F!==7)return!1;w(N);const W=N.currentPeek()===".";return N.resetPeek(),W}function k(N,M){const{currentType:F}=M;if(F!==8)return!1;w(N);const W=_(N.currentPeek());return N.resetPeek(),W}function C(N,M){const{currentType:F}=M;if(!(F===7||F===11))return!1;w(N);const W=N.currentPeek()===":";return N.resetPeek(),W}function T(N,M){const{currentType:F}=M;if(F!==9)return!1;const W=()=>{const Te=N.currentPeek();return Te==="{"?_(N.peek()):Te==="@"||Te==="|"||Te===":"||Te==="."||Te===Lt||!Te?!1:Te===Je?(N.peek(),W()):O(N,!1)},be=W();return N.resetPeek(),be}function v(N){w(N);const M=N.currentPeek()==="|";return N.resetPeek(),M}function O(N,M=!0){const F=(be=!1,Te="")=>{const oe=N.currentPeek();return oe==="{"||oe==="@"||!oe?be:oe==="|"?!(Te===Lt||Te===Je):oe===Lt?(N.peek(),F(!0,Lt)):oe===Je?(N.peek(),F(!0,Je)):!0},W=F();return M&&N.resetPeek(),W}function R(N,M){const F=N.currentChar();return F===jt?jt:M(F)?(N.next(),F):null}function B(N){const M=N.charCodeAt(0);return M>=97&&M<=122||M>=65&&M<=90||M>=48&&M<=57||M===95||M===36}function D(N){return R(N,B)}function V(N){const M=N.charCodeAt(0);return M>=97&&M<=122||M>=65&&M<=90||M>=48&&M<=57||M===95||M===36||M===45}function S(N){return R(N,V)}function P(N){const M=N.charCodeAt(0);return M>=48&&M<=57}function U(N){return R(N,P)}function K(N){const M=N.charCodeAt(0);return M>=48&&M<=57||M>=65&&M<=70||M>=97&&M<=102}function Z(N){return R(N,K)}function G(N){let M="",F="";for(;M=U(N);)F+=M;return F}function Oe(N){let M="";for(;;){const F=N.currentChar();if(F==="{"||F==="}"||F==="@"||F==="|"||!F)break;if(F===Lt||F===Je)if(O(N))M+=F,N.next();else{if(v(N))break;M+=F,N.next()}else M+=F,N.next()}return M}function Fe(N){E(N);let M="",F="";for(;M=S(N);)F+=M;const W=N.currentChar();if(W&&W!=="}"&&W!==jt&&W!==Lt&&W!==Je&&W!==" "){const be=gn(N);return f(Q.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,F+be),F+be}return N.currentChar()===jt&&f(Q.UNTERMINATED_CLOSING_BRACE,s(),0),F}function et(N){E(N);let M="";return N.currentChar()==="-"?(N.next(),M+=`-${G(N)}`):M+=G(N),N.currentChar()===jt&&f(Q.UNTERMINATED_CLOSING_BRACE,s(),0),M}function Se(N){return N!==vh&&N!==Je}function Ve(N){E(N),y(N,"'");let M="",F="";for(;M=R(N,Se);)M==="\\"?F+=$e(N):F+=M;const W=N.currentChar();return W===Je||W===jt?(f(Q.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),W===Je&&(N.next(),y(N,"'")),F):(y(N,"'"),F)}function $e(N){const M=N.currentChar();switch(M){case"\\":case"'":return N.next(),`\\${M}`;case"u":return ze(N,M,4);case"U":return ze(N,M,6);default:return f(Q.UNKNOWN_ESCAPE_SEQUENCE,s(),0,M),""}}function ze(N,M,F){y(N,M);let W="";for(let be=0;be<F;be++){const Te=Z(N);if(!Te){f(Q.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),0,`\\${M}${W}${N.currentChar()}`);break}W+=Te}return`\\${M}${W}`}function $n(N){return N!=="{"&&N!=="}"&&N!==Lt&&N!==Je}function gn(N){E(N);let M="",F="";for(;M=R(N,$n);)F+=M;return F}function hr(N){let M="",F="";for(;M=D(N);)F+=M;return F}function zn(N){const M=F=>{const W=N.currentChar();return W==="{"||W==="@"||W==="|"||W==="("||W===")"||!W||W===Lt?F:(F+=W,N.next(),M(F))};return M("")}function bn(N){E(N);const M=y(N,"|");return E(N),M}function ro(N,M){let F=null;switch(N.currentChar()){case"{":return M.braceNest>=1&&f(Q.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),N.next(),F=h(M,2,"{"),E(N),M.braceNest++,F;case"}":return M.braceNest>0&&M.currentType===2&&f(Q.EMPTY_PLACEHOLDER,s(),0),N.next(),F=h(M,3,"}"),M.braceNest--,M.braceNest>0&&E(N),M.inLinked&&M.braceNest===0&&(M.inLinked=!1),F;case"@":return M.braceNest>0&&f(Q.UNTERMINATED_CLOSING_BRACE,s(),0),F=Hn(N,M)||m(M),M.braceNest=0,F;default:{let be=!0,Te=!0,oe=!0;if(v(N))return M.braceNest>0&&f(Q.UNTERMINATED_CLOSING_BRACE,s(),0),F=h(M,1,bn(N)),M.braceNest=0,M.inLinked=!1,F;if(M.braceNest>0&&(M.currentType===4||M.currentType===5||M.currentType===6))return f(Q.UNTERMINATED_CLOSING_BRACE,s(),0),M.braceNest=0,oo(N,M);if(be=A(N,M))return F=h(M,4,Fe(N)),E(N),F;if(Te=u(N,M))return F=h(M,5,et(N)),E(N),F;if(oe=b(N,M))return F=h(M,6,Ve(N)),E(N),F;if(!be&&!Te&&!oe)return F=h(M,12,gn(N)),f(Q.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,F.value),E(N),F;break}}return F}function Hn(N,M){const{currentType:F}=M;let W=null;const be=N.currentChar();switch((F===7||F===8||F===11||F===9)&&(be===Je||be===Lt)&&f(Q.INVALID_LINKED_FORMAT,s(),0),be){case"@":return N.next(),W=h(M,7,"@"),M.inLinked=!0,W;case".":return E(N),N.next(),h(M,8,".");case":":return E(N),N.next(),h(M,9,":");default:return v(N)?(W=h(M,1,bn(N)),M.braceNest=0,M.inLinked=!1,W):g(N,M)||C(N,M)?(E(N),Hn(N,M)):k(N,M)?(E(N),h(M,11,hr(N))):T(N,M)?(E(N),be==="{"?ro(N,M)||W:h(M,10,zn(N))):(F===7&&f(Q.INVALID_LINKED_FORMAT,s(),0),M.braceNest=0,M.inLinked=!1,oo(N,M))}}function oo(N,M){let F={type:13};if(M.braceNest>0)return ro(N,M)||m(M);if(M.inLinked)return Hn(N,M)||m(M);switch(N.currentChar()){case"{":return ro(N,M)||m(M);case"}":return f(Q.UNBALANCED_CLOSING_BRACE,s(),0),N.next(),h(M,3,"}");case"@":return Hn(N,M)||m(M);default:{if(v(N))return F=h(M,1,bn(N)),M.braceNest=0,M.inLinked=!1,F;if(O(N))return h(M,0,Oe(N));break}}return F}function vl(){const{currentType:N,offset:M,startLoc:F,endLoc:W}=l;return l.lastType=N,l.lastOffset=M,l.lastStartLoc=F,l.lastEndLoc=W,l.offset=o(),l.startLoc=s(),r.currentChar()===jt?h(l,13):oo(r,l)}return{nextToken:vl,currentOffset:o,currentPosition:s,context:c}}const KC="parser",GC=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function qC(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function JC(t={}){const e=t.location!==!1,{onError:n}=t;function r(_,x,A,u,...b){const g=_.currentPosition();if(g.offset+=u,g.column+=u,n){const k=e?Qa(A,g):null,C=lr(x,k,{domain:KC,args:b});n(C)}}function o(_,x,A){const u={type:_};return e&&(u.start=x,u.end=x,u.loc={start:A,end:A}),u}function s(_,x,A,u){e&&(_.end=x,_.loc&&(_.loc.end=A))}function i(_,x){const A=_.context(),u=o(3,A.offset,A.startLoc);return u.value=x,s(u,_.currentOffset(),_.currentPosition()),u}function a(_,x){const A=_.context(),{lastOffset:u,lastStartLoc:b}=A,g=o(5,u,b);return g.index=parseInt(x,10),_.nextToken(),s(g,_.currentOffset(),_.currentPosition()),g}function l(_,x){const A=_.context(),{lastOffset:u,lastStartLoc:b}=A,g=o(4,u,b);return g.key=x,_.nextToken(),s(g,_.currentOffset(),_.currentPosition()),g}function c(_,x){const A=_.context(),{lastOffset:u,lastStartLoc:b}=A,g=o(9,u,b);return g.value=x.replace(GC,qC),_.nextToken(),s(g,_.currentOffset(),_.currentPosition()),g}function d(_){const x=_.nextToken(),A=_.context(),{lastOffset:u,lastStartLoc:b}=A,g=o(8,u,b);return x.type!==11?(r(_,Q.UNEXPECTED_EMPTY_LINKED_MODIFIER,A.lastStartLoc,0),g.value="",s(g,u,b),{nextConsumeToken:x,node:g}):(x.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,It(x)),g.value=x.value||"",s(g,_.currentOffset(),_.currentPosition()),{node:g})}function f(_,x){const A=_.context(),u=o(7,A.offset,A.startLoc);return u.value=x,s(u,_.currentOffset(),_.currentPosition()),u}function h(_){const x=_.context(),A=o(6,x.offset,x.startLoc);let u=_.nextToken();if(u.type===8){const b=d(_);A.modifier=b.node,u=b.nextConsumeToken||_.nextToken()}switch(u.type!==9&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(u)),u=_.nextToken(),u.type===2&&(u=_.nextToken()),u.type){case 10:u.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(u)),A.key=f(_,u.value||"");break;case 4:u.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(u)),A.key=l(_,u.value||"");break;case 5:u.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(u)),A.key=a(_,u.value||"");break;case 6:u.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(u)),A.key=c(_,u.value||"");break;default:{r(_,Q.UNEXPECTED_EMPTY_LINKED_KEY,x.lastStartLoc,0);const b=_.context(),g=o(7,b.offset,b.startLoc);return g.value="",s(g,b.offset,b.startLoc),A.key=g,s(A,b.offset,b.startLoc),{nextConsumeToken:u,node:A}}}return s(A,_.currentOffset(),_.currentPosition()),{node:A}}function m(_){const x=_.context(),A=x.currentType===1?_.currentOffset():x.offset,u=x.currentType===1?x.endLoc:x.startLoc,b=o(2,A,u);b.items=[];let g=null;do{const T=g||_.nextToken();switch(g=null,T.type){case 0:T.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(T)),b.items.push(i(_,T.value||""));break;case 5:T.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(T)),b.items.push(a(_,T.value||""));break;case 4:T.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(T)),b.items.push(l(_,T.value||""));break;case 6:T.value==null&&r(_,Q.UNEXPECTED_LEXICAL_ANALYSIS,x.lastStartLoc,0,It(T)),b.items.push(c(_,T.value||""));break;case 7:{const v=h(_);b.items.push(v.node),g=v.nextConsumeToken||null;break}}}while(x.currentType!==13&&x.currentType!==1);const k=x.currentType===1?x.lastOffset:_.currentOffset(),C=x.currentType===1?x.lastEndLoc:_.currentPosition();return s(b,k,C),b}function y(_,x,A,u){const b=_.context();let g=u.items.length===0;const k=o(1,x,A);k.cases=[],k.cases.push(u);do{const C=m(_);g||(g=C.items.length===0),k.cases.push(C)}while(b.currentType!==13);return g&&r(_,Q.MUST_HAVE_MESSAGES_IN_PLURAL,A,0),s(k,_.currentOffset(),_.currentPosition()),k}function w(_){const x=_.context(),{offset:A,startLoc:u}=x,b=m(_);return x.currentType===13?b:y(_,A,u,b)}function E(_){const x=WC(_,Le({},t)),A=x.context(),u=o(0,A.offset,A.startLoc);return e&&u.loc&&(u.loc.source=_),u.body=w(x),t.onCacheKey&&(u.cacheKey=t.onCacheKey(_)),A.currentType!==13&&r(x,Q.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,_[A.offset]||""),s(u,x.currentOffset(),x.currentPosition()),u}return{parse:E}}function It(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function YC(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function Sh(t,e){for(let n=0;n<t.length;n++)Za(t[n],e)}function Za(t,e){switch(t.type){case 1:Sh(t.cases,e),e.helper("plural");break;case 2:Sh(t.items,e);break;case 6:{Za(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function XC(t,e={}){const n=YC(t);n.helper("normalize"),t.body&&Za(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function QC(t){const e=t.body;return e.type===2?Th(e):e.cases.forEach(n=>Th(n)),t}function Th(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Ya(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const ZC="minifier";function cr(t){switch(t.t=t.type,t.type){case 0:{const e=t;cr(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)cr(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)cr(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;cr(e.key),e.k=e.key,delete e.key,e.modifier&&(cr(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:if(process.env.NODE_ENV!=="production")throw lr(Q.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:ZC,args:[t.type]})}delete t.type}const ev="parser";function tv(t,e){const{filename:n,breakLineCode:r,needIndent:o}=e,s=e.location!==!1,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};s&&t.loc&&(i.source=t.loc.source);const a=()=>i;function l(w,E){i.code+=w}function c(w,E=!0){const _=E?r:"";l(o?_+" ".repeat(w):_)}function d(w=!0){const E=++i.indentLevel;w&&c(E)}function f(w=!0){const E=--i.indentLevel;w&&c(E)}function h(){c(i.indentLevel)}return{context:a,push:l,indent:d,deindent:f,newline:h,helper:w=>`_${w}`,needIndent:()=>i.needIndent}}function nv(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),dr(t,e.key),e.modifier?(t.push(", "),dr(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function rv(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const o=e.items.length;for(let s=0;s<o&&(dr(t,e.items[s]),s!==o-1);s++)t.push(", ");t.deindent(r()),t.push("])")}function ov(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const o=e.cases.length;for(let s=0;s<o&&(dr(t,e.cases[s]),s!==o-1);s++)t.push(", ");t.deindent(r()),t.push("])")}}function sv(t,e){e.body?dr(t,e.body):t.push("null")}function dr(t,e){const{helper:n}=t;switch(e.type){case 0:sv(t,e);break;case 1:ov(t,e);break;case 2:rv(t,e);break;case 6:nv(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:if(process.env.NODE_ENV!=="production")throw lr(Q.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:ev,args:[e.type]})}}const iv=(t,e={})=>{const n=j(e.mode)?e.mode:"normal",r=j(e.filename)?e.filename:"message.intl";e.sourceMap;const o=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
304
|
+
`,s=e.needIndent?e.needIndent:n!=="arrow",i=t.helpers||[],a=tv(t,{filename:r,breakLineCode:o,needIndent:s});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(s),i.length>0&&(a.push(`const { ${Ya(i.map(d=>`${d}: _${d}`),", ")} } = ctx`),a.newline()),a.push("return "),dr(a,t),a.deindent(s),a.push("}"),delete t.helpers;const{code:l,map:c}=a.context();return{ast:t,code:l,map:c?c.toJSON():void 0}};function av(t,e={}){const n=Le({},e),r=!!n.jit,o=!!n.minify,s=n.optimize==null?!0:n.optimize,a=JC(n).parse(t);return r?(s&&QC(a),o&&cr(a),{ast:a,code:""}):(XC(a,n),iv(a,n))}/*!
|
|
305
|
+
* core-base v11.1.12
|
|
306
|
+
* (c) 2025 kazuya kawaguchi
|
|
307
|
+
* Released under the MIT License.
|
|
308
|
+
*/function lv(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Bn().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Bn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function mt(t){return ne(t)&&el(t)===0&&(Ct(t,"b")||Ct(t,"body"))}const xh=["b","body"];function cv(t){return pn(t,xh)}const Nh=["c","cases"];function dv(t){return pn(t,Nh,[])}const Mh=["s","static"];function uv(t){return pn(t,Mh)}const Ah=["i","items"];function fv(t){return pn(t,Ah,[])}const Oh=["t","type"];function el(t){return pn(t,Oh)}const Lh=["v","value"];function $s(t,e){const n=pn(t,Lh);if(n!=null)return n;throw Yr(e)}const Ih=["m","modifier"];function hv(t){return pn(t,Ih)}const Ph=["k","key"];function pv(t){const e=pn(t,Ph);if(e)return e;throw Yr(6)}function pn(t,e,n){for(let r=0;r<e.length;r++){const o=e[r];if(Ct(t,o)&&t[o]!=null)return t[o]}return n}const Rh=[...xh,...Nh,...Mh,...Ah,...Ph,...Ih,...Lh,...Oh];function Yr(t){return new Error(`unhandled node type: ${t}`)}function tl(t){return n=>mv(n,t)}function mv(t,e){const n=cv(e);if(n==null)throw Yr(0);if(el(n)===1){const s=dv(n);return t.plural(s.reduce((i,a)=>[...i,Dh(t,a)],[]))}else return Dh(t,n)}function Dh(t,e){const n=uv(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=fv(e).reduce((o,s)=>[...o,nl(t,s)],[]);return t.normalize(r)}}function nl(t,e){const n=el(e);switch(n){case 3:return $s(e,n);case 9:return $s(e,n);case 4:{const r=e;if(Ct(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(Ct(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw Yr(n)}case 5:{const r=e;if(Ct(r,"i")&&Ae(r.i))return t.interpolate(t.list(r.i));if(Ct(r,"index")&&Ae(r.index))return t.interpolate(t.list(r.index));throw Yr(n)}case 6:{const r=e,o=hv(r),s=pv(r);return t.linked(nl(t,s),o?nl(t,o):void 0,t.type)}case 7:return $s(e,n);case 8:return $s(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const gv="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function bv(t,e){e&&FC(t)&&At(Ds(gv,{source:t}))}const yv=t=>t;let zs=ce();function kv(t,e={}){let n=!1;const r=e.onError||DC;return e.onError=o=>{n=!0,r(o)},{...av(t,e),detectError:n}}function wv(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&j(t)){const n=re(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&bv(t,n);const o=(e.onCacheKey||yv)(t),s=zs[o];if(s)return s;const{ast:i,detectError:a}=kv(t,{...e,location:process.env.NODE_ENV!=="production",jit:!0}),l=tl(i);return a?l:zs[o]=l}else{if(process.env.NODE_ENV!=="production"&&!mt(t))return At(`the message that is resolve with key '${e.key}' is not supported for jit compilation`),(()=>t);const n=t.cacheKey;if(n){const r=zs[n];return r||(zs[n]=tl(t))}else return tl(t)}}let Xr=null;function _v(t){Xr=t}function Ev(t,e,n){Xr&&Xr.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const Cv=vv("function:translate");function vv(t){return e=>Xr&&Xr.emit(t,e)}const Ye={INVALID_ARGUMENT:PC,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Sv=24;function Ut(t){return lr(t,null,process.env.NODE_ENV!=="production"?{messages:Tv}:void 0)}const Tv={[Ye.INVALID_ARGUMENT]:"Invalid arguments",[Ye.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Ye.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Ye.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Ye.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Ye.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Ye.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function rl(t,e){return e.locale!=null?Bh(e.locale):Bh(t.locale)}let ol;function Bh(t){if(j(t))return t;if(ue(t)){if(t.resolvedOnce&&ol!=null)return ol;if(t.constructor.name==="Function"){const e=t();if(AC(e))throw Ut(Ye.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ol=e}else throw Ut(Ye.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ut(Ye.NOT_SUPPORT_LOCALE_TYPE)}function xv(t,e,n){return[...new Set([n,...ke(e)?e:ne(e)?Object.keys(e):j(e)?[e]:[n]])]}function Fh(t,e,n){const r=j(n)?n:Qr,o=t;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(r);if(!s){s=[];let i=[n];for(;ke(i);)i=Vh(s,i,e);const a=ke(e)||!te(e)?e:e.default?e.default:null;i=j(a)?[a]:a,ke(i)&&Vh(s,i,!1),o.__localeChainCache.set(r,s)}return s}function Vh(t,e,n){let r=!0;for(let o=0;o<e.length&&re(r);o++){const s=e[o];j(s)&&(r=Nv(t,e[o],n))}return r}function Nv(t,e,n){let r;const o=e.split("-");do{const s=o.join("-");r=Mv(t,s,n),o.splice(-1,1)}while(o.length&&r===!0);return r}function Mv(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const o=e.replace(/!/g,"");t.push(o),(ke(n)||te(n))&&n[o]&&(r=n[o])}return r}const mn=[];mn[0]={w:[0],i:[3,0],"[":[4],o:[7]},mn[1]={w:[1],".":[2],"[":[4],o:[7]},mn[2]={w:[2],i:[3,0],0:[3,0]},mn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},mn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},mn[5]={"'":[4,0],o:8,l:[5,0]},mn[6]={'"':[4,0],o:8,l:[6,0]};const Av=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Ov(t){return Av.test(t)}function Lv(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function Iv(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Pv(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:Ov(e)?Lv(e):"*"+e}function Rv(t){const e=[];let n=-1,r=0,o=0,s,i,a,l,c,d,f;const h=[];h[0]=()=>{i===void 0?i=a:i+=a},h[1]=()=>{i!==void 0&&(e.push(i),i=void 0)},h[2]=()=>{h[0](),o++},h[3]=()=>{if(o>0)o--,r=4,h[0]();else{if(o=0,i===void 0||(i=Pv(i),i===!1))return!1;h[1]()}};function m(){const y=t[n+1];if(r===5&&y==="'"||r===6&&y==='"')return n++,a="\\"+y,h[0](),!0}for(;r!==null;)if(n++,s=t[n],!(s==="\\"&&m())){if(l=Iv(s),f=mn[r],c=f[l]||f.l||8,c===8||(r=c[0],c[1]!==void 0&&(d=h[c[1]],d&&(a=s,d()===!1))))return;if(r===7)return e}}const $h=new Map;function Dv(t,e){return ne(t)?t[e]:null}function Bv(t,e){if(!ne(t))return null;let n=$h.get(e);if(n||(n=Rv(e),n&&$h.set(e,n)),!n)return null;const r=n.length;let o=t,s=0;for(;s<r;){const i=n[s];if(Rh.includes(i)&&mt(o))return null;const a=o[i];if(a===void 0||ue(o))return null;o=a,s++}return o}const rt={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},Fv=8,Vv={[rt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[rt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[rt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[rt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[rt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[rt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[rt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Fn(t,...e){return Ds(Vv[t],...e)}const $v="11.1.12",Hs=-1,Qr="en-US",js="",zh=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function zv(){return{upper:(t,e)=>e==="text"&&j(t)?t.toUpperCase():e==="vnode"&&ne(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&j(t)?t.toLowerCase():e==="vnode"&&ne(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&j(t)?zh(t):e==="vnode"&&ne(t)&&"__v_isVNode"in t?zh(t.children):t}}let Hh;function Hv(t){Hh=t}let jh;function jv(t){jh=t}let Uh;function Uv(t){Uh=t}let Wh=null;const Wv=t=>{Wh=t},Kv=()=>Wh;let Kh=null;const Gh=t=>{Kh=t},Gv=()=>Kh;let qh=0;function qv(t={}){const e=ue(t.onWarn)?t.onWarn:At,n=j(t.version)?t.version:$v,r=j(t.locale)||ue(t.locale)?t.locale:Qr,o=ue(r)?Qr:r,s=ke(t.fallbackLocale)||te(t.fallbackLocale)||j(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:o,i=te(t.messages)?t.messages:sl(o),a=te(t.datetimeFormats)?t.datetimeFormats:sl(o),l=te(t.numberFormats)?t.numberFormats:sl(o),c=Le(ce(),t.modifiers,zv()),d=t.pluralRules||ce(),f=ue(t.missing)?t.missing:null,h=re(t.missingWarn)||ar(t.missingWarn)?t.missingWarn:!0,m=re(t.fallbackWarn)||ar(t.fallbackWarn)?t.fallbackWarn:!0,y=!!t.fallbackFormat,w=!!t.unresolving,E=ue(t.postTranslation)?t.postTranslation:null,_=te(t.processor)?t.processor:null,x=re(t.warnHtmlMessage)?t.warnHtmlMessage:!0,A=!!t.escapeParameter,u=ue(t.messageCompiler)?t.messageCompiler:Hh;process.env.NODE_ENV!=="production"&&ue(t.messageCompiler)&&qa(Fn(rt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const b=ue(t.messageResolver)?t.messageResolver:jh||Dv,g=ue(t.localeFallbacker)?t.localeFallbacker:Uh||xv,k=ne(t.fallbackContext)?t.fallbackContext:void 0,C=t,T=ne(C.__datetimeFormatters)?C.__datetimeFormatters:new Map,v=ne(C.__numberFormatters)?C.__numberFormatters:new Map,O=ne(C.__meta)?C.__meta:{};qh++;const R={version:n,cid:qh,locale:r,fallbackLocale:s,messages:i,modifiers:c,pluralRules:d,missing:f,missingWarn:h,fallbackWarn:m,fallbackFormat:y,unresolving:w,postTranslation:E,processor:_,warnHtmlMessage:x,escapeParameter:A,messageCompiler:u,messageResolver:b,localeFallbacker:g,fallbackContext:k,onWarn:e,__meta:O};return R.datetimeFormats=a,R.numberFormats=l,R.__datetimeFormatters=T,R.__numberFormatters=v,process.env.NODE_ENV!=="production"&&(R.__v_emitter=C.__v_emitter!=null?C.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&Ev(R,n,O),R}const sl=t=>({[t]:ce()});function Us(t,e){return t instanceof RegExp?t.test(e):t}function Jh(t,e){return t instanceof RegExp?t.test(e):t}function il(t,e,n,r,o){const{missing:s,onWarn:i}=t;if(process.env.NODE_ENV!=="production"){const a=t.__v_emitter;a&&a.emit("missing",{locale:n,key:e,type:o,groupId:`${o}:${e}`})}if(s!==null){const a=s(t,n,e,o);return j(a)?a:e}else return process.env.NODE_ENV!=="production"&&Jh(r,e)&&i(Fn(rt.NOT_FOUND_KEY,{key:e,locale:n})),e}function Zr(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function Yh(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function Jv(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(Yh(t,e[r]))return!0;return!1}const Xh=typeof Intl<"u",Qh={dateTimeFormat:Xh&&typeof Intl.DateTimeFormat<"u",numberFormat:Xh&&typeof Intl.NumberFormat<"u"};function Zh(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:i}=t,{__datetimeFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!Qh.dateTimeFormat)return s(Fn(rt.CANNOT_FORMAT_DATE)),js;const[l,c,d,f]=al(...e),h=re(d.missingWarn)?d.missingWarn:t.missingWarn,m=re(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn,y=!!d.part,w=rl(t,d),E=i(t,o,w);if(!j(l)||l==="")return new Intl.DateTimeFormat(w,f).format(c);let _={},x,A=null,u=w,b=null;const g="datetime format";for(let T=0;T<E.length;T++){if(x=b=E[T],process.env.NODE_ENV!=="production"&&w!==x&&Us(m,l)&&s(Fn(rt.FALLBACK_TO_DATE_FORMAT,{key:l,target:x})),process.env.NODE_ENV!=="production"&&w!==x){const v=t.__v_emitter;v&&v.emit("fallback",{type:g,key:l,from:u,to:b,groupId:`${g}:${l}`})}if(_=n[x]||{},A=_[l],te(A))break;il(t,l,x,h,g),u=b}if(!te(A)||!j(x))return r?Hs:l;let k=`${x}__${l}`;Bs(f)||(k=`${k}__${JSON.stringify(f)}`);let C=a.get(k);return C||(C=new Intl.DateTimeFormat(x,Le({},A,f)),a.set(k,C)),y?C.formatToParts(c):C.format(c)}const ep=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function al(...t){const[e,n,r,o]=t,s=ce();let i=ce(),a;if(j(e)){const l=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!l)throw Ut(Ye.INVALID_ISO_DATE_ARGUMENT);const c=l[3]?l[3].trim().startsWith("T")?`${l[1].trim()}${l[3].trim()}`:`${l[1].trim()}T${l[3].trim()}`:l[1].trim();a=new Date(c);try{a.toISOString()}catch{throw Ut(Ye.INVALID_ISO_DATE_ARGUMENT)}}else if(TC(e)){if(isNaN(e.getTime()))throw Ut(Ye.INVALID_DATE_ARGUMENT);a=e}else if(Ae(e))a=e;else throw Ut(Ye.INVALID_ARGUMENT);return j(n)?s.key=n:te(n)&&Object.keys(n).forEach(l=>{ep.includes(l)?i[l]=n[l]:s[l]=n[l]}),j(r)?s.locale=r:te(r)&&(i=r),te(o)&&(i=o),[s.key||"",a,s,i]}function tp(t,e,n){const r=t;for(const o in n){const s=`${e}__${o}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function np(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:i}=t,{__numberFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!Qh.numberFormat)return s(Fn(rt.CANNOT_FORMAT_NUMBER)),js;const[l,c,d,f]=ll(...e),h=re(d.missingWarn)?d.missingWarn:t.missingWarn,m=re(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn,y=!!d.part,w=rl(t,d),E=i(t,o,w);if(!j(l)||l==="")return new Intl.NumberFormat(w,f).format(c);let _={},x,A=null,u=w,b=null;const g="number format";for(let T=0;T<E.length;T++){if(x=b=E[T],process.env.NODE_ENV!=="production"&&w!==x&&Us(m,l)&&s(Fn(rt.FALLBACK_TO_NUMBER_FORMAT,{key:l,target:x})),process.env.NODE_ENV!=="production"&&w!==x){const v=t.__v_emitter;v&&v.emit("fallback",{type:g,key:l,from:u,to:b,groupId:`${g}:${l}`})}if(_=n[x]||{},A=_[l],te(A))break;il(t,l,x,h,g),u=b}if(!te(A)||!j(x))return r?Hs:l;let k=`${x}__${l}`;Bs(f)||(k=`${k}__${JSON.stringify(f)}`);let C=a.get(k);return C||(C=new Intl.NumberFormat(x,Le({},A,f)),a.set(k,C)),y?C.formatToParts(c):C.format(c)}const rp=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function ll(...t){const[e,n,r,o]=t,s=ce();let i=ce();if(!Ae(e))throw Ut(Ye.INVALID_ARGUMENT);const a=e;return j(n)?s.key=n:te(n)&&Object.keys(n).forEach(l=>{rp.includes(l)?i[l]=n[l]:s[l]=n[l]}),j(r)?s.locale=r:te(r)&&(i=r),te(o)&&(i=o),[s.key||"",a,s,i]}function op(t,e,n){const r=t;for(const o in n){const s=`${e}__${o}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}const Yv=t=>t,Xv=t=>"",Qv="text",Zv=t=>t.length===0?"":Ya(t),e3=OC;function sp(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function t3(t){const e=Ae(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Ae(t.named.count)||Ae(t.named.n))?Ae(t.named.count)?t.named.count:Ae(t.named.n)?t.named.n:e:e}function n3(t,e){e.count||(e.count=t),e.n||(e.n=t)}function r3(t={}){const e=t.locale,n=t3(t),r=ne(t.pluralRules)&&j(e)&&ue(t.pluralRules[e])?t.pluralRules[e]:sp,o=ne(t.pluralRules)&&j(e)&&ue(t.pluralRules[e])?sp:void 0,s=_=>_[r(n,_.length,o)],i=t.list||[],a=_=>i[_],l=t.named||ce();Ae(t.pluralIndex)&&n3(n,l);const c=_=>l[_];function d(_,x){const A=ue(t.messages)?t.messages(_,!!x):ne(t.messages)?t.messages[_]:!1;return A||(t.parent?t.parent.message(_):Xv)}const f=_=>t.modifiers?t.modifiers[_]:Yv,h=te(t.processor)&&ue(t.processor.normalize)?t.processor.normalize:Zv,m=te(t.processor)&&ue(t.processor.interpolate)?t.processor.interpolate:e3,y=te(t.processor)&&j(t.processor.type)?t.processor.type:Qv,E={list:a,named:c,plural:s,linked:(_,...x)=>{const[A,u]=x;let b="text",g="";x.length===1?ne(A)?(g=A.modifier||g,b=A.type||b):j(A)&&(g=A||g):x.length===2&&(j(A)&&(g=A||g),j(u)&&(b=u||b));const k=d(_,!0)(E),C=b==="vnode"&&ke(k)&&g?k[0]:k;return g?f(g)(C,b):C},message:d,type:y,interpolate:m,normalize:h,values:Le(ce(),i,l)};return E}const ip=()=>"",gt=t=>ue(t);function ap(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:s,fallbackLocale:i,messages:a}=t,[l,c]=cl(...e),d=re(c.missingWarn)?c.missingWarn:t.missingWarn,f=re(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,h=re(c.escapeParameter)?c.escapeParameter:t.escapeParameter,m=!!c.resolvedMessage,y=j(c.default)||re(c.default)?re(c.default)?s?l:()=>l:c.default:n?s?l:()=>l:null,w=n||y!=null&&(j(y)||ue(y)),E=rl(t,c);h&&o3(c);let[_,x,A]=m?[l,E,a[E]||ce()]:lp(t,l,E,i,f,d),u=_,b=l;if(!m&&!(j(u)||mt(u)||gt(u))&&w&&(u=y,b=u),!m&&(!(j(u)||mt(u)||gt(u))||!j(x)))return o?Hs:l;if(process.env.NODE_ENV!=="production"&&j(u)&&t.messageCompiler==null)return At(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${l}'.`),l;let g=!1;const k=()=>{g=!0},C=gt(u)?u:cp(t,l,x,u,b,k);if(g)return u;const T=l3(t,x,A,c),v=r3(T),O=s3(t,C,v);let R=r?r(O,l):O;if(h&&j(R)&&(R=NC(R)),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const B={timestamp:Date.now(),key:j(l)?l:gt(u)?u.key:"",locale:x||(gt(u)?u.locale:""),format:j(u)?u:gt(u)?u.source:"",message:R};B.meta=Le({},t.__meta,Kv()||{}),Cv(B)}return R}function o3(t){ke(t.list)?t.list=t.list.map(e=>j(e)?wh(e):e):ne(t.named)&&Object.keys(t.named).forEach(e=>{j(t.named[e])&&(t.named[e]=wh(t.named[e]))})}function lp(t,e,n,r,o,s){const{messages:i,onWarn:a,messageResolver:l,localeFallbacker:c}=t,d=c(t,r,n);let f=ce(),h,m=null,y=n,w=null;const E="translate";for(let _=0;_<d.length;_++){if(h=w=d[_],process.env.NODE_ENV!=="production"&&n!==h&&!Yh(n,h)&&Us(o,e)&&a(Fn(rt.FALLBACK_TO_TRANSLATE,{key:e,target:h})),process.env.NODE_ENV!=="production"&&n!==h){const b=t.__v_emitter;b&&b.emit("fallback",{type:E,key:e,from:y,to:w,groupId:`${E}:${e}`})}f=i[h]||ce();let x=null,A,u;if(process.env.NODE_ENV!=="production"&&Et&&(x=window.performance.now(),A="intlify-message-resolve-start",u="intlify-message-resolve-end",lt&<(A)),(m=l(f,e))===null&&(m=f[e]),process.env.NODE_ENV!=="production"&&Et){const b=window.performance.now(),g=t.__v_emitter;g&&x&&m&&g.emit("message-resolve",{type:"message-resolve",key:e,message:m,time:b-x,groupId:`${E}:${e}`}),A&&u&<&&Dn&&(lt(u),Dn("intlify message resolve",A,u))}if(j(m)||mt(m)||gt(m))break;if(!Jv(h,d)){const b=il(t,e,h,s,E);b!==e&&(m=b)}y=w}return[m,h,f]}function cp(t,e,n,r,o,s){const{messageCompiler:i,warnHtmlMessage:a}=t;if(gt(r)){const h=r;return h.locale=h.locale||n,h.key=h.key||e,h}if(i==null){const h=(()=>r);return h.locale=n,h.key=e,h}let l=null,c,d;process.env.NODE_ENV!=="production"&&Et&&(l=window.performance.now(),c="intlify-message-compilation-start",d="intlify-message-compilation-end",lt&<(c));const f=i(r,i3(t,n,o,r,a,s));if(process.env.NODE_ENV!=="production"&&Et){const h=window.performance.now(),m=t.__v_emitter;m&&l&&m.emit("message-compilation",{type:"message-compilation",message:r,time:h-l,groupId:`translate:${e}`}),c&&d&<&&Dn&&(lt(d),Dn("intlify message compilation",c,d))}return f.locale=n,f.key=e,f.source=r,f}function s3(t,e,n){let r=null,o,s;process.env.NODE_ENV!=="production"&&Et&&(r=window.performance.now(),o="intlify-message-evaluation-start",s="intlify-message-evaluation-end",lt&<(o));const i=e(n);if(process.env.NODE_ENV!=="production"&&Et){const a=window.performance.now(),l=t.__v_emitter;l&&r&&l.emit("message-evaluation",{type:"message-evaluation",value:i,time:a-r,groupId:`translate:${e.key}`}),o&&s&<&&Dn&&(lt(s),Dn("intlify message evaluation",o,s))}return i}function cl(...t){const[e,n,r]=t,o=ce();if(!j(e)&&!Ae(e)&&!gt(e)&&!mt(e))throw Ut(Ye.INVALID_ARGUMENT);const s=Ae(e)?String(e):(gt(e),e);return Ae(n)?o.plural=n:j(n)?o.default=n:te(n)&&!Bs(n)?o.named=n:ke(n)&&(o.list=n),Ae(r)?o.plural=r:j(r)?o.default=r:te(r)&&Le(o,r),[s,o]}function i3(t,e,n,r,o,s){return{locale:e,key:n,warnHtmlMessage:o,onError:i=>{if(s&&s(i),process.env.NODE_ENV!=="production"){const a=a3(r),l=`Message compilation error: ${i.message}`,c=i.location&&a&&LC(a,i.location.start.offset,i.location.end.offset),d=t.__v_emitter;d&&a&&d.emit("compile-error",{message:a,error:i.message,start:i.location&&i.location.start.offset,end:i.location&&i.location.end.offset,groupId:`translate:${n}`}),console.error(c?`${l}
|
|
309
|
+
${c}`:l)}else throw i},onCacheKey:i=>vC(e,n,i)}}function a3(t){if(j(t))return t;if(t.loc&&t.loc.source)return t.loc.source}function l3(t,e,n,r){const{modifiers:o,pluralRules:s,messageResolver:i,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:d}=t,h={locale:e,modifiers:o,pluralRules:s,messages:(m,y)=>{let w=i(n,m);if(w==null&&(d||y)){const[,,E]=lp(d||t,m,e,a,l,c);w=i(E,m)}if(j(w)||mt(w)){let E=!1;const x=cp(t,m,e,w,m,()=>{E=!0});return E?ip:x}else return gt(w)?w:ip}};return t.processor&&(h.processor=t.processor),r.list&&(h.list=r.list),r.named&&(h.named=r.named),Ae(r.plural)&&(h.pluralIndex=r.plural),h}lv();function c3(){return dp().__VUE_DEVTOOLS_GLOBAL_HOOK__}function dp(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const d3=typeof Proxy=="function",u3="devtools-plugin:setup",f3="plugin:settings:set";let ur,dl;function h3(){var t;return ur!==void 0||(typeof window<"u"&&window.performance?(ur=!0,dl=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(ur=!0,dl=globalThis.perf_hooks.performance):ur=!1),ur}function p3(){return h3()?dl.now():Date.now()}class m3{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const i in e.settings){const a=e.settings[i];r[i]=a.defaultValue}const o=`__vue-devtools-plugin-settings__${e.id}`;let s=Object.assign({},r);try{const i=localStorage.getItem(o),a=JSON.parse(i);Object.assign(s,a)}catch{}this.fallbacks={getSettings(){return s},setSettings(i){try{localStorage.setItem(o,JSON.stringify(i))}catch{}s=i},now(){return p3()}},n&&n.on(f3,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function g3(t,e){const n=t,r=dp(),o=c3(),s=d3&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(u3,t,e);else{const i=s?new m3(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:i}),i&&e(i.proxiedTarget)}}/*!
|
|
310
|
+
* vue-i18n v11.1.12
|
|
311
|
+
* (c) 2025 kazuya kawaguchi
|
|
312
|
+
* Released under the MIT License.
|
|
313
|
+
*/const b3="11.1.12";function y3(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Bn().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Bn().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Bn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Bn().__INTLIFY_PROD_DEVTOOLS__=!1)}const pe={UNEXPECTED_RETURN_TYPE:Sv,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function ot(t,...e){return lr(t,null,process.env.NODE_ENV!=="production"?{messages:k3,args:e}:void 0)}const k3={[pe.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[pe.INVALID_ARGUMENT]:"Invalid argument",[pe.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[pe.NOT_INSTALLED]:"Need to install with `app.use` function",[pe.UNEXPECTED_ERROR]:"Unexpected error",[pe.REQUIRED_VALUE]:"Required in value: {0}",[pe.INVALID_VALUE]:"Invalid value",[pe.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[pe.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[pe.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[pe.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},ul=Ot("__translateVNode"),fl=Ot("__datetimeParts"),hl=Ot("__numberParts"),Vn=Ot("__enableEmitter"),eo=Ot("__disableEmitter"),up=Ot("__setPluralRules"),fp=Ot("__injectWithOption"),pl=Ot("__dispose"),bt={FALLBACK_TO_ROOT:Fv,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12,DUPLICATE_USE_I18N_CALLING:13},w3={[bt.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[bt.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[bt.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[bt.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead.
|
|
314
|
+
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[bt.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.",[bt.DUPLICATE_USE_I18N_CALLING]:"Duplicate `useI18n` calling by local scope. Please don't call it on local scope, due to it does not work properly in component."};function fr(t,...e){return Ds(w3[t],...e)}function to(t){if(!ne(t)||mt(t))return t;for(const e in t)if(Ct(t,e))if(!e.includes("."))ne(t[e])&&to(t[e]);else{const n=e.split("."),r=n.length-1;let o=t,s=!1;for(let i=0;i<r;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in o||(o[n[i]]=ce()),!ne(o[n[i]])){process.env.NODE_ENV!=="production"&&At(fr(bt.IGNORE_OBJ_FLATTEN,{key:n[i]})),s=!0;break}o=o[n[i]]}if(s||(mt(o)?Rh.includes(n[r])||delete t[e]:(o[n[r]]=t[e],delete t[e])),!mt(o)){const i=o[n[r]];ne(i)&&to(i)}}return t}function ml(t,e){const{messages:n,__i18n:r,messageResolver:o,flatJson:s}=e,i=te(n)?n:ke(r)?ce():{[t]:ce()};if(ke(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(i[l]=i[l]||ce(),Vs(c,i[l])):Vs(c,i)}else j(a)&&Vs(JSON.parse(a),i)}),o==null&&s)for(const a in i)Ct(i,a)&&to(i[a]);return i}function hp(t){return t.type}function pp(t,e,n){let r=ne(e.messages)?e.messages:ce();"__i18nGlobal"in n&&(r=ml(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(ne(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(i=>{t.mergeDateTimeFormat(i,e.datetimeFormats[i])})}if(ne(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(i=>{t.mergeNumberFormat(i,e.numberFormats[i])})}}}function mp(t){return p.createVNode(p.Text,null,t,0)}const gp="__INTLIFY_META__",bp=()=>[],_3=()=>!1;let yp=0;function kp(t){return((e,n,r,o)=>t(n,r,p.getCurrentInstance()||void 0,o))}const E3=()=>{const t=p.getCurrentInstance();let e=null;return t&&(e=hp(t)[gp])?{[gp]:e}:null};function gl(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,o=t.flatJson,s=Et?p.ref:p.shallowRef;let i=re(t.inheritLocale)?t.inheritLocale:!0;const a=s(e&&i?e.locale.value:j(t.locale)?t.locale:Qr),l=s(e&&i?e.fallbackLocale.value:j(t.fallbackLocale)||ke(t.fallbackLocale)||te(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:a.value),c=s(ml(a.value,t)),d=s(te(t.datetimeFormats)?t.datetimeFormats:{[a.value]:{}}),f=s(te(t.numberFormats)?t.numberFormats:{[a.value]:{}});let h=e?e.missingWarn:re(t.missingWarn)||ar(t.missingWarn)?t.missingWarn:!0,m=e?e.fallbackWarn:re(t.fallbackWarn)||ar(t.fallbackWarn)?t.fallbackWarn:!0,y=e?e.fallbackRoot:re(t.fallbackRoot)?t.fallbackRoot:!0,w=!!t.fallbackFormat,E=ue(t.missing)?t.missing:null,_=ue(t.missing)?kp(t.missing):null,x=ue(t.postTranslation)?t.postTranslation:null,A=e?e.warnHtmlMessage:re(t.warnHtmlMessage)?t.warnHtmlMessage:!0,u=!!t.escapeParameter;const b=e?e.modifiers:te(t.modifiers)?t.modifiers:{};let g=t.pluralRules||e&&e.pluralRules,k;k=(()=>{r&&Gh(null);const L={version:b3,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:b,pluralRules:g,missing:_===null?void 0:_,missingWarn:h,fallbackWarn:m,fallbackFormat:w,unresolving:!0,postTranslation:x===null?void 0:x,warnHtmlMessage:A,escapeParameter:u,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};L.datetimeFormats=d.value,L.numberFormats=f.value,L.__datetimeFormatters=te(k)?k.__datetimeFormatters:void 0,L.__numberFormatters=te(k)?k.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(L.__v_emitter=te(k)?k.__v_emitter:void 0);const z=qv(L);return r&&Gh(z),z})(),Zr(k,a.value,l.value);function T(){return[a.value,l.value,c.value,d.value,f.value]}const v=p.computed({get:()=>a.value,set:L=>{k.locale=L,a.value=L}}),O=p.computed({get:()=>l.value,set:L=>{k.fallbackLocale=L,l.value=L,Zr(k,a.value,L)}}),R=p.computed(()=>c.value),B=p.computed(()=>d.value),D=p.computed(()=>f.value);function V(){return ue(x)?x:null}function S(L){x=L,k.postTranslation=L}function P(){return E}function U(L){L!==null&&(_=kp(L)),E=L,k.missing=_}function K(L,z){return L!=="translate"||!z.resolvedMessage}const Z=(L,z,se,xe,jn,Ws)=>{T();let pr;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(k.fallbackContext=e?Gv():void 0),pr=L(k)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(k.fallbackContext=void 0)}if(se!=="translate exists"&&Ae(pr)&&pr===Hs||se==="translate exists"&&!pr){const[Un,oS]=z();if(process.env.NODE_ENV!=="production"&&e&&j(Un)&&K(se,oS)&&(y&&(Us(m,Un)||Jh(h,Un))&&At(fr(bt.FALLBACK_TO_ROOT,{key:Un,type:se})),process.env.NODE_ENV!=="production")){const{__v_emitter:Ip}=k;Ip&&y&&Ip.emit("fallback",{type:se,key:Un,to:"global",groupId:`${se}:${Un}`})}return e&&y?xe(e):jn(Un)}else{if(Ws(pr))return pr;throw ot(pe.UNEXPECTED_RETURN_TYPE)}};function G(...L){return Z(z=>Reflect.apply(ap,null,[z,...L]),()=>cl(...L),"translate",z=>Reflect.apply(z.t,z,[...L]),z=>z,z=>j(z))}function Oe(...L){const[z,se,xe]=L;if(xe&&!ne(xe))throw ot(pe.INVALID_ARGUMENT);return G(z,se,Le({resolvedMessage:!0},xe||{}))}function Fe(...L){return Z(z=>Reflect.apply(Zh,null,[z,...L]),()=>al(...L),"datetime format",z=>Reflect.apply(z.d,z,[...L]),()=>js,z=>j(z)||ke(z))}function et(...L){return Z(z=>Reflect.apply(np,null,[z,...L]),()=>ll(...L),"number format",z=>Reflect.apply(z.n,z,[...L]),()=>js,z=>j(z)||ke(z))}function Se(L){return L.map(z=>j(z)||Ae(z)||re(z)?mp(String(z)):z)}const $e={normalize:Se,interpolate:L=>L,type:"vnode"};function ze(...L){return Z(z=>{let se;const xe=z;try{xe.processor=$e,se=Reflect.apply(ap,null,[xe,...L])}finally{xe.processor=null}return se},()=>cl(...L),"translate",z=>z[ul](...L),z=>[mp(z)],z=>ke(z))}function $n(...L){return Z(z=>Reflect.apply(np,null,[z,...L]),()=>ll(...L),"number format",z=>z[hl](...L),bp,z=>j(z)||ke(z))}function gn(...L){return Z(z=>Reflect.apply(Zh,null,[z,...L]),()=>al(...L),"datetime format",z=>z[fl](...L),bp,z=>j(z)||ke(z))}function hr(L){g=L,k.pluralRules=g}function zn(L,z){return Z(()=>{if(!L)return!1;const se=j(z)?z:a.value,xe=Hn(se),jn=k.messageResolver(xe,L);return mt(jn)||gt(jn)||j(jn)},()=>[L],"translate exists",se=>Reflect.apply(se.te,se,[L,z]),_3,se=>re(se))}function bn(L){let z=null;const se=Fh(k,l.value,a.value);for(let xe=0;xe<se.length;xe++){const jn=c.value[se[xe]]||{},Ws=k.messageResolver(jn,L);if(Ws!=null){z=Ws;break}}return z}function ro(L){const z=bn(L);return z??(e?e.tm(L)||{}:{})}function Hn(L){return c.value[L]||{}}function oo(L,z){if(o){const se={[L]:z};for(const xe in se)Ct(se,xe)&&to(se[xe]);z=se[L]}c.value[L]=z,k.messages=c.value}function vl(L,z){c.value[L]=c.value[L]||{};const se={[L]:z};if(o)for(const xe in se)Ct(se,xe)&&to(se[xe]);z=se[L],Vs(z,c.value[L]),k.messages=c.value}function N(L){return d.value[L]||{}}function M(L,z){d.value[L]=z,k.datetimeFormats=d.value,tp(k,L,z)}function F(L,z){d.value[L]=Le(d.value[L]||{},z),k.datetimeFormats=d.value,tp(k,L,z)}function W(L){return f.value[L]||{}}function be(L,z){f.value[L]=z,k.numberFormats=f.value,op(k,L,z)}function Te(L,z){f.value[L]=Le(f.value[L]||{},z),k.numberFormats=f.value,op(k,L,z)}yp++,e&&Et&&(p.watch(e.locale,L=>{i&&(a.value=L,k.locale=L,Zr(k,a.value,l.value))}),p.watch(e.fallbackLocale,L=>{i&&(l.value=L,k.fallbackLocale=L,Zr(k,a.value,l.value))}));const oe={id:yp,locale:v,fallbackLocale:O,get inheritLocale(){return i},set inheritLocale(L){i=L,L&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,Zr(k,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:R,get modifiers(){return b},get pluralRules(){return g||{}},get isGlobal(){return r},get missingWarn(){return h},set missingWarn(L){h=L,k.missingWarn=h},get fallbackWarn(){return m},set fallbackWarn(L){m=L,k.fallbackWarn=m},get fallbackRoot(){return y},set fallbackRoot(L){y=L},get fallbackFormat(){return w},set fallbackFormat(L){w=L,k.fallbackFormat=w},get warnHtmlMessage(){return A},set warnHtmlMessage(L){A=L,k.warnHtmlMessage=L},get escapeParameter(){return u},set escapeParameter(L){u=L,k.escapeParameter=L},t:G,getLocaleMessage:Hn,setLocaleMessage:oo,mergeLocaleMessage:vl,getPostTranslationHandler:V,setPostTranslationHandler:S,getMissingHandler:P,setMissingHandler:U,[up]:hr};return oe.datetimeFormats=B,oe.numberFormats=D,oe.rt=Oe,oe.te=zn,oe.tm=ro,oe.d=Fe,oe.n=et,oe.getDateTimeFormat=N,oe.setDateTimeFormat=M,oe.mergeDateTimeFormat=F,oe.getNumberFormat=W,oe.setNumberFormat=be,oe.mergeNumberFormat=Te,oe[fp]=n,oe[ul]=ze,oe[fl]=gn,oe[hl]=$n,process.env.NODE_ENV!=="production"&&(oe[Vn]=L=>{k.__v_emitter=L},oe[eo]=()=>{k.__v_emitter=void 0}),oe}const wp="vue-i18n: composer properties",bl={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},C3={"vue-i18n-resource-inspector":"Search for scopes ..."},v3={"vue-i18n-timeline":16764185};let yl;async function S3(t,e){return new Promise((n,r)=>{try{g3({id:"vue-devtools-plugin-vue-i18n",label:bl["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[wp],app:t},o=>{yl=o,o.on.visitComponentTree(({componentInstance:i,treeNode:a})=>{T3(i,a,e)}),o.on.inspectComponent(({componentInstance:i,instanceData:a})=>{i.vnode.el&&i.vnode.el.__VUE_I18N__&&a&&(e.mode==="legacy"?i.vnode.el.__VUE_I18N__!==e.global.__composer&&Ep(a,i.vnode.el.__VUE_I18N__):Ep(a,i.vnode.el.__VUE_I18N__))}),o.addInspector({id:"vue-i18n-resource-inspector",label:bl["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:C3["vue-i18n-resource-inspector"]}),o.on.getInspectorTree(i=>{i.app===t&&i.inspectorId==="vue-i18n-resource-inspector"&&O3(i,e)});const s=new Map;o.on.getInspectorState(async i=>{if(i.app===t&&i.inspectorId==="vue-i18n-resource-inspector")if(o.unhighlightElement(),I3(i,e),i.nodeId==="global"){if(!s.has(i.app)){const[a]=await o.getComponentInstances(i.app);s.set(i.app,a)}o.highlightElement(s.get(i.app))}else{const a=L3(i.nodeId,e);a&&o.highlightElement(a)}}),o.on.editInspectorState(i=>{i.app===t&&i.inspectorId==="vue-i18n-resource-inspector"&&R3(i,e)}),o.addTimelineLayer({id:"vue-i18n-timeline",label:bl["vue-i18n-timeline"],color:v3["vue-i18n-timeline"]}),n(!0)})}catch(o){console.error(o),r(!1)}})}function _p(t){return t.type.name||t.type.displayName||t.type.__file||"Anonymous"}function T3(t,e,n){const r=n.mode==="composition"?n.global:n.global.__composer;if(t&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&t.vnode.el.__VUE_I18N__!==r){const o={label:`i18n (${_p(t)} Scope)`,textColor:0,backgroundColor:16764185};e.tags.push(o)}}function Ep(t,e){const n=wp;t.state.push({type:n,key:"locale",editable:!0,value:e.locale.value}),t.state.push({type:n,key:"availableLocales",editable:!1,value:e.availableLocales}),t.state.push({type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value}),t.state.push({type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}),t.state.push({type:n,key:"messages",editable:!1,value:kl(e.messages.value)}),t.state.push({type:n,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}),t.state.push({type:n,key:"numberFormats",editable:!1,value:e.numberFormats.value})}function kl(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];ue(r)&&"source"in r?e[n]=A3(r):mt(r)&&r.loc&&r.loc.source?e[n]=r.loc.source:ne(r)?e[n]=kl(r):e[n]=r}),e}const x3={"<":"<",">":">",'"':""","&":"&"};function N3(t){return t.replace(/[<>"&]/g,M3)}function M3(t){return x3[t]||t}function A3(t){return{_custom:{type:"function",display:`<span>ƒ</span> ${t.source?`("${N3(t.source)}")`:"(?)"}`}}}function O3(t,e){t.rootNodes.push({id:"global",label:"Global Scope"});const n=e.mode==="composition"?e.global:e.global.__composer;for(const[r,o]of e.__instances){const s=e.mode==="composition"?o:o.__composer;n!==s&&t.rootNodes.push({id:s.id.toString(),label:`${_p(r)} Scope`})}}function L3(t,e){let n=null;if(t!=="global"){for(const[r,o]of e.__instances.entries())if(o.id.toString()===t){n=r;break}}return n}function Cp(t,e){if(t==="global")return e.mode==="composition"?e.global:e.global.__composer;{const n=Array.from(e.__instances.values()).find(r=>r.id.toString()===t);return n?e.mode==="composition"?n:n.__composer:null}}function I3(t,e){const n=Cp(t.nodeId,e);return n&&(t.state=P3(n)),null}function P3(t){const e={},n="Locale related info",r=[{type:n,key:"locale",editable:!0,value:t.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:t.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}];e[n]=r;const o="Locale messages info",s=[{type:o,key:"messages",editable:!1,value:kl(t.messages.value)}];e[o]=s;{const i="Datetime formats info",a=[{type:i,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}];e[i]=a;const l="Datetime formats info",c=[{type:l,key:"numberFormats",editable:!1,value:t.numberFormats.value}];e[l]=c}return e}function no(t,e){if(yl){let n;e&&"groupId"in e&&(n=e.groupId,delete e.groupId),yl.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:t,groupId:n,time:Date.now(),meta:{},data:e||{},logType:t==="compile-error"?"error":t==="fallback"||t==="missing"?"warning":"default"}})}}function R3(t,e){const n=Cp(t.nodeId,e);if(n){const[r]=t.path;r==="locale"&&j(t.state.value)?n.locale.value=t.state.value:r==="fallbackLocale"&&(j(t.state.value)||ke(t.state.value)||ne(t.state.value))?n.fallbackLocale.value=t.state.value:r==="inheritLocale"&&re(t.state.value)&&(n.inheritLocale=t.state.value)}}function D3(t){const e=j(t.locale)?t.locale:Qr,n=j(t.fallbackLocale)||ke(t.fallbackLocale)||te(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=ue(t.missing)?t.missing:void 0,o=re(t.silentTranslationWarn)||ar(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=re(t.silentFallbackWarn)||ar(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,i=re(t.fallbackRoot)?t.fallbackRoot:!0,a=!!t.formatFallbackMessages,l=te(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,d=ue(t.postTranslation)?t.postTranslation:void 0,f=j(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,h=!!t.escapeParameterHtml,m=re(t.sync)?t.sync:!0;let y=t.messages;if(te(t.sharedMessages)){const b=t.sharedMessages;y=Object.keys(b).reduce((k,C)=>{const T=k[C]||(k[C]={});return Le(T,b[C]),k},y||{})}const{__i18n:w,__root:E,__injectWithOption:_}=t,x=t.datetimeFormats,A=t.numberFormats,u=t.flatJson;return{locale:e,fallbackLocale:n,messages:y,flatJson:u,datetimeFormats:x,numberFormats:A,missing:r,missingWarn:o,fallbackWarn:s,fallbackRoot:i,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:d,warnHtmlMessage:f,escapeParameter:h,messageResolver:t.messageResolver,inheritLocale:m,__i18n:w,__root:E,__injectWithOption:_}}function wl(t={}){const e=gl(D3(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(o){e.locale.value=o},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(o){e.fallbackLocale.value=o},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(o){e.setMissingHandler(o)},get silentTranslationWarn(){return re(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(o){e.missingWarn=re(o)?!o:o},get silentFallbackWarn(){return re(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(o){e.fallbackWarn=re(o)?!o:o},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(o){e.fallbackFormat=o},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(o){e.setPostTranslationHandler(o)},get sync(){return e.inheritLocale},set sync(o){e.inheritLocale=o},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){e.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(o){e.escapeParameter=o},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...o){return Reflect.apply(e.t,e,[...o])},rt(...o){return Reflect.apply(e.rt,e,[...o])},te(o,s){return e.te(o,s)},tm(o){return e.tm(o)},getLocaleMessage(o){return e.getLocaleMessage(o)},setLocaleMessage(o,s){e.setLocaleMessage(o,s)},mergeLocaleMessage(o,s){e.mergeLocaleMessage(o,s)},d(...o){return Reflect.apply(e.d,e,[...o])},getDateTimeFormat(o){return e.getDateTimeFormat(o)},setDateTimeFormat(o,s){e.setDateTimeFormat(o,s)},mergeDateTimeFormat(o,s){e.mergeDateTimeFormat(o,s)},n(...o){return Reflect.apply(e.n,e,[...o])},getNumberFormat(o){return e.getNumberFormat(o)},setNumberFormat(o,s){e.setNumberFormat(o,s)},mergeNumberFormat(o,s){e.mergeNumberFormat(o,s)}};return r.__extender=n,process.env.NODE_ENV!=="production"&&(r.__enableEmitter=o=>{const s=e;s[Vn]&&s[Vn](o)},r.__disableEmitter=()=>{const o=e;o[eo]&&o[eo]()}),r}function B3(t,e,n){return{beforeCreate(){const r=p.getCurrentInstance();if(!r)throw ot(pe.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=e,this===this.$root)this.$i18n=vp(t,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=wl(s);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=vp(t,o);else{this.$i18n=wl({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;o.__i18nGlobal&&pp(e,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,i)=>this.$i18n.te(s,i),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const r=this.$i18n;this.$el.__VUE_I18N__=r.__composer;const o=this.__v_emitter=Xa();r.__enableEmitter&&r.__enableEmitter(o),o.on("*",no)}},unmounted(){const r=p.getCurrentInstance();if(!r)throw ot(pe.UNEXPECTED_ERROR);const o=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",no),delete this.__v_emitter),this.$i18n&&(o.__disableEmitter&&o.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(r),delete this.$i18n}}}function vp(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[up](e.pluralizationRules||t.pluralizationRules);const n=ml(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const _l={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function F3({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,o)=>[...r,...o.type===p.Fragment?o.children:[o]],[]):e.reduce((n,r)=>{const o=t[r];return o&&(n[r]=o()),n},ce())}function Sp(){return p.Fragment}const Tp=p.defineComponent({name:"i18n-t",props:Le({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Ae(t)||!isNaN(t)}},_l),setup(t,e){const{slots:n,attrs:r}=e,o=t.i18n||El({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(f=>f[0]!=="_"),i=ce();t.locale&&(i.locale=t.locale),t.plural!==void 0&&(i.plural=j(t.plural)?+t.plural:t.plural);const a=F3(e,s),l=o[ul](t.keypath,a,i),c=Le(ce(),r),d=j(t.tag)||ne(t.tag)?t.tag:Sp();return p.h(d,c,l)}}});function V3(t){return ke(t)&&!j(t[0])}function xp(t,e,n,r){const{slots:o,attrs:s}=e;return()=>{const i={part:!0};let a=ce();t.locale&&(i.locale=t.locale),j(t.format)?i.key=t.format:ne(t.format)&&(j(t.format.key)&&(i.key=t.format.key),a=Object.keys(t.format).reduce((h,m)=>n.includes(m)?Le(ce(),h,{[m]:t.format[m]}):h,ce()));const l=r(t.value,i,a);let c=[i.key];ke(l)?c=l.map((h,m)=>{const y=o[h.type],w=y?y({[h.type]:h.value,index:m,parts:l}):[h.value];return V3(w)&&(w[0].key=`${h.type}-${m}`),w}):j(l)&&(c=[l]);const d=Le(ce(),s),f=j(t.tag)||ne(t.tag)?t.tag:Sp();return p.h(f,d,c)}}const Np=p.defineComponent({name:"i18n-n",props:Le({value:{type:Number,required:!0},format:{type:[String,Object]}},_l),setup(t,e){const n=t.i18n||El({useScope:t.scope,__useComponent:!0});return xp(t,e,rp,(...r)=>n[hl](...r))}});function $3(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function z3(t){const e=i=>{process.env.NODE_ENV!=="production"&&qa(fr(bt.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:a,value:l}=i;if(!a||!a.$)throw ot(pe.UNEXPECTED_ERROR);const c=$3(t,a.$),d=Mp(l);return[Reflect.apply(c.t,c,[...Ap(d)]),c]};return{created:(i,a)=>{const[l,c]=e(a);Et&&t.global===c&&(i.__i18nWatcher=p.watch(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),i.__composer=c,i.textContent=l},unmounted:i=>{Et&&i.__i18nWatcher&&(i.__i18nWatcher(),i.__i18nWatcher=void 0,delete i.__i18nWatcher),i.__composer&&(i.__composer=void 0,delete i.__composer)},beforeUpdate:(i,{value:a})=>{if(i.__composer){const l=i.__composer,c=Mp(a);i.textContent=Reflect.apply(l.t,l,[...Ap(c)])}},getSSRProps:i=>{const[a]=e(i);return{textContent:a}}}}function Mp(t){if(j(t))return{path:t};if(te(t)){if(!("path"in t))throw ot(pe.REQUIRED_VALUE,"path");return t}else throw ot(pe.INVALID_VALUE)}function Ap(t){const{path:e,locale:n,args:r,choice:o,plural:s}=t,i={},a=r||{};return j(n)&&(i.locale=n),Ae(o)&&(i.plural=o),Ae(s)&&(i.plural=s),[e,a,i]}function H3(t,e,...n){const r=te(n[0])?n[0]:{};(re(r.globalInstall)?r.globalInstall:!0)&&([Tp.name,"I18nT"].forEach(s=>t.component(s,Tp)),[Np.name,"I18nN"].forEach(s=>t.component(s,Np)),[Lp.name,"I18nD"].forEach(s=>t.component(s,Lp))),t.directive("t",z3(e))}const j3=Ot("global-vue-i18n");function U3(t={}){const e=__VUE_I18N_LEGACY_API__&&re(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&e&&qa(fr(bt.DEPRECATE_LEGACY_MODE));const n=re(t.globalInjection)?t.globalInjection:!0,r=new Map,[o,s]=W3(t,e),i=Ot(process.env.NODE_ENV!=="production"?"vue-i18n":"");function a(f){return r.get(f)||null}function l(f,h){r.set(f,h)}function c(f){r.delete(f)}const d={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(f,...h){if(process.env.NODE_ENV!=="production"&&(f.__VUE_I18N__=d),f.__VUE_I18N_SYMBOL__=i,f.provide(f.__VUE_I18N_SYMBOL__,d),te(h[0])){const w=h[0];d.__composerExtend=w.__composerExtend,d.__vueI18nExtend=w.__vueI18nExtend}let m=null;!e&&n&&(m=Z3(f,d.global)),__VUE_I18N_FULL_INSTALL__&&H3(f,d,...h),__VUE_I18N_LEGACY_API__&&e&&f.mixin(B3(s,s.__composer,d));const y=f.unmount;if(f.unmount=()=>{m&&m(),d.dispose(),y()},process.env.NODE_ENV!=="production"){if(!await S3(f,d))throw ot(pe.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const E=Xa();if(e){const _=s;_.__enableEmitter&&_.__enableEmitter(E)}else{const _=s;_[Vn]&&_[Vn](E)}E.on("*",no)}},get global(){return s},dispose(){o.stop()},__instances:r,__getInstance:a,__setInstance:l,__deleteInstance:c};return d}function El(t={}){const e=p.getCurrentInstance();if(e==null)throw ot(pe.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw ot(pe.NOT_INSTALLED);const n=K3(e),r=q3(n),o=hp(e),s=G3(t,o);if(s==="global")return pp(r,t,o),r;if(s==="parent"){let l=J3(n,e,t.__useComponent);return l==null&&(process.env.NODE_ENV!=="production"&&At(fr(bt.NOT_FOUND_PARENT_SCOPE)),l=r),l}const i=n;let a=i.__getInstance(e);if(a==null){const l=Le({},t);"__i18n"in o&&(l.__i18n=o.__i18n),r&&(l.__root=r),a=gl(l),i.__composerExtend&&(a[pl]=i.__composerExtend(a)),X3(i,e,a),i.__setInstance(e,a)}else process.env.NODE_ENV!=="production"&&s==="local"&&At(fr(bt.DUPLICATE_USE_I18N_CALLING));return a}function W3(t,e){const n=p.effectScope(),r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>wl(t)):n.run(()=>gl(t));if(r==null)throw ot(pe.UNEXPECTED_ERROR);return[n,r]}function K3(t){const e=p.inject(t.isCE?j3:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw ot(t.isCE?pe.NOT_INSTALLED_WITH_PROVIDE:pe.UNEXPECTED_ERROR);return e}function G3(t,e){return Bs(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function q3(t){return t.mode==="composition"?t.global:t.global.__composer}function J3(t,e,n=!1){let r=null;const o=e.root;let s=Y3(e,n);for(;s!=null;){const i=t;if(t.mode==="composition")r=i.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const a=i.__getInstance(s);a!=null&&(r=a.__composer,n&&r&&!r[fp]&&(r=null))}if(r!=null||o===s)break;s=s.parent}return r}function Y3(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function X3(t,e,n){let r=null;p.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=Xa();const o=n;o[Vn]&&o[Vn](r),r.on("*",no)}},e),p.onUnmounted(()=>{const o=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",no),o[eo]&&o[eo](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const s=o[pl];s&&(s(),delete o[pl])},e)}const Q3=["locale","fallbackLocale","availableLocales"],Op=["t","rt","d","n","tm","te"];function Z3(t,e){const n=Object.create(null);return Q3.forEach(o=>{const s=Object.getOwnPropertyDescriptor(e,o);if(!s)throw ot(pe.UNEXPECTED_ERROR);const i=p.isRef(s.value)?{get(){return s.value.value},set(a){s.value.value=a}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,o,i)}),t.config.globalProperties.$i18n=n,Op.forEach(o=>{const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!s.value)throw ot(pe.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${o}`,s)}),()=>{delete t.config.globalProperties.$i18n,Op.forEach(o=>{delete t.config.globalProperties[`$${o}`]})}}const Lp=p.defineComponent({name:"i18n-d",props:Le({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},_l),setup(t,e){const n=t.i18n||El({useScope:t.scope,__useComponent:!0});return xp(t,e,ep,(...r)=>n[fl](...r))}});if(y3(),Hv(wv),jv(Bv),Uv(Fh),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=Bn();t.__INTLIFY__=!0,_v(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const eS={},tS={},nS={paragraph:"Paragraph",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",linkTitle:"Enter Link",create:"Create",cancel:"Cancel"},rS={paragraph:"Звичайний текст",heading1:"Заголовок 1",heading2:"Заголовок 2",heading3:"Заголовок 3",heading4:"Заголовок 4",heading5:"Заголовок 5",heading6:"Заголовок 6",createTable:"Створити таблицю",addColumn:"Додати колонку",addRow:"Додати рядок",deleteColumn:"Видалити колонку",deleteRow:"Видалити рядок",deleteTable:"Видалити таблицю",linkTitle:"Введіть посилання",create:"Створити",cancel:"Скасувати"},Cl=U3({legacy:!1,locale:"uk",fallbackLocale:"en",messages:{en:{...eS,tiptap:nS},uk:{...tS,tiptap:rS}}});return{install:(t,e={})=>{if(e.i18nConfig){const n=e.i18nConfig,r=Cl.global?.messages?.value||Cl.messages;r&&n.global?.messages?.value&&Object.keys(r).forEach(o=>{n.global.mergeLocaleMessage?n.global.mergeLocaleMessage(o,r[o]):n.global.setLocaleMessage(o,r[o])})}else t.use(Cl);t.component("vs-richtext",jE),t.component("vs-richtext-md",EC)}}}));
|