@yiitap/vue 1.0.1 → 1.0.2
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/dist/index.cjs +28 -28
- package/dist/index.js +27 -27
- package/dist/index.mjs +939 -939
- package/package.json +2 -2
- package/types/components/buttons/OLinkBtn.vue.d.ts +0 -2
- package/types/components/buttons/OTextColorDropdown.vue.d.ts +0 -2
- package/types/components/buttons/OTextFormatDropdown.vue.d.ts +0 -2
package/dist/index.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var wb=Object.defineProperty;var Eb=(n,e,t)=>e in n?wb(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var De=(n,e,t)=>Eb(n,typeof e!="symbol"?e+"":e,t);/**
|
|
2
2
|
* Copyright 2025 Yiitap
|
|
3
3
|
* @license MIT
|
|
4
|
-
**/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");function ht(n){this.content=n}ht.prototype={constructor:ht,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,o=r.find(n),i=r.content.slice();return o==-1?i.push(t||n,e):(i[o+1]=e,t&&(i[o]=t)),new ht(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ht(t)},addToStart:function(n,e){return new ht([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ht(t)},addBefore:function(n,e,t){var r=this.remove(e),o=r.content.slice(),i=r.find(n);return o.splice(i==-1?o.length:i,0,e,t),new ht(o)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ht.from(n),n.size?new ht(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ht.from(n),n.size?new ht(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ht.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ht.from=function(n){if(n instanceof ht)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ht(e)};function ff(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let o=n.child(r),i=e.child(r);if(o==i){t+=o.nodeSize;continue}if(!o.sameMarkup(i))return t;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)t++;return t}if(o.content.size||i.content.size){let s=ff(o.content,i.content,t+1);if(s!=null)return s}t+=o.nodeSize}}function hf(n,e,t,r){for(let o=n.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:t,b:r};let s=n.child(--o),a=e.child(--i),c=s.nodeSize;if(s==a){t-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let d=0,u=Math.min(s.text.length,a.text.length);for(;d<u&&s.text[s.text.length-d-1]==a.text[a.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let d=hf(s.content,a.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class S{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,o=0,i){for(let s=0,a=0;a<t;s++){let c=this.content[s],d=a+c.nodeSize;if(d>e&&r(c,o+a,i||null,s)!==!1&&c.content.size){let u=a+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,o+u)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,o){let i="",s=!0;return this.nodesBetween(e,t,(a,c)=>{let d=a.isText?a.text.slice(Math.max(e,c)-c,t-c):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=d},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(o[o.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new S(o,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],o=0;if(t>e)for(let i=0,s=0;s<t;i++){let a=this.content[i],c=s+a.nodeSize;c>e&&((s<e||c>t)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),o+=a.nodeSize),s=c}return new S(r,o)}cutByIndex(e,t){return e==t?S.empty:e==0&&t==this.content.length?this:new S(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let o=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return o[e]=t,new S(o,i)}addToStart(e){return new S([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new S(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let o=this.content[t];e(o,r,t),r+=o.nodeSize}}findDiffStart(e,t=0){return ff(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return hf(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Hi(0,e);if(e==this.size)return Hi(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||t>0?Hi(r+1,s):Hi(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,t){if(!t)return S.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new S(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return S.empty;let t,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)?(t||(t=e.slice(0,o)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new S(t||e,r)}static from(e){if(!e)return S.empty;if(e instanceof S)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new S([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}S.empty=new S([],0);const Ga={index:0,offset:0};function Hi(n,e){return Ga.index=n,Ga.offset=e,Ga}function Ns(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Ns(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Ns(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Be=class Dl{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,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))t||(t=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,o)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ns(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let o=r.create(t.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Dl.none;if(e instanceof Dl)return[e];let t=e.slice();return t.sort((r,o)=>r.type.rank-o.type.rank),t}};Be.none=[];class li extends Error{}class O{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=gf(this.content,e+this.openStart,t);return r&&new O(r,this.openStart,this.openEnd)}removeBetween(e,t){return new O(mf(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return O.empty;let r=t.openStart||0,o=t.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new O(S.fromJSON(e,t.content),r,o)}static maxOpen(e,t=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)o++;return new O(e,r,o)}}O.empty=new O(S.empty,0,0);function mf(n,e,t){let{index:r,offset:o}=n.findIndex(e),i=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(o==e||i.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(mf(i.content,e-o-1,t-o-1)))}function gf(n,e,t,r){let{index:o,offset:i}=n.findIndex(e),s=n.maybeChild(o);if(i==e||s.isText)return n.cut(0,e).append(t).append(n.cut(e));let a=gf(s.content,e-i-1,t);return a&&n.replaceChild(o,s.copy(a))}function Eb(n,e,t){if(t.openStart>n.depth)throw new li("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new li("Inconsistent open depths");return bf(n,e,t,0)}function bf(n,e,t,r){let o=n.index(r),i=n.node(r);if(o==e.index(r)&&r<n.depth-t.openStart){let s=bf(n,e,t,r+1);return i.copy(i.content.replaceChild(o,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,a=s.content;return Br(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=Cb(t,n);return Br(i,vf(n,s,a,e,r))}else return Br(i,Ts(n,e,r))}function yf(n,e){if(!e.type.compatibleContent(n.type))throw new li("Cannot join "+e.type.name+" onto "+n.type.name)}function Il(n,e,t){let r=n.node(t);return yf(r,e.node(t)),r}function Ir(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Yo(n,e,t,r){let o=(e||n).node(t),i=0,s=e?e.index(t):o.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Ir(n.nodeAfter,r),i++));for(let a=i;a<s;a++)Ir(o.child(a),r);e&&e.depth==t&&e.textOffset&&Ir(e.nodeBefore,r)}function Br(n,e){return n.type.checkContent(e),n.copy(e)}function vf(n,e,t,r,o){let i=n.depth>o&&Il(n,e,o+1),s=r.depth>o&&Il(t,r,o+1),a=[];return Yo(null,n,o,a),i&&s&&e.index(o)==t.index(o)?(yf(i,s),Ir(Br(i,vf(n,e,t,r,o+1)),a)):(i&&Ir(Br(i,Ts(n,e,o+1)),a),Yo(e,t,o,a),s&&Ir(Br(s,Ts(t,r,o+1)),a)),Yo(r,null,o,a),new S(a)}function Ts(n,e,t){let r=[];if(Yo(null,n,t,r),n.depth>t){let o=Il(n,e,t+1);Ir(Br(o,Ts(n,e,t+1)),r)}return Yo(e,null,t,r),new S(r)}function Cb(n,e){let t=e.depth-n.openStart,o=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)o=e.node(i).copy(S.from(o));return{start:o.resolveNoCache(n.openStart+t),end:o.resolveNoCache(o.content.size-n.openEnd-t)}}class ci{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(t);return r?e.child(t).cut(r):o}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],o=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Be.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),o=e.maybeChild(t);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 t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.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 t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Os(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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],o=0,i=t;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(i),d=i-c;if(r.push(s,a,o+c),!d||(s=s.child(a),s.isText))break;i=d-1,o+=c+1}return new ci(t,r,i)}static resolveCached(e,t){let r=Vd.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==t)return s}else Vd.set(e,r=new _b);let o=r.elts[r.i]=ci.resolve(e,t);return r.i=(r.i+1)%Sb,o}}class _b{constructor(){this.elts=[],this.i=0}}const Sb=12,Vd=new WeakMap;class Os{constructor(e,t,r){this.$from=e,this.$to=t,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 xb=Object.create(null);let fr=class Bl{constructor(e,t,r,o=Be.none){this.type=e,this.attrs=t,this.marks=o,this.content=r||S.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,o=0){this.content.nodesBetween(e,t,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,t,r,o){return this.content.textBetween(e,t,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,t,r){return this.type==e&&Ns(this.attrs,t||e.defaultAttrs||xb)&&Be.sameSet(this.marks,r||Be.none)}copy(e=null){return e==this.content?this:new Bl(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Bl(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return O.empty;let o=this.resolve(e),i=this.resolve(t),s=r?0:o.sharedDepth(t),a=o.start(s),d=o.node(s).content.cut(o.pos-a,i.pos-a);return new O(d,o.depth-s,i.depth-s)}replace(e,t,r){return Eb(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:o}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(o==e||t.isText)return t;e-=o+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let o=this.content.child(t-1);return{node:o,index:t-1,offset:r-o.nodeSize}}resolve(e){return ci.resolveCached(this,e)}resolveNoCache(e){return ci.resolve(this,e)}rangeHasMark(e,t,r){let o=!1;return t>e&&this.nodesBetween(e,t,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()+")"),kf(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=S.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let c=o;c<i;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,t);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=Be.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Be.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let o=S.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};fr.prototype.text=void 0;class Ms extends fr{constructor(e,t,r,o){if(super(e,t,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):kf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ms(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ms(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function kf(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Hr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Nb(e,t);if(r.next==null)return Hr.empty;let o=wf(r);r.next&&r.err("Unexpected trailing text");let i=Ib(Db(o));return Bb(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let o=this;for(let i=t;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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let o=[this];function i(s,a){let c=s.matchFragment(e,r);if(c&&(!t||c.validEnd))return S.from(a.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:p}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(p)==-1){o.push(p);let f=i(p,a.concat(u));if(f)return f}}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 t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=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:c}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!o.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),t[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 t(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&t(r.next[o].next)}return t(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(`
|
|
5
|
-
`)}}Hr.empty=new Hr(!0);class Nb{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function wf(n){let e=[];do e.push(Tb(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Tb(n){let e=[];do e.push(Ob(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ob(n){let e=Rb(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Mb(n,e);else break;return e}function Hd(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Mb(n,e){let t=Hd(n),r=t;return n.eat(",")&&(n.next!="}"?r=Hd(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Ab(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let o=[];for(let i in t){let s=t[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&n.err("No node type or group '"+e+"' found"),o}function Rb(n){if(n.eat("(")){let e=wf(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Ab(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Db(n){let e=[[]];return o(i(n,0),t()),e;function t(){return e.push([])-1}function r(s,a,c){let d={term:c,to:a};return e[s].push(d),d}function o(s,a){s.forEach(c=>c.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(i(d,a)),[]);if(s.type=="seq")for(let c=0;;c++){let d=i(s.exprs[c],a);if(c==s.exprs.length-1)return d;o(d,a=t())}else if(s.type=="star"){let c=t();return r(a,c),o(i(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=t();return o(i(s.expr,a),c),o(i(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let c=a;for(let d=0;d<s.min;d++){let u=t();o(i(s.expr,c),u),c=u}if(s.max==-1)o(i(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=t();r(c,u),o(i(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Ef(n,e){return e-n}function Ud(n,e){let t=[];return r(e),t.sort(Ef);function r(o){let i=n[o];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(o);for(let s=0;s<i.length;s++){let{term:a,to:c}=i[s];!a&&t.indexOf(c)==-1&&r(c)}}}function Ib(n){let e=Object.create(null);return t(Ud(n,0));function t(r){let o=[];r.forEach(s=>{n[s].forEach(({term:a,to:c})=>{if(!a)return;let d;for(let u=0;u<o.length;u++)o[u][0]==a&&(d=o[u][1]);Ud(n,c).forEach(u=>{d||o.push([a,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let i=e[r.join(",")]=new Hr(r.indexOf(n.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(Ef);i.next.push({type:o[s][0],next:e[a.join(",")]||t(a)})}return i}}function Bb(n,e){for(let t=0,r=[n];t<r.length;t++){let o=r[t],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:c,next:d}=o.next[a];s.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),r.indexOf(d)==-1&&r.push(d)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Cf(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function _f(n,e){let t=Object.create(null);for(let r in n){let o=e&&e[r];if(o===void 0){let i=n[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=o}return t}function Sf(n,e,t,r){for(let o in e)if(!(o in n))throw new RangeError(`Unsupported attribute ${o} for ${t} of type ${o}`);for(let o in n){let i=n[o];i.validate&&i.validate(e[o])}}function xf(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Pb(n,r,e[r]);return t}let Wd=class Nf{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=xf(e,r.attrs),this.defaultAttrs=Cf(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==Hr.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:_f(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new fr(this,this.computeAttrs(e),S.from(t),Be.setFrom(r))}createChecked(e=null,t,r){return t=S.from(t),this.checkContent(t),new fr(this,this.computeAttrs(e),t,Be.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=S.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(S.empty,!0);return i?new fr(this,e,t.append(i),Be.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.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){Sf(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Be.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,s)=>r[i]=new Nf(i,t,s));let o=t.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 Lb(n,e,t){let r=t.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 ${n}, got ${i}`)}}class Pb{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Lb(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ni{constructor(e,t,r,o){this.name=e,this.rank=t,this.schema=r,this.spec=o,this.attrs=xf(e,o.attrs),this.excluded=null;let i=Cf(this.attrs);this.instance=i?new Be(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Be(this,_f(this.attrs,e))}static compile(e,t){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Ni(i,o++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Sf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Tf{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let o in e)t[o]=e[o];t.nodes=ht.from(e.nodes),t.marks=ht.from(e.marks||{}),this.nodes=Wd.compile(this.spec.nodes,this),this.marks=Ni.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]=Hr.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?qd(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==""?[]:qd(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,t=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Wd){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(t,r,o)}text(e,t){let r=this.nodes.text;return new Ms(r,r.defaultAttrs,e,Be.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return fr.fromJSON(this,e)}markFromJSON(e){return Be.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function qd(n,e){let t=[];for(let r=0;r<e.length;r++){let o=e[r],i=n.marks[o],s=i;if(i)t.push(i);else for(let a in n.marks){let c=n.marks[a];(o=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&t.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function $b(n){return n.tag!=null}function Fb(n){return n.style!=null}class hr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(o=>{if($b(o))this.tags.push(o);else if(Fb(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,t={}){let r=new Gd(this,t,!1);return r.addAll(e,Be.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Gd(this,t,!0);return r.addAll(e,Be.none,t.from,t.to),O.maxOpen(r.finish())}matchTag(e,t,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(Hb(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,t,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)!=t))){if(s.getAttrs){let c=s.getAttrs(t);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let t=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<t.length;s++){let a=t[s];if((a.priority==null?50:a.priority)<i)break}t.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=jd(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=jd(s)),s.node||s.ignore||s.mark||(s.node=o)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new hr(e,hr.schemaRules(e)))}}const Of={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},zb={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Mf={ol:!0,ul:!0},di=1,Ll=2,fs=4;function Kd(n,e,t){return e!=null?(e?di:0)|(e==="full"?Ll:0):n&&n.whitespace=="pre"?di|Ll:t&-5}class Ui{constructor(e,t,r,o,i,s){this.type=e,this.attrs=t,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Be.none,this.match=i||(s&fs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(S.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);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&di)){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 t=S.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(S.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Of.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Gd{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=t.topNode,i,s=Kd(null,t.preserveWhitespace,0)|(r?fs:0);o?i=new Ui(o.type,o.attrs,Be.none,!0,t.topMatch||o.type.contentMatch,s):r?i=new Ui(null,null,Be.none,!0,null,s):i=new Ui(e.schema.topNodeType,null,Be.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,o=this.top,i=o.options&Ll?"full":this.localPreserveWS||(o.options&di)>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,`
|
|
6
|
-
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Mf.hasOwnProperty(s)&&this.parser.normalizeLists&&
|
|
7
|
-
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){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 c=this.parser.matchStyle(i,s,this,a);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(d=>!c.clearMark(d)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)a=c;else break}}return t}addElementByRule(e,t,r,o){let i,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,t.attrs||null,r,t.preserveWhitespace);c&&(i=!0,r=c)}else{let c=this.parser.schema.marks[t.mark];r=r.concat(c.create(t.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}i&&this.sync(a)&&this.open--}addAll(e,t,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,t);this.findAtPoint(e,i)}findPlace(e,t){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,o=s,!a.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)t=this.enterInner(r[i],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let r=this.findPlace(e,t);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=Be.none;for(let s of r.concat(e.marks))(o.type?o.type.allowsMarkType(s.type):Jd(s.type,e.type))&&(i=s.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,t,r,o){let i=this.findPlace(e.create(t),r);return i&&(i=this.enterInner(e,t,r,!0,o)),i}enterInner(e,t,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Kd(e,i,s.options);s.options&fs&&s.content.length==0&&(a|=fs);let c=Be.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):Jd(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new Ui(e,t,c,o,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=di)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&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)&&t.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),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,c)=>{for(;a>=0;a--){let d=t[a];if(d==""){if(a==t.length-1||a==0)continue;for(;c>=i;c--)if(s(a-1,c))return!0;return!1}else{let u=c>0||c==0&&o?this.nodes[c].type:r&&c>=i?r.node(c-i).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Vb(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Mf.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Hb(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function jd(n){let e={};for(let t in n)e[t]=n[t];return e}function Jd(n,e){let t=e.schema.nodes;for(let r in t){let o=t[r];if(!o.allowsMarkType(n))continue;let i=[],s=a=>{i.push(a);for(let c=0;c<a.edgeCount;c++){let{type:d,next:u}=a.edge(c);if(d==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class Jr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=ja(t).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,c=0;for(;a<i.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(i[a][0])||d.type.spec.spanning===!1)break;a++,c++}for(;a<i.length;)o=i.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,t);u&&(i.push([d,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:o}=hs(ja(t),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,t,o)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let o=this.marks[e.type.name];return o&&hs(ja(r),o(e,t),null,e.attrs)}static renderSpec(e,t,r=null,o){return hs(e,t,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Jr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Yd(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Yd(e.marks)}}function Yd(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function ja(n){return n.document||window.document}const Xd=new WeakMap;function Ub(n){let e=Xd.get(n);return e===void 0&&Xd.set(n,e=Wb(n)),e}function Wb(n){let e=null;function t(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++)t(r[o]);else for(let o in r)t(r[o])}return t(n),e}function hs(n,e,t,r){if(typeof e=="string")return{dom:n.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=Ub(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&&(t=o.slice(0,s),o=o.slice(s+1));let a,c=t?n.createElementNS(t,o):n.createElement(o),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let p in d)if(d[p]!=null){let f=p.indexOf(" ");f>0?c.setAttributeNS(p.slice(0,f),p.slice(f+1),d[p]):c.setAttribute(p,d[p])}}for(let p=u;p<e.length;p++){let f=e[p];if(f===0){if(p<e.length-1||p>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:h,contentDOM:m}=hs(n,f,t,r);if(c.appendChild(h),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const Af=65535,Rf=Math.pow(2,16);function qb(n,e){return n+e*Rf}function Zd(n){return n&Af}function Kb(n){return(n-(n&Af))/Rf}const Df=1,If=2,ms=4,Bf=8;let Pl=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Bf)>0}get deletedBefore(){return(this.delInfo&(Df|ms))>0}get deletedAfter(){return(this.delInfo&(If|ms))>0}get deletedAcross(){return(this.delInfo&ms)>0}},Ur=class ro{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ro.empty)return ro.empty}recover(e){let t=0,r=Zd(e);if(!this.inverted)for(let o=0;o<r;o++)t+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+t+Kb(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,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 c=this.ranges[a]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[a+i],u=this.ranges[a+s],p=c+d;if(e<=p){let f=d?e==c?-1:e==p?1:t:t,h=c+o+(f<0?0:u);if(r)return h;let m=e==(t<0?c:p)?null:qb(a/3,e-c),g=e==c?If:e==p?Df:ms;return(t<0?e!=c:e!=p)&&(g|=Bf),new Pl(h,g,m)}o+=u-d}return r?e+o:new Pl(e+o,0,null)}touches(e,t){let r=0,o=Zd(t),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[a+i],u=c+d;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let t=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),c=s+(this.inverted?0:i),d=this.ranges[o+t],u=this.ranges[o+r];e(a,a+d,c,c+u),i+=u-d}}invert(){return new ro(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ro.empty:new ro(e<0?[0,-e,0]:[0,0,e])}};Ur.empty=new Ur([]);let Gb=class gs{constructor(e=[],t,r=0,o=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=o}slice(e=0,t=this.maps.length){return new gs(this.maps,this.mirror,e,t)}copy(){return new gs(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let o=e.getMirror(t);this.appendMap(e.maps[t],o!=null&&o<t?r+o:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new gs;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(e,t);if(a.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this.maps[c].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Pl(e,o,null)}};const Ja=Object.create(null);let _t=class{getMap(){return Ur.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ja[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ja)throw new RangeError("Duplicate use of step JSON ID "+e);return Ja[e]=t,t.prototype.jsonID=e,t}},At=class zo{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new zo(e,null)}static fail(e){return new zo(null,e)}static fromReplace(e,t,r,o){try{return zo.ok(e.replace(t,r,o))}catch(i){if(i instanceof li)return zo.fail(i.message);throw i}}};function Cc(n,e,t){let r=[];for(let o=0;o<n.childCount;o++){let i=n.child(o);i.content.size&&(i=i.copy(Cc(i.content,e,i))),i.isInline&&(i=e(i,t,o)),r.push(i)}return S.fromArray(r)}let _c=class Vo extends _t{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new O(Cc(t.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),t.openStart,t.openEnd);return At.fromReplace(e,this.from,this.to,i)}invert(){return new Ti(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Vo(t.pos,r.pos,this.mark)}merge(e){return e instanceof Vo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Vo(t.from,t.to,e.markFromJSON(t.mark))}};_t.jsonID("addMark",_c);let Ti=class Ho extends _t{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new O(Cc(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return At.fromReplace(e,this.from,this.to,r)}invert(){return new _c(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ho(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ho&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ho(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ho(t.from,t.to,e.markFromJSON(t.mark))}};_t.jsonID("removeMark",Ti);let Sc=class Uo extends _t{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return At.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return At.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(r))return new Uo(this.pos,t.marks[o]);return new Uo(this.pos,this.mark)}}return new xc(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Uo(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Uo(t.pos,e.markFromJSON(t.mark))}};_t.jsonID("addNodeMark",Sc);let xc=class $l extends _t{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return At.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return At.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Sc(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $l(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new $l(t.pos,e.markFromJSON(t.mark))}};_t.jsonID("removeNodeMark",xc);let Jn=class Nr extends _t{constructor(e,t,r,o=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=o}apply(e){return this.structure&&Fl(e,this.from,this.to)?At.fail("Structure replace would overwrite content"):At.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ur([this.from,this.to-this.from,this.slice.size])}invert(e){return new Nr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Nr(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Nr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?O.empty:new O(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Nr(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?O.empty:new O(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Nr(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Nr(t.from,t.to,O.fromJSON(e,t.slice),!!t.structure)}};_t.jsonID("replace",Jn);let Yr=class bs extends _t{constructor(e,t,r,o,i,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Fl(e,this.from,this.gapFrom)||Fl(e,this.gapTo,this.to)))return At.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return At.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?At.fromReplace(e,this.from,this.to,r):At.fail("Content does not fit in gap")}getMap(){return new Ur([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new bs(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||o<t.pos||i>r.pos?null:new bs(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bs(t.from,t.to,t.gapFrom,t.gapTo,O.fromJSON(e,t.slice),t.insert,!!t.structure)}};_t.jsonID("replaceAround",Yr);function Fl(n,e,t){let r=n.resolve(e),o=t-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 jb(n,e,t,r){let o=[],i=[],s,a;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let p=c.marks;if(!r.isInSet(p)&&u.type.allowsMarkType(r.type)){let f=Math.max(d,e),h=Math.min(d+c.nodeSize,t),m=r.addToSet(p);for(let g=0;g<p.length;g++)p[g].isInSet(m)||(s&&s.to==f&&s.mark.eq(p[g])?s.to=h:o.push(s=new Ti(f,h,p[g])));a&&a.to==f?a.to=h:i.push(a=new _c(f,h,r))}}),o.forEach(c=>n.step(c)),i.forEach(c=>n.step(c))}function Jb(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;i++;let c=null;if(r instanceof Ni){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(a+s.nodeSize,t);for(let u=0;u<c.length;u++){let p=c[u],f;for(let h=0;h<o.length;h++){let m=o[h];m.step==i-1&&p.eq(o[h].style)&&(f=m)}f?(f.to=d,f.step=i):o.push({style:p,from:Math.max(a,e),to:d,step:i})}}}),o.forEach(s=>n.step(new Ti(s.from,s.to,s.style)))}function Yb(n,e,t,r=t.contentMatch){let o=n.doc.nodeAt(e),i=[],s=e+1;for(let a=0;a<o.childCount;a++){let c=o.child(a),d=s+c.nodeSize,u=r.matchType(c.type);if(!u)i.push(new Jn(s,d,O.empty));else{r=u;for(let p=0;p<c.marks.length;p++)t.allowsMarkType(c.marks[p].type)||n.step(new Ti(s,d,c.marks[p]));if(c.isText&&!t.spec.code){let p,f=/\r?\n|\r/g,h;for(;p=f.exec(c.text);)h||(h=new O(S.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),i.push(new Jn(s+p.index,s+p.index+p[0].length,h))}}s=d}if(!r.validEnd){let a=r.fillBefore(S.empty,!0);n.replace(s,s,new O(a,0,0))}for(let a=i.length-1;a>=0;a--)n.step(i[a])}function Xb(n,e,t){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),c=s,d=a,u=S.empty,p=0;for(let m=i,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=S.from(r.node(m).copy(u)),p++):c--;let f=S.empty,h=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)<o.end(m)?(g=!0,f=S.from(o.node(m).copy(f)),h++):d++;n.step(new Yr(c,d,s,a,new O(u.append(f),p,h),u.size-p,!0))}function Zb(n,e,t){let r=S.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let a=t[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=S.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new Yr(o,i,o,i,new O(r,0,0),t.length,!0))}function Qb(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&ey(n.doc,n.mapping.slice(i).map(a),r)){n.clearIncompatible(n.mapping.slice(i).map(a,1),r);let c=n.mapping.slice(i),d=c.map(a,1),u=c.map(a+s.nodeSize,1);return n.step(new Yr(d,u,d+1,u-1,new O(S.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function ey(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function ty(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Yr(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new O(S.from(s),0,0),1,!0))}function ny(n,e,t=1,r){let o=n.doc.resolve(e),i=S.empty,s=S.empty;for(let a=o.depth,c=o.depth-t,d=t-1;a>c;a--,d--){i=S.from(o.node(a).copy(i));let u=r&&r[d];s=S.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}n.step(new Jn(e,e,new O(i.append(s),t,t),!0))}function ry(n,e,t){let r=new Jn(e-t,e+t,O.empty,!0);n.step(r)}function oy(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))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,t))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,t))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function iy(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let o=t.content;for(let i=0;i<t.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(t.openStart==0&&t.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,c=r.index(s)+(a>0?1:0),d=r.node(s),u=!1;if(i==1)u=d.canReplace(c,c,o);else{let p=d.contentMatchAt(c).findWrapping(o.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function sy(n,e,t=e,r=O.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return Lf(o,i,r)?new Jn(e,t,r):new ay(o,i,r).fit()}function Lf(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}let ay=class{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=S.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=S.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=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 c=new O(i,s,a);return e>-1?new Yr(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new Jn(r.pos,o.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Ya(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:c,match:d}=this.frontier[a],u,p=null;if(t==1&&(s?d.matchType(s.type)||(p=d.fillBefore(S.from(s),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:p};if(t==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&d.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=Ya(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new O(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=Ya(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new O(Wo(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new O(Wo(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:p,type:f}=this.frontier[t];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));p=p.matchFragment(o)}let h=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),b=p.matchType(g.type);if(!b)break;d++,(d>1||c==0||g.content.size)&&(p=b,u.push(Pf(g.mark(f.allowedMarks(g.marks)),d==1?c:0,d==a.childCount?h:-1)))}let m=d==a.childCount;m||(h=-1),this.placed=qo(this.placed,t,S.from(u)),this.frontier[t].match=p,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=a;g<h;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?O.empty:new O(Wo(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new O(Wo(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Xa(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=Xa(e,t,o,r,i);if(s){for(let a=t-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],u=Xa(e,a,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=qo(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=qo(this.placed,this.depth,S.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(S.empty,!0);t.childCount&&(this.placed=qo(this.placed,this.frontier.length,t))}};function Wo(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Wo(n.firstChild.content,e-1,t)))}function qo(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(qo(n.lastChild.content,e-1,t)))}function Ya(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Pf(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Pf(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(S.empty,!0)))),n.copy(r)}function Xa(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!ly(t,i.content,s)?a:null}function ly(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function cy(n){return n.spec.defining||n.spec.definingForContent}function dy(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let o=n.doc.resolve(e),i=n.doc.resolve(t);if(Lf(o,i,r))return n.step(new Jn(e,t,r));let s=Ff(o,n.doc.resolve(t));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==h&&s.splice(1,0,-f)}let c=s.indexOf(a),d=[],u=r.openStart;for(let f=r.content,h=0;;h++){let m=f.firstChild;if(d.push(m),h==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let h=d[f],m=cy(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(m||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),m=d[h];if(m)for(let g=0;g<s.length;g++){let b=s[(g+c)%s.length],y=!0;b<0&&(y=!1,b=-b);let k=o.node(b-1),E=o.index(b-1);if(k.canReplaceWith(E,E,m.type,m.marks))return n.replace(o.before(b),y?i.after(b):t,new O($f(r.content,0,r.openStart,h),h,r.openEnd))}}let p=n.steps.length;for(let f=s.length-1;f>=0&&(n.replace(e,t,r),!(n.steps.length>p));f--){let h=s[f];h<0||(e=o.before(h),t=i.after(h))}}function $f(n,e,t,r,o){if(e<t){let i=n.firstChild;n=n.replaceChild(0,i.copy($f(i.content,e+1,t,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(S.empty,!0))}return n}function uy(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=oy(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new O(S.from(r),0,0))}function py(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=Ff(r,o);for(let s=0;s<i.length;s++){let a=i[s],c=s==i.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return n.delete(r.start(a),o.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return n.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&&t>r.end(s)&&o.end(s)-t!=o.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function Ff(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(i<n.pos-(n.depth-o)||e.end(o)>e.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}let zf=class ys extends _t{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return At.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return At.fromReplace(e,this.pos,this.pos+1,new O(S.from(o),0,t.isLeaf?0:1))}getMap(){return Ur.empty}invert(e){return new ys(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ys(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ys(t.pos,t.attr,t.value)}};_t.jsonID("attr",zf);let Vf=class zl extends _t{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return At.ok(r)}getMap(){return Ur.empty}invert(e){return new zl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new zl(t.attr,t.value)}};_t.jsonID("docAttr",Vf);let go=class extends Error{};go=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};go.prototype=Object.create(Error.prototype);go.prototype.constructor=go;go.prototype.name="TransformError";let fy=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Gb}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new go(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=O.empty){let o=sy(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new O(S.from(r),0,0))}delete(e,t){return this.replace(e,t,O.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return dy(this,e,t,r),this}replaceRangeWith(e,t,r){return uy(this,e,t,r),this}deleteRange(e,t){return py(this,e,t),this}lift(e,t){return Xb(this,e,t),this}join(e,t=1){return ry(this,e,t),this}wrap(e,t){return Zb(this,e,t),this}setBlockType(e,t=e,r,o=null){return Qb(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return ty(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new zf(e,t,r)),this}setDocAttribute(e,t){return this.step(new Vf(e,t)),this}addNodeMark(e,t){return this.step(new Sc(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new xc(e,t)),this}split(e,t=1,r){return ny(this,e,t,r),this}addMark(e,t,r){return jb(this,e,t,r),this}removeMark(e,t,r){return Jb(this,e,t,r),this}clearIncompatible(e,t,r){return Yb(this,e,t,r),this}};const Za=Object.create(null);class ee{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new Hf(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=O.empty){let r=t.content.lastChild,o=null;for(let a=0;a<t.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:c,$to:d}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(c.pos),u.map(d.pos),a?O.empty:t),a==0&&tu(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(a.pos);i?e.deleteRange(d,u):(e.replaceRangeWith(d,u,t),tu(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let o=e.parent.inlineContent?new Y(e):oo(e.node(0),e.parent,e.pos,e.index(),t,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=t<0?oo(e.node(0),e.node(i),e.before(i+1),e.index(i),t,r):oo(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Jt(e.node(0))}static atStart(e){return oo(e,e,0,0,1)||new Jt(e)}static atEnd(e){return oo(e,e,e.content.size,e.childCount,-1)||new Jt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Za[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Za)throw new RangeError("Duplicate use of selection JSON ID "+e);return Za[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Y.between(this.$anchor,this.$head).getBookmark()}}ee.prototype.visible=!0;class Hf{constructor(e,t){this.$from=e,this.$to=t}}let Qd=!1;function eu(n){!Qd&&!n.parent.inlineContent&&(Qd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Y extends ee{constructor(e,t=e){eu(e),eu(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ee.near(r);let o=e.resolve(t.map(this.anchor));return new Y(o.parent.inlineContent?o:r,r)}replace(e,t=O.empty){if(super.replace(e,t),t==O.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 wa(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Y(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let o=e.resolve(t);return new this(o,r==t?o:e.resolve(r))}static between(e,t,r){let o=e.pos-t.pos;if((!r||o)&&(r=o>=0?1:-1),!t.parent.inlineContent){let i=ee.findFrom(t,r,!0)||ee.findFrom(t,-r,!0);if(i)t=i.$head;else return ee.near(t,r)}return e.parent.inlineContent||(o==0?e=t:(e=(ee.findFrom(e,-r,!0)||ee.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=o<0&&(e=t))),new Y(e,t)}}ee.jsonID("text",Y);class wa{constructor(e,t){this.anchor=e,this.head=t}map(e){return new wa(e.map(this.anchor),e.map(this.head))}resolve(e){return Y.between(e.resolve(this.anchor),e.resolve(this.head))}}class G extends ee{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:o}=t.mapResult(this.anchor),i=e.resolve(o);return r?ee.near(i):new G(i)}content(){return new O(S.from(this.node),0,0)}eq(e){return e instanceof G&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Nc(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new G(e.resolve(t.anchor))}static create(e,t){return new G(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}G.prototype.visible=!1;ee.jsonID("node",G);class Nc{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new wa(r,r):new Nc(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&G.isSelectable(r)?new G(t):ee.near(t)}}class Jt extends ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=O.empty){if(t==O.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,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Jt(e)}map(e){return new Jt(e)}eq(e){return e instanceof Jt}getBookmark(){return hy}}ee.jsonID("all",Jt);const hy={map(){return this},resolve(n){return new Jt(n)}};function oo(n,e,t,r,o,i=!1){if(e.inlineContent)return Y.create(n,t);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&&G.isSelectable(a))return G.create(n,t-(o<0?a.nodeSize:0))}else{let c=oo(n,a,t+o,o<0?a.childCount:0,o,i);if(c)return c}t+=a.nodeSize*o}return null}function tu(n,e,t){let r=n.steps.length-1;if(r<e)return;let o=n.steps[r];if(!(o instanceof Jn||o instanceof Yr))return;let i=n.mapping.maps[r],s;i.forEach((a,c,d,u)=>{s==null&&(s=u)}),n.setSelection(ee.near(n.doc.resolve(s),t))}const nu=1,ru=2,ou=4;class my extends fy{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|nu)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&nu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ru,this}ensureMarks(e){return Be.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&ru)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Be.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let o=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(t);i=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,o.text(e,i)),this.selection.empty||this.setSelection(ee.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,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|=ou,this}get scrolledIntoView(){return(this.updated&ou)>0}}function iu(n,e){return!e||!n?n:n.bind(e)}class Ko{constructor(e,t,r){this.name=e,this.init=iu(t.init,r),this.apply=iu(t.apply,r)}}const gy=[new Ko("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ko("selection",{init(n,e){return n.selection||ee.atStart(e.doc)},apply(n){return n.selection}}),new Ko("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ko("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class Qa{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=gy.slice(),t&&t.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 Ko(r.key,r.spec.state,r))})}}class uo{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){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 t=[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 c=o?o[s].n:0,d=o?o[s].state:this,u=c<t.length&&a.spec.appendTransaction.call(a,c?t.slice(c):t,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let p=0;p<this.config.plugins.length;p++)o.push(p<s?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:t.length})}}if(!i)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new uo(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new my(this)}static create(e){let t=new Qa(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new uo(t);for(let o=0;o<t.fields.length;o++)r[t.fields[o].name]=t.fields[o].init(e,r);return r}reconfigure(e){let t=new Qa(this.schema,e.plugins),r=t.fields,o=new uo(t);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 t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.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&&(t[r]=i.toJSON.call(o,this[o.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Qa(e.schema,e.plugins),i=new uo(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=fr.fromJSON(e.schema,t.doc);else if(s.name=="selection")i.selection=ee.fromJSON(i.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){i[s.name]=d.fromJSON.call(c,e,t[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function Uf(n,e,t){for(let r in n){let o=n[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=Uf(o,e,{})),t[r]=o}return t}class Te{constructor(e){this.spec=e,this.props={},e.props&&Uf(e.props,this,this.props),this.key=e.key?e.key.key:Wf("plugin")}getState(e){return e[this.key]}}const el=Object.create(null);function Wf(n){return n in el?n+"$"+ ++el[n]:(el[n]=0,n+"$")}class $e{constructor(e="key"){this.key=Wf(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const qf=65535,Kf=Math.pow(2,16);function by(n,e){return n+e*Kf}function su(n){return n&qf}function yy(n){return(n-(n&qf))/Kf}const Gf=1,jf=2,vs=4,Jf=8;class Vl{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Jf)>0}get deletedBefore(){return(this.delInfo&(Gf|vs))>0}get deletedAfter(){return(this.delInfo&(jf|vs))>0}get deletedAcross(){return(this.delInfo&vs)>0}}class Kt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Kt.empty)return Kt.empty}recover(e){let t=0,r=su(e);if(!this.inverted)for(let o=0;o<r;o++)t+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+t+yy(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,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 c=this.ranges[a]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[a+i],u=this.ranges[a+s],p=c+d;if(e<=p){let f=d?e==c?-1:e==p?1:t:t,h=c+o+(f<0?0:u);if(r)return h;let m=e==(t<0?c:p)?null:by(a/3,e-c),g=e==c?jf:e==p?Gf:vs;return(t<0?e!=c:e!=p)&&(g|=Jf),new Vl(h,g,m)}o+=u-d}return r?e+o:new Vl(e+o,0,null)}touches(e,t){let r=0,o=su(t),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[a+i],u=c+d;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let t=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),c=s+(this.inverted?0:i),d=this.ranges[o+t],u=this.ranges[o+r];e(a,a+d,c,c+u),i+=u-d}}invert(){return new Kt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Kt.empty:new Kt(e<0?[0,-e,0]:[0,0,e])}}Kt.empty=new Kt([]);class fo{constructor(e=[],t,r=0,o=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=o}slice(e=0,t=this.maps.length){return new fo(this.maps,this.mirror,e,t)}copy(){return new fo(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let o=e.getMirror(t);this.appendMap(e.maps[t],o!=null&&o<t?r+o:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new fo;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(e,t);if(a.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this.maps[c].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Vl(e,o,null)}}const tl=Object.create(null);class St{getMap(){return Kt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=tl[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in tl)throw new RangeError("Duplicate use of step JSON ID "+e);return tl[e]=t,t.prototype.jsonID=e,t}}class tt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new tt(e,null)}static fail(e){return new tt(null,e)}static fromReplace(e,t,r,o){try{return tt.ok(e.replace(t,r,o))}catch(i){if(i instanceof li)return tt.fail(i.message);throw i}}}function Tc(n,e,t){let r=[];for(let o=0;o<n.childCount;o++){let i=n.child(o);i.content.size&&(i=i.copy(Tc(i.content,e,i))),i.isInline&&(i=e(i,t,o)),r.push(i)}return S.fromArray(r)}class cr extends St{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new O(Tc(t.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),t.openStart,t.openEnd);return tt.fromReplace(e,this.from,this.to,i)}invert(){return new Tn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new cr(t.pos,r.pos,this.mark)}merge(e){return e instanceof cr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new cr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new cr(t.from,t.to,e.markFromJSON(t.mark))}}St.jsonID("addMark",cr);class Tn extends St{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new O(Tc(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return tt.fromReplace(e,this.from,this.to,r)}invert(){return new cr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Tn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Tn(t.from,t.to,e.markFromJSON(t.mark))}}St.jsonID("removeMark",Tn);class dr extends St{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return tt.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(r))return new dr(this.pos,t.marks[o]);return new dr(this.pos,this.mark)}}return new bo(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new dr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new dr(t.pos,e.markFromJSON(t.mark))}}St.jsonID("addNodeMark",dr);class bo extends St{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return tt.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new dr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new bo(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new bo(t.pos,e.markFromJSON(t.mark))}}St.jsonID("removeNodeMark",bo);class mt extends St{constructor(e,t,r,o=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=o}apply(e){return this.structure&&Hl(e,this.from,this.to)?tt.fail("Structure replace would overwrite content"):tt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Kt([this.from,this.to-this.from,this.slice.size])}invert(e){return new mt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new mt(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof mt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?O.empty:new O(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new mt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?O.empty:new O(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new mt(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new mt(t.from,t.to,O.fromJSON(e,t.slice),!!t.structure)}}St.jsonID("replace",mt);class yt extends St{constructor(e,t,r,o,i,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Hl(e,this.from,this.gapFrom)||Hl(e,this.gapTo,this.to)))return tt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return tt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?tt.fromReplace(e,this.from,this.to,r):tt.fail("Content does not fit in gap")}getMap(){return new Kt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new yt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||o<t.pos||i>r.pos?null:new yt(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new yt(t.from,t.to,t.gapFrom,t.gapTo,O.fromJSON(e,t.slice),t.insert,!!t.structure)}}St.jsonID("replaceAround",yt);function Hl(n,e,t){let r=n.resolve(e),o=t-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 vy(n,e,t,r){let o=[],i=[],s,a;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let p=c.marks;if(!r.isInSet(p)&&u.type.allowsMarkType(r.type)){let f=Math.max(d,e),h=Math.min(d+c.nodeSize,t),m=r.addToSet(p);for(let g=0;g<p.length;g++)p[g].isInSet(m)||(s&&s.to==f&&s.mark.eq(p[g])?s.to=h:o.push(s=new Tn(f,h,p[g])));a&&a.to==f?a.to=h:i.push(a=new cr(f,h,r))}}),o.forEach(c=>n.step(c)),i.forEach(c=>n.step(c))}function ky(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;i++;let c=null;if(r instanceof Ni){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(a+s.nodeSize,t);for(let u=0;u<c.length;u++){let p=c[u],f;for(let h=0;h<o.length;h++){let m=o[h];m.step==i-1&&p.eq(o[h].style)&&(f=m)}f?(f.to=d,f.step=i):o.push({style:p,from:Math.max(a,e),to:d,step:i})}}}),o.forEach(s=>n.step(new Tn(s.from,s.to,s.style)))}function Oc(n,e,t,r=t.contentMatch,o=!0){let i=n.doc.nodeAt(e),s=[],a=e+1;for(let c=0;c<i.childCount;c++){let d=i.child(c),u=a+d.nodeSize,p=r.matchType(d.type);if(!p)s.push(new mt(a,u,O.empty));else{r=p;for(let f=0;f<d.marks.length;f++)t.allowsMarkType(d.marks[f].type)||n.step(new Tn(a,u,d.marks[f]));if(o&&d.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(d.text);)m||(m=new O(S.from(t.schema.text(" ",t.allowedMarks(d.marks))),0,0)),s.push(new mt(a+f.index,a+f.index+f[0].length,m))}}a=u}if(!r.validEnd){let c=r.fillBefore(S.empty,!0);n.replace(a,a,new O(c,0,0))}for(let c=s.length-1;c>=0;c--)n.step(s[c])}function wy(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Oo(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(r<n.depth&&o.canReplace(i,s,t))return r;if(r==0||o.type.spec.isolating||!wy(o,i,s))break}return null}function Ey(n,e,t){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),c=s,d=a,u=S.empty,p=0;for(let m=i,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=S.from(r.node(m).copy(u)),p++):c--;let f=S.empty,h=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)<o.end(m)?(g=!0,f=S.from(o.node(m).copy(f)),h++):d++;n.step(new yt(c,d,s,a,new O(u.append(f),p,h),u.size-p,!0))}function Mc(n,e,t=null,r=n){let o=Cy(n,e),i=o&&_y(r,e);return i?o.map(au).concat({type:e,attrs:t}).concat(i.map(au)):null}function au(n){return{type:n,attrs:null}}function Cy(n,e){let{parent:t,startIndex:r,endIndex:o}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return t.canReplaceWith(r,o,s)?i:null}function _y(n,e){let{parent:t,startIndex:r,endIndex:o}=n,i=t.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<o;d++)c=c.matchType(t.child(d).type);return!c||!c.validEnd?null:s}function Sy(n,e,t){let r=S.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let a=t[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=S.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new yt(o,i,o,i,new O(r,0,0),t.length,!0))}function xy(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let c=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,c)&&Ny(n.doc,n.mapping.slice(i).map(a),r)){let d=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?d=!1:!h&&m&&(d=!0)}d===!1&&Xf(n,s,a,i),Oc(n,n.mapping.slice(i).map(a,1),r,void 0,d===null);let u=n.mapping.slice(i),p=u.map(a,1),f=u.map(a+s.nodeSize,1);return n.step(new yt(p,f,p+1,f-1,new O(S.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&Yf(n,s,a,i),!1}})}function Yf(n,e,t,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let c=n.mapping.slice(r).map(t+1+i+s.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Xf(n,e,t,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+i);n.replaceWith(s,s+1,e.type.schema.text(`
|
|
8
|
-
`))}})}function Ny(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function Ty(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new yt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new O(S.from(s),0,0),1,!0))}function Gn(n,e,t=1,r){let o=n.resolve(e),i=o.depth-t,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 d=o.depth-1,u=t-2;d>i;d--,u--){let p=o.node(d),f=o.index(d);if(p.type.spec.isolating)return!1;let h=p.content.cutByIndex(f,p.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||p;if(!p.canReplace(f+1,p.childCount)||!g.type.validContent(h))return!1}let a=o.indexAfter(i),c=r&&r[0];return o.node(i).canReplaceWith(a,a,c?c.type:o.node(i+1).type)}function Oy(n,e,t=1,r){let o=n.doc.resolve(e),i=S.empty,s=S.empty;for(let a=o.depth,c=o.depth-t,d=t-1;a>c;a--,d--){i=S.from(o.node(a).copy(i));let u=r&&r[d];s=S.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}n.step(new mt(e,e,new O(i.append(s),t,t),!0))}function kr(n,e){let t=n.resolve(e),r=t.index();return Zf(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function My(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?n.type.schema.nodes.text:i.type;if(t=t.matchType(s),!t||!n.type.allowsMarks(i.marks))return!1}return t.validEnd}function Zf(n,e){return!!(n&&e&&!n.isLeaf&&My(n,e))}function Ea(n,e,t=-1){let r=n.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):t>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&&Zf(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=t<0?r.before(o):r.after(o)}}function Ay(n,e,t){let r=null,{linebreakReplacement:o}=n.doc.type.schema,i=n.doc.resolve(e-t),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",p=!!s.contentMatch.matchType(o);u&&!p?r=!1:!u&&p&&(r=!0)}let a=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);Xf(n,u.node(),u.before(),a)}s.inlineContent&&Oc(n,e+t-1,s,i.node().contentMatchAt(i.index()),r==null);let c=n.mapping.slice(a),d=c.map(e-t);if(n.step(new mt(d,c.map(e+t,-1),O.empty,!0)),r===!0){let u=n.doc.resolve(d);Yf(n,u.node(),u.before(),n.steps.length)}return n}function Ry(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))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,t))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,t))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Dy(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let o=t.content;for(let i=0;i<t.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(t.openStart==0&&t.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,c=r.index(s)+(a>0?1:0),d=r.node(s),u=!1;if(i==1)u=d.canReplace(c,c,o);else{let p=d.contentMatchAt(c).findWrapping(o.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ca(n,e,t=e,r=O.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return Qf(o,i,r)?new mt(e,t,r):new Iy(o,i,r).fit()}function Qf(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Iy{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=S.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=S.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=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 c=new O(i,s,a);return e>-1?new yt(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new mt(r.pos,o.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=nl(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:c,match:d}=this.frontier[a],u,p=null;if(t==1&&(s?d.matchType(s.type)||(p=d.fillBefore(S.from(s),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:p};if(t==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&d.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=nl(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new O(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=nl(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new O(Go(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new O(Go(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:p,type:f}=this.frontier[t];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));p=p.matchFragment(o)}let h=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),b=p.matchType(g.type);if(!b)break;d++,(d>1||c==0||g.content.size)&&(p=b,u.push(eh(g.mark(f.allowedMarks(g.marks)),d==1?c:0,d==a.childCount?h:-1)))}let m=d==a.childCount;m||(h=-1),this.placed=jo(this.placed,t,S.from(u)),this.frontier[t].match=p,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=a;g<h;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?O.empty:new O(Go(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new O(Go(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!rl(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=rl(e,t,o,r,i);if(s){for(let a=t-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],u=rl(e,a,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=jo(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=jo(this.placed,this.depth,S.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(S.empty,!0);t.childCount&&(this.placed=jo(this.placed,this.frontier.length,t))}}function Go(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Go(n.firstChild.content,e-1,t)))}function jo(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(jo(n.lastChild.content,e-1,t)))}function nl(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function eh(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,eh(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(S.empty,!0)))),n.copy(r)}function rl(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!By(t,i.content,s)?a:null}function By(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function Ly(n){return n.spec.defining||n.spec.definingForContent}function Py(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let o=n.doc.resolve(e),i=n.doc.resolve(t);if(Qf(o,i,r))return n.step(new mt(e,t,r));let s=nh(o,n.doc.resolve(t));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==h&&s.splice(1,0,-f)}let c=s.indexOf(a),d=[],u=r.openStart;for(let f=r.content,h=0;;h++){let m=f.firstChild;if(d.push(m),h==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let h=d[f],m=Ly(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(m||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),m=d[h];if(m)for(let g=0;g<s.length;g++){let b=s[(g+c)%s.length],y=!0;b<0&&(y=!1,b=-b);let k=o.node(b-1),E=o.index(b-1);if(k.canReplaceWith(E,E,m.type,m.marks))return n.replace(o.before(b),y?i.after(b):t,new O(th(r.content,0,r.openStart,h),h,r.openEnd))}}let p=n.steps.length;for(let f=s.length-1;f>=0&&(n.replace(e,t,r),!(n.steps.length>p));f--){let h=s[f];h<0||(e=o.before(h),t=i.after(h))}}function th(n,e,t,r,o){if(e<t){let i=n.firstChild;n=n.replaceChild(0,i.copy(th(i.content,e+1,t,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(S.empty,!0))}return n}function $y(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=Ry(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new O(S.from(r),0,0))}function Fy(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=nh(r,o);for(let s=0;s<i.length;s++){let a=i[s],c=s==i.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return n.delete(r.start(a),o.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return n.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&&t>r.end(s)&&o.end(s)-t!=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 n.delete(r.before(s),t);n.delete(e,t)}function nh(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(i<n.pos-(n.depth-o)||e.end(o)>e.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}class ho extends St{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return tt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return tt.fromReplace(e,this.pos,this.pos+1,new O(S.from(o),0,t.isLeaf?0:1))}getMap(){return Kt.empty}invert(e){return new ho(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ho(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ho(t.pos,t.attr,t.value)}}St.jsonID("attr",ho);class ui extends St{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return tt.ok(r)}getMap(){return Kt.empty}invert(e){return new ui(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ui(t.attr,t.value)}}St.jsonID("docAttr",ui);let yo=class extends Error{};yo=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};yo.prototype=Object.create(Error.prototype);yo.prototype.constructor=yo;yo.prototype.name="TransformError";class rh{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new fo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new yo(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=O.empty){let o=Ca(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new O(S.from(r),0,0))}delete(e,t){return this.replace(e,t,O.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Py(this,e,t,r),this}replaceRangeWith(e,t,r){return $y(this,e,t,r),this}deleteRange(e,t){return Fy(this,e,t),this}lift(e,t){return Ey(this,e,t),this}join(e,t=1){return Ay(this,e,t),this}wrap(e,t){return Sy(this,e,t),this}setBlockType(e,t=e,r,o=null){return xy(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return Ty(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new ho(e,t,r)),this}setDocAttribute(e,t){return this.step(new ui(e,t)),this}addNodeMark(e,t){return this.step(new dr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new bo(e,t)),this}split(e,t=1,r){return Oy(this,e,t,r),this}addMark(e,t,r){return vy(this,e,t,r),this}removeMark(e,t,r){return ky(this,e,t,r),this}clearIncompatible(e,t,r){return Oc(this,e,t,r),this}}const gt=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},pi=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Ul=null;const Un=function(n,e,t){let r=Ul||(Ul=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},zy=function(){Ul=null},Wr=function(n,e,t,r){return t&&(lu(n,e,t,r,-1)||lu(n,e,t,r,1))},Vy=/^(img|br|input|textarea|hr)$/i;function lu(n,e,t,r,o){for(;;){if(n==t&&e==r)return!0;if(e==(o<0?0:on(n))){let i=n.parentNode;if(!i||i.nodeType!=1||Oi(n)||Vy.test(n.nodeName)||n.contentEditable=="false")return!1;e=gt(n)+(o<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[e+(o<0?-1:0)],n.contentEditable=="false")return!1;e=o<0?on(n):0}else return!1}}function on(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Hy(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=on(n)}else if(n.parentNode&&!Oi(n))e=gt(n),n=n.parentNode;else return null}}function Uy(n,e){for(;;){if(n.nodeType==3&&e<n.nodeValue.length)return n;if(n.nodeType==1&&e<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[e],e=0}else if(n.parentNode&&!Oi(n))e=gt(n)+1,n=n.parentNode;else return null}}function Wy(n,e,t){for(let r=e==0,o=e==on(n);r||o;){if(n==t)return!0;let i=gt(n);if(n=n.parentNode,!n)return!1;r=r&&i==0,o=o&&i==on(n)}}function Oi(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const _a=function(n){return n.focusNode&&Wr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Or(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function qy(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ky(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:Math.min(on(r.offsetNode),r.offset)}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:Math.min(on(r.startContainer),r.startOffset)}}}const Mn=typeof navigator<"u"?navigator:null,cu=typeof document<"u"?document:null,wr=Mn&&Mn.userAgent||"",Wl=/Edge\/(\d+)/.exec(wr),oh=/MSIE \d/.exec(wr),ql=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wr),Ft=!!(oh||ql||Wl),mr=oh?document.documentMode:ql?+ql[1]:Wl?+Wl[1]:0,bn=!Ft&&/gecko\/(\d+)/i.test(wr);bn&&+(/Firefox\/(\d+)/.exec(wr)||[0,0])[1];const Kl=!Ft&&/Chrome\/(\d+)/.exec(wr),Et=!!Kl,ih=Kl?+Kl[1]:0,Rt=!Ft&&!!Mn&&/Apple Computer/.test(Mn.vendor),vo=Rt&&(/Mobile\/\w+/.test(wr)||!!Mn&&Mn.maxTouchPoints>2),rn=vo||(Mn?/Mac/.test(Mn.platform):!1),Gy=Mn?/Win/.test(Mn.platform):!1,qn=/Android \d/.test(wr),Mi=!!cu&&"webkitFontSmoothing"in cu.documentElement.style,jy=Mi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Jy(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function $n(n,e){return typeof n=="number"?n:n[e]}function Yy(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function du(n,e,t){let r=n.someProp("scrollThreshold")||0,o=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let s=t||n.dom;s;s=pi(s)){if(s.nodeType!=1)continue;let a=s,c=a==i.body,d=c?Jy(i):Yy(a),u=0,p=0;if(e.top<d.top+$n(r,"top")?p=-(d.top-e.top+$n(o,"top")):e.bottom>d.bottom-$n(r,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+$n(o,"top")-d.top:e.bottom-d.bottom+$n(o,"bottom")),e.left<d.left+$n(r,"left")?u=-(d.left-e.left+$n(o,"left")):e.right>d.right-$n(r,"right")&&(u=e.right-d.right+$n(o,"right")),u||p)if(c)i.defaultView.scrollBy(u,p);else{let f=a.scrollLeft,h=a.scrollTop;p&&(a.scrollTop+=p),u&&(a.scrollLeft+=u);let m=a.scrollLeft-f,g=a.scrollTop-h;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Xy(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=t+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=n.root.elementFromPoint(i,s);if(!a||a==n.dom||!n.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=t-20){r=a,o=c.top;break}}return{refDOM:r,refTop:o,stack:sh(n.dom)}}function sh(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=pi(r));return e}function Zy({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;ah(t,r==0?0:r-e)}function ah(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:o,left:i}=n[t];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Qr=null;function Qy(n){if(n.setActive)return n.setActive();if(Qr)return n.focus(Qr);let e=sh(n);n.focus(Qr==null?{get preventScroll(){return Qr={preventScroll:!0},!0}}:void 0),Qr||(Qr=!1,ah(e,0))}function lh(n,e){let t,r=2e8,o,i=0,s=e.top,a=e.top,c,d;for(let u=n.firstChild,p=0;u;u=u.nextSibling,p++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Un(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){t=u,r=g,o=g&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(i=p+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=p+1)}}return!t&&c&&(t=c,o=d,r=0),t&&t.nodeType==3?ev(t,o):!t||r&&t.nodeType==1?{node:n,offset:i}:lh(t,o)}function ev(n,e){let t=n.nodeValue.length,r=document.createRange();for(let o=0;o<t;o++){r.setEnd(n,o+1),r.setStart(n,o);let i=nr(r,1);if(i.top!=i.bottom&&Ac(e,i))return{node:n,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:n,offset:0}}function Ac(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function tv(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function nv(n,e,t){let{node:r,offset:o}=lh(e,t),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&t.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,o,i)}function rv(n,e,t,r){let o=-1;for(let i=e,s=!1;i!=n.dom;){let a=n.docView.nearestDesc(i,!0),c;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((c=a.dom.getBoundingClientRect()).width||c.height)&&(a.node.isBlock&&a.parent&&(!s&&c.left>r.left||c.top>r.top?o=a.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return o>-1?o:n.docView.posFromDOM(e,t,-1)}function ch(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),i=o;;){let s=n.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let c=0;c<a.length;c++){let d=a[c];if(Ac(e,d))return ch(s,e,d)}}if((i=(i+1)%r)==o)break}return n}function ov(n,e){let t=n.dom.ownerDocument,r,o=0,i=Ky(t,e.left,e.top);i&&({node:r,offset:o}=i);let s=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),a;if(!s||!n.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=n.dom.getBoundingClientRect();if(!Ac(e,d)||(s=ch(n.dom,e,d),!s))return null}if(Rt)for(let d=s;r&&d;d=pi(d))d.draggable&&(r=void 0);if(s=tv(s,e),r){if(bn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],p;u.nodeName=="IMG"&&(p=u.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&o++}let d;Mi&&o&&r.nodeType==1&&(d=r.childNodes[o-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&o--,r==n.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=rv(n,r,o,e))}a==null&&(a=nv(n,s,e));let c=n.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function uu(n){return n.top<n.bottom||n.left<n.right}function nr(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(uu(r))return r}return Array.prototype.find.call(t,uu)||n.getBoundingClientRect()}const iv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function dh(n,e,t){let{node:r,offset:o,atom:i}=n.docView.domFromPos(e,t<0?-1:1),s=Mi||bn;if(r.nodeType==3)if(s&&(iv.test(r.nodeValue)||(t<0?!o:o==r.nodeValue.length))){let c=nr(Un(r,o,o),t);if(bn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let d=nr(Un(r,o-1,o-1),-1);if(d.top==c.top){let u=nr(Un(r,o,o+1),-1);if(u.top!=c.top)return Lo(u,u.left<d.left)}}return c}else{let c=o,d=o,u=t<0?1:-1;return t<0&&!o?(d++,u=-1):t>=0&&o==r.nodeValue.length?(c--,u=1):t<0?c--:d++,Lo(nr(Un(r,c,d),u),u<0)}if(!n.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(t<0||o==on(r))){let c=r.childNodes[o-1];if(c.nodeType==1)return ol(c.getBoundingClientRect(),!1)}if(i==null&&o<on(r)){let c=r.childNodes[o];if(c.nodeType==1)return ol(c.getBoundingClientRect(),!0)}return ol(r.getBoundingClientRect(),t>=0)}if(i==null&&o&&(t<0||o==on(r))){let c=r.childNodes[o-1],d=c.nodeType==3?Un(c,on(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return Lo(nr(d,1),!1)}if(i==null&&o<on(r)){let c=r.childNodes[o];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Un(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return Lo(nr(d,-1),!0)}return Lo(nr(r.nodeType==3?Un(r):r,-t),t>=0)}function Lo(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ol(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function uh(n,e,t){let r=n.state,o=n.root.activeElement;r!=e&&n.updateState(e),o!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),o!=n.dom&&o&&o.focus()}}function sv(n,e,t){let r=e.selection,o=t=="up"?r.$from:r.$to;return uh(n,e,()=>{let{node:i}=n.docView.domFromPos(o.pos,t=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=dh(n,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=Un(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const av=/[\u0590-\u08ac]/;function lv(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=n.domSelection();return a?!av.test(r.parent.textContent)||!a.modify?t=="left"||t=="backward"?i:s:uh(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:p}=n.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:g}=n.domSelectionRange(),b=m&&!h.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{a.collapse(u,p),c&&(c!=u||d!=p)&&a.extend&&a.extend(c,d)}catch{}return f!=null&&(a.caretBidiLevel=f),b}):r.pos==r.start()||r.pos==r.end()}let pu=null,fu=null,hu=!1;function cv(n,e,t){return pu==e&&fu==t?hu:(pu=e,fu=t,hu=t=="up"||t=="down"?sv(n,e,t):lv(n,e,t))}const sn=0,mu=1,Ar=2,An=3;class Ai{constructor(e,t,r,o){this.parent=e,this.children=t,this.dom=r,this.contentDOM=o,this.dirty=sn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let o=this.children[t];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,t,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[t-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[t];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=t>gt(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(t==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&t==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,t=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!t||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 t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let o=this.children[t],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,t){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 fh){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof ph&&i.side>=0;r--);if(t<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&t&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,t):{node:this.contentDOM,offset:i?gt(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,t):{node:this.contentDOM,offset:i?gt(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let c=this.children[a],d=s+c.size;if(o==-1&&e<=d){let u=s+c.border;if(e>=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=s;for(let p=a;p>0;p--){let f=this.children[p-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=gt(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(d>t||a==this.children.length-1)){t=d;for(let u=a+1;u<this.children.length;u++){let p=this.children[u];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){i=gt(p.dom);break}t+=p.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:t,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,o=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let h=0,m=0;h<this.children.length;h++){let g=this.children[h],b=m+g.size;if(i>m&&s<b)return g.setSelection(e-m-g.border,t-m-g.border,r,o);m=b}let a=this.domFromPos(e,e?-1:1),c=t==e?a:this.domFromPos(t,t?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),p=!1;if((bn||Rt)&&e==t){let{node:h,offset:m}=a;if(h.nodeType==3){if(p=!!(m&&h.nodeValue[m-1]==`
|
|
9
|
-
`),p&&m==h.nodeValue.length)for(let g=h,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(a=c={node:b.parentNode,offset:gt(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=h.childNodes[m-1];p=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(bn&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(o=!0)}if(!(o||p&&Rt)&&Wr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Wr(c.node,c.offset,u.focusNode,u.focusOffset))return;let f=!1;if((d.extend||e==t)&&!p){d.collapse(a.node,a.offset);try{e!=t&&d.extend(c.node,c.offset),f=!0}catch{}}if(!f){if(e>t){let m=a;a=c,c=m}let h=document.createRange();h.setEnd(c.node,c.offset),h.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){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&&t>=r:e<s&&t>r){let a=r+i.border,c=s-i.border;if(e>=a&&t<=c){this.dirty=e==r||t==s?Ar:mu,e==a&&t==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=An:i.markDirty(e-a,t-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Ar:An}r=s}this.dirty=Ar}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Ar:mu;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class ph extends Ai{constructor(e,t,r,o){let i,s=t.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!t.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=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==sn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(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 side(){return this.widget.type.side}}class dv extends Ai{constructor(e,t,r,o){super(e,[],t,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class qr extends Ai{constructor(e,t,r,o,i){super(e,[],r,o),this.mark=t,this.spec=i}static create(e,t,r,o){let i=o.nodeViews[t.type.name],s=i&&i(t,o,r);return(!s||!s.dom)&&(s=Jr.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new qr(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&An||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=An&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=sn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=sn}}slice(e,t,r){let o=qr.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;t<s&&(i=jl(i,t,s,r)),e>0&&(i=jl(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 gr extends Ai{constructor(e,t,r,o,i,s,a,c,d){super(e,[],i,s),this.node=t,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,t,r,o,i,s){let a=i.nodeViews[t.type.name],c,d=a&&a(t,i,()=>{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,o),u=d&&d.dom,p=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:p}=Jr.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!p&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=gh(u,r,t),d?c=new uv(e,t,r,o,u,p||null,f,d,i,s+1):t.isText?new Sa(e,t,r,o,u,f,i):new gr(e,t,r,o,u,p||null,f,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 t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>S.empty)}return e}matchesNode(e,t,r){return this.dirty==sn&&e.eq(this.node)&&As(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,c=new fv(this,s&&s.node,e);gv(this.node,this.innerDeco,(d,u,p)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!p&&c.syncToMarks(u==this.node.childCount?Be.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,o)},(d,u,p,f)=>{c.syncToMarks(d.marks,r,e);let h;c.findNodeMatch(d,u,p,f)||a&&e.state.selection.from>o&&e.state.selection.to<o+d.nodeSize&&(h=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(d,u,p,h,e)||c.updateNextNode(d,u,p,e,f,o)||c.addNode(d,u,p,e,o),o+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Ar)&&(s&&this.protectLocalComposition(e,s),hh(this.contentDOM,this.children,e),vo&&bv(this.dom))}localCompositionInfo(e,t){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Y)||r<t||o>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=yv(this.node.content,s,r-t,o-t);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:o}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new dv(this,i,t,o);e.input.compositionNodes.push(s),this.children=jl(this.children,r,r+o.length,e,s)}update(e,t,r,o){return this.dirty==An||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,o),!0)}updateInner(e,t,r,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=sn}updateOuterDeco(e){if(As(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=mh(this.dom,this.nodeDOM,Gl(this.outerDeco,this.node,t),Gl(e,this.node,t)),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 gu(n,e,t,r,o){gh(r,e,n);let i=new gr(void 0,n,e,t,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Sa extends gr{constructor(e,t,r,o,i,s,a){super(e,t,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,t,r,o){return this.dirty==An||this.dirty!=sn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=sn||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=sn,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let o=this.node.cut(e,t),i=document.createTextNode(o.text);return new Sa(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=An)}get domAtom(){return!1}isText(e){return this.node.text==e}}class fh extends Ai{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==sn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class uv extends gr{constructor(e,t,r,o,i,s,a,c,d,u){super(e,t,r,o,i,s,a,d,u),this.spec=c}update(e,t,r,o){if(this.dirty==An)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,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 hh(n,e,t){let r=n.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==n){for(;a!=r;)r=bu(r),o=!0;r=r.nextSibling}else o=!0,n.insertBefore(a,r);if(s instanceof qr){let c=r?r.previousSibling:n.lastChild;hh(s.contentDOM,s.children,t),r=c?c.nextSibling:n.firstChild}}for(;r;)r=bu(r),o=!0;o&&t.trackWrites==n&&(t.trackWrites=null)}const Xo=function(n){n&&(this.nodeName=n)};Xo.prototype=Object.create(null);const Rr=[new Xo];function Gl(n,e,t){if(n.length==0)return Rr;let r=t?Rr[0]:new Xo,o=[r];for(let i=0;i<n.length;i++){let s=n[i].type.attrs;if(s){s.nodeName&&o.push(r=new Xo(s.nodeName));for(let a in s){let c=s[a];c!=null&&(t&&o.length==1&&o.push(r=new Xo(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+c:a=="style"?r.style=(r.style?r.style+";":"")+c:a!="nodeName"&&(r[a]=c))}}}return o}function mh(n,e,t,r){if(t==Rr&&r==Rr)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=t[i];if(i){let c;a&&a.nodeName==s.nodeName&&o!=n&&(c=o.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(o),a=Rr[0]),o=c}pv(o,a||Rr[0],s)}return o}function pv(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=t.class?t.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&n.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&n.classList.add(o[i]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)n.style.removeProperty(o[1])}t.style&&(n.style.cssText+=t.style)}}function gh(n,e,t){return mh(n,n,Rr,Gl(e,t,n.nodeType!=1))}function As(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function bu(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class fv{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=hv(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,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=sn,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 c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[i])&&!this.isLocked(d.dom)){a=c;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=qr.create(this.top,e[i],t,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,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,t,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,c=Math.min(this.top.children.length,a+5);a<c;a++){let d=this.top.children[a];if(d.matchesNode(e,t,r)&&!this.preMatch.matched.has(d)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,r,o,i){let s=this.top.children[o];return s.dirty==An&&s.dom==s.contentDOM&&(s.dirty=Ar),s.update(e,t,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==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=t}}updateNextNode(e,t,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let c=this.top.children[a];if(c instanceof gr){let d=this.preMatch.matched.get(c);if(d!=null&&d!=i)return!1;let u=c.dom,p,f=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=An&&As(t,c.outerDeco));if(!f&&c.update(e,t,r,o))return this.destroyBetween(this.index,a),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(p=this.recreateWrapper(c,e,t,r,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=Ar,p.updateChildren(o,s+1),p.dirty=sn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,o,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!As(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=gr.create(this.top,t,r,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let c of a.children)c.parent=a}return e.destroy(),a}addNode(e,t,r,o,i){let s=gr.create(this.top,e,t,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,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 ph(this.top,e,t,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof qr;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Sa)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Rt||Et)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new fh(this.top,[],r,null);t!=this.top?t.children.push(o):t.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 hv(n,e){let t=e,r=t.children.length,o=n.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let d=t.children[r-1];if(d instanceof qr)t=d,r=d.children.length;else{a=d,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let c=a.node;if(c){if(c!=n.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function mv(n,e){return n.type.side-e.type.side}function gv(n,e,t,r){let o=e.locals(n),i=0;if(o.length==0){for(let d=0;d<n.childCount;d++){let u=n.child(d);r(u,o,e.forChild(i,u),d),i+=u.nodeSize}return}let s=0,a=[],c=null;for(let d=0;;){let u,p;for(;s<o.length&&o[s].to==i;){let b=o[s++];b.widget&&(u?(p||(p=[u])).push(b):u=b)}if(u)if(p){p.sort(mv);for(let b=0;b<p.length;b++)t(p[b],d,!!c)}else t(u,d,!!c);let f,h;if(c)h=-1,f=c,c=null;else if(d<n.childCount)h=d,f=n.child(d++);else break;for(let b=0;b<a.length;b++)a[b].to<=i&&a.splice(b--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let m=i+f.nodeSize;if(f.isText){let b=m;s<o.length&&o[s].from<b&&(b=o[s].from);for(let y=0;y<a.length;y++)a[y].to<b&&(b=a[y].to);b<m&&(c=f.cut(b-i),f=f.cut(0,b-i),m=b,h=-1)}else for(;s<o.length&&o[s].to<m;)s++;let g=f.isInline&&!f.isLeaf?a.filter(b=>!b.inline):a.slice();r(f,g,e.forChild(i,f),h),i=m}}function bv(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function yv(n,e,t,r){for(let o=0,i=0;o<n.childCount&&i<=r;){let s=n.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let c=s.text;for(;o<n.childCount;){let d=n.child(o++);if(i+=d.nodeSize,!d.isText)break;c+=d.text}if(i>=t){if(i>=r&&c.slice(r-e.length-a,r-a)==e)return r-e.length;let d=a<r?c.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=t)return a+d;if(t==r&&c.length>=r+e.length-a&&c.slice(r-a,r-a+e.length)==e)return r}}return-1}function jl(n,e,t,r,o){let i=[];for(let s=0,a=0;s<n.length;s++){let c=n[s],d=a,u=a+=c.size;d>=t||u<=e?i.push(c):(d<e&&i.push(c.slice(0,e-d,r)),o&&(i.push(o),o=void 0),u>t&&i.push(c.slice(t-d,c.size,r)))}return i}function Rc(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let o=n.docView.nearestDesc(t.focusNode),i=o&&o.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let a=r.resolve(s),c,d;if(_a(t)){for(c=s;o&&!o.node;)o=o.parent;let p=o.node;if(o&&p.isAtom&&G.isSelectable(p)&&o.parent&&!(p.isInline&&Wy(t.focusNode,t.focusOffset,o.dom))){let f=o.posBefore;d=new G(s==f?a:r.resolve(f))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let p=s,f=s;for(let h=0;h<t.rangeCount;h++){let m=t.getRangeAt(h);p=Math.min(p,n.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,n.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(p<0)return null;[c,s]=f==n.state.selection.anchor?[f,p]:[p,f],a=r.resolve(s)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!d){let p=e=="pointer"||n.state.selection.head<a.pos&&!i?1:-1;d=Dc(n,u,a,p)}return d}function bh(n){return n.editable?n.hasFocus():vh(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function jn(n,e=!1){let t=n.state.selection;if(yh(n,t),!!bh(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Et){let r=n.domSelectionRange(),o=n.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Wr(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)kv(n);else{let{anchor:r,head:o}=t,i,s;yu&&!(t instanceof Y)&&(t.$from.parent.inlineContent||(i=vu(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(s=vu(n,t.to))),n.docView.setSelection(r,o,n,e),yu&&(i&&ku(i),s&&ku(s)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vv(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const yu=Rt||Et&&ih<63;function vu(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),o=r<t.childNodes.length?t.childNodes[r]:null,i=r?t.childNodes[r-1]:null;if(Rt&&o&&o.contentEditable=="false")return il(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return il(o);if(i)return il(i)}}function il(n){return n.contentEditable="true",Rt&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function ku(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function vv(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,o=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=o)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!bh(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function kv(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,o=r.nodeName=="IMG";o?t.setStart(r.parentNode,gt(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!o&&!n.state.selection.visible&&Ft&&mr<=11&&(r.disabled=!0,r.disabled=!1)}function yh(n,e){if(e instanceof G){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(wu(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else wu(n)}function wu(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Dc(n,e,t,r){return n.someProp("createSelectionBetween",o=>o(n,e,t))||Y.between(e,t,r)}function Eu(n){return n.editable&&!n.hasFocus()?!1:vh(n)}function vh(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function wv(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Wr(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Jl(n,e){let{$anchor:t,$head:r}=n.selection,o=e>0?t.max(r):t.min(r),i=o.parent.inlineContent?o.depth?n.doc.resolve(e>0?o.after():o.before()):null:o;return i&&ee.findFrom(i,e)}function rr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Cu(n,e,t){let r=n.state.selection;if(r instanceof Y)if(t.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=n.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return rr(n,new Y(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let o=Jl(n.state,e);return o&&o instanceof G?rr(n,o):!1}else if(!(rn&&t.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=n.docView.descAt(a))&&!s.contentDOM?G.isSelectable(i)?rr(n,new G(e<0?n.state.doc.resolve(o.pos-i.nodeSize):o)):Mi?rr(n,new Y(n.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof G&&r.node.isInline)return rr(n,new Y(e>0?r.$to:r.$from));{let o=Jl(n.state,e);return o?rr(n,o):!1}}}function Rs(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Zo(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function eo(n,e){return e<0?Ev(n):Cv(n)}function Ev(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o,i,s=!1;for(bn&&t.nodeType==1&&r<Rs(t)&&Zo(t.childNodes[r],-1)&&(s=!0);;)if(r>0){if(t.nodeType!=1)break;{let a=t.childNodes[r-1];if(Zo(a,-1))o=t,i=--r;else if(a.nodeType==3)t=a,r=t.nodeValue.length;else break}}else{if(kh(t))break;{let a=t.previousSibling;for(;a&&Zo(a,-1);)o=t.parentNode,i=gt(a),a=a.previousSibling;if(a)t=a,r=Rs(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?Yl(n,t,r):o&&Yl(n,o,i)}function Cv(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o=Rs(t),i,s;for(;;)if(r<o){if(t.nodeType!=1)break;let a=t.childNodes[r];if(Zo(a,1))i=t,s=++r;else break}else{if(kh(t))break;{let a=t.nextSibling;for(;a&&Zo(a,1);)i=a.parentNode,s=gt(a)+1,a=a.nextSibling;if(a)t=a,r=0,o=Rs(t);else{if(t=t.parentNode,t==n.dom)break;r=o=0}}}i&&Yl(n,i,s)}function kh(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function _v(n,e){for(;n&&e==n.childNodes.length&&!Oi(n);)e=gt(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Sv(n,e){for(;n&&!e&&!Oi(n);)e=gt(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function Yl(n,e,t){if(e.nodeType!=3){let i,s;(s=_v(e,t))?(e=s,t=0):(i=Sv(e,t))&&(e=i,t=i.nodeValue.length)}let r=n.domSelection();if(!r)return;if(_a(r)){let i=document.createRange();i.setEnd(e,t),i.setStart(e,t),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:o}=n;setTimeout(()=>{n.state==o&&jn(n)},50)}function _u(n,e){let t=n.state.doc.resolve(e);if(!(Et||Gy)&&t.parent.inlineContent){let o=n.coordsAtPos(e);if(e>t.start()){let i=n.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<t.end()){let i=n.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(n.dom).direction=="rtl"?"rtl":"ltr"}function Su(n,e,t){let r=n.state.selection;if(r instanceof Y&&!r.empty||t.indexOf("s")>-1||rn&&t.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Jl(n.state,e);if(s&&s instanceof G)return rr(n,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof Jt?ee.near(s,e):ee.findFrom(s,e);return a?rr(n,a):!1}return!1}function xu(n,e){if(!(n.state.selection instanceof Y))return!0;let{$head:t,$anchor:r,empty:o}=n.state.selection;if(!t.sameParent(r))return!0;if(!o)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(i&&!i.isText){let s=n.state.tr;return e<0?s.delete(t.pos-i.nodeSize,t.pos):s.delete(t.pos,t.pos+i.nodeSize),n.dispatch(s),!0}return!1}function Nu(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function xv(n){if(!Rt||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Nu(n,r,"true"),setTimeout(()=>Nu(n,r,"false"),20)}return!1}function Nv(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Tv(n,e){let t=e.keyCode,r=Nv(e);if(t==8||rn&&t==72&&r=="c")return xu(n,-1)||eo(n,-1);if(t==46&&!e.shiftKey||rn&&t==68&&r=="c")return xu(n,1)||eo(n,1);if(t==13||t==27)return!0;if(t==37||rn&&t==66&&r=="c"){let o=t==37?_u(n,n.state.selection.from)=="ltr"?-1:1:-1;return Cu(n,o,r)||eo(n,o)}else if(t==39||rn&&t==70&&r=="c"){let o=t==39?_u(n,n.state.selection.from)=="ltr"?1:-1:1;return Cu(n,o,r)||eo(n,o)}else{if(t==38||rn&&t==80&&r=="c")return Su(n,-1,r)||eo(n,-1);if(t==40||rn&&t==78&&r=="c")return xv(n)||Su(n,1,r)||eo(n,1);if(r==(rn?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Ic(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=n.someProp("clipboardSerializer")||Jr.fromSchema(n.state.schema),a=xh(),c=a.createElement("div");c.appendChild(s.serializeFragment(r,{document:a}));let d=c.firstChild,u,p=0;for(;d&&d.nodeType==1&&(u=Sh[d.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=a.createElement(u[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),p++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${o} ${i}${p?` -${p}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,`
|
|
4
|
+
**/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");function ht(n){this.content=n}ht.prototype={constructor:ht,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,o=r.find(n),i=r.content.slice();return o==-1?i.push(t||n,e):(i[o+1]=e,t&&(i[o]=t)),new ht(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ht(t)},addToStart:function(n,e){return new ht([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ht(t)},addBefore:function(n,e,t){var r=this.remove(e),o=r.content.slice(),i=r.find(n);return o.splice(i==-1?o.length:i,0,e,t),new ht(o)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ht.from(n),n.size?new ht(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ht.from(n),n.size?new ht(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ht.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ht.from=function(n){if(n instanceof ht)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ht(e)};function ff(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let o=n.child(r),i=e.child(r);if(o==i){t+=o.nodeSize;continue}if(!o.sameMarkup(i))return t;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)t++;return t}if(o.content.size||i.content.size){let s=ff(o.content,i.content,t+1);if(s!=null)return s}t+=o.nodeSize}}function hf(n,e,t,r){for(let o=n.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:t,b:r};let s=n.child(--o),a=e.child(--i),c=s.nodeSize;if(s==a){t-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let d=0,u=Math.min(s.text.length,a.text.length);for(;d<u&&s.text[s.text.length-d-1]==a.text[a.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let d=hf(s.content,a.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class S{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,o=0,i){for(let s=0,a=0;a<t;s++){let c=this.content[s],d=a+c.nodeSize;if(d>e&&r(c,o+a,i||null,s)!==!1&&c.content.size){let u=a+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,o+u)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,o){let i="",s=!0;return this.nodesBetween(e,t,(a,c)=>{let d=a.isText?a.text.slice(Math.max(e,c)-c,t-c):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=d},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(o[o.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new S(o,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],o=0;if(t>e)for(let i=0,s=0;s<t;i++){let a=this.content[i],c=s+a.nodeSize;c>e&&((s<e||c>t)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),o+=a.nodeSize),s=c}return new S(r,o)}cutByIndex(e,t){return e==t?S.empty:e==0&&t==this.content.length?this:new S(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let o=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return o[e]=t,new S(o,i)}addToStart(e){return new S([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new S(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let o=this.content[t];e(o,r,t),r+=o.nodeSize}}findDiffStart(e,t=0){return ff(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return hf(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Hi(0,e);if(e==this.size)return Hi(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||t>0?Hi(r+1,s):Hi(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,t){if(!t)return S.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new S(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return S.empty;let t,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)?(t||(t=e.slice(0,o)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new S(t||e,r)}static from(e){if(!e)return S.empty;if(e instanceof S)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new S([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}S.empty=new S([],0);const Ga={index:0,offset:0};function Hi(n,e){return Ga.index=n,Ga.offset=e,Ga}function Ns(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Ns(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Ns(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Be=class Dl{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,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))t||(t=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,o)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ns(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let o=r.create(t.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Dl.none;if(e instanceof Dl)return[e];let t=e.slice();return t.sort((r,o)=>r.type.rank-o.type.rank),t}};Be.none=[];class li extends Error{}class O{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=gf(this.content,e+this.openStart,t);return r&&new O(r,this.openStart,this.openEnd)}removeBetween(e,t){return new O(mf(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return O.empty;let r=t.openStart||0,o=t.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new O(S.fromJSON(e,t.content),r,o)}static maxOpen(e,t=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)o++;return new O(e,r,o)}}O.empty=new O(S.empty,0,0);function mf(n,e,t){let{index:r,offset:o}=n.findIndex(e),i=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(o==e||i.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(mf(i.content,e-o-1,t-o-1)))}function gf(n,e,t,r){let{index:o,offset:i}=n.findIndex(e),s=n.maybeChild(o);if(i==e||s.isText)return n.cut(0,e).append(t).append(n.cut(e));let a=gf(s.content,e-i-1,t);return a&&n.replaceChild(o,s.copy(a))}function Cb(n,e,t){if(t.openStart>n.depth)throw new li("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new li("Inconsistent open depths");return bf(n,e,t,0)}function bf(n,e,t,r){let o=n.index(r),i=n.node(r);if(o==e.index(r)&&r<n.depth-t.openStart){let s=bf(n,e,t,r+1);return i.copy(i.content.replaceChild(o,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,a=s.content;return Br(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=_b(t,n);return Br(i,vf(n,s,a,e,r))}else return Br(i,Ts(n,e,r))}function yf(n,e){if(!e.type.compatibleContent(n.type))throw new li("Cannot join "+e.type.name+" onto "+n.type.name)}function Il(n,e,t){let r=n.node(t);return yf(r,e.node(t)),r}function Ir(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Yo(n,e,t,r){let o=(e||n).node(t),i=0,s=e?e.index(t):o.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Ir(n.nodeAfter,r),i++));for(let a=i;a<s;a++)Ir(o.child(a),r);e&&e.depth==t&&e.textOffset&&Ir(e.nodeBefore,r)}function Br(n,e){return n.type.checkContent(e),n.copy(e)}function vf(n,e,t,r,o){let i=n.depth>o&&Il(n,e,o+1),s=r.depth>o&&Il(t,r,o+1),a=[];return Yo(null,n,o,a),i&&s&&e.index(o)==t.index(o)?(yf(i,s),Ir(Br(i,vf(n,e,t,r,o+1)),a)):(i&&Ir(Br(i,Ts(n,e,o+1)),a),Yo(e,t,o,a),s&&Ir(Br(s,Ts(t,r,o+1)),a)),Yo(r,null,o,a),new S(a)}function Ts(n,e,t){let r=[];if(Yo(null,n,t,r),n.depth>t){let o=Il(n,e,t+1);Ir(Br(o,Ts(n,e,t+1)),r)}return Yo(e,null,t,r),new S(r)}function _b(n,e){let t=e.depth-n.openStart,o=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)o=e.node(i).copy(S.from(o));return{start:o.resolveNoCache(n.openStart+t),end:o.resolveNoCache(o.content.size-n.openEnd-t)}}class ci{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(t);return r?e.child(t).cut(r):o}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],o=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Be.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),o=e.maybeChild(t);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 t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.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 t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Os(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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],o=0,i=t;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(i),d=i-c;if(r.push(s,a,o+c),!d||(s=s.child(a),s.isText))break;i=d-1,o+=c+1}return new ci(t,r,i)}static resolveCached(e,t){let r=Vd.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==t)return s}else Vd.set(e,r=new Sb);let o=r.elts[r.i]=ci.resolve(e,t);return r.i=(r.i+1)%xb,o}}class Sb{constructor(){this.elts=[],this.i=0}}const xb=12,Vd=new WeakMap;class Os{constructor(e,t,r){this.$from=e,this.$to=t,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 Nb=Object.create(null);let fr=class Bl{constructor(e,t,r,o=Be.none){this.type=e,this.attrs=t,this.marks=o,this.content=r||S.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,o=0){this.content.nodesBetween(e,t,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,t,r,o){return this.content.textBetween(e,t,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,t,r){return this.type==e&&Ns(this.attrs,t||e.defaultAttrs||Nb)&&Be.sameSet(this.marks,r||Be.none)}copy(e=null){return e==this.content?this:new Bl(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Bl(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return O.empty;let o=this.resolve(e),i=this.resolve(t),s=r?0:o.sharedDepth(t),a=o.start(s),d=o.node(s).content.cut(o.pos-a,i.pos-a);return new O(d,o.depth-s,i.depth-s)}replace(e,t,r){return Cb(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:o}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(o==e||t.isText)return t;e-=o+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let o=this.content.child(t-1);return{node:o,index:t-1,offset:r-o.nodeSize}}resolve(e){return ci.resolveCached(this,e)}resolveNoCache(e){return ci.resolve(this,e)}rangeHasMark(e,t,r){let o=!1;return t>e&&this.nodesBetween(e,t,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()+")"),kf(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=S.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let c=o;c<i;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,t);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=Be.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Be.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let o=S.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};fr.prototype.text=void 0;class Ms extends fr{constructor(e,t,r,o){if(super(e,t,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):kf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ms(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ms(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function kf(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Hr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Tb(e,t);if(r.next==null)return Hr.empty;let o=wf(r);r.next&&r.err("Unexpected trailing text");let i=Bb(Ib(o));return Lb(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let o=this;for(let i=t;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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let o=[this];function i(s,a){let c=s.matchFragment(e,r);if(c&&(!t||c.validEnd))return S.from(a.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:p}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(p)==-1){o.push(p);let f=i(p,a.concat(u));if(f)return f}}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 t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=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:c}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!o.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),t[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 t(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&t(r.next[o].next)}return t(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(`
|
|
5
|
+
`)}}Hr.empty=new Hr(!0);class Tb{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function wf(n){let e=[];do e.push(Ob(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Ob(n){let e=[];do e.push(Mb(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Mb(n){let e=Db(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Ab(n,e);else break;return e}function Hd(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Ab(n,e){let t=Hd(n),r=t;return n.eat(",")&&(n.next!="}"?r=Hd(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Rb(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let o=[];for(let i in t){let s=t[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&n.err("No node type or group '"+e+"' found"),o}function Db(n){if(n.eat("(")){let e=wf(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Rb(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Ib(n){let e=[[]];return o(i(n,0),t()),e;function t(){return e.push([])-1}function r(s,a,c){let d={term:c,to:a};return e[s].push(d),d}function o(s,a){s.forEach(c=>c.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(i(d,a)),[]);if(s.type=="seq")for(let c=0;;c++){let d=i(s.exprs[c],a);if(c==s.exprs.length-1)return d;o(d,a=t())}else if(s.type=="star"){let c=t();return r(a,c),o(i(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=t();return o(i(s.expr,a),c),o(i(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let c=a;for(let d=0;d<s.min;d++){let u=t();o(i(s.expr,c),u),c=u}if(s.max==-1)o(i(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=t();r(c,u),o(i(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Ef(n,e){return e-n}function Ud(n,e){let t=[];return r(e),t.sort(Ef);function r(o){let i=n[o];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(o);for(let s=0;s<i.length;s++){let{term:a,to:c}=i[s];!a&&t.indexOf(c)==-1&&r(c)}}}function Bb(n){let e=Object.create(null);return t(Ud(n,0));function t(r){let o=[];r.forEach(s=>{n[s].forEach(({term:a,to:c})=>{if(!a)return;let d;for(let u=0;u<o.length;u++)o[u][0]==a&&(d=o[u][1]);Ud(n,c).forEach(u=>{d||o.push([a,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let i=e[r.join(",")]=new Hr(r.indexOf(n.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(Ef);i.next.push({type:o[s][0],next:e[a.join(",")]||t(a)})}return i}}function Lb(n,e){for(let t=0,r=[n];t<r.length;t++){let o=r[t],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:c,next:d}=o.next[a];s.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),r.indexOf(d)==-1&&r.push(d)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Cf(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function _f(n,e){let t=Object.create(null);for(let r in n){let o=e&&e[r];if(o===void 0){let i=n[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=o}return t}function Sf(n,e,t,r){for(let o in e)if(!(o in n))throw new RangeError(`Unsupported attribute ${o} for ${t} of type ${o}`);for(let o in n){let i=n[o];i.validate&&i.validate(e[o])}}function xf(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new $b(n,r,e[r]);return t}let Wd=class Nf{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=xf(e,r.attrs),this.defaultAttrs=Cf(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==Hr.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:_f(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new fr(this,this.computeAttrs(e),S.from(t),Be.setFrom(r))}createChecked(e=null,t,r){return t=S.from(t),this.checkContent(t),new fr(this,this.computeAttrs(e),t,Be.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=S.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(S.empty,!0);return i?new fr(this,e,t.append(i),Be.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.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){Sf(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Be.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,s)=>r[i]=new Nf(i,t,s));let o=t.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 Pb(n,e,t){let r=t.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 ${n}, got ${i}`)}}class $b{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Pb(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ni{constructor(e,t,r,o){this.name=e,this.rank=t,this.schema=r,this.spec=o,this.attrs=xf(e,o.attrs),this.excluded=null;let i=Cf(this.attrs);this.instance=i?new Be(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Be(this,_f(this.attrs,e))}static compile(e,t){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Ni(i,o++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Sf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Tf{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let o in e)t[o]=e[o];t.nodes=ht.from(e.nodes),t.marks=ht.from(e.marks||{}),this.nodes=Wd.compile(this.spec.nodes,this),this.marks=Ni.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]=Hr.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?qd(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==""?[]:qd(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,t=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Wd){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(t,r,o)}text(e,t){let r=this.nodes.text;return new Ms(r,r.defaultAttrs,e,Be.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return fr.fromJSON(this,e)}markFromJSON(e){return Be.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function qd(n,e){let t=[];for(let r=0;r<e.length;r++){let o=e[r],i=n.marks[o],s=i;if(i)t.push(i);else for(let a in n.marks){let c=n.marks[a];(o=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&t.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Fb(n){return n.tag!=null}function zb(n){return n.style!=null}class hr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(o=>{if(Fb(o))this.tags.push(o);else if(zb(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,t={}){let r=new Gd(this,t,!1);return r.addAll(e,Be.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Gd(this,t,!0);return r.addAll(e,Be.none,t.from,t.to),O.maxOpen(r.finish())}matchTag(e,t,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(Ub(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,t,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)!=t))){if(s.getAttrs){let c=s.getAttrs(t);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let t=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<t.length;s++){let a=t[s];if((a.priority==null?50:a.priority)<i)break}t.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=jd(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=jd(s)),s.node||s.ignore||s.mark||(s.node=o)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new hr(e,hr.schemaRules(e)))}}const Of={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},Vb={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Mf={ol:!0,ul:!0},di=1,Ll=2,fs=4;function Kd(n,e,t){return e!=null?(e?di:0)|(e==="full"?Ll:0):n&&n.whitespace=="pre"?di|Ll:t&-5}class Ui{constructor(e,t,r,o,i,s){this.type=e,this.attrs=t,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Be.none,this.match=i||(s&fs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(S.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);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&di)){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 t=S.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(S.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Of.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Gd{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=t.topNode,i,s=Kd(null,t.preserveWhitespace,0)|(r?fs:0);o?i=new Ui(o.type,o.attrs,Be.none,!0,t.topMatch||o.type.contentMatch,s):r?i=new Ui(null,null,Be.none,!0,null,s):i=new Ui(e.schema.topNodeType,null,Be.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,o=this.top,i=o.options&Ll?"full":this.localPreserveWS||(o.options&di)>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,`
|
|
6
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Mf.hasOwnProperty(s)&&this.parser.normalizeLists&&Hb(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(c?c.ignore:Vb.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(Of.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),d=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let p=c&&c.skip?t:this.readStyles(e,t);p&&this.addAll(e,p),d&&this.sync(i),this.needsBlock=u}else{let d=this.readStyles(e,t);d&&this.addElementByRule(e,c,d,c.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
7
|
+
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){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 c=this.parser.matchStyle(i,s,this,a);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(d=>!c.clearMark(d)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)a=c;else break}}return t}addElementByRule(e,t,r,o){let i,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,t.attrs||null,r,t.preserveWhitespace);c&&(i=!0,r=c)}else{let c=this.parser.schema.marks[t.mark];r=r.concat(c.create(t.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}i&&this.sync(a)&&this.open--}addAll(e,t,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,t);this.findAtPoint(e,i)}findPlace(e,t){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,o=s,!a.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)t=this.enterInner(r[i],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let r=this.findPlace(e,t);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=Be.none;for(let s of r.concat(e.marks))(o.type?o.type.allowsMarkType(s.type):Jd(s.type,e.type))&&(i=s.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,t,r,o){let i=this.findPlace(e.create(t),r);return i&&(i=this.enterInner(e,t,r,!0,o)),i}enterInner(e,t,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Kd(e,i,s.options);s.options&fs&&s.content.length==0&&(a|=fs);let c=Be.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):Jd(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new Ui(e,t,c,o,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=di)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&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)&&t.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),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,c)=>{for(;a>=0;a--){let d=t[a];if(d==""){if(a==t.length-1||a==0)continue;for(;c>=i;c--)if(s(a-1,c))return!0;return!1}else{let u=c>0||c==0&&o?this.nodes[c].type:r&&c>=i?r.node(c-i).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Hb(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Mf.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Ub(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function jd(n){let e={};for(let t in n)e[t]=n[t];return e}function Jd(n,e){let t=e.schema.nodes;for(let r in t){let o=t[r];if(!o.allowsMarkType(n))continue;let i=[],s=a=>{i.push(a);for(let c=0;c<a.edgeCount;c++){let{type:d,next:u}=a.edge(c);if(d==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class Jr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=ja(t).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,c=0;for(;a<i.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(i[a][0])||d.type.spec.spanning===!1)break;a++,c++}for(;a<i.length;)o=i.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,t);u&&(i.push([d,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:o}=hs(ja(t),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,t,o)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let o=this.marks[e.type.name];return o&&hs(ja(r),o(e,t),null,e.attrs)}static renderSpec(e,t,r=null,o){return hs(e,t,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Jr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Yd(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Yd(e.marks)}}function Yd(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function ja(n){return n.document||window.document}const Xd=new WeakMap;function Wb(n){let e=Xd.get(n);return e===void 0&&Xd.set(n,e=qb(n)),e}function qb(n){let e=null;function t(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++)t(r[o]);else for(let o in r)t(r[o])}return t(n),e}function hs(n,e,t,r){if(typeof e=="string")return{dom:n.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=Wb(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&&(t=o.slice(0,s),o=o.slice(s+1));let a,c=t?n.createElementNS(t,o):n.createElement(o),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let p in d)if(d[p]!=null){let f=p.indexOf(" ");f>0?c.setAttributeNS(p.slice(0,f),p.slice(f+1),d[p]):c.setAttribute(p,d[p])}}for(let p=u;p<e.length;p++){let f=e[p];if(f===0){if(p<e.length-1||p>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:h,contentDOM:m}=hs(n,f,t,r);if(c.appendChild(h),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const Af=65535,Rf=Math.pow(2,16);function Kb(n,e){return n+e*Rf}function Zd(n){return n&Af}function Gb(n){return(n-(n&Af))/Rf}const Df=1,If=2,ms=4,Bf=8;let Pl=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Bf)>0}get deletedBefore(){return(this.delInfo&(Df|ms))>0}get deletedAfter(){return(this.delInfo&(If|ms))>0}get deletedAcross(){return(this.delInfo&ms)>0}},Ur=class ro{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ro.empty)return ro.empty}recover(e){let t=0,r=Zd(e);if(!this.inverted)for(let o=0;o<r;o++)t+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+t+Gb(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,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 c=this.ranges[a]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[a+i],u=this.ranges[a+s],p=c+d;if(e<=p){let f=d?e==c?-1:e==p?1:t:t,h=c+o+(f<0?0:u);if(r)return h;let m=e==(t<0?c:p)?null:Kb(a/3,e-c),g=e==c?If:e==p?Df:ms;return(t<0?e!=c:e!=p)&&(g|=Bf),new Pl(h,g,m)}o+=u-d}return r?e+o:new Pl(e+o,0,null)}touches(e,t){let r=0,o=Zd(t),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[a+i],u=c+d;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let t=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),c=s+(this.inverted?0:i),d=this.ranges[o+t],u=this.ranges[o+r];e(a,a+d,c,c+u),i+=u-d}}invert(){return new ro(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ro.empty:new ro(e<0?[0,-e,0]:[0,0,e])}};Ur.empty=new Ur([]);let jb=class gs{constructor(e=[],t,r=0,o=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=o}slice(e=0,t=this.maps.length){return new gs(this.maps,this.mirror,e,t)}copy(){return new gs(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let o=e.getMirror(t);this.appendMap(e.maps[t],o!=null&&o<t?r+o:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new gs;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(e,t);if(a.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this.maps[c].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Pl(e,o,null)}};const Ja=Object.create(null);let _t=class{getMap(){return Ur.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ja[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ja)throw new RangeError("Duplicate use of step JSON ID "+e);return Ja[e]=t,t.prototype.jsonID=e,t}},At=class zo{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new zo(e,null)}static fail(e){return new zo(null,e)}static fromReplace(e,t,r,o){try{return zo.ok(e.replace(t,r,o))}catch(i){if(i instanceof li)return zo.fail(i.message);throw i}}};function Cc(n,e,t){let r=[];for(let o=0;o<n.childCount;o++){let i=n.child(o);i.content.size&&(i=i.copy(Cc(i.content,e,i))),i.isInline&&(i=e(i,t,o)),r.push(i)}return S.fromArray(r)}let _c=class Vo extends _t{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new O(Cc(t.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),t.openStart,t.openEnd);return At.fromReplace(e,this.from,this.to,i)}invert(){return new Ti(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Vo(t.pos,r.pos,this.mark)}merge(e){return e instanceof Vo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Vo(t.from,t.to,e.markFromJSON(t.mark))}};_t.jsonID("addMark",_c);let Ti=class Ho extends _t{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new O(Cc(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return At.fromReplace(e,this.from,this.to,r)}invert(){return new _c(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ho(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ho&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ho(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ho(t.from,t.to,e.markFromJSON(t.mark))}};_t.jsonID("removeMark",Ti);let Sc=class Uo extends _t{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return At.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return At.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(r))return new Uo(this.pos,t.marks[o]);return new Uo(this.pos,this.mark)}}return new xc(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Uo(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Uo(t.pos,e.markFromJSON(t.mark))}};_t.jsonID("addNodeMark",Sc);let xc=class $l extends _t{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return At.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return At.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Sc(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $l(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new $l(t.pos,e.markFromJSON(t.mark))}};_t.jsonID("removeNodeMark",xc);let Jn=class Nr extends _t{constructor(e,t,r,o=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=o}apply(e){return this.structure&&Fl(e,this.from,this.to)?At.fail("Structure replace would overwrite content"):At.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ur([this.from,this.to-this.from,this.slice.size])}invert(e){return new Nr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new Nr(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Nr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?O.empty:new O(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Nr(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?O.empty:new O(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Nr(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Nr(t.from,t.to,O.fromJSON(e,t.slice),!!t.structure)}};_t.jsonID("replace",Jn);let Yr=class bs extends _t{constructor(e,t,r,o,i,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Fl(e,this.from,this.gapFrom)||Fl(e,this.gapTo,this.to)))return At.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return At.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?At.fromReplace(e,this.from,this.to,r):At.fail("Content does not fit in gap")}getMap(){return new Ur([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new bs(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||o<t.pos||i>r.pos?null:new bs(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bs(t.from,t.to,t.gapFrom,t.gapTo,O.fromJSON(e,t.slice),t.insert,!!t.structure)}};_t.jsonID("replaceAround",Yr);function Fl(n,e,t){let r=n.resolve(e),o=t-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 Jb(n,e,t,r){let o=[],i=[],s,a;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let p=c.marks;if(!r.isInSet(p)&&u.type.allowsMarkType(r.type)){let f=Math.max(d,e),h=Math.min(d+c.nodeSize,t),m=r.addToSet(p);for(let g=0;g<p.length;g++)p[g].isInSet(m)||(s&&s.to==f&&s.mark.eq(p[g])?s.to=h:o.push(s=new Ti(f,h,p[g])));a&&a.to==f?a.to=h:i.push(a=new _c(f,h,r))}}),o.forEach(c=>n.step(c)),i.forEach(c=>n.step(c))}function Yb(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;i++;let c=null;if(r instanceof Ni){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(a+s.nodeSize,t);for(let u=0;u<c.length;u++){let p=c[u],f;for(let h=0;h<o.length;h++){let m=o[h];m.step==i-1&&p.eq(o[h].style)&&(f=m)}f?(f.to=d,f.step=i):o.push({style:p,from:Math.max(a,e),to:d,step:i})}}}),o.forEach(s=>n.step(new Ti(s.from,s.to,s.style)))}function Xb(n,e,t,r=t.contentMatch){let o=n.doc.nodeAt(e),i=[],s=e+1;for(let a=0;a<o.childCount;a++){let c=o.child(a),d=s+c.nodeSize,u=r.matchType(c.type);if(!u)i.push(new Jn(s,d,O.empty));else{r=u;for(let p=0;p<c.marks.length;p++)t.allowsMarkType(c.marks[p].type)||n.step(new Ti(s,d,c.marks[p]));if(c.isText&&!t.spec.code){let p,f=/\r?\n|\r/g,h;for(;p=f.exec(c.text);)h||(h=new O(S.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),i.push(new Jn(s+p.index,s+p.index+p[0].length,h))}}s=d}if(!r.validEnd){let a=r.fillBefore(S.empty,!0);n.replace(s,s,new O(a,0,0))}for(let a=i.length-1;a>=0;a--)n.step(i[a])}function Zb(n,e,t){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),c=s,d=a,u=S.empty,p=0;for(let m=i,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=S.from(r.node(m).copy(u)),p++):c--;let f=S.empty,h=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)<o.end(m)?(g=!0,f=S.from(o.node(m).copy(f)),h++):d++;n.step(new Yr(c,d,s,a,new O(u.append(f),p,h),u.size-p,!0))}function Qb(n,e,t){let r=S.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let a=t[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=S.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new Yr(o,i,o,i,new O(r,0,0),t.length,!0))}function ey(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&ty(n.doc,n.mapping.slice(i).map(a),r)){n.clearIncompatible(n.mapping.slice(i).map(a,1),r);let c=n.mapping.slice(i),d=c.map(a,1),u=c.map(a+s.nodeSize,1);return n.step(new Yr(d,u,d+1,u-1,new O(S.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function ty(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function ny(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Yr(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new O(S.from(s),0,0),1,!0))}function ry(n,e,t=1,r){let o=n.doc.resolve(e),i=S.empty,s=S.empty;for(let a=o.depth,c=o.depth-t,d=t-1;a>c;a--,d--){i=S.from(o.node(a).copy(i));let u=r&&r[d];s=S.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}n.step(new Jn(e,e,new O(i.append(s),t,t),!0))}function oy(n,e,t){let r=new Jn(e-t,e+t,O.empty,!0);n.step(r)}function iy(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))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,t))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,t))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function sy(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let o=t.content;for(let i=0;i<t.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(t.openStart==0&&t.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,c=r.index(s)+(a>0?1:0),d=r.node(s),u=!1;if(i==1)u=d.canReplace(c,c,o);else{let p=d.contentMatchAt(c).findWrapping(o.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function ay(n,e,t=e,r=O.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return Lf(o,i,r)?new Jn(e,t,r):new ly(o,i,r).fit()}function Lf(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}let ly=class{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=S.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=S.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=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 c=new O(i,s,a);return e>-1?new Yr(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new Jn(r.pos,o.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Ya(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:c,match:d}=this.frontier[a],u,p=null;if(t==1&&(s?d.matchType(s.type)||(p=d.fillBefore(S.from(s),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:p};if(t==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&d.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=Ya(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new O(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=Ya(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new O(Wo(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new O(Wo(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:p,type:f}=this.frontier[t];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));p=p.matchFragment(o)}let h=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),b=p.matchType(g.type);if(!b)break;d++,(d>1||c==0||g.content.size)&&(p=b,u.push(Pf(g.mark(f.allowedMarks(g.marks)),d==1?c:0,d==a.childCount?h:-1)))}let m=d==a.childCount;m||(h=-1),this.placed=qo(this.placed,t,S.from(u)),this.frontier[t].match=p,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=a;g<h;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?O.empty:new O(Wo(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new O(Wo(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Xa(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=Xa(e,t,o,r,i);if(s){for(let a=t-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],u=Xa(e,a,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=qo(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=qo(this.placed,this.depth,S.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(S.empty,!0);t.childCount&&(this.placed=qo(this.placed,this.frontier.length,t))}};function Wo(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Wo(n.firstChild.content,e-1,t)))}function qo(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(qo(n.lastChild.content,e-1,t)))}function Ya(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Pf(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Pf(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(S.empty,!0)))),n.copy(r)}function Xa(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!cy(t,i.content,s)?a:null}function cy(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function dy(n){return n.spec.defining||n.spec.definingForContent}function uy(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let o=n.doc.resolve(e),i=n.doc.resolve(t);if(Lf(o,i,r))return n.step(new Jn(e,t,r));let s=Ff(o,n.doc.resolve(t));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==h&&s.splice(1,0,-f)}let c=s.indexOf(a),d=[],u=r.openStart;for(let f=r.content,h=0;;h++){let m=f.firstChild;if(d.push(m),h==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let h=d[f],m=dy(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(m||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),m=d[h];if(m)for(let g=0;g<s.length;g++){let b=s[(g+c)%s.length],y=!0;b<0&&(y=!1,b=-b);let k=o.node(b-1),E=o.index(b-1);if(k.canReplaceWith(E,E,m.type,m.marks))return n.replace(o.before(b),y?i.after(b):t,new O($f(r.content,0,r.openStart,h),h,r.openEnd))}}let p=n.steps.length;for(let f=s.length-1;f>=0&&(n.replace(e,t,r),!(n.steps.length>p));f--){let h=s[f];h<0||(e=o.before(h),t=i.after(h))}}function $f(n,e,t,r,o){if(e<t){let i=n.firstChild;n=n.replaceChild(0,i.copy($f(i.content,e+1,t,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(S.empty,!0))}return n}function py(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=iy(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new O(S.from(r),0,0))}function fy(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=Ff(r,o);for(let s=0;s<i.length;s++){let a=i[s],c=s==i.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return n.delete(r.start(a),o.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return n.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&&t>r.end(s)&&o.end(s)-t!=o.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function Ff(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(i<n.pos-(n.depth-o)||e.end(o)>e.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}let zf=class ys extends _t{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return At.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return At.fromReplace(e,this.pos,this.pos+1,new O(S.from(o),0,t.isLeaf?0:1))}getMap(){return Ur.empty}invert(e){return new ys(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ys(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ys(t.pos,t.attr,t.value)}};_t.jsonID("attr",zf);let Vf=class zl extends _t{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return At.ok(r)}getMap(){return Ur.empty}invert(e){return new zl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new zl(t.attr,t.value)}};_t.jsonID("docAttr",Vf);let go=class extends Error{};go=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};go.prototype=Object.create(Error.prototype);go.prototype.constructor=go;go.prototype.name="TransformError";let hy=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new jb}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new go(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=O.empty){let o=ay(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new O(S.from(r),0,0))}delete(e,t){return this.replace(e,t,O.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return uy(this,e,t,r),this}replaceRangeWith(e,t,r){return py(this,e,t,r),this}deleteRange(e,t){return fy(this,e,t),this}lift(e,t){return Zb(this,e,t),this}join(e,t=1){return oy(this,e,t),this}wrap(e,t){return Qb(this,e,t),this}setBlockType(e,t=e,r,o=null){return ey(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return ny(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new zf(e,t,r)),this}setDocAttribute(e,t){return this.step(new Vf(e,t)),this}addNodeMark(e,t){return this.step(new Sc(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new xc(e,t)),this}split(e,t=1,r){return ry(this,e,t,r),this}addMark(e,t,r){return Jb(this,e,t,r),this}removeMark(e,t,r){return Yb(this,e,t,r),this}clearIncompatible(e,t,r){return Xb(this,e,t,r),this}};const Za=Object.create(null);class ee{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new Hf(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=O.empty){let r=t.content.lastChild,o=null;for(let a=0;a<t.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:c,$to:d}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(c.pos),u.map(d.pos),a?O.empty:t),a==0&&tu(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(a.pos);i?e.deleteRange(d,u):(e.replaceRangeWith(d,u,t),tu(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let o=e.parent.inlineContent?new Y(e):oo(e.node(0),e.parent,e.pos,e.index(),t,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=t<0?oo(e.node(0),e.node(i),e.before(i+1),e.index(i),t,r):oo(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Jt(e.node(0))}static atStart(e){return oo(e,e,0,0,1)||new Jt(e)}static atEnd(e){return oo(e,e,e.content.size,e.childCount,-1)||new Jt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Za[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Za)throw new RangeError("Duplicate use of selection JSON ID "+e);return Za[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Y.between(this.$anchor,this.$head).getBookmark()}}ee.prototype.visible=!0;class Hf{constructor(e,t){this.$from=e,this.$to=t}}let Qd=!1;function eu(n){!Qd&&!n.parent.inlineContent&&(Qd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Y extends ee{constructor(e,t=e){eu(e),eu(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ee.near(r);let o=e.resolve(t.map(this.anchor));return new Y(o.parent.inlineContent?o:r,r)}replace(e,t=O.empty){if(super.replace(e,t),t==O.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 wa(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Y(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let o=e.resolve(t);return new this(o,r==t?o:e.resolve(r))}static between(e,t,r){let o=e.pos-t.pos;if((!r||o)&&(r=o>=0?1:-1),!t.parent.inlineContent){let i=ee.findFrom(t,r,!0)||ee.findFrom(t,-r,!0);if(i)t=i.$head;else return ee.near(t,r)}return e.parent.inlineContent||(o==0?e=t:(e=(ee.findFrom(e,-r,!0)||ee.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=o<0&&(e=t))),new Y(e,t)}}ee.jsonID("text",Y);class wa{constructor(e,t){this.anchor=e,this.head=t}map(e){return new wa(e.map(this.anchor),e.map(this.head))}resolve(e){return Y.between(e.resolve(this.anchor),e.resolve(this.head))}}class G extends ee{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:o}=t.mapResult(this.anchor),i=e.resolve(o);return r?ee.near(i):new G(i)}content(){return new O(S.from(this.node),0,0)}eq(e){return e instanceof G&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Nc(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new G(e.resolve(t.anchor))}static create(e,t){return new G(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}G.prototype.visible=!1;ee.jsonID("node",G);class Nc{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new wa(r,r):new Nc(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&G.isSelectable(r)?new G(t):ee.near(t)}}class Jt extends ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=O.empty){if(t==O.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,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Jt(e)}map(e){return new Jt(e)}eq(e){return e instanceof Jt}getBookmark(){return my}}ee.jsonID("all",Jt);const my={map(){return this},resolve(n){return new Jt(n)}};function oo(n,e,t,r,o,i=!1){if(e.inlineContent)return Y.create(n,t);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&&G.isSelectable(a))return G.create(n,t-(o<0?a.nodeSize:0))}else{let c=oo(n,a,t+o,o<0?a.childCount:0,o,i);if(c)return c}t+=a.nodeSize*o}return null}function tu(n,e,t){let r=n.steps.length-1;if(r<e)return;let o=n.steps[r];if(!(o instanceof Jn||o instanceof Yr))return;let i=n.mapping.maps[r],s;i.forEach((a,c,d,u)=>{s==null&&(s=u)}),n.setSelection(ee.near(n.doc.resolve(s),t))}const nu=1,ru=2,ou=4;class gy extends hy{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|nu)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&nu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ru,this}ensureMarks(e){return Be.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&ru)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Be.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let o=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(t);i=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,o.text(e,i)),this.selection.empty||this.setSelection(ee.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,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|=ou,this}get scrolledIntoView(){return(this.updated&ou)>0}}function iu(n,e){return!e||!n?n:n.bind(e)}class Ko{constructor(e,t,r){this.name=e,this.init=iu(t.init,r),this.apply=iu(t.apply,r)}}const by=[new Ko("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ko("selection",{init(n,e){return n.selection||ee.atStart(e.doc)},apply(n){return n.selection}}),new Ko("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ko("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class Qa{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=by.slice(),t&&t.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 Ko(r.key,r.spec.state,r))})}}class uo{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){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 t=[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 c=o?o[s].n:0,d=o?o[s].state:this,u=c<t.length&&a.spec.appendTransaction.call(a,c?t.slice(c):t,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let p=0;p<this.config.plugins.length;p++)o.push(p<s?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:t.length})}}if(!i)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new uo(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new gy(this)}static create(e){let t=new Qa(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new uo(t);for(let o=0;o<t.fields.length;o++)r[t.fields[o].name]=t.fields[o].init(e,r);return r}reconfigure(e){let t=new Qa(this.schema,e.plugins),r=t.fields,o=new uo(t);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 t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.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&&(t[r]=i.toJSON.call(o,this[o.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Qa(e.schema,e.plugins),i=new uo(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=fr.fromJSON(e.schema,t.doc);else if(s.name=="selection")i.selection=ee.fromJSON(i.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){i[s.name]=d.fromJSON.call(c,e,t[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function Uf(n,e,t){for(let r in n){let o=n[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=Uf(o,e,{})),t[r]=o}return t}class Te{constructor(e){this.spec=e,this.props={},e.props&&Uf(e.props,this,this.props),this.key=e.key?e.key.key:Wf("plugin")}getState(e){return e[this.key]}}const el=Object.create(null);function Wf(n){return n in el?n+"$"+ ++el[n]:(el[n]=0,n+"$")}class $e{constructor(e="key"){this.key=Wf(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const qf=65535,Kf=Math.pow(2,16);function yy(n,e){return n+e*Kf}function su(n){return n&qf}function vy(n){return(n-(n&qf))/Kf}const Gf=1,jf=2,vs=4,Jf=8;class Vl{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Jf)>0}get deletedBefore(){return(this.delInfo&(Gf|vs))>0}get deletedAfter(){return(this.delInfo&(jf|vs))>0}get deletedAcross(){return(this.delInfo&vs)>0}}class Kt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Kt.empty)return Kt.empty}recover(e){let t=0,r=su(e);if(!this.inverted)for(let o=0;o<r;o++)t+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+t+vy(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,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 c=this.ranges[a]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[a+i],u=this.ranges[a+s],p=c+d;if(e<=p){let f=d?e==c?-1:e==p?1:t:t,h=c+o+(f<0?0:u);if(r)return h;let m=e==(t<0?c:p)?null:yy(a/3,e-c),g=e==c?jf:e==p?Gf:vs;return(t<0?e!=c:e!=p)&&(g|=Jf),new Vl(h,g,m)}o+=u-d}return r?e+o:new Vl(e+o,0,null)}touches(e,t){let r=0,o=su(t),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[a+i],u=c+d;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let t=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),c=s+(this.inverted?0:i),d=this.ranges[o+t],u=this.ranges[o+r];e(a,a+d,c,c+u),i+=u-d}}invert(){return new Kt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Kt.empty:new Kt(e<0?[0,-e,0]:[0,0,e])}}Kt.empty=new Kt([]);class fo{constructor(e=[],t,r=0,o=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=o}slice(e=0,t=this.maps.length){return new fo(this.maps,this.mirror,e,t)}copy(){return new fo(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let o=e.getMirror(t);this.appendMap(e.maps[t],o!=null&&o<t?r+o:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new fo;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(e,t);if(a.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this.maps[c].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Vl(e,o,null)}}const tl=Object.create(null);class St{getMap(){return Kt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=tl[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in tl)throw new RangeError("Duplicate use of step JSON ID "+e);return tl[e]=t,t.prototype.jsonID=e,t}}class tt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new tt(e,null)}static fail(e){return new tt(null,e)}static fromReplace(e,t,r,o){try{return tt.ok(e.replace(t,r,o))}catch(i){if(i instanceof li)return tt.fail(i.message);throw i}}}function Tc(n,e,t){let r=[];for(let o=0;o<n.childCount;o++){let i=n.child(o);i.content.size&&(i=i.copy(Tc(i.content,e,i))),i.isInline&&(i=e(i,t,o)),r.push(i)}return S.fromArray(r)}class cr extends St{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new O(Tc(t.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),t.openStart,t.openEnd);return tt.fromReplace(e,this.from,this.to,i)}invert(){return new Tn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new cr(t.pos,r.pos,this.mark)}merge(e){return e instanceof cr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new cr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new cr(t.from,t.to,e.markFromJSON(t.mark))}}St.jsonID("addMark",cr);class Tn extends St{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new O(Tc(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return tt.fromReplace(e,this.from,this.to,r)}invert(){return new cr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Tn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Tn(t.from,t.to,e.markFromJSON(t.mark))}}St.jsonID("removeMark",Tn);class dr extends St{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return tt.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(r))return new dr(this.pos,t.marks[o]);return new dr(this.pos,this.mark)}}return new bo(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new dr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new dr(t.pos,e.markFromJSON(t.mark))}}St.jsonID("addNodeMark",dr);class bo extends St{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return tt.fromReplace(e,this.pos,this.pos+1,new O(S.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new dr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new bo(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new bo(t.pos,e.markFromJSON(t.mark))}}St.jsonID("removeNodeMark",bo);class mt extends St{constructor(e,t,r,o=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=o}apply(e){return this.structure&&Hl(e,this.from,this.to)?tt.fail("Structure replace would overwrite content"):tt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Kt([this.from,this.to-this.from,this.slice.size])}invert(e){return new mt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new mt(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof mt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?O.empty:new O(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new mt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?O.empty:new O(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new mt(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new mt(t.from,t.to,O.fromJSON(e,t.slice),!!t.structure)}}St.jsonID("replace",mt);class yt extends St{constructor(e,t,r,o,i,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Hl(e,this.from,this.gapFrom)||Hl(e,this.gapTo,this.to)))return tt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return tt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?tt.fromReplace(e,this.from,this.to,r):tt.fail("Content does not fit in gap")}getMap(){return new Kt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new yt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||o<t.pos||i>r.pos?null:new yt(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new yt(t.from,t.to,t.gapFrom,t.gapTo,O.fromJSON(e,t.slice),t.insert,!!t.structure)}}St.jsonID("replaceAround",yt);function Hl(n,e,t){let r=n.resolve(e),o=t-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 ky(n,e,t,r){let o=[],i=[],s,a;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let p=c.marks;if(!r.isInSet(p)&&u.type.allowsMarkType(r.type)){let f=Math.max(d,e),h=Math.min(d+c.nodeSize,t),m=r.addToSet(p);for(let g=0;g<p.length;g++)p[g].isInSet(m)||(s&&s.to==f&&s.mark.eq(p[g])?s.to=h:o.push(s=new Tn(f,h,p[g])));a&&a.to==f?a.to=h:i.push(a=new cr(f,h,r))}}),o.forEach(c=>n.step(c)),i.forEach(c=>n.step(c))}function wy(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;i++;let c=null;if(r instanceof Ni){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(a+s.nodeSize,t);for(let u=0;u<c.length;u++){let p=c[u],f;for(let h=0;h<o.length;h++){let m=o[h];m.step==i-1&&p.eq(o[h].style)&&(f=m)}f?(f.to=d,f.step=i):o.push({style:p,from:Math.max(a,e),to:d,step:i})}}}),o.forEach(s=>n.step(new Tn(s.from,s.to,s.style)))}function Oc(n,e,t,r=t.contentMatch,o=!0){let i=n.doc.nodeAt(e),s=[],a=e+1;for(let c=0;c<i.childCount;c++){let d=i.child(c),u=a+d.nodeSize,p=r.matchType(d.type);if(!p)s.push(new mt(a,u,O.empty));else{r=p;for(let f=0;f<d.marks.length;f++)t.allowsMarkType(d.marks[f].type)||n.step(new Tn(a,u,d.marks[f]));if(o&&d.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(d.text);)m||(m=new O(S.from(t.schema.text(" ",t.allowedMarks(d.marks))),0,0)),s.push(new mt(a+f.index,a+f.index+f[0].length,m))}}a=u}if(!r.validEnd){let c=r.fillBefore(S.empty,!0);n.replace(a,a,new O(c,0,0))}for(let c=s.length-1;c>=0;c--)n.step(s[c])}function Ey(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Oo(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(r<n.depth&&o.canReplace(i,s,t))return r;if(r==0||o.type.spec.isolating||!Ey(o,i,s))break}return null}function Cy(n,e,t){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),c=s,d=a,u=S.empty,p=0;for(let m=i,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=S.from(r.node(m).copy(u)),p++):c--;let f=S.empty,h=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)<o.end(m)?(g=!0,f=S.from(o.node(m).copy(f)),h++):d++;n.step(new yt(c,d,s,a,new O(u.append(f),p,h),u.size-p,!0))}function Mc(n,e,t=null,r=n){let o=_y(n,e),i=o&&Sy(r,e);return i?o.map(au).concat({type:e,attrs:t}).concat(i.map(au)):null}function au(n){return{type:n,attrs:null}}function _y(n,e){let{parent:t,startIndex:r,endIndex:o}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return t.canReplaceWith(r,o,s)?i:null}function Sy(n,e){let{parent:t,startIndex:r,endIndex:o}=n,i=t.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<o;d++)c=c.matchType(t.child(d).type);return!c||!c.validEnd?null:s}function xy(n,e,t){let r=S.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let a=t[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=S.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new yt(o,i,o,i,new O(r,0,0),t.length,!0))}function Ny(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let c=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,c)&&Ty(n.doc,n.mapping.slice(i).map(a),r)){let d=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?d=!1:!h&&m&&(d=!0)}d===!1&&Xf(n,s,a,i),Oc(n,n.mapping.slice(i).map(a,1),r,void 0,d===null);let u=n.mapping.slice(i),p=u.map(a,1),f=u.map(a+s.nodeSize,1);return n.step(new yt(p,f,p+1,f-1,new O(S.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&Yf(n,s,a,i),!1}})}function Yf(n,e,t,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let c=n.mapping.slice(r).map(t+1+i+s.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Xf(n,e,t,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+i);n.replaceWith(s,s+1,e.type.schema.text(`
|
|
8
|
+
`))}})}function Ty(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function Oy(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new yt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new O(S.from(s),0,0),1,!0))}function Gn(n,e,t=1,r){let o=n.resolve(e),i=o.depth-t,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 d=o.depth-1,u=t-2;d>i;d--,u--){let p=o.node(d),f=o.index(d);if(p.type.spec.isolating)return!1;let h=p.content.cutByIndex(f,p.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||p;if(!p.canReplace(f+1,p.childCount)||!g.type.validContent(h))return!1}let a=o.indexAfter(i),c=r&&r[0];return o.node(i).canReplaceWith(a,a,c?c.type:o.node(i+1).type)}function My(n,e,t=1,r){let o=n.doc.resolve(e),i=S.empty,s=S.empty;for(let a=o.depth,c=o.depth-t,d=t-1;a>c;a--,d--){i=S.from(o.node(a).copy(i));let u=r&&r[d];s=S.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}n.step(new mt(e,e,new O(i.append(s),t,t),!0))}function kr(n,e){let t=n.resolve(e),r=t.index();return Zf(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Ay(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?n.type.schema.nodes.text:i.type;if(t=t.matchType(s),!t||!n.type.allowsMarks(i.marks))return!1}return t.validEnd}function Zf(n,e){return!!(n&&e&&!n.isLeaf&&Ay(n,e))}function Ea(n,e,t=-1){let r=n.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):t>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&&Zf(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=t<0?r.before(o):r.after(o)}}function Ry(n,e,t){let r=null,{linebreakReplacement:o}=n.doc.type.schema,i=n.doc.resolve(e-t),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",p=!!s.contentMatch.matchType(o);u&&!p?r=!1:!u&&p&&(r=!0)}let a=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);Xf(n,u.node(),u.before(),a)}s.inlineContent&&Oc(n,e+t-1,s,i.node().contentMatchAt(i.index()),r==null);let c=n.mapping.slice(a),d=c.map(e-t);if(n.step(new mt(d,c.map(e+t,-1),O.empty,!0)),r===!0){let u=n.doc.resolve(d);Yf(n,u.node(),u.before(),n.steps.length)}return n}function Dy(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))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,t))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,t))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Iy(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let o=t.content;for(let i=0;i<t.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(t.openStart==0&&t.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,c=r.index(s)+(a>0?1:0),d=r.node(s),u=!1;if(i==1)u=d.canReplace(c,c,o);else{let p=d.contentMatchAt(c).findWrapping(o.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ca(n,e,t=e,r=O.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return Qf(o,i,r)?new mt(e,t,r):new By(o,i,r).fit()}function Qf(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class By{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=S.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=S.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=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 c=new O(i,s,a);return e>-1?new yt(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new mt(r.pos,o.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=t.firstChild;if(t.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=nl(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:c,match:d}=this.frontier[a],u,p=null;if(t==1&&(s?d.matchType(s.type)||(p=d.fillBefore(S.from(s),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:p};if(t==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&d.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=nl(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new O(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=nl(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new O(Go(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new O(Go(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:p,type:f}=this.frontier[t];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));p=p.matchFragment(o)}let h=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),b=p.matchType(g.type);if(!b)break;d++,(d>1||c==0||g.content.size)&&(p=b,u.push(eh(g.mark(f.allowedMarks(g.marks)),d==1?c:0,d==a.childCount?h:-1)))}let m=d==a.childCount;m||(h=-1),this.placed=jo(this.placed,t,S.from(u)),this.frontier[t].match=p,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=a;g<h;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?O.empty:new O(Go(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new O(Go(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!rl(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=rl(e,t,o,r,i);if(s){for(let a=t-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],u=rl(e,a,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=jo(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=jo(this.placed,this.depth,S.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(S.empty,!0);t.childCount&&(this.placed=jo(this.placed,this.frontier.length,t))}}function Go(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Go(n.firstChild.content,e-1,t)))}function jo(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(jo(n.lastChild.content,e-1,t)))}function nl(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function eh(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,eh(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(S.empty,!0)))),n.copy(r)}function rl(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!Ly(t,i.content,s)?a:null}function Ly(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function Py(n){return n.spec.defining||n.spec.definingForContent}function $y(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let o=n.doc.resolve(e),i=n.doc.resolve(t);if(Qf(o,i,r))return n.step(new mt(e,t,r));let s=nh(o,n.doc.resolve(t));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==h&&s.splice(1,0,-f)}let c=s.indexOf(a),d=[],u=r.openStart;for(let f=r.content,h=0;;h++){let m=f.firstChild;if(d.push(m),h==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let h=d[f],m=Py(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(m||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),m=d[h];if(m)for(let g=0;g<s.length;g++){let b=s[(g+c)%s.length],y=!0;b<0&&(y=!1,b=-b);let k=o.node(b-1),E=o.index(b-1);if(k.canReplaceWith(E,E,m.type,m.marks))return n.replace(o.before(b),y?i.after(b):t,new O(th(r.content,0,r.openStart,h),h,r.openEnd))}}let p=n.steps.length;for(let f=s.length-1;f>=0&&(n.replace(e,t,r),!(n.steps.length>p));f--){let h=s[f];h<0||(e=o.before(h),t=i.after(h))}}function th(n,e,t,r,o){if(e<t){let i=n.firstChild;n=n.replaceChild(0,i.copy(th(i.content,e+1,t,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(S.empty,!0))}return n}function Fy(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=Dy(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new O(S.from(r),0,0))}function zy(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=nh(r,o);for(let s=0;s<i.length;s++){let a=i[s],c=s==i.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return n.delete(r.start(a),o.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return n.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&&t>r.end(s)&&o.end(s)-t!=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 n.delete(r.before(s),t);n.delete(e,t)}function nh(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(i<n.pos-(n.depth-o)||e.end(o)>e.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}class ho extends St{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return tt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return tt.fromReplace(e,this.pos,this.pos+1,new O(S.from(o),0,t.isLeaf?0:1))}getMap(){return Kt.empty}invert(e){return new ho(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ho(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ho(t.pos,t.attr,t.value)}}St.jsonID("attr",ho);class ui extends St{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return tt.ok(r)}getMap(){return Kt.empty}invert(e){return new ui(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ui(t.attr,t.value)}}St.jsonID("docAttr",ui);let yo=class extends Error{};yo=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};yo.prototype=Object.create(Error.prototype);yo.prototype.constructor=yo;yo.prototype.name="TransformError";class rh{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new fo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new yo(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=O.empty){let o=Ca(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new O(S.from(r),0,0))}delete(e,t){return this.replace(e,t,O.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return $y(this,e,t,r),this}replaceRangeWith(e,t,r){return Fy(this,e,t,r),this}deleteRange(e,t){return zy(this,e,t),this}lift(e,t){return Cy(this,e,t),this}join(e,t=1){return Ry(this,e,t),this}wrap(e,t){return xy(this,e,t),this}setBlockType(e,t=e,r,o=null){return Ny(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return Oy(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new ho(e,t,r)),this}setDocAttribute(e,t){return this.step(new ui(e,t)),this}addNodeMark(e,t){return this.step(new dr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new bo(e,t)),this}split(e,t=1,r){return My(this,e,t,r),this}addMark(e,t,r){return ky(this,e,t,r),this}removeMark(e,t,r){return wy(this,e,t,r),this}clearIncompatible(e,t,r){return Oc(this,e,t,r),this}}const gt=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},pi=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Ul=null;const Un=function(n,e,t){let r=Ul||(Ul=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Vy=function(){Ul=null},Wr=function(n,e,t,r){return t&&(lu(n,e,t,r,-1)||lu(n,e,t,r,1))},Hy=/^(img|br|input|textarea|hr)$/i;function lu(n,e,t,r,o){for(;;){if(n==t&&e==r)return!0;if(e==(o<0?0:on(n))){let i=n.parentNode;if(!i||i.nodeType!=1||Oi(n)||Hy.test(n.nodeName)||n.contentEditable=="false")return!1;e=gt(n)+(o<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[e+(o<0?-1:0)],n.contentEditable=="false")return!1;e=o<0?on(n):0}else return!1}}function on(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Uy(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=on(n)}else if(n.parentNode&&!Oi(n))e=gt(n),n=n.parentNode;else return null}}function Wy(n,e){for(;;){if(n.nodeType==3&&e<n.nodeValue.length)return n;if(n.nodeType==1&&e<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[e],e=0}else if(n.parentNode&&!Oi(n))e=gt(n)+1,n=n.parentNode;else return null}}function qy(n,e,t){for(let r=e==0,o=e==on(n);r||o;){if(n==t)return!0;let i=gt(n);if(n=n.parentNode,!n)return!1;r=r&&i==0,o=o&&i==on(n)}}function Oi(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const _a=function(n){return n.focusNode&&Wr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Or(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Ky(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Gy(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:Math.min(on(r.offsetNode),r.offset)}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:Math.min(on(r.startContainer),r.startOffset)}}}const Mn=typeof navigator<"u"?navigator:null,cu=typeof document<"u"?document:null,wr=Mn&&Mn.userAgent||"",Wl=/Edge\/(\d+)/.exec(wr),oh=/MSIE \d/.exec(wr),ql=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wr),Ft=!!(oh||ql||Wl),mr=oh?document.documentMode:ql?+ql[1]:Wl?+Wl[1]:0,bn=!Ft&&/gecko\/(\d+)/i.test(wr);bn&&+(/Firefox\/(\d+)/.exec(wr)||[0,0])[1];const Kl=!Ft&&/Chrome\/(\d+)/.exec(wr),Et=!!Kl,ih=Kl?+Kl[1]:0,Rt=!Ft&&!!Mn&&/Apple Computer/.test(Mn.vendor),vo=Rt&&(/Mobile\/\w+/.test(wr)||!!Mn&&Mn.maxTouchPoints>2),rn=vo||(Mn?/Mac/.test(Mn.platform):!1),jy=Mn?/Win/.test(Mn.platform):!1,qn=/Android \d/.test(wr),Mi=!!cu&&"webkitFontSmoothing"in cu.documentElement.style,Jy=Mi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Yy(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function $n(n,e){return typeof n=="number"?n:n[e]}function Xy(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function du(n,e,t){let r=n.someProp("scrollThreshold")||0,o=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let s=t||n.dom;s;s=pi(s)){if(s.nodeType!=1)continue;let a=s,c=a==i.body,d=c?Yy(i):Xy(a),u=0,p=0;if(e.top<d.top+$n(r,"top")?p=-(d.top-e.top+$n(o,"top")):e.bottom>d.bottom-$n(r,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+$n(o,"top")-d.top:e.bottom-d.bottom+$n(o,"bottom")),e.left<d.left+$n(r,"left")?u=-(d.left-e.left+$n(o,"left")):e.right>d.right-$n(r,"right")&&(u=e.right-d.right+$n(o,"right")),u||p)if(c)i.defaultView.scrollBy(u,p);else{let f=a.scrollLeft,h=a.scrollTop;p&&(a.scrollTop+=p),u&&(a.scrollLeft+=u);let m=a.scrollLeft-f,g=a.scrollTop-h;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Zy(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=t+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=n.root.elementFromPoint(i,s);if(!a||a==n.dom||!n.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=t-20){r=a,o=c.top;break}}return{refDOM:r,refTop:o,stack:sh(n.dom)}}function sh(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=pi(r));return e}function Qy({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;ah(t,r==0?0:r-e)}function ah(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:o,left:i}=n[t];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Qr=null;function ev(n){if(n.setActive)return n.setActive();if(Qr)return n.focus(Qr);let e=sh(n);n.focus(Qr==null?{get preventScroll(){return Qr={preventScroll:!0},!0}}:void 0),Qr||(Qr=!1,ah(e,0))}function lh(n,e){let t,r=2e8,o,i=0,s=e.top,a=e.top,c,d;for(let u=n.firstChild,p=0;u;u=u.nextSibling,p++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Un(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){t=u,r=g,o=g&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(i=p+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=p+1)}}return!t&&c&&(t=c,o=d,r=0),t&&t.nodeType==3?tv(t,o):!t||r&&t.nodeType==1?{node:n,offset:i}:lh(t,o)}function tv(n,e){let t=n.nodeValue.length,r=document.createRange();for(let o=0;o<t;o++){r.setEnd(n,o+1),r.setStart(n,o);let i=nr(r,1);if(i.top!=i.bottom&&Ac(e,i))return{node:n,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:n,offset:0}}function Ac(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function nv(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function rv(n,e,t){let{node:r,offset:o}=lh(e,t),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&t.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,o,i)}function ov(n,e,t,r){let o=-1;for(let i=e,s=!1;i!=n.dom;){let a=n.docView.nearestDesc(i,!0),c;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((c=a.dom.getBoundingClientRect()).width||c.height)&&(a.node.isBlock&&a.parent&&(!s&&c.left>r.left||c.top>r.top?o=a.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return o>-1?o:n.docView.posFromDOM(e,t,-1)}function ch(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),i=o;;){let s=n.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let c=0;c<a.length;c++){let d=a[c];if(Ac(e,d))return ch(s,e,d)}}if((i=(i+1)%r)==o)break}return n}function iv(n,e){let t=n.dom.ownerDocument,r,o=0,i=Gy(t,e.left,e.top);i&&({node:r,offset:o}=i);let s=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),a;if(!s||!n.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=n.dom.getBoundingClientRect();if(!Ac(e,d)||(s=ch(n.dom,e,d),!s))return null}if(Rt)for(let d=s;r&&d;d=pi(d))d.draggable&&(r=void 0);if(s=nv(s,e),r){if(bn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],p;u.nodeName=="IMG"&&(p=u.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&o++}let d;Mi&&o&&r.nodeType==1&&(d=r.childNodes[o-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&o--,r==n.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=ov(n,r,o,e))}a==null&&(a=rv(n,s,e));let c=n.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function uu(n){return n.top<n.bottom||n.left<n.right}function nr(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(uu(r))return r}return Array.prototype.find.call(t,uu)||n.getBoundingClientRect()}const sv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function dh(n,e,t){let{node:r,offset:o,atom:i}=n.docView.domFromPos(e,t<0?-1:1),s=Mi||bn;if(r.nodeType==3)if(s&&(sv.test(r.nodeValue)||(t<0?!o:o==r.nodeValue.length))){let c=nr(Un(r,o,o),t);if(bn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let d=nr(Un(r,o-1,o-1),-1);if(d.top==c.top){let u=nr(Un(r,o,o+1),-1);if(u.top!=c.top)return Lo(u,u.left<d.left)}}return c}else{let c=o,d=o,u=t<0?1:-1;return t<0&&!o?(d++,u=-1):t>=0&&o==r.nodeValue.length?(c--,u=1):t<0?c--:d++,Lo(nr(Un(r,c,d),u),u<0)}if(!n.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(t<0||o==on(r))){let c=r.childNodes[o-1];if(c.nodeType==1)return ol(c.getBoundingClientRect(),!1)}if(i==null&&o<on(r)){let c=r.childNodes[o];if(c.nodeType==1)return ol(c.getBoundingClientRect(),!0)}return ol(r.getBoundingClientRect(),t>=0)}if(i==null&&o&&(t<0||o==on(r))){let c=r.childNodes[o-1],d=c.nodeType==3?Un(c,on(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return Lo(nr(d,1),!1)}if(i==null&&o<on(r)){let c=r.childNodes[o];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Un(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return Lo(nr(d,-1),!0)}return Lo(nr(r.nodeType==3?Un(r):r,-t),t>=0)}function Lo(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ol(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function uh(n,e,t){let r=n.state,o=n.root.activeElement;r!=e&&n.updateState(e),o!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),o!=n.dom&&o&&o.focus()}}function av(n,e,t){let r=e.selection,o=t=="up"?r.$from:r.$to;return uh(n,e,()=>{let{node:i}=n.docView.domFromPos(o.pos,t=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=dh(n,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=Un(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const lv=/[\u0590-\u08ac]/;function cv(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=n.domSelection();return a?!lv.test(r.parent.textContent)||!a.modify?t=="left"||t=="backward"?i:s:uh(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:p}=n.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:g}=n.domSelectionRange(),b=m&&!h.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{a.collapse(u,p),c&&(c!=u||d!=p)&&a.extend&&a.extend(c,d)}catch{}return f!=null&&(a.caretBidiLevel=f),b}):r.pos==r.start()||r.pos==r.end()}let pu=null,fu=null,hu=!1;function dv(n,e,t){return pu==e&&fu==t?hu:(pu=e,fu=t,hu=t=="up"||t=="down"?av(n,e,t):cv(n,e,t))}const sn=0,mu=1,Ar=2,An=3;class Ai{constructor(e,t,r,o){this.parent=e,this.children=t,this.dom=r,this.contentDOM=o,this.dirty=sn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let o=this.children[t];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,t,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[t-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[t];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=t>gt(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(t==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&t==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,t=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!t||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 t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let o=this.children[t],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,t){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 fh){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof ph&&i.side>=0;r--);if(t<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&t&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,t):{node:this.contentDOM,offset:i?gt(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,t):{node:this.contentDOM,offset:i?gt(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let c=this.children[a],d=s+c.size;if(o==-1&&e<=d){let u=s+c.border;if(e>=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=s;for(let p=a;p>0;p--){let f=this.children[p-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=gt(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(d>t||a==this.children.length-1)){t=d;for(let u=a+1;u<this.children.length;u++){let p=this.children[u];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){i=gt(p.dom);break}t+=p.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:t,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,o=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let h=0,m=0;h<this.children.length;h++){let g=this.children[h],b=m+g.size;if(i>m&&s<b)return g.setSelection(e-m-g.border,t-m-g.border,r,o);m=b}let a=this.domFromPos(e,e?-1:1),c=t==e?a:this.domFromPos(t,t?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),p=!1;if((bn||Rt)&&e==t){let{node:h,offset:m}=a;if(h.nodeType==3){if(p=!!(m&&h.nodeValue[m-1]==`
|
|
9
|
+
`),p&&m==h.nodeValue.length)for(let g=h,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(a=c={node:b.parentNode,offset:gt(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=h.childNodes[m-1];p=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(bn&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(o=!0)}if(!(o||p&&Rt)&&Wr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Wr(c.node,c.offset,u.focusNode,u.focusOffset))return;let f=!1;if((d.extend||e==t)&&!p){d.collapse(a.node,a.offset);try{e!=t&&d.extend(c.node,c.offset),f=!0}catch{}}if(!f){if(e>t){let m=a;a=c,c=m}let h=document.createRange();h.setEnd(c.node,c.offset),h.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){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&&t>=r:e<s&&t>r){let a=r+i.border,c=s-i.border;if(e>=a&&t<=c){this.dirty=e==r||t==s?Ar:mu,e==a&&t==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=An:i.markDirty(e-a,t-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Ar:An}r=s}this.dirty=Ar}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Ar:mu;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class ph extends Ai{constructor(e,t,r,o){let i,s=t.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!t.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=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==sn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(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 side(){return this.widget.type.side}}class uv extends Ai{constructor(e,t,r,o){super(e,[],t,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class qr extends Ai{constructor(e,t,r,o,i){super(e,[],r,o),this.mark=t,this.spec=i}static create(e,t,r,o){let i=o.nodeViews[t.type.name],s=i&&i(t,o,r);return(!s||!s.dom)&&(s=Jr.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new qr(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&An||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=An&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=sn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=sn}}slice(e,t,r){let o=qr.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;t<s&&(i=jl(i,t,s,r)),e>0&&(i=jl(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 gr extends Ai{constructor(e,t,r,o,i,s,a,c,d){super(e,[],i,s),this.node=t,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,t,r,o,i,s){let a=i.nodeViews[t.type.name],c,d=a&&a(t,i,()=>{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,o),u=d&&d.dom,p=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:p}=Jr.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!p&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=gh(u,r,t),d?c=new pv(e,t,r,o,u,p||null,f,d,i,s+1):t.isText?new Sa(e,t,r,o,u,f,i):new gr(e,t,r,o,u,p||null,f,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 t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>S.empty)}return e}matchesNode(e,t,r){return this.dirty==sn&&e.eq(this.node)&&As(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,c=new hv(this,s&&s.node,e);bv(this.node,this.innerDeco,(d,u,p)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!p&&c.syncToMarks(u==this.node.childCount?Be.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,o)},(d,u,p,f)=>{c.syncToMarks(d.marks,r,e);let h;c.findNodeMatch(d,u,p,f)||a&&e.state.selection.from>o&&e.state.selection.to<o+d.nodeSize&&(h=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(d,u,p,h,e)||c.updateNextNode(d,u,p,e,f,o)||c.addNode(d,u,p,e,o),o+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Ar)&&(s&&this.protectLocalComposition(e,s),hh(this.contentDOM,this.children,e),vo&&yv(this.dom))}localCompositionInfo(e,t){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Y)||r<t||o>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=vv(this.node.content,s,r-t,o-t);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:o}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new uv(this,i,t,o);e.input.compositionNodes.push(s),this.children=jl(this.children,r,r+o.length,e,s)}update(e,t,r,o){return this.dirty==An||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,o),!0)}updateInner(e,t,r,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=sn}updateOuterDeco(e){if(As(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=mh(this.dom,this.nodeDOM,Gl(this.outerDeco,this.node,t),Gl(e,this.node,t)),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 gu(n,e,t,r,o){gh(r,e,n);let i=new gr(void 0,n,e,t,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Sa extends gr{constructor(e,t,r,o,i,s,a){super(e,t,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,t,r,o){return this.dirty==An||this.dirty!=sn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=sn||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=sn,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let o=this.node.cut(e,t),i=document.createTextNode(o.text);return new Sa(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=An)}get domAtom(){return!1}isText(e){return this.node.text==e}}class fh extends Ai{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==sn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class pv extends gr{constructor(e,t,r,o,i,s,a,c,d,u){super(e,t,r,o,i,s,a,d,u),this.spec=c}update(e,t,r,o){if(this.dirty==An)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,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 hh(n,e,t){let r=n.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==n){for(;a!=r;)r=bu(r),o=!0;r=r.nextSibling}else o=!0,n.insertBefore(a,r);if(s instanceof qr){let c=r?r.previousSibling:n.lastChild;hh(s.contentDOM,s.children,t),r=c?c.nextSibling:n.firstChild}}for(;r;)r=bu(r),o=!0;o&&t.trackWrites==n&&(t.trackWrites=null)}const Xo=function(n){n&&(this.nodeName=n)};Xo.prototype=Object.create(null);const Rr=[new Xo];function Gl(n,e,t){if(n.length==0)return Rr;let r=t?Rr[0]:new Xo,o=[r];for(let i=0;i<n.length;i++){let s=n[i].type.attrs;if(s){s.nodeName&&o.push(r=new Xo(s.nodeName));for(let a in s){let c=s[a];c!=null&&(t&&o.length==1&&o.push(r=new Xo(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+c:a=="style"?r.style=(r.style?r.style+";":"")+c:a!="nodeName"&&(r[a]=c))}}}return o}function mh(n,e,t,r){if(t==Rr&&r==Rr)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=t[i];if(i){let c;a&&a.nodeName==s.nodeName&&o!=n&&(c=o.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(o),a=Rr[0]),o=c}fv(o,a||Rr[0],s)}return o}function fv(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=t.class?t.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&n.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&n.classList.add(o[i]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)n.style.removeProperty(o[1])}t.style&&(n.style.cssText+=t.style)}}function gh(n,e,t){return mh(n,n,Rr,Gl(e,t,n.nodeType!=1))}function As(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function bu(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class hv{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=mv(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,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=sn,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 c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[i])&&!this.isLocked(d.dom)){a=c;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=qr.create(this.top,e[i],t,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,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,t,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,c=Math.min(this.top.children.length,a+5);a<c;a++){let d=this.top.children[a];if(d.matchesNode(e,t,r)&&!this.preMatch.matched.has(d)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,r,o,i){let s=this.top.children[o];return s.dirty==An&&s.dom==s.contentDOM&&(s.dirty=Ar),s.update(e,t,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==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=t}}updateNextNode(e,t,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let c=this.top.children[a];if(c instanceof gr){let d=this.preMatch.matched.get(c);if(d!=null&&d!=i)return!1;let u=c.dom,p,f=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=An&&As(t,c.outerDeco));if(!f&&c.update(e,t,r,o))return this.destroyBetween(this.index,a),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(p=this.recreateWrapper(c,e,t,r,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=Ar,p.updateChildren(o,s+1),p.dirty=sn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,o,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!As(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=gr.create(this.top,t,r,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let c of a.children)c.parent=a}return e.destroy(),a}addNode(e,t,r,o,i){let s=gr.create(this.top,e,t,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,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 ph(this.top,e,t,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof qr;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Sa)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Rt||Et)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new fh(this.top,[],r,null);t!=this.top?t.children.push(o):t.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 mv(n,e){let t=e,r=t.children.length,o=n.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let d=t.children[r-1];if(d instanceof qr)t=d,r=d.children.length;else{a=d,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let c=a.node;if(c){if(c!=n.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function gv(n,e){return n.type.side-e.type.side}function bv(n,e,t,r){let o=e.locals(n),i=0;if(o.length==0){for(let d=0;d<n.childCount;d++){let u=n.child(d);r(u,o,e.forChild(i,u),d),i+=u.nodeSize}return}let s=0,a=[],c=null;for(let d=0;;){let u,p;for(;s<o.length&&o[s].to==i;){let b=o[s++];b.widget&&(u?(p||(p=[u])).push(b):u=b)}if(u)if(p){p.sort(gv);for(let b=0;b<p.length;b++)t(p[b],d,!!c)}else t(u,d,!!c);let f,h;if(c)h=-1,f=c,c=null;else if(d<n.childCount)h=d,f=n.child(d++);else break;for(let b=0;b<a.length;b++)a[b].to<=i&&a.splice(b--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let m=i+f.nodeSize;if(f.isText){let b=m;s<o.length&&o[s].from<b&&(b=o[s].from);for(let y=0;y<a.length;y++)a[y].to<b&&(b=a[y].to);b<m&&(c=f.cut(b-i),f=f.cut(0,b-i),m=b,h=-1)}else for(;s<o.length&&o[s].to<m;)s++;let g=f.isInline&&!f.isLeaf?a.filter(b=>!b.inline):a.slice();r(f,g,e.forChild(i,f),h),i=m}}function yv(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function vv(n,e,t,r){for(let o=0,i=0;o<n.childCount&&i<=r;){let s=n.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let c=s.text;for(;o<n.childCount;){let d=n.child(o++);if(i+=d.nodeSize,!d.isText)break;c+=d.text}if(i>=t){if(i>=r&&c.slice(r-e.length-a,r-a)==e)return r-e.length;let d=a<r?c.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=t)return a+d;if(t==r&&c.length>=r+e.length-a&&c.slice(r-a,r-a+e.length)==e)return r}}return-1}function jl(n,e,t,r,o){let i=[];for(let s=0,a=0;s<n.length;s++){let c=n[s],d=a,u=a+=c.size;d>=t||u<=e?i.push(c):(d<e&&i.push(c.slice(0,e-d,r)),o&&(i.push(o),o=void 0),u>t&&i.push(c.slice(t-d,c.size,r)))}return i}function Rc(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let o=n.docView.nearestDesc(t.focusNode),i=o&&o.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let a=r.resolve(s),c,d;if(_a(t)){for(c=s;o&&!o.node;)o=o.parent;let p=o.node;if(o&&p.isAtom&&G.isSelectable(p)&&o.parent&&!(p.isInline&&qy(t.focusNode,t.focusOffset,o.dom))){let f=o.posBefore;d=new G(s==f?a:r.resolve(f))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let p=s,f=s;for(let h=0;h<t.rangeCount;h++){let m=t.getRangeAt(h);p=Math.min(p,n.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,n.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(p<0)return null;[c,s]=f==n.state.selection.anchor?[f,p]:[p,f],a=r.resolve(s)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!d){let p=e=="pointer"||n.state.selection.head<a.pos&&!i?1:-1;d=Dc(n,u,a,p)}return d}function bh(n){return n.editable?n.hasFocus():vh(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function jn(n,e=!1){let t=n.state.selection;if(yh(n,t),!!bh(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Et){let r=n.domSelectionRange(),o=n.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Wr(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)wv(n);else{let{anchor:r,head:o}=t,i,s;yu&&!(t instanceof Y)&&(t.$from.parent.inlineContent||(i=vu(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(s=vu(n,t.to))),n.docView.setSelection(r,o,n,e),yu&&(i&&ku(i),s&&ku(s)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&kv(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const yu=Rt||Et&&ih<63;function vu(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),o=r<t.childNodes.length?t.childNodes[r]:null,i=r?t.childNodes[r-1]:null;if(Rt&&o&&o.contentEditable=="false")return il(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return il(o);if(i)return il(i)}}function il(n){return n.contentEditable="true",Rt&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function ku(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function kv(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,o=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=o)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!bh(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function wv(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,o=r.nodeName=="IMG";o?t.setStart(r.parentNode,gt(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!o&&!n.state.selection.visible&&Ft&&mr<=11&&(r.disabled=!0,r.disabled=!1)}function yh(n,e){if(e instanceof G){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(wu(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else wu(n)}function wu(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Dc(n,e,t,r){return n.someProp("createSelectionBetween",o=>o(n,e,t))||Y.between(e,t,r)}function Eu(n){return n.editable&&!n.hasFocus()?!1:vh(n)}function vh(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Ev(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Wr(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Jl(n,e){let{$anchor:t,$head:r}=n.selection,o=e>0?t.max(r):t.min(r),i=o.parent.inlineContent?o.depth?n.doc.resolve(e>0?o.after():o.before()):null:o;return i&&ee.findFrom(i,e)}function rr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Cu(n,e,t){let r=n.state.selection;if(r instanceof Y)if(t.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=n.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return rr(n,new Y(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let o=Jl(n.state,e);return o&&o instanceof G?rr(n,o):!1}else if(!(rn&&t.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=n.docView.descAt(a))&&!s.contentDOM?G.isSelectable(i)?rr(n,new G(e<0?n.state.doc.resolve(o.pos-i.nodeSize):o)):Mi?rr(n,new Y(n.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof G&&r.node.isInline)return rr(n,new Y(e>0?r.$to:r.$from));{let o=Jl(n.state,e);return o?rr(n,o):!1}}}function Rs(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Zo(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function eo(n,e){return e<0?Cv(n):_v(n)}function Cv(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o,i,s=!1;for(bn&&t.nodeType==1&&r<Rs(t)&&Zo(t.childNodes[r],-1)&&(s=!0);;)if(r>0){if(t.nodeType!=1)break;{let a=t.childNodes[r-1];if(Zo(a,-1))o=t,i=--r;else if(a.nodeType==3)t=a,r=t.nodeValue.length;else break}}else{if(kh(t))break;{let a=t.previousSibling;for(;a&&Zo(a,-1);)o=t.parentNode,i=gt(a),a=a.previousSibling;if(a)t=a,r=Rs(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?Yl(n,t,r):o&&Yl(n,o,i)}function _v(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o=Rs(t),i,s;for(;;)if(r<o){if(t.nodeType!=1)break;let a=t.childNodes[r];if(Zo(a,1))i=t,s=++r;else break}else{if(kh(t))break;{let a=t.nextSibling;for(;a&&Zo(a,1);)i=a.parentNode,s=gt(a)+1,a=a.nextSibling;if(a)t=a,r=0,o=Rs(t);else{if(t=t.parentNode,t==n.dom)break;r=o=0}}}i&&Yl(n,i,s)}function kh(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Sv(n,e){for(;n&&e==n.childNodes.length&&!Oi(n);)e=gt(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function xv(n,e){for(;n&&!e&&!Oi(n);)e=gt(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function Yl(n,e,t){if(e.nodeType!=3){let i,s;(s=Sv(e,t))?(e=s,t=0):(i=xv(e,t))&&(e=i,t=i.nodeValue.length)}let r=n.domSelection();if(!r)return;if(_a(r)){let i=document.createRange();i.setEnd(e,t),i.setStart(e,t),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:o}=n;setTimeout(()=>{n.state==o&&jn(n)},50)}function _u(n,e){let t=n.state.doc.resolve(e);if(!(Et||jy)&&t.parent.inlineContent){let o=n.coordsAtPos(e);if(e>t.start()){let i=n.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<t.end()){let i=n.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(n.dom).direction=="rtl"?"rtl":"ltr"}function Su(n,e,t){let r=n.state.selection;if(r instanceof Y&&!r.empty||t.indexOf("s")>-1||rn&&t.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Jl(n.state,e);if(s&&s instanceof G)return rr(n,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof Jt?ee.near(s,e):ee.findFrom(s,e);return a?rr(n,a):!1}return!1}function xu(n,e){if(!(n.state.selection instanceof Y))return!0;let{$head:t,$anchor:r,empty:o}=n.state.selection;if(!t.sameParent(r))return!0;if(!o)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(i&&!i.isText){let s=n.state.tr;return e<0?s.delete(t.pos-i.nodeSize,t.pos):s.delete(t.pos,t.pos+i.nodeSize),n.dispatch(s),!0}return!1}function Nu(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Nv(n){if(!Rt||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Nu(n,r,"true"),setTimeout(()=>Nu(n,r,"false"),20)}return!1}function Tv(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Ov(n,e){let t=e.keyCode,r=Tv(e);if(t==8||rn&&t==72&&r=="c")return xu(n,-1)||eo(n,-1);if(t==46&&!e.shiftKey||rn&&t==68&&r=="c")return xu(n,1)||eo(n,1);if(t==13||t==27)return!0;if(t==37||rn&&t==66&&r=="c"){let o=t==37?_u(n,n.state.selection.from)=="ltr"?-1:1:-1;return Cu(n,o,r)||eo(n,o)}else if(t==39||rn&&t==70&&r=="c"){let o=t==39?_u(n,n.state.selection.from)=="ltr"?1:-1:1;return Cu(n,o,r)||eo(n,o)}else{if(t==38||rn&&t==80&&r=="c")return Su(n,-1,r)||eo(n,-1);if(t==40||rn&&t==78&&r=="c")return Nv(n)||Su(n,1,r)||eo(n,1);if(r==(rn?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Ic(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=n.someProp("clipboardSerializer")||Jr.fromSchema(n.state.schema),a=xh(),c=a.createElement("div");c.appendChild(s.serializeFragment(r,{document:a}));let d=c.firstChild,u,p=0;for(;d&&d.nodeType==1&&(u=Sh[d.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=a.createElement(u[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),p++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${o} ${i}${p?` -${p}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,`
|
|
10
10
|
|
|
11
11
|
`);return{dom:c,text:f,slice:e}}function wh(n,e,t,r,o){let i=o.parent.type.spec.code,s,a;if(!t&&!e)return null;let c=e&&(r||i||!t);if(c){if(n.someProp("transformPastedText",f=>{e=f(e,i||r,n)}),i)return e?new O(S.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
12
|
-
`))),0,0):O.empty;let p=n.someProp("clipboardTextParser",f=>f(e,o,r,n));if(p)a=p;else{let f=o.marks(),{schema:h}=n.state,m=Jr.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=s.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(h.text(g,f)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),s=Rv(t),Mi&&Dv(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(n.someProp("clipboardParser")||n.someProp("domParser")||hr.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!Ov.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=Iv(Tu(a,+u[1],+u[2]),u[4]);else if(a=O.maxOpen(Mv(a.content,o),!0),a.openStart||a.openEnd){let p=0,f=0;for(let h=a.content.firstChild;p<a.openStart&&!h.type.spec.isolating;p++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=Tu(a,p,f)}return n.someProp("transformPasted",p=>{a=p(a,n)}),a}const Ov=/^(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 Mv(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let o=e.node(t).contentMatchAt(e.index(t)),i,s=[];if(n.forEach(a=>{if(!s)return;let c=o.findWrapping(a.type),d;if(!c)return s=null;if(d=s.length&&i.length&&Ch(c,i,a,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=_h(s[s.length-1],i.length));let u=Eh(a,c);s.push(u),o=o.matchType(u.type),i=c}}),s)return S.from(s)}return n}function Eh(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,S.from(n));return n}function Ch(n,e,t,r,o){if(o<n.length&&o<e.length&&n[o]==e[o]){let i=Ch(n,e,t,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==n.length-1?t.type:n[o+1]))return r.copy(r.content.append(S.from(Eh(t,n,o+1))))}}function _h(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,_h(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(S.empty,!0);return n.copy(t.append(r))}function Xl(n,e,t,r,o,i){let s=e<0?n.firstChild:n.lastChild,a=s.content;return n.childCount>1&&(i=0),o<r-1&&(a=Xl(a,e,t,r,o+1,i)),o>=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(S.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function Tu(n,e,t){return e<n.openStart&&(n=new O(Xl(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new O(Xl(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Sh={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 Ou=null;function xh(){return Ou||(Ou=document.implementation.createHTMLDocument("title"))}let sl=null;function Av(n){let e=window.trustedTypes;return e?(sl||(sl=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),sl.createHTML(n)):n}function Rv(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=xh().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),o;if((o=r&&Sh[r[1].toLowerCase()])&&(n=o.map(i=>"<"+i+">").join("")+n+o.map(i=>"</"+i+">").reverse().join("")),t.innerHTML=Av(n),o)for(let i=0;i<o.length;i++)t=t.querySelector(o[i])||t;return t}function Dv(n){let e=n.querySelectorAll(Et?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function Iv(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:o,openStart:i,openEnd:s}=n;for(let a=r.length-2;a>=0;a-=2){let c=t.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;o=S.from(c.create(r[a+1],o)),i++,s++}return new O(o,i,s)}const Dt={},It={},Bv={touchstart:!0,touchmove:!0};class Lv{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.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 Pv(n){for(let e in Dt){let t=Dt[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Fv(n,r)&&!Bc(n,r)&&(n.editable||!(r.type in It))&&t(n,r)},Bv[e]?{passive:!0}:void 0)}Rt&&n.dom.addEventListener("input",()=>null),Zl(n)}function ur(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function $v(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Zl(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Bc(n,r))})}function Bc(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Fv(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function zv(n,e){!Bc(n,e)&&Dt[e.type]&&(n.editable||!(e.type in It))&&Dt[e.type](n,e)}It.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Th(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(qn&&Et&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),vo&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",o=>o(n,Or(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Tv(n,t)?t.preventDefault():ur(n,"key")};It.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};It.keypress=(n,e)=>{let t=e;if(Th(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||rn&&t.metaKey)return;if(n.someProp("handleKeyPress",o=>o(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof Y)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(t.charCode);!/[\r\n]/.test(o)&&!n.someProp("handleTextInput",i=>i(n,r.$from.pos,r.$to.pos,o))&&n.dispatch(n.state.tr.insertText(o).scrollIntoView()),t.preventDefault()}};function xa(n){return{left:n.clientX,top:n.clientY}}function Vv(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Lc(n,e,t,r,o){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(n.someProp(e,a=>s>i.depth?a(n,t,i.nodeAfter,i.before(s),o,!0):a(n,t,i.node(s),i.before(s),o,!1)))return!0;return!1}function mo(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function Hv(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&G.isSelectable(r)?(mo(n,new G(t)),!0):!1}function Uv(n,e){if(e==-1)return!1;let t=n.state.selection,r,o;t instanceof G&&(r=t.node);let i=n.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(G.isSelectable(a)){r&&t.$from.depth>0&&s>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?o=i.before(t.$from.depth):o=i.before(s);break}}return o!=null?(mo(n,G.create(n.state.doc,o)),!0):!1}function Wv(n,e,t,r,o){return Lc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(o?Uv(n,t):Hv(n,t))}function qv(n,e,t,r){return Lc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",o=>o(n,e,r))}function Kv(n,e,t,r){return Lc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",o=>o(n,e,r))||Gv(n,t,r)}function Gv(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(mo(n,Y.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)mo(n,Y.create(r,a+1,a+1+s.content.size));else if(G.isSelectable(s))mo(n,G.create(r,a));else continue;return!0}}function Pc(n){return Ds(n)}const Nh=rn?"metaKey":"ctrlKey";Dt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Pc(n),o=Date.now(),i="singleClick";o-n.input.lastClick.time<500&&Vv(t,n.input.lastClick)&&!t[Nh]&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:i};let s=n.posAtCoords(xa(t));s&&(i=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new jv(n,s,t,!!r)):(i=="doubleClick"?qv:Kv)(n,s.pos,s.inside,t)?t.preventDefault():ur(n,"pointer"))};class jv{constructor(e,t,r,o){this.view=e,this.pos=t,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Nh],this.allowDefault=r.shiftKey;let i,s;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,c=a?e.docView.nearestDesc(a,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:d}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||d instanceof G&&d.from<=s&&d.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&bn&&!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)),ur(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(()=>jn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(xa(e))),this.updateAllowDefault(e),this.allowDefault||!t?ur(this.view,"pointer"):Wv(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Rt&&this.mightDrag&&!this.mightDrag.node.isAtom||Et&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(mo(this.view,ee.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ur(this.view,"pointer")}move(e){this.updateAllowDefault(e),ur(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)}}Dt.touchstart=n=>{n.input.lastTouch=Date.now(),Pc(n),ur(n,"pointer")};Dt.touchmove=n=>{n.input.lastTouch=Date.now(),ur(n,"pointer")};Dt.contextmenu=n=>Pc(n);function Th(n,e){return n.composing?!0:Rt&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Jv=qn?5e3:-1;It.compositionstart=It.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof Y&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Ds(n,!0),n.markCursor=null;else if(Ds(n,!e.selection.empty),bn&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.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=n.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}n.input.composing=!0}Oh(n,Jv)};It.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Oh(n,20))};function Oh(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ds(n),e))}function Mh(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Xv());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Yv(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=Hy(e.focusNode,e.focusOffset),r=Uy(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let o=r.pmViewDesc,i=n.domObserver.lastChangedTextNode;if(t==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function Xv(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ds(n,e=!1){if(!(qn&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Mh(n),e||n.docView&&n.docView.dirty){let t=Rc(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function Zv(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const fi=Ft&&mr<15||vo&&jy<604;Dt.copy=It.cut=(n,e)=>{let t=e,r=n.state.selection,o=t.type=="cut";if(r.empty)return;let i=fi?null:t.clipboardData,s=r.content(),{dom:a,text:c}=Ic(n,s);i?(t.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",c)):Zv(n,a),o&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Qv(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function ek(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?hi(n,r.value,null,o,e):hi(n,r.textContent,r.innerHTML,o,e)},50)}function hi(n,e,t,r,o){let i=wh(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,o,i||O.empty)))return!0;if(!i)return!1;let s=Qv(i),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ah(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}It.paste=(n,e)=>{let t=e;if(n.composing&&!qn)return;let r=fi?null:t.clipboardData,o=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&hi(n,Ah(r),r.getData("text/html"),o,t)?t.preventDefault():ek(n,t)};class Rh{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Dh=rn?"altKey":"ctrlKey";Dt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=n.state.selection,i=o.empty?null:n.posAtCoords(xa(t)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof G?o.to-1:o.to))){if(r&&r.mightDrag)s=G.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let p=n.docView.nearestDesc(t.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(s=G.create(n.state.doc,p.posBefore))}}let a=(s||n.state.selection).content(),{dom:c,text:d,slice:u}=Ic(n,a);(!t.dataTransfer.files.length||!Et||ih>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(fi?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",fi||t.dataTransfer.setData("text/plain",d),n.dragging=new Rh(u,!t[Dh],s)};Dt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};It.dragover=It.dragenter=(n,e)=>e.preventDefault();It.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let o=n.posAtCoords(xa(t));if(!o)return;let i=n.state.doc.resolve(o.pos),s=r&&r.slice;s?n.someProp("transformPasted",m=>{s=m(s,n)}):s=wh(n,Ah(t.dataTransfer),fi?null:t.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!t[Dh]);if(n.someProp("handleDrop",m=>m(n,t,s||O.empty,a))){t.preventDefault();return}if(!s)return;t.preventDefault();let c=s?Dy(n.state.doc,i.pos,s):i.pos;c==null&&(c=i.pos);let d=n.state.tr;if(a){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),p=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=d.doc;if(p?d.replaceRangeWith(u,u,s.content.firstChild):d.replaceRange(u,u,s),d.doc.eq(f))return;let h=d.doc.resolve(u);if(p&&G.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new G(h));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,b,y,k)=>m=k),d.setSelection(Dc(n,h,d.doc.resolve(m)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))};Dt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&jn(n)},20))};Dt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Dt.beforeinput=(n,e)=>{if(Et&&qn&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Or(8,"Backspace")))))return;let{$cursor:o}=n.state.selection;o&&o.pos>0&&n.dispatch(n.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let n in It)Dt[n]=It[n];function mi(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Is{constructor(e,t){this.toDOM=e,this.spec=t||Lr,this.side=this.spec.side||0}map(e,t,r,o){let{pos:i,deleted:s}=e.mapResult(t.from+o,this.side<0?-1:1);return s?null:new Ze(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Is&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&mi(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class br{constructor(e,t){this.attrs=e,this.spec=t||Lr}map(e,t,r,o){let i=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Ze(i,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof br&&mi(this.attrs,e.attrs)&&mi(this.spec,e.spec)}static is(e){return e.type instanceof br}destroy(){}}class $c{constructor(e,t){this.attrs=e,this.spec=t||Lr}map(e,t,r,o){let i=e.mapResult(t.from+o,1);if(i.deleted)return null;let s=e.mapResult(t.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Ze(i.pos-r,s.pos-r,this)}valid(e,t){let{index:r,offset:o}=e.content.findIndex(t.from),i;return o==t.from&&!(i=e.child(r)).isText&&o+i.nodeSize==t.to}eq(e){return this==e||e instanceof $c&&mi(this.attrs,e.attrs)&&mi(this.spec,e.spec)}destroy(){}}class Ze{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Ze(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Ze(e,e,new Is(t,r))}static inline(e,t,r,o){return new Ze(e,t,new br(r,o))}static node(e,t,r,o){return new Ze(e,t,new $c(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof br}get widget(){return this.type instanceof Is}}const io=[],Lr={};class Ne{constructor(e,t){this.local=e.length?e:io,this.children=t.length?t:io}static create(e,t){return t.length?Bs(t,e,0,Lr):wt}find(e,t,r){let o=[];return this.findInner(e??0,t??1e9,o,0,r),o}findInner(e,t,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=t&&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]<t&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,t-a,r,o+a,i)}}map(e,t,r){return this==wt||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Lr)}mapInner(e,t,r,o,i){let s;for(let a=0;a<this.local.length;a++){let c=this.local[a].map(e,r,o);c&&c.type.valid(t,c)?(s||(s=[])).push(c):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?tk(this.children,s||[],e,t,r,o,i):s?new Ne(s.sort(Pr),io):wt}add(e,t){return t.length?this==wt?Ne.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let o,i=0;e.forEach((a,c)=>{let d=c+r,u;if(u=Bh(t,a,d)){for(o||(o=this.children.slice());i<o.length&&o[i]<c;)i+=3;o[i]==c?o[i+2]=o[i+2].addInner(a,u,d+1):o.splice(i,0,c,c+a.nodeSize,Bs(u,a,d+1,Lr)),i+=3}});let s=Ih(i?Lh(t):t,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ne(s.length?this.local.concat(s).sort(Pr):this.local,o||this.children)}remove(e){return e.length==0||this==wt?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+t,c=r[i+1]+t;for(let u=0,p;u<e.length;u++)(p=e[u])&&p.from>a&&p.to<c&&(e[u]=null,(s||(s=[])).push(p));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[i+2].removeInner(s,a+1);d!=wt?r[i+2]=d:(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,t)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Ne(o,r):wt}forChild(e,t){if(this==wt)return this;if(t.isLeaf)return Ne.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+t.content.size;for(let a=0;a<this.local.length;a++){let c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof br){let d=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;d<u&&(o||(o=[])).push(c.copy(d,u))}}if(o){let a=new Ne(o.sort(Pr),io);return r?new sr([a,r]):a}return r||wt}eq(e){if(this==e)return!0;if(!(e instanceof Ne)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Fc(this.localsInner(e))}localsInner(e){if(this==wt)return io;if(e.inlineContent||!this.local.some(br.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof br||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Ne.empty=new Ne([],[]);Ne.removeOverlap=Fc;const wt=Ne.empty;class sr{constructor(e){this.members=e}map(e,t){const r=this.members.map(o=>o.map(e,t,Lr));return sr.from(r)}forChild(e,t){if(t.isLeaf)return Ne.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,t);i!=wt&&(i instanceof sr?r=r.concat(i.members):r.push(i))}return sr.from(r)}eq(e){if(!(e instanceof sr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!t)t=i;else{r&&(t=t.slice(),r=!1);for(let s=0;s<i.length;s++)t.push(i[s])}}return t?Fc(r?t:t.sort(Pr)):io}static from(e){switch(e.length){case 0:return wt;case 1:return e[0];default:return new sr(e.every(t=>t instanceof Ne)?e:e.reduce((t,r)=>t.concat(r instanceof Ne?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function tk(n,e,t,r,o,i,s){let a=n.slice();for(let d=0,u=i;d<t.maps.length;d++){let p=0;t.maps[d].forEach((f,h,m,g)=>{let b=g-m-(h-f);for(let y=0;y<a.length;y+=3){let k=a[y+1];if(k<0||f>k+u-p)continue;let E=a[y]+u-p;h>=E?a[y+1]=f<=E?-2:-1:f>=u&&b&&(a[y]+=b,a[y+1]+=b)}p+=b}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){c=!0,a[d+1]=-1;continue}let u=t.map(n[d]+i),p=u-o;if(p<0||p>=r.content.size){c=!0;continue}let f=t.map(n[d+1]+i,-1),h=f-o,{index:m,offset:g}=r.content.findIndex(p),b=r.maybeChild(m);if(b&&g==p&&g+b.nodeSize==h){let y=a[d+2].mapInner(t,b,u+1,n[d]+i+1,s);y!=wt?(a[d]=p,a[d+1]=h,a[d+2]=y):(a[d+1]=-2,c=!0)}else c=!0}if(c){let d=nk(a,n,e,t,o,i,s),u=Bs(d,r,0,s);e=u.local;for(let p=0;p<a.length;p+=3)a[p+1]<0&&(a.splice(p,3),p-=3);for(let p=0,f=0;p<u.children.length;p+=3){let h=u.children[p];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,u.children[p],u.children[p+1],u.children[p+2])}}return new Ne(e.sort(Pr),a)}function Ih(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let o=n[r];t.push(new Ze(o.from+e,o.to+e,o.type))}return t}function nk(n,e,t,r,o,i,s){function a(c,d){for(let u=0;u<c.local.length;u++){let p=c.local[u].map(r,o,d);p?t.push(p):s.onRemove&&s.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)a(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&a(n[c+2],e[c]+i+1);return t}function Bh(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,o=null;for(let i=0,s;i<n.length;i++)(s=n[i])&&s.from>t&&s.to<r&&((o||(o=[])).push(s),n[i]=null);return o}function Lh(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Bs(n,e,t,r){let o=[],i=!1;e.forEach((a,c)=>{let d=Bh(n,a,c+t);if(d){i=!0;let u=Bs(d,a,t+c+1,r);u!=wt&&o.push(c,c+a.nodeSize,u)}});let s=Ih(i?Lh(n):n,-t).sort(Pr);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 Ne(s,o):wt}function Pr(n,e){return n.from-e.from||n.to-e.to}function Fc(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let o=t+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==n&&(e=n.slice()),e[o]=i.copy(i.from,r.to),Mu(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,i.from),Mu(e,o,r.copy(i.from,r.to)));break}}}return e}function Mu(n,e,t){for(;e<n.length&&Pr(t,n[e])>0;)e++;n.splice(e,0,t)}function al(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=wt&&e.push(r)}),n.cursorWrapper&&e.push(Ne.create(n.state.doc,[n.cursorWrapper.deco])),sr.from(e)}const rk={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ok=Ft&&mr<=11;class ik{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 sk{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ik,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]);Ft&&mr<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),ok&&(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,rk)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Eu(this.view)){if(this.suppressingSelectionUpdates)return jn(this.view);if(Ft&&mr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Wr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let i=e.focusNode;i;i=pi(i))t.add(i);for(let i=e.anchorNode;i;i=pi(i))if(t.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 t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Eu(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,c=[];if(e.editable)for(let u=0;u<t.length;u++){let p=this.registerMutation(t[u],c);p&&(i=i<0?p.from:Math.min(p.from,i),s=s<0?p.to:Math.max(p.to,s),p.typeOver&&(a=!0))}if(bn&&c.length){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let[p,f]=u;p.parentNode&&p.parentNode.parentNode==f.parentNode?f.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!p||ck(e,p)!=h)&&f.remove()}}}let d=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&_a(r)&&(d=Rc(e))&&d.eq(ee.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,jn(e),this.currentSelection.set(r)):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),ak(e)),this.handleDOMChange(i,s,a,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||jn(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.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 p=e.addedNodes[u];t.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}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(Ft&&mr<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:p,nextSibling:f}=e.addedNodes[u];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==e.target?gt(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),c=i&&i.parentNode==e.target?gt(i):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:a,to:d}}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 Au=new WeakMap,Ru=!1;function ak(n){if(!Au.has(n)&&(Au.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=bn,Ru)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."),Ru=!0}}function Du(n,e){let t=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return Wr(s.node,s.offset,o,i)&&([t,r,o,i]=[o,i,t,r]),{anchorNode:t,anchorOffset:r,focusNode:o,focusOffset:i}}function lk(n,e){if(e.getComposedRanges){let o=e.getComposedRanges(n.root)[0];if(o)return Du(n,o)}let t;function r(o){o.preventDefault(),o.stopImmediatePropagation(),t=o.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?Du(n,t):null}function ck(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let r=n.docView.nearestDesc(t,!0);if(r&&r.node.isBlock)return t}return null}function dk(n,e,t){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,u=c.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],_a(c)||d.push({node:c.focusNode,offset:c.focusOffset})),Et&&n.input.lastKeyCode===8)for(let b=i;b>o;b--){let y=r.childNodes[b-1],k=y.pmViewDesc;if(y.nodeName=="BR"&&!k){i=b;break}if(!k||k.size)break}let p=n.state.doc,f=n.someProp("domParser")||hr.fromSchema(n.state.schema),h=p.resolve(s),m=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:uk,context:h});if(d&&d[0].pos!=null){let b=d[0].pos,y=d[1]&&d[1].pos;y==null&&(y=b),m={anchor:b+s,head:y+s}}return{doc:g,sel:m,from:s,to:a}}function uk(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Rt&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Rt&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const pk=/^(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 fk(n,e,t,r,o){let i=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let A=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,$=Rc(n,A);if($&&!n.state.selection.eq($)){if(Et&&qn&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",te=>te(n,Or(13,"Enter"))))return;let J=n.state.tr.setSelection($);A=="pointer"?J.setMeta("pointer",!0):A=="key"&&J.scrollIntoView(),i&&J.setMeta("composition",i),n.dispatch(J)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let c=n.state.selection,d=dk(n,e,t),u=n.state.doc,p=u.slice(d.from,d.to),f,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(f=n.state.selection.to,h="end"):(f=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let m=gk(p.content,d.doc.content,d.from,f,h);if(m&&n.input.domChangeCount++,(vo&&n.input.lastIOSEnter>Date.now()-225||qn)&&o.some(A=>A.nodeType==1&&!pk.test(A.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",A=>A(n,Or(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof Y&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let A=Iu(n,n.state.doc,d.sel);if(A&&!A.eq(n.state.selection)){let $=n.state.tr.setSelection(A);i&&$.setMeta("composition",i),n.dispatch($)}}return}n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof Y&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),Ft&&mr<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),b=d.doc.resolveNoCache(m.endB-d.from),y=u.resolve(m.start),k=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA,E;if((vo&&n.input.lastIOSEnter>Date.now()-225&&(!k||o.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!k&&g.pos<d.doc.content.size&&!g.sameParent(b)&&(E=ee.findFrom(d.doc.resolve(g.pos+1),1,!0))&&E.head==b.pos)&&n.someProp("handleKeyDown",A=>A(n,Or(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&mk(u,m.start,m.endA,g,b)&&n.someProp("handleKeyDown",A=>A(n,Or(8,"Backspace")))){qn&&Et&&n.domObserver.suppressSelectionUpdates();return}Et&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),qn&&!k&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,b=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(A){return A(n,Or(13,"Enter"))})},20));let v=m.start,_=m.endA,C,D,B;if(k){if(g.pos==b.pos)Ft&&mr<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>jn(n),20)),C=n.state.tr.delete(v,_),D=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(B=hk(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start()))))C=n.state.tr,B.type=="add"?C.addMark(v,_,B.mark):C.removeMark(v,_,B.mark);else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let A=g.parent.textBetween(g.parentOffset,b.parentOffset);if(n.someProp("handleTextInput",$=>$(n,v,_,A)))return;C=n.state.tr.insertText(A,v,_)}}if(C||(C=n.state.tr.replace(v,_,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let A=Iu(n,C.doc,d.sel);A&&!(Et&&n.composing&&A.empty&&(m.start!=m.endB||n.input.lastChromeDelete<Date.now()-100)&&(A.head==v||A.head==C.mapping.map(_)-1)||Ft&&A.empty&&A.head==v)&&C.setSelection(A)}D&&C.ensureMarks(D),i&&C.setMeta("composition",i),n.dispatch(C.scrollIntoView())}function Iu(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Dc(n,e.resolve(t.anchor),e.resolve(t.head))}function hk(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,o=t,i=r,s,a,c;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<t.length;u++)i=t[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",c=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",c=u=>u.mark(a.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(S.from(d).eq(n))return{mark:a,type:s}}function mk(n,e,t,r,o){if(t-e<=o.pos-r.pos||ll(r,!0,!1)<o.pos)return!1;let i=n.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&t==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=n.resolve(ll(i,!0,!0));return!s.parent.isTextblock||s.pos>t||ll(s,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function ll(n,e,t){let r=n.depth,o=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,o++,e=!1;if(t){let i=n.node(r).maybeChild(n.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function gk(n,e,t,r,o){let i=n.findDiffStart(e,t);if(i==null)return null;let{a:s,b:a}=n.findDiffEnd(e,t+n.size,t+e.size);if(o=="end"){let c=Math.max(0,i-Math.min(s,a));r-=s+c-i}if(s<i&&n.size<e.size){let c=r<=i&&r>=s?i-r:0;i-=c,i&&i<e.size&&Bu(e.textBetween(i-1,i+1))&&(i+=c?1:-1),a=i+(a-s),s=i}else if(a<i){let c=r<=i&&r>=a?i-r:0;i-=c,i&&i<n.size&&Bu(n.textBetween(i-1,i+1))&&(i+=c?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function Bu(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class bk{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Lv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zu),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=$u(this),Pu(this),this.nodeViews=Fu(this),this.docView=gu(this.state.doc,Lu(this),al(this),this.dom,this),this.domObserver=new sk(this,(r,o,i,s)=>fk(this,r,o,i,s)),this.domObserver.start(),Pv(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Zl(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(zu),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Mh(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Fu(this);vk(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Zl(this),this.editable=$u(this),Pu(this);let c=al(this),d=Lu(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",p=i||!this.docView.matchesNode(e.doc,d,c);(p||!e.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Xy(this);if(s){this.domObserver.stop();let h=p&&(Ft||Et)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&yk(o.selection,e.selection);if(p){let m=Et?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Yv(this)),(i||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=gu(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&wv(this))?jn(this,h):(yh(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():f&&Zy(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof G){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&du(this,t.getBoundingClientRect(),e)}else du(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 t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){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-t.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Rh(e.slice,e.move,o<0?void 0:G.create(this.state.doc,o))}someProp(e,t){let r=this._props&&this._props[e],o;if(r!=null&&(o=t?t(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=t?t(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=t?t(a):a))return o}}hasFocus(){if(Ft){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&&Qy(this.dom),jn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ov(this,e)}coordsAtPos(e,t=1){return dh(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let o=this.docView.posFromDOM(e,t,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,t){return cv(this,t||this.state,e)}pasteHTML(e,t){return hi(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return hi(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ic(this,e)}destroy(){this.docView&&($v(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],al(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,zy())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return zv(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Rt&&this.root.nodeType===11&&qy(this.dom.ownerDocument)==this.dom&&lk(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Lu(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Ze.node(0,n.state.doc.content.size,e)]}function Pu(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Ze.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function $u(n){return!n.someProp("editable",e=>e(n.state)===!1)}function yk(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Fu(n){let e=Object.create(null);function t(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function vk(n,e){let t=0,r=0;for(let o in n){if(n[o]!=e[o])return!0;t++}for(let o in e)r++;return t!=r}function zu(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var yr={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:"'"},Ls={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kk=typeof navigator<"u"&&/Mac/.test(navigator.platform),wk=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var bt=0;bt<10;bt++)yr[48+bt]=yr[96+bt]=String(bt);for(var bt=1;bt<=24;bt++)yr[bt+111]="F"+bt;for(var bt=65;bt<=90;bt++)yr[bt]=String.fromCharCode(bt+32),Ls[bt]=String.fromCharCode(bt);for(var cl in yr)Ls.hasOwnProperty(cl)||(Ls[cl]=yr[cl]);function Ek(n){var e=kk&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||wk&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ls:yr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const Ck=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function _k(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,o,i,s;for(let a=0;a<e.length-1;a++){let c=e[a];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))Ck?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),o&&(t="Ctrl-"+t),s&&(t="Meta-"+t),i&&(t="Shift-"+t),t}function Sk(n){let e=Object.create(null);for(let t in n)e[_k(t)]=n[t];return e}function dl(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function xk(n){return new Te({props:{handleKeyDown:zc(n)}})}function zc(n){let e=Sk(n);return function(t,r){let o=Ek(r),i,s=e[dl(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[dl(o,r,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=yr[r.keyCode])&&i!=o){let a=e[dl(i,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}const Vc=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Ph(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const $h=(n,e,t)=>{let r=Ph(n,t);if(!r)return!1;let o=Hc(r);if(!o){let s=r.blockRange(),a=s&&Oo(s);return a==null?!1:(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(Gh(n,o,e,-1))return!0;if(r.parent.content.size==0&&(ko(i,"end")||G.isSelectable(i)))for(let s=r.depth;;s--){let a=Ca(n.doc,r.before(s),r.after(s),O.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=n.tr.step(a);c.setSelection(ko(i,"end")?ee.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):G.create(c.doc,o.pos-i.nodeSize)),e(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(n.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},Nk=(n,e,t)=>{let r=Ph(n,t);if(!r)return!1;let o=Hc(r);return o?Fh(n,o,e):!1},Tk=(n,e,t)=>{let r=Vh(n,t);if(!r)return!1;let o=Uc(r);return o?Fh(n,o,e):!1};function Fh(n,e,t){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,c=e.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let d=Ca(n.doc,i,c,O.empty);if(!d||d.from!=i||d instanceof mt&&d.slice.size>=c-i)return!1;if(t){let u=n.tr.step(d);u.setSelection(Y.create(u.doc,i)),t(u.scrollIntoView())}return!0}function ko(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const zh=(n,e,t)=>{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;i=Hc(r)}let s=i&&i.nodeBefore;return!s||!G.isSelectable(s)?!1:(e&&e(n.tr.setSelection(G.create(n.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Hc(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function Vh(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const Hh=(n,e,t)=>{let r=Vh(n,t);if(!r)return!1;let o=Uc(r);if(!o)return!1;let i=o.nodeAfter;if(Gh(n,o,e,1))return!0;if(r.parent.content.size==0&&(ko(i,"start")||G.isSelectable(i))){let s=Ca(n.doc,r.before(),r.after(),O.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=n.tr.step(s);a.setSelection(ko(i,"start")?ee.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):G.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(n.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Uh=(n,e,t)=>{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;i=Uc(r)}let s=i&&i.nodeAfter;return!s||!G.isSelectable(s)?!1:(e&&e(n.tr.setSelection(G.create(n.doc,i.pos)).scrollIntoView()),!0)};function Uc(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const Ok=(n,e)=>{let t=n.selection,r=t instanceof G,o;if(r){if(t.node.isTextblock||!kr(n.doc,t.from))return!1;o=t.from}else if(o=Ea(n.doc,t.from,-1),o==null)return!1;if(e){let i=n.tr.join(o);r&&i.setSelection(G.create(i.doc,o-n.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},Mk=(n,e)=>{let t=n.selection,r;if(t instanceof G){if(t.node.isTextblock||!kr(n.doc,t.to))return!1;r=t.to}else if(r=Ea(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},Ak=(n,e)=>{let{$from:t,$to:r}=n.selection,o=t.blockRange(r),i=o&&Oo(o);return i==null?!1:(e&&e(n.tr.lift(o,i).scrollIntoView()),!0)},Wh=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
13
|
-
`).scrollIntoView()),!0)};function Wc(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const Rk=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let o=t.node(-1),i=t.indexAfter(-1),s=Wc(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=t.after(),c=n.tr.replaceWith(a,a,s.createAndFill());c.setSelection(ee.near(c.doc.resolve(a),1)),e(c.scrollIntoView())}return!0},qh=(n,e)=>{let t=n.selection,{$from:r,$to:o}=t;if(t instanceof Jt||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Wc(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=n.tr.insert(s,i.createAndFill());a.setSelection(Y.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},Kh=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let i=t.before();if(Gn(n.doc,i))return e&&e(n.tr.split(i).scrollIntoView()),!0}let r=t.blockRange(),o=r&&Oo(r);return o==null?!1:(e&&e(n.tr.lift(r,o).scrollIntoView()),!0)};function Dk(n){return(e,t)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof G&&e.selection.node.isBlock)return!r.parentOffset||!Gn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,a,c=!1,d=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){c=r.end(h)==r.pos+(r.depth-h),d=r.start(h)==r.pos-(r.depth-h),a=Wc(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),i.unshift(c&&a?{type:a}:null),s=h;break}else{if(h==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof Y||e.selection instanceof Jt)&&u.deleteSelection();let p=u.mapping.map(r.pos),f=Gn(u.doc,p,i.length,i);if(f||(i[0]=a?{type:a}:null,f=Gn(u.doc,p,i.length,i)),u.split(p,i.length,i),!c&&d&&r.node(s).type!=a){let h=u.mapping.map(r.before(s)),m=u.doc.resolve(h);a&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return t&&t(u.scrollIntoView()),!0}}const Ik=Dk(),Bk=(n,e)=>{let{$from:t,to:r}=n.selection,o,i=t.sharedDepth(r);return i==0?!1:(o=t.before(i),e&&e(n.tr.setSelection(G.create(n.doc,o))),!0)};function Lk(n,e,t){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)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||kr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function Gh(n,e,t,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,c=o.type.spec.isolating||i.type.spec.isolating;if(!c&&Lk(n,e,t))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(t){let h=e.pos+i.nodeSize,m=S.empty;for(let y=s.length-1;y>=0;y--)m=S.from(s[y].create(null,m));m=S.from(o.copy(m));let g=n.tr.step(new yt(e.pos-1,h,e.pos,h,new O(m,1,0),s.length,!0)),b=g.doc.resolve(h+2*s.length);b.nodeAfter&&b.nodeAfter.type==o.type&&kr(g.doc,b.pos)&&g.join(b.pos),t(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&c?null:ee.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),f=p&&Oo(p);if(f!=null&&f>=e.depth)return t&&t(n.tr.lift(p,f).scrollIntoView()),!0;if(d&&ko(i,"start",!0)&&ko(o,"end")){let h=o,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let g=i,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(t){let y=S.empty;for(let E=m.length-1;E>=0;E--)y=S.from(m[E].copy(y));let k=n.tr.step(new yt(e.pos-m.length,e.pos+i.nodeSize,e.pos+b,e.pos+i.nodeSize-b,new O(y,m.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function jh(n){return function(e,t){let r=e.selection,o=n<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(t&&t(e.tr.setSelection(Y.create(e.doc,n<0?o.start(i):o.end(i)))),!0):!1}}const Pk=jh(-1),$k=jh(1);function Fk(n,e=null){return function(t,r){let{$from:o,$to:i}=t.selection,s=o.blockRange(i),a=s&&Mc(s,n,e);return a?(r&&r(t.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Vu(n,e=null){return function(t,r){let o=!1;for(let i=0;i<t.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=t.selection.ranges[i];t.doc.nodesBetween(s,a,(c,d)=>{if(o)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)o=!0;else{let u=t.doc.resolve(d),p=u.index();o=u.parent.canReplaceWith(p,p+1,n)}})}if(!o)return!1;if(r){let i=t.tr;for(let s=0;s<t.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:c}}=t.selection.ranges[s];i.setBlockType(a,c,n,e)}r(i.scrollIntoView())}return!0}}function qc(...n){return function(e,t,r){for(let o=0;o<n.length;o++)if(n[o](e,t,r))return!0;return!1}}qc(Vc,$h,zh);qc(Vc,Hh,Uh);qc(Wh,qh,Kh,Ik);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function zk(n,e=null){return function(t,r){let{$from:o,$to:i}=t.selection,s=o.blockRange(i);if(!s)return!1;let a=r?t.tr:null;return Vk(a,s,n,e)?(r&&r(a.scrollIntoView()),!0):!1}}function Vk(n,e,t,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=s.resolve(e.start-2);i=new Os(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Os(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=Mc(i,t,r,e);return a?(n&&Hk(n,e,a,o,t),!0):!1}function Hk(n,e,t,r,o){let i=S.empty;for(let u=t.length-1;u>=0;u--)i=S.from(t[u].type.create(t[u].attrs,i));n.step(new yt(e.start-(r?2:0),e.end,e.start,e.end,new O(i,0,0),t.length,!0));let s=0;for(let u=0;u<t.length;u++)t[u].type==o&&(s=u+1);let a=t.length-s,c=e.start+t.length-(r?2:0),d=e.parent;for(let u=e.startIndex,p=e.endIndex,f=!0;u<p;u++,f=!1)!f&&Gn(n.doc,c,a)&&(n.split(c,a),c+=2*a),c+=d.child(u).nodeSize;return n}function Uk(n){return function(e,t){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==n);return i?t?r.node(i.depth-1).type==n?Wk(e,t,n,i):qk(e,t,i):!0:!1}}function Wk(n,e,t,r){let o=n.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new yt(i-1,s,i,s,new O(S.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new Os(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Oo(r);if(a==null)return!1;o.lift(r,a);let c=o.mapping.map(i,-1)-1;return kr(o.doc,c)&&o.join(c),e(o.scrollIntoView()),!0}function qk(n,e,t){let r=n.tr,o=t.parent;for(let h=t.end,m=t.endIndex-1,g=t.startIndex;m>g;m--)h-=o.child(m).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(t.start),s=i.nodeAfter;if(r.mapping.map(t.end)!=t.start+i.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,c=t.endIndex==o.childCount,d=i.node(-1),u=i.index(-1);if(!d.canReplace(u+(a?0:1),u+1,s.content.append(c?S.empty:S.from(o))))return!1;let p=i.pos,f=p+s.nodeSize;return r.step(new yt(p-(a?1:0),f+(c?1:0),p+1,f-1,new O((a?S.empty:S.from(o.copy(S.empty))).append(c?S.empty:S.from(o.copy(S.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Kk(n){return function(e,t){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,d=>d.childCount>0&&d.firstChild.type==n);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,c=a.child(s-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==a.type,u=S.from(d?n.create():null),p=new O(S.from(n.create(null,S.from(a.type.create(null,u)))),d?3:1,0),f=i.start,h=i.end;t(e.tr.step(new yt(f-(d?3:1),h,f,h,p,1,!0)).scrollIntoView())}return!0}}function Na(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:o}=t,{storedMarks:i}=t;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=t.selection,o=t.doc,i=t.storedMarks,t}}}class Ta{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:t,state:r}=this,{view:o}=t,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,c])=>[a,(...u)=>{const p=c(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],c=!!e,d=e||i.tr,u=()=>(!c&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),a.every(f=>f===!0)),p={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...g)=>{const b=this.buildProps(d,t),y=h(...g)(b);return a.push(y),p}])),run:u};return p}createCan(e){const{rawCommands:t,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(t).map(([c,d])=>[c,(...u)=>d(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,t=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:Na({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(a)]))}};return a}}class Gk{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(o=>o!==t):delete this.callbacks[e]),this}once(e,t){const r=(...o)=>{this.off(e,r),t.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function U(n,e,t){return n.config[e]===void 0&&n.parent?U(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?U(n.parent,e,t):null}):n.config[e]}function Oa(n){const e=n.filter(o=>o.type==="extension"),t=n.filter(o=>o.type==="node"),r=n.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Jh(n){const e=[],{nodeExtensions:t,markExtensions:r}=Oa(n),o=[...t,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},c=U(s,"addGlobalAttributes",a);if(!c)return;c().forEach(u=>{u.types.forEach(p=>{Object.entries(u.attributes).forEach(([f,h])=>{e.push({type:p,name:f,attribute:{...i,...h}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},c=U(s,"addAttributes",a);if(!c)return;const d=c();Object.entries(d).forEach(([u,p])=>{const f={...i,...p};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function lt(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function _e(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?String(i).split(" "):[],c=r[o]?r[o].split(" "):[],d=a.filter(u=>!c.includes(u));r[o]=[...c,...d].join(" ")}else if(o==="style"){const a=i?i.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],d=new Map;c.forEach(u=>{const[p,f]=u.split(":").map(h=>h.trim());d.set(p,f)}),a.forEach(u=>{const[p,f]=u.split(":").map(h=>h.trim());d.set(p,f)}),r[o]=Array.from(d.entries()).map(([u,p])=>`${u}: ${p}`).join("; ")}else r[o]=i}),r},{})}function Ql(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>_e(t,r),{})}function Yh(n){return typeof n=="function"}function me(n,e=void 0,...t){return Yh(n)?e?n.bind(e)(...t):n(...t):n}function jk(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Jk(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Hu(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(t):Jk(t.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function Uu(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&jk(t)?!1:t!=null))}function Yk(n,e){var t;const r=Jh(n),{nodeExtensions:o,markExtensions:i}=Oa(n),s=(t=o.find(d=>U(d,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(o.map(d=>{const u=r.filter(y=>y.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},f=n.reduce((y,k)=>{const E=U(k,"extendNodeSchema",p);return{...y,...E?E(d):{}}},{}),h=Uu({...f,content:me(U(d,"content",p)),marks:me(U(d,"marks",p)),group:me(U(d,"group",p)),inline:me(U(d,"inline",p)),atom:me(U(d,"atom",p)),selectable:me(U(d,"selectable",p)),draggable:me(U(d,"draggable",p)),code:me(U(d,"code",p)),whitespace:me(U(d,"whitespace",p)),linebreakReplacement:me(U(d,"linebreakReplacement",p)),defining:me(U(d,"defining",p)),isolating:me(U(d,"isolating",p)),attrs:Object.fromEntries(u.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),m=me(U(d,"parseHTML",p));m&&(h.parseDOM=m.map(y=>Hu(y,u)));const g=U(d,"renderHTML",p);g&&(h.toDOM=y=>g({node:y,HTMLAttributes:Ql(y,u)}));const b=U(d,"renderText",p);return b&&(h.toText=b),[d.name,h]})),c=Object.fromEntries(i.map(d=>{const u=r.filter(b=>b.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},f=n.reduce((b,y)=>{const k=U(y,"extendMarkSchema",p);return{...b,...k?k(d):{}}},{}),h=Uu({...f,inclusive:me(U(d,"inclusive",p)),excludes:me(U(d,"excludes",p)),group:me(U(d,"group",p)),spanning:me(U(d,"spanning",p)),code:me(U(d,"code",p)),attrs:Object.fromEntries(u.map(b=>{var y;return[b.name,{default:(y=b==null?void 0:b.attribute)===null||y===void 0?void 0:y.default}]}))}),m=me(U(d,"parseHTML",p));m&&(h.parseDOM=m.map(b=>Hu(b,u)));const g=U(d,"renderHTML",p);return g&&(h.toDOM=b=>g({mark:b,HTMLAttributes:Ql(b,u)})),[d.name,h]}));return new Tf({topNode:s,nodes:a,marks:c})}function ul(n,e){return e.nodes[n]||e.marks[n]||null}function Wu(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Kc(n,e){const t=Jr.fromSchema(e).serializeFragment(n),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(t),o.innerHTML}const Xk=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var c,d;const u=((d=(c=o.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";t+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),t};function Gc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Ri{constructor(e){this.find=e.find,this.handler=e.handler}}const Zk=(n,e)=>{if(Gc(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Wi(n){var e;const{editor:t,from:r,to:o,text:i,rules:s,plugin:a}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const p=Xk(d)+i;return s.forEach(f=>{if(u)return;const h=Zk(p,f.find);if(!h)return;const m=c.state.tr,g=Na({state:c.state,transaction:m}),b={from:r-(h[0].length-i.length),to:o},{commands:y,chain:k,can:E}=new Ta({editor:t,state:g});f.handler({state:g,range:b,match:h,commands:y,chain:k,can:E})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:o,text:i}),c.dispatch(m),u=!0)}),u}function Qk(n){const{editor:e,rules:t}=n,r=new Te({state:{init(){return null},apply(o,i,s){const a=o.getMeta(r);if(a)return a;const c=o.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=Kc(S.from(u),s.schema);const{from:p}=c,f=p+u.length;Wi({editor:e,from:p,to:f,text:u,rules:t,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return Wi({editor:e,from:i,to:s,text:a,rules:t,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Wi({editor:e,from:i.pos,to:i.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?Wi({editor:e,from:s.pos,to:s.pos,text:`
|
|
14
|
-
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
12
|
+
`))),0,0):O.empty;let p=n.someProp("clipboardTextParser",f=>f(e,o,r,n));if(p)a=p;else{let f=o.marks(),{schema:h}=n.state,m=Jr.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=s.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(h.text(g,f)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),s=Dv(t),Mi&&Iv(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(n.someProp("clipboardParser")||n.someProp("domParser")||hr.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!Mv.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=Bv(Tu(a,+u[1],+u[2]),u[4]);else if(a=O.maxOpen(Av(a.content,o),!0),a.openStart||a.openEnd){let p=0,f=0;for(let h=a.content.firstChild;p<a.openStart&&!h.type.spec.isolating;p++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=Tu(a,p,f)}return n.someProp("transformPasted",p=>{a=p(a,n)}),a}const Mv=/^(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 Av(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let o=e.node(t).contentMatchAt(e.index(t)),i,s=[];if(n.forEach(a=>{if(!s)return;let c=o.findWrapping(a.type),d;if(!c)return s=null;if(d=s.length&&i.length&&Ch(c,i,a,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=_h(s[s.length-1],i.length));let u=Eh(a,c);s.push(u),o=o.matchType(u.type),i=c}}),s)return S.from(s)}return n}function Eh(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,S.from(n));return n}function Ch(n,e,t,r,o){if(o<n.length&&o<e.length&&n[o]==e[o]){let i=Ch(n,e,t,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==n.length-1?t.type:n[o+1]))return r.copy(r.content.append(S.from(Eh(t,n,o+1))))}}function _h(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,_h(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(S.empty,!0);return n.copy(t.append(r))}function Xl(n,e,t,r,o,i){let s=e<0?n.firstChild:n.lastChild,a=s.content;return n.childCount>1&&(i=0),o<r-1&&(a=Xl(a,e,t,r,o+1,i)),o>=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(S.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function Tu(n,e,t){return e<n.openStart&&(n=new O(Xl(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new O(Xl(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const Sh={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 Ou=null;function xh(){return Ou||(Ou=document.implementation.createHTMLDocument("title"))}let sl=null;function Rv(n){let e=window.trustedTypes;return e?(sl||(sl=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),sl.createHTML(n)):n}function Dv(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=xh().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),o;if((o=r&&Sh[r[1].toLowerCase()])&&(n=o.map(i=>"<"+i+">").join("")+n+o.map(i=>"</"+i+">").reverse().join("")),t.innerHTML=Rv(n),o)for(let i=0;i<o.length;i++)t=t.querySelector(o[i])||t;return t}function Iv(n){let e=n.querySelectorAll(Et?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function Bv(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:o,openStart:i,openEnd:s}=n;for(let a=r.length-2;a>=0;a-=2){let c=t.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;o=S.from(c.create(r[a+1],o)),i++,s++}return new O(o,i,s)}const Dt={},It={},Lv={touchstart:!0,touchmove:!0};class Pv{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.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 $v(n){for(let e in Dt){let t=Dt[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{zv(n,r)&&!Bc(n,r)&&(n.editable||!(r.type in It))&&t(n,r)},Lv[e]?{passive:!0}:void 0)}Rt&&n.dom.addEventListener("input",()=>null),Zl(n)}function ur(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Fv(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Zl(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Bc(n,r))})}function Bc(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function zv(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Vv(n,e){!Bc(n,e)&&Dt[e.type]&&(n.editable||!(e.type in It))&&Dt[e.type](n,e)}It.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Th(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(qn&&Et&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),vo&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",o=>o(n,Or(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Ov(n,t)?t.preventDefault():ur(n,"key")};It.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};It.keypress=(n,e)=>{let t=e;if(Th(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||rn&&t.metaKey)return;if(n.someProp("handleKeyPress",o=>o(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof Y)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(t.charCode);!/[\r\n]/.test(o)&&!n.someProp("handleTextInput",i=>i(n,r.$from.pos,r.$to.pos,o))&&n.dispatch(n.state.tr.insertText(o).scrollIntoView()),t.preventDefault()}};function xa(n){return{left:n.clientX,top:n.clientY}}function Hv(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Lc(n,e,t,r,o){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(n.someProp(e,a=>s>i.depth?a(n,t,i.nodeAfter,i.before(s),o,!0):a(n,t,i.node(s),i.before(s),o,!1)))return!0;return!1}function mo(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function Uv(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&G.isSelectable(r)?(mo(n,new G(t)),!0):!1}function Wv(n,e){if(e==-1)return!1;let t=n.state.selection,r,o;t instanceof G&&(r=t.node);let i=n.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(G.isSelectable(a)){r&&t.$from.depth>0&&s>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?o=i.before(t.$from.depth):o=i.before(s);break}}return o!=null?(mo(n,G.create(n.state.doc,o)),!0):!1}function qv(n,e,t,r,o){return Lc(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(o?Wv(n,t):Uv(n,t))}function Kv(n,e,t,r){return Lc(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",o=>o(n,e,r))}function Gv(n,e,t,r){return Lc(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",o=>o(n,e,r))||jv(n,t,r)}function jv(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(mo(n,Y.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)mo(n,Y.create(r,a+1,a+1+s.content.size));else if(G.isSelectable(s))mo(n,G.create(r,a));else continue;return!0}}function Pc(n){return Ds(n)}const Nh=rn?"metaKey":"ctrlKey";Dt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Pc(n),o=Date.now(),i="singleClick";o-n.input.lastClick.time<500&&Hv(t,n.input.lastClick)&&!t[Nh]&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:i};let s=n.posAtCoords(xa(t));s&&(i=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Jv(n,s,t,!!r)):(i=="doubleClick"?Kv:Gv)(n,s.pos,s.inside,t)?t.preventDefault():ur(n,"pointer"))};class Jv{constructor(e,t,r,o){this.view=e,this.pos=t,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Nh],this.allowDefault=r.shiftKey;let i,s;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,c=a?e.docView.nearestDesc(a,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:d}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||d instanceof G&&d.from<=s&&d.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&bn&&!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)),ur(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(()=>jn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(xa(e))),this.updateAllowDefault(e),this.allowDefault||!t?ur(this.view,"pointer"):qv(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Rt&&this.mightDrag&&!this.mightDrag.node.isAtom||Et&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(mo(this.view,ee.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ur(this.view,"pointer")}move(e){this.updateAllowDefault(e),ur(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)}}Dt.touchstart=n=>{n.input.lastTouch=Date.now(),Pc(n),ur(n,"pointer")};Dt.touchmove=n=>{n.input.lastTouch=Date.now(),ur(n,"pointer")};Dt.contextmenu=n=>Pc(n);function Th(n,e){return n.composing?!0:Rt&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Yv=qn?5e3:-1;It.compositionstart=It.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof Y&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Ds(n,!0),n.markCursor=null;else if(Ds(n,!e.selection.empty),bn&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.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=n.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}n.input.composing=!0}Oh(n,Yv)};It.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Oh(n,20))};function Oh(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ds(n),e))}function Mh(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Zv());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Xv(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=Uy(e.focusNode,e.focusOffset),r=Wy(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let o=r.pmViewDesc,i=n.domObserver.lastChangedTextNode;if(t==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function Zv(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ds(n,e=!1){if(!(qn&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Mh(n),e||n.docView&&n.docView.dirty){let t=Rc(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function Qv(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const fi=Ft&&mr<15||vo&&Jy<604;Dt.copy=It.cut=(n,e)=>{let t=e,r=n.state.selection,o=t.type=="cut";if(r.empty)return;let i=fi?null:t.clipboardData,s=r.content(),{dom:a,text:c}=Ic(n,s);i?(t.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",c)):Qv(n,a),o&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ek(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function tk(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?hi(n,r.value,null,o,e):hi(n,r.textContent,r.innerHTML,o,e)},50)}function hi(n,e,t,r,o){let i=wh(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,o,i||O.empty)))return!0;if(!i)return!1;let s=ek(i),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ah(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}It.paste=(n,e)=>{let t=e;if(n.composing&&!qn)return;let r=fi?null:t.clipboardData,o=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&hi(n,Ah(r),r.getData("text/html"),o,t)?t.preventDefault():tk(n,t)};class Rh{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Dh=rn?"altKey":"ctrlKey";Dt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=n.state.selection,i=o.empty?null:n.posAtCoords(xa(t)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof G?o.to-1:o.to))){if(r&&r.mightDrag)s=G.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let p=n.docView.nearestDesc(t.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(s=G.create(n.state.doc,p.posBefore))}}let a=(s||n.state.selection).content(),{dom:c,text:d,slice:u}=Ic(n,a);(!t.dataTransfer.files.length||!Et||ih>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(fi?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",fi||t.dataTransfer.setData("text/plain",d),n.dragging=new Rh(u,!t[Dh],s)};Dt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};It.dragover=It.dragenter=(n,e)=>e.preventDefault();It.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let o=n.posAtCoords(xa(t));if(!o)return;let i=n.state.doc.resolve(o.pos),s=r&&r.slice;s?n.someProp("transformPasted",m=>{s=m(s,n)}):s=wh(n,Ah(t.dataTransfer),fi?null:t.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!t[Dh]);if(n.someProp("handleDrop",m=>m(n,t,s||O.empty,a))){t.preventDefault();return}if(!s)return;t.preventDefault();let c=s?Iy(n.state.doc,i.pos,s):i.pos;c==null&&(c=i.pos);let d=n.state.tr;if(a){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),p=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=d.doc;if(p?d.replaceRangeWith(u,u,s.content.firstChild):d.replaceRange(u,u,s),d.doc.eq(f))return;let h=d.doc.resolve(u);if(p&&G.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new G(h));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,b,y,k)=>m=k),d.setSelection(Dc(n,h,d.doc.resolve(m)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))};Dt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&jn(n)},20))};Dt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Dt.beforeinput=(n,e)=>{if(Et&&qn&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Or(8,"Backspace")))))return;let{$cursor:o}=n.state.selection;o&&o.pos>0&&n.dispatch(n.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let n in It)Dt[n]=It[n];function mi(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Is{constructor(e,t){this.toDOM=e,this.spec=t||Lr,this.side=this.spec.side||0}map(e,t,r,o){let{pos:i,deleted:s}=e.mapResult(t.from+o,this.side<0?-1:1);return s?null:new Ze(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Is&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&mi(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class br{constructor(e,t){this.attrs=e,this.spec=t||Lr}map(e,t,r,o){let i=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Ze(i,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof br&&mi(this.attrs,e.attrs)&&mi(this.spec,e.spec)}static is(e){return e.type instanceof br}destroy(){}}class $c{constructor(e,t){this.attrs=e,this.spec=t||Lr}map(e,t,r,o){let i=e.mapResult(t.from+o,1);if(i.deleted)return null;let s=e.mapResult(t.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Ze(i.pos-r,s.pos-r,this)}valid(e,t){let{index:r,offset:o}=e.content.findIndex(t.from),i;return o==t.from&&!(i=e.child(r)).isText&&o+i.nodeSize==t.to}eq(e){return this==e||e instanceof $c&&mi(this.attrs,e.attrs)&&mi(this.spec,e.spec)}destroy(){}}class Ze{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Ze(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Ze(e,e,new Is(t,r))}static inline(e,t,r,o){return new Ze(e,t,new br(r,o))}static node(e,t,r,o){return new Ze(e,t,new $c(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof br}get widget(){return this.type instanceof Is}}const io=[],Lr={};class Ne{constructor(e,t){this.local=e.length?e:io,this.children=t.length?t:io}static create(e,t){return t.length?Bs(t,e,0,Lr):wt}find(e,t,r){let o=[];return this.findInner(e??0,t??1e9,o,0,r),o}findInner(e,t,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=t&&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]<t&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,t-a,r,o+a,i)}}map(e,t,r){return this==wt||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Lr)}mapInner(e,t,r,o,i){let s;for(let a=0;a<this.local.length;a++){let c=this.local[a].map(e,r,o);c&&c.type.valid(t,c)?(s||(s=[])).push(c):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?nk(this.children,s||[],e,t,r,o,i):s?new Ne(s.sort(Pr),io):wt}add(e,t){return t.length?this==wt?Ne.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let o,i=0;e.forEach((a,c)=>{let d=c+r,u;if(u=Bh(t,a,d)){for(o||(o=this.children.slice());i<o.length&&o[i]<c;)i+=3;o[i]==c?o[i+2]=o[i+2].addInner(a,u,d+1):o.splice(i,0,c,c+a.nodeSize,Bs(u,a,d+1,Lr)),i+=3}});let s=Ih(i?Lh(t):t,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ne(s.length?this.local.concat(s).sort(Pr):this.local,o||this.children)}remove(e){return e.length==0||this==wt?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+t,c=r[i+1]+t;for(let u=0,p;u<e.length;u++)(p=e[u])&&p.from>a&&p.to<c&&(e[u]=null,(s||(s=[])).push(p));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[i+2].removeInner(s,a+1);d!=wt?r[i+2]=d:(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,t)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Ne(o,r):wt}forChild(e,t){if(this==wt)return this;if(t.isLeaf)return Ne.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+t.content.size;for(let a=0;a<this.local.length;a++){let c=this.local[a];if(c.from<s&&c.to>i&&c.type instanceof br){let d=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;d<u&&(o||(o=[])).push(c.copy(d,u))}}if(o){let a=new Ne(o.sort(Pr),io);return r?new sr([a,r]):a}return r||wt}eq(e){if(this==e)return!0;if(!(e instanceof Ne)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Fc(this.localsInner(e))}localsInner(e){if(this==wt)return io;if(e.inlineContent||!this.local.some(br.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof br||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Ne.empty=new Ne([],[]);Ne.removeOverlap=Fc;const wt=Ne.empty;class sr{constructor(e){this.members=e}map(e,t){const r=this.members.map(o=>o.map(e,t,Lr));return sr.from(r)}forChild(e,t){if(t.isLeaf)return Ne.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,t);i!=wt&&(i instanceof sr?r=r.concat(i.members):r.push(i))}return sr.from(r)}eq(e){if(!(e instanceof sr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!t)t=i;else{r&&(t=t.slice(),r=!1);for(let s=0;s<i.length;s++)t.push(i[s])}}return t?Fc(r?t:t.sort(Pr)):io}static from(e){switch(e.length){case 0:return wt;case 1:return e[0];default:return new sr(e.every(t=>t instanceof Ne)?e:e.reduce((t,r)=>t.concat(r instanceof Ne?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function nk(n,e,t,r,o,i,s){let a=n.slice();for(let d=0,u=i;d<t.maps.length;d++){let p=0;t.maps[d].forEach((f,h,m,g)=>{let b=g-m-(h-f);for(let y=0;y<a.length;y+=3){let k=a[y+1];if(k<0||f>k+u-p)continue;let E=a[y]+u-p;h>=E?a[y+1]=f<=E?-2:-1:f>=u&&b&&(a[y]+=b,a[y+1]+=b)}p+=b}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){c=!0,a[d+1]=-1;continue}let u=t.map(n[d]+i),p=u-o;if(p<0||p>=r.content.size){c=!0;continue}let f=t.map(n[d+1]+i,-1),h=f-o,{index:m,offset:g}=r.content.findIndex(p),b=r.maybeChild(m);if(b&&g==p&&g+b.nodeSize==h){let y=a[d+2].mapInner(t,b,u+1,n[d]+i+1,s);y!=wt?(a[d]=p,a[d+1]=h,a[d+2]=y):(a[d+1]=-2,c=!0)}else c=!0}if(c){let d=rk(a,n,e,t,o,i,s),u=Bs(d,r,0,s);e=u.local;for(let p=0;p<a.length;p+=3)a[p+1]<0&&(a.splice(p,3),p-=3);for(let p=0,f=0;p<u.children.length;p+=3){let h=u.children[p];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,u.children[p],u.children[p+1],u.children[p+2])}}return new Ne(e.sort(Pr),a)}function Ih(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let o=n[r];t.push(new Ze(o.from+e,o.to+e,o.type))}return t}function rk(n,e,t,r,o,i,s){function a(c,d){for(let u=0;u<c.local.length;u++){let p=c.local[u].map(r,o,d);p?t.push(p):s.onRemove&&s.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)a(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&a(n[c+2],e[c]+i+1);return t}function Bh(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,o=null;for(let i=0,s;i<n.length;i++)(s=n[i])&&s.from>t&&s.to<r&&((o||(o=[])).push(s),n[i]=null);return o}function Lh(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Bs(n,e,t,r){let o=[],i=!1;e.forEach((a,c)=>{let d=Bh(n,a,c+t);if(d){i=!0;let u=Bs(d,a,t+c+1,r);u!=wt&&o.push(c,c+a.nodeSize,u)}});let s=Ih(i?Lh(n):n,-t).sort(Pr);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 Ne(s,o):wt}function Pr(n,e){return n.from-e.from||n.to-e.to}function Fc(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let o=t+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==n&&(e=n.slice()),e[o]=i.copy(i.from,r.to),Mu(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,i.from),Mu(e,o,r.copy(i.from,r.to)));break}}}return e}function Mu(n,e,t){for(;e<n.length&&Pr(t,n[e])>0;)e++;n.splice(e,0,t)}function al(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=wt&&e.push(r)}),n.cursorWrapper&&e.push(Ne.create(n.state.doc,[n.cursorWrapper.deco])),sr.from(e)}const ok={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ik=Ft&&mr<=11;class sk{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 ak{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sk,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]);Ft&&mr<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),ik&&(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,ok)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Eu(this.view)){if(this.suppressingSelectionUpdates)return jn(this.view);if(Ft&&mr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Wr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let i=e.focusNode;i;i=pi(i))t.add(i);for(let i=e.anchorNode;i;i=pi(i))if(t.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 t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Eu(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,c=[];if(e.editable)for(let u=0;u<t.length;u++){let p=this.registerMutation(t[u],c);p&&(i=i<0?p.from:Math.min(p.from,i),s=s<0?p.to:Math.max(p.to,s),p.typeOver&&(a=!0))}if(bn&&c.length){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let[p,f]=u;p.parentNode&&p.parentNode.parentNode==f.parentNode?f.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!p||dk(e,p)!=h)&&f.remove()}}}let d=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&_a(r)&&(d=Rc(e))&&d.eq(ee.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,jn(e),this.currentSelection.set(r)):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),lk(e)),this.handleDOMChange(i,s,a,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||jn(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.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 p=e.addedNodes[u];t.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}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(Ft&&mr<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:p,nextSibling:f}=e.addedNodes[u];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==e.target?gt(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),c=i&&i.parentNode==e.target?gt(i):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:a,to:d}}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 Au=new WeakMap,Ru=!1;function lk(n){if(!Au.has(n)&&(Au.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=bn,Ru)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."),Ru=!0}}function Du(n,e){let t=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return Wr(s.node,s.offset,o,i)&&([t,r,o,i]=[o,i,t,r]),{anchorNode:t,anchorOffset:r,focusNode:o,focusOffset:i}}function ck(n,e){if(e.getComposedRanges){let o=e.getComposedRanges(n.root)[0];if(o)return Du(n,o)}let t;function r(o){o.preventDefault(),o.stopImmediatePropagation(),t=o.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?Du(n,t):null}function dk(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let r=n.docView.nearestDesc(t,!0);if(r&&r.node.isBlock)return t}return null}function uk(n,e,t){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,u=c.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],_a(c)||d.push({node:c.focusNode,offset:c.focusOffset})),Et&&n.input.lastKeyCode===8)for(let b=i;b>o;b--){let y=r.childNodes[b-1],k=y.pmViewDesc;if(y.nodeName=="BR"&&!k){i=b;break}if(!k||k.size)break}let p=n.state.doc,f=n.someProp("domParser")||hr.fromSchema(n.state.schema),h=p.resolve(s),m=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:pk,context:h});if(d&&d[0].pos!=null){let b=d[0].pos,y=d[1]&&d[1].pos;y==null&&(y=b),m={anchor:b+s,head:y+s}}return{doc:g,sel:m,from:s,to:a}}function pk(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Rt&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Rt&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const fk=/^(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 hk(n,e,t,r,o){let i=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let A=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,$=Rc(n,A);if($&&!n.state.selection.eq($)){if(Et&&qn&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",te=>te(n,Or(13,"Enter"))))return;let J=n.state.tr.setSelection($);A=="pointer"?J.setMeta("pointer",!0):A=="key"&&J.scrollIntoView(),i&&J.setMeta("composition",i),n.dispatch(J)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let c=n.state.selection,d=uk(n,e,t),u=n.state.doc,p=u.slice(d.from,d.to),f,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(f=n.state.selection.to,h="end"):(f=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let m=bk(p.content,d.doc.content,d.from,f,h);if(m&&n.input.domChangeCount++,(vo&&n.input.lastIOSEnter>Date.now()-225||qn)&&o.some(A=>A.nodeType==1&&!fk.test(A.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",A=>A(n,Or(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof Y&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let A=Iu(n,n.state.doc,d.sel);if(A&&!A.eq(n.state.selection)){let $=n.state.tr.setSelection(A);i&&$.setMeta("composition",i),n.dispatch($)}}return}n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof Y&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),Ft&&mr<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),b=d.doc.resolveNoCache(m.endB-d.from),y=u.resolve(m.start),k=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA,E;if((vo&&n.input.lastIOSEnter>Date.now()-225&&(!k||o.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!k&&g.pos<d.doc.content.size&&!g.sameParent(b)&&(E=ee.findFrom(d.doc.resolve(g.pos+1),1,!0))&&E.head==b.pos)&&n.someProp("handleKeyDown",A=>A(n,Or(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&gk(u,m.start,m.endA,g,b)&&n.someProp("handleKeyDown",A=>A(n,Or(8,"Backspace")))){qn&&Et&&n.domObserver.suppressSelectionUpdates();return}Et&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),qn&&!k&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,b=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(A){return A(n,Or(13,"Enter"))})},20));let v=m.start,_=m.endA,C,D,B;if(k){if(g.pos==b.pos)Ft&&mr<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>jn(n),20)),C=n.state.tr.delete(v,_),D=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(B=mk(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start()))))C=n.state.tr,B.type=="add"?C.addMark(v,_,B.mark):C.removeMark(v,_,B.mark);else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let A=g.parent.textBetween(g.parentOffset,b.parentOffset);if(n.someProp("handleTextInput",$=>$(n,v,_,A)))return;C=n.state.tr.insertText(A,v,_)}}if(C||(C=n.state.tr.replace(v,_,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let A=Iu(n,C.doc,d.sel);A&&!(Et&&n.composing&&A.empty&&(m.start!=m.endB||n.input.lastChromeDelete<Date.now()-100)&&(A.head==v||A.head==C.mapping.map(_)-1)||Ft&&A.empty&&A.head==v)&&C.setSelection(A)}D&&C.ensureMarks(D),i&&C.setMeta("composition",i),n.dispatch(C.scrollIntoView())}function Iu(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Dc(n,e.resolve(t.anchor),e.resolve(t.head))}function mk(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,o=t,i=r,s,a,c;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<t.length;u++)i=t[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",c=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",c=u=>u.mark(a.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(S.from(d).eq(n))return{mark:a,type:s}}function gk(n,e,t,r,o){if(t-e<=o.pos-r.pos||ll(r,!0,!1)<o.pos)return!1;let i=n.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&t==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=n.resolve(ll(i,!0,!0));return!s.parent.isTextblock||s.pos>t||ll(s,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function ll(n,e,t){let r=n.depth,o=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,o++,e=!1;if(t){let i=n.node(r).maybeChild(n.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function bk(n,e,t,r,o){let i=n.findDiffStart(e,t);if(i==null)return null;let{a:s,b:a}=n.findDiffEnd(e,t+n.size,t+e.size);if(o=="end"){let c=Math.max(0,i-Math.min(s,a));r-=s+c-i}if(s<i&&n.size<e.size){let c=r<=i&&r>=s?i-r:0;i-=c,i&&i<e.size&&Bu(e.textBetween(i-1,i+1))&&(i+=c?1:-1),a=i+(a-s),s=i}else if(a<i){let c=r<=i&&r>=a?i-r:0;i-=c,i&&i<n.size&&Bu(n.textBetween(i-1,i+1))&&(i+=c?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function Bu(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class yk{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Pv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zu),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=$u(this),Pu(this),this.nodeViews=Fu(this),this.docView=gu(this.state.doc,Lu(this),al(this),this.dom,this),this.domObserver=new ak(this,(r,o,i,s)=>hk(this,r,o,i,s)),this.domObserver.start(),$v(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Zl(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(zu),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Mh(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Fu(this);kk(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Zl(this),this.editable=$u(this),Pu(this);let c=al(this),d=Lu(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",p=i||!this.docView.matchesNode(e.doc,d,c);(p||!e.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Zy(this);if(s){this.domObserver.stop();let h=p&&(Ft||Et)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&vk(o.selection,e.selection);if(p){let m=Et?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Xv(this)),(i||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=gu(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Ev(this))?jn(this,h):(yh(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():f&&Qy(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof G){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&du(this,t.getBoundingClientRect(),e)}else du(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 t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){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-t.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Rh(e.slice,e.move,o<0?void 0:G.create(this.state.doc,o))}someProp(e,t){let r=this._props&&this._props[e],o;if(r!=null&&(o=t?t(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=t?t(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=t?t(a):a))return o}}hasFocus(){if(Ft){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&&ev(this.dom),jn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return iv(this,e)}coordsAtPos(e,t=1){return dh(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let o=this.docView.posFromDOM(e,t,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,t){return dv(this,t||this.state,e)}pasteHTML(e,t){return hi(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return hi(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ic(this,e)}destroy(){this.docView&&(Fv(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],al(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Vy())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Vv(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Rt&&this.root.nodeType===11&&Ky(this.dom.ownerDocument)==this.dom&&ck(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Lu(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Ze.node(0,n.state.doc.content.size,e)]}function Pu(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Ze.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function $u(n){return!n.someProp("editable",e=>e(n.state)===!1)}function vk(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Fu(n){let e=Object.create(null);function t(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function kk(n,e){let t=0,r=0;for(let o in n){if(n[o]!=e[o])return!0;t++}for(let o in e)r++;return t!=r}function zu(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var yr={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:"'"},Ls={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},wk=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ek=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var bt=0;bt<10;bt++)yr[48+bt]=yr[96+bt]=String(bt);for(var bt=1;bt<=24;bt++)yr[bt+111]="F"+bt;for(var bt=65;bt<=90;bt++)yr[bt]=String.fromCharCode(bt+32),Ls[bt]=String.fromCharCode(bt);for(var cl in yr)Ls.hasOwnProperty(cl)||(Ls[cl]=yr[cl]);function Ck(n){var e=wk&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Ek&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ls:yr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const _k=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Sk(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,o,i,s;for(let a=0;a<e.length-1;a++){let c=e[a];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))_k?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),o&&(t="Ctrl-"+t),s&&(t="Meta-"+t),i&&(t="Shift-"+t),t}function xk(n){let e=Object.create(null);for(let t in n)e[Sk(t)]=n[t];return e}function dl(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function Nk(n){return new Te({props:{handleKeyDown:zc(n)}})}function zc(n){let e=xk(n);return function(t,r){let o=Ck(r),i,s=e[dl(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[dl(o,r,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=yr[r.keyCode])&&i!=o){let a=e[dl(i,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}const Vc=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Ph(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const $h=(n,e,t)=>{let r=Ph(n,t);if(!r)return!1;let o=Hc(r);if(!o){let s=r.blockRange(),a=s&&Oo(s);return a==null?!1:(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(Gh(n,o,e,-1))return!0;if(r.parent.content.size==0&&(ko(i,"end")||G.isSelectable(i)))for(let s=r.depth;;s--){let a=Ca(n.doc,r.before(s),r.after(s),O.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=n.tr.step(a);c.setSelection(ko(i,"end")?ee.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):G.create(c.doc,o.pos-i.nodeSize)),e(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(n.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},Tk=(n,e,t)=>{let r=Ph(n,t);if(!r)return!1;let o=Hc(r);return o?Fh(n,o,e):!1},Ok=(n,e,t)=>{let r=Vh(n,t);if(!r)return!1;let o=Uc(r);return o?Fh(n,o,e):!1};function Fh(n,e,t){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,c=e.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let d=Ca(n.doc,i,c,O.empty);if(!d||d.from!=i||d instanceof mt&&d.slice.size>=c-i)return!1;if(t){let u=n.tr.step(d);u.setSelection(Y.create(u.doc,i)),t(u.scrollIntoView())}return!0}function ko(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const zh=(n,e,t)=>{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;i=Hc(r)}let s=i&&i.nodeBefore;return!s||!G.isSelectable(s)?!1:(e&&e(n.tr.setSelection(G.create(n.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Hc(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function Vh(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const Hh=(n,e,t)=>{let r=Vh(n,t);if(!r)return!1;let o=Uc(r);if(!o)return!1;let i=o.nodeAfter;if(Gh(n,o,e,1))return!0;if(r.parent.content.size==0&&(ko(i,"start")||G.isSelectable(i))){let s=Ca(n.doc,r.before(),r.after(),O.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=n.tr.step(s);a.setSelection(ko(i,"start")?ee.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):G.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(n.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Uh=(n,e,t)=>{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;i=Uc(r)}let s=i&&i.nodeAfter;return!s||!G.isSelectable(s)?!1:(e&&e(n.tr.setSelection(G.create(n.doc,i.pos)).scrollIntoView()),!0)};function Uc(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const Mk=(n,e)=>{let t=n.selection,r=t instanceof G,o;if(r){if(t.node.isTextblock||!kr(n.doc,t.from))return!1;o=t.from}else if(o=Ea(n.doc,t.from,-1),o==null)return!1;if(e){let i=n.tr.join(o);r&&i.setSelection(G.create(i.doc,o-n.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},Ak=(n,e)=>{let t=n.selection,r;if(t instanceof G){if(t.node.isTextblock||!kr(n.doc,t.to))return!1;r=t.to}else if(r=Ea(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},Rk=(n,e)=>{let{$from:t,$to:r}=n.selection,o=t.blockRange(r),i=o&&Oo(o);return i==null?!1:(e&&e(n.tr.lift(o,i).scrollIntoView()),!0)},Wh=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
13
|
+
`).scrollIntoView()),!0)};function Wc(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const Dk=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let o=t.node(-1),i=t.indexAfter(-1),s=Wc(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=t.after(),c=n.tr.replaceWith(a,a,s.createAndFill());c.setSelection(ee.near(c.doc.resolve(a),1)),e(c.scrollIntoView())}return!0},qh=(n,e)=>{let t=n.selection,{$from:r,$to:o}=t;if(t instanceof Jt||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Wc(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=n.tr.insert(s,i.createAndFill());a.setSelection(Y.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},Kh=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let i=t.before();if(Gn(n.doc,i))return e&&e(n.tr.split(i).scrollIntoView()),!0}let r=t.blockRange(),o=r&&Oo(r);return o==null?!1:(e&&e(n.tr.lift(r,o).scrollIntoView()),!0)};function Ik(n){return(e,t)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof G&&e.selection.node.isBlock)return!r.parentOffset||!Gn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,a,c=!1,d=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){c=r.end(h)==r.pos+(r.depth-h),d=r.start(h)==r.pos-(r.depth-h),a=Wc(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),i.unshift(c&&a?{type:a}:null),s=h;break}else{if(h==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof Y||e.selection instanceof Jt)&&u.deleteSelection();let p=u.mapping.map(r.pos),f=Gn(u.doc,p,i.length,i);if(f||(i[0]=a?{type:a}:null,f=Gn(u.doc,p,i.length,i)),u.split(p,i.length,i),!c&&d&&r.node(s).type!=a){let h=u.mapping.map(r.before(s)),m=u.doc.resolve(h);a&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return t&&t(u.scrollIntoView()),!0}}const Bk=Ik(),Lk=(n,e)=>{let{$from:t,to:r}=n.selection,o,i=t.sharedDepth(r);return i==0?!1:(o=t.before(i),e&&e(n.tr.setSelection(G.create(n.doc,o))),!0)};function Pk(n,e,t){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)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||kr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function Gh(n,e,t,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,c=o.type.spec.isolating||i.type.spec.isolating;if(!c&&Pk(n,e,t))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(t){let h=e.pos+i.nodeSize,m=S.empty;for(let y=s.length-1;y>=0;y--)m=S.from(s[y].create(null,m));m=S.from(o.copy(m));let g=n.tr.step(new yt(e.pos-1,h,e.pos,h,new O(m,1,0),s.length,!0)),b=g.doc.resolve(h+2*s.length);b.nodeAfter&&b.nodeAfter.type==o.type&&kr(g.doc,b.pos)&&g.join(b.pos),t(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&c?null:ee.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),f=p&&Oo(p);if(f!=null&&f>=e.depth)return t&&t(n.tr.lift(p,f).scrollIntoView()),!0;if(d&&ko(i,"start",!0)&&ko(o,"end")){let h=o,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let g=i,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(t){let y=S.empty;for(let E=m.length-1;E>=0;E--)y=S.from(m[E].copy(y));let k=n.tr.step(new yt(e.pos-m.length,e.pos+i.nodeSize,e.pos+b,e.pos+i.nodeSize-b,new O(y,m.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function jh(n){return function(e,t){let r=e.selection,o=n<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(t&&t(e.tr.setSelection(Y.create(e.doc,n<0?o.start(i):o.end(i)))),!0):!1}}const $k=jh(-1),Fk=jh(1);function zk(n,e=null){return function(t,r){let{$from:o,$to:i}=t.selection,s=o.blockRange(i),a=s&&Mc(s,n,e);return a?(r&&r(t.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Vu(n,e=null){return function(t,r){let o=!1;for(let i=0;i<t.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=t.selection.ranges[i];t.doc.nodesBetween(s,a,(c,d)=>{if(o)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)o=!0;else{let u=t.doc.resolve(d),p=u.index();o=u.parent.canReplaceWith(p,p+1,n)}})}if(!o)return!1;if(r){let i=t.tr;for(let s=0;s<t.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:c}}=t.selection.ranges[s];i.setBlockType(a,c,n,e)}r(i.scrollIntoView())}return!0}}function qc(...n){return function(e,t,r){for(let o=0;o<n.length;o++)if(n[o](e,t,r))return!0;return!1}}qc(Vc,$h,zh);qc(Vc,Hh,Uh);qc(Wh,qh,Kh,Bk);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Vk(n,e=null){return function(t,r){let{$from:o,$to:i}=t.selection,s=o.blockRange(i);if(!s)return!1;let a=r?t.tr:null;return Hk(a,s,n,e)?(r&&r(a.scrollIntoView()),!0):!1}}function Hk(n,e,t,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=s.resolve(e.start-2);i=new Os(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Os(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=Mc(i,t,r,e);return a?(n&&Uk(n,e,a,o,t),!0):!1}function Uk(n,e,t,r,o){let i=S.empty;for(let u=t.length-1;u>=0;u--)i=S.from(t[u].type.create(t[u].attrs,i));n.step(new yt(e.start-(r?2:0),e.end,e.start,e.end,new O(i,0,0),t.length,!0));let s=0;for(let u=0;u<t.length;u++)t[u].type==o&&(s=u+1);let a=t.length-s,c=e.start+t.length-(r?2:0),d=e.parent;for(let u=e.startIndex,p=e.endIndex,f=!0;u<p;u++,f=!1)!f&&Gn(n.doc,c,a)&&(n.split(c,a),c+=2*a),c+=d.child(u).nodeSize;return n}function Wk(n){return function(e,t){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==n);return i?t?r.node(i.depth-1).type==n?qk(e,t,n,i):Kk(e,t,i):!0:!1}}function qk(n,e,t,r){let o=n.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new yt(i-1,s,i,s,new O(S.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new Os(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Oo(r);if(a==null)return!1;o.lift(r,a);let c=o.mapping.map(i,-1)-1;return kr(o.doc,c)&&o.join(c),e(o.scrollIntoView()),!0}function Kk(n,e,t){let r=n.tr,o=t.parent;for(let h=t.end,m=t.endIndex-1,g=t.startIndex;m>g;m--)h-=o.child(m).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(t.start),s=i.nodeAfter;if(r.mapping.map(t.end)!=t.start+i.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,c=t.endIndex==o.childCount,d=i.node(-1),u=i.index(-1);if(!d.canReplace(u+(a?0:1),u+1,s.content.append(c?S.empty:S.from(o))))return!1;let p=i.pos,f=p+s.nodeSize;return r.step(new yt(p-(a?1:0),f+(c?1:0),p+1,f-1,new O((a?S.empty:S.from(o.copy(S.empty))).append(c?S.empty:S.from(o.copy(S.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Gk(n){return function(e,t){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,d=>d.childCount>0&&d.firstChild.type==n);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,c=a.child(s-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==a.type,u=S.from(d?n.create():null),p=new O(S.from(n.create(null,S.from(a.type.create(null,u)))),d?3:1,0),f=i.start,h=i.end;t(e.tr.step(new yt(f-(d?3:1),h,f,h,p,1,!0)).scrollIntoView())}return!0}}function Na(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:o}=t,{storedMarks:i}=t;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=t.selection,o=t.doc,i=t.storedMarks,t}}}class Ta{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:t,state:r}=this,{view:o}=t,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,c])=>[a,(...u)=>{const p=c(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],c=!!e,d=e||i.tr,u=()=>(!c&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),a.every(f=>f===!0)),p={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...g)=>{const b=this.buildProps(d,t),y=h(...g)(b);return a.push(y),p}])),run:u};return p}createCan(e){const{rawCommands:t,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(t).map(([c,d])=>[c,(...u)=>d(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,t=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:Na({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(a)]))}};return a}}class jk{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(o=>o!==t):delete this.callbacks[e]),this}once(e,t){const r=(...o)=>{this.off(e,r),t.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function U(n,e,t){return n.config[e]===void 0&&n.parent?U(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?U(n.parent,e,t):null}):n.config[e]}function Oa(n){const e=n.filter(o=>o.type==="extension"),t=n.filter(o=>o.type==="node"),r=n.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Jh(n){const e=[],{nodeExtensions:t,markExtensions:r}=Oa(n),o=[...t,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},c=U(s,"addGlobalAttributes",a);if(!c)return;c().forEach(u=>{u.types.forEach(p=>{Object.entries(u.attributes).forEach(([f,h])=>{e.push({type:p,name:f,attribute:{...i,...h}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},c=U(s,"addAttributes",a);if(!c)return;const d=c();Object.entries(d).forEach(([u,p])=>{const f={...i,...p};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function lt(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function _e(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?String(i).split(" "):[],c=r[o]?r[o].split(" "):[],d=a.filter(u=>!c.includes(u));r[o]=[...c,...d].join(" ")}else if(o==="style"){const a=i?i.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],d=new Map;c.forEach(u=>{const[p,f]=u.split(":").map(h=>h.trim());d.set(p,f)}),a.forEach(u=>{const[p,f]=u.split(":").map(h=>h.trim());d.set(p,f)}),r[o]=Array.from(d.entries()).map(([u,p])=>`${u}: ${p}`).join("; ")}else r[o]=i}),r},{})}function Ql(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>_e(t,r),{})}function Yh(n){return typeof n=="function"}function me(n,e=void 0,...t){return Yh(n)?e?n.bind(e)(...t):n(...t):n}function Jk(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Yk(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Hu(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(t):Yk(t.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function Uu(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Jk(t)?!1:t!=null))}function Xk(n,e){var t;const r=Jh(n),{nodeExtensions:o,markExtensions:i}=Oa(n),s=(t=o.find(d=>U(d,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(o.map(d=>{const u=r.filter(y=>y.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},f=n.reduce((y,k)=>{const E=U(k,"extendNodeSchema",p);return{...y,...E?E(d):{}}},{}),h=Uu({...f,content:me(U(d,"content",p)),marks:me(U(d,"marks",p)),group:me(U(d,"group",p)),inline:me(U(d,"inline",p)),atom:me(U(d,"atom",p)),selectable:me(U(d,"selectable",p)),draggable:me(U(d,"draggable",p)),code:me(U(d,"code",p)),whitespace:me(U(d,"whitespace",p)),linebreakReplacement:me(U(d,"linebreakReplacement",p)),defining:me(U(d,"defining",p)),isolating:me(U(d,"isolating",p)),attrs:Object.fromEntries(u.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),m=me(U(d,"parseHTML",p));m&&(h.parseDOM=m.map(y=>Hu(y,u)));const g=U(d,"renderHTML",p);g&&(h.toDOM=y=>g({node:y,HTMLAttributes:Ql(y,u)}));const b=U(d,"renderText",p);return b&&(h.toText=b),[d.name,h]})),c=Object.fromEntries(i.map(d=>{const u=r.filter(b=>b.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},f=n.reduce((b,y)=>{const k=U(y,"extendMarkSchema",p);return{...b,...k?k(d):{}}},{}),h=Uu({...f,inclusive:me(U(d,"inclusive",p)),excludes:me(U(d,"excludes",p)),group:me(U(d,"group",p)),spanning:me(U(d,"spanning",p)),code:me(U(d,"code",p)),attrs:Object.fromEntries(u.map(b=>{var y;return[b.name,{default:(y=b==null?void 0:b.attribute)===null||y===void 0?void 0:y.default}]}))}),m=me(U(d,"parseHTML",p));m&&(h.parseDOM=m.map(b=>Hu(b,u)));const g=U(d,"renderHTML",p);return g&&(h.toDOM=b=>g({mark:b,HTMLAttributes:Ql(b,u)})),[d.name,h]}));return new Tf({topNode:s,nodes:a,marks:c})}function ul(n,e){return e.nodes[n]||e.marks[n]||null}function Wu(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Kc(n,e){const t=Jr.fromSchema(e).serializeFragment(n),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(t),o.innerHTML}const Zk=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var c,d;const u=((d=(c=o.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";t+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),t};function Gc(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Ri{constructor(e){this.find=e.find,this.handler=e.handler}}const Qk=(n,e)=>{if(Gc(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Wi(n){var e;const{editor:t,from:r,to:o,text:i,rules:s,plugin:a}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const p=Zk(d)+i;return s.forEach(f=>{if(u)return;const h=Qk(p,f.find);if(!h)return;const m=c.state.tr,g=Na({state:c.state,transaction:m}),b={from:r-(h[0].length-i.length),to:o},{commands:y,chain:k,can:E}=new Ta({editor:t,state:g});f.handler({state:g,range:b,match:h,commands:y,chain:k,can:E})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:o,text:i}),c.dispatch(m),u=!0)}),u}function ew(n){const{editor:e,rules:t}=n,r=new Te({state:{init(){return null},apply(o,i,s){const a=o.getMeta(r);if(a)return a;const c=o.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=Kc(S.from(u),s.schema);const{from:p}=c,f=p+u.length;Wi({editor:e,from:p,to:f,text:u,rules:t,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return Wi({editor:e,from:i,to:s,text:a,rules:t,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Wi({editor:e,from:i.pos,to:i.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?Wi({editor:e,from:s.pos,to:s.pos,text:`
|
|
14
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function tw(n){return Object.prototype.toString.call(n).slice(8,-1)}function qi(n){return tw(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Ma(n,e){const t={...n};return qi(n)&&qi(e)&&Object.keys(e).forEach(r=>{qi(e[r])&&qi(n[r])?t[r]=Ma(n[r],e[r]):t[r]=e[r]}),t}class ln{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=me(U(this,"addOptions",{name:this.name}))),this.storage=me(U(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ln(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Ma(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new ln(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=me(U(t,"addOptions",{name:t.name})),t.storage=me(U(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(d=>(d==null?void 0:d.type.name)===t.name))return!1;const c=s.find(d=>(d==null?void 0:d.type.name)===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function nw(n){return typeof n=="number"}class rw{constructor(e){this.find=e.find,this.handler=e.handler}}const ow=(n,e,t)=>{if(Gc(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=n,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function iw(n){const{editor:e,state:t,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=n,{commands:c,chain:d,can:u}=new Ta({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,o,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,m),b=Math.min(o,m+h.content.size),y=h.textBetween(g-m,b-m,void 0,"");ow(y,i.find,s).forEach(E=>{if(E.index===void 0)return;const v=g+E.index+1,_=v+E[0].length,C={from:t.tr.mapping.map(v),to:t.tr.mapping.map(_)},D=i.handler({state:t,range:C,match:E,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:a});p.push(D)})}),p.every(h=>h!==null)}let Ki=null;const sw=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function aw(n){const{editor:e,rules:t}=n;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const c=({state:u,from:p,to:f,rule:h,pasteEvt:m})=>{const g=u.tr,b=Na({state:u,transaction:g});if(!(!iw({editor:e,state:b,from:Math.max(p-1,0),to:f.b-1,rule:h,pasteEvent:m,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return t.map(u=>new Te({view(p){const f=m=>{var g;r=!((g=p.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?p.dom.parentElement:null,r&&(Ki=e)},h=()=>{Ki&&(Ki=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(p,f)=>{if(i=r===p.dom.parentElement,a=f,!i){const h=Ki;h&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(p,f)=>{var h;const m=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=f,o=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(p,f,h)=>{const m=p[0],g=m.getMeta("uiEvent")==="paste"&&!o,b=m.getMeta("uiEvent")==="drop"&&!i,y=m.getMeta("applyPasteRules"),k=!!y;if(!g&&!b&&!k)return;if(k){let{text:_}=y;typeof _=="string"?_=_:_=Kc(S.from(_),h.schema);const{from:C}=y,D=C+_.length,B=sw(_);return c({rule:u,state:h,from:C,to:{b:D},pasteEvt:B})}const E=f.doc.content.findDiffStart(h.doc.content),v=f.doc.content.findDiffEnd(h.doc.content);if(!(!nw(E)||!v||E===v.b))return c({rule:u,state:h,from:E,to:v,pasteEvt:s})}}))}function lw(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class po{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=po.resolve(e),this.schema=Xk(this.extensions,t),this.setupExtensions()}static resolve(e){const t=po.sort(po.flatten(e)),r=lw(t.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},o=U(t,"addExtensions",r);return o?[t,...this.flatten(o())]:t}).flat(10)}static sort(e){return e.sort((r,o)=>{const i=U(r,"priority")||100,s=U(o,"priority")||100;return i>s?-1:i<s?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ul(t.name,this.schema)},o=U(t,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,t=po.sort([...this.extensions].reverse()),r=[],o=[],i=t.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:ul(s.name,this.schema)},c=[],d=U(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&U(s,"exitable",a)&&(u.ArrowRight=()=>ln.handleExit({editor:e,mark:s})),d){const g=Object.fromEntries(Object.entries(d()).map(([b,y])=>[b,()=>y({editor:e})]));u={...u,...g}}const p=Nk(u);c.push(p);const f=U(s,"addInputRules",a);Wu(s,e.options.enableInputRules)&&f&&r.push(...f());const h=U(s,"addPasteRules",a);Wu(s,e.options.enablePasteRules)&&h&&o.push(...h());const m=U(s,"addProseMirrorPlugins",a);if(m){const g=m();c.push(...g)}return c}).flat();return[ew({editor:e,rules:r}),...aw({editor:e,rules:o}),...i]}get attributes(){return Jh(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Oa(this.extensions);return Object.fromEntries(t.filter(r=>!!U(r,"addNodeView")).map(r=>{const o=this.attributes.filter(c=>c.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:lt(r.name,this.schema)},s=U(r,"addNodeView",i);if(!s)return[];const a=(c,d,u,p,f)=>{const h=Ql(c,o);return s()({node:c,view:d,getPos:u,decorations:p,innerDecorations:f,editor:e,extension:r,HTMLAttributes:h})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:ul(e.name,this.schema)};e.type==="mark"&&(!((t=me(U(e,"keepOnSplit",r)))!==null&&t!==void 0)||t)&&this.splittableMarks.push(e.name);const o=U(e,"onBeforeCreate",r),i=U(e,"onCreate",r),s=U(e,"onUpdate",r),a=U(e,"onSelectionUpdate",r),c=U(e,"onTransaction",r),d=U(e,"onFocus",r),u=U(e,"onBlur",r),p=U(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),p&&this.editor.on("destroy",p)})}}class Ae{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=me(U(this,"addOptions",{name:this.name}))),this.storage=me(U(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ae(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Ma(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Ae({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=me(U(t,"addOptions",{name:t.name})),t.storage=me(U(t,"addStorage",{name:t.name,options:t.options})),t}}function Xh(n,e,t){const{from:r,to:o}=e,{blockSeparator:i=`
|
|
15
15
|
|
|
16
|
-
`,textSerializers:s={}}=t||{};let a="";return n.nodesBetween(r,o,(c,d,u,p)=>{var f;c.isBlock&&d>r&&(a+=i);const h=s==null?void 0:s[c.type.name];if(h)return u&&(a+=h({node:c,pos:d,parent:u,index:p,range:e})),!1;c.isText&&(a+=(f=c==null?void 0:c.text)===null||f===void 0?void 0:f.slice(Math.max(r,d)-d,o-d))}),a}function jc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const lw=Ae.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Te({key:new $e("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{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)),c=jc(t);return Xh(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),cw=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),dw=(n=!1)=>({commands:e})=>e.setContent("",n),uw=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:o}=r;return t&&o.forEach(({$from:i,$to:s})=>{n.doc.nodesBetween(i.pos,s.pos,(a,c)=>{if(a.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),f=d.resolve(u.map(c+a.nodeSize)),h=p.blockRange(f);if(!h)return;const m=Oo(h);if(a.type.isTextblock){const{defaultType:g}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(h.start,g)}(m||m===0)&&e.lift(h,m)})}),!0},pw=n=>e=>n(e),fw=()=>({state:n,dispatch:e})=>qh(n,e),hw=(n,e)=>({editor:t,tr:r})=>{const{state:o}=t,i=o.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new Y(r.doc.resolve(s-1))),!0},mw=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const o=n.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),c=o.after(i);n.delete(a,c).scrollIntoView()}return!0}return!1},gw=n=>({tr:e,state:t,dispatch:r})=>{const o=lt(n,t.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const c=i.before(s),d=i.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},bw=n=>({tr:e,dispatch:t})=>{const{from:r,to:o}=n;return t&&e.delete(r,o),!0},yw=()=>({state:n,dispatch:e})=>Vc(n,e),vw=()=>({commands:n})=>n.keyboardShortcut("Enter"),kw=()=>({state:n,dispatch:e})=>Rk(n,e);function Ps(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>t.strict?e[o]===n[o]:Gc(e[o])?e[o].test(n[o]):e[o]===n[o]):!0}function Zh(n,e,t={}){return n.find(r=>r.type===e&&Ps(Object.fromEntries(Object.keys(t).map(o=>[o,r.attrs[o]])),t))}function qu(n,e,t={}){return!!Zh(n,e,t)}function Mo(n,e,t){var r;if(!n||!e)return;let o=n.parent.childAfter(n.parentOffset);if((!o.node||!o.node.marks.some(u=>u.type===e))&&(o=n.parent.childBefore(n.parentOffset)),!o.node||!o.node.marks.some(u=>u.type===e)||(t=t||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!Zh([...o.node.marks],e,t)))return;let s=o.index,a=n.start()+o.offset,c=s+1,d=a+o.node.nodeSize;for(;s>0&&qu([...n.parent.child(s-1).marks],e,t);)s-=1,a-=n.parent.child(s).nodeSize;for(;c<n.parent.childCount&&qu([...n.parent.child(c).marks],e,t);)d+=n.parent.child(c).nodeSize,c+=1;return{from:a,to:d}}function Er(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const ww=(n,e={})=>({tr:t,state:r,dispatch:o})=>{const i=Er(n,r.schema),{doc:s,selection:a}=t,{$from:c,from:d,to:u}=a;if(o){const p=Mo(c,i,e);if(p&&p.from<=d&&p.to>=u){const f=Y.create(s,p.from,p.to);t.setSelection(f)}}return!0},Ew=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Aa(n){return n instanceof Y}function Kn(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function Qh(n,e=null){if(!e)return null;const t=ee.atStart(n),r=ee.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const o=t.from,i=r.to;return e==="all"?Y.create(n,Kn(0,o,i),Kn(n.content.size,o,i)):Y.create(n,Kn(e,o,i),Kn(e,o,i))}function em(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ra(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const Cw=(n=null,e={})=>({editor:t,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{(Ra()||em())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(i&&n===null&&!Aa(t.state.selection))return s(),!0;const a=Qh(o.doc,n)||t.state.selection,c=t.state.selection.eq(a);return i&&(c||o.setSelection(a),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},_w=(n,e)=>t=>n.every((r,o)=>e(r,{...t,index:o})),Sw=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),tm=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&tm(r)}return n};function Gi(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return tm(t)}function $s(n,e,t){if(n instanceof fr||n instanceof S)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,o=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return S.fromArray(n.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(i){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",i),$s("",e,t)}if(o){if(t.errorOnInvalidContent){let s=!1,a="";const c=new Tf({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:d=>(s=!0,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(t.slice?hr.fromSchema(c).parseSlice(Gi(n),t.parseOptions):hr.fromSchema(c).parse(Gi(n),t.parseOptions),t.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=hr.fromSchema(e);return t.slice?i.parseSlice(Gi(n),t.parseOptions).content:i.parse(Gi(n),t.parseOptions)}return $s("",e,t)}function xw(n,e,t){const r=n.steps.length-1;if(r<e)return;const o=n.steps[r];if(!(o instanceof mt||o instanceof yt))return;const i=n.mapping.maps[r];let s=0;i.forEach((a,c,d,u)=>{s===0&&(s=u)}),n.setSelection(ee.near(n.doc.resolve(s),t))}const Nw=n=>!("type"in n),Tw=(n,e,t)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){t={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let a;try{a=$s(e,i.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(s=t.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(m){return i.emit("contentError",{editor:i,error:m,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:d}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},u=!0,p=!0;if((Nw(a)?a:[a]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,p=p?m.isBlock:!1}),c===d&&p){const{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,d+=1)}let h;if(u){if(Array.isArray(e))h=e.map(m=>m.text||"").join("");else if(e instanceof S){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),h=m}else typeof e=="object"&&e&&e.text?h=e.text:h=e;r.insertText(h,c,d)}else h=a,r.replaceWith(c,d,h);t.updateSelection&&xw(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:h}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:h})}return!0},Ow=()=>({state:n,dispatch:e})=>Ok(n,e),Mw=()=>({state:n,dispatch:e})=>Mk(n,e),Aw=()=>({state:n,dispatch:e})=>$h(n,e),Rw=()=>({state:n,dispatch:e})=>Hh(n,e),Dw=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Ea(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Iw=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Ea(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Bw=()=>({state:n,dispatch:e})=>Nk(n,e),Lw=()=>({state:n,dispatch:e})=>Tk(n,e);function nm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Pw(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,o,i,s;for(let a=0;a<e.length-1;a+=1){const c=e[a];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))Ra()||nm()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),o&&(t=`Ctrl-${t}`),s&&(t=`Meta-${t}`),i&&(t=`Shift-${t}`),t}const $w=n=>({editor:e,view:t,tr:r,dispatch:o})=>{const i=Pw(n).split(/-(?!$)/),s=i.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),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}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,a))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function gi(n,e,t={}){const{from:r,to:o,empty:i}=n.selection,s=e?lt(e,n.schema):null,a=[];n.doc.nodesBetween(r,o,(p,f)=>{if(p.isText)return;const h=Math.max(r,f),m=Math.min(o,f+p.nodeSize);a.push({node:p,from:h,to:m})});const c=o-r,d=a.filter(p=>s?s.name===p.node.type.name:!0).filter(p=>Ps(p.node.attrs,t,{strict:!1}));return i?!!d.length:d.reduce((p,f)=>p+f.to-f.from,0)>=c}const Fw=(n,e={})=>({state:t,dispatch:r})=>{const o=lt(n,t.schema);return gi(t,o,e)?Ak(t,r):!1},zw=()=>({state:n,dispatch:e})=>Kh(n,e),Vw=n=>({state:e,dispatch:t})=>{const r=lt(n,e.schema);return Uk(r)(e,t)},Hw=()=>({state:n,dispatch:e})=>Wh(n,e);function Da(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Ku(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,o)=>(t.includes(o)||(r[o]=n[o]),r),{})}const Uw=(n,e)=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const a=Da(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=lt(n,r.schema)),a==="mark"&&(s=Er(n,r.schema)),o&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{i&&i===d.type&&t.setNodeMarkup(u,void 0,Ku(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(p=>{s===p.type&&t.addMark(u,u+d.nodeSize,s.create(Ku(p.attrs,e)))})})}),!0):!1},Ww=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),qw=()=>({tr:n,dispatch:e})=>{if(e){const t=new Jt(n.doc);n.setSelection(t)}return!0},Kw=()=>({state:n,dispatch:e})=>zh(n,e),Gw=()=>({state:n,dispatch:e})=>Uh(n,e),jw=()=>({state:n,dispatch:e})=>Bk(n,e),Jw=()=>({state:n,dispatch:e})=>$k(n,e),Yw=()=>({state:n,dispatch:e})=>Pk(n,e);function ec(n,e,t={},r={}){return $s(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const Xw=(n,e=!1,t={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var c,d;const{doc:u}=i;if(t.preserveWhitespace!=="full"){const p=ec(n,o.schema,t,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,p).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},n,{parseOptions:t,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:o.options.enableContentCheck})};function rm(n,e){const t=Er(e,n.schema),{from:r,to:o,empty:i}=n.selection,s=[];i?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,o,c=>{s.push(...c.marks)});const a=s.find(c=>c.type.name===t.name);return a?{...a.attrs}:{}}function Zw(n,e){const t=new rh(n);return e.forEach(r=>{r.steps.forEach(o=>{t.step(o)})}),t}function Qw(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function tc(n,e){const t=[];return n.descendants((r,o)=>{e(r)&&t.push({node:r,pos:o})}),t}function eE(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(o,i)=>{t(o)&&r.push({node:o,pos:i})}),r}function om(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Jc(n){return e=>om(e.$from,n)}function im(n,e){const t={from:0,to:n.content.size};return Xh(n,t,e)}function tE(n,e){const t=lt(e,n.schema),{from:r,to:o}=n.selection,i=[];n.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===t.name);return s?{...s.attrs}:{}}function sm(n,e){const t=Da(typeof e=="string"?e:e.name,n.schema);return t==="node"?tE(n,e):t==="mark"?rm(n,e):{}}function nE(n,e=JSON.stringify){const t={};return n.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(t,o)?!1:t[o]=!0})}function rE(n){const e=nE(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,s)=>s!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function oE(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,c)=>{s.push({from:a,to:c})});else{const{from:a,to:c}=t[i];if(a===void 0||c===void 0)return;s.push({from:a,to:c})}s.forEach(({from:a,to:c})=>{const d=e.slice(i).map(a,-1),u=e.slice(i).map(c),p=e.invert().map(d,-1),f=e.invert().map(u);r.push({oldRange:{from:p,to:f},newRange:{from:d,to:u}})})}),rE(r)}function Yc(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(o=>{const i=t.resolve(n),s=Mo(i,o.type);s&&r.push({mark:o,...s})}):t.nodesBetween(n,e,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function ks(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const o=n.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function nc(n,e,t={}){const{empty:r,ranges:o}=n.selection,i=e?Er(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>i?i.name===p.type.name:!0).find(p=>Ps(p.attrs,t,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:p,$to:f})=>{const h=p.pos,m=f.pos;n.doc.nodesBetween(h,m,(g,b)=>{if(!g.isText&&!g.marks.length)return;const y=Math.max(h,b),k=Math.min(m,b+g.nodeSize),E=k-y;s+=E,a.push(...g.marks.map(v=>({mark:v,from:y,to:k})))})}),s===0)return!1;const c=a.filter(p=>i?i.name===p.mark.type.name:!0).filter(p=>Ps(p.mark.attrs,t,{strict:!1})).reduce((p,f)=>p+f.to-f.from,0),d=a.filter(p=>i?p.mark.type!==i&&p.mark.type.excludes(i):!0).reduce((p,f)=>p+f.to-f.from,0);return(c>0?c+d:c)>=s}function iE(n,e,t={}){if(!e)return gi(n,null,t)||nc(n,null,t);const r=Da(e,n.schema);return r==="node"?gi(n,e,t):r==="mark"?nc(n,e,t):!1}function Gu(n,e){const{nodeExtensions:t}=Oa(e),r=t.find(s=>s.name===n);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=me(U(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Xc(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let o=!0;return n.content.forEach(i=>{o!==!1&&(Xc(i,{ignoreWhitespace:t,checkChildren:e})||(o=!1))}),o}return!1}function am(n){return n instanceof G}function lm(n,e,t){const o=n.state.doc.content.size,i=Kn(e,0,o),s=Kn(t,0,o),a=n.coordsAtPos(i),c=n.coordsAtPos(s,-1),d=Math.min(a.top,c.top),u=Math.max(a.bottom,c.bottom),p=Math.min(a.left,c.left),f=Math.max(a.right,c.right),h=f-p,m=u-d,y={top:d,bottom:u,left:p,right:f,width:h,height:m,x:p,y:d};return{...y,toJSON:()=>y}}function sE(n,e,t){var r;const{selection:o}=e;let i=null;if(Aa(o)&&(i=o.$cursor),i){const a=(r=n.storedMarks)!==null&&r!==void 0?r:i.marks();return!!t.isInSet(a)||!a.some(c=>c.type.excludes(t))}const{ranges:s}=o;return s.some(({$from:a,$to:c})=>{let d=a.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(a.pos,c.pos,(u,p,f)=>{if(d)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(t));d=h&&m}return!d}),d})}const aE=(n,e={})=>({tr:t,state:r,dispatch:o})=>{const{selection:i}=t,{empty:s,ranges:a}=i,c=Er(n,r.schema);if(o)if(s){const d=rm(r,c);t.addStoredMark(c.create({...d,...e}))}else a.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(u,p,(f,h)=>{const m=Math.max(h,u),g=Math.min(h+f.nodeSize,p);f.marks.find(y=>y.type===c)?f.marks.forEach(y=>{c===y.type&&t.addMark(m,g,c.create({...y.attrs,...e}))}):t.addMark(m,g,c.create(e))})});return sE(r,t,c)},lE=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),cE=(n,e={})=>({state:t,dispatch:r,chain:o})=>{const i=lt(n,t.schema);let s;return t.selection.$anchor.sameParent(t.selection.$head)&&(s=t.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:a})=>Vu(i,{...s,...e})(t)?!0:a.clearNodes()).command(({state:a})=>Vu(i,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},dE=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,o=Kn(n,0,r.content.size),i=G.create(r,o);e.setSelection(i)}return!0},uE=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:o,to:i}=typeof n=="number"?{from:n,to:n}:n,s=Y.atStart(r).from,a=Y.atEnd(r).to,c=Kn(o,s,a),d=Kn(i,s,a),u=Y.create(r,c,d);e.setSelection(u)}return!0},pE=n=>({state:e,dispatch:t})=>{const r=lt(n,e.schema);return Kk(r)(e,t)};function ju(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(o=>e==null?void 0:e.includes(o.type.name));n.tr.ensureMarks(r)}}const fE=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:c}=i,d=o.extensionManager.attributes,u=ks(d,a.node().type.name,a.node().attrs);if(i instanceof G&&i.node.isBlock)return!a.parentOffset||!Gn(s,a.pos)?!1:(r&&(n&&ju(t,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const p=c.parentOffset===c.parent.content.size,f=a.depth===0?void 0:Qw(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=p&&f?[{type:f,attrs:u}]:void 0,m=Gn(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!m&&Gn(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(m&&(i instanceof Y&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,h),f&&!p&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),b=e.doc.resolve(g);a.node(-1).canReplaceWith(b.index(),b.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}n&&ju(t,o.extensionManager.splittableMarks),e.scrollIntoView()}return m},hE=(n,e={})=>({tr:t,state:r,dispatch:o,editor:i})=>{var s;const a=lt(n,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const p=c.node(-1);if(p.type!==a)return!1;const f=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(o){let y=S.empty;const k=c.index(-1)?1:c.index(-2)?2:3;for(let B=c.depth-k;B>=c.depth-3;B-=1)y=S.from(c.node(B).copy(y));const E=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,v={...ks(f,c.node().type.name,c.node().attrs),...e},_=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(v))||void 0;y=y.append(S.from(a.createAndFill(null,_)||void 0));const C=c.before(c.depth-(k-1));t.replace(C,c.after(-E),new O(y,4-k,0));let D=-1;t.doc.nodesBetween(C,t.doc.content.size,(B,A)=>{if(D>-1)return!1;B.isTextblock&&B.content.size===0&&(D=A+1)}),D>-1&&t.setSelection(Y.near(t.doc.resolve(D))),t.scrollIntoView()}return!0}const h=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,m={...ks(f,p.type.name,p.attrs),...e},g={...ks(f,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,d.pos);const b=h?[{type:a,attrs:m},{type:h,attrs:g}]:[{type:a,attrs:m}];if(!Gn(t.doc,c.pos,2))return!1;if(o){const{selection:y,storedMarks:k}=r,{splittableMarks:E}=i.extensionManager,v=k||y.$to.parentOffset&&y.$from.marks();if(t.split(c.pos,2,b).scrollIntoView(),!v||!o)return!0;const _=v.filter(C=>E.includes(C.type.name));t.ensureMarks(_)}return!0},pl=(n,e)=>{const t=Jc(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===(o==null?void 0:o.type)&&kr(n.doc,t.pos)&&n.join(t.pos),!0},fl=(n,e)=>{const t=Jc(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===(o==null?void 0:o.type)&&kr(n.doc,r)&&n.join(r),!0},mE=(n,e,t,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:f}=o.extensionManager,h=lt(n,s.schema),m=lt(e,s.schema),{selection:g,storedMarks:b}=s,{$from:y,$to:k}=g,E=y.blockRange(k),v=b||g.$to.parentOffset&&g.$from.marks();if(!E)return!1;const _=Jc(C=>Gu(C.type.name,p))(g);if(E.depth>=1&&_&&E.depth-_.depth<=1){if(_.node.type===h)return d.liftListItem(m);if(Gu(_.node.type.name,p)&&h.validContent(_.node.content)&&a)return c().command(()=>(i.setNodeMarkup(_.pos,h),!0)).command(()=>pl(i,h)).command(()=>fl(i,h)).run()}return!t||!v||!a?c().command(()=>u().wrapInList(h,r)?!0:d.clearNodes()).wrapInList(h,r).command(()=>pl(i,h)).command(()=>fl(i,h)).run():c().command(()=>{const C=u().wrapInList(h,r),D=v.filter(B=>f.includes(B.type.name));return i.ensureMarks(D),C?!0:d.clearNodes()}).wrapInList(h,r).command(()=>pl(i,h)).command(()=>fl(i,h)).run()},gE=(n,e={},t={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=t,s=Er(n,r.schema);return nc(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},bE=(n,e,t={})=>({state:r,commands:o})=>{const i=lt(n,r.schema),s=lt(e,r.schema),a=gi(r,i,t);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),a?o.setNode(s,c):o.setNode(i,{...c,...t})},yE=(n,e={})=>({state:t,commands:r})=>{const o=lt(n,t.schema);return gi(t,o,e)?r.lift(o):r.wrapIn(o,e)},vE=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const o=t[r];let i;if(o.spec.isInputRules&&(i=o.getState(n))){if(e){const s=n.tr,a=i.transform;for(let c=a.steps.length-1;c>=0;c-=1)s.step(a.steps[c].invert(a.docs[c]));if(i.text){const c=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,n.schema.text(i.text,c))}else s.delete(i.from,i.to)}return!0}}return!1},kE=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:o}=t;return r||e&&o.forEach(i=>{n.removeMark(i.$from.pos,i.$to.pos)}),!0},wE=(n,e={})=>({tr:t,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=t,c=Er(n,r.schema),{$from:d,empty:u,ranges:p}=a;if(!o)return!0;if(u&&s){let{from:f,to:h}=a;const m=(i=d.marks().find(b=>b.type===c))===null||i===void 0?void 0:i.attrs,g=Mo(d,c,m);g&&(f=g.from,h=g.to),t.removeMark(f,h,c)}else p.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,c)});return t.removeStoredMark(c),!0},EE=(n,e={})=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const a=Da(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=lt(n,r.schema)),a==="mark"&&(s=Er(n,r.schema)),o&&t.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let p,f,h,m;t.selection.empty?r.doc.nodesBetween(d,u,(g,b)=>{i&&i===g.type&&(h=Math.max(b,d),m=Math.min(b+g.nodeSize,u),p=b,f=g)}):r.doc.nodesBetween(d,u,(g,b)=>{b<d&&i&&i===g.type&&(h=Math.max(b,d),m=Math.min(b+g.nodeSize,u),p=b,f=g),b>=d&&b<=u&&(i&&i===g.type&&t.setNodeMarkup(b,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(y=>{if(s===y.type){const k=Math.max(b,d),E=Math.min(b+g.nodeSize,u);t.addMark(k,E,s.create({...y.attrs,...e}))}}))}),f&&(p!==void 0&&t.setNodeMarkup(p,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(g=>{s===g.type&&t.addMark(h,m,s.create({...g.attrs,...e}))}))}),!0):!1},CE=(n,e={})=>({state:t,dispatch:r})=>{const o=lt(n,t.schema);return Fk(o,e)(t,r)},_E=(n,e={})=>({state:t,dispatch:r})=>{const o=lt(n,t.schema);return zk(o,e)(t,r)};var SE=Object.freeze({__proto__:null,blur:cw,clearContent:dw,clearNodes:uw,command:pw,createParagraphNear:fw,cut:hw,deleteCurrentNode:mw,deleteNode:gw,deleteRange:bw,deleteSelection:yw,enter:vw,exitCode:kw,extendMarkRange:ww,first:Ew,focus:Cw,forEach:_w,insertContent:Sw,insertContentAt:Tw,joinBackward:Aw,joinDown:Mw,joinForward:Rw,joinItemBackward:Dw,joinItemForward:Iw,joinTextblockBackward:Bw,joinTextblockForward:Lw,joinUp:Ow,keyboardShortcut:$w,lift:Fw,liftEmptyBlock:zw,liftListItem:Vw,newlineInCode:Hw,resetAttributes:Uw,scrollIntoView:Ww,selectAll:qw,selectNodeBackward:Kw,selectNodeForward:Gw,selectParentNode:jw,selectTextblockEnd:Jw,selectTextblockStart:Yw,setContent:Xw,setMark:aE,setMeta:lE,setNode:cE,setNodeSelection:dE,setTextSelection:uE,sinkListItem:pE,splitBlock:fE,splitListItem:hE,toggleList:mE,toggleMark:gE,toggleNode:bE,toggleWrap:yE,undoInputRule:vE,unsetAllMarks:kE,unsetMark:wE,updateAttributes:EE,wrapIn:CE,wrapInList:_E});const xE=Ae.create({name:"commands",addCommands(){return{...SE}}}),NE=Ae.create({name:"drop",addProseMirrorPlugins(){return[new Te({key:new $e("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),TE=Ae.create({name:"editable",addProseMirrorPlugins(){return[new Te({key:new $e("editable"),props:{editable:()=>this.editor.options.editable}})]}}),OE=Ae.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Te({key:new $e("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),ME=Ae.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:c,doc:d}=a,{empty:u,$anchor:p}=c,{pos:f,parent:h}=p,m=p.parent.isTextblock&&f>0?a.doc.resolve(f-1):p,g=m.parent.type.spec.isolating,b=p.pos-p.parentOffset,y=g&&m.parent.childCount===1?b===p.pos:ee.atStart(d).from===f;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&p.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:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":n,"Alt-Backspace":n,"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 Ra()||nm()?i:o},addProseMirrorPlugins(){return[new Te({key:new $e("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(g=>g.getMeta("composition")))return;const r=n.some(g=>g.docChanged)&&!e.doc.eq(t.doc),o=n.some(g=>g.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,c=ee.atStart(e.doc).from,d=ee.atEnd(e.doc).to;if(i||!(s===c&&a===d)||!Xc(t.doc))return;const f=t.tr,h=Na({state:t,transaction:f}),{commands:m}=new Ta({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),AE=Ae.create({name:"paste",addProseMirrorPlugins(){return[new Te({key:new $e("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),RE=Ae.create({name:"tabindex",addProseMirrorPlugins(){return[new Te({key:new $e("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Mr{get name(){return this.node.type.name}constructor(e,t,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,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 t=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}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,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),t=this.resolvedPos.doc.resolve(e);return new Mr(t,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((t,r)=>{const o=t.isBlock&&!t.isTextblock,i=t.isAtom&&!t.isText,s=this.pos+r+(i?0:1),a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;const c=new Mr(a,this.editor,o,o?t:null);o&&(c.actualDepth=this.depth+1),e.push(new Mr(a,this.editor,o,o?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(t).length>0){const i=o.node.attrs,s=Object.keys(t);for(let a=0;a<s.length;a+=1){const c=s[a];if(i[c]!==t[c])break}}else r=o;o=o.parent}return r}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(t);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(c=>t[c]===s.node.attrs[c])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,t,r))))}),o}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}}const DE=`.ProseMirror {
|
|
16
|
+
`,textSerializers:s={}}=t||{};let a="";return n.nodesBetween(r,o,(c,d,u,p)=>{var f;c.isBlock&&d>r&&(a+=i);const h=s==null?void 0:s[c.type.name];if(h)return u&&(a+=h({node:c,pos:d,parent:u,index:p,range:e})),!1;c.isText&&(a+=(f=c==null?void 0:c.text)===null||f===void 0?void 0:f.slice(Math.max(r,d)-d,o-d))}),a}function jc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const cw=Ae.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Te({key:new $e("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{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)),c=jc(t);return Xh(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),dw=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),uw=(n=!1)=>({commands:e})=>e.setContent("",n),pw=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:o}=r;return t&&o.forEach(({$from:i,$to:s})=>{n.doc.nodesBetween(i.pos,s.pos,(a,c)=>{if(a.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),f=d.resolve(u.map(c+a.nodeSize)),h=p.blockRange(f);if(!h)return;const m=Oo(h);if(a.type.isTextblock){const{defaultType:g}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(h.start,g)}(m||m===0)&&e.lift(h,m)})}),!0},fw=n=>e=>n(e),hw=()=>({state:n,dispatch:e})=>qh(n,e),mw=(n,e)=>({editor:t,tr:r})=>{const{state:o}=t,i=o.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new Y(r.doc.resolve(s-1))),!0},gw=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const o=n.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),c=o.after(i);n.delete(a,c).scrollIntoView()}return!0}return!1},bw=n=>({tr:e,state:t,dispatch:r})=>{const o=lt(n,t.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const c=i.before(s),d=i.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},yw=n=>({tr:e,dispatch:t})=>{const{from:r,to:o}=n;return t&&e.delete(r,o),!0},vw=()=>({state:n,dispatch:e})=>Vc(n,e),kw=()=>({commands:n})=>n.keyboardShortcut("Enter"),ww=()=>({state:n,dispatch:e})=>Dk(n,e);function Ps(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>t.strict?e[o]===n[o]:Gc(e[o])?e[o].test(n[o]):e[o]===n[o]):!0}function Zh(n,e,t={}){return n.find(r=>r.type===e&&Ps(Object.fromEntries(Object.keys(t).map(o=>[o,r.attrs[o]])),t))}function qu(n,e,t={}){return!!Zh(n,e,t)}function Mo(n,e,t){var r;if(!n||!e)return;let o=n.parent.childAfter(n.parentOffset);if((!o.node||!o.node.marks.some(u=>u.type===e))&&(o=n.parent.childBefore(n.parentOffset)),!o.node||!o.node.marks.some(u=>u.type===e)||(t=t||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!Zh([...o.node.marks],e,t)))return;let s=o.index,a=n.start()+o.offset,c=s+1,d=a+o.node.nodeSize;for(;s>0&&qu([...n.parent.child(s-1).marks],e,t);)s-=1,a-=n.parent.child(s).nodeSize;for(;c<n.parent.childCount&&qu([...n.parent.child(c).marks],e,t);)d+=n.parent.child(c).nodeSize,c+=1;return{from:a,to:d}}function Er(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const Ew=(n,e={})=>({tr:t,state:r,dispatch:o})=>{const i=Er(n,r.schema),{doc:s,selection:a}=t,{$from:c,from:d,to:u}=a;if(o){const p=Mo(c,i,e);if(p&&p.from<=d&&p.to>=u){const f=Y.create(s,p.from,p.to);t.setSelection(f)}}return!0},Cw=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Aa(n){return n instanceof Y}function Kn(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function Qh(n,e=null){if(!e)return null;const t=ee.atStart(n),r=ee.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const o=t.from,i=r.to;return e==="all"?Y.create(n,Kn(0,o,i),Kn(n.content.size,o,i)):Y.create(n,Kn(e,o,i),Kn(e,o,i))}function em(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ra(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const _w=(n=null,e={})=>({editor:t,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{(Ra()||em())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(i&&n===null&&!Aa(t.state.selection))return s(),!0;const a=Qh(o.doc,n)||t.state.selection,c=t.state.selection.eq(a);return i&&(c||o.setSelection(a),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},Sw=(n,e)=>t=>n.every((r,o)=>e(r,{...t,index:o})),xw=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),tm=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&tm(r)}return n};function Gi(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return tm(t)}function $s(n,e,t){if(n instanceof fr||n instanceof S)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,o=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return S.fromArray(n.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(i){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",i),$s("",e,t)}if(o){if(t.errorOnInvalidContent){let s=!1,a="";const c=new Tf({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:d=>(s=!0,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(t.slice?hr.fromSchema(c).parseSlice(Gi(n),t.parseOptions):hr.fromSchema(c).parse(Gi(n),t.parseOptions),t.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=hr.fromSchema(e);return t.slice?i.parseSlice(Gi(n),t.parseOptions).content:i.parse(Gi(n),t.parseOptions)}return $s("",e,t)}function Nw(n,e,t){const r=n.steps.length-1;if(r<e)return;const o=n.steps[r];if(!(o instanceof mt||o instanceof yt))return;const i=n.mapping.maps[r];let s=0;i.forEach((a,c,d,u)=>{s===0&&(s=u)}),n.setSelection(ee.near(n.doc.resolve(s),t))}const Tw=n=>!("type"in n),Ow=(n,e,t)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){t={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let a;try{a=$s(e,i.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(s=t.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(m){return i.emit("contentError",{editor:i,error:m,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:d}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},u=!0,p=!0;if((Tw(a)?a:[a]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,p=p?m.isBlock:!1}),c===d&&p){const{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,d+=1)}let h;if(u){if(Array.isArray(e))h=e.map(m=>m.text||"").join("");else if(e instanceof S){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),h=m}else typeof e=="object"&&e&&e.text?h=e.text:h=e;r.insertText(h,c,d)}else h=a,r.replaceWith(c,d,h);t.updateSelection&&Nw(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:h}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:h})}return!0},Mw=()=>({state:n,dispatch:e})=>Mk(n,e),Aw=()=>({state:n,dispatch:e})=>Ak(n,e),Rw=()=>({state:n,dispatch:e})=>$h(n,e),Dw=()=>({state:n,dispatch:e})=>Hh(n,e),Iw=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Ea(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Bw=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Ea(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Lw=()=>({state:n,dispatch:e})=>Tk(n,e),Pw=()=>({state:n,dispatch:e})=>Ok(n,e);function nm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function $w(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,o,i,s;for(let a=0;a<e.length-1;a+=1){const c=e[a];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))Ra()||nm()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),o&&(t=`Ctrl-${t}`),s&&(t=`Meta-${t}`),i&&(t=`Shift-${t}`),t}const Fw=n=>({editor:e,view:t,tr:r,dispatch:o})=>{const i=$w(n).split(/-(?!$)/),s=i.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),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}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,a))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function gi(n,e,t={}){const{from:r,to:o,empty:i}=n.selection,s=e?lt(e,n.schema):null,a=[];n.doc.nodesBetween(r,o,(p,f)=>{if(p.isText)return;const h=Math.max(r,f),m=Math.min(o,f+p.nodeSize);a.push({node:p,from:h,to:m})});const c=o-r,d=a.filter(p=>s?s.name===p.node.type.name:!0).filter(p=>Ps(p.node.attrs,t,{strict:!1}));return i?!!d.length:d.reduce((p,f)=>p+f.to-f.from,0)>=c}const zw=(n,e={})=>({state:t,dispatch:r})=>{const o=lt(n,t.schema);return gi(t,o,e)?Rk(t,r):!1},Vw=()=>({state:n,dispatch:e})=>Kh(n,e),Hw=n=>({state:e,dispatch:t})=>{const r=lt(n,e.schema);return Wk(r)(e,t)},Uw=()=>({state:n,dispatch:e})=>Wh(n,e);function Da(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Ku(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,o)=>(t.includes(o)||(r[o]=n[o]),r),{})}const Ww=(n,e)=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const a=Da(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=lt(n,r.schema)),a==="mark"&&(s=Er(n,r.schema)),o&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{i&&i===d.type&&t.setNodeMarkup(u,void 0,Ku(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(p=>{s===p.type&&t.addMark(u,u+d.nodeSize,s.create(Ku(p.attrs,e)))})})}),!0):!1},qw=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Kw=()=>({tr:n,dispatch:e})=>{if(e){const t=new Jt(n.doc);n.setSelection(t)}return!0},Gw=()=>({state:n,dispatch:e})=>zh(n,e),jw=()=>({state:n,dispatch:e})=>Uh(n,e),Jw=()=>({state:n,dispatch:e})=>Lk(n,e),Yw=()=>({state:n,dispatch:e})=>Fk(n,e),Xw=()=>({state:n,dispatch:e})=>$k(n,e);function ec(n,e,t={},r={}){return $s(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const Zw=(n,e=!1,t={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var c,d;const{doc:u}=i;if(t.preserveWhitespace!=="full"){const p=ec(n,o.schema,t,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,p).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},n,{parseOptions:t,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:o.options.enableContentCheck})};function rm(n,e){const t=Er(e,n.schema),{from:r,to:o,empty:i}=n.selection,s=[];i?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,o,c=>{s.push(...c.marks)});const a=s.find(c=>c.type.name===t.name);return a?{...a.attrs}:{}}function Qw(n,e){const t=new rh(n);return e.forEach(r=>{r.steps.forEach(o=>{t.step(o)})}),t}function eE(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function tc(n,e){const t=[];return n.descendants((r,o)=>{e(r)&&t.push({node:r,pos:o})}),t}function tE(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(o,i)=>{t(o)&&r.push({node:o,pos:i})}),r}function om(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Jc(n){return e=>om(e.$from,n)}function im(n,e){const t={from:0,to:n.content.size};return Xh(n,t,e)}function nE(n,e){const t=lt(e,n.schema),{from:r,to:o}=n.selection,i=[];n.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===t.name);return s?{...s.attrs}:{}}function sm(n,e){const t=Da(typeof e=="string"?e:e.name,n.schema);return t==="node"?nE(n,e):t==="mark"?rm(n,e):{}}function rE(n,e=JSON.stringify){const t={};return n.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(t,o)?!1:t[o]=!0})}function oE(n){const e=rE(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,s)=>s!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function iE(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,c)=>{s.push({from:a,to:c})});else{const{from:a,to:c}=t[i];if(a===void 0||c===void 0)return;s.push({from:a,to:c})}s.forEach(({from:a,to:c})=>{const d=e.slice(i).map(a,-1),u=e.slice(i).map(c),p=e.invert().map(d,-1),f=e.invert().map(u);r.push({oldRange:{from:p,to:f},newRange:{from:d,to:u}})})}),oE(r)}function Yc(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(o=>{const i=t.resolve(n),s=Mo(i,o.type);s&&r.push({mark:o,...s})}):t.nodesBetween(n,e,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function ks(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const o=n.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function nc(n,e,t={}){const{empty:r,ranges:o}=n.selection,i=e?Er(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>i?i.name===p.type.name:!0).find(p=>Ps(p.attrs,t,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:p,$to:f})=>{const h=p.pos,m=f.pos;n.doc.nodesBetween(h,m,(g,b)=>{if(!g.isText&&!g.marks.length)return;const y=Math.max(h,b),k=Math.min(m,b+g.nodeSize),E=k-y;s+=E,a.push(...g.marks.map(v=>({mark:v,from:y,to:k})))})}),s===0)return!1;const c=a.filter(p=>i?i.name===p.mark.type.name:!0).filter(p=>Ps(p.mark.attrs,t,{strict:!1})).reduce((p,f)=>p+f.to-f.from,0),d=a.filter(p=>i?p.mark.type!==i&&p.mark.type.excludes(i):!0).reduce((p,f)=>p+f.to-f.from,0);return(c>0?c+d:c)>=s}function sE(n,e,t={}){if(!e)return gi(n,null,t)||nc(n,null,t);const r=Da(e,n.schema);return r==="node"?gi(n,e,t):r==="mark"?nc(n,e,t):!1}function Gu(n,e){const{nodeExtensions:t}=Oa(e),r=t.find(s=>s.name===n);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=me(U(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Xc(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let o=!0;return n.content.forEach(i=>{o!==!1&&(Xc(i,{ignoreWhitespace:t,checkChildren:e})||(o=!1))}),o}return!1}function am(n){return n instanceof G}function lm(n,e,t){const o=n.state.doc.content.size,i=Kn(e,0,o),s=Kn(t,0,o),a=n.coordsAtPos(i),c=n.coordsAtPos(s,-1),d=Math.min(a.top,c.top),u=Math.max(a.bottom,c.bottom),p=Math.min(a.left,c.left),f=Math.max(a.right,c.right),h=f-p,m=u-d,y={top:d,bottom:u,left:p,right:f,width:h,height:m,x:p,y:d};return{...y,toJSON:()=>y}}function aE(n,e,t){var r;const{selection:o}=e;let i=null;if(Aa(o)&&(i=o.$cursor),i){const a=(r=n.storedMarks)!==null&&r!==void 0?r:i.marks();return!!t.isInSet(a)||!a.some(c=>c.type.excludes(t))}const{ranges:s}=o;return s.some(({$from:a,$to:c})=>{let d=a.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(a.pos,c.pos,(u,p,f)=>{if(d)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(t));d=h&&m}return!d}),d})}const lE=(n,e={})=>({tr:t,state:r,dispatch:o})=>{const{selection:i}=t,{empty:s,ranges:a}=i,c=Er(n,r.schema);if(o)if(s){const d=rm(r,c);t.addStoredMark(c.create({...d,...e}))}else a.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(u,p,(f,h)=>{const m=Math.max(h,u),g=Math.min(h+f.nodeSize,p);f.marks.find(y=>y.type===c)?f.marks.forEach(y=>{c===y.type&&t.addMark(m,g,c.create({...y.attrs,...e}))}):t.addMark(m,g,c.create(e))})});return aE(r,t,c)},cE=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),dE=(n,e={})=>({state:t,dispatch:r,chain:o})=>{const i=lt(n,t.schema);let s;return t.selection.$anchor.sameParent(t.selection.$head)&&(s=t.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:a})=>Vu(i,{...s,...e})(t)?!0:a.clearNodes()).command(({state:a})=>Vu(i,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},uE=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,o=Kn(n,0,r.content.size),i=G.create(r,o);e.setSelection(i)}return!0},pE=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:o,to:i}=typeof n=="number"?{from:n,to:n}:n,s=Y.atStart(r).from,a=Y.atEnd(r).to,c=Kn(o,s,a),d=Kn(i,s,a),u=Y.create(r,c,d);e.setSelection(u)}return!0},fE=n=>({state:e,dispatch:t})=>{const r=lt(n,e.schema);return Gk(r)(e,t)};function ju(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(o=>e==null?void 0:e.includes(o.type.name));n.tr.ensureMarks(r)}}const hE=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:c}=i,d=o.extensionManager.attributes,u=ks(d,a.node().type.name,a.node().attrs);if(i instanceof G&&i.node.isBlock)return!a.parentOffset||!Gn(s,a.pos)?!1:(r&&(n&&ju(t,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const p=c.parentOffset===c.parent.content.size,f=a.depth===0?void 0:eE(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=p&&f?[{type:f,attrs:u}]:void 0,m=Gn(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!m&&Gn(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(m&&(i instanceof Y&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,h),f&&!p&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),b=e.doc.resolve(g);a.node(-1).canReplaceWith(b.index(),b.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}n&&ju(t,o.extensionManager.splittableMarks),e.scrollIntoView()}return m},mE=(n,e={})=>({tr:t,state:r,dispatch:o,editor:i})=>{var s;const a=lt(n,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const p=c.node(-1);if(p.type!==a)return!1;const f=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(o){let y=S.empty;const k=c.index(-1)?1:c.index(-2)?2:3;for(let B=c.depth-k;B>=c.depth-3;B-=1)y=S.from(c.node(B).copy(y));const E=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,v={...ks(f,c.node().type.name,c.node().attrs),...e},_=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(v))||void 0;y=y.append(S.from(a.createAndFill(null,_)||void 0));const C=c.before(c.depth-(k-1));t.replace(C,c.after(-E),new O(y,4-k,0));let D=-1;t.doc.nodesBetween(C,t.doc.content.size,(B,A)=>{if(D>-1)return!1;B.isTextblock&&B.content.size===0&&(D=A+1)}),D>-1&&t.setSelection(Y.near(t.doc.resolve(D))),t.scrollIntoView()}return!0}const h=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,m={...ks(f,p.type.name,p.attrs),...e},g={...ks(f,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,d.pos);const b=h?[{type:a,attrs:m},{type:h,attrs:g}]:[{type:a,attrs:m}];if(!Gn(t.doc,c.pos,2))return!1;if(o){const{selection:y,storedMarks:k}=r,{splittableMarks:E}=i.extensionManager,v=k||y.$to.parentOffset&&y.$from.marks();if(t.split(c.pos,2,b).scrollIntoView(),!v||!o)return!0;const _=v.filter(C=>E.includes(C.type.name));t.ensureMarks(_)}return!0},pl=(n,e)=>{const t=Jc(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===(o==null?void 0:o.type)&&kr(n.doc,t.pos)&&n.join(t.pos),!0},fl=(n,e)=>{const t=Jc(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===(o==null?void 0:o.type)&&kr(n.doc,r)&&n.join(r),!0},gE=(n,e,t,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:f}=o.extensionManager,h=lt(n,s.schema),m=lt(e,s.schema),{selection:g,storedMarks:b}=s,{$from:y,$to:k}=g,E=y.blockRange(k),v=b||g.$to.parentOffset&&g.$from.marks();if(!E)return!1;const _=Jc(C=>Gu(C.type.name,p))(g);if(E.depth>=1&&_&&E.depth-_.depth<=1){if(_.node.type===h)return d.liftListItem(m);if(Gu(_.node.type.name,p)&&h.validContent(_.node.content)&&a)return c().command(()=>(i.setNodeMarkup(_.pos,h),!0)).command(()=>pl(i,h)).command(()=>fl(i,h)).run()}return!t||!v||!a?c().command(()=>u().wrapInList(h,r)?!0:d.clearNodes()).wrapInList(h,r).command(()=>pl(i,h)).command(()=>fl(i,h)).run():c().command(()=>{const C=u().wrapInList(h,r),D=v.filter(B=>f.includes(B.type.name));return i.ensureMarks(D),C?!0:d.clearNodes()}).wrapInList(h,r).command(()=>pl(i,h)).command(()=>fl(i,h)).run()},bE=(n,e={},t={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=t,s=Er(n,r.schema);return nc(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},yE=(n,e,t={})=>({state:r,commands:o})=>{const i=lt(n,r.schema),s=lt(e,r.schema),a=gi(r,i,t);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),a?o.setNode(s,c):o.setNode(i,{...c,...t})},vE=(n,e={})=>({state:t,commands:r})=>{const o=lt(n,t.schema);return gi(t,o,e)?r.lift(o):r.wrapIn(o,e)},kE=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const o=t[r];let i;if(o.spec.isInputRules&&(i=o.getState(n))){if(e){const s=n.tr,a=i.transform;for(let c=a.steps.length-1;c>=0;c-=1)s.step(a.steps[c].invert(a.docs[c]));if(i.text){const c=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,n.schema.text(i.text,c))}else s.delete(i.from,i.to)}return!0}}return!1},wE=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:o}=t;return r||e&&o.forEach(i=>{n.removeMark(i.$from.pos,i.$to.pos)}),!0},EE=(n,e={})=>({tr:t,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=t,c=Er(n,r.schema),{$from:d,empty:u,ranges:p}=a;if(!o)return!0;if(u&&s){let{from:f,to:h}=a;const m=(i=d.marks().find(b=>b.type===c))===null||i===void 0?void 0:i.attrs,g=Mo(d,c,m);g&&(f=g.from,h=g.to),t.removeMark(f,h,c)}else p.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,c)});return t.removeStoredMark(c),!0},CE=(n,e={})=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const a=Da(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=lt(n,r.schema)),a==="mark"&&(s=Er(n,r.schema)),o&&t.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let p,f,h,m;t.selection.empty?r.doc.nodesBetween(d,u,(g,b)=>{i&&i===g.type&&(h=Math.max(b,d),m=Math.min(b+g.nodeSize,u),p=b,f=g)}):r.doc.nodesBetween(d,u,(g,b)=>{b<d&&i&&i===g.type&&(h=Math.max(b,d),m=Math.min(b+g.nodeSize,u),p=b,f=g),b>=d&&b<=u&&(i&&i===g.type&&t.setNodeMarkup(b,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(y=>{if(s===y.type){const k=Math.max(b,d),E=Math.min(b+g.nodeSize,u);t.addMark(k,E,s.create({...y.attrs,...e}))}}))}),f&&(p!==void 0&&t.setNodeMarkup(p,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(g=>{s===g.type&&t.addMark(h,m,s.create({...g.attrs,...e}))}))}),!0):!1},_E=(n,e={})=>({state:t,dispatch:r})=>{const o=lt(n,t.schema);return zk(o,e)(t,r)},SE=(n,e={})=>({state:t,dispatch:r})=>{const o=lt(n,t.schema);return Vk(o,e)(t,r)};var xE=Object.freeze({__proto__:null,blur:dw,clearContent:uw,clearNodes:pw,command:fw,createParagraphNear:hw,cut:mw,deleteCurrentNode:gw,deleteNode:bw,deleteRange:yw,deleteSelection:vw,enter:kw,exitCode:ww,extendMarkRange:Ew,first:Cw,focus:_w,forEach:Sw,insertContent:xw,insertContentAt:Ow,joinBackward:Rw,joinDown:Aw,joinForward:Dw,joinItemBackward:Iw,joinItemForward:Bw,joinTextblockBackward:Lw,joinTextblockForward:Pw,joinUp:Mw,keyboardShortcut:Fw,lift:zw,liftEmptyBlock:Vw,liftListItem:Hw,newlineInCode:Uw,resetAttributes:Ww,scrollIntoView:qw,selectAll:Kw,selectNodeBackward:Gw,selectNodeForward:jw,selectParentNode:Jw,selectTextblockEnd:Yw,selectTextblockStart:Xw,setContent:Zw,setMark:lE,setMeta:cE,setNode:dE,setNodeSelection:uE,setTextSelection:pE,sinkListItem:fE,splitBlock:hE,splitListItem:mE,toggleList:gE,toggleMark:bE,toggleNode:yE,toggleWrap:vE,undoInputRule:kE,unsetAllMarks:wE,unsetMark:EE,updateAttributes:CE,wrapIn:_E,wrapInList:SE});const NE=Ae.create({name:"commands",addCommands(){return{...xE}}}),TE=Ae.create({name:"drop",addProseMirrorPlugins(){return[new Te({key:new $e("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),OE=Ae.create({name:"editable",addProseMirrorPlugins(){return[new Te({key:new $e("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ME=Ae.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Te({key:new $e("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),AE=Ae.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:c,doc:d}=a,{empty:u,$anchor:p}=c,{pos:f,parent:h}=p,m=p.parent.isTextblock&&f>0?a.doc.resolve(f-1):p,g=m.parent.type.spec.isolating,b=p.pos-p.parentOffset,y=g&&m.parent.childCount===1?b===p.pos:ee.atStart(d).from===f;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&p.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:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":n,"Alt-Backspace":n,"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 Ra()||nm()?i:o},addProseMirrorPlugins(){return[new Te({key:new $e("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(g=>g.getMeta("composition")))return;const r=n.some(g=>g.docChanged)&&!e.doc.eq(t.doc),o=n.some(g=>g.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,c=ee.atStart(e.doc).from,d=ee.atEnd(e.doc).to;if(i||!(s===c&&a===d)||!Xc(t.doc))return;const f=t.tr,h=Na({state:t,transaction:f}),{commands:m}=new Ta({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),RE=Ae.create({name:"paste",addProseMirrorPlugins(){return[new Te({key:new $e("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),DE=Ae.create({name:"tabindex",addProseMirrorPlugins(){return[new Te({key:new $e("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Mr{get name(){return this.node.type.name}constructor(e,t,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,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 t=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}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,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),t=this.resolvedPos.doc.resolve(e);return new Mr(t,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((t,r)=>{const o=t.isBlock&&!t.isTextblock,i=t.isAtom&&!t.isText,s=this.pos+r+(i?0:1),a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;const c=new Mr(a,this.editor,o,o?t:null);o&&(c.actualDepth=this.depth+1),e.push(new Mr(a,this.editor,o,o?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(t).length>0){const i=o.node.attrs,s=Object.keys(t);for(let a=0;a<s.length;a+=1){const c=s[a];if(i[c]!==t[c])break}}else r=o;o=o.parent}return r}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(t);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(c=>t[c]===s.node.attrs[c])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,t,r))))}),o}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}}const IE=`.ProseMirror {
|
|
17
17
|
position: relative;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -87,39 +87,39 @@ img.ProseMirror-separator {
|
|
|
87
87
|
|
|
88
88
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
89
89
|
opacity: 0
|
|
90
|
-
}`;function
|
|
90
|
+
}`;function BE(n,e,t){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=n,document.getElementsByTagName("head")[0].appendChild(o),o}let Dn=class extends jk{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>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("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:t,slice:r,moved:o})=>this.options.onDrop(t,r,o)),this.on("paste",({event:t,slice:r})=>this.options.onPaste(t,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=BE(IE,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const r=Yh(t)?t(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 t=this.state.plugins;let r=t;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;r=t.filter(a=>!a.key.startsWith(s))}),t.length===r.length)return;const o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}createExtensionManager(){var e,t;const o=[...this.options.enableCoreExtensions?[OE,cw.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),NE,ME,AE,DE,TE,RE].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new po(o,this)}createCommandManager(){this.commandManager=new Ta({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let t;try{t=ec(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),t=ec(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=Qh(t,this.options.autofocus);this.view=new yk(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:uo.create({doc:t,selection:r||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return sm(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,o=typeof e=="string"?t:e;return sE(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Kc(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
|
|
91
91
|
|
|
92
|
-
`,textSerializers:r={}}=e||{};return im(this.state.doc,{blockSeparator:t,textSerializers:{...jc(this.schema),...r}})}get isEmpty(){return Xc(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,t){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,t))||null}$nodes(e,t){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new Mr(t,this)}get $doc(){return this.$pos(0)}};function Kr(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r})=>{const o=me(n.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 c=a.search(/\S/),d=t.from+a.indexOf(s),u=d+s.length;if(Yc(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>d).length)return null;u<t.to&&i.delete(u,t.to),d>t.from&&i.delete(t.from+c,d);const f=t.from+c+s.length;i.addMark(t.from+c,f,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}function Zc(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r})=>{const o=me(n.getAttributes,void 0,r)||{},{tr:i}=e,s=t.from;let a=t.to;const c=n.type.create(o);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>a?u=a:a=u+r[1].length;const p=r[0][r[0].length-1];i.insertText(p,s+r[0].length-1),i.replaceWith(u,a,c)}else if(r[0]){const d=n.type.isInline?s:s-1;i.insert(d,n.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function rc(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r})=>{const o=e.doc.resolve(t.from),i=me(n.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,i)}})}function Ye(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r})=>{let o=n.replace,i=t.from;const s=t.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);o+=r[0].slice(a+r[1].length),i+=a;const c=i-s;c>0&&(o=r[0].slice(a-c,a)+o,i=s)}e.tr.insertText(o,i,s)}})}function wo(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r,chain:o})=>{const i=me(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),c=s.doc.resolve(t.from).blockRange(),d=c&&Mc(c,n.type,i);if(!d)return null;if(s.wrap(c,d),n.keepMarks&&n.editor){const{selection:p,storedMarks:f}=e,{splittableMarks:h}=n.editor.extensionManager,m=f||p.$to.parentOffset&&p.$from.marks();if(m){const g=m.filter(b=>h.includes(b.type.name));s.ensureMarks(g)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(p,i).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&kr(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)}})}class Ke{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=me(U(this,"addOptions",{name:this.name}))),this.storage=me(U(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ke(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Ma(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Ke(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=me(U(t,"addOptions",{name:t.name})),t.storage=me(U(t,"addStorage",{name:t.name,options:t.options})),t}}class BE{constructor(e,t,r){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,r,o,i,s,a,c;const{view:d}=this.editor,u=e.target,p=u.nodeType===3?(t=u.parentElement)===null||t===void 0?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!p)return;let f=0,h=0;if(this.dom!==p){const y=this.dom.getBoundingClientRect(),k=p.getBoundingClientRect(),E=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,v=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;f=k.x-y.x+E,h=k.y-y.y+v}(c=e.dataTransfer)===null||c===void 0||c.setDragImage(this.dom,f,h);const m=this.getPos();if(typeof m!="number")return;const g=G.create(d.state.doc,m),b=d.state.tr.setSelection(g);d.dispatch(b)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((t=this.contentDOM)===null||t===void 0)&&t.contains(r))))return!1;const i=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!i)return!0;const{isEditable:c}=this.editor,{isDragging:d}=this,u=!!this.node.type.spec.draggable,p=G.isSelectable(this.node),f=e.type==="copy",h=e.type==="paste",m=e.type==="cut",g=e.type==="mousedown";if(!u&&p&&i&&e.target===this.dom&&e.preventDefault(),u&&i&&!d&&e.target===this.dom)return e.preventDefault(),!1;if(u&&c&&!d&&g){const b=r.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(d||s||f||h||m||g&&p)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Ra()||em())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const r=this.getPos();return typeof r!="number"?!1:(t.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}function vr(n){return new nw({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:o})=>{const i=me(n.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],c=r[0];let d=t.to;if(a){const u=c.search(/\S/),p=t.from+c.indexOf(a),f=p+a.length;if(Yc(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(b=>b===n.type&&b!==m.mark.type)).filter(m=>m.to>p).length)return null;f<t.to&&s.delete(f,t.to),p>t.from&&s.delete(t.from+u,p),d=t.from+u+a.length,s.addMark(t.from+u,d,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}function LE(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var zt="top",cn="bottom",dn="right",Vt="left",Qc="auto",Di=[zt,cn,dn,Vt],Eo="start",bi="end",PE="clippingParents",cm="viewport",Po="popper",$E="reference",Ju=Di.reduce(function(n,e){return n.concat([e+"-"+Eo,e+"-"+bi])},[]),dm=[].concat(Di,[Qc]).reduce(function(n,e){return n.concat([e,e+"-"+Eo,e+"-"+bi])},[]),FE="beforeRead",zE="read",VE="afterRead",HE="beforeMain",UE="main",WE="afterMain",qE="beforeWrite",KE="write",GE="afterWrite",jE=[FE,zE,VE,HE,UE,WE,qE,KE,GE];function Rn(n){return n?(n.nodeName||"").toLowerCase():null}function Yt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Gr(n){var e=Yt(n).Element;return n instanceof e||n instanceof Element}function an(n){var e=Yt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function ed(n){if(typeof ShadowRoot>"u")return!1;var e=Yt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function JE(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];!an(i)||!Rn(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 YE(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.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]:t[r]),a=s.reduce(function(c,d){return c[d]="",c},{});!an(o)||!Rn(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(c){o.removeAttribute(c)}))})}}const um={name:"applyStyles",enabled:!0,phase:"write",fn:JE,effect:YE,requires:["computeStyles"]};function On(n){return n.split("-")[0]}var $r=Math.max,Fs=Math.min,Co=Math.round;function oc(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function pm(){return!/^((?!chrome|android).)*safari/i.test(oc())}function _o(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),o=1,i=1;e&&an(n)&&(o=n.offsetWidth>0&&Co(r.width)/n.offsetWidth||1,i=n.offsetHeight>0&&Co(r.height)/n.offsetHeight||1);var s=Gr(n)?Yt(n):window,a=s.visualViewport,c=!pm()&&t,d=(r.left+(c&&a?a.offsetLeft:0))/o,u=(r.top+(c&&a?a.offsetTop:0))/i,p=r.width/o,f=r.height/i;return{width:p,height:f,top:u,right:d+p,bottom:u+f,left:d,x:d,y:u}}function td(n){var e=_o(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function fm(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&ed(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Yn(n){return Yt(n).getComputedStyle(n)}function XE(n){return["table","td","th"].indexOf(Rn(n))>=0}function Cr(n){return((Gr(n)?n.ownerDocument:n.document)||window.document).documentElement}function Ia(n){return Rn(n)==="html"?n:n.assignedSlot||n.parentNode||(ed(n)?n.host:null)||Cr(n)}function Yu(n){return!an(n)||Yn(n).position==="fixed"?null:n.offsetParent}function ZE(n){var e=/firefox/i.test(oc()),t=/Trident/i.test(oc());if(t&&an(n)){var r=Yn(n);if(r.position==="fixed")return null}var o=Ia(n);for(ed(o)&&(o=o.host);an(o)&&["html","body"].indexOf(Rn(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 Ii(n){for(var e=Yt(n),t=Yu(n);t&&XE(t)&&Yn(t).position==="static";)t=Yu(t);return t&&(Rn(t)==="html"||Rn(t)==="body"&&Yn(t).position==="static")?e:t||ZE(n)||e}function nd(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Qo(n,e,t){return $r(n,Fs(e,t))}function QE(n,e,t){var r=Qo(n,e,t);return r>t?t:r}function hm(){return{top:0,right:0,bottom:0,left:0}}function mm(n){return Object.assign({},hm(),n)}function gm(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var e0=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,mm(typeof e!="number"?e:gm(e,Di))};function t0(n){var e,t=n.state,r=n.name,o=n.options,i=t.elements.arrow,s=t.modifiersData.popperOffsets,a=On(t.placement),c=nd(a),d=[Vt,dn].indexOf(a)>=0,u=d?"height":"width";if(!(!i||!s)){var p=e0(o.padding,t),f=td(i),h=c==="y"?zt:Vt,m=c==="y"?cn:dn,g=t.rects.reference[u]+t.rects.reference[c]-s[c]-t.rects.popper[u],b=s[c]-t.rects.reference[c],y=Ii(i),k=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,E=g/2-b/2,v=p[h],_=k-f[u]-p[m],C=k/2-f[u]/2+E,D=Qo(v,C,_),B=c;t.modifiersData[r]=(e={},e[B]=D,e.centerOffset=D-C,e)}}function n0(n){var e=n.state,t=n.options,r=t.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||fm(e.elements.popper,o)&&(e.elements.arrow=o))}const r0={name:"arrow",enabled:!0,phase:"main",fn:t0,effect:n0,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function So(n){return n.split("-")[1]}var o0={top:"auto",right:"auto",bottom:"auto",left:"auto"};function i0(n,e){var t=n.x,r=n.y,o=e.devicePixelRatio||1;return{x:Co(t*o)/o||0,y:Co(r*o)/o||0}}function Xu(n){var e,t=n.popper,r=n.popperRect,o=n.placement,i=n.variation,s=n.offsets,a=n.position,c=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,p=n.isFixed,f=s.x,h=f===void 0?0:f,m=s.y,g=m===void 0?0:m,b=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var y=s.hasOwnProperty("x"),k=s.hasOwnProperty("y"),E=Vt,v=zt,_=window;if(d){var C=Ii(t),D="clientHeight",B="clientWidth";if(C===Yt(t)&&(C=Cr(t),Yn(C).position!=="static"&&a==="absolute"&&(D="scrollHeight",B="scrollWidth")),C=C,o===zt||(o===Vt||o===dn)&&i===bi){v=cn;var A=p&&C===_&&_.visualViewport?_.visualViewport.height:C[D];g-=A-r.height,g*=c?1:-1}if(o===Vt||(o===zt||o===cn)&&i===bi){E=dn;var $=p&&C===_&&_.visualViewport?_.visualViewport.width:C[B];h-=$-r.width,h*=c?1:-1}}var J=Object.assign({position:a},d&&o0),te=u===!0?i0({x:h,y:g},Yt(t)):{x:h,y:g};if(h=te.x,g=te.y,c){var de;return Object.assign({},J,(de={},de[v]=k?"0":"",de[E]=y?"0":"",de.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",de))}return Object.assign({},J,(e={},e[v]=k?g+"px":"",e[E]=y?h+"px":"",e.transform="",e))}function s0(n){var e=n.state,t=n.options,r=t.gpuAcceleration,o=r===void 0?!0:r,i=t.adaptive,s=i===void 0?!0:i,a=t.roundOffsets,c=a===void 0?!0:a,d={placement:On(e.placement),variation:So(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,Xu(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xu(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const a0={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:s0,data:{}};var ji={passive:!0};function l0(n){var e=n.state,t=n.instance,r=n.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,c=Yt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&d.forEach(function(u){u.addEventListener("scroll",t.update,ji)}),a&&c.addEventListener("resize",t.update,ji),function(){i&&d.forEach(function(u){u.removeEventListener("scroll",t.update,ji)}),a&&c.removeEventListener("resize",t.update,ji)}}const c0={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:l0,data:{}};var d0={left:"right",right:"left",bottom:"top",top:"bottom"};function ws(n){return n.replace(/left|right|bottom|top/g,function(e){return d0[e]})}var u0={start:"end",end:"start"};function Zu(n){return n.replace(/start|end/g,function(e){return u0[e]})}function rd(n){var e=Yt(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function od(n){return _o(Cr(n)).left+rd(n).scrollLeft}function p0(n,e){var t=Yt(n),r=Cr(n),o=t.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;var d=pm();(d||!d&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a+od(n),y:c}}function f0(n){var e,t=Cr(n),r=rd(n),o=(e=n.ownerDocument)==null?void 0:e.body,i=$r(t.scrollWidth,t.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=$r(t.scrollHeight,t.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+od(n),c=-r.scrollTop;return Yn(o||t).direction==="rtl"&&(a+=$r(t.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:c}}function id(n){var e=Yn(n),t=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+o+r)}function bm(n){return["html","body","#document"].indexOf(Rn(n))>=0?n.ownerDocument.body:an(n)&&id(n)?n:bm(Ia(n))}function ei(n,e){var t;e===void 0&&(e=[]);var r=bm(n),o=r===((t=n.ownerDocument)==null?void 0:t.body),i=Yt(r),s=o?[i].concat(i.visualViewport||[],id(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(ei(Ia(s)))}function ic(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function h0(n,e){var t=_o(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Qu(n,e,t){return e===cm?ic(p0(n,t)):Gr(e)?h0(e,t):ic(f0(Cr(n)))}function m0(n){var e=ei(Ia(n)),t=["absolute","fixed"].indexOf(Yn(n).position)>=0,r=t&&an(n)?Ii(n):n;return Gr(r)?e.filter(function(o){return Gr(o)&&fm(o,r)&&Rn(o)!=="body"}):[]}function g0(n,e,t,r){var o=e==="clippingParents"?m0(n):[].concat(e),i=[].concat(o,[t]),s=i[0],a=i.reduce(function(c,d){var u=Qu(n,d,r);return c.top=$r(u.top,c.top),c.right=Fs(u.right,c.right),c.bottom=Fs(u.bottom,c.bottom),c.left=$r(u.left,c.left),c},Qu(n,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 ym(n){var e=n.reference,t=n.element,r=n.placement,o=r?On(r):null,i=r?So(r):null,s=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(o){case zt:c={x:s,y:e.y-t.height};break;case cn:c={x:s,y:e.y+e.height};break;case dn:c={x:e.x+e.width,y:a};break;case Vt:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var d=o?nd(o):null;if(d!=null){var u=d==="y"?"height":"width";switch(i){case Eo:c[d]=c[d]-(e[u]/2-t[u]/2);break;case bi:c[d]=c[d]+(e[u]/2-t[u]/2);break}}return c}function yi(n,e){e===void 0&&(e={});var t=e,r=t.placement,o=r===void 0?n.placement:r,i=t.strategy,s=i===void 0?n.strategy:i,a=t.boundary,c=a===void 0?PE:a,d=t.rootBoundary,u=d===void 0?cm:d,p=t.elementContext,f=p===void 0?Po:p,h=t.altBoundary,m=h===void 0?!1:h,g=t.padding,b=g===void 0?0:g,y=mm(typeof b!="number"?b:gm(b,Di)),k=f===Po?$E:Po,E=n.rects.popper,v=n.elements[m?k:f],_=g0(Gr(v)?v:v.contextElement||Cr(n.elements.popper),c,u,s),C=_o(n.elements.reference),D=ym({reference:C,element:E,placement:o}),B=ic(Object.assign({},E,D)),A=f===Po?B:C,$={top:_.top-A.top+y.top,bottom:A.bottom-_.bottom+y.bottom,left:_.left-A.left+y.left,right:A.right-_.right+y.right},J=n.modifiersData.offset;if(f===Po&&J){var te=J[o];Object.keys($).forEach(function(de){var ce=[dn,cn].indexOf(de)>=0?1:-1,re=[zt,cn].indexOf(de)>=0?"y":"x";$[de]+=te[re]*ce})}return $}function b0(n,e){e===void 0&&(e={});var t=e,r=t.placement,o=t.boundary,i=t.rootBoundary,s=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?dm:c,u=So(r),p=u?a?Ju:Ju.filter(function(m){return So(m)===u}):Di,f=p.filter(function(m){return d.indexOf(m)>=0});f.length===0&&(f=p);var h=f.reduce(function(m,g){return m[g]=yi(n,{placement:g,boundary:o,rootBoundary:i,padding:s})[On(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function y0(n){if(On(n)===Qc)return[];var e=ws(n);return[Zu(n),e,Zu(e)]}function v0(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var o=t.mainAxis,i=o===void 0?!0:o,s=t.altAxis,a=s===void 0?!0:s,c=t.fallbackPlacements,d=t.padding,u=t.boundary,p=t.rootBoundary,f=t.altBoundary,h=t.flipVariations,m=h===void 0?!0:h,g=t.allowedAutoPlacements,b=e.options.placement,y=On(b),k=y===b,E=c||(k||!m?[ws(b)]:y0(b)),v=[b].concat(E).reduce(function(rt,xe){return rt.concat(On(xe)===Qc?b0(e,{placement:xe,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:g}):xe)},[]),_=e.rects.reference,C=e.rects.popper,D=new Map,B=!0,A=v[0],$=0;$<v.length;$++){var J=v[$],te=On(J),de=So(J)===Eo,ce=[zt,cn].indexOf(te)>=0,re=ce?"width":"height",oe=yi(e,{placement:J,boundary:u,rootBoundary:p,altBoundary:f,padding:d}),N=ce?de?dn:Vt:de?cn:zt;_[re]>C[re]&&(N=ws(N));var M=ws(N),z=[];if(i&&z.push(oe[te]<=0),a&&z.push(oe[N]<=0,oe[M]<=0),z.every(function(rt){return rt})){A=J,B=!1;break}D.set(J,z)}if(B)for(var j=m?3:1,Q=function(xe){var Fe=v.find(function(Ht){var dt=D.get(Ht);if(dt)return dt.slice(0,xe).every(function(Qt){return Qt})});if(Fe)return A=Fe,"break"},fe=j;fe>0;fe--){var Se=Q(fe);if(Se==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const k0={name:"flip",enabled:!0,phase:"main",fn:v0,requiresIfExists:["offset"],data:{_skip:!1}};function ep(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function tp(n){return[zt,dn,cn,Vt].some(function(e){return n[e]>=0})}function w0(n){var e=n.state,t=n.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=yi(e,{elementContext:"reference"}),a=yi(e,{altBoundary:!0}),c=ep(s,r),d=ep(a,o,i),u=tp(c),p=tp(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const E0={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:w0};function C0(n,e,t){var r=On(n),o=[Vt,zt].indexOf(r)>=0?-1:1,i=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Vt,dn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function _0(n){var e=n.state,t=n.options,r=n.name,o=t.offset,i=o===void 0?[0,0]:o,s=dm.reduce(function(u,p){return u[p]=C0(p,e.rects,i),u},{}),a=s[e.placement],c=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const S0={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_0};function x0(n){var e=n.state,t=n.name;e.modifiersData[t]=ym({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const N0={name:"popperOffsets",enabled:!0,phase:"read",fn:x0,data:{}};function T0(n){return n==="x"?"y":"x"}function O0(n){var e=n.state,t=n.options,r=n.name,o=t.mainAxis,i=o===void 0?!0:o,s=t.altAxis,a=s===void 0?!1:s,c=t.boundary,d=t.rootBoundary,u=t.altBoundary,p=t.padding,f=t.tether,h=f===void 0?!0:f,m=t.tetherOffset,g=m===void 0?0:m,b=yi(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),y=On(e.placement),k=So(e.placement),E=!k,v=nd(y),_=T0(v),C=e.modifiersData.popperOffsets,D=e.rects.reference,B=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,$=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),J=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,te={x:0,y:0};if(C){if(i){var de,ce=v==="y"?zt:Vt,re=v==="y"?cn:dn,oe=v==="y"?"height":"width",N=C[v],M=N+b[ce],z=N-b[re],j=h?-B[oe]/2:0,Q=k===Eo?D[oe]:B[oe],fe=k===Eo?-B[oe]:-D[oe],Se=e.elements.arrow,rt=h&&Se?td(Se):{width:0,height:0},xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:hm(),Fe=xe[ce],Ht=xe[re],dt=Qo(0,D[oe],rt[oe]),Qt=E?D[oe]/2-j-dt-Fe-$.mainAxis:Q-dt-Fe-$.mainAxis,ut=E?-D[oe]/2+j+dt+Ht+$.mainAxis:fe+dt+Ht+$.mainAxis,en=e.elements.arrow&&Ii(e.elements.arrow),kn=en?v==="y"?en.clientTop||0:en.clientLeft||0:0,pn=(de=J==null?void 0:J[v])!=null?de:0,Ut=N+Qt-pn-kn,fn=N+ut-pn,le=Qo(h?Fs(M,Ut):M,N,h?$r(z,fn):z);C[v]=le,te[v]=le-N}if(a){var Lt,vt=v==="x"?zt:Vt,Z=v==="x"?cn:dn,xt=C[_],Re=_==="y"?"height":"width",ke=xt+b[vt],Nt=xt-b[Z],Xe=[zt,Vt].indexOf(y)!==-1,hn=(Lt=J==null?void 0:J[_])!=null?Lt:0,Tt=Xe?ke:xt-D[Re]-B[Re]-hn+$.altAxis,L=Xe?xt+D[Re]+B[Re]-hn-$.altAxis:Nt,V=h&&Xe?QE(Tt,xt,L):Qo(h?Tt:ke,xt,h?L:Nt);C[_]=V,te[_]=V-xt}e.modifiersData[r]=te}}const M0={name:"preventOverflow",enabled:!0,phase:"main",fn:O0,requiresIfExists:["offset"]};function A0(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function R0(n){return n===Yt(n)||!an(n)?rd(n):A0(n)}function D0(n){var e=n.getBoundingClientRect(),t=Co(e.width)/n.offsetWidth||1,r=Co(e.height)/n.offsetHeight||1;return t!==1||r!==1}function I0(n,e,t){t===void 0&&(t=!1);var r=an(e),o=an(e)&&D0(e),i=Cr(e),s=_o(n,o,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((Rn(e)!=="body"||id(i))&&(a=R0(e)),an(e)?(c=_o(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=od(i))),{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function B0(n){var e=new Map,t=new Set,r=[];n.forEach(function(i){e.set(i.name,i)});function o(i){t.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&o(c)}}),r.push(i)}return n.forEach(function(i){t.has(i.name)||o(i)}),r}function L0(n){var e=B0(n);return jE.reduce(function(t,r){return t.concat(e.filter(function(o){return o.phase===r}))},[])}function P0(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function $0(n){var e=n.reduce(function(t,r){var o=t[r.name];return t[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var np={placement:"bottom",modifiers:[],strategy:"absolute"};function rp(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function F0(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,o=e.defaultOptions,i=o===void 0?np:o;return function(a,c,d){d===void 0&&(d=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},np,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},p=[],f=!1,h={state:u,setOptions:function(y){var k=typeof y=="function"?y(u.options):y;g(),u.options=Object.assign({},i,u.options,k),u.scrollParents={reference:Gr(a)?ei(a):a.contextElement?ei(a.contextElement):[],popper:ei(c)};var E=L0($0([].concat(r,u.options.modifiers)));return u.orderedModifiers=E.filter(function(v){return v.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var y=u.elements,k=y.reference,E=y.popper;if(rp(k,E)){u.rects={reference:I0(k,Ii(E),u.options.strategy==="fixed"),popper:td(E)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var _=u.orderedModifiers[v],C=_.fn,D=_.options,B=D===void 0?{}:D,A=_.name;typeof C=="function"&&(u=C({state:u,options:B,name:A,instance:h})||u)}}}},update:P0(function(){return new Promise(function(b){h.forceUpdate(),b(u)})}),destroy:function(){g(),f=!0}};if(!rp(a,c))return h;h.setOptions(d).then(function(b){!f&&d.onFirstUpdate&&d.onFirstUpdate(b)});function m(){u.orderedModifiers.forEach(function(b){var y=b.name,k=b.options,E=k===void 0?{}:k,v=b.effect;if(typeof v=="function"){var _=v({state:u,name:y,instance:h,options:E}),C=function(){};p.push(_||C)}})}function g(){p.forEach(function(b){return b()}),p=[]}return h}}var z0=[c0,N0,a0,um,S0,k0,M0,r0,E0],V0=F0({defaultModifiers:z0}),H0="tippy-box",vm="tippy-content",U0="tippy-backdrop",km="tippy-arrow",wm="tippy-svg-arrow",Tr={passive:!0,capture:!0},Em=function(){return document.body};function W0(n,e){return{}.hasOwnProperty.call(n,e)}function hl(n,e,t){if(Array.isArray(n)){var r=n[e];return r??(Array.isArray(t)?t[e]:t)}return n}function sd(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function Cm(n,e){return typeof n=="function"?n.apply(void 0,e):n}function op(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function q0(n,e){var t=Object.assign({},n);return e.forEach(function(r){delete t[r]}),t}function K0(n){return n.split(/\s+/).filter(Boolean)}function so(n){return[].concat(n)}function ip(n,e){n.indexOf(e)===-1&&n.push(e)}function G0(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function j0(n){return n.split("-")[0]}function zs(n){return[].slice.call(n)}function sp(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function ti(){return document.createElement("div")}function vi(n){return["Element","Fragment"].some(function(e){return sd(n,e)})}function J0(n){return sd(n,"NodeList")}function Y0(n){return sd(n,"MouseEvent")}function X0(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function Z0(n){return vi(n)?[n]:J0(n)?zs(n):Array.isArray(n)?n:zs(document.querySelectorAll(n))}function ml(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function ap(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function Q0(n){var e,t=so(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function eC(n,e){var t=e.clientX,r=e.clientY;return n.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,c=a.interactiveBorder,d=j0(s.placement),u=s.modifiersData.offset;if(!u)return!0;var p=d==="bottom"?u.top.y:0,f=d==="top"?u.bottom.y:0,h=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,g=i.top-r+p>c,b=r-i.bottom-f>c,y=i.left-t+h>c,k=t-i.right-m>c;return g||b||y||k})}function gl(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){n[r](o,t)})}function lp(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Nn={isTouch:!1},cp=0;function tC(){Nn.isTouch||(Nn.isTouch=!0,window.performance&&document.addEventListener("mousemove",_m))}function _m(){var n=performance.now();n-cp<20&&(Nn.isTouch=!1,document.removeEventListener("mousemove",_m)),cp=n}function nC(){var n=document.activeElement;if(X0(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function rC(){document.addEventListener("touchstart",tC,Tr),window.addEventListener("blur",nC)}var oC=typeof window<"u"&&typeof document<"u",iC=oC?!!window.msCrypto:!1;function to(n){var e=n==="destroy"?"n already-":" ";return[n+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function dp(n){var e=/[ \t]{2,}/g,t=/^[ \t]*/gm;return n.replace(e," ").replace(t,"").trim()}function sC(n){return dp(`
|
|
92
|
+
`,textSerializers:r={}}=e||{};return im(this.state.doc,{blockSeparator:t,textSerializers:{...jc(this.schema),...r}})}get isEmpty(){return Xc(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,t){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,t))||null}$nodes(e,t){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new Mr(t,this)}get $doc(){return this.$pos(0)}};function Kr(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r})=>{const o=me(n.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 c=a.search(/\S/),d=t.from+a.indexOf(s),u=d+s.length;if(Yc(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>d).length)return null;u<t.to&&i.delete(u,t.to),d>t.from&&i.delete(t.from+c,d);const f=t.from+c+s.length;i.addMark(t.from+c,f,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}function Zc(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r})=>{const o=me(n.getAttributes,void 0,r)||{},{tr:i}=e,s=t.from;let a=t.to;const c=n.type.create(o);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>a?u=a:a=u+r[1].length;const p=r[0][r[0].length-1];i.insertText(p,s+r[0].length-1),i.replaceWith(u,a,c)}else if(r[0]){const d=n.type.isInline?s:s-1;i.insert(d,n.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function rc(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r})=>{const o=e.doc.resolve(t.from),i=me(n.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,i)}})}function Ye(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r})=>{let o=n.replace,i=t.from;const s=t.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);o+=r[0].slice(a+r[1].length),i+=a;const c=i-s;c>0&&(o=r[0].slice(a-c,a)+o,i=s)}e.tr.insertText(o,i,s)}})}function wo(n){return new Ri({find:n.find,handler:({state:e,range:t,match:r,chain:o})=>{const i=me(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),c=s.doc.resolve(t.from).blockRange(),d=c&&Mc(c,n.type,i);if(!d)return null;if(s.wrap(c,d),n.keepMarks&&n.editor){const{selection:p,storedMarks:f}=e,{splittableMarks:h}=n.editor.extensionManager,m=f||p.$to.parentOffset&&p.$from.marks();if(m){const g=m.filter(b=>h.includes(b.type.name));s.ensureMarks(g)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(p,i).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&kr(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)}})}class Ke{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=me(U(this,"addOptions",{name:this.name}))),this.storage=me(U(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ke(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Ma(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Ke(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=me(U(t,"addOptions",{name:t.name})),t.storage=me(U(t,"addStorage",{name:t.name,options:t.options})),t}}class LE{constructor(e,t,r){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,r,o,i,s,a,c;const{view:d}=this.editor,u=e.target,p=u.nodeType===3?(t=u.parentElement)===null||t===void 0?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!p)return;let f=0,h=0;if(this.dom!==p){const y=this.dom.getBoundingClientRect(),k=p.getBoundingClientRect(),E=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,v=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;f=k.x-y.x+E,h=k.y-y.y+v}(c=e.dataTransfer)===null||c===void 0||c.setDragImage(this.dom,f,h);const m=this.getPos();if(typeof m!="number")return;const g=G.create(d.state.doc,m),b=d.state.tr.setSelection(g);d.dispatch(b)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((t=this.contentDOM)===null||t===void 0)&&t.contains(r))))return!1;const i=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!i)return!0;const{isEditable:c}=this.editor,{isDragging:d}=this,u=!!this.node.type.spec.draggable,p=G.isSelectable(this.node),f=e.type==="copy",h=e.type==="paste",m=e.type==="cut",g=e.type==="mousedown";if(!u&&p&&i&&e.target===this.dom&&e.preventDefault(),u&&i&&!d&&e.target===this.dom)return e.preventDefault(),!1;if(u&&c&&!d&&g){const b=r.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(d||s||f||h||m||g&&p)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Ra()||em())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const r=this.getPos();return typeof r!="number"?!1:(t.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}function vr(n){return new rw({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:o})=>{const i=me(n.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],c=r[0];let d=t.to;if(a){const u=c.search(/\S/),p=t.from+c.indexOf(a),f=p+a.length;if(Yc(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(b=>b===n.type&&b!==m.mark.type)).filter(m=>m.to>p).length)return null;f<t.to&&s.delete(f,t.to),p>t.from&&s.delete(t.from+u,p),d=t.from+u+a.length,s.addMark(t.from+u,d,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}function PE(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var zt="top",cn="bottom",dn="right",Vt="left",Qc="auto",Di=[zt,cn,dn,Vt],Eo="start",bi="end",$E="clippingParents",cm="viewport",Po="popper",FE="reference",Ju=Di.reduce(function(n,e){return n.concat([e+"-"+Eo,e+"-"+bi])},[]),dm=[].concat(Di,[Qc]).reduce(function(n,e){return n.concat([e,e+"-"+Eo,e+"-"+bi])},[]),zE="beforeRead",VE="read",HE="afterRead",UE="beforeMain",WE="main",qE="afterMain",KE="beforeWrite",GE="write",jE="afterWrite",JE=[zE,VE,HE,UE,WE,qE,KE,GE,jE];function Rn(n){return n?(n.nodeName||"").toLowerCase():null}function Yt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Gr(n){var e=Yt(n).Element;return n instanceof e||n instanceof Element}function an(n){var e=Yt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function ed(n){if(typeof ShadowRoot>"u")return!1;var e=Yt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function YE(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},o=e.attributes[t]||{},i=e.elements[t];!an(i)||!Rn(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 XE(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.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]:t[r]),a=s.reduce(function(c,d){return c[d]="",c},{});!an(o)||!Rn(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(c){o.removeAttribute(c)}))})}}const um={name:"applyStyles",enabled:!0,phase:"write",fn:YE,effect:XE,requires:["computeStyles"]};function On(n){return n.split("-")[0]}var $r=Math.max,Fs=Math.min,Co=Math.round;function oc(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function pm(){return!/^((?!chrome|android).)*safari/i.test(oc())}function _o(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),o=1,i=1;e&&an(n)&&(o=n.offsetWidth>0&&Co(r.width)/n.offsetWidth||1,i=n.offsetHeight>0&&Co(r.height)/n.offsetHeight||1);var s=Gr(n)?Yt(n):window,a=s.visualViewport,c=!pm()&&t,d=(r.left+(c&&a?a.offsetLeft:0))/o,u=(r.top+(c&&a?a.offsetTop:0))/i,p=r.width/o,f=r.height/i;return{width:p,height:f,top:u,right:d+p,bottom:u+f,left:d,x:d,y:u}}function td(n){var e=_o(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function fm(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&ed(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Yn(n){return Yt(n).getComputedStyle(n)}function ZE(n){return["table","td","th"].indexOf(Rn(n))>=0}function Cr(n){return((Gr(n)?n.ownerDocument:n.document)||window.document).documentElement}function Ia(n){return Rn(n)==="html"?n:n.assignedSlot||n.parentNode||(ed(n)?n.host:null)||Cr(n)}function Yu(n){return!an(n)||Yn(n).position==="fixed"?null:n.offsetParent}function QE(n){var e=/firefox/i.test(oc()),t=/Trident/i.test(oc());if(t&&an(n)){var r=Yn(n);if(r.position==="fixed")return null}var o=Ia(n);for(ed(o)&&(o=o.host);an(o)&&["html","body"].indexOf(Rn(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 Ii(n){for(var e=Yt(n),t=Yu(n);t&&ZE(t)&&Yn(t).position==="static";)t=Yu(t);return t&&(Rn(t)==="html"||Rn(t)==="body"&&Yn(t).position==="static")?e:t||QE(n)||e}function nd(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Qo(n,e,t){return $r(n,Fs(e,t))}function e0(n,e,t){var r=Qo(n,e,t);return r>t?t:r}function hm(){return{top:0,right:0,bottom:0,left:0}}function mm(n){return Object.assign({},hm(),n)}function gm(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var t0=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,mm(typeof e!="number"?e:gm(e,Di))};function n0(n){var e,t=n.state,r=n.name,o=n.options,i=t.elements.arrow,s=t.modifiersData.popperOffsets,a=On(t.placement),c=nd(a),d=[Vt,dn].indexOf(a)>=0,u=d?"height":"width";if(!(!i||!s)){var p=t0(o.padding,t),f=td(i),h=c==="y"?zt:Vt,m=c==="y"?cn:dn,g=t.rects.reference[u]+t.rects.reference[c]-s[c]-t.rects.popper[u],b=s[c]-t.rects.reference[c],y=Ii(i),k=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,E=g/2-b/2,v=p[h],_=k-f[u]-p[m],C=k/2-f[u]/2+E,D=Qo(v,C,_),B=c;t.modifiersData[r]=(e={},e[B]=D,e.centerOffset=D-C,e)}}function r0(n){var e=n.state,t=n.options,r=t.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||fm(e.elements.popper,o)&&(e.elements.arrow=o))}const o0={name:"arrow",enabled:!0,phase:"main",fn:n0,effect:r0,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function So(n){return n.split("-")[1]}var i0={top:"auto",right:"auto",bottom:"auto",left:"auto"};function s0(n,e){var t=n.x,r=n.y,o=e.devicePixelRatio||1;return{x:Co(t*o)/o||0,y:Co(r*o)/o||0}}function Xu(n){var e,t=n.popper,r=n.popperRect,o=n.placement,i=n.variation,s=n.offsets,a=n.position,c=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,p=n.isFixed,f=s.x,h=f===void 0?0:f,m=s.y,g=m===void 0?0:m,b=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var y=s.hasOwnProperty("x"),k=s.hasOwnProperty("y"),E=Vt,v=zt,_=window;if(d){var C=Ii(t),D="clientHeight",B="clientWidth";if(C===Yt(t)&&(C=Cr(t),Yn(C).position!=="static"&&a==="absolute"&&(D="scrollHeight",B="scrollWidth")),C=C,o===zt||(o===Vt||o===dn)&&i===bi){v=cn;var A=p&&C===_&&_.visualViewport?_.visualViewport.height:C[D];g-=A-r.height,g*=c?1:-1}if(o===Vt||(o===zt||o===cn)&&i===bi){E=dn;var $=p&&C===_&&_.visualViewport?_.visualViewport.width:C[B];h-=$-r.width,h*=c?1:-1}}var J=Object.assign({position:a},d&&i0),te=u===!0?s0({x:h,y:g},Yt(t)):{x:h,y:g};if(h=te.x,g=te.y,c){var de;return Object.assign({},J,(de={},de[v]=k?"0":"",de[E]=y?"0":"",de.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",de))}return Object.assign({},J,(e={},e[v]=k?g+"px":"",e[E]=y?h+"px":"",e.transform="",e))}function a0(n){var e=n.state,t=n.options,r=t.gpuAcceleration,o=r===void 0?!0:r,i=t.adaptive,s=i===void 0?!0:i,a=t.roundOffsets,c=a===void 0?!0:a,d={placement:On(e.placement),variation:So(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,Xu(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xu(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const l0={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:a0,data:{}};var ji={passive:!0};function c0(n){var e=n.state,t=n.instance,r=n.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,c=Yt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&d.forEach(function(u){u.addEventListener("scroll",t.update,ji)}),a&&c.addEventListener("resize",t.update,ji),function(){i&&d.forEach(function(u){u.removeEventListener("scroll",t.update,ji)}),a&&c.removeEventListener("resize",t.update,ji)}}const d0={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:c0,data:{}};var u0={left:"right",right:"left",bottom:"top",top:"bottom"};function ws(n){return n.replace(/left|right|bottom|top/g,function(e){return u0[e]})}var p0={start:"end",end:"start"};function Zu(n){return n.replace(/start|end/g,function(e){return p0[e]})}function rd(n){var e=Yt(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function od(n){return _o(Cr(n)).left+rd(n).scrollLeft}function f0(n,e){var t=Yt(n),r=Cr(n),o=t.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,c=0;if(o){i=o.width,s=o.height;var d=pm();(d||!d&&e==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:a+od(n),y:c}}function h0(n){var e,t=Cr(n),r=rd(n),o=(e=n.ownerDocument)==null?void 0:e.body,i=$r(t.scrollWidth,t.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=$r(t.scrollHeight,t.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+od(n),c=-r.scrollTop;return Yn(o||t).direction==="rtl"&&(a+=$r(t.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:c}}function id(n){var e=Yn(n),t=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+o+r)}function bm(n){return["html","body","#document"].indexOf(Rn(n))>=0?n.ownerDocument.body:an(n)&&id(n)?n:bm(Ia(n))}function ei(n,e){var t;e===void 0&&(e=[]);var r=bm(n),o=r===((t=n.ownerDocument)==null?void 0:t.body),i=Yt(r),s=o?[i].concat(i.visualViewport||[],id(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(ei(Ia(s)))}function ic(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function m0(n,e){var t=_o(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Qu(n,e,t){return e===cm?ic(f0(n,t)):Gr(e)?m0(e,t):ic(h0(Cr(n)))}function g0(n){var e=ei(Ia(n)),t=["absolute","fixed"].indexOf(Yn(n).position)>=0,r=t&&an(n)?Ii(n):n;return Gr(r)?e.filter(function(o){return Gr(o)&&fm(o,r)&&Rn(o)!=="body"}):[]}function b0(n,e,t,r){var o=e==="clippingParents"?g0(n):[].concat(e),i=[].concat(o,[t]),s=i[0],a=i.reduce(function(c,d){var u=Qu(n,d,r);return c.top=$r(u.top,c.top),c.right=Fs(u.right,c.right),c.bottom=Fs(u.bottom,c.bottom),c.left=$r(u.left,c.left),c},Qu(n,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 ym(n){var e=n.reference,t=n.element,r=n.placement,o=r?On(r):null,i=r?So(r):null,s=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(o){case zt:c={x:s,y:e.y-t.height};break;case cn:c={x:s,y:e.y+e.height};break;case dn:c={x:e.x+e.width,y:a};break;case Vt:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var d=o?nd(o):null;if(d!=null){var u=d==="y"?"height":"width";switch(i){case Eo:c[d]=c[d]-(e[u]/2-t[u]/2);break;case bi:c[d]=c[d]+(e[u]/2-t[u]/2);break}}return c}function yi(n,e){e===void 0&&(e={});var t=e,r=t.placement,o=r===void 0?n.placement:r,i=t.strategy,s=i===void 0?n.strategy:i,a=t.boundary,c=a===void 0?$E:a,d=t.rootBoundary,u=d===void 0?cm:d,p=t.elementContext,f=p===void 0?Po:p,h=t.altBoundary,m=h===void 0?!1:h,g=t.padding,b=g===void 0?0:g,y=mm(typeof b!="number"?b:gm(b,Di)),k=f===Po?FE:Po,E=n.rects.popper,v=n.elements[m?k:f],_=b0(Gr(v)?v:v.contextElement||Cr(n.elements.popper),c,u,s),C=_o(n.elements.reference),D=ym({reference:C,element:E,placement:o}),B=ic(Object.assign({},E,D)),A=f===Po?B:C,$={top:_.top-A.top+y.top,bottom:A.bottom-_.bottom+y.bottom,left:_.left-A.left+y.left,right:A.right-_.right+y.right},J=n.modifiersData.offset;if(f===Po&&J){var te=J[o];Object.keys($).forEach(function(de){var ce=[dn,cn].indexOf(de)>=0?1:-1,re=[zt,cn].indexOf(de)>=0?"y":"x";$[de]+=te[re]*ce})}return $}function y0(n,e){e===void 0&&(e={});var t=e,r=t.placement,o=t.boundary,i=t.rootBoundary,s=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?dm:c,u=So(r),p=u?a?Ju:Ju.filter(function(m){return So(m)===u}):Di,f=p.filter(function(m){return d.indexOf(m)>=0});f.length===0&&(f=p);var h=f.reduce(function(m,g){return m[g]=yi(n,{placement:g,boundary:o,rootBoundary:i,padding:s})[On(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function v0(n){if(On(n)===Qc)return[];var e=ws(n);return[Zu(n),e,Zu(e)]}function k0(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var o=t.mainAxis,i=o===void 0?!0:o,s=t.altAxis,a=s===void 0?!0:s,c=t.fallbackPlacements,d=t.padding,u=t.boundary,p=t.rootBoundary,f=t.altBoundary,h=t.flipVariations,m=h===void 0?!0:h,g=t.allowedAutoPlacements,b=e.options.placement,y=On(b),k=y===b,E=c||(k||!m?[ws(b)]:v0(b)),v=[b].concat(E).reduce(function(rt,xe){return rt.concat(On(xe)===Qc?y0(e,{placement:xe,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:g}):xe)},[]),_=e.rects.reference,C=e.rects.popper,D=new Map,B=!0,A=v[0],$=0;$<v.length;$++){var J=v[$],te=On(J),de=So(J)===Eo,ce=[zt,cn].indexOf(te)>=0,re=ce?"width":"height",oe=yi(e,{placement:J,boundary:u,rootBoundary:p,altBoundary:f,padding:d}),N=ce?de?dn:Vt:de?cn:zt;_[re]>C[re]&&(N=ws(N));var M=ws(N),z=[];if(i&&z.push(oe[te]<=0),a&&z.push(oe[N]<=0,oe[M]<=0),z.every(function(rt){return rt})){A=J,B=!1;break}D.set(J,z)}if(B)for(var j=m?3:1,Q=function(xe){var Fe=v.find(function(Ht){var dt=D.get(Ht);if(dt)return dt.slice(0,xe).every(function(Qt){return Qt})});if(Fe)return A=Fe,"break"},fe=j;fe>0;fe--){var Se=Q(fe);if(Se==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const w0={name:"flip",enabled:!0,phase:"main",fn:k0,requiresIfExists:["offset"],data:{_skip:!1}};function ep(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function tp(n){return[zt,dn,cn,Vt].some(function(e){return n[e]>=0})}function E0(n){var e=n.state,t=n.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=yi(e,{elementContext:"reference"}),a=yi(e,{altBoundary:!0}),c=ep(s,r),d=ep(a,o,i),u=tp(c),p=tp(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const C0={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:E0};function _0(n,e,t){var r=On(n),o=[Vt,zt].indexOf(r)>=0?-1:1,i=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Vt,dn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function S0(n){var e=n.state,t=n.options,r=n.name,o=t.offset,i=o===void 0?[0,0]:o,s=dm.reduce(function(u,p){return u[p]=_0(p,e.rects,i),u},{}),a=s[e.placement],c=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const x0={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:S0};function N0(n){var e=n.state,t=n.name;e.modifiersData[t]=ym({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const T0={name:"popperOffsets",enabled:!0,phase:"read",fn:N0,data:{}};function O0(n){return n==="x"?"y":"x"}function M0(n){var e=n.state,t=n.options,r=n.name,o=t.mainAxis,i=o===void 0?!0:o,s=t.altAxis,a=s===void 0?!1:s,c=t.boundary,d=t.rootBoundary,u=t.altBoundary,p=t.padding,f=t.tether,h=f===void 0?!0:f,m=t.tetherOffset,g=m===void 0?0:m,b=yi(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),y=On(e.placement),k=So(e.placement),E=!k,v=nd(y),_=O0(v),C=e.modifiersData.popperOffsets,D=e.rects.reference,B=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,$=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),J=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,te={x:0,y:0};if(C){if(i){var de,ce=v==="y"?zt:Vt,re=v==="y"?cn:dn,oe=v==="y"?"height":"width",N=C[v],M=N+b[ce],z=N-b[re],j=h?-B[oe]/2:0,Q=k===Eo?D[oe]:B[oe],fe=k===Eo?-B[oe]:-D[oe],Se=e.elements.arrow,rt=h&&Se?td(Se):{width:0,height:0},xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:hm(),Fe=xe[ce],Ht=xe[re],dt=Qo(0,D[oe],rt[oe]),Qt=E?D[oe]/2-j-dt-Fe-$.mainAxis:Q-dt-Fe-$.mainAxis,ut=E?-D[oe]/2+j+dt+Ht+$.mainAxis:fe+dt+Ht+$.mainAxis,en=e.elements.arrow&&Ii(e.elements.arrow),kn=en?v==="y"?en.clientTop||0:en.clientLeft||0:0,pn=(de=J==null?void 0:J[v])!=null?de:0,Ut=N+Qt-pn-kn,fn=N+ut-pn,le=Qo(h?Fs(M,Ut):M,N,h?$r(z,fn):z);C[v]=le,te[v]=le-N}if(a){var Lt,vt=v==="x"?zt:Vt,Z=v==="x"?cn:dn,xt=C[_],Re=_==="y"?"height":"width",ke=xt+b[vt],Nt=xt-b[Z],Xe=[zt,Vt].indexOf(y)!==-1,hn=(Lt=J==null?void 0:J[_])!=null?Lt:0,Tt=Xe?ke:xt-D[Re]-B[Re]-hn+$.altAxis,L=Xe?xt+D[Re]+B[Re]-hn-$.altAxis:Nt,V=h&&Xe?e0(Tt,xt,L):Qo(h?Tt:ke,xt,h?L:Nt);C[_]=V,te[_]=V-xt}e.modifiersData[r]=te}}const A0={name:"preventOverflow",enabled:!0,phase:"main",fn:M0,requiresIfExists:["offset"]};function R0(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function D0(n){return n===Yt(n)||!an(n)?rd(n):R0(n)}function I0(n){var e=n.getBoundingClientRect(),t=Co(e.width)/n.offsetWidth||1,r=Co(e.height)/n.offsetHeight||1;return t!==1||r!==1}function B0(n,e,t){t===void 0&&(t=!1);var r=an(e),o=an(e)&&I0(e),i=Cr(e),s=_o(n,o,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((Rn(e)!=="body"||id(i))&&(a=D0(e)),an(e)?(c=_o(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=od(i))),{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function L0(n){var e=new Map,t=new Set,r=[];n.forEach(function(i){e.set(i.name,i)});function o(i){t.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&o(c)}}),r.push(i)}return n.forEach(function(i){t.has(i.name)||o(i)}),r}function P0(n){var e=L0(n);return JE.reduce(function(t,r){return t.concat(e.filter(function(o){return o.phase===r}))},[])}function $0(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function F0(n){var e=n.reduce(function(t,r){var o=t[r.name];return t[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var np={placement:"bottom",modifiers:[],strategy:"absolute"};function rp(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function z0(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,o=e.defaultOptions,i=o===void 0?np:o;return function(a,c,d){d===void 0&&(d=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},np,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},p=[],f=!1,h={state:u,setOptions:function(y){var k=typeof y=="function"?y(u.options):y;g(),u.options=Object.assign({},i,u.options,k),u.scrollParents={reference:Gr(a)?ei(a):a.contextElement?ei(a.contextElement):[],popper:ei(c)};var E=P0(F0([].concat(r,u.options.modifiers)));return u.orderedModifiers=E.filter(function(v){return v.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var y=u.elements,k=y.reference,E=y.popper;if(rp(k,E)){u.rects={reference:B0(k,Ii(E),u.options.strategy==="fixed"),popper:td(E)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var _=u.orderedModifiers[v],C=_.fn,D=_.options,B=D===void 0?{}:D,A=_.name;typeof C=="function"&&(u=C({state:u,options:B,name:A,instance:h})||u)}}}},update:$0(function(){return new Promise(function(b){h.forceUpdate(),b(u)})}),destroy:function(){g(),f=!0}};if(!rp(a,c))return h;h.setOptions(d).then(function(b){!f&&d.onFirstUpdate&&d.onFirstUpdate(b)});function m(){u.orderedModifiers.forEach(function(b){var y=b.name,k=b.options,E=k===void 0?{}:k,v=b.effect;if(typeof v=="function"){var _=v({state:u,name:y,instance:h,options:E}),C=function(){};p.push(_||C)}})}function g(){p.forEach(function(b){return b()}),p=[]}return h}}var V0=[d0,T0,l0,um,x0,w0,A0,o0,C0],H0=z0({defaultModifiers:V0}),U0="tippy-box",vm="tippy-content",W0="tippy-backdrop",km="tippy-arrow",wm="tippy-svg-arrow",Tr={passive:!0,capture:!0},Em=function(){return document.body};function q0(n,e){return{}.hasOwnProperty.call(n,e)}function hl(n,e,t){if(Array.isArray(n)){var r=n[e];return r??(Array.isArray(t)?t[e]:t)}return n}function sd(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function Cm(n,e){return typeof n=="function"?n.apply(void 0,e):n}function op(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function K0(n,e){var t=Object.assign({},n);return e.forEach(function(r){delete t[r]}),t}function G0(n){return n.split(/\s+/).filter(Boolean)}function so(n){return[].concat(n)}function ip(n,e){n.indexOf(e)===-1&&n.push(e)}function j0(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function J0(n){return n.split("-")[0]}function zs(n){return[].slice.call(n)}function sp(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function ti(){return document.createElement("div")}function vi(n){return["Element","Fragment"].some(function(e){return sd(n,e)})}function Y0(n){return sd(n,"NodeList")}function X0(n){return sd(n,"MouseEvent")}function Z0(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function Q0(n){return vi(n)?[n]:Y0(n)?zs(n):Array.isArray(n)?n:zs(document.querySelectorAll(n))}function ml(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function ap(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function eC(n){var e,t=so(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function tC(n,e){var t=e.clientX,r=e.clientY;return n.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,c=a.interactiveBorder,d=J0(s.placement),u=s.modifiersData.offset;if(!u)return!0;var p=d==="bottom"?u.top.y:0,f=d==="top"?u.bottom.y:0,h=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,g=i.top-r+p>c,b=r-i.bottom-f>c,y=i.left-t+h>c,k=t-i.right-m>c;return g||b||y||k})}function gl(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){n[r](o,t)})}function lp(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Nn={isTouch:!1},cp=0;function nC(){Nn.isTouch||(Nn.isTouch=!0,window.performance&&document.addEventListener("mousemove",_m))}function _m(){var n=performance.now();n-cp<20&&(Nn.isTouch=!1,document.removeEventListener("mousemove",_m)),cp=n}function rC(){var n=document.activeElement;if(Z0(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function oC(){document.addEventListener("touchstart",nC,Tr),window.addEventListener("blur",rC)}var iC=typeof window<"u"&&typeof document<"u",sC=iC?!!window.msCrypto:!1;function to(n){var e=n==="destroy"?"n already-":" ";return[n+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function dp(n){var e=/[ \t]{2,}/g,t=/^[ \t]*/gm;return n.replace(e," ").replace(t,"").trim()}function aC(n){return dp(`
|
|
93
93
|
%ctippy.js
|
|
94
94
|
|
|
95
95
|
%c`+dp(n)+`
|
|
96
96
|
|
|
97
97
|
%c👷 This is a development-only message. It will be removed in production.
|
|
98
|
-
`)}function Sm(n){return[
|
|
98
|
+
`)}function Sm(n){return[aC(n),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ki;process.env.NODE_ENV!=="production"&&lC();function lC(){ki=new Set}function Wn(n,e){if(n&&!ki.has(e)){var t;ki.add(e),(t=console).warn.apply(t,Sm(e))}}function sc(n,e){if(n&&!ki.has(e)){var t;ki.add(e),(t=console).error.apply(t,Sm(e))}}function cC(n){var e=!n,t=Object.prototype.toString.call(n)==="[object Object]"&&!n.addEventListener;sc(e,["tippy() was passed","`"+String(n)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),sc(t,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var xm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},dC={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Gt=Object.assign({appendTo:Em,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},xm,dC),uC=Object.keys(Gt),pC=function(e){process.env.NODE_ENV!=="production"&&Tm(e,[]);var t=Object.keys(e);t.forEach(function(r){Gt[r]=e[r]})};function Nm(n){var e=n.plugins||[],t=e.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var a;r[i]=n[i]!==void 0?n[i]:(a=Gt[i])!=null?a:s}return r},{});return Object.assign({},n,t)}function fC(n,e){var t=e?Object.keys(Nm(Object.assign({},Gt,{plugins:e}))):uC,r=t.reduce(function(o,i){var s=(n.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function up(n,e){var t=Object.assign({},e,{content:Cm(e.content,[n])},e.ignoreAttributes?{}:fC(n,e.plugins));return t.aria=Object.assign({},Gt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}function Tm(n,e){n===void 0&&(n={}),e===void 0&&(e=[]);var t=Object.keys(n);t.forEach(function(r){var o=K0(Gt,Object.keys(xm)),i=!q0(o,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),Wn(i,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
99
99
|
|
|
100
100
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
101
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
101
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var hC=function(){return"innerHTML"};function ac(n,e){n[hC()]=e}function pp(n){var e=ti();return n===!0?e.className=km:(e.className=wm,vi(n)?e.appendChild(n):ac(e,n)),e}function fp(n,e){vi(e.content)?(ac(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?ac(n,e.content):n.textContent=e.content)}function lc(n){var e=n.firstElementChild,t=zs(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(vm)}),arrow:t.find(function(r){return r.classList.contains(km)||r.classList.contains(wm)}),backdrop:t.find(function(r){return r.classList.contains(W0)})}}function Om(n){var e=ti(),t=ti();t.className=U0,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=ti();r.className=vm,r.setAttribute("data-state","hidden"),fp(r,n.props),e.appendChild(t),t.appendChild(r),o(n.props,n.props);function o(i,s){var a=lc(e),c=a.box,d=a.content,u=a.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&fp(d,n.props),s.arrow?u?i.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(pp(s.arrow))):c.appendChild(pp(s.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:o}}Om.$$tippy=!0;var mC=1,Ji=[],bl=[];function gC(n,e){var t=up(n,Object.assign({},Gt,Nm(sp(e)))),r,o,i,s=!1,a=!1,c=!1,d=!1,u,p,f,h=[],m=op(Ut,t.interactiveDebounce),g,b=mC++,y=null,k=j0(t.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:b,reference:n,popper:ti(),popperInstance:y,props:t,state:E,plugins:k,clearDelayTimeouts:Tt,setProps:L,setContent:V,show:ue,hide:we,hideWithInteractivity:Qe,enable:Xe,disable:hn,unmount:Wt,destroy:Do};if(!t.render)return process.env.NODE_ENV!=="production"&&sc(!0,"render() function has not been supplied."),v;var _=t.render(v),C=_.popper,D=_.onUpdate;C.setAttribute("data-tippy-root",""),C.id="tippy-"+v.id,v.popper=C,n._tippy=v,C._tippy=v;var B=k.map(function(x){return x.fn(v)}),A=n.hasAttribute("aria-expanded");return en(),j(),N(),M("onCreate",[v]),t.showOnCreate&&ke(),C.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),C.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&ce().addEventListener("mousemove",m)}),v;function $(){var x=v.props.touch;return Array.isArray(x)?x:[x,0]}function J(){return $()[0]==="hold"}function te(){var x;return!!((x=v.props.render)!=null&&x.$$tippy)}function de(){return g||n}function ce(){var x=de().parentNode;return x?eC(x):document}function re(){return lc(C)}function oe(x){return v.state.isMounted&&!v.state.isVisible||Nn.isTouch||u&&u.type==="focus"?0:hl(v.props.delay,x?0:1,Gt.delay)}function N(x){x===void 0&&(x=!1),C.style.pointerEvents=v.props.interactive&&!x?"":"none",C.style.zIndex=""+v.props.zIndex}function M(x,W,ne){if(ne===void 0&&(ne=!0),B.forEach(function(be){be[x]&&be[x].apply(be,W)}),ne){var Ce;(Ce=v.props)[x].apply(Ce,W)}}function z(){var x=v.props.aria;if(x.content){var W="aria-"+x.content,ne=C.id,Ce=so(v.props.triggerTarget||n);Ce.forEach(function(be){var ot=be.getAttribute(W);if(v.state.isVisible)be.setAttribute(W,ot?ot+" "+ne:ne);else{var Ot=ot&&ot.replace(ne,"").trim();Ot?be.setAttribute(W,Ot):be.removeAttribute(W)}})}}function j(){if(!(A||!v.props.aria.expanded)){var x=so(v.props.triggerTarget||n);x.forEach(function(W){v.props.interactive?W.setAttribute("aria-expanded",v.state.isVisible&&W===de()?"true":"false"):W.removeAttribute("aria-expanded")})}}function Q(){ce().removeEventListener("mousemove",m),Ji=Ji.filter(function(x){return x!==m})}function fe(x){if(!(Nn.isTouch&&(c||x.type==="mousedown"))){var W=x.composedPath&&x.composedPath()[0]||x.target;if(!(v.props.interactive&&lp(C,W))){if(so(v.props.triggerTarget||n).some(function(ne){return lp(ne,W)})){if(Nn.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else M("onClickOutside",[v,x]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||Fe())}}}function Se(){c=!0}function rt(){c=!1}function xe(){var x=ce();x.addEventListener("mousedown",fe,!0),x.addEventListener("touchend",fe,Tr),x.addEventListener("touchstart",rt,Tr),x.addEventListener("touchmove",Se,Tr)}function Fe(){var x=ce();x.removeEventListener("mousedown",fe,!0),x.removeEventListener("touchend",fe,Tr),x.removeEventListener("touchstart",rt,Tr),x.removeEventListener("touchmove",Se,Tr)}function Ht(x,W){Qt(x,function(){!v.state.isVisible&&C.parentNode&&C.parentNode.contains(C)&&W()})}function dt(x,W){Qt(x,W)}function Qt(x,W){var ne=re().box;function Ce(be){be.target===ne&&(gl(ne,"remove",Ce),W())}if(x===0)return W();gl(ne,"remove",p),gl(ne,"add",Ce),p=Ce}function ut(x,W,ne){ne===void 0&&(ne=!1);var Ce=so(v.props.triggerTarget||n);Ce.forEach(function(be){be.addEventListener(x,W,ne),h.push({node:be,eventType:x,handler:W,options:ne})})}function en(){J()&&(ut("touchstart",pn,{passive:!0}),ut("touchend",fn,{passive:!0})),G0(v.props.trigger).forEach(function(x){if(x!=="manual")switch(ut(x,pn),x){case"mouseenter":ut("mouseleave",fn);break;case"focus":ut(sC?"focusout":"blur",le);break;case"focusin":ut("focusout",le);break}})}function kn(){h.forEach(function(x){var W=x.node,ne=x.eventType,Ce=x.handler,be=x.options;W.removeEventListener(ne,Ce,be)}),h=[]}function pn(x){var W,ne=!1;if(!(!v.state.isEnabled||Lt(x)||a)){var Ce=((W=u)==null?void 0:W.type)==="focus";u=x,g=x.currentTarget,j(),!v.state.isVisible&&X0(x)&&Ji.forEach(function(be){return be(x)}),x.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||s)&&v.props.hideOnClick!==!1&&v.state.isVisible?ne=!0:ke(x),x.type==="click"&&(s=!ne),ne&&!Ce&&Nt(x)}}function Ut(x){var W=x.target,ne=de().contains(W)||C.contains(W);if(!(x.type==="mousemove"&&ne)){var Ce=Re().concat(C).map(function(be){var ot,Ot=be._tippy,Zn=(ot=Ot.popperInstance)==null?void 0:ot.state;return Zn?{popperRect:be.getBoundingClientRect(),popperState:Zn,props:t}:null}).filter(Boolean);tC(Ce,x)&&(Q(),Nt(x))}}function fn(x){var W=Lt(x)||v.props.trigger.indexOf("click")>=0&&s;if(!W){if(v.props.interactive){v.hideWithInteractivity(x);return}Nt(x)}}function le(x){v.props.trigger.indexOf("focusin")<0&&x.target!==de()||v.props.interactive&&x.relatedTarget&&C.contains(x.relatedTarget)||Nt(x)}function Lt(x){return Nn.isTouch?J()!==x.type.indexOf("touch")>=0:!1}function vt(){Z();var x=v.props,W=x.popperOptions,ne=x.placement,Ce=x.offset,be=x.getReferenceClientRect,ot=x.moveTransition,Ot=te()?lc(C).arrow:null,Zn=be?{getBoundingClientRect:be,contextElement:be.contextElement||de()}:n,Io={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(T){var P=T.state;if(te()){var se=re(),Ue=se.box;["placement","reference-hidden","escaped"].forEach(function(ze){ze==="placement"?Ue.setAttribute("data-placement",P.placement):P.attributes.popper["data-popper-"+ze]?Ue.setAttribute("data-"+ze,""):Ue.removeAttribute("data-"+ze)}),P.attributes.popper={}}}},Pt=[{name:"offset",options:{offset:Ce}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ot}},Io];te()&&Ot&&Pt.push({name:"arrow",options:{element:Ot,padding:3}}),Pt.push.apply(Pt,(W==null?void 0:W.modifiers)||[]),v.popperInstance=H0(Zn,C,Object.assign({},W,{placement:ne,onFirstUpdate:f,modifiers:Pt}))}function Z(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function xt(){var x=v.props.appendTo,W,ne=de();v.props.interactive&&x===Em||x==="parent"?W=ne.parentNode:W=Cm(x,[ne]),W.contains(C)||W.appendChild(C),v.state.isMounted=!0,vt(),process.env.NODE_ENV!=="production"&&Wn(v.props.interactive&&x===Gt.appendTo&&ne.nextElementSibling!==C,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
102
102
|
|
|
103
103
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
104
104
|
|
|
105
105
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
106
106
|
|
|
107
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Re(){return zs(C.querySelectorAll("[data-tippy-root]"))}function ke(x){v.clearDelayTimeouts(),x&&M("onTrigger",[v,x]),xe();var W=oe(!0),ne=$(),Ce=ne[0],be=ne[1];Nn.isTouch&&Ce==="hold"&&be&&(W=be),W?r=setTimeout(function(){v.show()},W):v.show()}function Nt(x){if(v.clearDelayTimeouts(),M("onUntrigger",[v,x]),!v.state.isVisible){Fe();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(x.type)>=0&&s)){var W=oe(!1);W?o=setTimeout(function(){v.state.isVisible&&v.hide()},W):i=requestAnimationFrame(function(){v.hide()})}}function Xe(){v.state.isEnabled=!0}function hn(){v.hide(),v.state.isEnabled=!1}function Tt(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function L(x){if(process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("setProps")),!v.state.isDestroyed){M("onBeforeUpdate",[v,x]),kn();var W=v.props,ne=up(n,Object.assign({},W,sp(x),{ignoreAttributes:!0}));v.props=ne,en(),W.interactiveDebounce!==ne.interactiveDebounce&&(Q(),m=op(Ut,ne.interactiveDebounce)),W.triggerTarget&&!ne.triggerTarget?so(W.triggerTarget).forEach(function(Ce){Ce.removeAttribute("aria-expanded")}):ne.triggerTarget&&n.removeAttribute("aria-expanded"),j(),N(),D&&D(W,ne),v.popperInstance&&(vt(),Re().forEach(function(Ce){requestAnimationFrame(Ce._tippy.popperInstance.forceUpdate)})),M("onAfterUpdate",[v,x])}}function V(x){v.setProps({content:x})}function ue(){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("show"));var x=v.state.isVisible,W=v.state.isDestroyed,ne=!v.state.isEnabled,Ce=Nn.isTouch&&!v.props.touch,be=hl(v.props.duration,0,Gt.duration);if(!(x||W||ne||Ce)&&!de().hasAttribute("disabled")&&(M("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,te()&&(C.style.visibility="visible"),N(),xe(),v.state.isMounted||(C.style.transition="none"),te()){var ot=re(),Ot=ot.box,Zn=ot.content;ml([Ot,Zn],0)}f=function(){var Pt;if(!(!v.state.isVisible||d)){if(d=!0,C.offsetHeight,C.style.transition=v.props.moveTransition,te()&&v.props.animation){var w=re(),T=w.box,P=w.content;ml([T,P],be),ap([T,P],"visible")}z(),j(),ip(bl,v),(Pt=v.popperInstance)==null||Pt.forceUpdate(),M("onMount",[v]),v.props.animation&&te()&&dt(be,function(){v.state.isShown=!0,M("onShown",[v])})}},xt()}}function we(){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("hide"));var x=!v.state.isVisible,W=v.state.isDestroyed,ne=!v.state.isEnabled,Ce=hl(v.props.duration,1,Gt.duration);if(!(x||W||ne)&&(M("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,d=!1,s=!1,te()&&(C.style.visibility="hidden"),Q(),Fe(),N(!0),te()){var be=re(),ot=be.box,Ot=be.content;v.props.animation&&(ml([ot,Ot],Ce),ap([ot,Ot],"hidden"))}z(),j(),v.props.animation?te()&&Ht(Ce,v.unmount):v.unmount()}}function Qe(x){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("hideWithInteractivity")),ce().addEventListener("mousemove",m),ip(Ji,m),m(x)}function Wt(){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("unmount")),v.state.isVisible&&v.hide(),v.state.isMounted&&(Z(),Re().forEach(function(x){x._tippy.unmount()}),C.parentNode&&C.parentNode.removeChild(C),bl=bl.filter(function(x){return x!==v}),v.state.isMounted=!1,M("onHidden",[v]))}function Do(){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("destroy")),!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),kn(),delete n._tippy,v.state.isDestroyed=!0,M("onDestroy",[v]))}}function In(n,e){e===void 0&&(e={});var t=Gt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(
|
|
107
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Re(){return zs(C.querySelectorAll("[data-tippy-root]"))}function ke(x){v.clearDelayTimeouts(),x&&M("onTrigger",[v,x]),xe();var W=oe(!0),ne=$(),Ce=ne[0],be=ne[1];Nn.isTouch&&Ce==="hold"&&be&&(W=be),W?r=setTimeout(function(){v.show()},W):v.show()}function Nt(x){if(v.clearDelayTimeouts(),M("onUntrigger",[v,x]),!v.state.isVisible){Fe();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(x.type)>=0&&s)){var W=oe(!1);W?o=setTimeout(function(){v.state.isVisible&&v.hide()},W):i=requestAnimationFrame(function(){v.hide()})}}function Xe(){v.state.isEnabled=!0}function hn(){v.hide(),v.state.isEnabled=!1}function Tt(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function L(x){if(process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("setProps")),!v.state.isDestroyed){M("onBeforeUpdate",[v,x]),kn();var W=v.props,ne=up(n,Object.assign({},W,sp(x),{ignoreAttributes:!0}));v.props=ne,en(),W.interactiveDebounce!==ne.interactiveDebounce&&(Q(),m=op(Ut,ne.interactiveDebounce)),W.triggerTarget&&!ne.triggerTarget?so(W.triggerTarget).forEach(function(Ce){Ce.removeAttribute("aria-expanded")}):ne.triggerTarget&&n.removeAttribute("aria-expanded"),j(),N(),D&&D(W,ne),v.popperInstance&&(vt(),Re().forEach(function(Ce){requestAnimationFrame(Ce._tippy.popperInstance.forceUpdate)})),M("onAfterUpdate",[v,x])}}function V(x){v.setProps({content:x})}function ue(){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("show"));var x=v.state.isVisible,W=v.state.isDestroyed,ne=!v.state.isEnabled,Ce=Nn.isTouch&&!v.props.touch,be=hl(v.props.duration,0,Gt.duration);if(!(x||W||ne||Ce)&&!de().hasAttribute("disabled")&&(M("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,te()&&(C.style.visibility="visible"),N(),xe(),v.state.isMounted||(C.style.transition="none"),te()){var ot=re(),Ot=ot.box,Zn=ot.content;ml([Ot,Zn],0)}f=function(){var Pt;if(!(!v.state.isVisible||d)){if(d=!0,C.offsetHeight,C.style.transition=v.props.moveTransition,te()&&v.props.animation){var w=re(),T=w.box,P=w.content;ml([T,P],be),ap([T,P],"visible")}z(),j(),ip(bl,v),(Pt=v.popperInstance)==null||Pt.forceUpdate(),M("onMount",[v]),v.props.animation&&te()&&dt(be,function(){v.state.isShown=!0,M("onShown",[v])})}},xt()}}function we(){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("hide"));var x=!v.state.isVisible,W=v.state.isDestroyed,ne=!v.state.isEnabled,Ce=hl(v.props.duration,1,Gt.duration);if(!(x||W||ne)&&(M("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,d=!1,s=!1,te()&&(C.style.visibility="hidden"),Q(),Fe(),N(!0),te()){var be=re(),ot=be.box,Ot=be.content;v.props.animation&&(ml([ot,Ot],Ce),ap([ot,Ot],"hidden"))}z(),j(),v.props.animation?te()&&Ht(Ce,v.unmount):v.unmount()}}function Qe(x){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("hideWithInteractivity")),ce().addEventListener("mousemove",m),ip(Ji,m),m(x)}function Wt(){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("unmount")),v.state.isVisible&&v.hide(),v.state.isMounted&&(Z(),Re().forEach(function(x){x._tippy.unmount()}),C.parentNode&&C.parentNode.removeChild(C),bl=bl.filter(function(x){return x!==v}),v.state.isMounted=!1,M("onHidden",[v]))}function Do(){process.env.NODE_ENV!=="production"&&Wn(v.state.isDestroyed,to("destroy")),!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),kn(),delete n._tippy,v.state.isDestroyed=!0,M("onDestroy",[v]))}}function In(n,e){e===void 0&&(e={});var t=Gt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(cC(n),Tm(e,t)),oC();var r=Object.assign({},e,{plugins:t}),o=Q0(n);if(process.env.NODE_ENV!=="production"){var i=vi(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.",`
|
|
108
108
|
|
|
109
109
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
110
110
|
|
|
111
111
|
`,`1) content: element.innerHTML
|
|
112
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(c,d){var u=d&&mC(d,r);return u&&c.push(u),c},[]);return vi(n)?a[0]:a}In.defaultProps=Gt;In.setDefaultProps=uC;In.currentInput=Nn;Object.assign({},um,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});In.setDefaultProps({render:Om});class gC{constructor({editor:e,element:t,view:r,tippyOptions:o={},updateDelay:i=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:c,from:d,to:u})=>{const{doc:p,selection:f}=c,{empty:h}=f,m=!p.textBetween(d,u).length&&Aa(c.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||h||m||!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 c;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,c)=>{const d=!(c!=null&&c.selection.eq(a.state.selection)),u=!(c!=null&&c.doc.eq(a.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,d,u,c)},this.updateDelay))},this.updateHandler=(a,c,d,u)=>{var p,f,h;const{state:m,composing:g}=a,{selection:b}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:k}=b,E=Math.min(...k.map(C=>C.$from.pos)),v=Math.max(...k.map(C=>C.$to.pos));if(!((p=this.shouldShow)===null||p===void 0?void 0:p.call(this,{editor:this.editor,element:this.element,view:a,state:m,oldState:u,from:E,to:v}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(am(m.selection)){let C=a.nodeDOM(E);if(C){const D=C.dataset.nodeViewWrapper?C:C.querySelector("[data-node-view-wrapper]");if(D&&(C=D.firstChild),C)return C.getBoundingClientRect()}}return lm(a,E,v)})}),this.show()},this.editor=e,this.element=t,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,t=!!e.parentElement;this.tippy||!t||(this.tippy=In(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,t){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!(t!=null&&t.selection.eq(e.state.selection)),s=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,i,s,t)}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,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Mm=n=>new Te({key:typeof n.pluginKey=="string"?new $e(n.pluginKey):n.pluginKey,view:e=>new gC({view:e,...n})});Ae.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Mm({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class bC{getTextContent(e){return im(e,{textSerializers:jc(this.editor.schema)})}constructor({editor:e,element:t,view:r,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:c}=a,{$anchor:d,empty:u}=c,p=d.depth===1,f=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!s.hasFocus()||!u||!p||!f||!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!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||(s==null?void 0:s.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=t,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,t=!!e.parentElement;this.tippy||!t||(this.tippy=In(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,t){var r,o,i;const{state:s}=e,{doc:a,selection:c}=s,{from:d,to:u}=c;if(t&&t.doc.eq(a)&&t.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:t}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:((i=this.tippyOptions)===null||i===void 0?void 0:i.getReferenceClientRect)||(()=>lm(e,d,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,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Am=n=>new Te({key:typeof n.pluginKey=="string"?new $e(n.pluginKey):n.pluginKey,view:e=>new bC({view:e,...n})});Ae.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Am({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const yC=l.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(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:o,pluginKey:i,shouldShow:s,tippyOptions:a}=n;o.registerPlugin(Mm({updateDelay:r,editor:o,element:t.value,pluginKey:i,shouldShow:s,tippyOptions:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=n;o.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function hp(n){return l.customRef((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class vC extends Dn{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=hp(this.view.state),this.reactiveExtensionStorage=hp(this.extensionStorage),this.on("beforeTransaction",({nextState:t})=>{this.reactiveState.value=t,this.reactiveExtensionStorage.value=this.extensionStorage}),l.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,t){const r=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}}const kC=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=l.ref(),t=l.getCurrentInstance();return l.watchEffect(()=>{const r=n.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const o=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=t.ctx._,t&&(r.appContext={...t.appContext,provides:t.provides}),r.setOptions({element:o}),r.createNodeViews()})}),l.onBeforeUnmount(()=>{const r=n.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return l.h("div",{ref:n=>{this.rootEl=n}})}}),wC=l.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:i,shouldShow:s}=n;o.registerPlugin(Am({pluginKey:r,editor:o,element:t.value,tippyOptions:i,shouldShow:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=n;o.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),Xn=l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),ad=l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,e;return l.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))}}),EC=(n={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new vC(n)}),l.onBeforeUnmount(()=>{var t,r,o;const i=(t=e.value)===null||t===void 0?void 0:t.options.element,s=i==null?void 0:i.cloneNode(!0);(r=i==null?void 0:i.parentNode)===null||r===void 0||r.replaceChild(s,i),(o=e.value)===null||o===void 0||o.destroy()}),e};class Rm{constructor(e,{props:t={},editor:r}){this.editor=r,this.component=l.markRaw(e),this.el=document.createElement("div"),this.props=l.reactive(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t,r,o;return!((t=(e=this.renderedComponent.vNode)===null||e===void 0?void 0:e.component)===null||t===void 0)&&t.exposed?this.renderedComponent.vNode.component.exposed:(o=(r=this.renderedComponent.vNode)===null||r===void 0?void 0:r.component)===null||o===void 0?void 0:o.proxy}renderComponent(){let e=l.h(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&l.render(e,this.el),{vNode:e,destroy:()=>{this.el&&l.render(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([t,r])=>{this.props[t]=r}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const ct={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class CC extends BE{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()},t=this.onDragStart.bind(this);this.decorationClasses=l.ref(this.getDecorationClasses());const r=l.defineComponent({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:o=>{var i,s;return l.provide("onDragStart",t),l.provide("decorationClasses",this.decorationClasses),(s=(i=this.component).setup)===null||s===void 0?void 0:s.call(i,o,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new Rm(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:e,to:t}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&t>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,r){const o=i=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(i)};if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=r,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:t,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>o({node:e,decorations:t,innerDecorations:r})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===t&&this.innerDecorations===r||(this.node=e,this.decorations=t,this.innerDecorations=r,o({node:e,decorations:t,innerDecorations:r})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function yn(n,e){return t=>{if(!t.editor.contentComponent)return{};const r=typeof n=="function"&&"__vccOpts"in n?n.__vccOpts:n;return new CC(r,t,e)}}const _C=/^\s*>\s$/,Dm=Ke.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[wo({find:_C,type:this.type})]}}),SC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,NC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,TC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,OC=ln.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Kr({find:SC,type:this.type}),Kr({find:NC,type:this.type})]},addPasteRules(){return[vr({find:xC,type:this.type}),vr({find:TC,type:this.type})]}}),MC="listItem",mp="textStyle",gp=/^\s*([-+*])\s$/,AC=Ke.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:n}){return["ul",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(MC,this.editor.getAttributes(mp)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=wo({find:gp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=wo({find:gp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(mp),editor:this.editor})),[n]}}),RC=/(^|[^`])`([^`]+)`(?!`)/,DC=/(^|[^`])`([^`]+)`(?!`)/g,IC=ln.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Kr({find:RC,type:this.type})]},addPasteRules(){return[vr({find:DC,type:this.type})]}}),BC=/^```([a-z]+)?[\s\n]$/,LC=/^~~~([a-z]+)?[\s\n]$/,Im=Ke.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:n=>{var e;const{languageClassPrefix:t}=this.options,i=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(t)).map(s=>s.replace(t,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",_e(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:o}=t;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
113
|
-
|
|
114
|
-
`);return!i||!s?!1:n.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:o,empty:i}=t;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)?n.commands.command(({tr:d})=>(d.setSelection(ee.near(r.resolve(a))),!0)):n.commands.exitCode()}}},addInputRules(){return[rc({find:
|
|
115
|
-
`));return s.replaceSelectionWith(this.type.create({language:i},c)),s.selection.$from.parent.type!==this.type&&s.setSelection(Y.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),
|
|
116
|
-
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:o,storedMarks:i}=t;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,c=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&s){const p=c.filter(f=>a.includes(f.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Bm=Ke.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,_e(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>rc({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Vs=200,at=function(){};at.prototype.append=function(e){return e.length?(e=at.from(e),!this.length&&e||e.length<Vs&&this.leafAppend(e)||this.length<Vs&&e.leafPrepend(this)||this.appendInner(e)):this};at.prototype.prepend=function(e){return e.length?at.from(e).append(this):this};at.prototype.appendInner=function(e){return new YC(this,e)};at.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?at.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};at.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};at.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};at.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},t,r),o};at.from=function(e){return e instanceof at?e:e&&e.length?new Lm(e):at.empty};var Lm=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={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 c=i;c<s;c++)if(o(this.values[c],a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var c=i-1;c>=s;c--)if(o(this.values[c],a+c)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Vs)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Vs)return new e(o.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(at);at.empty=new Lm([]);var YC=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.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}(at);const XC=500;class gn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){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;t&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,c,d=[],u=[];return this.items.forEach((p,f)=>{if(!p.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(p);return}if(o){u.push(new _n(p.map));let h=p.step.map(o.slice(i)),m;h&&s.maybeStep(h).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new _n(m,void 0,void 0,d.length+u.length))),i--,m&&o.appendMap(m,i)}else s.maybeStep(p.step);if(p.selection)return a=o?p.selection.map(o.slice(i)):p.selection,c=new gn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:a}}addTransform(e,t,r,o){let i=[],s=this.eventCount,a=this.items,c=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let p=e.steps[u].invert(e.docs[u]),f=new _n(e.mapping.maps[u],p,t),h;(h=c&&c.merge(f))&&(f=h,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),t&&(s++,t=void 0),o||(c=f)}let d=s-r.depth;return d>QC&&(a=ZC(a,d),s-=d),new gn(a.append(i),s)}remapping(e,t){let r=new fo;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,t),r}addMaps(e){return this.eventCount==0?this:new gn(this.items.append(e.map(t=>new _n(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-t),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let c=t;this.items.forEach(f=>{let h=i.getMirror(--c);if(h==null)return;s=Math.min(s,h);let m=i.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),b=f.selection&&f.selection.map(i.slice(c+1,h));b&&a++,r.push(new _n(m,g,b))}else r.push(new _n(m))},o);let d=[];for(let f=t;f<s;f++)d.push(new _n(i.maps[f]));let u=this.items.slice(0,o).append(d).append(r),p=new gn(u,a);return p.emptyItemCount()>XC&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.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 c=s.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=s.selection&&s.selection.map(t.slice(r));u&&i++;let p=new _n(d.invert(),c,u),f,h=o.length-1;(f=o.length&&o[h].merge(p))?o[h]=f:o.push(p)}}else s.map&&r--},this.items.length,0),new gn(at.from(o.reverse()),i)}}gn.empty=new gn(at.empty,0);function ZC(n,e){let t;return n.forEach((r,o)=>{if(r.selection&&e--==0)return t=o,!1}),n.slice(t)}class _n{constructor(e,t,r,o){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new _n(t.getMap().invert(),t,this.selection)}}}class or{constructor(e,t,r,o,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const QC=20;function e_(n,e,t,r){let o=t.getMeta(Fr),i;if(o)return o.historyState;t.getMeta(r_)&&(n=new or(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Fr))return s.getMeta(Fr).redo?new or(n.done.addTransform(t,void 0,r,Es(e)),n.undone,bp(t.mapping.maps),n.prevTime,n.prevComposition):new or(n.done,n.undone.addTransform(t,void 0,r,Es(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),c=n.prevTime==0||!s&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!t_(t,n.prevRanges)),d=s?yl(n.prevRanges,t.mapping):bp(t.mapping.maps);return new or(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Es(e)),gn.empty,d,t.time,a??n.prevComposition)}else return(i=t.getMeta("rebased"))?new or(n.done.rebased(t,i),n.undone.rebased(t,i),yl(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new or(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),yl(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function t_(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(t=!0)}),t}function bp(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,o,i,s)=>e.push(i,s));return e}function yl(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let o=e.map(n[r],1),i=e.map(n[r+1],-1);o<=i&&t.push(o,i)}return t}function n_(n,e,t){let r=Es(e),o=Fr.get(e).spec.config,i=(t?n.undone:n.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(t?n.done:n.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),c=new or(t?a:i.remaining,t?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Fr,{redo:t,historyState:c})}let vl=!1,yp=null;function Es(n){let e=n.plugins;if(yp!=e){vl=!1,yp=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){vl=!0;break}}return vl}const Fr=new $e("history"),r_=new $e("closeHistory");function o_(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Te({key:Fr,state:{init(){return new or(gn.empty,gn.empty,null,0,-1)},apply(e,t,r){return e_(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,o=r=="historyUndo"?$m:r=="historyRedo"?Fm:null;return o?(t.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function Pm(n,e){return(t,r)=>{let o=Fr.getState(t);if(!o||(n?o.undone:o.done).eventCount==0)return!1;if(r){let i=n_(o,t,n);i&&r(e?i.scrollIntoView():i)}return!0}}const $m=Pm(!1,!0),Fm=Pm(!0,!0),i_=Ae.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>$m(n,e),redo:()=>({state:n,dispatch:e})=>Fm(n,e)}},addProseMirrorPlugins(){return[o_(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()}}}),zm=Ke.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",_e(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{selection:t}=e,{$from:r,$to:o}=t,i=n();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):am(t)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:s,dispatch:a})=>{var c;if(a){const{$to:d}=s.selection,u=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?s.setSelection(Y.create(s.doc,d.pos+1)):d.nodeAfter.isBlock?s.setSelection(G.create(s.doc,d.pos)):s.setSelection(Y.create(s.doc,d.pos));else{const p=(c=d.parent.type.contentMatch.defaultType)===null||c===void 0?void 0:c.create();p&&(s.insert(u,p),s.setSelection(Y.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Zc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),s_=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,a_=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,l_=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,c_=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,d_=ln.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Kr({find:s_,type:this.type}),Kr({find:l_,type:this.type})]},addPasteRules(){return[vr({find:a_,type:this.type}),vr({find:c_,type:this.type})]}}),u_=Ke.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",_e(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),p_="listItem",vp="textStyle",kp=/^(\d+)\.\s$/,f_=Ke.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:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",_e(this.options.HTMLAttributes,t),0]:["ol",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(p_,this.editor.getAttributes(vp)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=wo({find:kp,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=wo({find:kp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(vp)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),Vm=Ke.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),h_=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,m_=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,g_=ln.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Kr({find:h_,type:this.type})]},addPasteRules(){return[vr({find:m_,type:this.type})]}}),b_=Ke.create({name:"text",group:"inline"}),y_=Ae.create({name:"starterKit",addExtensions(){var n,e,t,r,o,i,s,a,c,d,u,p,f,h,m,g,b,y;const k=[];return this.options.bold!==!1&&k.push(OC.configure((n=this.options)===null||n===void 0?void 0:n.bold)),this.options.blockquote!==!1&&k.push(Dm.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&k.push(AC.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&k.push(IC.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&k.push(Im.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&k.push(PC.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&k.push(zC.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&k.push(jC.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&k.push(JC.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&k.push(Bm.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&k.push(i_.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&k.push(zm.configure((p=this.options)===null||p===void 0?void 0:p.horizontalRule)),this.options.italic!==!1&&k.push(d_.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&k.push(u_.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&k.push(f_.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&k.push(Vm.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&k.push(g_.configure((b=this.options)===null||b===void 0?void 0:b.strike)),this.options.text!==!1&&k.push(b_.configure((y=this.options)===null||y===void 0?void 0:y.text)),k}}),v_=n=>{if(!n.children.length)return;const e=n.querySelectorAll("span");e&&e.forEach(t=>{var r,o;const i=t.getAttribute("style"),s=(o=(r=t.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||o===void 0?void 0:o.getAttribute("style");t.setAttribute("style",`${s};${i}`)})},k_=ln.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&v_(n),{}):!1}]},renderHTML({HTMLAttributes:n}){return["span",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:n})=>{const{selection:e}=n;return n.doc.nodesBetween(e.from,e.to,(t,r)=>{if(t.isTextblock)return!0;t.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(i=>!!i))||n.removeMark(r,r+t.nodeSize,this.type)}),!0}}}}),ie=l.defineComponent({__name:"OIcon",props:{name:{type:String,default:""},color:{type:String,default:""},small:{type:Boolean,default:!1}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("span",{class:l.normalizeClass(["o-icon",{small:n.small}]),style:l.normalizeStyle({color:n.color})},[l.createElementVNode("i",{class:l.normalizeClass(["yiitip-icon",`icon-${n.name}`])},null,2)],6))}}),wp={isoName:"en-us",nativeName:"English (US)",diagram:{name:"Text Diagram",flow:"Flow Diagram",sequence:"Sequence Diagram",class:"Class Diagram",state:"State Diagram",gantt:"Gantt Diagram",tips:"Generation of diagram and chart from text in a similar manner as markdown"},editor:{add:"Add",addMore:"Add More",url:"URL",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",textFormat:"More text format",list:"List",unorderedList:"Unordered List",orderedList:"Ordered List",todoList:"Todo List",subscript:"Subscript",superscript:"Superscript",hyperlink:"Hyperlink",toggleFullscreen:"Toggle Fullscreen",quote:"Quote",left:"Left align",center:"Center align",right:"Right align",justify:"Justify align",print:"Print",outdent:"Decrease indentation",indent:"Increase indentation",indentDropdown:"Indent",removeFormat:"Remove formatting",formatting:"Formatting",fontFamily:"Font Family",defaultFont:"Default Font",fontSize:"Font Size",align:"Align",hr:"Insert Horizontal Rule",undo:"Undo",redo:"Redo",heading:"Heading & Paragraph",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",headings:"Headings",paragraph:"Paragraph",code:"Code",codeBlock:"Code Block",size1:"Very small",size2:"A bit small",size3:"Normal",size4:"Medium-large",size5:"Big",size6:"Very big",size7:"Maximum",viewSource:"View Source",textColor:"Text Color",highlightColor:"Highlight Color",default:"Default",lineHeight:"Line Height",blockquote:"Blockquote",table:"Table",photo:"Insert Photo",video:"Insert Video",formula:"Formula",inlineFormula:"Inline",blockFormula:"Block",thirdPartyService:"Third party services",horizontal:"Horizontal Rule",callout:"Callout",emoji:"Emoji",defaultColor:"Default Color",noColor:"No Color",delete:"Delete",duplicate:"Duplicate"},label:{ai:"AI",cancel:"Cancel",color:"Color",edit:"Edit",link:"Link",linkAddress:"Link Address",ok:"Ok",preview:"Preview",template:"Template",example:"Example",submit:"Submit",settings:"Settings",remove:"Remove",replace:"Replace",help:"Help",back:"Back",styles:"Styles",basic:"Basic",basicBlocks:"Basic Blocks",common:"Common",media:"Media",image:"Image",video:"Video",model:"Model",modelViewer:"Model Viewer",more:"More",toc:"Table of Contents",untitled:"Untitled",typeForCommands:"Type '/' for commands",empty:"Empty",emptyTips:"Press Enter to continue with an empty note, or select following",copy:"Copy",cut:"Cut",search:"Search"},table:{cellBackground:"Cell Background",insert:"Insert Table",remove:"Remove Table",addColumn:"Add Column",removeColumn:"Remove Column",addRow:"Add Row",removeRow:"Remove Row",merge:"Merge/Unmerge Cells"},image:{preferences:"Image Preferences",ratio:"Ratio",size:"Size",width:"Width",height:"Height",src:"Image Source",caption:"Caption",link:"Link",lockAspectRatio:"Lock aspect ratio",unlockAspectRatio:"Unlock aspect ratio",original:"Original",small:"Small",medium:"Medium",large:"Large"},embed:{video:"Video",map:"Map",design:"Design",develop:"Develop",data:"Data",others:"Others",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}},w_={isoName:"pl",nativeName:"Polski",diagram:{name:"Schemat tekstowy",flow:"Schemat przepływu",sequence:"Schemat sekwencji",class:"Schemat klas",state:"Diagram stanu",gantt:"Diagram Gantta",tips:"Generowanie diagramu i wykresu z tekstu w podobny sposób jak markdown"},editor:{add:"Dodaj",addMore:"Dodaj więcej",url:"URL",bold:"Pogrubienie",italic:"Kursywa",strikethrough:"Przekreślenie",underline:"Podkreślenie",textFormat:"More text format",unorderedList:"Lista wypunktowana",orderedList:"Lista numerowana",list:"List",todoList:"Lista rzeczy do zrobienia",subscript:"Indeks dolny",superscript:"Indeks górny",hyperlink:"Hiperłącze",toggleFullscreen:"Przełącz na tryb pełnoekranowy",quote:"Zacytuj",left:"Wyrównaj do lewej",center:"Wyrównaj do środka",right:"Wyrównaj do prawej",justify:"Wyjustuj",print:"Drukuj",outdent:"Zmniejsz wcięcie",indent:"Zwiększ wcięcie",indentDropdown:"Wcięcie",removeFormat:"Usuń formatowanie",formatting:"Formatowanie",fontFamily:"Nazwa czcionki",defaultFont:"Domyślna czcionka",fontSize:"Rozmiar czcionki",align:"Wyrównanie",hr:"Wstaw poziomą linię",undo:"Cofnij",redo:"Przywróć",heading:"Heading & Paragraph",heading1:"Nagłówek 1",heading2:"Nagłówek 2",heading3:"Nagłówek 3",heading4:"Nagłówek 4",heading5:"Nagłówek 5",headings:"Nagłówki",paragraph:"Paragraf",code:"Kod",codeBlock:"Blok kodu",size1:"Bardzo mała",size2:"Mała",size3:"Normalna",size4:"Średnio-duża",size5:"Duża",size6:"Bardzo duża",size7:"Maksymalna",viewSource:"Pokaż źródło",textColor:"Kolor czcionki",highlightColor:"Kolor wyróżnienia",default:"Dymyślny",lineHeight:"Wysokość linii",blockquote:"Cytat",table:"Tabela",photo:"Wstaw obraz",video:"Insert Video",formula:"Formuła",inlineFormula:"Formuła w treści",blockFormula:"Blokowa formuła",thirdPartyService:"Third party services",horizontal:"Horizontal Rule",callout:"Callout",emoji:"Emoji",defaultColor:"Default Color",noColor:"No Color",delete:"Delete",duplicate:"Duplicate"},label:{ai:"AI",cancel:"Anuluj",edit:"Edycja",link:"Łącze",linkAddress:"Adres łącza",ok:"Ok",preview:"Podgląd",template:"Szablon",example:"Example",submit:"Submit",settings:"Settings",remove:"Remove",help:"Help",back:"Back",styles:"Styles",basic:"Basic",basicBlocks:"Basic Blocks",common:"Common",media:"Media",image:"Image",video:"Video",model:"Model",modelViewer:"Model Viewer",toc:"Table of Contents",untitled:"Untitled",typeForCommands:"Type '/' for commands",empty:"Empty",emptyTips:"Press Enter to continue with an empty note, or select following",copy:"Copy",cut:"Cut",search:"Search"},table:{cellBackground:"Cell Background",insert:"Insert Table",remove:"Remove Table",addColumn:"Add Column",removeColumn:"Remove Column",addRow:"Add Row",removeRow:"Remove Row",merge:"Merge/Unmerge Cells"},image:{preferences:"Preferencje obrazu",ratio:"Ratio",size:"Rozmiar",width:"Szerokość",height:"Wysokość",src:"Źródło obrazu",caption:"Nagłówek",link:"Łącze",lockAspectRatio:"Lock aspect ratio",unlockAspectRatio:"Unlock aspect ratio",original:"Original",small:"Small",medium:"Medium",large:"Large"},embed:{video:"Video",map:"Map",design:"Design",develop:"Develop",data:"Data",others:"Others",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}},E_={isoName:"pt-br",nativeName:"Português (BR)",diagram:{name:"Diagrama de Texto",flow:"Diagrama de Fluxo",sequence:"Diagrama de sequência",class:"Diagrama de Classe",state:"Diagrama de Estado",gantt:"Diagrama de Gantt",tips:"Geração de diagrama ou gráfico a partir de texto semelhante a markdown"},editor:{add:"Adicionar",addMore:"Adicione Mais",url:"URL",bold:"Negrito",italic:"Itálico",strikethrough:"Tachar",underline:"Sublinhado",textFormat:"Mais formatos de textos",list:"Lista",unorderedList:"Lista com Marcadores",orderedList:"Lista Numerada",todoList:"Lista de afazer",subscript:"Subscrito",superscript:"Sobrescrito",hyperlink:"Hyperlink",toggleFullscreen:"Alternar tela-cheia",quote:"Citação",left:"Alinhar à esquerda",center:"Alinhar ao centro",right:"Alinhar à direita",justify:"Justificar",print:"Imprimir",outdent:"Diminuir recuo",indent:"Aumentar recuo",indentDropdown:"Recuo",removeFormat:"Limpar formatação",formatting:"Formatação",fontFamily:"Fonte",defaultFont:"Fonte Padrão",fontSize:"Tamanho da fontee",align:"Alinhamento",hr:"Linha Horizontal",undo:"Desfazer",redo:"Refazer",heading:"Heading & Paragraph",heading1:"Título 1",heading2:"Título 2",heading3:"Título 3",heading4:"Título 4",heading5:"Título 5",headings:"Estilos de Parágrafo",paragraph:"Parágrafo",code:"Código",codeBlock:"Bloco de Código",size1:"Muito Pequeno",size2:"Pequeno",size3:"Normal",size4:"Médio",size5:"Grande",size6:"Enorme",size7:"Máximo",viewSource:"Código Fonte",textColor:"Cor do texto",highlightColor:"Cor do fundo",default:"Padrão",lineHeight:"Espaço entre linhas",blockquote:"Bloco de citação",table:"Tabela",photo:"Inserir Foto",video:"Insert Video",formula:"Fórmula",inlineFormula:"Linha",blockFormula:"Bloco",thirdPartyService:"Serviços de terceiros",horizontal:"Horizontal Rule",callout:"Callout",emoji:"Emoji",defaultColor:"Default Color",noColor:"No Color",delete:"Delete",duplicate:"Duplicate"},label:{ai:"AI",cancel:"Cancelar",edit:"Editar",link:"Link",linkAddress:"Endereço do Link",ok:"Ok",preview:"Pré Visualização",template:"Modelo",example:"Exemplo",submit:"Enviar",settings:"Configurações",remove:"Excluir",help:"Ajuda",back:"Voltar",styles:"Styles",basic:"Basic",basicBlocks:"Basic Blocks",common:"Common",media:"Media",image:"Image",video:"Video",model:"Model",modelViewer:"Model Viewer",toc:"Table of Contents",untitled:"Untitled",typeForCommands:"Type '/' for commands",empty:"Empty",emptyTips:"Press Enter to continue with an empty note, or select following",copy:"Copy",cut:"Cut",search:"Search"},table:{cellBackground:"Cell Background",insert:"Insert Table",remove:"Remove Table",addColumn:"Add Column",removeColumn:"Remove Column",addRow:"Add Row",removeRow:"Remove Row",merge:"Merge/Unmerge Cells"},image:{preferences:"Preferências da Imagem",ratio:"Ratio",size:"Tamanho",width:"Largura",height:"Altura",src:"Origem da imagem",caption:"Legenda",link:"Link",lockAspectRatio:"Bloquear proporção",unlockAspectRatio:"Desbloquear proporção",original:"Original",small:"Small",medium:"Medium",large:"Large"},embed:{video:"Vídeo",map:"Mapa",design:"Design",develop:"Desenvolvimento",data:"Dados",others:"Outros",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}},Ep={isoName:"zh-hans",nativeName:"简体中文",diagram:{name:"文本绘图",flow:"流程图",sequence:"时序图",class:"类图",state:"状态图",gantt:"甘特图",tips:"使用Markdown风格文本生成流程图、顺序图、类图、状态图和甘特图"},editor:{add:"添加",addMore:"添加更多",url:"URL",bold:"粗体",italic:"斜体",strikethrough:"删除线",underline:"下划线",textFormat:"更多格式",list:"列表",unorderedList:"无序列表",orderedList:"有序列表",todoList:"任务列表",subscript:"下标",superscript:"上标",hyperlink:"超链接",toggleFullscreen:"全屏切换",quote:"引号",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐",print:"打印",outdent:"减少缩进",indent:"增加缩进",indentDropdown:"缩进",removeFormat:"清除格式",formatting:"格式化",fontFamily:"字体",defaultFont:"默认字体",fontSize:"字体大小",align:"对齐方式",hr:"插入分割线",undo:"撤消",redo:"重做",heading:"标题与段落",heading1:"标题一",heading2:"标题二",heading3:"标题三",heading4:"标题四",heading5:"标题五",headings:"标题",paragraph:"正文",code:"代码",codeBlock:"代码块",size1:"非常小",size2:"比较小",size3:"正常",size4:"中等偏大",size5:"大",size6:"非常大",size7:"超级大",viewSource:"查看资料",textColor:"文字颜色",highlightColor:"背景颜色",default:"默认",lineHeight:"行高",blockquote:"引用",table:"表格",photo:"图片",video:"视频",formula:"数学公式",inlineFormula:"行内公式",blockFormula:"块级公式",thirdPartyService:"第三方服务",horizontal:"水平线",callout:"高亮块",emoji:"表情",defaultColor:"默认颜色",noColor:"无色",delete:"删除",duplicate:"创建副本"},label:{ai:"AI",cancel:"取消",color:"颜色",edit:"编辑",link:"链接",linkAddress:"链接地址",ok:"确定",preview:"预览",template:"模板",example:"示例",submit:"确定",settings:"设置",remove:"删除",replace:"替换",help:"帮助",back:"返回",styles:"样式",basic:"基础",basicBlocks:"基础块",common:"常用",media:"多媒体",image:"图片",video:"视频",model:"模型",modelViewer:"模型",more:"更多",toc:"目录",untitled:"未命名",typeForCommands:"输入 '/' 显示命令",empty:"空白页面",emptyTips:"按回车开始编辑,或从下方选择",copy:"复制",cut:"剪切",search:"搜索"},table:{cellBackground:"单元格背景色",insert:"插入表格",remove:"删除表格",addColumn:"添加列",removeColumn:"删除列",addRow:"添加行",removeRow:"删除行",merge:"合并/拆分 单元格"},image:{preferences:"图片设置",ratio:"比例",size:"尺寸",width:"宽度",height:"高度",src:"图片地址",caption:"图片说明",link:"链接",lockAspectRatio:"锁定长宽比",unlockAspectRatio:"解锁长宽比",original:"原始",small:"小",medium:"中",large:"大"},embed:{video:"视频",map:"地图",design:"设计",develop:"开发",data:"数据",others:"其它",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"优酷",iqiyi:"爱奇艺",bilibili:"Bilibili",qqvideo:"腾讯视频",google_map:"谷歌地图",amap:"高德地图",baidu_map:"百度",modao:"墨刀",lanhu:"蓝湖",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"金数据",iframe:"IFrame",linkTips:"链接或代码",linkWarning:"无效的链接"},link:{back:"返回主菜单",edit:"编辑链接",off:"取消链接",open:"打开链接",open_in_new_tab:"在新标签页打开"}},C_={isoName:"zh-hant",nativeName:"繁體中文",diagram:{name:"文本繪圖",flow:"流程圖",sequence:"時序圖",class:"類圖",state:"狀態圖",gantt:"甘特圖",tips:"使用Markdown風格文本生成流程圖、順序圖、類圖、狀態圖和甘特圖"},editor:{add:"添加",addMore:"添加更多",url:"URL",bold:"粗體",italic:"斜體",strikethrough:"刪除線",underline:"下劃線",textFormat:"更多格式",list:"列表",unorderedList:"無序列表",orderedList:"有序列表",todoList:"任務列表",subscript:"下標",superscript:"上標",hyperlink:"超鏈接",toggleFullscreen:"全屏切換",quote:"引號",left:"左對齊",center:"居中對齊",right:"右對齊",justify:"兩端對齊",print:"打印",outdent:"減少縮進",indent:"增加縮進",indentDropdown:"縮進",removeFormat:"清除格式",formatting:"格式化",fontFamily:"字體",defaultFont:"默認字體",fontSize:"字體大小",align:"對齊方式",hr:"插入分割線",undo:"撤消",redo:"重做",heading:"標題與段落",heading1:"標題一",heading2:"標題二",heading3:"標題三",heading4:"標題四",heading5:"標題五",headings:"標題",paragraph:"正文",code:"代碼",codeBlock:"代碼塊",size1:"非常小",size2:"比較小",size3:"正常",size4:"中等偏大",size5:"大",size6:"非常大",size7:"超級大",viewSource:"查看資料",textColor:"文字顏色",highlightColor:"背景顏色",default:"默認",lineHeight:"行高",blockquote:"引用",table:"表格",photo:"圖片",video:"視頻",formula:"數學公式",inlineFormula:"行內公式",blockFormula:"塊級公式",thirdPartyService:"第三方服務",horizontal:"水平線",callout:"高亮塊",emoji:"表情",defaultColor:"默認顏色",noColor:"無色",delete:"刪除",duplicate:"創建副本"},label:{ai:"AI",cancel:"取消",edit:"編輯",link:"鏈接",linkAddress:"鏈接地址",ok:"確定",preview:"預覽",template:"模板",example:"示例",submit:"確定",settings:"設置",remove:"刪除",help:"幫助",back:"返回",styles:"樣式",basic:"基础",basicBlocks:"基础块",common:"常用",media:"多媒體",image:"圖片",video:"視頻",model:"模型",modelViewer:"模型",toc:"目錄",untitled:"未命名",typeForCommands:"輸入 '/' 顯示命令",empty:"空白页面",emptyTips:"按回车开始编辑,或从下方选择",copy:"複製",cut:"剪切",search:"搜索"},table:{cellBackground:"單元格背景色",insert:"插入表格",remove:"刪除表格",addColumn:"添加列",removeColumn:"刪除列",addRow:"添加行",removeRow:"刪除行",merge:"合併/拆分 單元格"},image:{preferences:"圖片設置",ratio:"比例",size:"尺寸",width:"寬度",height:"高度",src:"圖片地址",caption:"圖片說明",link:"鏈接",lockAspectRatio:"鎖定長寬比",unlockAspectRatio:"解鎖長寬比",original:"原始",small:"小",medium:"中",large:"大"},embed:{video:"視頻",map:"地圖",design:"設計",develop:"開發",data:"數據",others:"其它",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"優酷",iqiyi:"愛奇藝",bilibili:"Bilibili",qqvideo:"騰訊視頻",google_map:"谷歌地圖",amap:"高德地圖",baidu_map:"百度",modao:"墨刀",lanhu:"藍湖",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"金數據",iframe:"IFrame",linkTips:"鏈接或代碼",linkWarning:"無效的鏈接"},link:{back:"返回主菜單",edit:"編輯鏈接",off:"取消鏈接",open:"打開鏈接",open_in_new_tab:"在新標籤頁打開"}},Hm={en:wp,"en-us":wp,pl:w_,"pt-br":E_,zh:Ep,"zh-hans":Ep,"zh-hant":C_},__="en",S_=Hm[__],x_=n=>Hm[n]||S_;function ve(){const n=l.inject("locale",{value:"en"}),e=l.computed(()=>x_(n.value));function t(r){return r.split(".").reduce((o,i)=>{if(o)return o[i]},e.value)}return{locale:n,message:e,tr:t}}function Bi(){const n=l.inject("darkMode",{value:!1}),e=l.computed(()=>n.value?"dark":"light");return{darkMode:n,theme:e}}function Pe(){function n(t,r,o={}){const i=t==null?void 0:t.chain().focus(),s=t==null?void 0:t.commands;e(s,i,r,o)}function e(t,r,o,i={}){switch(console.log("command",o,i),o){case"backColor":i.color?t.setHighlight({color:i.color}):t.unsetHighlight();break;case"blockquote":r.toggleBlockquote().run();break;case"bold":r.toggleBold().run();break;case"bulletList":r.toggleBulletList().run();break;case"callout":r.toggleCallout().run();break;case"clearFormat":r.unsetAllMarks().run();break;case"code":r.toggleCode().run();break;case"codeBlock":t.toggleCodeBlock({language:"bash"});break;case"content":t.insertContent(i.content);break;case"fontFamily":t.setFontFamily(i.fontFamily);break;case"foreColor":t.setColor(i.color);break;case"heading":r.toggleHeading(i).run();break;case"horizontalRule":r.setHorizontalRule().run();break;case"image":r.setImage({src:"init"}).run();break;case"imageUpdate":r.setImage(i).run();break;case"italic":r.toggleItalic().run();break;case"linkSet":r.extendMarkRange("link").setLink(i).run();break;case"linkUnset":r.extendMarkRange("link").unsetLink().run();break;case"orderedList":r.toggleOrderedList().run();break;case"paragraph":r.setParagraph().run();break;case"strike":r.toggleStrike().run();break;case"table":r.insertTable({rows:3,cols:3,withHeaderRow:!0}).run();break;case"tableAddColumn":r.addColumnAfter().run();break;case"tableAddRow":r.addRowAfter().run();break;case"tableCellAttribute":r.setCellAttribute(i.name,i.value).run();break;case"tableDeleteColumn":r.deleteColumn().run();break;case"tableDeleteRow":r.deleteRow().run();break;case"tableDelete":r.deleteTable().run();break;case"tableInsert":r.insertTable(i).run();break;case"tableMergeCells":r.mergeCells().run();break;case"tableSelectColumn":r.selectColumn(i.pos).run();break;case"tableSelectRow":r.selectRow(i.pos).run();break;case"tableSplitCell":r.splitCell().run();break;case"taskList":t.toggleTaskList();break;case"textAlign":r.setTextAlign(i.textAlign).run();break;case"underline":r.toggleUnderline().run();break;case"video":r.setVideo({src:"init"}).run()}}return{run:n,onCommand:e}}const _r=l.defineComponent({__name:"OTooltip",props:{placement:{type:String,default:"top"},trigger:{type:String,default:"mouseenter focus"}},setup(n){const e=n,{theme:t}=Bi(),r=l.ref(),o=l.ref(),i=l.ref();function s(){i.value=In(r.value,{appendTo:()=>document.body,animation:"perspective",content:o.value,duration:100,interactive:!0,placement:e.placement,trigger:e.trigger})}function a(){i.value.setProps({theme:t.value})}return l.watch(t,c=>{a()}),l.onMounted(()=>{s()}),(c,d)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"triggerRef",ref:r,"data-tippy-role":"tooltip"},[l.renderSlot(c.$slots,"trigger"),l.createElementVNode("div",{ref_key:"contentRef",ref:o,class:"tooltip-content"},[l.renderSlot(c.$slots,"default")],512)],512))}}),Me=l.defineComponent({__name:"OMenubarBtn",props:{icon:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},tooltip:{type:String,default:""},placement:{type:String,default:"top"},contentClass:{type:[String,Object],default:""},contentStyle:{type:[String,Object],default:""},iconClass:{type:[String,Object],default:""}},emits:["click"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(_r,{class:"o-tooltip",placement:n.placement},{trigger:l.withCtx(()=>[l.createElementVNode("button",{class:l.normalizeClass(["o-menubar-btn o-command-btn o-btn",n.contentClass]),style:l.normalizeStyle(n.contentStyle),onClick:o[0]||(o[0]=i=>t("click",i))},[l.createVNode(ie,{name:n.icon,color:n.color,class:l.normalizeClass(n.iconClass)},null,8,["name","color","class"])],6)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(n.tooltip),1)]),_:1},8,["placement"]))}}),N_=l.defineComponent({__name:"OSimpleCommandBtn",props:{name:{type:String,default:""},editor:{type:Object}},setup(n){const e=n,{run:t}=Pe(),{tr:r}=ve(),o=l.computed(()=>({aiViewer:{icon:"auto_awesome",tooltip:r("label.ai")},blockquote:{icon:"format_quote_open",tooltip:r("editor.blockquote")},bold:{icon:"format_bold",tooltip:r("editor.bold")},callout:{icon:"card_text",tooltip:r("editor.callout")},clearFormat:{icon:"format_clear",tooltip:r("editor.removeFormat")},code:{icon:"code",tooltip:r("editor.code")},codeBlock:{icon:"code_braces",tooltip:r("editor.codeBlock")},columns:{icon:"splitscreen_vertical_add",tooltip:"Column",rotate:!0},horizontalRule:{icon:"horizontal_rule",tooltip:r("editor.hr")},italic:{icon:"format_italic",tooltip:r("editor.italic")},image:{icon:"image",tooltip:r("editor.photo")},linkUnset:{icon:"link_off",tooltip:r("link.off")},modelViewer:{icon:"3d_rotation",tooltip:r("label.modelViewer")},strike:{icon:"format_strikethrough",tooltip:r("editor.strikethrough")},underline:{icon:"format_underlined",tooltip:r("editor.underline")},video:{icon:"videocam",tooltip:r("editor.video")}})),i=l.computed(()=>o.value[e.name]||{icon:"",isActive:!1,command:()=>{}});function s(){t(e.editor,e.name)}return(a,c)=>{var d;return l.openBlock(),l.createBlock(Me,{class:"o-simple-command-btn",icon:i.value.icon,tooltip:i.value.tooltip,"content-class":{"is-active":(d=n.editor)==null?void 0:d.isActive(n.name),"rotate-90":i.value.rotate},onClick:s},null,8,["icon","tooltip","content-class"])}}}),T_={class:"o-block-placeholder"},O_={class:"icon"},M_={class:"placeholder"},cd=l.defineComponent({__name:"OBlockPlaceholder",props:{icon:{type:String,default:"image"},placeholder:{type:String,default:""}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("section",T_,[l.createElementVNode("div",O_,[l.createVNode(l.unref(ie),{name:n.icon},null,8,["name"])]),l.createElementVNode("div",M_,l.toDisplayString(n.placeholder),1)]))}}),Ee={amber:"#ffc107",blue:"#2172e0",brown:"#795548",cyan:"#00bcd4",deepOrange:"#ff5722",deepPurple:"#673ab7",green:"#4caf50",indigo:"#3f51b5",lightBlue:"#03a9f4",lightGreen:"#8bc34a",lime:"#cddc39",orange:"#ff9800",purple:"#9c27b0",pink:"#e91e63",red:"#f44336",teal:"#009688",yellow:"#ffeb3b"},Li=[{label:"editor.paragraph",value:"paragraph",icon:"title",color:"",style:!0,group:"label.basic"},{label:"editor.heading1",value:"heading",icon:"format_h1",color:Ee.blue,style:!0,options:{level:1}},{label:"editor.heading2",value:"heading",icon:"format_h2",color:Ee.blue,style:!0,options:{level:2}},{label:"editor.heading3",value:"heading",icon:"format_h3",color:Ee.blue,style:!0,options:{level:3}},{label:"editor.todoList",value:"taskList",icon:"check_box",color:Ee.indigo,style:!0},{label:"editor.unorderedList",value:"bulletList",icon:"format_list_bulleted",color:Ee.indigo,style:!0},{label:"editor.orderedList",value:"orderedList",icon:"format_list_numbered",color:Ee.indigo,style:!0},{label:"editor.blockquote",value:"blockquote",icon:"format_quote_open",color:Ee.brown,style:!0},{label:"editor.codeBlock",value:"codeBlock",icon:"code_braces",color:Ee.lightBlue,style:!0},{label:"editor.horizontal",value:"horizontalRule",icon:"horizontal_rule",color:Ee.blue},{label:"editor.callout",value:"callout",color:Ee.deepOrange,icon:"card_text",style:!1},{label:"editor.emoji",value:"emoji",icon:"emoji_emotions",color:Ee.blue}],Hs=Li.filter(n=>n.style),wi=[{label:"label.ai",value:"aiViewer",icon:"auto_awesome",color:Ee.purple,tips:"ai",group:"label.ai"},{label:"editor.callout",value:"callout",icon:"card_text",color:Ee.deepOrange,tips:"callout",group:"label.common"},{label:"editor.table",value:"table",icon:"window",tips:"table",color:Ee.cyan},{label:"editor.codeBlock",value:"codeBlock",icon:"code_braces",tips:"code",color:Ee.blue},{label:"editor.todoList",value:"taskList",icon:"check_box",tips:"task",color:Ee.indigo},{label:"label.image",value:"image",icon:"image",color:Ee.amber,tips:"image",group:"label.media"},{label:"label.video",value:"video",icon:"videocam",tips:"video",color:Ee.purple},{label:"label.model",value:"modelViewer",icon:"3d_rotation",tips:"model",color:Ee.purple}],dd=[...Li,...wi],Cp=[{label:"editor.duplicate",value:"duplicate",icon:"content_copy",color:Ee.blue,tips:"Ctrl+D",group:"label.common",filter:"common"},{label:"editor.delete",value:"delete",icon:"delete",tips:"Ctrl+D",color:Ee.deepOrange,filter:"common"},{label:"label.replace",value:"replace",icon:"cached",tips:"Ctrl+R",color:Ee.blue,filter:"image,video,model"},{label:"label.color",value:"palette",icon:"palette",color:Ee.purple,filter:"callout",component:"OCalloutColorBoard"}],A_={key:1,class:"group o-tips"},R_={class:"suffix o-tips"},D_={key:1,class:"item"},Xr=l.defineComponent({__name:"OBlockMenu",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},colorful:{type:Boolean,default:!1},showGroup:{type:Boolean,default:!1}},emits:["action"],setup(n,{emit:e}){const t=n,r=e,{tr:o}=ve(),i=l.ref([]),s=l.computed(()=>{var h;return(h=t.node)==null?void 0:h.type.name}),a=l.computed(()=>{const h=Cp.filter(g=>{var b;return((b=g.filter)==null?void 0:b.indexOf("common"))>=0}),m=Cp.filter(g=>{var b;return((b=g.filter)==null?void 0:b.indexOf(s.value))>=0});if(m.length>0){const g=m[0];g.group=`editor.${s.value}`}return[...h,...m]});function c(h){switch(h.component){case"OCalloutColorBoard":return pd;default:return null}}function d(h){r("action",h),setTimeout(()=>{u(h)},0)}function u(h){switch(h.value){case"delete":t.deleteNode();break;case"duplicate":p();break}}function p(){var y,k,E;const h=t.node.nodeSize,m=t.getPos()+h,g=JSON.parse(JSON.stringify(t.node));(y=t.editor)==null||y.commands.insertContentAt(m,{type:"paragraph"}),(k=t.editor)==null||k.commands.insertContentAt(m,g);const b=m+h+1;(E=t.editor)==null||E.commands.focus(b)}function f(h,m){switch(m.name){case"backColor":t.updateAttributes({background:m.value});break;case"foreColor":t.updateAttributes({borderColor:m.value});break}}return(h,m)=>(l.openBlock(),l.createBlock(l.unref(un),{class:"o-block-menu",hoverable:"",clickable:""},{default:l.withCtx(()=>[a.value.length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(a.value,(g,b)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:b},[g.group?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[b>0?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),n.showGroup?(l.openBlock(),l.createElementBlock("div",A_,l.toDisplayString(l.unref(o)(g.group)),1)):l.createCommentVNode("",!0)],64)):l.createCommentVNode("",!0),c(g)?(l.openBlock(),l.createBlock(l.unref(qe),{key:1,ref_for:!0,ref:i.value[g.value],offset:[0,16],placement:"right"},{trigger:l.withCtx(()=>[l.createVNode(l.unref(Zt),{class:"item",clickable:""},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:g.icon,color:n.colorful?g.color:""},null,8,["name","color"])]),suffix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"navigate_next",class:"o-tips"})]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(o)(g.label)),1)]),_:2},1024)]),default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(c(g)),{onSelect:y=>f(g,y)},null,40,["onSelect"]))]),_:2},1536)):(l.openBlock(),l.createBlock(l.unref(Zt),{key:2,class:"item",clickable:"",onClick:y=>d(g)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:g.icon,color:n.colorful?g.color:""},null,8,["name","color"])]),suffix:l.withCtx(()=>[l.createElementVNode("div",R_,l.toDisplayString(g.tips),1)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(o)(g.label)),1)]),_:2},1032,["onClick"]))],64))),128)):(l.openBlock(),l.createElementBlock("div",D_,"No result"))]),_:1}))}}),xo=l.defineComponent({__name:"OBlockPopover",props:{modelValue:{type:Boolean,default:!1},placement:{type:String,default:"bottom-center"},showArrow:{type:Boolean,default:!1},hideClickOutside:{type:Boolean,default:!1},tippyClass:{type:String,default:""},offset:{type:Array,default:function(){return[0,10]}}},emits:["update:modelValue","show","hide"],setup(n,{emit:e}){const t=n,r=e,o=l.ref();function i(a){r("update:modelValue",a)}function s(){t.hideClickOutside&&r("update:modelValue",!1)}return l.watch(()=>t.modelValue,a=>{var c,d;console.log("modelValue",a),a?(c=o.value)==null||c.setShow(!0):(d=o.value)==null||d.setShow(!1)}),l.onMounted(()=>{var a;t.modelValue&&((a=o.value)==null||a.setShow(!0))}),(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,placement:n.placement,"tippy-class":n.tippyClass,trigger:"manual",arrow:n.showArrow,offset:n.offset,show:n.modelValue,"onUpdate:show":i,onClickoutside:s},{trigger:l.withCtx(()=>[l.renderSlot(a.$slots,"default")]),default:l.withCtx(()=>[l.renderSlot(a.$slots,"popover-content")]),_:3},8,["placement","tippy-class","arrow","offset","show"]))}}),I_={class:"o-block-toolbar"},B_={class:"button-group"},ud=l.defineComponent({__name:"OBlockToolbar",props:{...ct,type:{type:String,default:"link"}},emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),s=l.ref();function a(c){var d;r("action",c),(d=s.value)==null||d.setShow(!1)}return(c,d)=>(l.openBlock(),l.createElementBlock("div",I_,[l.createElementVNode("section",B_,[l.renderSlot(c.$slots,"default"),l.createVNode(l.unref(qe),{ref_key:"popover",ref:s,placement:"bottom-end",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"more_horiz",tooltip:l.unref(i)("label.more")},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(Xr),l.mergeProps(t,{onAction:a}),null,16)]),_:1},512)])]))}}),L_={class:"o-callout-color-board"},P_={class:"fore-colors"},$_=l.createElementVNode("div",{class:"label o-tips"},"Border color",-1),F_={class:"color-row"},z_={class:"color-row"},V_={class:"back-colors"},H_=l.createElementVNode("div",{class:"label o-tips"},"Background",-1),U_={class:"color-row"},W_={class:"color-row"},pd=l.defineComponent({__name:"OCalloutColorBoard",props:{foreColor:{type:String,default:""},backColor:{type:String,default:""},activeColor:{type:String,default:""}},emits:["select"],setup(n,{emit:e}){const t=e;function r(s,a){t("select",{name:s,value:a.value})}const o=l.computed(()=>[{label:"Grey",value:"#e9e9e9"},{label:"Brown",value:"#ffd591"},{label:"Orange",value:"#ffbb96"},{label:"Yellow",value:"#fff08f"},{label:"Green",value:"#b7eb8f"},{label:"Blue",value:"#91d5ff"},{label:"Purple",value:"#d3adf7"},{label:"Pink",value:"#ffadd2"},{label:"Red",value:"#ffa39e"}]),i=l.computed(()=>[{label:"Grey",value:"#F5F5F5"},{label:"Brown",value:"#F4EEEE"},{label:"Orange",value:"#FAEBDD"},{label:"Yellow",value:"#FBF3DB"},{label:"Green",value:"#EDF3EC"},{label:"Blue",value:"#E7F3F8"},{label:"Purple",value:"#F6F3F9"},{label:"Pink",value:"#FAF1F5"},{label:"Red",value:"#FDEBEC"}]);return(s,a)=>(l.openBlock(),l.createElementBlock("section",L_,[l.createElementVNode("section",P_,[$_,l.createElementVNode("div",F_,[l.createVNode(l.unref(Me),{icon:"slash_forward",tooltip:"No color","content-class":"border",onClick:a[0]||(a[0]=c=>r("foreColor",{value:""}))}),n.foreColor?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,tooltip:"Last used","content-style":{borderColor:n.foreColor},onClick:a[1]||(a[1]=c=>r("foreColor",{value:n.foreColor}))},null,8,["content-style"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",z_,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(c,d)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:`col-${d}`,tooltip:c.label,"content-style":{borderColor:c.value},onClick:u=>r("foreColor",c)},null,8,["tooltip","content-style","onClick"]))),128))])]),l.createElementVNode("section",V_,[H_,l.createElementVNode("div",U_,[l.createVNode(l.unref(Me),{icon:"slash_forward",tooltip:"Default Color","content-class":"border",onClick:a[2]||(a[2]=c=>r("backColor",{value:"#F5F5F5"}))}),n.backColor?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,"content-style":{backgroundColor:n.backColor},tooltip:"Last used","content-class":"border",onClick:a[3]||(a[3]=c=>r("backColor",{value:n.backColor}))},null,8,["content-style"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",W_,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(c,d)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:`col-${d}`,tooltip:c.label,"content-style":{backgroundColor:c.value},onClick:u=>r("backColor",c)},null,8,["tooltip","content-style","onClick"]))),128))])])]))}}),q_=l.defineComponent({__name:"OCalloutColorDropdown",props:{editor:{type:Object}},emits:["select"],setup(n,{emit:e}){const t=e,{tr:r}=ve(),{run:o}=Pe(),i=l.ref(null),s=l.ref(""),a=l.ref("");function c(d,u){d==="foreColor"?(s.value=u,localStorage.setItem("yiitap.text-color.fore",u)):d==="backColor"&&(a.value=u,localStorage.setItem("yiitap.text-color.back",u)),t("select",d,u)}return l.onMounted(()=>{s.value=localStorage.getItem("yiitap.text-color.fore")||"",a.value=localStorage.getItem("yiitap.text-color.back")||""}),(d,u)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:i,placement:"bottom-center",trigger:"hover",arrow:""},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"palette",tooltip:l.unref(r)("editor.textColor")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>{var p;return[l.createVNode(l.unref(pd),{"fore-color":s.value,"back-color":a.value,"default-label":l.unref(r)("editor.defaultColor"),"active-color":(p=n.editor)==null?void 0:p.getAttributes("textStyle").color,onSelect:c},null,8,["fore-color","back-color","default-label","active-color"])]}),_:1},512))}}),Ba=l.defineComponent({__name:"OContextMenu",props:{modelValue:{type:Boolean,default:!1},clientX:{type:Number,default:0},clientY:{type:Number,default:0},event:{type:Object,default:function(){return{}}}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=l.ref();l.computed(()=>{var a;return t.clientX||((a=t.event)==null?void 0:a.clientX)||0}),l.computed(()=>{var a;return t.clientY||((a=t.event)==null?void 0:a.clientY)||0});function i(a){r("update:modelValue",a)}function s(){r("update:modelValue",!1)}return l.watch(()=>t.modelValue,a=>{var c;a?setTimeout(()=>{var d;(d=o.value)==null||d.setShow(a)},0):(c=o.value)==null||c.setShow(a)}),(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,placement:"bottom-start",trigger:"manual",show:n.modelValue,"show-arrow":!1,event:n.event,"onUpdate:show":i,onClickoutside:s},{default:l.withCtx(()=>[l.renderSlot(a.$slots,"default")]),_:3},8,["show","event"]))}}),K_={class:"o-color-board"},G_={class:"cell-container"},j_={class:"label"},J_=["onClick"],La=l.defineComponent({__name:"OColorBoard",props:{defaultColor:{type:String,default:""},defaultLabel:{type:String,default:""},activeColor:{type:String,default:""}},emits:["select"],setup(n,{emit:e}){const t=n,r=e;function o(c){r("select",c.hex)}function i(c){return t.activeColor===c}function s(c){return"abc"}const a=l.computed(()=>[[{label:"color",rgb:"rgb(0, 0, 0)",hex:"#000000"},{label:"color",rgb:"rgb(38, 38, 38)",hex:"#262626"},{label:"color",rgb:"rgb(89, 89, 89)",hex:"#595959"},{label:"color",rgb:"rgb(140, 140, 140)",hex:"#8c8c8c"},{label:"color",rgb:"rgb(191, 191, 191)",hex:"#bfbfbf"},{label:"color",rgb:"rgb(217, 217, 217)",hex:"#d9d9d9"},{label:"color",rgb:"rgb(233, 233, 233)",hex:"#e9e9e9"},{label:"color",rgb:"rgb(245, 245, 245)",hex:"#f5f5f5"},{label:"color",rgb:"rgb(250, 250, 250)",hex:"#fafafa",border:!0},{label:"color",rgb:"rgb(255, 255, 255)",hex:"#ffffff",border:!0}],[{label:"color",rgb:"rgb(245, 34, 45)",hex:"#f5222d"},{label:"color",rgb:"rgb(250, 84, 28)",hex:"#fa541c"},{label:"color",rgb:"rgb(250, 140, 22)",hex:"#fa8c16"},{label:"color",rgb:"rgb(250, 219, 20)",hex:"#fadb14"},{label:"color",rgb:"rgb(82, 196, 26)",hex:"#52c41a"},{label:"color",rgb:"rgb(19, 194, 194)",hex:"#13c2c2"},{label:"color",rgb:"rgb(24, 144, 255)",hex:"#1890ff"},{label:"color",rgb:"rgb(47, 84, 235)",hex:"#2f54eb"},{label:"color",rgb:"rgb(114, 46, 209)",hex:"#722ed1"},{label:"color",rgb:"rgb(235, 47, 150)",hex:"#eb2f96"}],[{label:"color",rgb:"rgb(255, 232, 230)",hex:"#ffe8e6"},{label:"color",rgb:"rgb(255, 236, 224)",hex:"#ffece0"},{label:"color",rgb:"rgb(255, 239, 209)",hex:"#ffefd1"},{label:"color",rgb:"rgb(255, 248, 189)",hex:"#fff8bd"},{label:"color",rgb:"rgb(228, 247, 210)",hex:"#e4f7d2"},{label:"color",rgb:"rgb(211, 245, 240)",hex:"#d3f5f0"},{label:"color",rgb:"rgb(212, 238, 252)",hex:"#d4eefc"},{label:"color",rgb:"rgb(222, 232, 252)",hex:"#dee8fc"},{label:"color",rgb:"rgb(239, 225, 250)",hex:"#efe1fa"},{label:"color",rgb:"rgb(250, 225, 235)",hex:"#fae1eb"}],[{label:"color",rgb:"rgb(255, 163, 158)",hex:"#ffa39e"},{label:"color",rgb:"rgb(255, 187, 150)",hex:"#ffbb96"},{label:"color",rgb:"rgb(255, 213, 145)",hex:"#ffd591"},{label:"color",rgb:"rgb(255, 240, 143)",hex:"#fff08f"},{label:"color",rgb:"rgb(183, 235, 143)",hex:"#b7eb8f"},{label:"color",rgb:"rgb(135, 232, 222)",hex:"#87e8de"},{label:"color",rgb:"rgb(145, 213, 255)",hex:"#91d5ff"},{label:"color",rgb:"rgb(173, 198, 255)",hex:"#adc6ff"},{label:"color",rgb:"rgb(211, 173, 247)",hex:"#d3adf7"},{label:"color",rgb:"rgb(255, 173, 210)",hex:"#ffadd2"}],[{label:"color",rgb:"rgb(255, 77, 79)",hex:"#ff4d4f"},{label:"color",rgb:"rgb(255, 122, 69)",hex:"#ff7a45"},{label:"color",rgb:"rgb(255, 169, 64)",hex:"#ffa940"},{label:"color",rgb:"rgb(255, 236, 61)",hex:"#ffec3d"},{label:"color",rgb:"rgb(115, 209, 61)",hex:"#73d13d"},{label:"color",rgb:"rgb(54, 207, 201)",hex:"#36cfc9"},{label:"color",rgb:"rgb(64, 169, 255)",hex:"#40a9ff"},{label:"color",rgb:"rgb(89, 126, 247)",hex:"#597ef7"},{label:"color",rgb:"rgb(146, 84, 222)",hex:"#9254de"},{label:"color",rgb:"rgb(247, 89, 171)",hex:"#f759ab"}],[{label:"color",rgb:"rgb(207, 19, 34)",hex:"#cf1322"},{label:"color",rgb:"rgb(212, 56, 13)",hex:"#d4380d"},{label:"color",rgb:"rgb(212, 107, 8)",hex:"#d46b08"},{label:"color",rgb:"rgb(212, 177, 6)",hex:"#d4b106"},{label:"color",rgb:"rgb(56, 158, 13)",hex:"#389e0d"},{label:"color",rgb:"rgb(8, 151, 156)",hex:"#08979c"},{label:"color",rgb:"rgb(9, 109, 217)",hex:"#096dd9"},{label:"color",rgb:"rgb(29, 57, 196)",hex:"#1d39c4"},{label:"color",rgb:"rgb(83, 29, 171)",hex:"#531dab"},{label:"color",rgb:"rgb(196, 29, 127)",hex:"#c41d7f"}],[{label:"color",rgb:"rgb(130, 0, 20)",hex:"#820014"},{label:"color",rgb:"rgb(135, 20, 0)",hex:"#871400"},{label:"color",rgb:"rgb(135, 56, 0)",hex:"#873800"},{label:"color",rgb:"rgb(97, 71, 0)",hex:"#614700"},{label:"color",rgb:"rgb(19, 82, 0)",hex:"#135200"},{label:"color",rgb:"rgb(0, 71, 79)",hex:"#00474f"},{label:"color",rgb:"rgb(0, 58, 140)",hex:"#003a8c"},{label:"color",rgb:"rgb(6, 17, 120)",hex:"#061178"},{label:"color",rgb:"rgb(34, 7, 94)",hex:"#22075e"},{label:"color",rgb:"rgb(120, 6, 80)",hex:"#780650"}]]);return(c,d)=>(l.openBlock(),l.createElementBlock("section",K_,[l.createElementVNode("div",{class:"default-color",onClick:d[0]||(d[0]=u=>o({hex:n.defaultColor}))},[l.createElementVNode("div",G_,[l.createElementVNode("div",{class:"cell border",style:l.normalizeStyle({background:n.defaultColor})},[l.createVNode(l.unref(ie),{name:"slash_forward"})],4)]),l.createElementVNode("div",j_,l.toDisplayString(n.defaultLabel),1)]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,(u,p)=>(l.openBlock(),l.createElementBlock("div",{class:"color-row",key:`row-${p}`},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u,(f,h)=>(l.openBlock(),l.createElementBlock("div",{class:"",key:`col-${h}`},[l.createElementVNode("div",{class:"cell-container",onClick:m=>o(f)},[l.createElementVNode("div",{class:l.normalizeClass(["cell",{border:f.border}]),style:l.normalizeStyle({backgroundColor:f.hex})},[i(f.hex)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",style:l.normalizeStyle({color:s(f.rgb)})},null,8,["style"])):l.createCommentVNode("",!0)],6)],8,J_)]))),128))]))),128))]))}}),st=l.defineComponent({__name:"OCommandBtn",props:{icon:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},tooltip:{type:String,default:""},placement:{type:String,default:"top"},disabled:{type:Boolean,default:!1},contentClass:{type:[String,Object],default:""},contentStyle:{type:[String,Object],default:""},iconClass:{type:[String,Object],default:""}},emits:["click"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(l.unref(_r),{placement:n.placement},{trigger:l.withCtx(()=>[l.createElementVNode("button",{class:l.normalizeClass(["o-menubar-btn o-command-btn o-btn",n.contentClass]),style:l.normalizeStyle(n.contentStyle),onClick:o[0]||(o[0]=i=>t("click",i))},[l.createVNode(l.unref(ie),{name:n.icon,color:n.color,class:l.normalizeClass(n.iconClass)},null,8,["name","color","class"]),l.renderSlot(r.$slots,"default")],6)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(n.tooltip),1)]),_:3},8,["placement"]))}}),Us=l.defineComponent({__name:"OCommonBtn",props:{icon:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},tooltip:{type:String,default:""},placement:{type:String,default:"top"},disabled:{type:Boolean,default:!1},contentClass:{type:[String,Object],default:""},contentStyle:{type:[String,Object],default:""},iconClass:{type:[String,Object],default:""}},emits:["click"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(l.unref(_r),{placement:n.placement},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-menubar-btn o-command-btn o-btn",n.contentClass]),style:l.normalizeStyle(n.contentStyle),onClick:o[0]||(o[0]=i=>t("click",i))},[l.createVNode(l.unref(ie),{name:n.icon,color:n.color,class:l.normalizeClass(n.iconClass)},null,8,["name","color","class"]),l.renderSlot(r.$slots,"default")],6)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(n.tooltip),1)]),_:3},8,["placement"]))}}),kl=[{label:"Arduino",value:"arduino",icon:"code_blocks"},{label:"Bash",value:"bash",icon:"code_blocks"},{label:"C",value:"c",icon:"code_blocks"},{label:"C++",value:"cpp",icon:"code_blocks"},{label:"C#",value:"csharp",icon:"code_blocks"},{label:"CSS",value:"css",icon:"code_blocks"},{label:"Diff",value:"diff",icon:"code_blocks"},{label:"Go",value:"go",icon:"code_blocks"},{label:"GraphQL",value:"graphql",icon:"code_blocks"},{label:"Ini",value:"ini",icon:"code_blocks"},{label:"Java",value:"java",icon:"code_blocks"},{label:"JavaScript",value:"javascript",icon:"code_blocks"},{label:"JSON",value:"json",icon:"code_blocks"},{label:"Kotlin",value:"kotlin",icon:"code_blocks"},{label:"Less",value:"less",icon:"code_blocks"},{label:"Lua",value:"lua",icon:"code_blocks"},{label:"Makefile",value:"makefile",icon:"code_blocks"},{label:"Markdown",value:"markdown",icon:"code_blocks"},{label:"Objective-C",value:"objectivec",icon:"code_blocks"},{label:"Perl",value:"perl",icon:"code_blocks"},{label:"PHP",value:"php",icon:"code_blocks"},{label:"PHP-Template",value:"php-template",icon:"code_blocks"},{label:"Plain Text",value:"plaintext",icon:"code_blocks"},{label:"Python",value:"python",icon:"code_blocks"},{label:"Python-Repl",value:"python-repl",icon:"code_blocks"},{label:"R",value:"r",icon:"code_blocks"},{label:"Ruby",value:"ruby",icon:"code_blocks"},{label:"Rust",value:"rust",icon:"code_blocks"},{label:"Scss",value:"scss",icon:"code_blocks"},{label:"Shell",value:"shell",icon:"code_blocks"},{label:"SQL",value:"sql",icon:"code_blocks"},{label:"Swift",value:"swift",icon:"code_blocks"},{label:"TypeScript",value:"typescript",icon:"code_blocks"},{label:"VB.Net",value:"vbnet",icon:"code_blocks"},{label:"WebAssembly",value:"wasm",icon:"code_blocks"},{label:"XML",value:"xml",icon:"code_blocks"},{label:"YAML",value:"yaml",icon:"code_blocks"}],Y_={class:"selected-language"},X_={class:"header"},Z_={class:"o-scroll"},Um=l.defineComponent({__name:"OLanguageDropdown",props:{language:{type:String,default:"shell"}},emits:["select"],setup(n,{emit:e}){const t=n,r=e,{tr:o}=ve(),i=l.ref(),s=l.ref(),a=l.ref(""),c=l.ref(0),d=l.ref(""),u=l.computed(()=>a.value?kl.filter(y=>y.value.toLowerCase().indexOf(a.value.toLowerCase())>=0):kl),p=l.computed(()=>kl.find(y=>y.value===d.value));function f(y){y&&setTimeout(()=>{var k;(k=s.value)==null||k.focus(),c.value=0,window.addEventListener("keyup",b)},0)}function h(){window.removeEventListener("keyup",b)}function m(y){h(),d.value=y.value,r("select",y.value)}function g(){m(u.value[c.value])}function b(y){if(u.value.length>0){switch(y.code){case"ArrowDown":c.value=c.value+1;break;case"ArrowUp":c.value=c.value-1;break;case"Enter":g();break}c.value>=u.value.length&&(c.value=0),c.value<0&&(c.value=u.value.length-1)}else c.value=0}return l.onMounted(()=>{d.value=t.language}),(y,k)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:i,placement:"bottom-start",trigger:"click","tippy-class":"o-language-popover dropdown","onUpdate:show":f},{trigger:l.withCtx(()=>[l.createVNode(l.unref(Bt),{class:"o-dropdown-btn"},{default:l.withCtx(()=>{var E;return[l.createElementVNode("span",Y_,l.toDisplayString((E=p.value)==null?void 0:E.label),1),l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]}),_:1})]),default:l.withCtx(()=>[l.createElementVNode("header",X_,[l.createVNode(l.unref(Ao),{ref_key:"input",ref:s,modelValue:a.value,"onUpdate:modelValue":k[0]||(k[0]=E=>a.value=E),type:"text",placeholder:"Search",autofocus:"",clearable:""},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"search",class:"o-tips"})]),_:1},8,["modelValue"])]),l.createElementVNode("section",Z_,[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.value,(E,v)=>(l.openBlock(),l.createBlock(l.unref(Zt),{key:v,onClick:_=>m(E),class:l.normalizeClass({"is-active":E.value===d.value,"is-select":v===c.value})},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:E.icon},null,8,["name"])]),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(E.label)+" ",1)]),_:2},1032,["onClick","class"]))),128))]),_:1})])]),_:1},512))}}),Q_={class:"o-media-input"},eS={class:"fields"},tS=l.createElementVNode("div",{class:"o-media-title"},"Link",-1),nS={class:"actions"},fd=l.defineComponent({__name:"OMediaInput",props:{val:{type:String,default:""},type:{type:String,default:""}},emits:["input"],setup(n,{emit:e}){const t=n,r=e,{tr:o}=ve(),i=l.ref(),s=l.ref(""),a=l.ref("");function c(){return a.value?(s.value="null",!0):(s.value="error",!1)}function d(){c()&&r("input",a.value)}return l.onMounted(()=>{a.value=t.val,setTimeout(()=>{var u;(u=i.value)==null||u.focus()},0)}),(u,p)=>(l.openBlock(),l.createElementBlock("section",Q_,[l.createElementVNode("section",eS,[tS,l.createVNode(l.unref(Ao),{ref_key:"input",ref:i,modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=f=>a.value=f),status:s.value,type:"text",autofocus:"",clearable:""},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"link",class:"o-tips"})]),_:1},8,["modelValue","status"])]),l.createElementVNode("footer",nS,[l.createVNode(l.unref(Bt),{type:"info",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o)("label.ok")),1)]),_:1})])]))}}),rS={class:"o-meta-input"},oS={class:"header"},iS={class:"title"},sS={class:"fields"},aS={class:"actions"},hd=l.defineComponent({__name:"OMetaInput",props:{val:{type:String,default:""},title:{type:String,default:"Link"},type:{type:String,default:"link"},icon:{type:String,default:"link"},secondIcon:{type:String,default:""},secondLabel:{type:String,default:""}},emits:["cancel","confirm"],setup(n,{emit:e}){const t=n,r=e,{tr:o}=ve(),i=l.ref(null),s=l.ref("");function a(){console.log("confirm",s.value),r("confirm",s.value)}return l.onMounted(()=>{s.value=t.val,setTimeout(()=>{var c;(c=i.value)==null||c.focus()},0)}),(c,d)=>(l.openBlock(),l.createElementBlock("section",rS,[l.createElementVNode("section",oS,[l.createElementVNode("div",iS,l.toDisplayString(n.title),1),l.createElementVNode("div",null,[l.renderSlot(c.$slots,"header-right")])]),l.createElementVNode("section",sS,[l.createVNode(l.unref(Ao),{ref_key:"input",ref:i,modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=u=>s.value=u),type:"text",autofocus:"",clearable:""},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:n.icon,class:"o-tips"},null,8,["name"])]),_:1},8,["modelValue"])]),l.createElementVNode("footer",aS,[l.createVNode(l.unref(Bt),{type:"tertiary",onClick:d[1]||(d[1]=u=>r("cancel"))},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o)("label.cancel")),1)]),_:1}),l.createVNode(l.unref(Bt),{type:"info",onClick:a},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o)("label.ok")),1)]),_:1})])]))}}),lS={class:"o-table-grid"},cS=["onMouseover"],Wm=l.defineComponent({__name:"OTableGrid",emits:["select"],setup(n,{emit:e}){const t=e,r=l.ref(6),o=l.ref(6),i=l.ref(2),s=l.ref(2);function a(d,u){i.value=d,s.value=u,r.value===d&&r.value<10&&(r.value+=1),o.value===u&&o.value<10&&(o.value+=1)}function c(){t("select",{rows:i.value,cols:s.value,withHeaderRow:!0})}return(d,u)=>(l.openBlock(),l.createElementBlock("section",lS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(p,f)=>(l.openBlock(),l.createElementBlock("div",{class:"rows",key:`row-${f}`},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(h,m)=>(l.openBlock(),l.createElementBlock("div",{key:`col-${m}`},[l.createElementVNode("div",{class:l.normalizeClass(["cell",{selected:p<=i.value&&h<=s.value}]),onMouseover:g=>a(p,h),onClick:c},null,42,cS)]))),128))]))),128)),l.createElementVNode("footer",null,l.toDisplayString(i.value)+" x "+l.toDisplayString(s.value),1)]))}}),dS={class:"o-table-cell-background o-button-group"},uS=["onClick"],pS={class:"o-command-btn"},qm=l.defineComponent({__name:"OTableCellBackground",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(),i=l.ref("#ffec3d");function s(){a(i.value)}function a(c){o.value.setShow(!1),i.value=c,r(e.editor,"tableCellAttribute",{name:"background",value:i.value})}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",placement:"bottom-start",trigger:"click"},{trigger:l.withCtx(()=>[l.createVNode(l.unref(_r),{trigger:"hover"},{trigger:l.withCtx(()=>[l.createElementVNode("div",dS,[l.createElementVNode("div",{class:"o-command-btn label",onClick:l.withModifiers(s,["stop"])},[l.createVNode(l.unref(ie),{name:"crop_16_9",class:"arrow"}),l.createElementVNode("div",{class:"indicator",style:l.normalizeStyle(`background: ${i.value}`)},null,4)],8,uS),l.createElementVNode("div",pS,[l.createVNode(l.unref(ie),{name:"arrow_drop_down"})])])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(t)("editor.highlightColor")),1)]),_:1})]),default:l.withCtx(()=>[l.createVNode(l.unref(La),{"default-color":"","default-label":l.unref(t)("editor.noColor"),onSelect:a},null,8,["default-label"])]),_:1},512))}}),fS={class:"o-simple-color-board"},hS={class:"fore-colors"},mS=l.createElementVNode("div",{class:"label o-tips"},"Color",-1),gS={class:"color-row"},bS={class:"color-row"},yS={class:"back-colors"},vS=l.createElementVNode("div",{class:"label o-tips"},"Background",-1),kS={class:"color-row"},wS={class:"color-row"},Km=l.defineComponent({__name:"OTextColorBoard",props:{foreColor:{type:String,default:""},backColor:{type:String,default:""},activeColor:{type:String,default:""}},emits:["select"],setup(n,{emit:e}){const t=e;function r(s,a){t("select",s,a.value)}const o=l.computed(()=>[{label:"Grey",value:"#787774"},{label:"Brown",value:"#9F6B53"},{label:"Orange",value:"#D9730D"},{label:"Yellow",value:"#CB912F"},{label:"Green",value:"#448361"},{label:"Blue",value:"#337EA9"},{label:"Purple",value:"#9065B0"},{label:"Pink",value:"#C14C8A"},{label:"Red",value:"#D44C47"}]),i=l.computed(()=>[{label:"Grey",value:"#F1F1EF"},{label:"Brown",value:"#F4EEEE"},{label:"Orange",value:"#FAEBDD"},{label:"Yellow",value:"#FBF3DB"},{label:"Green",value:"#EDF3EC"},{label:"Blue",value:"#E7F3F8"},{label:"Purple",value:"#F6F3F9"},{label:"Pink",value:"#FAF1F5"},{label:"Red",value:"#FDEBEC"}]);return(s,a)=>(l.openBlock(),l.createElementBlock("section",fS,[l.createElementVNode("section",hS,[mS,l.createElementVNode("div",gS,[l.createVNode(l.unref(Me),{icon:"format_text",tooltip:"Default color","content-class":"border",onClick:a[0]||(a[0]=c=>r("foreColor",{value:""}))}),n.foreColor?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,icon:"format_text",color:n.foreColor,tooltip:"Last used","content-class":"border",onClick:a[1]||(a[1]=c=>r("foreColor",{value:n.foreColor}))},null,8,["color"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",bS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(c,d)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:`col-${d}`,icon:"format_text",color:c.value,tooltip:c.label,onClick:u=>r("foreColor",c)},null,8,["color","tooltip","onClick"]))),128))])]),l.createElementVNode("section",yS,[vS,l.createElementVNode("div",kS,[l.createVNode(l.unref(Me),{icon:"slash_forward",tooltip:"No Color","content-class":"border",onClick:a[2]||(a[2]=c=>r("backColor",{value:""}))}),n.backColor?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,icon:"format_text",tooltip:"Last used","content-class":"border","content-style":{backgroundColor:n.backColor},onClick:a[3]||(a[3]=c=>r("backColor",{value:n.backColor}))},null,8,["content-style"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",wS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(c,d)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:`col-${d}`,icon:"format_text",tooltip:c.label,"content-style":{backgroundColor:c.value},onClick:u=>r("backColor",c)},null,8,["tooltip","content-style","onClick"]))),128))])])]))}}),Ws=[{type:"paragraph",content:[]}],Gm=[{type:"listItem",content:[{type:"paragraph",content:[]}]}],jm=[{type:"taskItem",content:[{type:"paragraph",content:[]}]}],ES={class:"o-add-node-view"},CS={key:0,class:"view-main"},_S={class:"group o-tips"},SS={class:"panel"},xS={class:"group o-tips"},NS={key:1,class:"item"},TS={key:1,class:"view-emoji"},OS=l.defineComponent({__name:"AddNodeView",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),{run:s}=Pe(),a=l.ref("main"),c=l.ref(0);function d(f){const h=t.editor.chain();let m=null;switch(f.value){case"blockquote":m={content:Ws};break;case"callout":m={content:Ws,attrs:{icon:"💡"}};break;case"codeBlock":m={content:[],attrs:{language:"shell"}};break;case"emoji":m={type:"paragraph",content:[{type:"text",text:":"}]};break;case"heading":m={attrs:f.options};break;case"horizontalRule":m={};break;case"paragraph":m={content:[]};break;case"bulletList":case"orderedList":m={content:Gm};break;case"taskList":m={content:jm};break;case"table":setTimeout(()=>{h.insertContentAt(p.value,{type:"paragraph",content:[]}).insertTable({rows:3,cols:3,withHeaderRow:!0}).focus().run()},1);return;case"image":m={type:"paragraph",content:[{type:f.value,attrs:{src:"init"}}]};break;case"model-viewer":m={attrs:{src:"init"}};break}m&&(m.type=m.type||f.value,setTimeout(()=>{u.value?h.insertContent(m).focus().run():h.insertContentAt(p.value,m).focus().run()},1)),r("action",f)}const u=l.computed(()=>t.node.content.size===0),p=l.computed(()=>u.value?c.value:c.value+t.node.nodeSize);return l.onMounted(()=>{c.value=t.getPos()}),(f,h)=>(l.openBlock(),l.createElementBlock("section",ES,[a.value==="main"?(l.openBlock(),l.createElementBlock("section",CS,[l.createElementVNode("section",null,[l.createElementVNode("div",_S,l.toDisplayString(l.unref(i)("label.basic")),1),l.createElementVNode("section",SS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Li),(m,g)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:g,icon:m.icon,tooltip:l.unref(i)(m.label),quaternary:"",onClick:b=>d(m)},null,8,["icon","tooltip","onClick"]))),128))])]),l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[l.unref(wi).length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(l.unref(wi),(m,g)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:g},[m.group?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[g>0?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",xS,l.toDisplayString(l.unref(i)(m.group)),1)],64)):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:"item",clickable:"",onClick:b=>d(m)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:m.icon,color:m.color},null,8,["name","color"])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(i)(m.label)),1)]),_:2},1032,["onClick"])],64))),128)):(l.openBlock(),l.createElementBlock("div",NS,"No result"))]),_:1})])):a.value==="emoji"?(l.openBlock(),l.createElementBlock("section",TS)):l.createCommentVNode("",!0)]))}}),MS=l.defineComponent({__name:"AddNode",props:ct,setup(n){const e=n,t=l.ref(null),r=l.ref(!1);function o(s){r.value=s}function i(){var s;(s=t.value)==null||s.setShow(!1),r.value=!1}return(s,a)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:t,placement:"left",trigger:"mouseenter",arrow:"","onUpdate:show":o},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-add-node",{"is-selected":r.value}])},[l.createVNode(l.unref(Bt),{type:"tertiary",class:"o-node-btn"},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"add",small:""})]),_:1})],2)]),default:l.withCtx(()=>[l.createVNode(OS,l.mergeProps(e,{onAction:i}),null,16)]),_:1},512))}}),AS={class:"o-drag-node-view"},RS={key:0,class:"view-main"},DS={key:0},IS=l.createElementVNode("div",{class:"group o-tips"},"Turn into",-1),BS={class:"panel"},LS=l.defineComponent({__name:"DragNodeView",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),{run:s,onCommand:a}=Pe(),c=l.ref("main"),d=l.ref(["heading","codeBlock","paragraph"]),u=l.computed(()=>{var b,y;const g=(b=t.node)==null?void 0:b.content.content;if(g.length>0){const k=g[0];if(k.type.name==="image")return k.type.name}return(y=t.node)==null?void 0:y.type.name}),p=l.computed(()=>Hs.find(g=>g.value===u.value));function f(g){var b;return g.value===u.value&&((b=t.editor)==null?void 0:b.isActive(u.value,g.options))}function h(g){switch(g.value){default:m(g);break}r("action",g)}function m(g){var E,v,_,C,D;const b=t.getPos();if(g.value===u.value&&d.value.indexOf(u.value)<0){const B=(E=t.editor)==null?void 0:E.isActive(u.value),A=(v=t.editor)==null?void 0:v.commands.lift(u.value);console.log("lift",u.value,B,A);return}const y=(_=t.editor)==null?void 0:_.commands,k=(C=t.editor)==null?void 0:C.chain().focus(b+1);console.log("runCommand",g),a(y,k,g.value,g.options),(D=t.editor)==null||D.commands.setNodeSelection(b)}return l.computed(()=>[{label:"editor.duplicate",value:"duplicate",icon:"content_copy",color:Ee.blue,tips:"Ctrl+D",group:"label.common"},{label:"editor.delete",value:"delete",icon:"delete",tips:"Ctrl+D",color:Ee.deepOrange}]),(g,b)=>(l.openBlock(),l.createElementBlock("section",AS,[c.value==="main"?(l.openBlock(),l.createElementBlock("section",RS,[p.value?(l.openBlock(),l.createElementBlock("section",DS,[IS,l.createElementVNode("section",BS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Hs),(y,k)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:k,icon:y.icon,tooltip:l.unref(i)(y.label),"content-class":{"is-active":f(y)},quaternary:"",onClick:E=>h(y)},null,8,["icon","tooltip","content-class","onClick"]))),128))])])):l.createCommentVNode("",!0),l.createVNode(l.unref(Xr),l.mergeProps(t,{colorful:"","show-group":"",onAction:h}),null,16)])):l.createCommentVNode("",!0)]))}}),PS=l.defineComponent({__name:"DragNode",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,{run:o}=Pe(),i=l.ref(null),s=l.ref(0),a=l.ref(!1),c=l.ref(["heading","codeBlock","paragraph"]),d=l.ref(!1),u=l.computed(()=>{var k,E;const y=(k=t.node)==null?void 0:k.content.content;if(y.length>0){const v=y[0];if(v.type.name==="image")return v.type.name}return(E=t.node)==null?void 0:E.type.name}),p=l.computed(()=>{var k;let y=u.value;return y==="heading"?{icon:`format_h${((k=t.node.attrs)==null?void 0:k.level)||1}`,color:Ee.blue}:(y==="table-wrapper"&&(y="table"),dd.find(E=>E.value===y)||{icon:"title"})});function f(y){var k;(k=i.value)==null||k.setShow(!1),r("action",y)}function h(y){a.value=y,console.log("show",y),y&&m()}function m(){var k;let y=t.getPos();c.value.includes(u.value)||(y+=1),(k=t.editor)==null||k.commands.setNodeSelection(y),s.value=y}function g(y){d.value=!0,setTimeout(()=>{d.value=!1},10)}function b(y){d.value=!1}return(y,k)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:i,placement:"left",size:"medium",trigger:"click",arrow:"","onUpdate:show":h},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-drag-node",{"is-selected":a.value,"is-dragging":d.value}]),contenteditable:"false",draggable:"true","data-drag-handle":"",onDragstart:g,onDragend:b},[l.createVNode(l.unref(Bt),{type:"tertiary",class:"o-node-btn"},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:p.value.icon,color:p.value.color,small:""},null,8,["name","color"]),l.createVNode(l.unref(ie),{name:"drag_indicator",small:""})]),_:1})],34)]),default:l.withCtx(()=>[l.createVNode(LS,l.mergeProps(t,{onAction:f}),null,16)]),_:1},512))}}),$S=l.defineComponent({__name:"index",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,o=l.ref(!1),i=l.ref(0);l.ref(0);const s=l.computed(()=>a.value==="paragraph"&&t.node.content.size===0),a=l.computed(()=>{var f,h;const p=(f=t.node)==null?void 0:f.content.content;if(p.length>0){const m=p[0];if(m.type.name==="image")return m.type.name}return(h=t.node)==null?void 0:h.type.name}),c=l.computed(()=>{var p;return i.value||((p=t.node.attrs)==null?void 0:p.level)}),d=l.computed(()=>a.value==="heading"?`type-heading-${c.value}`:`type-${a.value}`);function u(p){r("action",p)}return l.onMounted(()=>{i.value=0}),(p,f)=>{var h;return(h=p.editor)!=null&&h.isEditable?(l.openBlock(),l.createElementBlock("section",{key:0,class:l.normalizeClass(["o-side-node",{"is-active":o.value,"is-empty":s.value}])},[l.createElementVNode("section",{class:l.normalizeClass(["action-container",d.value])},[l.createVNode(MS,l.normalizeProps(l.guardReactiveProps(t)),null,16),s.value?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(PS,l.mergeProps({key:0},t,{onAction:u}),null,16))],2)],2)):l.createCommentVNode("",!0)}}}),Bn=l.defineComponent({__name:"ONodeView",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,o=l.inject("sideNode",{value:!1});return l.computed(()=>{const i={};return t.node.attrs["data-id"]&&(i["data-id"]=t.node.attrs["data-id"]),i}),(i,s)=>(l.openBlock(),l.createBlock(l.unref(ad),{class:"o-node-view"},{default:l.withCtx(()=>{var a;return[l.unref(o)&&((a=i.editor)!=null&&a.isEditable)?(l.openBlock(),l.createBlock($S,l.mergeProps({key:0},t,{onAction:s[0]||(s[0]=c=>r("action"))}),null,16)):l.createCommentVNode("",!0),l.renderSlot(i.$slots,"default")]}),_:3}))}}),FS={class:"o-add-node-view"},zS={key:0,class:"view-main"},VS={class:"group o-tips"},HS={class:"panel"},US={class:"group o-tips"},WS={key:1,class:"item"},qS={key:1,class:"view-emoji"},KS=l.defineComponent({__name:"AddNodeView",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}},emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),{run:s}=Pe(),a=l.ref("main");function c(p){const f=t.editor.chain();let h=null;switch(p.value){case"blockquote":h={content:Ws};break;case"callout":h={content:Ws,attrs:{icon:"💡"}};break;case"codeBlock":h={content:[],attrs:{language:"shell"}};break;case"emoji":h={type:"paragraph",content:[{type:"text",text:":"}]};break;case"heading":h={attrs:p.options};break;case"horizontalRule":h={};break;case"paragraph":h={content:[]};break;case"bulletList":case"orderedList":h={content:Gm};break;case"taskList":h={content:jm};break;case"table":setTimeout(()=>{f.insertContentAt(u.value,{type:"paragraph",content:[]}).insertTable({rows:3,cols:3,withHeaderRow:!0}).focus().run()},1);return;case"image":h={type:"paragraph",content:[{type:p.value,attrs:{src:"init"}}]};break;case"model-viewer":h={attrs:{src:"init"}};break}h&&(console.log("add",t.getPos(),u.value),h.type=h.type||p.value,setTimeout(()=>{d.value?f.insertContent(h).focus().run():f.insertContentAt(u.value,h).focus().run()},1)),r("action",p)}const d=l.computed(()=>{var p;return((p=t.node)==null?void 0:p.content.size)===0}),u=l.computed(()=>d.value?t.getPos():t.getPos()+t.node.nodeSize);return(p,f)=>(l.openBlock(),l.createElementBlock("section",FS,[a.value==="main"?(l.openBlock(),l.createElementBlock("section",zS,[l.createElementVNode("section",null,[l.createElementVNode("div",VS,l.toDisplayString(l.unref(i)("label.basic")),1),l.createElementVNode("section",HS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Li),(h,m)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:m,icon:h.icon,tooltip:l.unref(i)(h.label),quaternary:"",onClick:g=>c(h)},null,8,["icon","tooltip","onClick"]))),128))])]),l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[l.unref(wi).length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(l.unref(wi),(h,m)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:m},[h.group?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[m>0?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",US,l.toDisplayString(l.unref(i)(h.group)),1)],64)):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:"item",clickable:"",onClick:g=>c(h)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:h.icon,color:h.color},null,8,["name","color"])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(i)(h.label)),1)]),_:2},1032,["onClick"])],64))),128)):(l.openBlock(),l.createElementBlock("div",WS,"No result"))]),_:1})])):a.value==="emoji"?(l.openBlock(),l.createElementBlock("section",qS)):l.createCommentVNode("",!0)]))}}),Jm=l.defineComponent({__name:"AddNode",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}},setup(n){const e=n,t=l.ref(),r=l.ref(!1),o=l.computed(()=>{var c;return((c=e.node)==null?void 0:c.content.size)===0});l.computed(()=>o.value?e.getPos():e.getPos()+e.node.nodeSize);function i(c){r.value=c}function s(){var c;(c=t.value)==null||c.setShow(!0)}function a(){var c;(c=t.value)==null||c.setShow(!1),r.value=!1}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:t,placement:"left","tippy-class":"dropdown",trigger:"manual",offset:[0,4],"onUpdate:show":i},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-add-btn",{"is-selected":r.value}])},[l.createVNode(l.unref(Bt),{type:"tertiary",class:"o-node-btn",onClick:s},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"add",small:""})]),_:1})],2)]),default:l.withCtx(()=>[l.createVNode(KS,l.mergeProps(e,{onAction:a}),null,16)]),_:1},512))}}),GS={class:"o-drag-node-view"},jS={key:0,class:"view-main"},JS={key:0},YS=l.createElementVNode("div",{class:"group o-tips"},"Turn into",-1),XS={class:"panel"},ZS=l.defineComponent({__name:"DragNodeView",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}},emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),{run:s,onCommand:a}=Pe(),c=l.ref("main"),d=l.ref(["heading","codeBlock","paragraph"]),u=l.computed(()=>{var b,y;const g=(b=t.node)==null?void 0:b.content.content;if(g.length>0){const k=g[0];if(k.type.name==="image")return k.type.name}return(y=t.node)==null?void 0:y.type.name}),p=l.computed(()=>Hs.find(g=>g.value===u.value));function f(g){var b;return g.value===u.value&&((b=t.editor)==null?void 0:b.isActive(u.value,g.options))}function h(g){switch(g.value){case"delete":break;case"duplicate":break;default:m(g);break}r("action",g)}function m(g){var E,v,_,C,D;const b=t.getPos();if(g.value===u.value&&d.value.indexOf(u.value)<0){const B=(E=t.editor)==null?void 0:E.isActive(u.value),A=(v=t.editor)==null?void 0:v.commands.lift(u.value);console.log("lift",u.value,B,A);return}const y=(_=t.editor)==null?void 0:_.commands,k=(C=t.editor)==null?void 0:C.chain().focus(b+1);console.log("runCommand",g),a(y,k,g.value,g.options),(D=t.editor)==null||D.commands.setNodeSelection(b)}return l.computed(()=>[{label:"editor.duplicate",value:"duplicate",icon:"content_copy",color:Ee.blue,tips:"Ctrl+D",group:"label.common"},{label:"editor.delete",value:"delete",icon:"delete",tips:"Ctrl+D",color:Ee.deepOrange}]),(g,b)=>(l.openBlock(),l.createElementBlock("section",GS,[c.value==="main"?(l.openBlock(),l.createElementBlock("section",jS,[p.value?(l.openBlock(),l.createElementBlock("section",JS,[YS,l.createElementVNode("section",XS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Hs),(y,k)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:k,icon:y.icon,tooltip:l.unref(i)(y.label),"content-class":{"is-active":f(y)},quaternary:"",onClick:E=>h(y)},null,8,["icon","tooltip","content-class","onClick"]))),128))])])):l.createCommentVNode("",!0),l.createVNode(l.unref(Xr),l.mergeProps(t,{colorful:"","show-group":"",onAction:h}),null,16)])):l.createCommentVNode("",!0)]))}}),Ym=l.defineComponent({__name:"DragNode",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}},emits:["action","dragstart","dragend"],setup(n,{emit:e}){const t=n,r=e,{run:o}=Pe(),i=l.ref(null),s=l.ref(!1),a=l.ref(["heading","codeBlock","paragraph"]),c=l.computed(()=>{var b,y,k;const g=(y=(b=t.node)==null?void 0:b.content)==null?void 0:y.content;if((g==null?void 0:g.length)>0){const E=g[0];if(E.type.name==="image")return E.type.name}return(k=t.node)==null?void 0:k.type.name}),d=l.computed(()=>{var b;let g=c.value;return g==="heading"?{icon:`format_h${((b=t.node.attrs)==null?void 0:b.level)||1}`,color:Ee.blue}:(g==="table-wrapper"&&(g="table"),dd.find(y=>y.value===g)||{icon:"title"})});function u(g){r("dragstart",g)}function p(g){r("dragend",g)}function f(g){var b;(b=i.value)==null||b.setShow(!1),r("action",g)}function h(g){s.value=g,console.log("show",g),g&&m()}function m(){var b;let g=t.getPos();a.value.includes(c.value)||(g+=1),(b=t.editor)==null||b.commands.setNodeSelection(g)}return l.watch(()=>t.getPos(),g=>{var b;(b=i.value)==null||b.setShow(!1)}),(g,b)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:i,placement:"left","tippy-class":"dropdown",trigger:"click",offset:[0,2],"onUpdate:show":h},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-drag-btn",{selected:s.value}]),contenteditable:"false",draggable:"true","data-drag-handle":"",onDragstart:u,onDragend:p},[l.createVNode(l.unref(Bt),{type:"tertiary",class:"o-node-btn"},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:d.value.icon,color:d.value.color,small:""},null,8,["name","color"]),l.createVNode(l.unref(ie),{name:"drag_indicator",small:""})]),_:1})],34)]),default:l.withCtx(()=>[l.createVNode(ZS,l.mergeProps(t,{onAction:f}),null,16)]),_:1},512))}}),Bt=l.defineComponent({__name:"OBtn",props:{icon:{type:String,default:""},iconClass:{type:[String,Object],default:""},type:{type:String,default:""}},emits:["click"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createElementBlock("button",{class:l.normalizeClass(["o-btn",n.type?`type-${n.type}`:""]),onClick:o[0]||(o[0]=i=>t("click",i))},[n.icon?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:n.icon,class:l.normalizeClass(n.iconClass)},null,8,["name","class"])):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"default")],2))}}),QS={class:"o-checkbox"},ex={class:"o-checkbox__main"},tx={class:"o-checkbox__suffix"},md=l.defineComponent({__name:"OCheckbox",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=l.computed({get(){return t.modelValue},set(i){r("update:modelValue",i)}});return(i,s)=>(l.openBlock(),l.createElementBlock("div",QS,[l.createElementVNode("div",ex,[l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>o.value=a),type:"checkbox"},null,512),[[l.vModelCheckbox,o.value]])]),l.createElementVNode("div",tx,l.toDisplayString(n.label),1)]))}}),Xt=l.defineComponent({__name:"ODivider",props:{vertical:{type:Boolean,default:!1}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["o-divider",{"o-divider-vertical":n.vertical}])},null,2))}}),nx={class:"o-input__prefix"},rx={class:"o-input__main"},ox={class:"o-input__suffix"},Ao=l.defineComponent({__name:"OInput",props:{modelValue:{type:String,default:""},clearable:{type:Boolean,default:!1},type:{type:String,default:""}},emits:["blur","update:modelValue"],setup(n,{expose:e,emit:t}){const r=n,o=t,i=l.ref(null),s=l.computed({get(){return r.modelValue},set(d){o("update:modelValue",d)}});function a(){var d;(d=i.value)==null||d.focus()}function c(){s.value="",a()}return e({clear:c,focus:a}),(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["o-input",`type-${n.type}`])},[l.createElementVNode("div",nx,[l.renderSlot(d.$slots,"prefix")]),l.createElementVNode("div",rx,[l.withDirectives(l.createElementVNode("input",{ref_key:"input",ref:i,"onUpdate:modelValue":u[0]||(u[0]=p=>s.value=p),onBlur:u[1]||(u[1]=p=>o("blur"))},null,544),[[l.vModelText,s.value]])]),l.createElementVNode("div",ox,[l.renderSlot(d.$slots,"suffix"),n.clearable&&s.value?(l.openBlock(),l.createBlock(ie,{key:0,name:"close",class:"clear o-tips",onClick:c})):l.createCommentVNode("",!0)])],2))}}),un=l.defineComponent({__name:"OList",props:{clickable:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("ul",{class:l.normalizeClass(["o-list",{clickable:n.clickable,hoverable:n.hoverable}])},[l.renderSlot(e.$slots,"default")],2))}}),ix={class:"o-list-item"},sx={class:"o-list-item__prefix"},ax={class:"o-list-item__main"},lx={class:"o-list-item__suffix"},Zt=l.defineComponent({__name:"OListItem",props:{hoverable:{type:Boolean,default:!1}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("li",ix,[l.createElementVNode("div",sx,[l.renderSlot(e.$slots,"prefix")]),l.createElementVNode("div",ax,[l.renderSlot(e.$slots,"default")]),l.createElementVNode("div",lx,[l.renderSlot(e.$slots,"suffix")])]))}}),qe=l.defineComponent({__name:"OPopover",props:{show:{type:Boolean,default:!1},arrow:{type:Boolean,default:!1},offset:{type:Array,default:function(){return[0,10]}},placement:{type:String,default:"bottom-start"},trigger:{type:String,default:"mouseenter focus"},tippyClass:{type:String,default:""},event:{type:Object,default:function(){return{}}}},emits:["update:show"],setup(n,{expose:e,emit:t}){const r=n,o=t,{theme:i}=Bi(),s=l.ref(null),a=l.ref(),c=l.ref();function d(h){var m,g,b,y;h?((g=c.value)==null||g.setProps({getReferenceClientRect:(m=r.event)!=null&&m.clientX?u:null}),(b=c.value)==null||b.show()):(y=c.value)==null||y.hide()}function u(){var h,m;return{width:0,height:0,left:r.event.clientX,right:r.event.clientX,top:r.event.clientY,bottom:r.event.clientY,x:((h=r.event)==null?void 0:h.clientX)||0,y:((m=r.event)==null?void 0:m.clientY)||0,toJSON:()=>{var g,b;return{width:100,height:100,left:((g=r.event)==null?void 0:g.clientX)||0,top:((b=r.event)==null?void 0:b.clientY)||0}}}}function p(){c.value=In(s.value,{appendTo:()=>document.body,animation:"shift-away",arrow:r.arrow,content:a.value,delay:100,duration:200,interactive:!0,placement:r.placement,trigger:r.trigger,theme:i.value,onShow:h=>{o("update:show",!0)},onHide:h=>{o("update:show",!1)}})}function f(){c.value.setProps({theme:i.value})}return l.watch(i,h=>{f()}),l.onMounted(()=>{p()}),e({setShow:d}),(h,m)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"triggerRef",ref:s,"data-tippy-role":"popover",class:"o-popover"},[l.renderSlot(h.$slots,"trigger"),l.createElementVNode("div",{ref_key:"contentRef",ref:a,class:l.normalizeClass(["popover-content",n.tippyClass])},[l.renderSlot(h.$slots,"default")],2)],512))}}),cx=l.defineComponent({__name:"OAlignDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.computed(()=>[{label:t("editor.left"),value:"left",icon:"format_align_center"},{label:t("editor.center"),value:"center",icon:"format_align_center"},{label:t("editor.right"),value:"right",icon:"format_align_right"},{label:t("editor.justify"),value:"justify",icon:"format_align_justify"}]);function s(a){var c;(c=o.value)==null||c.setShow(!1),r(e.editor,"textAlign",{textAlign:a})}return(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_align_center","content-class":"o-align-dropdown dropdown",tooltip:l.unref(t)("editor.align")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(d,u)=>{var p;return l.openBlock(),l.createBlock(l.unref(Zt),{key:u,class:l.normalizeClass({"is-active":(p=n.editor)==null?void 0:p.isActive({textAlign:d.value})}),onClick:f=>s(d.value)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:d.icon},null,8,["name"])]),suffix:l.withCtx(()=>{var f;return[(f=n.editor)!=null&&f.isActive({textAlign:d.value})?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.label)+" ",1)]),_:2},1032,["class","onClick"])}),128))]),_:1})]),_:1},512))}}),dx={class:"o-align-group"},ux=l.defineComponent({__name:"OAlignGroup",props:{editor:{type:Dn}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.computed(()=>[{label:t("editor.left"),value:"left",icon:"format_align_left"},{label:t("editor.center"),value:"center",icon:"format_align_center"},{label:t("editor.right"),value:"right",icon:"format_align_right"}]);function i(s){r(e.editor,"textAlign",{textAlign:s.value})}return(s,a)=>(l.openBlock(),l.createElementBlock("div",dx,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(c,d)=>{var u;return l.openBlock(),l.createBlock(Me,{key:d,icon:c.icon,tooltip:c.label,"content-class":{"is-active":(u=n.editor)==null?void 0:u.isActive({textAlign:c.value})},onClick:p=>i(c)},null,8,["icon","tooltip","content-class","onClick"])}),128))]))}}),px={class:"o-back-color-dropdown o-button-group"},fx=l.defineComponent({__name:"OBackColorDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.ref("#ffec3d");function s(){a(i.value)}function a(c){o.value.setShow(!1),i.value=c,r(e.editor,"backColor",{color:c})}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(_r),{trigger:"hover"},{trigger:l.withCtx(()=>[l.createElementVNode("div",px,[l.createVNode(l.unref(Bt),{icon:"ink_highlighter",class:"o-command-btn label",onClick:l.withModifiers(s,["stop"])},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"indicator",style:l.normalizeStyle(`background: ${i.value}`)},null,4)]),_:1},8,["onClick"]),l.createVNode(l.unref(Bt),{icon:"arrow_drop_down",class:"o-command-btn"})])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(t)("editor.highlightColor")),1)]),_:1})]),default:l.withCtx(()=>{var u;return[l.createVNode(l.unref(La),{"default-color":"","default-label":l.unref(t)("editor.noColor"),"active-color":(u=n.editor)==null?void 0:u.getAttributes("highlight").color,onSelect:a},null,8,["default-label","active-color"])]}),_:1},512))}}),hx=l.defineComponent({__name:"OFontFamilyDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.computed(()=>[{label:t("editor.default"),value:"system-ui"},{label:"Arial",value:"Arial",separator:!0},{label:"Arial Black",value:"Arial Black"},{label:"Georgia",value:"Georgia"},{label:"Impact",value:"Impact"},{label:"Helvetica",value:"Helvetica"},{label:"Roboto",value:"Roboto"},{label:"Tahoma",value:"Tahoma"},{label:"Times New Roman",value:"Times New Roman"},{label:"Verdana",value:"Verdana"},{label:"Courier New",value:"Courier New",separator:!0},{label:"Monaco",value:"Monaco"},{label:"Monospace",value:"monospace"}]);function s(a){var c;(c=o.value)==null||c.setShow(!1),r(e.editor,"fontFamily",{fontFamily:a})}return(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_font","content-class":"o-font-family-dropdown dropdown",tooltip:l.unref(t)("editor.fontFamily")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(d,u)=>{var p;return l.openBlock(),l.createElementBlock(l.Fragment,{key:u},[d.separator?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:l.normalizeClass({"is-active":(p=n.editor)==null?void 0:p.isActive("textStyle",{fontFamily:d.value})}),onClick:f=>s(d.value)},{suffix:l.withCtx(()=>{var f;return[(f=n.editor)!=null&&f.isActive("textStyle",{fontFamily:d.value})?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>[l.createElementVNode("span",{style:l.normalizeStyle(`font-family: ${d.value}`)},l.toDisplayString(d.label),5)]),_:2},1032,["class","onClick"])],64)}),128))]),_:1})]),_:1},512))}}),mx={class:"o-fore-color-dropdown o-button-group"},gx=l.defineComponent({__name:"OForeColorDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.ref("#ff4d4f");function s(){a(i.value)}function a(c){var d;(d=o.value)==null||d.setShow(!1),i.value=c,r(e.editor,"foreColor",{color:c})}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(_r),null,{trigger:l.withCtx(()=>[l.createElementVNode("div",mx,[l.createVNode(l.unref(Bt),{icon:"format_color_text",class:"o-command-btn label",onClick:l.withModifiers(s,["stop"])},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"indicator",style:l.normalizeStyle(`background: ${i.value}`)},null,4)]),_:1},8,["onClick"]),l.createVNode(l.unref(Bt),{icon:"arrow_drop_down",class:"o-command-btn"})])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(t)("editor.textColor")),1)]),_:1})]),default:l.withCtx(()=>{var u;return[l.createVNode(l.unref(La),{"default-color":"","default-label":l.unref(t)("editor.defaultColor"),"active-color":(u=n.editor)==null?void 0:u.getAttributes("textStyle").color,onSelect:a},null,8,["default-label","active-color"])]}),_:1},512))}}),bx=l.defineComponent({__name:"OHeadingDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.computed(()=>[{label:t("editor.paragraph"),value:"paragraph",valueAlt:"",icon:"title"},{label:t("editor.heading1"),value:"heading",valueAlt:1,icon:"format_h1",separator:!0},{label:t("editor.heading2"),value:"heading",valueAlt:2,icon:"format_h2"},{label:t("editor.heading3"),value:"heading",valueAlt:3,icon:"format_h3"},{label:t("editor.heading4"),value:"heading",valueAlt:4,icon:"format_h4"},{label:t("editor.heading5"),value:"heading",valueAlt:5,icon:"format_h5"}]);function s(c){var d,u;return c.value==="heading"?(d=e.editor)==null?void 0:d.isActive(c.value,{level:c.valueAlt}):(u=e.editor)==null?void 0:u.isActive(c.value)}function a(c){var d;(d=o.value)==null||d.setShow(!1),r(e.editor,c.value,{level:c.valueAlt})}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_header_pound","content-class":"o-heading-dropdown dropdown",tooltip:l.unref(t)("editor.heading")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(u,p)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:p},[u.separator?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:l.normalizeClass({"is-active":s(u)}),onClick:f=>a(u)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:u.icon},null,8,["name"])]),suffix:l.withCtx(()=>[s(u)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(u.label)+" ",1)]),_:2},1032,["class","onClick"])],64))),128))]),_:1})]),_:1},512))}}),yx={class:"o-list-dropdown o-button-group"},vx=l.defineComponent({__name:"OListDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.ref();function s(){r(e.editor,i.value.value)}function a(d){o.value.setShow(!1),i.value=d,r(e.editor,d.value)}const c=l.computed(()=>[{label:t("editor.unorderedList"),value:"bulletList",icon:"format_list_bulleted"},{label:t("editor.orderedList"),value:"orderedList",icon:"format_list_numbered"},{label:t("editor.todoList"),value:"taskList",icon:"check_box"}]);return l.onMounted(()=>{i.value=c.value[0]}),(d,u)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(_r),{trigger:"hover"},{trigger:l.withCtx(()=>{var p;return[l.createElementVNode("div",yx,[l.createVNode(l.unref(Bt),{icon:(p=i.value)==null?void 0:p.icon,class:"o-command-btn",onClick:l.withModifiers(s,["stop"])},null,8,["icon","onClick"]),l.createVNode(l.unref(Bt),{icon:"arrow_drop_down",class:"o-command-btn"})])]}),default:l.withCtx(()=>{var p;return[l.createTextVNode(" "+l.toDisplayString((p=i.value)==null?void 0:p.label),1)]}),_:1})]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,(p,f)=>{var h;return l.openBlock(),l.createBlock(l.unref(Zt),{key:f,class:l.normalizeClass({"is-active":(h=n.editor)==null?void 0:h.isActive(p.value)}),onClick:m=>a(p)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:p.icon},null,8,["name"])]),suffix:l.withCtx(()=>{var m;return[(m=n.editor)!=null&&m.isActive(p.value)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(p.label)+" ",1)]),_:2},1032,["class","onClick"])}),128))]),_:1})]),_:1},512))}}),kx={class:"o-list-group"},wx=l.defineComponent({__name:"OListGroup",props:{editor:{type:Dn,required:!0}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.computed(()=>[{label:t("editor.unorderedList"),value:"bulletList",icon:"format_list_bulleted"},{label:t("editor.orderedList"),value:"orderedList",icon:"format_list_numbered"},{label:t("editor.todoList"),value:"taskList",icon:"check_box"}]);function i(s){r(e.editor,s.value)}return(s,a)=>(l.openBlock(),l.createElementBlock("div",kx,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(c,d)=>{var u;return l.openBlock(),l.createBlock(Me,{key:d,icon:c.icon,tooltip:c.label,"content-class":{"is-active":(u=n.editor)==null?void 0:u.isActive(c.value)},onClick:p=>i(c)},null,8,["icon","tooltip","content-class","onClick"])}),128))]))}}),Ex=l.defineComponent({__name:"OLinkBtn",props:{editor:{type:Dn,required:!0}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(),i=l.ref(!1),s=l.ref(""),a=l.ref(!0);function c(){var f;s.value="",a.value=!0;const p=(f=e.editor)==null?void 0:f.getAttributes("link");p!=null&&p.href&&(s.value=p.href,a.value=p.target==="_blank",console.log("show",i.value,p,a.value))}function d(){var p;(p=o.value)==null||p.setShow(!1)}function u(p){var f;p?r(e.editor,"linkSet",{href:p,target:a.value?"_blank":""}):r(e.editor,"linkUnset"),(f=o.value)==null||f.setShow(!1)}return(p,f)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",placement:"bottom",trigger:"click",arrow:"",show:i.value,"onUpdate:show":[f[1]||(f[1]=h=>i.value=h),c]},{trigger:l.withCtx(()=>{var h;return[l.createVNode(l.unref(st),{icon:"link","content-class":{"is-active":(h=n.editor)==null?void 0:h.isActive("link")},tooltip:l.unref(t)("editor.hyperlink")},null,8,["content-class","tooltip"])]}),default:l.withCtx(()=>[i.value?(l.openBlock(),l.createBlock(l.unref(hd),{key:0,title:l.unref(t)("editor.hyperlink"),val:s.value,icon:"link",onCancel:d,onConfirm:u},{"header-right":l.withCtx(()=>[l.createVNode(l.unref(md),{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),label:l.unref(t)("link.open_in_new_tab")},null,8,["modelValue","label"])]),_:1},8,["title","val"])):l.createCommentVNode("",!0)]),_:1},8,["show"]))}}),Cx=l.defineComponent({__name:"OLinkEditBtn",props:{editor:{type:Dn,required:!0}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(),i=l.ref(!1),s=l.ref(""),a=l.ref(!0);function c(){var f;s.value="",a.value=!0;const p=(f=e.editor)==null?void 0:f.getAttributes("link");p!=null&&p.href&&(s.value=p.href,a.value=p.target==="_blank")}function d(){var p;(p=o.value)==null||p.setShow(!1)}function u(p){var f;p?r(e.editor,"linkSet",{href:p,target:a.value?"_blank":""}):r(e.editor,"linkUnset"),(f=o.value)==null||f.setShow(!1)}return(p,f)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",placement:"bottom",trigger:"click",arrow:"",show:i.value,"onUpdate:show":[f[1]||(f[1]=h=>i.value=h),c]},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"edit",tooltip:l.unref(t)("link.edit")},null,8,["tooltip"])]),default:l.withCtx(()=>[i.value?(l.openBlock(),l.createBlock(l.unref(hd),{key:0,title:l.unref(t)("link.edit"),val:s.value,icon:"link",onCancel:d,onConfirm:u},{"header-right":l.withCtx(()=>[l.createVNode(l.unref(md),{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),label:l.unref(t)("link.open_in_new_tab")},null,8,["modelValue","label"])]),_:1},8,["title","val"])):l.createCommentVNode("",!0)]),_:1},8,["show"]))}}),_x=l.defineComponent({__name:"OLinkOpenBtn",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve();function r(){var i;const o=(i=e.editor)==null?void 0:i.getAttributes("link");o!=null&&o.href&&window.open(o.href,"target")}return(o,i)=>(l.openBlock(),l.createBlock(Me,{icon:"open_in_new",tooltip:l.unref(t)("link.open"),"content-class":"o-link-open-btn",onClick:r},null,8,["tooltip"]))}}),Sx=["bold","italic","text-format-dropdown","separator","heading","font-family","text-color-dropdown","fore-color","back-color","clearFormat","separator","align-dropdown","separator","horizontalRule","blockquote","list-dropdown","codeBlock","link","image","video","modelViewer","table","callout","columns","aiViewer"],xx=["table-group","separator","bold","italic","text-format-dropdown","separator","heading","font-family","text-color-dropdown","clearFormat","separator","align-dropdown","separator","horizontalRule","blockquote","list-dropdown","link","image"],Nx=["bold","strike","text-color-dropdown","clearFormat","separator","list-group","link","callout","separator","align-dropdown","more"],Tx=["link-open","link-edit","linkUnset"],Ox=["align-group","separator","link"],Mx=["align-group","separator","link-open","link-edit","linkUnset"],Ax=["heading","separator","italic","underline","font-family","separator","code","blockquote"],Rx=["table-group","separator","bold","italic","font-family","text-color-dropdown","separator","align-group"],Dx=["style-dropdown","separator","bold","italic","text-color-dropdown","separator","align-dropdown"],Ix={class:"o-command-btn"},Bx={class:"o-more-bubble"},Lx=l.defineComponent({__name:"OMoreBubble",props:{editor:{type:Dn,required:!0}},setup(n){const e=l.ref();return(t,r)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:e,offset:[4,10],class:"o-simple-command-btn","tippy-class":"o-more-bubble-popover",placement:"top-end",size:"medium",trigger:"mouseenter"},{trigger:l.withCtx(()=>[l.createElementVNode("div",Ix,[l.createVNode(l.unref(ie),{name:"more_horiz"})])]),default:l.withCtx(()=>[l.createElementVNode("section",Bx,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Ax),(o,i)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:i},[o==="separator"?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0,vertical:""})):typeof o=="string"?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Pa)(o)),{key:1,name:o,editor:n.editor},null,8,["name","editor"])):l.createCommentVNode("",!0)],64))),128))])]),_:1},512))}}),Px=l.defineComponent({__name:"OStyleDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.computed(()=>[{label:t("editor.paragraph"),value:"paragraph",icon:"title"},{label:t("editor.heading1"),value:"heading",icon:"format_h1",options:{level:1}},{label:t("editor.heading2"),value:"heading",icon:"format_h2",options:{level:2}},{label:t("editor.heading3"),value:"heading",icon:"format_h3",options:{level:3}},{label:t("editor.todoList"),value:"taskList",icon:"check_box"},{label:t("editor.unorderedList"),value:"bulletList",icon:"format_list_bulleted"},{label:t("editor.orderedList"),value:"orderedList",icon:"format_list_numbered"},{label:t("editor.blockquote"),value:"blockquote",icon:"format_quote_open"},{label:t("editor.removeFormat"),value:"clearFormat",icon:"format_clear",separator:!0}]);function s(c){var d;return(d=e.editor)==null?void 0:d.isActive(c.value,c.options)}function a(c){o.value.setShow(!1),r(e.editor,c.value,c.options)}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",trigger:"click"},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_paint","content-class":"o-style-dropdown o-command-btn dropdown",tooltip:l.unref(t)("label.styles")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(u,p)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:p},[u.separator?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:l.normalizeClass({"is-active":s(u)}),onClick:f=>a(u)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:u.icon},null,8,["name"])]),suffix:l.withCtx(()=>[s(u)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(u.label)+" ",1)]),_:2},1032,["class","onClick"])],64))),128))]),_:1})]),_:1},512))}}),$x=l.defineComponent({__name:"OTableBtn",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null);function i(s){var a;(a=o.value)==null||a.setShow(!1),r(e.editor,"tableInsert",s)}return(s,a)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",placement:"bottom",trigger:"click",arrow:""},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"window","content-class":"o-table-btn",tooltip:l.unref(t)("table.insert")},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(Wm),{onSelect:i})]),_:1},512))}}),Fx={class:"o-table-group"},zx=l.defineComponent({__name:"OTableGroup",props:{editor:{type:Dn,required:!0}},setup(n){const{tr:e}=ve(),{run:t}=Pe();return(r,o)=>{var i,s;return l.openBlock(),l.createElementBlock("section",Fx,[(i=n.editor)!=null&&i.can().mergeCells()?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,icon:"cell_merge",tooltip:l.unref(e)("table.merge"),onClick:o[0]||(o[0]=a=>l.unref(t)(n.editor,"tableMergeCells"))},null,8,["tooltip"])):l.createCommentVNode("",!0),(s=n.editor)!=null&&s.can().splitCell()?(l.openBlock(),l.createBlock(l.unref(Me),{key:1,icon:"splitscreen_left",tooltip:l.unref(e)("table.split"),onClick:o[1]||(o[1]=a=>l.unref(t)(n.editor,"tableSplitCell"))},null,8,["tooltip"])):l.createCommentVNode("",!0),l.createVNode(l.unref(qm),{editor:n.editor},null,8,["editor"])])}}}),Vx=l.defineComponent({__name:"OTextColorDropdown",props:{editor:{type:Dn,required:!0}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.ref(""),s=l.ref("");function a(c,d){c==="foreColor"?(i.value=d,localStorage.setItem("yiitap.text-color.fore",d)):c==="backColor"&&(s.value=d,localStorage.setItem("yiitap.text-color.back",d)),o.value.setShow(!1),r(e.editor,c,{color:d})}return l.onMounted(()=>{i.value=localStorage.getItem("yiitap.text-color.fore")||"",s.value=localStorage.getItem("yiitap.text-color.back")||""}),(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_text","content-class":"o-text-color-dropdown dropdown",tooltip:l.unref(t)("editor.textColor")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>{var u;return[l.createVNode(l.unref(Km),{"fore-color":i.value,"back-color":s.value,"default-label":l.unref(t)("editor.defaultColor"),"active-color":(u=n.editor)==null?void 0:u.getAttributes("textStyle").color,onSelect:a},null,8,["fore-color","back-color","default-label","active-color"])]}),_:1},512))}}),Hx=l.defineComponent({__name:"OTextFormatDropdown",props:{editor:{type:Dn,required:!0}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(),i=l.computed(()=>[{label:t("editor.strikethrough"),value:"strike",icon:"format_strikethrough"},{label:t("editor.underline"),value:"underline",icon:"format_underlined"},{label:t("editor.code"),value:"code",icon:"code"}]);function s(a){var c;(c=o.value)==null||c.setShow(!1),r(e.editor,a)}return(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"title","content-class":"o-text-format-dropdown dropdown",tooltip:l.unref(t)("editor.textFormat")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(d,u)=>{var p;return l.openBlock(),l.createBlock(l.unref(Zt),{key:u,class:l.normalizeClass({"is-active":(p=n.editor)==null?void 0:p.isActive(d.value)}),onClick:f=>s(d.value)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:d.icon},null,8,["name"])]),suffix:l.withCtx(()=>{var f;return[(f=n.editor)!=null&&f.isActive(d.value)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.label)+" ",1)]),_:2},1032,["class","onClick"])}),128))]),_:1})]),_:1},512))}}),Ux={"align-dropdown":cx,"align-group":ux,"back-color":fx,"font-family":hx,"fore-color":gx,heading:bx,"list-dropdown":vx,"list-group":wx,link:Ex,"link-edit":Cx,"link-open":_x,more:Lx,"style-dropdown":Px,table:$x,"table-group":zx,"text-color-dropdown":Vx,"text-format-dropdown":Hx},Pa=n=>Ux[n]||N_,Wx={class:"o-main-menu"},qx={class:"left"},Kx={class:"right"},Xm=l.defineComponent({__name:"OMainMenu",props:{editor:{type:Object},menu:{type:Array,default:function(){return[]}}},setup(n){const e=n,t=l.computed(()=>{var o;let r=e.menu;return(o=e.editor)!=null&&o.isActive("table")&&(r=xx),r.length>0?r:Sx});return(r,o)=>(l.openBlock(),l.createElementBlock("section",Wx,[l.createElementVNode("section",qx,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.value,(i,s)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s},[i==="separator"?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0,vertical:""})):typeof i=="string"?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Pa)(i)),{key:1,name:i,editor:n.editor},null,8,["name","editor"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i),{key:2,editor:n.editor},null,8,["editor"]))],64))),128)),l.renderSlot(r.$slots,"left")]),l.createElementVNode("section",Kx,[l.renderSlot(r.$slots,"right")])]))}}),Gx={key:0,class:"o-bubble-menu"},jx={class:"container"},Jx=l.defineComponent({__name:"OBubbleMenu",props:{editor:{type:Object},menu:{type:Array,default:function(){return[]}},tableToolbar:{type:Array,default:function(){return[]}},menuClass:{type:String,default:""}},setup(n){const e=n,{tr:t}=ve(),{theme:r}=Bi(),o=l.ref(!1),i=l.ref({duration:100,placement:"top",role:"popover",arrow:!1,onShow:()=>{o.value=!1}});function s(){o.value=!0}function a(f){const{schema:h}=e.editor,m=h.marks.link;if(!m||!f)return!1;const{$from:g,$to:b}=f;return!!Mo(g,m)}function c({editor:f,view:h,state:m,oldState:g,from:b,to:y}){var $;const{doc:k,selection:E}=m,{empty:v}=E,_=!k.textBetween(b,y).length&&Aa(m.selection);if(!h.hasFocus()||v||_&&f.isActive("link")&&!f.isActive("image"))return!1;const C=["image"],D=["toc","video","model-viewer"],B=E.node,A=($=B==null?void 0:B.type)==null?void 0:$.name;return!(f.isActive("codeBlock")||D.indexOf(A)>=0||A&&!C.includes(A))}const d=l.computed(()=>{if(e.editor){const{state:f}=e.editor,{tr:h}=f,{selection:m}=h;return a(m)}else return!1}),u=l.computed(()=>{var f;return!o.value&&d.value&&!((f=e.editor)!=null&&f.isActive("image"))}),p=l.computed(()=>{var h,m;let f=e.menu;return o.value||((h=e.editor)!=null&&h.isActive("image")?f=d.value?Mx:Ox:(m=e.editor)!=null&&m.isActive("table")?f=Rx:d.value&&(f=Tx)),f.length>0?f:Nx});return l.onMounted(()=>{o.value=!1}),(f,h)=>n.editor?(l.openBlock(),l.createElementBlock("section",Gx,[l.createVNode(l.unref(yC),{class:l.normalizeClass(["bubble-menu",n.menuClass]),editor:n.editor,"should-show":c,"tippy-options":i.value},{default:l.withCtx(()=>[l.createElementVNode("section",jx,[u.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(l.unref(Me),{icon:"arrow_back",tooltip:l.unref(t)("link.back"),onClick:s},null,8,["tooltip"]),l.createVNode(l.unref(Xt),{vertical:""})],64)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,(m,g)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:g},[m==="separator"?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0,vertical:""})):typeof m=="string"?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Pa)(m)),{key:1,name:m,editor:n.editor},null,8,["name","editor"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(m),{key:2,editor:n.editor},null,8,["editor"]))],64))),128))])]),_:1},8,["class","editor","tippy-options"])])):l.createCommentVNode("",!0)}}),Yx={key:0,class:"o-floating-menu"},Xx={class:"container"},Zx=l.defineComponent({__name:"OFloatingMenu",props:{editor:{type:Object},menu:{type:Array,default:function(){return[]}},tableToolbar:{type:Array,default:function(){return[]}},menuClass:{type:String,default:""}},setup(n){const e=n,t=l.ref(!1),r=l.ref({arrow:!1,duration:100,role:"popover",placement:"right",offset:[0,168]});function o(){t.value=!0}function i(d){const{schema:u}=e.editor,p=u.marks.link;if(!p||!d)return!1;const{$from:f,$to:h}=d;return!!Mo(f,p)}const s=l.computed(()=>{if(e.editor){const{state:d}=e.editor,{tr:u}=d,{selection:p}=u;return i(p)}else return!1}),a=l.computed(()=>!t.value&&s.value),c=l.computed(()=>{let d=e.menu;return d.length>0?d:Dx});return(d,u)=>n.editor?(l.openBlock(),l.createElementBlock("section",Yx,[l.createVNode(l.unref(wC),{class:l.normalizeClass(["floating-menu",n.menuClass]),editor:n.editor,"tippy-options":r.value},{default:l.withCtx(()=>[l.createElementVNode("section",Xx,[a.value?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,icon:"arrow_back",onClick:o})):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,(p,f)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:f},[p==="separator"?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0,vertical:""})):typeof p=="string"?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Pa)(p)),{key:1,name:p,editor:n.editor},null,8,["name","editor"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(p),{key:2,editor:n.editor},null,8,["editor"]))],64))),128))])]),_:1},8,["class","editor","tippy-options"])])):l.createCommentVNode("",!0)}});function gd(n,e){const t=e==null?void 0:e.posAtCoords(n);if(!t)return;let r=Cs(t.pos,e);if(r!==e.dom){for(;r&&r.parentNode&&r.parentNode!==e.dom;)r=r.parentNode;if(r)return r}}function Cs(n,e){return e.nodeDOM(n)||e.domAtPos(n).node}function bd(n,e){const t=gd(n,e);if(t&&t.nodeType===1){const r=e.docView,o=r.nearestDesc(t,!0);return!o||o===r?null:o.posBefore}return null}function Qx(n,e){let t,r;const o=e.resolve(n.from).node().type.spec.group==="blockContent",i=e.resolve(n.to).node().type.spec.group==="blockContent",s=Math.min(n.$anchor.depth,n.$head.depth);if(o&&i){const a=n.$from.start(s-1),c=n.$to.end(s-1);t=e.resolve(a-1).pos,r=e.resolve(c+1).pos}else t=n.from,r=n.to;return{from:t,to:r}}function eN(n,e){const t=bd(n,e.view);return t&&t>=0?{node:e.state.doc.nodeAt(t),pos:t}:{node:null,pos:t}}const qs=new $e("sideMenu");class tN{constructor(){De(this,"hovered",!1);De(this,"coords",{left:0,top:0});De(this,"className","")}init(e){return this}apply({tr:e,oldState:t,newState:r}){return e.docChanged?this:this}setHover(e,t,r=""){this.hovered=e,this.coords=t,this.className=r}}class nN{constructor({editor:e,element:t,view:r,tippyOptions:o={},updateDelay:i=250}){De(this,"editor");De(this,"element");De(this,"view");De(this,"preventHide",!1);De(this,"tippy");De(this,"tippyOptions");De(this,"updateDelay");De(this,"updateDebounceTimer");De(this,"mousedownHandler",()=>{this.preventHide=!0});De(this,"onDragStart",e=>{this.hide()});De(this,"blurHandler",({event:e})=>{var t;e!=null&&e.relatedTarget&&((t=this.element.parentNode)!=null&&t.contains(e.relatedTarget))||this.hide()});De(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});De(this,"handleDebouncedUpdate",(e,t)=>{const r=!(t!=null&&t.selection.eq(e.state.selection)),o=!(t!=null&&t.doc.eq(e.state.doc));!r&&!o||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,r,o,t)},this.updateDelay))});De(this,"updateHandler",(e,t,r,o)=>{var u,p;const{state:i,composing:s}=e,{coords:a}=qs.getState(i),c=gd(a,e),d=bd(a,e);!c||d<=0||(this.createTooltip(),(p=this.tippy)==null||p.setProps({getReferenceClientRect:((u=this.tippyOptions)==null?void 0:u.getReferenceClientRect)||(()=>c.getBoundingClientRect())}),this.show())});this.editor=e,this.element=t,this.view=r,this.updateDelay=i,this.view.dom.addEventListener("dragstart",this.onDragStart),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=In(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"left",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,o=!(t!=null&&t.selection.eq(e.state.selection)),i=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,i,t)}show(){var e;(e=this.tippy)==null||e.show()}hide(){var e;(e=this.tippy)==null||e.hide()}destroy(){var e,t;(e=this.tippy)!=null&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)==null||t.destroy(),this.view.dom.removeEventListener("dragstart",this.onDragStart)}}const rN=(n,e)=>{if(!n.dataTransfer)return;const t=e.view,r=t.dom.getBoundingClientRect(),o={left:r.left+r.width/2,top:n.clientY},i=bd(o,t);if(i===null)return;const s=t.state.selection,a=t.state.doc;Qx(s,a),t.dispatch(t.state.tr.setSelection(G.create(t.state.doc,i))),iN(t,i);const c=t.state.selection.content(),{dom:d,text:u}=t.serializeForClipboard(c);n.dataTransfer.clearData(),n.dataTransfer.setData("text/html",d.innerHTML),n.dataTransfer.setData("text/plain",u),n.dataTransfer.effectAllowed="move",n.dataTransfer.setDragImage(zr,0,0),t.dragging={slice:c,move:!0}},oN=(n,e)=>{Zm()};let zr;function iN(n,e,t=e){const r=n.domAtPos(e).node.cloneNode(!0),o=n.domAtPos(e).node,i=(p,f)=>Array.prototype.indexOf.call(p.children,f),s=p=>{let f=p,h=f.parentElement;for(;h;){if(h===n.dom)return f;f=h,h=f.parentElement}return f};let a=-1,c=-1;e===t?(a=i(o,s(Cs(e,n))),c=a):(a=i(o,s(Cs(e+1,n))),c=i(o,s(Cs(t-1,n))));for(let p=o.childElementCount-1;p>=0;p--)(p>a||p<c)&&r.removeChild(r.children[p]);Zm(),zr=r;const u=n.dom.className.split(" ").filter(p=>p!=="ProseMirror"&&p!=="yiitap-root"&&p!=="yiitap-editor").join(" ");zr.className+=" yiitap-dragging-preview "+u,document.body.appendChild(zr)}function Zm(){zr!==void 0&&(document.body.removeChild(zr),zr=void 0)}class sN{constructor(e){De(this,"options");De(this,"plugin");De(this,"sideMenuView");const t=new tN;this.options=e,this.plugin=new Te({key:qs,props:{handleDOMEvents:{mouseover(r,o){const i={left:o.clientX,top:o.clientY},s=gd(i,r),a=(s==null?void 0:s.className)||"",c=t.className;a.indexOf("o-table-wrapper-view")>=0&&c.indexOf("o-table-wrapper-view")>=0||(t.setHover(!0,i,a),r.dispatch(r.state.tr.setMeta(qs,t)))}}},state:{init(r,o){return t.init(o)},apply(r,o,i,s){return t.apply({tr:r,oldState:i,newState:s})}},view:r=>(this.sideMenuView=new nN({view:r,...e}),this.sideMenuView)})}dragstart(e){rN(e,this.options.editor)}dragend(e){oN(e,this.options.editor)}}const aN=l.defineComponent({name:"SideMenu",props:{pluginKey:{type:[String,Object],default:"sideMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})}},setup(n,{expose:e,slots:t}){const r=l.ref(null),o=l.ref(),i=a=>{var c;(c=o.value)==null||c.dragstart(a)},s=a=>{var c;(c=o.value)==null||c.dragend(a)};return l.onMounted(()=>{const{pluginKey:a,editor:c,updateDelay:d,tippyOptions:u}=n;o.value=new sN({updateDelay:d,editor:c,element:r.value,pluginKey:a,tippyOptions:u}),c.registerPlugin(o.value.plugin)}),l.onBeforeUnmount(()=>{const{pluginKey:a,editor:c}=n;c.unregisterPlugin(a)}),e({...n,dragstart:i,dragend:s}),()=>{var a;return l.h("div",{ref:r},(a=t.default)==null?void 0:a.call(t))}}}),lN={key:0,class:"o-side-menu"},cN={class:"container"},dN=l.defineComponent({__name:"OSideMenu",props:{editor:{type:Dn,required:!0},menuClass:{type:String,default:""}},setup(n){const e=n,t=l.ref(null),r=l.ref(null),o=l.ref(0),i=l.computed(()=>({arrow:!1,duration:100,placement:"left"})),s=l.computed(()=>({editor:e.editor,node:r.value,decorations:[],selected:!1,extension:{},getPos:()=>o.value,pos:o.value,updateAttributes:c,deleteNode:a,view:void 0,innerDecorations:[],HTMLAttributes:void 0}));function a(){var m,g;const f=o.value,h=f+((m=r.value)==null?void 0:m.nodeSize);(g=e.editor)==null||g.commands.deleteRange({from:f,to:h})}function c(f){var h;(h=e.editor)==null||h.commands.command(({tr:m})=>{var g;return m.setNodeMarkup(o.value,void 0,{...(g=r.value)==null?void 0:g.attrs,...f}),!0})}function d({editor:f,transaction:h}){let m={left:0,top:0};const g=qs.getState(e.editor.view.state);if(g){m=g.coords;const b=eN(m,f);b.node&&b.pos>0&&(r.value=b.node,o.value=b.pos)}}function u(f){var h;(h=t.value)==null||h.dragstart(f)}function p(f){var h;(h=t.value)==null||h.dragend(f)}return l.onMounted(()=>{var f;(f=e.editor)==null||f.on("transaction",d)}),(f,h)=>n.editor?(l.openBlock(),l.createElementBlock("section",lN,[l.createVNode(l.unref(aN),{ref_key:"menu",ref:t,class:l.normalizeClass(["side-menu",n.menuClass]),editor:n.editor,"tippy-options":i.value},{default:l.withCtx(()=>[l.createElementVNode("section",cN,[r.value?(l.openBlock(),l.createBlock(l.unref(Jm),l.normalizeProps(l.mergeProps({key:0},s.value)),null,16)):l.createCommentVNode("",!0),r.value?(l.openBlock(),l.createBlock(l.unref(Ym),l.mergeProps({key:1},s.value,{onDragstart:u,onDragend:p}),null,16)):l.createCommentVNode("",!0)])]),_:1},8,["class","editor","tippy-options"])])):l.createCommentVNode("",!0)}}),uN=l.defineComponent({__name:"view",props:ct,setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-blockquote-view"}),{default:l.withCtx(()=>[l.createElementVNode("blockquote",null,[l.createVNode(l.unref(Xn))])]),_:1},16))}}),pN=Dm.extend({draggable:!0,addNodeView(){return yn(uN)}}),fN={class:"callout-container"},hN={class:"callout-icon"},mN={class:"callout-content"},gN=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,{theme:t}=Bi(),r=l.ref(!1),o=l.ref(!1),i=l.ref({}),s=l.computed(()=>{e.editor.isActive("callout");const{selection:b}=e.editor.view.state,y=b.from,k=e.getPos(),E=k+e.node.nodeSize;return y>=k&&y<=E});l.computed(()=>e.node.attrs);const a=l.computed({get(){return e.node.attrs.backColor},set(b){e.updateAttributes({backColor:b})}}),c=l.computed({get(){return e.node.attrs.backColorDark},set(b){e.updateAttributes({backColorDark:b})}}),d=l.computed({get(){return e.node.attrs.borderColor},set(b){e.updateAttributes({borderColor:b})}}),u=l.computed({get(){return e.node.attrs.borderColorDark},set(b){e.updateAttributes({borderColorDark:b})}}),p=l.computed(()=>t.value==="dark"?c.value:a.value),f=l.computed(()=>t.value==="dark"?u.value:d.value);function h(b){switch(r.value=!1,b.value){case"palette":g(!0);break}}function m(b){r.value=!0,i.value=b}function g(b){o.value=b}return l.watch(s,b=>{g(b)}),(b,y)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-callout-view",style:`--callout-border-color: ${f.value}; --callout-back-color: ${p.value}`,onContextmenu:l.withModifiers(m,["prevent"])}),{default:l.withCtx(()=>[l.createElementVNode("div",fN,[l.createElementVNode("div",hN,l.toDisplayString(b.node.attrs.icon),1),l.createElementVNode("div",mN,[l.createVNode(l.unref(Xn))]),l.createVNode(l.unref(Ba),{modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=k=>r.value=k),event:i.value},{default:l.withCtx(()=>[l.createVNode(l.unref(Xr),l.mergeProps(e,{onAction:h}),null,16)]),_:1},8,["modelValue","event"])])]),_:1},16,["style","onContextmenu"]))}}),bN=Ke.create({name:"callout",group:"block",content:"block+",draggable:!0,addAttributes(){return{icon:{default:"🌾"},borderColor:{default:"#dddddd"},borderColorDark:{default:"#333333"},backColor:{default:"#eeeeee"},backColorDark:{default:"rgba(101, 117, 133, 0.16)"}}},parseHTML(){return[{tag:'div[data-type="callout"]'}]},renderHTML({HTMLAttributes:n}){return["div",_e(n,{"data-type":"callout"}),0]},addCommands(){return{setCallout:()=>({commands:n})=>n.wrapIn(this.name),toggleCallout:()=>({commands:n})=>n.toggleWrap(this.name),unsetCallout:()=>({commands:n})=>n.lift(this.name)}},addNodeView(){return yn(gN)}});function yN(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Qm(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e],r=typeof t;(r==="object"||r==="function")&&!Object.isFrozen(t)&&Qm(t)}),n}class _p{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function eg(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function pr(n,...e){const t=Object.create(null);for(const r in n)t[r]=n[r];return e.forEach(function(r){for(const o in r)t[o]=r[o]}),t}const vN="</span>",Sp=n=>!!n.scope,kN=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${e}${n}`};class wN{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=eg(e)}openNode(e){if(!Sp(e))return;const t=kN(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){Sp(e)&&(this.buffer+=vN)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const xp=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class yd{constructor(){this.rootNode=xp(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=xp({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(r=>this._walk(e,r)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{yd._collapse(t)}))}}class EN extends yd{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const r=e.root;t&&(r.scope=`language:${t}`),this.add(r)}toHTML(){return new wN(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ei(n){return n?typeof n=="string"?n:n.source:null}function tg(n){return Zr("(?=",n,")")}function CN(n){return Zr("(?:",n,")*")}function _N(n){return Zr("(?:",n,")?")}function Zr(...n){return n.map(t=>Ei(t)).join("")}function SN(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function vd(...n){return"("+(SN(n).capture?"":"?:")+n.map(r=>Ei(r)).join("|")+")"}function ng(n){return new RegExp(n.toString()+"|").exec("").length-1}function xN(n,e){const t=n&&n.exec(e);return t&&t.index===0}const NN=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function kd(n,{joinWith:e}){let t=0;return n.map(r=>{t+=1;const o=t;let i=Ei(r),s="";for(;i.length>0;){const a=NN.exec(i);if(!a){s+=i;break}s+=i.substring(0,a.index),i=i.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+o):(s+=a[0],a[0]==="("&&t++)}return s}).map(r=>`(${r})`).join(e)}const TN=/\b\B/,rg="[a-zA-Z]\\w*",wd="[a-zA-Z_]\\w*",og="\\b\\d+(\\.\\d+)?",ig="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",sg="\\b(0b[01]+)",ON="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",MN=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=Zr(e,/.*\b/,n.binary,/\b.*/)),pr({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,r)=>{t.index!==0&&r.ignoreMatch()}},n)},Ci={begin:"\\\\[\\s\\S]",relevance:0},AN={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ci]},RN={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ci]},DN={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},$a=function(n,e,t={}){const r=pr({scope:"comment",begin:n,end:e,contains:[]},t);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=vd("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Zr(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},IN=$a("//","$"),BN=$a("/\\*","\\*/"),LN=$a("#","$"),PN={scope:"number",begin:og,relevance:0},$N={scope:"number",begin:ig,relevance:0},FN={scope:"number",begin:sg,relevance:0},zN={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ci,{begin:/\[/,end:/\]/,relevance:0,contains:[Ci]}]},VN={scope:"title",begin:rg,relevance:0},HN={scope:"title",begin:wd,relevance:0},UN={begin:"\\.\\s*"+wd,relevance:0},WN=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var Xi=Object.freeze({__proto__:null,APOS_STRING_MODE:AN,BACKSLASH_ESCAPE:Ci,BINARY_NUMBER_MODE:FN,BINARY_NUMBER_RE:sg,COMMENT:$a,C_BLOCK_COMMENT_MODE:BN,C_LINE_COMMENT_MODE:IN,C_NUMBER_MODE:$N,C_NUMBER_RE:ig,END_SAME_AS_BEGIN:WN,HASH_COMMENT_MODE:LN,IDENT_RE:rg,MATCH_NOTHING_RE:TN,METHOD_GUARD:UN,NUMBER_MODE:PN,NUMBER_RE:og,PHRASAL_WORDS_MODE:DN,QUOTE_STRING_MODE:RN,REGEXP_MODE:zN,RE_STARTERS_RE:ON,SHEBANG:MN,TITLE_MODE:VN,UNDERSCORE_IDENT_RE:wd,UNDERSCORE_TITLE_MODE:HN});function qN(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function KN(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function GN(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=qN,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function jN(n,e){Array.isArray(n.illegal)&&(n.illegal=vd(...n.illegal))}function JN(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function YN(n,e){n.relevance===void 0&&(n.relevance=1)}const XN=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},n);Object.keys(n).forEach(r=>{delete n[r]}),n.keywords=t.keywords,n.begin=Zr(t.beforeMatch,tg(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},ZN=["of","and","for","in","not","or","if","then","parent","list","value"],QN="keyword";function ag(n,e,t=QN){const r=Object.create(null);return typeof n=="string"?o(t,n.split(" ")):Array.isArray(n)?o(t,n):Object.keys(n).forEach(function(i){Object.assign(r,ag(n[i],e,i))}),r;function o(i,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){const c=a.split("|");r[c[0]]=[i,e1(c[0],c[1])]})}}function e1(n,e){return e?Number(e):t1(n)?0:1}function t1(n){return ZN.includes(n.toLowerCase())}const Np={},Vr=n=>{console.error(n)},Tp=(n,...e)=>{console.log(`WARN: ${n}`,...e)},no=(n,e)=>{Np[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),Np[`${n}/${e}`]=!0)},Ks=new Error;function lg(n,e,{key:t}){let r=0;const o=n[t],i={},s={};for(let a=1;a<=e.length;a++)s[a+r]=o[a],i[a+r]=!0,r+=ng(e[a-1]);n[t]=s,n[t]._emit=i,n[t]._multi=!0}function n1(n){if(Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw Vr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ks;if(typeof n.beginScope!="object"||n.beginScope===null)throw Vr("beginScope must be object"),Ks;lg(n,n.begin,{key:"beginScope"}),n.begin=kd(n.begin,{joinWith:""})}}function r1(n){if(Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw Vr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ks;if(typeof n.endScope!="object"||n.endScope===null)throw Vr("endScope must be object"),Ks;lg(n,n.end,{key:"endScope"}),n.end=kd(n.end,{joinWith:""})}}function o1(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function i1(n){o1(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),n1(n),r1(n)}function s1(n){function e(s,a){return new RegExp(Ei(s),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(a?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,a]),this.matchAt+=ng(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(c=>c[1]);this.matcherRe=e(kd(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(a);if(!c)return null;const d=c.findIndex((p,f)=>f>0&&p!==void 0),u=this.matchIndexes[d];return c.splice(0,d),Object.assign(c,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const c=new t;return this.rules.slice(a).forEach(([d,u])=>c.addRule(d,u)),c.compile(),this.multiRegexes[a]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,c){this.rules.push([a,c]),c.type==="begin"&&this.count++}exec(a){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let d=c.exec(a);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,d=u.exec(a)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function o(s){const a=new r;return s.contains.forEach(c=>a.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function i(s,a){const c=s;if(s.isCompiled)return c;[KN,JN,i1,XN].forEach(u=>u(s,a)),n.compilerExtensions.forEach(u=>u(s,a)),s.__beforeBegin=null,[GN,jN,YN].forEach(u=>u(s,a)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=ag(s.keywords,n.case_insensitive)),c.keywordPatternRe=e(d,!0),a&&(s.begin||(s.begin=/\B|\b/),c.beginRe=e(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=e(c.end)),c.terminatorEnd=Ei(c.end)||"",s.endsWithParent&&a.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(c.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return a1(u==="self"?s:u)})),s.contains.forEach(function(u){i(u,c)}),s.starts&&i(s.starts,a),c.matcher=o(c),c}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=pr(n.classNameAliases||{}),i(n)}function cg(n){return n?n.endsWithParent||cg(n.starts):!1}function a1(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return pr(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:cg(n)?pr(n,{starts:n.starts?pr(n.starts):null}):Object.isFrozen(n)?pr(n):n}var l1="11.10.0";class c1 extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const wl=eg,Op=pr,Mp=Symbol("nomatch"),d1=7,dg=function(n){const e=Object.create(null),t=Object.create(null),r=[];let o=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:EN};function c(N){return a.noHighlightRe.test(N)}function d(N){let M=N.className+" ";M+=N.parentNode?N.parentNode.className:"";const z=a.languageDetectRe.exec(M);if(z){const j=A(z[1]);return j||(Tp(i.replace("{}",z[1])),Tp("Falling back to no-highlight mode for this block.",N)),j?z[1]:"no-highlight"}return M.split(/\s+/).find(j=>c(j)||A(j))}function u(N,M,z){let j="",Q="";typeof M=="object"?(j=N,z=M.ignoreIllegals,Q=M.language):(no("10.7.0","highlight(lang, code, ...args) has been deprecated."),no("10.7.0",`Please use highlight(code, options) instead.
|
|
117
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Q=N,j=M),z===void 0&&(z=!0);const fe={code:j,language:Q};re("before:highlight",fe);const Se=fe.result?fe.result:p(fe.language,fe.code,z);return Se.code=fe.code,re("after:highlight",Se),Se}function p(N,M,z,j){const Q=Object.create(null);function fe(L,V){return L.keywords[V]}function Se(){if(!Z.keywords){Re.addText(ke);return}let L=0;Z.keywordPatternRe.lastIndex=0;let V=Z.keywordPatternRe.exec(ke),ue="";for(;V;){ue+=ke.substring(L,V.index);const we=le.case_insensitive?V[0].toLowerCase():V[0],Qe=fe(Z,we);if(Qe){const[Wt,Do]=Qe;if(Re.addText(ue),ue="",Q[we]=(Q[we]||0)+1,Q[we]<=d1&&(Nt+=Do),Wt.startsWith("_"))ue+=V[0];else{const x=le.classNameAliases[Wt]||Wt;Fe(V[0],x)}}else ue+=V[0];L=Z.keywordPatternRe.lastIndex,V=Z.keywordPatternRe.exec(ke)}ue+=ke.substring(L),Re.addText(ue)}function rt(){if(ke==="")return;let L=null;if(typeof Z.subLanguage=="string"){if(!e[Z.subLanguage]){Re.addText(ke);return}L=p(Z.subLanguage,ke,!0,xt[Z.subLanguage]),xt[Z.subLanguage]=L._top}else L=h(ke,Z.subLanguage.length?Z.subLanguage:null);Z.relevance>0&&(Nt+=L.relevance),Re.__addSublanguage(L._emitter,L.language)}function xe(){Z.subLanguage!=null?rt():Se(),ke=""}function Fe(L,V){L!==""&&(Re.startScope(V),Re.addText(L),Re.endScope())}function Ht(L,V){let ue=1;const we=V.length-1;for(;ue<=we;){if(!L._emit[ue]){ue++;continue}const Qe=le.classNameAliases[L[ue]]||L[ue],Wt=V[ue];Qe?Fe(Wt,Qe):(ke=Wt,Se(),ke=""),ue++}}function dt(L,V){return L.scope&&typeof L.scope=="string"&&Re.openNode(le.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Fe(ke,le.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),ke=""):L.beginScope._multi&&(Ht(L.beginScope,V),ke="")),Z=Object.create(L,{parent:{value:Z}}),Z}function Qt(L,V,ue){let we=xN(L.endRe,ue);if(we){if(L["on:end"]){const Qe=new _p(L);L["on:end"](V,Qe),Qe.isMatchIgnored&&(we=!1)}if(we){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Qt(L.parent,V,ue)}function ut(L){return Z.matcher.regexIndex===0?(ke+=L[0],1):(Tt=!0,0)}function en(L){const V=L[0],ue=L.rule,we=new _p(ue),Qe=[ue.__beforeBegin,ue["on:begin"]];for(const Wt of Qe)if(Wt&&(Wt(L,we),we.isMatchIgnored))return ut(V);return ue.skip?ke+=V:(ue.excludeBegin&&(ke+=V),xe(),!ue.returnBegin&&!ue.excludeBegin&&(ke=V)),dt(ue,L),ue.returnBegin?0:V.length}function kn(L){const V=L[0],ue=M.substring(L.index),we=Qt(Z,L,ue);if(!we)return Mp;const Qe=Z;Z.endScope&&Z.endScope._wrap?(xe(),Fe(V,Z.endScope._wrap)):Z.endScope&&Z.endScope._multi?(xe(),Ht(Z.endScope,L)):Qe.skip?ke+=V:(Qe.returnEnd||Qe.excludeEnd||(ke+=V),xe(),Qe.excludeEnd&&(ke=V));do Z.scope&&Re.closeNode(),!Z.skip&&!Z.subLanguage&&(Nt+=Z.relevance),Z=Z.parent;while(Z!==we.parent);return we.starts&&dt(we.starts,L),Qe.returnEnd?0:V.length}function pn(){const L=[];for(let V=Z;V!==le;V=V.parent)V.scope&&L.unshift(V.scope);L.forEach(V=>Re.openNode(V))}let Ut={};function fn(L,V){const ue=V&&V[0];if(ke+=L,ue==null)return xe(),0;if(Ut.type==="begin"&&V.type==="end"&&Ut.index===V.index&&ue===""){if(ke+=M.slice(V.index,V.index+1),!o){const we=new Error(`0 width match regex (${N})`);throw we.languageName=N,we.badRule=Ut.rule,we}return 1}if(Ut=V,V.type==="begin")return en(V);if(V.type==="illegal"&&!z){const we=new Error('Illegal lexeme "'+ue+'" for mode "'+(Z.scope||"<unnamed>")+'"');throw we.mode=Z,we}else if(V.type==="end"){const we=kn(V);if(we!==Mp)return we}if(V.type==="illegal"&&ue==="")return 1;if(hn>1e5&&hn>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ke+=ue,ue.length}const le=A(N);if(!le)throw Vr(i.replace("{}",N)),new Error('Unknown language: "'+N+'"');const Lt=s1(le);let vt="",Z=j||Lt;const xt={},Re=new a.__emitter(a);pn();let ke="",Nt=0,Xe=0,hn=0,Tt=!1;try{if(le.__emitTokens)le.__emitTokens(M,Re);else{for(Z.matcher.considerAll();;){hn++,Tt?Tt=!1:Z.matcher.considerAll(),Z.matcher.lastIndex=Xe;const L=Z.matcher.exec(M);if(!L)break;const V=M.substring(Xe,L.index),ue=fn(V,L);Xe=L.index+ue}fn(M.substring(Xe))}return Re.finalize(),vt=Re.toHTML(),{language:N,value:vt,relevance:Nt,illegal:!1,_emitter:Re,_top:Z}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:N,value:wl(M),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:Xe,context:M.slice(Xe-100,Xe+100),mode:L.mode,resultSoFar:vt},_emitter:Re};if(o)return{language:N,value:wl(M),illegal:!1,relevance:0,errorRaised:L,_emitter:Re,_top:Z};throw L}}function f(N){const M={value:wl(N),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return M._emitter.addText(N),M}function h(N,M){M=M||a.languages||Object.keys(e);const z=f(N),j=M.filter(A).filter(J).map(xe=>p(xe,N,!1));j.unshift(z);const Q=j.sort((xe,Fe)=>{if(xe.relevance!==Fe.relevance)return Fe.relevance-xe.relevance;if(xe.language&&Fe.language){if(A(xe.language).supersetOf===Fe.language)return 1;if(A(Fe.language).supersetOf===xe.language)return-1}return 0}),[fe,Se]=Q,rt=fe;return rt.secondBest=Se,rt}function m(N,M,z){const j=M&&t[M]||z;N.classList.add("hljs"),N.classList.add(`language-${j}`)}function g(N){let M=null;const z=d(N);if(c(z))return;if(re("before:highlightElement",{el:N,language:z}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new c1("One of your code blocks includes unescaped HTML.",N.innerHTML);M=N;const j=M.textContent,Q=z?u(j,{language:z,ignoreIllegals:!0}):h(j);N.innerHTML=Q.value,N.dataset.highlighted="yes",m(N,z,Q.language),N.result={language:Q.language,re:Q.relevance,relevance:Q.relevance},Q.secondBest&&(N.secondBest={language:Q.secondBest.language,relevance:Q.secondBest.relevance}),re("after:highlightElement",{el:N,result:Q,text:j})}function b(N){a=Op(a,N)}const y=()=>{v(),no("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function k(){v(),no("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function v(){if(document.readyState==="loading"){E=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function _(){E&&v()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_,!1);function C(N,M){let z=null;try{z=M(n)}catch(j){if(Vr("Language definition for '{}' could not be registered.".replace("{}",N)),o)Vr(j);else throw j;z=s}z.name||(z.name=N),e[N]=z,z.rawDefinition=M.bind(null,n),z.aliases&&$(z.aliases,{languageName:N})}function D(N){delete e[N];for(const M of Object.keys(t))t[M]===N&&delete t[M]}function B(){return Object.keys(e)}function A(N){return N=(N||"").toLowerCase(),e[N]||e[t[N]]}function $(N,{languageName:M}){typeof N=="string"&&(N=[N]),N.forEach(z=>{t[z.toLowerCase()]=M})}function J(N){const M=A(N);return M&&!M.disableAutodetect}function te(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=M=>{N["before:highlightBlock"](Object.assign({block:M.el},M))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=M=>{N["after:highlightBlock"](Object.assign({block:M.el},M))})}function de(N){te(N),r.push(N)}function ce(N){const M=r.indexOf(N);M!==-1&&r.splice(M,1)}function re(N,M){const z=N;r.forEach(function(j){j[z]&&j[z](M)})}function oe(N){return no("10.7.0","highlightBlock will be removed entirely in v12.0"),no("10.7.0","Please use highlightElement now."),g(N)}Object.assign(n,{highlight:u,highlightAuto:h,highlightAll:v,highlightElement:g,highlightBlock:oe,configure:b,initHighlighting:y,initHighlightingOnLoad:k,registerLanguage:C,unregisterLanguage:D,listLanguages:B,getLanguage:A,registerAliases:$,autoDetection:J,inherit:Op,addPlugin:de,removePlugin:ce}),n.debugMode=function(){o=!1},n.safeMode=function(){o=!0},n.versionString=l1,n.regex={concat:Zr,lookahead:tg,either:vd,optional:_N,anyNumberOfTimes:CN};for(const N in Xi)typeof Xi[N]=="object"&&Qm(Xi[N]);return Object.assign(n,Xi),n},No=dg({});No.newInstance=()=>dg({});var u1=No;No.HighlightJS=No;No.default=No;var p1=yN(u1);function ug(n,e=[]){return n.map(t=>{const r=[...e,...t.properties?t.properties.className:[]];return t.children?ug(t.children,r):{text:t.value,classes:r}}).flat()}function Ap(n){return n.value||n.children||[]}function f1(n){return!!p1.getLanguage(n)}function Rp({doc:n,name:e,lowlight:t,defaultLanguage:r}){const o=[];return tc(n,i=>i.type.name===e).forEach(i=>{var s;let a=i.pos+1;const c=i.node.attrs.language||r,d=t.listLanguages(),u=c&&(d.includes(c)||f1(c)||!((s=t.registered)===null||s===void 0)&&s.call(t,c))?Ap(t.highlight(c,i.node.textContent)):Ap(t.highlightAuto(i.node.textContent));ug(u).forEach(p=>{const f=a+p.text.length;if(p.classes.length){const h=Ze.inline(a,f,{class:p.classes.join(" ")});o.push(h)}a=f})}),Ne.create(n,o)}function h1(n){return typeof n=="function"}function m1({name:n,lowlight:e,defaultLanguage:t}){if(!["highlight","highlightAuto","listLanguages"].every(o=>h1(e[o])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new Te({key:new $e("lowlight"),state:{init:(o,{doc:i})=>Rp({doc:i,name:n,lowlight:e,defaultLanguage:t}),apply:(o,i,s,a)=>{const c=s.selection.$head.parent.type.name,d=a.selection.$head.parent.type.name,u=tc(s.doc,f=>f.type.name===n),p=tc(a.doc,f=>f.type.name===n);return o.docChanged&&([c,d].includes(n)||p.length!==u.length||o.steps.some(f=>f.from!==void 0&&f.to!==void 0&&u.some(h=>h.pos>=f.from&&h.pos+h.node.nodeSize<=f.to)))?Rp({doc:o.doc,name:n,lowlight:e,defaultLanguage:t}):i.map(o.mapping,o.doc)}},props:{decorations(o){return r.getState(o)}}});return r}const g1=Im.extend({addOptions(){var n;return{...(n=this.parent)===null||n===void 0?void 0:n.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var n;return[...((n=this.parent)===null||n===void 0?void 0:n.call(this))||[],m1({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});function b1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+n.IDENT_RE,relevance:0},h=e.optional(o)+n.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},C=[_,p,a,t,n.C_BLOCK_COMMENT_MODE,u,d],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:C.concat([{begin:/\(/,end:/\)/,keywords:v,contains:C.concat(["self"]),relevance:0}]),relevance:0},B={className:"function",begin:"("+s+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,d,u,a,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,d,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,B,_,C,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:v,contains:["self",a]},{begin:n.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function y1(n){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},t=b1(n),r=t.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,t.name="Arduino",t.aliases=["ino"],t.supersetOf="cpp",t}function v1(n){const e=n.regex,t={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},i=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,o]};o.contains.push(a);const c={match:/\\"/},d={className:"string",begin:/'/,end:/'/},u={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=n.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],b=["true","false"],y={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],E=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],v=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:b,built_in:[...k,...E,"set","shopt",...v,..._]},contains:[h,n.SHEBANG(),m,p,i,s,y,a,c,d,u,t]}}function k1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+n.IDENT_RE,relevance:0},h=e.optional(o)+n.IDENT_RE+"\\s*\\(",b={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[p,a,t,n.C_BLOCK_COMMENT_MODE,u,d],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:y.concat([{begin:/\(/,end:/\)/,keywords:b,contains:y.concat(["self"]),relevance:0}]),relevance:0},E={begin:"("+s+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:b,relevance:0},{begin:h,returnBegin:!0,contains:[n.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,d,u,a,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,d,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:b,disableAutodetect:!0,illegal:"</",contains:[].concat(k,E,y,[p,{begin:n.IDENT_RE+"::",keywords:b},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:p,strings:d,keywords:b}}}function w1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+n.IDENT_RE,relevance:0},h=e.optional(o)+n.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},C=[_,p,a,t,n.C_BLOCK_COMMENT_MODE,u,d],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:C.concat([{begin:/\(/,end:/\)/,keywords:v,contains:C.concat(["self"]),relevance:0}]),relevance:0},B={className:"function",begin:"("+s+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,d,u,a,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,d,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,B,_,C,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:v,contains:["self",a]},{begin:n.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function E1(n){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:o.concat(i),built_in:e,literal:r},a=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=n.inherit(u,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},h=n.inherit(f,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,h]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},b=n.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});f.contains=[g,m,u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],h.contains=[b,m,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[d,g,m,u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},k={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},E=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",v={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,k,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,k,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,k],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[y,c,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},v]}}const C1=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),_1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],S1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],x1=[..._1,...S1],N1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),T1=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),O1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),M1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function A1(n){const e=n.regex,t=C1(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",i=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+T1.join("|")+")"},{begin:":(:)?("+O1.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+M1.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:N1.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+x1.join("|")+")\\b"}]}}function R1(n){const e=n.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function D1(n){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"string",variants:[n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[n.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}function I1(n){const e=n.regex,t=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[n.HASH_COMMENT_MODE,n.QUOTE_STRING_MODE,n.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(t,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function B1(n){const e=n.regex,t={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:n.NUMBER_RE}]},r=n.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,i,o,s,t,"self"],relevance:0},c=/[A-Za-z0-9_-]+/,d=/"(\\"|[^"])*"/,u=/'[^']*'/,p=e.either(c,d,u),f=e.concat(p,"(\\s*\\.\\s*",p,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[r,a,i,o,s,t]}}]}}var ao="[0-9](_*[0-9])*",Zi=`\\.(${ao})`,Qi="[0-9a-fA-F](_*[0-9a-fA-F])*",Dp={className:"number",variants:[{begin:`(\\b(${ao})((${Zi})|\\.)?|(${Zi}))[eE][+-]?(${ao})[fFdD]?\\b`},{begin:`\\b(${ao})((${Zi})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Zi})[fFdD]?\\b`},{begin:`\\b(${ao})[fFdD]\\b`},{begin:`\\b0[xX]((${Qi})\\.?|(${Qi})?\\.(${Qi}))[pP][+-]?(${ao})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Qi})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function pg(n,e,t){return t===-1?"":n.replace(e,r=>pg(n,e,t-1))}function L1(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+pg("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[u,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[d,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,Dp,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Dp,d]}}const Ip="[A-Za-z$_][0-9A-Za-z$_]*",P1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],$1=["true","false","null","undefined","NaN","Infinity"],fg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],hg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],F1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],z1=[].concat(mg,fg,hg);function V1(n){const e=n.regex,t=(M,{after:z})=>{const j="</"+M[0].slice(1);return M.input.indexOf(j,z)!==-1},r=Ip,o={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const j=M[0].length+M.index,Q=M.input[j];if(Q==="<"||Q===","){z.ignoreMatch();return}Q===">"&&(t(M,{after:j})||z.ignoreMatch());let fe;const Se=M.input.substring(j);if(fe=Se.match(/^\s*=/)){z.ignoreMatch();return}if((fe=Se.match(/^\s+extends\s+/))&&fe.index===0){z.ignoreMatch();return}}},a={$pattern:Ip,keyword:P1,literal:$1,built_in:z1,"variable.language":F1},c="[0-9](_?[0-9])*",d=`\\.(${c})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${u})((${d})|\\.)?|(${d}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},k={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},E=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,m,g,b,{match:/\$\d+/},p];f.contains=E.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(E)});const v=[].concat(k,f.contains),_=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(v)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},B={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...fg,...hg]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(M){return e.concat("(?!",M.join("|"),")")}const de={match:e.concat(/\b/,te([...mg,"super","import"].map(M=>`${M}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},oe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(oe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:B},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,m,g,b,k,{match:/\$\d+/},p,B,{scope:"attr",match:r+e.lookahead(":"),relevance:0},N,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,n.REGEXP_MODE,{className:"function",begin:oe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},de,J,D,re,{match:/\$[(.]/}]}}function H1(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,o,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var lo="[0-9](_*[0-9])*",es=`\\.(${lo})`,ts="[0-9a-fA-F](_*[0-9a-fA-F])*",U1={className:"number",variants:[{begin:`(\\b(${lo})((${es})|\\.)?|(${es}))[eE][+-]?(${lo})[fFdD]?\\b`},{begin:`\\b(${lo})((${es})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${es})[fFdD]?\\b`},{begin:`\\b(${lo})[fFdD]\\b`},{begin:`\\b0[xX]((${ts})\\.?|(${ts})?\\.(${ts}))[pP][+-]?(${lo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ts})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function W1(n){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[n.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+n.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,o]},{begin:"'",end:"'",illegal:/\n/,contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,i,o]}]};o.contains.push(s);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+n.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+n.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[n.inherit(s,{className:"string"}),"self"]}]},d=U1,u=n.COMMENT("/\\*","\\*/",{contains:[n.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:n.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=p;return f.variants[1].contains=[p],p.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),n.C_LINE_COMMENT_MODE,u,t,r,a,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:n.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[n.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,n.C_LINE_COMMENT_MODE,u],relevance:0},n.C_LINE_COMMENT_MODE,u,a,c,s,n.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,n.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},n.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,c]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
118
|
-
`},d]}}const q1=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),K1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],G1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],j1=[...K1,...G1],J1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),gg=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),bg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Y1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),X1=gg.concat(bg).sort().reverse();function Z1(n){const e=q1(n),t=X1,r="and or not only",o="[\\w-]+",i="("+o+"|@\\{"+o+"\\})",s=[],a=[],c=function(E){return{className:"string",begin:"~?"+E+".*?"+E}},d=function(E,v,_){return{className:E,begin:v,relevance:_}},u={$pattern:/[a-z-]+/,keyword:r,attribute:J1.join(" ")},p={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,c("'"),c('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,p,d("variable","@@?"+o,10),d("variable","@\\{"+o+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const f=a.concat({begin:/\{/,end:/\}/,contains:s}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Y1.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},b={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,h,d("keyword","all\\b"),d("variable","@\\{"+o+"\\}"),{begin:"\\b("+j1.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",i,0),d("selector-id","#"+i),d("selector-class","\\."+i,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+gg.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+bg.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},k={begin:o+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[y]};return s.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,g,b,k,m,y,h,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function Q1(n){const e="\\[=*\\[",t="\\]=*\\]",r={begin:e,end:t,contains:["self"]},o=[n.COMMENT("--(?!"+e+")","$"),n.COMMENT("--"+e,t,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:n.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[n.inherit(n.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},n.C_NUMBER_MODE,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{className:"string",begin:e,end:t,contains:[r],relevance:5}])}}function eT(n){const e={className:"variable",variants:[{begin:"\\$\\("+n.UNDERSCORE_IDENT_RE+"\\)",contains:[n.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},t={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,t]},o={begin:"^"+n.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[n.HASH_COMMENT_MODE,e,t,r,o,i,s]}}function tT(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=n.inherit(d,{contains:[]}),f=n.inherit(u,{contains:[]});d.contains.push(f),u.contains.push(p);let h=[t,c];return[d,u,p,f].forEach(y=>{y.contains=y.contains.concat(h)}),h=h.concat(d,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},t,i,d,u,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},o,r,c,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function nT(n){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},t=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[e,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,n.C_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[n.UNDERSCORE_TITLE_MODE]},{begin:"\\."+n.UNDERSCORE_IDENT_RE,relevance:0}]}}function rT(n){const e=n.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:t.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},d={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[n.BACKSLASH_ESCAPE,i,c],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(g,b,y="\\1")=>{const k=y==="\\1"?y:e.concat(y,b);return e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,k,/(?:\\.|[^\\\/])*?/,y,r)},h=(g,b,y)=>e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,y,r),m=[c,n.HASH_COMMENT_MODE,n.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},d,{begin:"(\\/\\/|"+n.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[n.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...p,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...p,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE,a,d]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:m}}function oT(n){const e=n.regex,t=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),o=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),i=e.concat(/[A-Z]+/,t),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},d=n.inherit(n.APOS_STRING_MODE,{illegal:null}),u=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(c)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(ce,re)=>{re.data._beginMatch=ce[1]||ce[2]},"on:end":(ce,re)=>{re.data._beginMatch!==ce[1]&&re.ignoreMatch()}},f=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
|
|
119
|
-
]`,m={scope:"string",variants:[u,d,p,f]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],k=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:y,literal:(ce=>{const re=[];return ce.forEach(oe=>{re.push(oe),oe.toLowerCase()===oe?re.push(oe.toUpperCase()):re.push(oe.toLowerCase())}),re})(b),built_in:k},_=ce=>ce.map(re=>re.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",_(k).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},D=e.concat(r,"\\b(?!\\()"),B={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[o,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},A={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},$={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[A,s,B,n.C_BLOCK_COMMENT_MODE,m,g,C]},J={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",_(y).join("\\b|"),"|",_(k).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[$]};$.contains.push(J);const te=[A,B,n.C_BLOCK_COMMENT_MODE,m,g,C],de={begin:e.concat(/#\[\s*\\?/,e.either(o,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...te]},...te,{scope:"meta",variants:[{match:o},{match:i}]}]};return{case_insensitive:!1,keywords:v,contains:[de,n.HASH_COMMENT_MODE,n.COMMENT("//","$"),n.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:n.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,J,B,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",de,s,B,n.C_BLOCK_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},n.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[n.inherit(n.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},n.UNDERSCORE_TITLE_MODE]},m,g]}}function iT(n){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function sT(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aT(n){const e=n.regex,t=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},p={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c,u,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c,u,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,u,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,u,d]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",h=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${f})[jJ](?=${m})`}]},b={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",c,g,p,n.HASH_COMMENT_MODE]}]};return d.contains=[p,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,b,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,y,p]}]}}function lT(n){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function cT(n){const e=n.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[n.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),n.HASH_COMMENT_MODE,{scope:"string",contains:[n.BACKSLASH_ESCAPE],variants:[n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function dT(n){const e=n.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},d=[n.COMMENT("#","$",{contains:[a]}),n.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},p={className:"string",contains:[n.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[n.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},C=[p,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:s},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,d),relevance:0}].concat(c,d);u.contains=C,g.contains=C;const $=[{begin:/^\s*=>/,starts:{end:"$",contains:C}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:C}}];return d.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat($).concat(d).concat(C)}}function uT(n){const e=n.regex,t=/(r#)?/,r=e.concat(t,n.UNDERSCORE_IDENT_RE),o=e.concat(t,n.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:n.IDENT_RE+"!?",type:u,keyword:a,literal:c,built_in:d},illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.COMMENT("/\\*","\\*/",{contains:["self"]}),n.inherit(n.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:n.IDENT_RE+"::",keywords:{keyword:"Self",built_in:d,type:u}},{className:"punctuation",begin:"->"},i]}}const pT=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),fT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hT=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],mT=[...fT,...hT],gT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),bT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function kT(n){const e=pT(n),t=yT,r=bT,o="@[a-z-]+",i="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+mT.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vT.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:gT.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function wT(n){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ET(n){const e=n.regex,t=n.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=u,m=[...d,...c].filter(_=>!u.includes(_)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},b={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:e.concat(/\b/,e.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function k(_){return e.concat(/\b/,e.either(..._.map(C=>C.replace(/\s+/,"\\s+"))),/\b/)}const E={scope:"keyword",match:k(f),relevance:0};function v(_,{exceptions:C,when:D}={}){const B=D;return C=C||[],_.map(A=>A.match(/\|\d+$/)||C.includes(A)?A:B(A)?`${A}|0`:A)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:v(m,{when:_=>_.length<3}),literal:i,type:a,built_in:p},contains:[{scope:"type",match:k(s)},E,y,g,r,o,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,b]}}function yg(n){return n?typeof n=="string"?n:n.source:null}function $o(n){return Ie("(?=",n,")")}function Ie(...n){return n.map(t=>yg(t)).join("")}function CT(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function Mt(...n){return"("+(CT(n).capture?"":"?:")+n.map(r=>yg(r)).join("|")+")"}const Ed=n=>Ie(/\b/,n,/\w$/.test(n)?/\b/:/\B/),_T=["Protocol","Type"].map(Ed),Bp=["init","self"].map(Ed),ST=["Any","Self"],El=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Lp=["false","nil","true"],xT=["assignment","associativity","higherThan","left","lowerThan","none","right"],NT=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Pp=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],vg=Mt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),kg=Mt(vg,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Cl=Ie(vg,kg,"*"),wg=Mt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Gs=Mt(wg,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Cn=Ie(wg,Gs,"*"),ns=Ie(/[A-Z]/,Gs,"*"),TT=["attached","autoclosure",Ie(/convention\(/,Mt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ie(/objc\(/,Cn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],OT=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function MT(n){const e={match:/\s+/,relevance:0},t=n.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[n.C_LINE_COMMENT_MODE,t],o={match:[/\./,Mt(..._T,...Bp)],className:{2:"keyword"}},i={match:Ie(/\./,Mt(...El)),relevance:0},s=El.filter(le=>typeof le=="string").concat(["_|0"]),a=El.filter(le=>typeof le!="string").concat(ST).map(Ed),c={variants:[{className:"keyword",match:Mt(...a,...Bp)}]},d={$pattern:Mt(/\b\w+/,/#\w+/),keyword:s.concat(NT),literal:Lp},u=[o,i,c],p={match:Ie(/\./,Mt(...Pp)),relevance:0},f={className:"built_in",match:Ie(/\b/,Mt(...Pp),/(?=\()/)},h=[p,f],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:Cl},{match:`\\.(\\.|${kg})+`}]},b=[m,g],y="([0-9]_*)+",k="([0-9a-fA-F]_*)+",E={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${k})(\\.(${k}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},v=(le="")=>({className:"subst",variants:[{match:Ie(/\\/,le,/[0\\tnr"']/)},{match:Ie(/\\/,le,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(le="")=>({className:"subst",match:Ie(/\\/,le,/[\t ]*(?:[\r\n]|\r\n)/)}),C=(le="")=>({className:"subst",label:"interpol",begin:Ie(/\\/,le,/\(/),end:/\)/}),D=(le="")=>({begin:Ie(le,/"""/),end:Ie(/"""/,le),contains:[v(le),_(le),C(le)]}),B=(le="")=>({begin:Ie(le,/"/),end:Ie(/"/,le),contains:[v(le),C(le)]}),A={className:"string",variants:[D(),D("#"),D("##"),D("###"),B(),B("#"),B("##"),B("###")]},$=[n.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[n.BACKSLASH_ESCAPE]}],J={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:$},te=le=>{const Lt=Ie(le,/\//),vt=Ie(/\//,le);return{begin:Lt,end:vt,contains:[...$,{scope:"comment",begin:`#(?!.*${vt})`,end:/$/}]}},de={scope:"regexp",variants:[te("###"),te("##"),te("#"),J]},ce={match:Ie(/`/,Cn,/`/)},re={className:"variable",match:/\$\d+/},oe={className:"variable",match:`\\$${Gs}+`},N=[ce,re,oe],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:OT,contains:[...b,E,A]}]}},z={scope:"keyword",match:Ie(/@/,Mt(...TT),$o(Mt(/\(/,/\s+/)))},j={scope:"meta",match:Ie(/@/,Cn)},Q=[M,z,j],fe={match:$o(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ie(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Gs,"+")},{className:"type",match:ns,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ie(/\s+&\s+/,$o(ns)),relevance:0}]},Se={begin:/</,end:/>/,keywords:d,contains:[...r,...u,...Q,m,fe]};fe.contains.push(Se);const rt={match:Ie(Cn,/\s*:/),keywords:"_|0",relevance:0},xe={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",rt,...r,de,...u,...h,...b,E,A,...N,...Q,fe]},Fe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,fe]},Ht={begin:Mt($o(Ie(Cn,/\s*:/)),$o(Ie(Cn,/\s+/,Cn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Cn}]},dt={begin:/\(/,end:/\)/,keywords:d,contains:[Ht,...r,...u,...b,E,A,...Q,fe,xe],endsParent:!0,illegal:/["']/},Qt={match:[/(func|macro)/,/\s+/,Mt(ce.match,Cn,Cl)],className:{1:"keyword",3:"title.function"},contains:[Fe,dt,e],illegal:[/\[/,/%/]},ut={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Fe,dt,e],illegal:/\[|%/},en={match:[/operator/,/\s+/,Cl],className:{1:"keyword",3:"title"}},kn={begin:[/precedencegroup/,/\s+/,ns],className:{1:"keyword",3:"title"},contains:[fe],keywords:[...xT,...Lp],end:/}/},pn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ut={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},fn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Cn,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:d,contains:[Fe,...u,{begin:/:/,end:/\{/,keywords:d,contains:[{scope:"title.class.inherited",match:ns},...u],relevance:0}]};for(const le of A.variants){const Lt=le.contains.find(Z=>Z.label==="interpol");Lt.keywords=d;const vt=[...u,...h,...b,E,A,...N];Lt.contains=[...vt,{begin:/\(/,end:/\)/,contains:["self",...vt]}]}return{name:"Swift",keywords:d,contains:[...r,Qt,ut,pn,Ut,fn,en,kn,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},de,...u,...h,...b,E,A,...N,...Q,fe,xe]}}const js="[A-Za-z$_][0-9A-Za-z$_]*",Eg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Cg=["true","false","null","undefined","NaN","Infinity"],_g=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Sg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ng=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Tg=[].concat(xg,_g,Sg);function AT(n){const e=n.regex,t=(M,{after:z})=>{const j="</"+M[0].slice(1);return M.input.indexOf(j,z)!==-1},r=js,o={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const j=M[0].length+M.index,Q=M.input[j];if(Q==="<"||Q===","){z.ignoreMatch();return}Q===">"&&(t(M,{after:j})||z.ignoreMatch());let fe;const Se=M.input.substring(j);if(fe=Se.match(/^\s*=/)){z.ignoreMatch();return}if((fe=Se.match(/^\s+extends\s+/))&&fe.index===0){z.ignoreMatch();return}}},a={$pattern:js,keyword:Eg,literal:Cg,built_in:Tg,"variable.language":Ng},c="[0-9](_?[0-9])*",d=`\\.(${c})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${u})((${d})|\\.)?|(${d}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},k={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},E=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,m,g,b,{match:/\$\d+/},p];f.contains=E.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(E)});const v=[].concat(k,f.contains),_=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(v)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},B={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._g,...Sg]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(M){return e.concat("(?!",M.join("|"),")")}const de={match:e.concat(/\b/,te([...xg,"super","import"].map(M=>`${M}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},oe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(oe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:B},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,m,g,b,k,{match:/\$\d+/},p,B,{scope:"attr",match:r+e.lookahead(":"),relevance:0},N,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,n.REGEXP_MODE,{className:"function",begin:oe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},de,J,D,re,{match:/\$[(.]/}]}}function RT(n){const e=n.regex,t=AT(n),r=js,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[t.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:js,keyword:Eg.concat(c),literal:Cg,built_in:Tg.concat(o),"variable.language":Ng},u={className:"meta",begin:"@"+r},p=(g,b,y)=>{const k=g.contains.findIndex(E=>E.label===b);if(k===-1)throw new Error("can not find mode to replace");g.contains.splice(k,1,y)};Object.assign(t.keywords,d),t.exports.PARAMS_CONTAINS.push(u);const f=t.contains.find(g=>g.scope==="attr"),h=Object.assign({},f,{match:e.concat(r,e.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,f,h]),t.contains=t.contains.concat([u,i,s,h]),p(t,"shebang",n.SHEBANG()),p(t,"use_strict",a);const m=t.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function DT(n){const e=n.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:e.concat(/# */,e.either(i,o),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(i,o),/ +/,e.either(s,a),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},p=n.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=n.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,r,c,d,u,p,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function IT(n){n.regex;const e=n.COMMENT(/\(;/,/;\)/);e.contains.push("self");const t=n.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[t,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,s,o,n.QUOTE_STRING_MODE,c,d,a]}}function BT(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=n.inherit(i,{begin:/\(/,end:/\)/}),a=n.inherit(n.APOS_STRING_MODE,{className:"string"}),c=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,s,c,a]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function LT(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,o]},a=n.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},b=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},f,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},m,g,i,s],y=[...b];return y.pop(),y.push(a),h.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}const PT={arduino:y1,bash:v1,c:k1,cpp:w1,csharp:E1,css:A1,diff:R1,go:D1,graphql:I1,ini:B1,java:L1,javascript:V1,json:H1,kotlin:W1,less:Z1,lua:Q1,makefile:eT,markdown:tT,objectivec:nT,perl:rT,php:oT,"php-template":iT,plaintext:sT,python:aT,"python-repl":lT,r:cT,ruby:dT,rust:uT,scss:kT,shell:wT,sql:ET,swift:MT,typescript:RT,vbnet:DT,wasm:IT,xml:BT,yaml:LT};function $T(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _l,$p;function FT(){if($p)return _l;$p=1;function n(w){return w instanceof Map?w.clear=w.delete=w.set=function(){throw new Error("map is read-only")}:w instanceof Set&&(w.add=w.clear=w.delete=function(){throw new Error("set is read-only")}),Object.freeze(w),Object.getOwnPropertyNames(w).forEach(T=>{const P=w[T],se=typeof P;(se==="object"||se==="function")&&!Object.isFrozen(P)&&n(P)}),w}class e{constructor(T){T.data===void 0&&(T.data={}),this.data=T.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(w){return w.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(w,...T){const P=Object.create(null);for(const se in w)P[se]=w[se];return T.forEach(function(se){for(const Ue in se)P[Ue]=se[Ue]}),P}const o="</span>",i=w=>!!w.scope,s=(w,{prefix:T})=>{if(w.startsWith("language:"))return w.replace("language:","language-");if(w.includes(".")){const P=w.split(".");return[`${T}${P.shift()}`,...P.map((se,Ue)=>`${se}${"_".repeat(Ue+1)}`)].join(" ")}return`${T}${w}`};class a{constructor(T,P){this.buffer="",this.classPrefix=P.classPrefix,T.walk(this)}addText(T){this.buffer+=t(T)}openNode(T){if(!i(T))return;const P=s(T.scope,{prefix:this.classPrefix});this.span(P)}closeNode(T){i(T)&&(this.buffer+=o)}value(){return this.buffer}span(T){this.buffer+=`<span class="${T}">`}}const c=(w={})=>{const T={children:[]};return Object.assign(T,w),T};class d{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(T){this.top.children.push(T)}openNode(T){const P=c({scope:T});this.add(P),this.stack.push(P)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(T){return this.constructor._walk(T,this.rootNode)}static _walk(T,P){return typeof P=="string"?T.addText(P):P.children&&(T.openNode(P),P.children.forEach(se=>this._walk(T,se)),T.closeNode(P)),T}static _collapse(T){typeof T!="string"&&T.children&&(T.children.every(P=>typeof P=="string")?T.children=[T.children.join("")]:T.children.forEach(P=>{d._collapse(P)}))}}class u extends d{constructor(T){super(),this.options=T}addText(T){T!==""&&this.add(T)}startScope(T){this.openNode(T)}endScope(){this.closeNode()}__addSublanguage(T,P){const se=T.root;P&&(se.scope=`language:${P}`),this.add(se)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(w){return w?typeof w=="string"?w:w.source:null}function f(w){return g("(?=",w,")")}function h(w){return g("(?:",w,")*")}function m(w){return g("(?:",w,")?")}function g(...w){return w.map(P=>p(P)).join("")}function b(w){const T=w[w.length-1];return typeof T=="object"&&T.constructor===Object?(w.splice(w.length-1,1),T):{}}function y(...w){return"("+(b(w).capture?"":"?:")+w.map(se=>p(se)).join("|")+")"}function k(w){return new RegExp(w.toString()+"|").exec("").length-1}function E(w,T){const P=w&&w.exec(T);return P&&P.index===0}const v=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function _(w,{joinWith:T}){let P=0;return w.map(se=>{P+=1;const Ue=P;let ze=p(se),q="";for(;ze.length>0;){const H=v.exec(ze);if(!H){q+=ze;break}q+=ze.substring(0,H.index),ze=ze.substring(H.index+H[0].length),H[0][0]==="\\"&&H[1]?q+="\\"+String(Number(H[1])+Ue):(q+=H[0],H[0]==="("&&P++)}return q}).map(se=>`(${se})`).join(T)}const C=/\b\B/,D="[a-zA-Z]\\w*",B="[a-zA-Z_]\\w*",A="\\b\\d+(\\.\\d+)?",$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",J="\\b(0b[01]+)",te="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",de=(w={})=>{const T=/^#![ ]*\//;return w.binary&&(w.begin=g(T,/.*\b/,w.binary,/\b.*/)),r({scope:"meta",begin:T,end:/$/,relevance:0,"on:begin":(P,se)=>{P.index!==0&&se.ignoreMatch()}},w)},ce={begin:"\\\\[\\s\\S]",relevance:0},re={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ce]},oe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ce]},N={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},M=function(w,T,P={}){const se=r({scope:"comment",begin:w,end:T,contains:[]},P);se.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ue=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return se.contains.push({begin:g(/[ ]+/,"(",Ue,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),se},z=M("//","$"),j=M("/\\*","\\*/"),Q=M("#","$"),fe={scope:"number",begin:A,relevance:0},Se={scope:"number",begin:$,relevance:0},rt={scope:"number",begin:J,relevance:0},xe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ce,{begin:/\[/,end:/\]/,relevance:0,contains:[ce]}]},Fe={scope:"title",begin:D,relevance:0},Ht={scope:"title",begin:B,relevance:0},dt={begin:"\\.\\s*"+B,relevance:0};var ut=Object.freeze({__proto__:null,APOS_STRING_MODE:re,BACKSLASH_ESCAPE:ce,BINARY_NUMBER_MODE:rt,BINARY_NUMBER_RE:J,COMMENT:M,C_BLOCK_COMMENT_MODE:j,C_LINE_COMMENT_MODE:z,C_NUMBER_MODE:Se,C_NUMBER_RE:$,END_SAME_AS_BEGIN:function(w){return Object.assign(w,{"on:begin":(T,P)=>{P.data._beginMatch=T[1]},"on:end":(T,P)=>{P.data._beginMatch!==T[1]&&P.ignoreMatch()}})},HASH_COMMENT_MODE:Q,IDENT_RE:D,MATCH_NOTHING_RE:C,METHOD_GUARD:dt,NUMBER_MODE:fe,NUMBER_RE:A,PHRASAL_WORDS_MODE:N,QUOTE_STRING_MODE:oe,REGEXP_MODE:xe,RE_STARTERS_RE:te,SHEBANG:de,TITLE_MODE:Fe,UNDERSCORE_IDENT_RE:B,UNDERSCORE_TITLE_MODE:Ht});function en(w,T){w.input[w.index-1]==="."&&T.ignoreMatch()}function kn(w,T){w.className!==void 0&&(w.scope=w.className,delete w.className)}function pn(w,T){T&&w.beginKeywords&&(w.begin="\\b("+w.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",w.__beforeBegin=en,w.keywords=w.keywords||w.beginKeywords,delete w.beginKeywords,w.relevance===void 0&&(w.relevance=0))}function Ut(w,T){Array.isArray(w.illegal)&&(w.illegal=y(...w.illegal))}function fn(w,T){if(w.match){if(w.begin||w.end)throw new Error("begin & end are not supported with match");w.begin=w.match,delete w.match}}function le(w,T){w.relevance===void 0&&(w.relevance=1)}const Lt=(w,T)=>{if(!w.beforeMatch)return;if(w.starts)throw new Error("beforeMatch cannot be used with starts");const P=Object.assign({},w);Object.keys(w).forEach(se=>{delete w[se]}),w.keywords=P.keywords,w.begin=g(P.beforeMatch,f(P.begin)),w.starts={relevance:0,contains:[Object.assign(P,{endsParent:!0})]},w.relevance=0,delete P.beforeMatch},vt=["of","and","for","in","not","or","if","then","parent","list","value"],Z="keyword";function xt(w,T,P=Z){const se=Object.create(null);return typeof w=="string"?Ue(P,w.split(" ")):Array.isArray(w)?Ue(P,w):Object.keys(w).forEach(function(ze){Object.assign(se,xt(w[ze],T,ze))}),se;function Ue(ze,q){T&&(q=q.map(H=>H.toLowerCase())),q.forEach(function(H){const ae=H.split("|");se[ae[0]]=[ze,Re(ae[0],ae[1])]})}}function Re(w,T){return T?Number(T):ke(w)?0:1}function ke(w){return vt.includes(w.toLowerCase())}const Nt={},Xe=w=>{console.error(w)},hn=(w,...T)=>{console.log(`WARN: ${w}`,...T)},Tt=(w,T)=>{Nt[`${w}/${T}`]||(console.log(`Deprecated as of ${w}. ${T}`),Nt[`${w}/${T}`]=!0)},L=new Error;function V(w,T,{key:P}){let se=0;const Ue=w[P],ze={},q={};for(let H=1;H<=T.length;H++)q[H+se]=Ue[H],ze[H+se]=!0,se+=k(T[H-1]);w[P]=q,w[P]._emit=ze,w[P]._multi=!0}function ue(w){if(Array.isArray(w.begin)){if(w.skip||w.excludeBegin||w.returnBegin)throw Xe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),L;if(typeof w.beginScope!="object"||w.beginScope===null)throw Xe("beginScope must be object"),L;V(w,w.begin,{key:"beginScope"}),w.begin=_(w.begin,{joinWith:""})}}function we(w){if(Array.isArray(w.end)){if(w.skip||w.excludeEnd||w.returnEnd)throw Xe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),L;if(typeof w.endScope!="object"||w.endScope===null)throw Xe("endScope must be object"),L;V(w,w.end,{key:"endScope"}),w.end=_(w.end,{joinWith:""})}}function Qe(w){w.scope&&typeof w.scope=="object"&&w.scope!==null&&(w.beginScope=w.scope,delete w.scope)}function Wt(w){Qe(w),typeof w.beginScope=="string"&&(w.beginScope={_wrap:w.beginScope}),typeof w.endScope=="string"&&(w.endScope={_wrap:w.endScope}),ue(w),we(w)}function Do(w){function T(q,H){return new RegExp(p(q),"m"+(w.case_insensitive?"i":"")+(w.unicodeRegex?"u":"")+(H?"g":""))}class P{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(H,ae){ae.position=this.position++,this.matchIndexes[this.matchAt]=ae,this.regexes.push([ae,H]),this.matchAt+=k(H)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const H=this.regexes.map(ae=>ae[1]);this.matcherRe=T(_(H,{joinWith:"|"}),!0),this.lastIndex=0}exec(H){this.matcherRe.lastIndex=this.lastIndex;const ae=this.matcherRe.exec(H);if(!ae)return null;const it=ae.findIndex((Bo,Va)=>Va>0&&Bo!==void 0),et=this.matchIndexes[it];return ae.splice(0,it),Object.assign(ae,et)}}class se{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(H){if(this.multiRegexes[H])return this.multiRegexes[H];const ae=new P;return this.rules.slice(H).forEach(([it,et])=>ae.addRule(it,et)),ae.compile(),this.multiRegexes[H]=ae,ae}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(H,ae){this.rules.push([H,ae]),ae.type==="begin"&&this.count++}exec(H){const ae=this.getMatcher(this.regexIndex);ae.lastIndex=this.lastIndex;let it=ae.exec(H);if(this.resumingScanAtSamePosition()&&!(it&&it.index===this.lastIndex)){const et=this.getMatcher(0);et.lastIndex=this.lastIndex+1,it=et.exec(H)}return it&&(this.regexIndex+=it.position+1,this.regexIndex===this.count&&this.considerAll()),it}}function Ue(q){const H=new se;return q.contains.forEach(ae=>H.addRule(ae.begin,{rule:ae,type:"begin"})),q.terminatorEnd&&H.addRule(q.terminatorEnd,{type:"end"}),q.illegal&&H.addRule(q.illegal,{type:"illegal"}),H}function ze(q,H){const ae=q;if(q.isCompiled)return ae;[kn,fn,Wt,Lt].forEach(et=>et(q,H)),w.compilerExtensions.forEach(et=>et(q,H)),q.__beforeBegin=null,[pn,Ut,le].forEach(et=>et(q,H)),q.isCompiled=!0;let it=null;return typeof q.keywords=="object"&&q.keywords.$pattern&&(q.keywords=Object.assign({},q.keywords),it=q.keywords.$pattern,delete q.keywords.$pattern),it=it||/\w+/,q.keywords&&(q.keywords=xt(q.keywords,w.case_insensitive)),ae.keywordPatternRe=T(it,!0),H&&(q.begin||(q.begin=/\B|\b/),ae.beginRe=T(ae.begin),!q.end&&!q.endsWithParent&&(q.end=/\B|\b/),q.end&&(ae.endRe=T(ae.end)),ae.terminatorEnd=p(ae.end)||"",q.endsWithParent&&H.terminatorEnd&&(ae.terminatorEnd+=(q.end?"|":"")+H.terminatorEnd)),q.illegal&&(ae.illegalRe=T(q.illegal)),q.contains||(q.contains=[]),q.contains=[].concat(...q.contains.map(function(et){return W(et==="self"?q:et)})),q.contains.forEach(function(et){ze(et,ae)}),q.starts&&ze(q.starts,H),ae.matcher=Ue(ae),ae}if(w.compilerExtensions||(w.compilerExtensions=[]),w.contains&&w.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return w.classNameAliases=r(w.classNameAliases||{}),ze(w)}function x(w){return w?w.endsWithParent||x(w.starts):!1}function W(w){return w.variants&&!w.cachedVariants&&(w.cachedVariants=w.variants.map(function(T){return r(w,{variants:null},T)})),w.cachedVariants?w.cachedVariants:x(w)?r(w,{starts:w.starts?r(w.starts):null}):Object.isFrozen(w)?r(w):w}var ne="11.11.1";class Ce extends Error{constructor(T,P){super(T),this.name="HTMLInjectionError",this.html=P}}const be=t,ot=r,Ot=Symbol("nomatch"),Zn=7,Io=function(w){const T=Object.create(null),P=Object.create(null),se=[];let Ue=!0;const ze="Could not find the language '{}', did you forget to load/include a language module?",q={disableAutodetect:!0,name:"Plain text",contains:[]};let H={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function ae(I){return H.noHighlightRe.test(I)}function it(I){let X=I.className+" ";X+=I.parentNode?I.parentNode.className:"";const ye=H.languageDetectRe.exec(X);if(ye){const Ve=Qn(ye[1]);return Ve||(hn(ze.replace("{}",ye[1])),hn("Falling back to no-highlight mode for this block.",I)),Ve?ye[1]:"no-highlight"}return X.split(/\s+/).find(Ve=>ae(Ve)||Qn(Ve))}function et(I,X,ye){let Ve="",nt="";typeof X=="object"?(Ve=I,ye=X.ignoreIllegals,nt=X.language):(Tt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Tt("10.7.0",`Please use highlight(code, options) instead.
|
|
120
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),nt=I,Ve=X),ye===void 0&&(ye=!0);const mn={code:Ve,language:nt};$i("before:highlight",mn);const er=mn.result?mn.result:Bo(mn.language,mn.code,ye);return er.code=mn.code,$i("after:highlight",er),er}function Bo(I,X,ye,Ve){const nt=Object.create(null);function mn(F,K){return F.keywords[K]}function er(){if(!pe.keywords){pt.addText(He);return}let F=0;pe.keywordPatternRe.lastIndex=0;let K=pe.keywordPatternRe.exec(He),ge="";for(;K;){ge+=He.substring(F,K.index);const Oe=En.case_insensitive?K[0].toLowerCase():K[0],kt=mn(pe,Oe);if(kt){const[Pn,
|
|
121
|
-
`,1;if(qa>1e5&&qa>K.index*3)throw new Error("potential infinite loop, way more iterations than matches");return He+=ge,ge.length}const En=Qn(I);if(!En)throw Xe(ze.replace("{}",I)),new Error('Unknown language: "'+I+'"');const bb=Do(En);let Wa="",pe=Ve||bb;const zd={},pt=new H.__emitter(H);gb();let He="",Vi=0,Sr=0,qa=0,Ka=!1;try{if(En.__emitTokens)En.__emitTokens(X,pt);else{for(pe.matcher.considerAll();;){qa++,Ka?Ka=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=Sr;const F=pe.matcher.exec(X);if(!F)break;const K=X.substring(Sr,F.index),ge=Fd(K,F);Sr=F.index+ge}Fd(X.substring(Sr))}return pt.finalize(),Wa=pt.toHTML(),{language:I,value:Wa,relevance:Vi,illegal:!1,_emitter:pt,_top:pe}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:I,value:be(X),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:Sr,context:X.slice(Sr-100,Sr+100),mode:F.mode,resultSoFar:Wa},_emitter:pt};if(Ue)return{language:I,value:be(X),illegal:!1,relevance:0,errorRaised:F,_emitter:pt,_top:pe};throw F}}function Va(I){const X={value:be(I),illegal:!1,relevance:0,_top:q,_emitter:new H.__emitter(H)};return X._emitter.addText(I),X}function Ha(I,X){X=X||H.languages||Object.keys(T);const ye=Va(I),Ve=X.filter(Qn).filter(Bd).map(qt=>Bo(qt,I,!1));Ve.unshift(ye);const nt=Ve.sort((qt,wn)=>{if(qt.relevance!==wn.relevance)return wn.relevance-qt.relevance;if(qt.language&&wn.language){if(Qn(qt.language).supersetOf===wn.language)return 1;if(Qn(wn.language).supersetOf===qt.language)return-1}return 0}),[mn,er]=nt,Fi=mn;return Fi.secondBest=er,Fi}function nb(I,X,ye){const Ve=X&&P[X]||ye;I.classList.add("hljs"),I.classList.add(`language-${Ve}`)}function Ua(I){let X=null;const ye=it(I);if(ae(ye))return;if($i("before:highlightElement",{el:I,language:ye}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0&&(H.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(I)),H.throwUnescapedHTML))throw new Ce("One of your code blocks includes unescaped HTML.",I.innerHTML);X=I;const Ve=X.textContent,nt=ye?et(Ve,{language:ye,ignoreIllegals:!0}):Ha(Ve);I.innerHTML=nt.value,I.dataset.highlighted="yes",nb(I,ye,nt.language),I.result={language:nt.language,re:nt.relevance,relevance:nt.relevance},nt.secondBest&&(I.secondBest={language:nt.secondBest.language,relevance:nt.secondBest.relevance}),$i("after:highlightElement",{el:I,result:nt,text:Ve})}function rb(I){H=ot(H,I)}const ob=()=>{Pi(),Tt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ib(){Pi(),Tt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Dd=!1;function Pi(){function I(){Pi()}if(document.readyState==="loading"){Dd||window.addEventListener("DOMContentLoaded",I,!1),Dd=!0;return}document.querySelectorAll(H.cssSelector).forEach(Ua)}function sb(I,X){let ye=null;try{ye=X(w)}catch(Ve){if(Xe("Language definition for '{}' could not be registered.".replace("{}",I)),Ue)Xe(Ve);else throw Ve;ye=q}ye.name||(ye.name=I),T[I]=ye,ye.rawDefinition=X.bind(null,w),ye.aliases&&Id(ye.aliases,{languageName:I})}function ab(I){delete T[I];for(const X of Object.keys(P))P[X]===I&&delete P[X]}function lb(){return Object.keys(T)}function Qn(I){return I=(I||"").toLowerCase(),T[I]||T[P[I]]}function Id(I,{languageName:X}){typeof I=="string"&&(I=[I]),I.forEach(ye=>{P[ye.toLowerCase()]=X})}function Bd(I){const X=Qn(I);return X&&!X.disableAutodetect}function cb(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=X=>{I["before:highlightBlock"](Object.assign({block:X.el},X))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=X=>{I["after:highlightBlock"](Object.assign({block:X.el},X))})}function db(I){cb(I),se.push(I)}function ub(I){const X=se.indexOf(I);X!==-1&&se.splice(X,1)}function $i(I,X){const ye=I;se.forEach(function(Ve){Ve[ye]&&Ve[ye](X)})}function pb(I){return Tt("10.7.0","highlightBlock will be removed entirely in v12.0"),Tt("10.7.0","Please use highlightElement now."),Ua(I)}Object.assign(w,{highlight:et,highlightAuto:Ha,highlightAll:Pi,highlightElement:Ua,highlightBlock:pb,configure:rb,initHighlighting:ob,initHighlightingOnLoad:ib,registerLanguage:sb,unregisterLanguage:ab,listLanguages:lb,getLanguage:Qn,registerAliases:Id,autoDetection:Bd,inherit:ot,addPlugin:db,removePlugin:ub}),w.debugMode=function(){Ue=!1},w.safeMode=function(){Ue=!0},w.versionString=ne,w.regex={concat:g,lookahead:f,either:y,optional:m,anyNumberOfTimes:h};for(const I in ut)typeof ut[I]=="object"&&n(ut[I]);return Object.assign(w,ut),w},Pt=Io({});return Pt.newInstance=()=>Io({}),_l=Pt,Pt.HighlightJS=Pt,Pt.default=Pt,_l}var zT=FT();const VT=$T(zT),Fp={},HT="hljs-";function UT(n){const e=VT.newInstance();return n&&i(n),{highlight:t,highlightAuto:r,listLanguages:o,register:i,registerAlias:s,registered:a};function t(c,d,u){const p=u||Fp,f=typeof p.prefix=="string"?p.prefix:HT;if(!e.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");e.configure({__emitter:WT,classPrefix:f});const h=e.highlight(d,{ignoreIllegals:!0,language:c});if(h.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:h.errorRaised});const m=h._emitter.root,g=m.data;return g.language=h.language,g.relevance=h.relevance,m}function r(c,d){const p=(d||Fp).subset||o();let f=-1,h=0,m;for(;++f<p.length;){const g=p[f];if(!e.getLanguage(g))continue;const b=t(g,c,d);b.data&&b.data.relevance!==void 0&&b.data.relevance>h&&(h=b.data.relevance,m=b)}return m||{type:"root",children:[],data:{language:void 0,relevance:h}}}function o(){return e.listLanguages()}function i(c,d){if(typeof c=="string")e.registerLanguage(c,d);else{let u;for(u in c)Object.hasOwn(c,u)&&e.registerLanguage(u,c[u])}}function s(c,d){if(typeof c=="string")e.registerAliases(typeof d=="string"?d:[...d],{languageName:c});else{let u;for(u in c)if(Object.hasOwn(c,u)){const p=c[u];e.registerAliases(typeof p=="string"?p:[...p],{languageName:u})}}}function a(c){return!!e.getLanguage(c)}}class WT{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const t=this.stack[this.stack.length-1],r=t.children[t.children.length-1];r&&r.type==="text"?r.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const r=this.stack[this.stack.length-1],o=e.root.children;t?r.children.push({type:"element",tagName:"span",properties:{className:[t]},children:o}):r.children.push(...o)}openNode(e){const t=this,r=e.split(".").map(function(s,a){return a?s+"_".repeat(a):t.options.classPrefix+s}),o=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};o.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}function qT(n){const e=document.createElement("textarea");e.value=n,e.contentEditable="true",e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();const t=document.execCommand("copy");return e.remove(),t}function KT(n){return navigator.clipboard!==void 0?navigator.clipboard.writeText(n):new Promise((e,t)=>{const r=qT(n);r?e(!0):t(r)})}const GT={class:"code-block-toolbar"},jT={class:"wrap editable"},JT={class:"wrap"},YT={class:"language readonly"},XT=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.ref("content_copy"),r=l.computed({get(){return e.node.attrs.language},set(d){e.updateAttributes({language:d})}}),o=l.computed({get(){return e.node.attrs.wrap},set(d){e.updateAttributes({wrap:d})}}),i=l.computed(()=>o.value?"text_select_move_down":"format_text_wrap");function s(d){r.value=d}function a(){const d=e.node.content.content[0].text;KT(d).then(()=>{t.value="done",setTimeout(()=>{t.value="content_copy"},2e3)})}function c(){o.value=!o.value}return(d,u)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-code-block-view"}),{default:l.withCtx(()=>[l.createElementVNode("div",GT,[l.createElementVNode("div",jT,[l.createVNode(l.unref(Um),{language:r.value,onSelect:s},null,8,["language"])]),l.createElementVNode("div",JT,[l.createElementVNode("div",YT,l.toDisplayString(r.value),1),l.createVNode(l.unref(Me),{icon:i.value,"icon-class":{"rotate-270":o.value},tooltip:"Wrap",class:"editable",onClick:c},null,8,["icon","icon-class"]),l.createVNode(l.unref(Me),{icon:t.value,tooltip:"Copy",onClick:a},null,8,["icon"])])]),l.createElementVNode("pre",null,[l.createVNode(l.unref(Xn),{as:"code",class:l.normalizeClass({wrap:o.value})},null,8,["class"])])]),_:1},16))}}),ZT=UT(PT),QT=g1.extend({draggable:!0,addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),wrap:{default:!0,rendered:!1}}},addNodeView(){return yn(XT)}}).configure({languageClassPrefix:"language-",defaultLanguage:"bash",lowlight:ZT}),zp=n=>{const e=/(#[0-9a-f]{3,6})\b/gi,t=[];return n.descendants((r,o)=>{r.text&&Array.from(r.text.matchAll(e)).forEach(i=>{const s=i[0],a=i.index||0,c=o+a,d=c+s.length,u=Ze.inline(c,d,{class:"color",style:`--color: ${s}`});t.push(u)})}),Ne.create(n,t)},eO=Ae.create({name:"colorHighlighter",addProseMirrorPlugins(){return[new Te({state:{init(n,{doc:e}){return zp(e)},apply(n,e){return n.docChanged?zp(n.doc):e}},props:{decorations(n){return this.getState(n)}}})]}});Ae.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Te({key:new $e("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:o}=e,i=[];if(!t||!r)return Ne.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((c,d)=>{if(c.isText)return;if(!(o>=d&&o<=d+c.nodeSize-1))return!1;s+=1});let a=0;return n.descendants((c,d)=>{if(c.isText||!(o>=d&&o<=d+c.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(Ze.node(d,d+c.nodeSize,{class:this.options.className}))}),Ne.create(n,i)}}})]}});const tO=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.computed(()=>e.node.attrs.level);return(r,o)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:["o-heading-view",`h${t.value}`],"data-id":r.node.attrs["data-id"],style:`text-align: ${r.node.attrs.textAlign}`}),{default:l.withCtx(()=>[l.createVNode(l.unref(Xn))]),_:1},16,["class","data-id","style"]))}}),nO=Bm.extend({draggable:!0,addNodeView(){return yn(tO)}}),rO={class:"horizontal"},oO=l.defineComponent({__name:"view",props:ct,setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-horizontal-view"}),{default:l.withCtx(()=>[l.createElementVNode("div",rO,[l.createVNode(l.unref(Xn),{as:"div",class:"divider"})])]),_:1},16))}}),iO=zm.extend({draggable:!0,addNodeView(){return yn(oO)}}),sO=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Og=Ke.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:n}){return["img",_e(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Zc({find:sO,type:this.type,getAttributes:n=>{const[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),aO={key:1,class:"image-container"},lO={key:1},cO=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.ref(!1),r=l.ref(!1),o=l.ref({}),i=l.ref(null),s=l.ref(!1),a=l.computed(()=>e.node.attrs),c=l.computed({get(){return e.node.attrs.src},set(b){e.updateAttributes({src:b})}}),d=l.computed({get(){return e.node.attrs.title},set(b){e.updateAttributes({title:b})}});function u(){s.value=!0,setTimeout(()=>{var b;(b=i.value)==null||b.focus()},0)}function p(){s.value=!1}function f(){c.value==="init"&&g(!0)}function h(b){switch(t.value=!1,b.value){case"replace":g(!0);break}}function m(b){c.value=b,g(!1)}function g(b){r.value=b}return l.onMounted(()=>{g(c.value==="init")}),(b,y)=>{var k;return l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:["o-image-view",{"with-caption":a.value.alt,"with-ratio":a.value.ratio,readonly:!((k=b.editor)!=null&&k.isEditable),init:c.value==="init"}],size:a.value.size,as:"div",onClick:f}),{default:l.withCtx(()=>[l.createVNode(l.unref(xo),{modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=E=>r.value=E),placement:c.value==="init"?"bottom":"top","show-arrow":""},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(fd),{val:c.value==="init"?"":c.value,type:"image",onInput:m},null,8,["val"])]),default:l.withCtx(()=>{var E;return[c.value==="init"?(l.openBlock(),l.createBlock(l.unref(cd),{key:0,icon:"image",placeholder:"Add an image"})):(l.openBlock(),l.createElementBlock("div",aO,[l.createVNode(l.unref(ud),l.mergeProps(e,{onAction:h}),{default:l.withCtx(()=>[l.createVNode(l.unref(Me),{icon:"subtitles",tooltip:"image.caption",onClick:u})]),_:1},16),l.createElementVNode("img",l.mergeProps(a.value,{draggable:"true","data-drag-handle":""}),null,16),l.createElementVNode("div",{class:"caption",onClick:u},[(E=b.editor)!=null&&E.isEditable&&s.value?(l.openBlock(),l.createBlock(l.unref(Ao),{key:0,ref_key:"captionInput",ref:i,class:"caption-input",modelValue:d.value,"onUpdate:modelValue":y[0]||(y[0]=v=>d.value=v),type:"text",placeholder:"Input caption",autosize:"",onBlur:p},null,8,["modelValue"])):(l.openBlock(),l.createElementBlock("span",lO,l.toDisplayString(d.value),1))])]))]}),_:1},8,["modelValue","placement"]),l.createVNode(l.unref(Ba),{modelValue:t.value,"onUpdate:modelValue":y[2]||(y[2]=E=>t.value=E),event:o.value},{default:l.withCtx(()=>[l.createVNode(l.unref(Xr),l.mergeProps(e,{onAction:h}),null,16)]),_:1},8,["modelValue","event"])]),_:1},16,["class","size"])}}}),dO=Og.extend({draggable:!0,addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),size:{default:"",rendered:!1},ratio:{default:"",rendered:!1},isDraggable:{default:!0,renderHTML:e=>({})}}},renderHTML({node:n,HTMLAttributes:e}){return e.size=n.attrs.size,e.ratio=n.attrs.ratio,["img",_e(this.options.HTMLAttributes,e)]},addNodeView(){return yn(cO)}}).configure({inline:!0}),uO="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",pO="ελ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",To=(n,e)=>{for(const t in e)n[t]=e[t];return n},cc="numeric",dc="ascii",uc="alpha",ni="asciinumeric",Jo="alphanumeric",pc="domain",Mg="emoji",fO="scheme",hO="slashscheme",Sl="whitespace";function mO(n,e){return n in e||(e[n]=[]),e[n]}function Dr(n,e,t){e[cc]&&(e[ni]=!0,e[Jo]=!0),e[dc]&&(e[ni]=!0,e[uc]=!0),e[ni]&&(e[Jo]=!0),e[uc]&&(e[Jo]=!0),e[Jo]&&(e[pc]=!0),e[Mg]&&(e[pc]=!0);for(const r in e){const o=mO(r,t);o.indexOf(n)<0&&o.push(n)}}function gO(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function $t(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}$t.groups={};$t.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(n))return i}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let o=0;o<n.length;o++)this.tt(n[o],e,t,r)},tr(n,e,t,r){r=r||$t.groups;let o;return e&&e.j?o=e:(o=new $t(e),t&&r&&Dr(e,t,r)),this.jr.push([n,o]),o},ts(n,e,t,r){let o=this;const i=n.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(n[s]);return o.tt(n[i-1],e,t,r)},tt(n,e,t,r){r=r||$t.groups;const o=this;if(e&&e.j)return o.j[n]=e,e;const i=e;let s,a=o.go(n);if(a?(s=new $t,To(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new $t,i){if(r)if(s.t&&typeof s.t=="string"){const c=To(gO(s.t,r),t);Dr(i,c,r)}else t&&Dr(i,t,r);s.t=i}return o.j[n]=s,s}};const he=(n,e,t,r,o)=>n.ta(e,t,r,o),Ge=(n,e,t,r,o)=>n.tr(e,t,r,o),Vp=(n,e,t,r,o)=>n.ts(e,t,r,o),R=(n,e,t,r,o)=>n.tt(e,t,r,o),Vn="WORD",fc="UWORD",Ag="ASCIINUMERICAL",Rg="ALPHANUMERICAL",_i="LOCALHOST",hc="TLD",mc="UTLD",_s="SCHEME",co="SLASH_SCHEME",Cd="NUM",gc="WS",_d="NL",ri="OPENBRACE",oi="CLOSEBRACE",Js="OPENBRACKET",Ys="CLOSEBRACKET",Xs="OPENPAREN",Zs="CLOSEPAREN",Qs="OPENANGLEBRACKET",ea="CLOSEANGLEBRACKET",ta="FULLWIDTHLEFTPAREN",na="FULLWIDTHRIGHTPAREN",ra="LEFTCORNERBRACKET",oa="RIGHTCORNERBRACKET",ia="LEFTWHITECORNERBRACKET",sa="RIGHTWHITECORNERBRACKET",aa="FULLWIDTHLESSTHAN",la="FULLWIDTHGREATERTHAN",ca="AMPERSAND",Sd="APOSTROPHE",da="ASTERISK",ir="AT",ua="BACKSLASH",pa="BACKTICK",fa="CARET",ar="COLON",xd="COMMA",ha="DOLLAR",Sn="DOT",ma="EQUALS",Nd="EXCLAMATION",nn="HYPHEN",ii="PERCENT",ga="PIPE",ba="PLUS",ya="POUND",si="QUERY",Td="QUOTE",Dg="FULLWIDTHMIDDLEDOT",Od="SEMI",xn="SLASH",ai="TILDE",va="UNDERSCORE",Ig="EMOJI",ka="SYM";var Bg=Object.freeze({__proto__:null,WORD:Vn,UWORD:fc,ASCIINUMERICAL:Ag,ALPHANUMERICAL:Rg,LOCALHOST:_i,TLD:hc,UTLD:mc,SCHEME:_s,SLASH_SCHEME:co,NUM:Cd,WS:gc,NL:_d,OPENBRACE:ri,CLOSEBRACE:oi,OPENBRACKET:Js,CLOSEBRACKET:Ys,OPENPAREN:Xs,CLOSEPAREN:Zs,OPENANGLEBRACKET:Qs,CLOSEANGLEBRACKET:ea,FULLWIDTHLEFTPAREN:ta,FULLWIDTHRIGHTPAREN:na,LEFTCORNERBRACKET:ra,RIGHTCORNERBRACKET:oa,LEFTWHITECORNERBRACKET:ia,RIGHTWHITECORNERBRACKET:sa,FULLWIDTHLESSTHAN:aa,FULLWIDTHGREATERTHAN:la,AMPERSAND:ca,APOSTROPHE:Sd,ASTERISK:da,AT:ir,BACKSLASH:ua,BACKTICK:pa,CARET:fa,COLON:ar,COMMA:xd,DOLLAR:ha,DOT:Sn,EQUALS:ma,EXCLAMATION:Nd,HYPHEN:nn,PERCENT:ii,PIPE:ga,PLUS:ba,POUND:ya,QUERY:si,QUOTE:Td,FULLWIDTHMIDDLEDOT:Dg,SEMI:Od,SLASH:xn,TILDE:ai,UNDERSCORE:va,EMOJI:Ig,SYM:ka});const Fn=/[a-z]/,Fo=new RegExp("\\p{L}","u"),xl=new RegExp("\\p{Emoji}","u"),zn=/\d/,Nl=/\s/,Hp="\r",Tl=`
|
|
122
|
-
`,bO="️",yO="",Ol="";let rs=null,is=null;function vO(n=[]){const e={};$t.groups=e;const t=new $t;rs==null&&(rs=Up(uO)),is==null&&(is=Up(pO)),R(t,"'",Sd),R(t,"{",ri),R(t,"}",oi),R(t,"[",Js),R(t,"]",Ys),R(t,"(",Xs),R(t,")",Zs),R(t,"<",Qs),R(t,">",ea),R(t,"(",ta),R(t,")",na),R(t,"「",ra),R(t,"」",oa),R(t,"『",ia),R(t,"』",sa),R(t,"<",aa),R(t,">",la),R(t,"&",ca),R(t,"*",da),R(t,"@",ir),R(t,"`",pa),R(t,"^",fa),R(t,":",ar),R(t,",",xd),R(t,"$",ha),R(t,".",Sn),R(t,"=",ma),R(t,"!",Nd),R(t,"-",nn),R(t,"%",ii),R(t,"|",ga),R(t,"+",ba),R(t,"#",ya),R(t,"?",si),R(t,'"',Td),R(t,"/",xn),R(t,";",Od),R(t,"~",ai),R(t,"_",va),R(t,"\\",ua),R(t,"・",
|
|
112
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(c,d){var u=d&&gC(d,r);return u&&c.push(u),c},[]);return vi(n)?a[0]:a}In.defaultProps=Gt;In.setDefaultProps=pC;In.currentInput=Nn;Object.assign({},um,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});In.setDefaultProps({render:Om});class bC{constructor({editor:e,element:t,view:r,tippyOptions:o={},updateDelay:i=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:c,from:d,to:u})=>{const{doc:p,selection:f}=c,{empty:h}=f,m=!p.textBetween(d,u).length&&Aa(c.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||h||m||!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 c;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,c)=>{const d=!(c!=null&&c.selection.eq(a.state.selection)),u=!(c!=null&&c.doc.eq(a.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,d,u,c)},this.updateDelay))},this.updateHandler=(a,c,d,u)=>{var p,f,h;const{state:m,composing:g}=a,{selection:b}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:k}=b,E=Math.min(...k.map(C=>C.$from.pos)),v=Math.max(...k.map(C=>C.$to.pos));if(!((p=this.shouldShow)===null||p===void 0?void 0:p.call(this,{editor:this.editor,element:this.element,view:a,state:m,oldState:u,from:E,to:v}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(am(m.selection)){let C=a.nodeDOM(E);if(C){const D=C.dataset.nodeViewWrapper?C:C.querySelector("[data-node-view-wrapper]");if(D&&(C=D.firstChild),C)return C.getBoundingClientRect()}}return lm(a,E,v)})}),this.show()},this.editor=e,this.element=t,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,t=!!e.parentElement;this.tippy||!t||(this.tippy=In(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,t){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!(t!=null&&t.selection.eq(e.state.selection)),s=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,i,s,t)}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,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Mm=n=>new Te({key:typeof n.pluginKey=="string"?new $e(n.pluginKey):n.pluginKey,view:e=>new bC({view:e,...n})});Ae.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Mm({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class yC{getTextContent(e){return im(e,{textSerializers:jc(this.editor.schema)})}constructor({editor:e,element:t,view:r,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:c}=a,{$anchor:d,empty:u}=c,p=d.depth===1,f=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!s.hasFocus()||!u||!p||!f||!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!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||(s==null?void 0:s.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=t,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,t=!!e.parentElement;this.tippy||!t||(this.tippy=In(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,t){var r,o,i;const{state:s}=e,{doc:a,selection:c}=s,{from:d,to:u}=c;if(t&&t.doc.eq(a)&&t.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:t}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:((i=this.tippyOptions)===null||i===void 0?void 0:i.getReferenceClientRect)||(()=>lm(e,d,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,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Am=n=>new Te({key:typeof n.pluginKey=="string"?new $e(n.pluginKey):n.pluginKey,view:e=>new yC({view:e,...n})});Ae.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Am({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const vC=l.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(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:o,pluginKey:i,shouldShow:s,tippyOptions:a}=n;o.registerPlugin(Mm({updateDelay:r,editor:o,element:t.value,pluginKey:i,shouldShow:s,tippyOptions:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=n;o.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function hp(n){return l.customRef((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class kC extends Dn{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=hp(this.view.state),this.reactiveExtensionStorage=hp(this.extensionStorage),this.on("beforeTransaction",({nextState:t})=>{this.reactiveState.value=t,this.reactiveExtensionStorage.value=this.extensionStorage}),l.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,t){const r=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}}const wC=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=l.ref(),t=l.getCurrentInstance();return l.watchEffect(()=>{const r=n.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const o=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=t.ctx._,t&&(r.appContext={...t.appContext,provides:t.provides}),r.setOptions({element:o}),r.createNodeViews()})}),l.onBeforeUnmount(()=>{const r=n.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return l.h("div",{ref:n=>{this.rootEl=n}})}}),EC=l.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:i,shouldShow:s}=n;o.registerPlugin(Am({pluginKey:r,editor:o,element:t.value,tippyOptions:i,shouldShow:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=n;o.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),Xn=l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),ad=l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,e;return l.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))}}),CC=(n={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new kC(n)}),l.onBeforeUnmount(()=>{var t,r,o;const i=(t=e.value)===null||t===void 0?void 0:t.options.element,s=i==null?void 0:i.cloneNode(!0);(r=i==null?void 0:i.parentNode)===null||r===void 0||r.replaceChild(s,i),(o=e.value)===null||o===void 0||o.destroy()}),e};class Rm{constructor(e,{props:t={},editor:r}){this.editor=r,this.component=l.markRaw(e),this.el=document.createElement("div"),this.props=l.reactive(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t,r,o;return!((t=(e=this.renderedComponent.vNode)===null||e===void 0?void 0:e.component)===null||t===void 0)&&t.exposed?this.renderedComponent.vNode.component.exposed:(o=(r=this.renderedComponent.vNode)===null||r===void 0?void 0:r.component)===null||o===void 0?void 0:o.proxy}renderComponent(){let e=l.h(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&l.render(e,this.el),{vNode:e,destroy:()=>{this.el&&l.render(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([t,r])=>{this.props[t]=r}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const ct={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class _C extends LE{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()},t=this.onDragStart.bind(this);this.decorationClasses=l.ref(this.getDecorationClasses());const r=l.defineComponent({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:o=>{var i,s;return l.provide("onDragStart",t),l.provide("decorationClasses",this.decorationClasses),(s=(i=this.component).setup)===null||s===void 0?void 0:s.call(i,o,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new Rm(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:e,to:t}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&t>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,r){const o=i=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(i)};if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=r,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:t,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>o({node:e,decorations:t,innerDecorations:r})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===t&&this.innerDecorations===r||(this.node=e,this.decorations=t,this.innerDecorations=r,o({node:e,decorations:t,innerDecorations:r})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function yn(n,e){return t=>{if(!t.editor.contentComponent)return{};const r=typeof n=="function"&&"__vccOpts"in n?n.__vccOpts:n;return new _C(r,t,e)}}const SC=/^\s*>\s$/,Dm=Ke.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[wo({find:SC,type:this.type})]}}),xC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,NC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,TC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,OC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,MC=ln.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Kr({find:xC,type:this.type}),Kr({find:TC,type:this.type})]},addPasteRules(){return[vr({find:NC,type:this.type}),vr({find:OC,type:this.type})]}}),AC="listItem",mp="textStyle",gp=/^\s*([-+*])\s$/,RC=Ke.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:n}){return["ul",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(AC,this.editor.getAttributes(mp)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=wo({find:gp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=wo({find:gp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(mp),editor:this.editor})),[n]}}),DC=/(^|[^`])`([^`]+)`(?!`)/,IC=/(^|[^`])`([^`]+)`(?!`)/g,BC=ln.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Kr({find:DC,type:this.type})]},addPasteRules(){return[vr({find:IC,type:this.type})]}}),LC=/^```([a-z]+)?[\s\n]$/,PC=/^~~~([a-z]+)?[\s\n]$/,Im=Ke.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:n=>{var e;const{languageClassPrefix:t}=this.options,i=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(t)).map(s=>s.replace(t,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",_e(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:o}=t;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
113
|
+
|
|
114
|
+
`);return!i||!s?!1:n.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:o,empty:i}=t;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)?n.commands.command(({tr:d})=>(d.setSelection(ee.near(r.resolve(a))),!0)):n.commands.exitCode()}}},addInputRules(){return[rc({find:LC,type:this.type,getAttributes:n=>({language:n[1]})}),rc({find:PC,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Te({key:new $e("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!t||!i)return!1;const{tr:s,schema:a}=n.state,c=a.text(t.replace(/\r\n?/g,`
|
|
115
|
+
`));return s.replaceSelectionWith(this.type.create({language:i},c)),s.selection.$from.parent.type!==this.type&&s.setSelection(Y.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Bm=Ke.create({name:"doc",topNode:!0,content:"block+"});function $C(n={}){return new Te({view(e){return new FC(e,n)}})}class FC{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let a=e.nodeBefore,c=e.nodeAfter;if(a||c){let d=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(d){let u=d.getBoundingClientRect(),p=a?u.bottom:u.top;a&&c&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:p-this.width/2,bottom:p+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.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",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,t,e):o;if(t&&!i){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=sy(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const zC=Ae.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[$C(this.options)]}});class je extends ee{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return je.valid(r)?new je(r):ee.near(r)}content(){return O.empty}eq(e){return e instanceof je&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new je(e.resolve(t.pos))}getBookmark(){return new ld(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!VC(e)||!HC(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let o=t.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&je.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(t>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=t;let c=e.doc.resolve(o);if(je.valid(c))return c}for(;;){let s=t>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!G.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*t),r=!1;continue e}break}i=s,o+=t;let a=e.doc.resolve(o);if(je.valid(a))return a}return null}}}je.prototype.visible=!1;je.findFrom=je.findGapCursorFrom;ee.jsonID("gapcursor",je);class ld{constructor(e){this.pos=e}map(e){return new ld(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return je.valid(t)?new je(t):ee.near(t)}}function VC(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(t-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 HC(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(t);;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 UC(){return new Te({props:{decorations:GC,createSelectionBetween(n,e,t){return e.pos==t.pos&&je.valid(t)?new je(t):null},handleClick:qC,handleKeyDown:WC,handleDOMEvents:{beforeinput:KC}}})}const WC=zc({ArrowLeft:Yi("horiz",-1),ArrowRight:Yi("horiz",1),ArrowUp:Yi("vert",-1),ArrowDown:Yi("vert",1)});function Yi(n,e){const t=n=="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,c=s.empty;if(s instanceof Y){if(!i.endOfTextblock(t)||a.depth==0)return!1;c=!1,a=r.doc.resolve(e>0?a.after():a.before())}let d=je.findGapCursorFrom(a,e,c);return d?(o&&o(r.tr.setSelection(new je(d))),!0):!1}}function qC(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!je.valid(r))return!1;let o=n.posAtCoords({left:t.clientX,top:t.clientY});return o&&o.inside>-1&&G.isSelectable(n.state.doc.nodeAt(o.inside))?!1:(n.dispatch(n.state.tr.setSelection(new je(r))),!0)}function KC(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof je))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let o=S.empty;for(let s=r.length-1;s>=0;s--)o=S.from(r[s].createAndFill(null,o));let i=n.state.tr.replace(t.pos,t.pos,new O(o,0,0));return i.setSelection(Y.near(i.doc.resolve(t.pos+1))),n.dispatch(i),!1}function GC(n){if(!(n.selection instanceof je))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ne.create(n.doc,[Ze.widget(n.selection.head,e,{key:"gapcursor"})])}const jC=Ae.create({name:"gapCursor",addProseMirrorPlugins(){return[UC()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=me(U(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),JC=Ke.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",_e(this.options.HTMLAttributes,n)]},renderText(){return`
|
|
116
|
+
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:o,storedMarks:i}=t;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,c=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&s){const p=c.filter(f=>a.includes(f.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Lm=Ke.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,_e(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>rc({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Vs=200,at=function(){};at.prototype.append=function(e){return e.length?(e=at.from(e),!this.length&&e||e.length<Vs&&this.leafAppend(e)||this.length<Vs&&e.leafPrepend(this)||this.appendInner(e)):this};at.prototype.prepend=function(e){return e.length?at.from(e).append(this):this};at.prototype.appendInner=function(e){return new YC(this,e)};at.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?at.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};at.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};at.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};at.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},t,r),o};at.from=function(e){return e instanceof at?e:e&&e.length?new Pm(e):at.empty};var Pm=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={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 c=i;c<s;c++)if(o(this.values[c],a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var c=i-1;c>=s;c--)if(o(this.values[c],a+c)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Vs)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Vs)return new e(o.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(at);at.empty=new Pm([]);var YC=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.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}(at);const XC=500;class gn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){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;t&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,c,d=[],u=[];return this.items.forEach((p,f)=>{if(!p.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(p);return}if(o){u.push(new _n(p.map));let h=p.step.map(o.slice(i)),m;h&&s.maybeStep(h).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new _n(m,void 0,void 0,d.length+u.length))),i--,m&&o.appendMap(m,i)}else s.maybeStep(p.step);if(p.selection)return a=o?p.selection.map(o.slice(i)):p.selection,c=new gn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:a}}addTransform(e,t,r,o){let i=[],s=this.eventCount,a=this.items,c=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let p=e.steps[u].invert(e.docs[u]),f=new _n(e.mapping.maps[u],p,t),h;(h=c&&c.merge(f))&&(f=h,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),t&&(s++,t=void 0),o||(c=f)}let d=s-r.depth;return d>QC&&(a=ZC(a,d),s-=d),new gn(a.append(i),s)}remapping(e,t){let r=new fo;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,t),r}addMaps(e){return this.eventCount==0?this:new gn(this.items.append(e.map(t=>new _n(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-t),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let c=t;this.items.forEach(f=>{let h=i.getMirror(--c);if(h==null)return;s=Math.min(s,h);let m=i.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),b=f.selection&&f.selection.map(i.slice(c+1,h));b&&a++,r.push(new _n(m,g,b))}else r.push(new _n(m))},o);let d=[];for(let f=t;f<s;f++)d.push(new _n(i.maps[f]));let u=this.items.slice(0,o).append(d).append(r),p=new gn(u,a);return p.emptyItemCount()>XC&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.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 c=s.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=s.selection&&s.selection.map(t.slice(r));u&&i++;let p=new _n(d.invert(),c,u),f,h=o.length-1;(f=o.length&&o[h].merge(p))?o[h]=f:o.push(p)}}else s.map&&r--},this.items.length,0),new gn(at.from(o.reverse()),i)}}gn.empty=new gn(at.empty,0);function ZC(n,e){let t;return n.forEach((r,o)=>{if(r.selection&&e--==0)return t=o,!1}),n.slice(t)}class _n{constructor(e,t,r,o){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new _n(t.getMap().invert(),t,this.selection)}}}class or{constructor(e,t,r,o,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const QC=20;function e_(n,e,t,r){let o=t.getMeta(Fr),i;if(o)return o.historyState;t.getMeta(r_)&&(n=new or(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Fr))return s.getMeta(Fr).redo?new or(n.done.addTransform(t,void 0,r,Es(e)),n.undone,bp(t.mapping.maps),n.prevTime,n.prevComposition):new or(n.done,n.undone.addTransform(t,void 0,r,Es(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),c=n.prevTime==0||!s&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!t_(t,n.prevRanges)),d=s?yl(n.prevRanges,t.mapping):bp(t.mapping.maps);return new or(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Es(e)),gn.empty,d,t.time,a??n.prevComposition)}else return(i=t.getMeta("rebased"))?new or(n.done.rebased(t,i),n.undone.rebased(t,i),yl(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new or(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),yl(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function t_(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(t=!0)}),t}function bp(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,o,i,s)=>e.push(i,s));return e}function yl(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let o=e.map(n[r],1),i=e.map(n[r+1],-1);o<=i&&t.push(o,i)}return t}function n_(n,e,t){let r=Es(e),o=Fr.get(e).spec.config,i=(t?n.undone:n.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(t?n.done:n.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),c=new or(t?a:i.remaining,t?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Fr,{redo:t,historyState:c})}let vl=!1,yp=null;function Es(n){let e=n.plugins;if(yp!=e){vl=!1,yp=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){vl=!0;break}}return vl}const Fr=new $e("history"),r_=new $e("closeHistory");function o_(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Te({key:Fr,state:{init(){return new or(gn.empty,gn.empty,null,0,-1)},apply(e,t,r){return e_(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,o=r=="historyUndo"?Fm:r=="historyRedo"?zm:null;return o?(t.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function $m(n,e){return(t,r)=>{let o=Fr.getState(t);if(!o||(n?o.undone:o.done).eventCount==0)return!1;if(r){let i=n_(o,t,n);i&&r(e?i.scrollIntoView():i)}return!0}}const Fm=$m(!1,!0),zm=$m(!0,!0),i_=Ae.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Fm(n,e),redo:()=>({state:n,dispatch:e})=>zm(n,e)}},addProseMirrorPlugins(){return[o_(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()}}}),Vm=Ke.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",_e(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{selection:t}=e,{$from:r,$to:o}=t,i=n();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):am(t)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:s,dispatch:a})=>{var c;if(a){const{$to:d}=s.selection,u=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?s.setSelection(Y.create(s.doc,d.pos+1)):d.nodeAfter.isBlock?s.setSelection(G.create(s.doc,d.pos)):s.setSelection(Y.create(s.doc,d.pos));else{const p=(c=d.parent.type.contentMatch.defaultType)===null||c===void 0?void 0:c.create();p&&(s.insert(u,p),s.setSelection(Y.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Zc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),s_=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,a_=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,l_=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,c_=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,d_=ln.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Kr({find:s_,type:this.type}),Kr({find:l_,type:this.type})]},addPasteRules(){return[vr({find:a_,type:this.type}),vr({find:c_,type:this.type})]}}),u_=Ke.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",_e(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),p_="listItem",vp="textStyle",kp=/^(\d+)\.\s$/,f_=Ke.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:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",_e(this.options.HTMLAttributes,t),0]:["ol",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(p_,this.editor.getAttributes(vp)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=wo({find:kp,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=wo({find:kp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(vp)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),Hm=Ke.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),h_=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,m_=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,g_=ln.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Kr({find:h_,type:this.type})]},addPasteRules(){return[vr({find:m_,type:this.type})]}}),b_=Ke.create({name:"text",group:"inline"}),y_=Ae.create({name:"starterKit",addExtensions(){var n,e,t,r,o,i,s,a,c,d,u,p,f,h,m,g,b,y;const k=[];return this.options.bold!==!1&&k.push(MC.configure((n=this.options)===null||n===void 0?void 0:n.bold)),this.options.blockquote!==!1&&k.push(Dm.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&k.push(RC.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&k.push(BC.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&k.push(Im.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&k.push(Bm.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&k.push(zC.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&k.push(jC.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&k.push(JC.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&k.push(Lm.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&k.push(i_.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&k.push(Vm.configure((p=this.options)===null||p===void 0?void 0:p.horizontalRule)),this.options.italic!==!1&&k.push(d_.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&k.push(u_.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&k.push(f_.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&k.push(Hm.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&k.push(g_.configure((b=this.options)===null||b===void 0?void 0:b.strike)),this.options.text!==!1&&k.push(b_.configure((y=this.options)===null||y===void 0?void 0:y.text)),k}}),v_=n=>{if(!n.children.length)return;const e=n.querySelectorAll("span");e&&e.forEach(t=>{var r,o;const i=t.getAttribute("style"),s=(o=(r=t.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||o===void 0?void 0:o.getAttribute("style");t.setAttribute("style",`${s};${i}`)})},k_=ln.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&v_(n),{}):!1}]},renderHTML({HTMLAttributes:n}){return["span",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:n})=>{const{selection:e}=n;return n.doc.nodesBetween(e.from,e.to,(t,r)=>{if(t.isTextblock)return!0;t.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(i=>!!i))||n.removeMark(r,r+t.nodeSize,this.type)}),!0}}}}),ie=l.defineComponent({__name:"OIcon",props:{name:{type:String,default:""},color:{type:String,default:""},small:{type:Boolean,default:!1}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("span",{class:l.normalizeClass(["o-icon",{small:n.small}]),style:l.normalizeStyle({color:n.color})},[l.createElementVNode("i",{class:l.normalizeClass(["yiitip-icon",`icon-${n.name}`])},null,2)],6))}}),wp={isoName:"en-us",nativeName:"English (US)",diagram:{name:"Text Diagram",flow:"Flow Diagram",sequence:"Sequence Diagram",class:"Class Diagram",state:"State Diagram",gantt:"Gantt Diagram",tips:"Generation of diagram and chart from text in a similar manner as markdown"},editor:{add:"Add",addMore:"Add More",url:"URL",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",textFormat:"More text format",list:"List",unorderedList:"Unordered List",orderedList:"Ordered List",todoList:"Todo List",subscript:"Subscript",superscript:"Superscript",hyperlink:"Hyperlink",toggleFullscreen:"Toggle Fullscreen",quote:"Quote",left:"Left align",center:"Center align",right:"Right align",justify:"Justify align",print:"Print",outdent:"Decrease indentation",indent:"Increase indentation",indentDropdown:"Indent",removeFormat:"Remove formatting",formatting:"Formatting",fontFamily:"Font Family",defaultFont:"Default Font",fontSize:"Font Size",align:"Align",hr:"Insert Horizontal Rule",undo:"Undo",redo:"Redo",heading:"Heading & Paragraph",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",headings:"Headings",paragraph:"Paragraph",code:"Code",codeBlock:"Code Block",size1:"Very small",size2:"A bit small",size3:"Normal",size4:"Medium-large",size5:"Big",size6:"Very big",size7:"Maximum",viewSource:"View Source",textColor:"Text Color",highlightColor:"Highlight Color",default:"Default",lineHeight:"Line Height",blockquote:"Blockquote",table:"Table",photo:"Insert Photo",video:"Insert Video",formula:"Formula",inlineFormula:"Inline",blockFormula:"Block",thirdPartyService:"Third party services",horizontal:"Horizontal Rule",callout:"Callout",emoji:"Emoji",defaultColor:"Default Color",noColor:"No Color",delete:"Delete",duplicate:"Duplicate"},label:{ai:"AI",cancel:"Cancel",color:"Color",edit:"Edit",link:"Link",linkAddress:"Link Address",ok:"Ok",preview:"Preview",template:"Template",example:"Example",submit:"Submit",settings:"Settings",remove:"Remove",replace:"Replace",help:"Help",back:"Back",styles:"Styles",basic:"Basic",basicBlocks:"Basic Blocks",common:"Common",media:"Media",image:"Image",video:"Video",model:"Model",modelViewer:"Model Viewer",more:"More",toc:"Table of Contents",untitled:"Untitled",typeForCommands:"Type '/' for commands",empty:"Empty",emptyTips:"Press Enter to continue with an empty note, or select following",copy:"Copy",cut:"Cut",search:"Search"},table:{cellBackground:"Cell Background",insert:"Insert Table",remove:"Remove Table",addColumn:"Add Column",removeColumn:"Remove Column",addRow:"Add Row",removeRow:"Remove Row",merge:"Merge/Unmerge Cells"},image:{preferences:"Image Preferences",ratio:"Ratio",size:"Size",width:"Width",height:"Height",src:"Image Source",caption:"Caption",link:"Link",lockAspectRatio:"Lock aspect ratio",unlockAspectRatio:"Unlock aspect ratio",original:"Original",small:"Small",medium:"Medium",large:"Large"},embed:{video:"Video",map:"Map",design:"Design",develop:"Develop",data:"Data",others:"Others",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}},w_={isoName:"pl",nativeName:"Polski",diagram:{name:"Schemat tekstowy",flow:"Schemat przepływu",sequence:"Schemat sekwencji",class:"Schemat klas",state:"Diagram stanu",gantt:"Diagram Gantta",tips:"Generowanie diagramu i wykresu z tekstu w podobny sposób jak markdown"},editor:{add:"Dodaj",addMore:"Dodaj więcej",url:"URL",bold:"Pogrubienie",italic:"Kursywa",strikethrough:"Przekreślenie",underline:"Podkreślenie",textFormat:"More text format",unorderedList:"Lista wypunktowana",orderedList:"Lista numerowana",list:"List",todoList:"Lista rzeczy do zrobienia",subscript:"Indeks dolny",superscript:"Indeks górny",hyperlink:"Hiperłącze",toggleFullscreen:"Przełącz na tryb pełnoekranowy",quote:"Zacytuj",left:"Wyrównaj do lewej",center:"Wyrównaj do środka",right:"Wyrównaj do prawej",justify:"Wyjustuj",print:"Drukuj",outdent:"Zmniejsz wcięcie",indent:"Zwiększ wcięcie",indentDropdown:"Wcięcie",removeFormat:"Usuń formatowanie",formatting:"Formatowanie",fontFamily:"Nazwa czcionki",defaultFont:"Domyślna czcionka",fontSize:"Rozmiar czcionki",align:"Wyrównanie",hr:"Wstaw poziomą linię",undo:"Cofnij",redo:"Przywróć",heading:"Heading & Paragraph",heading1:"Nagłówek 1",heading2:"Nagłówek 2",heading3:"Nagłówek 3",heading4:"Nagłówek 4",heading5:"Nagłówek 5",headings:"Nagłówki",paragraph:"Paragraf",code:"Kod",codeBlock:"Blok kodu",size1:"Bardzo mała",size2:"Mała",size3:"Normalna",size4:"Średnio-duża",size5:"Duża",size6:"Bardzo duża",size7:"Maksymalna",viewSource:"Pokaż źródło",textColor:"Kolor czcionki",highlightColor:"Kolor wyróżnienia",default:"Dymyślny",lineHeight:"Wysokość linii",blockquote:"Cytat",table:"Tabela",photo:"Wstaw obraz",video:"Insert Video",formula:"Formuła",inlineFormula:"Formuła w treści",blockFormula:"Blokowa formuła",thirdPartyService:"Third party services",horizontal:"Horizontal Rule",callout:"Callout",emoji:"Emoji",defaultColor:"Default Color",noColor:"No Color",delete:"Delete",duplicate:"Duplicate"},label:{ai:"AI",cancel:"Anuluj",edit:"Edycja",link:"Łącze",linkAddress:"Adres łącza",ok:"Ok",preview:"Podgląd",template:"Szablon",example:"Example",submit:"Submit",settings:"Settings",remove:"Remove",help:"Help",back:"Back",styles:"Styles",basic:"Basic",basicBlocks:"Basic Blocks",common:"Common",media:"Media",image:"Image",video:"Video",model:"Model",modelViewer:"Model Viewer",toc:"Table of Contents",untitled:"Untitled",typeForCommands:"Type '/' for commands",empty:"Empty",emptyTips:"Press Enter to continue with an empty note, or select following",copy:"Copy",cut:"Cut",search:"Search"},table:{cellBackground:"Cell Background",insert:"Insert Table",remove:"Remove Table",addColumn:"Add Column",removeColumn:"Remove Column",addRow:"Add Row",removeRow:"Remove Row",merge:"Merge/Unmerge Cells"},image:{preferences:"Preferencje obrazu",ratio:"Ratio",size:"Rozmiar",width:"Szerokość",height:"Wysokość",src:"Źródło obrazu",caption:"Nagłówek",link:"Łącze",lockAspectRatio:"Lock aspect ratio",unlockAspectRatio:"Unlock aspect ratio",original:"Original",small:"Small",medium:"Medium",large:"Large"},embed:{video:"Video",map:"Map",design:"Design",develop:"Develop",data:"Data",others:"Others",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}},E_={isoName:"pt-br",nativeName:"Português (BR)",diagram:{name:"Diagrama de Texto",flow:"Diagrama de Fluxo",sequence:"Diagrama de sequência",class:"Diagrama de Classe",state:"Diagrama de Estado",gantt:"Diagrama de Gantt",tips:"Geração de diagrama ou gráfico a partir de texto semelhante a markdown"},editor:{add:"Adicionar",addMore:"Adicione Mais",url:"URL",bold:"Negrito",italic:"Itálico",strikethrough:"Tachar",underline:"Sublinhado",textFormat:"Mais formatos de textos",list:"Lista",unorderedList:"Lista com Marcadores",orderedList:"Lista Numerada",todoList:"Lista de afazer",subscript:"Subscrito",superscript:"Sobrescrito",hyperlink:"Hyperlink",toggleFullscreen:"Alternar tela-cheia",quote:"Citação",left:"Alinhar à esquerda",center:"Alinhar ao centro",right:"Alinhar à direita",justify:"Justificar",print:"Imprimir",outdent:"Diminuir recuo",indent:"Aumentar recuo",indentDropdown:"Recuo",removeFormat:"Limpar formatação",formatting:"Formatação",fontFamily:"Fonte",defaultFont:"Fonte Padrão",fontSize:"Tamanho da fontee",align:"Alinhamento",hr:"Linha Horizontal",undo:"Desfazer",redo:"Refazer",heading:"Heading & Paragraph",heading1:"Título 1",heading2:"Título 2",heading3:"Título 3",heading4:"Título 4",heading5:"Título 5",headings:"Estilos de Parágrafo",paragraph:"Parágrafo",code:"Código",codeBlock:"Bloco de Código",size1:"Muito Pequeno",size2:"Pequeno",size3:"Normal",size4:"Médio",size5:"Grande",size6:"Enorme",size7:"Máximo",viewSource:"Código Fonte",textColor:"Cor do texto",highlightColor:"Cor do fundo",default:"Padrão",lineHeight:"Espaço entre linhas",blockquote:"Bloco de citação",table:"Tabela",photo:"Inserir Foto",video:"Insert Video",formula:"Fórmula",inlineFormula:"Linha",blockFormula:"Bloco",thirdPartyService:"Serviços de terceiros",horizontal:"Horizontal Rule",callout:"Callout",emoji:"Emoji",defaultColor:"Default Color",noColor:"No Color",delete:"Delete",duplicate:"Duplicate"},label:{ai:"AI",cancel:"Cancelar",edit:"Editar",link:"Link",linkAddress:"Endereço do Link",ok:"Ok",preview:"Pré Visualização",template:"Modelo",example:"Exemplo",submit:"Enviar",settings:"Configurações",remove:"Excluir",help:"Ajuda",back:"Voltar",styles:"Styles",basic:"Basic",basicBlocks:"Basic Blocks",common:"Common",media:"Media",image:"Image",video:"Video",model:"Model",modelViewer:"Model Viewer",toc:"Table of Contents",untitled:"Untitled",typeForCommands:"Type '/' for commands",empty:"Empty",emptyTips:"Press Enter to continue with an empty note, or select following",copy:"Copy",cut:"Cut",search:"Search"},table:{cellBackground:"Cell Background",insert:"Insert Table",remove:"Remove Table",addColumn:"Add Column",removeColumn:"Remove Column",addRow:"Add Row",removeRow:"Remove Row",merge:"Merge/Unmerge Cells"},image:{preferences:"Preferências da Imagem",ratio:"Ratio",size:"Tamanho",width:"Largura",height:"Altura",src:"Origem da imagem",caption:"Legenda",link:"Link",lockAspectRatio:"Bloquear proporção",unlockAspectRatio:"Desbloquear proporção",original:"Original",small:"Small",medium:"Medium",large:"Large"},embed:{video:"Vídeo",map:"Mapa",design:"Design",develop:"Desenvolvimento",data:"Dados",others:"Outros",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"Youku",iqiyi:"iQiyi",bilibili:"Bilibili",qqvideo:"QQ Video",google_map:"Google Map",amap:"AMap",baidu_map:"Baidu Map",modao:"Modao",lanhu:"Lanhu",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"Jinshuju",iframe:"IFrame",linkTips:"Link or embed code",linkWarning:"Invalid link"},link:{back:"Back to main menu",edit:"Edit Link",off:"Disable Link",open:"Open Link",open_in_new_tab:"Open in new tab"}},Ep={isoName:"zh-hans",nativeName:"简体中文",diagram:{name:"文本绘图",flow:"流程图",sequence:"时序图",class:"类图",state:"状态图",gantt:"甘特图",tips:"使用Markdown风格文本生成流程图、顺序图、类图、状态图和甘特图"},editor:{add:"添加",addMore:"添加更多",url:"URL",bold:"粗体",italic:"斜体",strikethrough:"删除线",underline:"下划线",textFormat:"更多格式",list:"列表",unorderedList:"无序列表",orderedList:"有序列表",todoList:"任务列表",subscript:"下标",superscript:"上标",hyperlink:"超链接",toggleFullscreen:"全屏切换",quote:"引号",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐",print:"打印",outdent:"减少缩进",indent:"增加缩进",indentDropdown:"缩进",removeFormat:"清除格式",formatting:"格式化",fontFamily:"字体",defaultFont:"默认字体",fontSize:"字体大小",align:"对齐方式",hr:"插入分割线",undo:"撤消",redo:"重做",heading:"标题与段落",heading1:"标题一",heading2:"标题二",heading3:"标题三",heading4:"标题四",heading5:"标题五",headings:"标题",paragraph:"正文",code:"代码",codeBlock:"代码块",size1:"非常小",size2:"比较小",size3:"正常",size4:"中等偏大",size5:"大",size6:"非常大",size7:"超级大",viewSource:"查看资料",textColor:"文字颜色",highlightColor:"背景颜色",default:"默认",lineHeight:"行高",blockquote:"引用",table:"表格",photo:"图片",video:"视频",formula:"数学公式",inlineFormula:"行内公式",blockFormula:"块级公式",thirdPartyService:"第三方服务",horizontal:"水平线",callout:"高亮块",emoji:"表情",defaultColor:"默认颜色",noColor:"无色",delete:"删除",duplicate:"创建副本"},label:{ai:"AI",cancel:"取消",color:"颜色",edit:"编辑",link:"链接",linkAddress:"链接地址",ok:"确定",preview:"预览",template:"模板",example:"示例",submit:"确定",settings:"设置",remove:"删除",replace:"替换",help:"帮助",back:"返回",styles:"样式",basic:"基础",basicBlocks:"基础块",common:"常用",media:"多媒体",image:"图片",video:"视频",model:"模型",modelViewer:"模型",more:"更多",toc:"目录",untitled:"未命名",typeForCommands:"输入 '/' 显示命令",empty:"空白页面",emptyTips:"按回车开始编辑,或从下方选择",copy:"复制",cut:"剪切",search:"搜索"},table:{cellBackground:"单元格背景色",insert:"插入表格",remove:"删除表格",addColumn:"添加列",removeColumn:"删除列",addRow:"添加行",removeRow:"删除行",merge:"合并/拆分 单元格"},image:{preferences:"图片设置",ratio:"比例",size:"尺寸",width:"宽度",height:"高度",src:"图片地址",caption:"图片说明",link:"链接",lockAspectRatio:"锁定长宽比",unlockAspectRatio:"解锁长宽比",original:"原始",small:"小",medium:"中",large:"大"},embed:{video:"视频",map:"地图",design:"设计",develop:"开发",data:"数据",others:"其它",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"优酷",iqiyi:"爱奇艺",bilibili:"Bilibili",qqvideo:"腾讯视频",google_map:"谷歌地图",amap:"高德地图",baidu_map:"百度",modao:"墨刀",lanhu:"蓝湖",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"金数据",iframe:"IFrame",linkTips:"链接或代码",linkWarning:"无效的链接"},link:{back:"返回主菜单",edit:"编辑链接",off:"取消链接",open:"打开链接",open_in_new_tab:"在新标签页打开"}},C_={isoName:"zh-hant",nativeName:"繁體中文",diagram:{name:"文本繪圖",flow:"流程圖",sequence:"時序圖",class:"類圖",state:"狀態圖",gantt:"甘特圖",tips:"使用Markdown風格文本生成流程圖、順序圖、類圖、狀態圖和甘特圖"},editor:{add:"添加",addMore:"添加更多",url:"URL",bold:"粗體",italic:"斜體",strikethrough:"刪除線",underline:"下劃線",textFormat:"更多格式",list:"列表",unorderedList:"無序列表",orderedList:"有序列表",todoList:"任務列表",subscript:"下標",superscript:"上標",hyperlink:"超鏈接",toggleFullscreen:"全屏切換",quote:"引號",left:"左對齊",center:"居中對齊",right:"右對齊",justify:"兩端對齊",print:"打印",outdent:"減少縮進",indent:"增加縮進",indentDropdown:"縮進",removeFormat:"清除格式",formatting:"格式化",fontFamily:"字體",defaultFont:"默認字體",fontSize:"字體大小",align:"對齊方式",hr:"插入分割線",undo:"撤消",redo:"重做",heading:"標題與段落",heading1:"標題一",heading2:"標題二",heading3:"標題三",heading4:"標題四",heading5:"標題五",headings:"標題",paragraph:"正文",code:"代碼",codeBlock:"代碼塊",size1:"非常小",size2:"比較小",size3:"正常",size4:"中等偏大",size5:"大",size6:"非常大",size7:"超級大",viewSource:"查看資料",textColor:"文字顏色",highlightColor:"背景顏色",default:"默認",lineHeight:"行高",blockquote:"引用",table:"表格",photo:"圖片",video:"視頻",formula:"數學公式",inlineFormula:"行內公式",blockFormula:"塊級公式",thirdPartyService:"第三方服務",horizontal:"水平線",callout:"高亮塊",emoji:"表情",defaultColor:"默認顏色",noColor:"無色",delete:"刪除",duplicate:"創建副本"},label:{ai:"AI",cancel:"取消",edit:"編輯",link:"鏈接",linkAddress:"鏈接地址",ok:"確定",preview:"預覽",template:"模板",example:"示例",submit:"確定",settings:"設置",remove:"刪除",help:"幫助",back:"返回",styles:"樣式",basic:"基础",basicBlocks:"基础块",common:"常用",media:"多媒體",image:"圖片",video:"視頻",model:"模型",modelViewer:"模型",toc:"目錄",untitled:"未命名",typeForCommands:"輸入 '/' 顯示命令",empty:"空白页面",emptyTips:"按回车开始编辑,或从下方选择",copy:"複製",cut:"剪切",search:"搜索"},table:{cellBackground:"單元格背景色",insert:"插入表格",remove:"刪除表格",addColumn:"添加列",removeColumn:"刪除列",addRow:"添加行",removeRow:"刪除行",merge:"合併/拆分 單元格"},image:{preferences:"圖片設置",ratio:"比例",size:"尺寸",width:"寬度",height:"高度",src:"圖片地址",caption:"圖片說明",link:"鏈接",lockAspectRatio:"鎖定長寬比",unlockAspectRatio:"解鎖長寬比",original:"原始",small:"小",medium:"中",large:"大"},embed:{video:"視頻",map:"地圖",design:"設計",develop:"開發",data:"數據",others:"其它",youtube:"Youtube",vimeo:"Vimeo",netflix:"Netflix",youku:"優酷",iqiyi:"愛奇藝",bilibili:"Bilibili",qqvideo:"騰訊視頻",google_map:"谷歌地圖",amap:"高德地圖",baidu_map:"百度",modao:"墨刀",lanhu:"藍湖",figma:"Figma",canva:"Canva",processon:"ProcessOn",codepen:"CodePen",google_forms:"Google Forms",jinshuju:"金數據",iframe:"IFrame",linkTips:"鏈接或代碼",linkWarning:"無效的鏈接"},link:{back:"返回主菜單",edit:"編輯鏈接",off:"取消鏈接",open:"打開鏈接",open_in_new_tab:"在新標籤頁打開"}},Um={en:wp,"en-us":wp,pl:w_,"pt-br":E_,zh:Ep,"zh-hans":Ep,"zh-hant":C_},__="en",S_=Um[__],x_=n=>Um[n]||S_;function ve(){const n=l.inject("locale",{value:"en"}),e=l.computed(()=>x_(n.value));function t(r){return r.split(".").reduce((o,i)=>{if(o)return o[i]},e.value)}return{locale:n,message:e,tr:t}}function Bi(){const n=l.inject("darkMode",{value:!1}),e=l.computed(()=>n.value?"dark":"light");return{darkMode:n,theme:e}}function Pe(){function n(t,r,o={}){const i=t==null?void 0:t.chain().focus(),s=t==null?void 0:t.commands;e(s,i,r,o)}function e(t,r,o,i={}){switch(console.log("command",o,i),o){case"backColor":i.color?t.setHighlight({color:i.color}):t.unsetHighlight();break;case"blockquote":r.toggleBlockquote().run();break;case"bold":r.toggleBold().run();break;case"bulletList":r.toggleBulletList().run();break;case"callout":r.toggleCallout().run();break;case"clearFormat":r.unsetAllMarks().run();break;case"code":r.toggleCode().run();break;case"codeBlock":t.toggleCodeBlock({language:"bash"});break;case"content":t.insertContent(i.content);break;case"fontFamily":t.setFontFamily(i.fontFamily);break;case"foreColor":t.setColor(i.color);break;case"heading":r.toggleHeading(i).run();break;case"horizontalRule":r.setHorizontalRule().run();break;case"image":r.setImage({src:"init"}).run();break;case"imageUpdate":r.setImage(i).run();break;case"italic":r.toggleItalic().run();break;case"linkSet":r.extendMarkRange("link").setLink(i).run();break;case"linkUnset":r.extendMarkRange("link").unsetLink().run();break;case"orderedList":r.toggleOrderedList().run();break;case"paragraph":r.setParagraph().run();break;case"strike":r.toggleStrike().run();break;case"table":r.insertTable({rows:3,cols:3,withHeaderRow:!0}).run();break;case"tableAddColumn":r.addColumnAfter().run();break;case"tableAddRow":r.addRowAfter().run();break;case"tableCellAttribute":r.setCellAttribute(i.name,i.value).run();break;case"tableDeleteColumn":r.deleteColumn().run();break;case"tableDeleteRow":r.deleteRow().run();break;case"tableDelete":r.deleteTable().run();break;case"tableInsert":r.insertTable(i).run();break;case"tableMergeCells":r.mergeCells().run();break;case"tableSelectColumn":r.selectColumn(i.pos).run();break;case"tableSelectRow":r.selectRow(i.pos).run();break;case"tableSplitCell":r.splitCell().run();break;case"taskList":t.toggleTaskList();break;case"textAlign":r.setTextAlign(i.textAlign).run();break;case"underline":r.toggleUnderline().run();break;case"video":r.setVideo({src:"init"}).run()}}return{run:n,onCommand:e}}const _r=l.defineComponent({__name:"OTooltip",props:{placement:{type:String,default:"top"},trigger:{type:String,default:"mouseenter focus"}},setup(n){const e=n,{theme:t}=Bi(),r=l.ref(),o=l.ref(),i=l.ref();function s(){i.value=In(r.value,{appendTo:()=>document.body,animation:"perspective",content:o.value,duration:100,interactive:!0,placement:e.placement,trigger:e.trigger})}function a(){i.value.setProps({theme:t.value})}return l.watch(t,c=>{a()}),l.onMounted(()=>{s()}),(c,d)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"triggerRef",ref:r,"data-tippy-role":"tooltip"},[l.renderSlot(c.$slots,"trigger"),l.createElementVNode("div",{ref_key:"contentRef",ref:o,class:"tooltip-content"},[l.renderSlot(c.$slots,"default")],512)],512))}}),Me=l.defineComponent({__name:"OMenubarBtn",props:{icon:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},tooltip:{type:String,default:""},placement:{type:String,default:"top"},contentClass:{type:[String,Object],default:""},contentStyle:{type:[String,Object],default:""},iconClass:{type:[String,Object],default:""}},emits:["click"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(_r,{class:"o-tooltip",placement:n.placement},{trigger:l.withCtx(()=>[l.createElementVNode("button",{class:l.normalizeClass(["o-menubar-btn o-command-btn o-btn",n.contentClass]),style:l.normalizeStyle(n.contentStyle),onClick:o[0]||(o[0]=i=>t("click",i))},[l.createVNode(ie,{name:n.icon,color:n.color,class:l.normalizeClass(n.iconClass)},null,8,["name","color","class"])],6)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(n.tooltip),1)]),_:1},8,["placement"]))}}),N_=l.defineComponent({__name:"OSimpleCommandBtn",props:{name:{type:String,default:""},editor:{type:Object}},setup(n){const e=n,{run:t}=Pe(),{tr:r}=ve(),o=l.computed(()=>({aiViewer:{icon:"auto_awesome",tooltip:r("label.ai")},blockquote:{icon:"format_quote_open",tooltip:r("editor.blockquote")},bold:{icon:"format_bold",tooltip:r("editor.bold")},callout:{icon:"card_text",tooltip:r("editor.callout")},clearFormat:{icon:"format_clear",tooltip:r("editor.removeFormat")},code:{icon:"code",tooltip:r("editor.code")},codeBlock:{icon:"code_braces",tooltip:r("editor.codeBlock")},columns:{icon:"splitscreen_vertical_add",tooltip:"Column",rotate:!0},horizontalRule:{icon:"horizontal_rule",tooltip:r("editor.hr")},italic:{icon:"format_italic",tooltip:r("editor.italic")},image:{icon:"image",tooltip:r("editor.photo")},linkUnset:{icon:"link_off",tooltip:r("link.off")},modelViewer:{icon:"3d_rotation",tooltip:r("label.modelViewer")},strike:{icon:"format_strikethrough",tooltip:r("editor.strikethrough")},underline:{icon:"format_underlined",tooltip:r("editor.underline")},video:{icon:"videocam",tooltip:r("editor.video")}})),i=l.computed(()=>o.value[e.name]||{icon:"",isActive:!1,command:()=>{}});function s(){t(e.editor,e.name)}return(a,c)=>{var d;return l.openBlock(),l.createBlock(Me,{class:"o-simple-command-btn",icon:i.value.icon,tooltip:i.value.tooltip,"content-class":{"is-active":(d=n.editor)==null?void 0:d.isActive(n.name),"rotate-90":i.value.rotate},onClick:s},null,8,["icon","tooltip","content-class"])}}}),T_={class:"o-block-placeholder"},O_={class:"icon"},M_={class:"placeholder"},cd=l.defineComponent({__name:"OBlockPlaceholder",props:{icon:{type:String,default:"image"},placeholder:{type:String,default:""}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("section",T_,[l.createElementVNode("div",O_,[l.createVNode(l.unref(ie),{name:n.icon},null,8,["name"])]),l.createElementVNode("div",M_,l.toDisplayString(n.placeholder),1)]))}}),Ee={amber:"#ffc107",blue:"#2172e0",brown:"#795548",cyan:"#00bcd4",deepOrange:"#ff5722",deepPurple:"#673ab7",green:"#4caf50",indigo:"#3f51b5",lightBlue:"#03a9f4",lightGreen:"#8bc34a",lime:"#cddc39",orange:"#ff9800",purple:"#9c27b0",pink:"#e91e63",red:"#f44336",teal:"#009688",yellow:"#ffeb3b"},Li=[{label:"editor.paragraph",value:"paragraph",icon:"title",color:"",style:!0,group:"label.basic"},{label:"editor.heading1",value:"heading",icon:"format_h1",color:Ee.blue,style:!0,options:{level:1}},{label:"editor.heading2",value:"heading",icon:"format_h2",color:Ee.blue,style:!0,options:{level:2}},{label:"editor.heading3",value:"heading",icon:"format_h3",color:Ee.blue,style:!0,options:{level:3}},{label:"editor.todoList",value:"taskList",icon:"check_box",color:Ee.indigo,style:!0},{label:"editor.unorderedList",value:"bulletList",icon:"format_list_bulleted",color:Ee.indigo,style:!0},{label:"editor.orderedList",value:"orderedList",icon:"format_list_numbered",color:Ee.indigo,style:!0},{label:"editor.blockquote",value:"blockquote",icon:"format_quote_open",color:Ee.brown,style:!0},{label:"editor.codeBlock",value:"codeBlock",icon:"code_braces",color:Ee.lightBlue,style:!0},{label:"editor.horizontal",value:"horizontalRule",icon:"horizontal_rule",color:Ee.blue},{label:"editor.callout",value:"callout",color:Ee.deepOrange,icon:"card_text",style:!1},{label:"editor.emoji",value:"emoji",icon:"emoji_emotions",color:Ee.blue}],Hs=Li.filter(n=>n.style),wi=[{label:"label.ai",value:"aiViewer",icon:"auto_awesome",color:Ee.purple,tips:"ai",group:"label.ai"},{label:"editor.callout",value:"callout",icon:"card_text",color:Ee.deepOrange,tips:"callout",group:"label.common"},{label:"editor.table",value:"table",icon:"window",tips:"table",color:Ee.cyan},{label:"editor.codeBlock",value:"codeBlock",icon:"code_braces",tips:"code",color:Ee.blue},{label:"editor.todoList",value:"taskList",icon:"check_box",tips:"task",color:Ee.indigo},{label:"label.image",value:"image",icon:"image",color:Ee.amber,tips:"image",group:"label.media"},{label:"label.video",value:"video",icon:"videocam",tips:"video",color:Ee.purple},{label:"label.model",value:"modelViewer",icon:"3d_rotation",tips:"model",color:Ee.purple}],dd=[...Li,...wi],Cp=[{label:"editor.duplicate",value:"duplicate",icon:"content_copy",color:Ee.blue,tips:"Ctrl+D",group:"label.common",filter:"common"},{label:"editor.delete",value:"delete",icon:"delete",tips:"Ctrl+D",color:Ee.deepOrange,filter:"common"},{label:"label.replace",value:"replace",icon:"cached",tips:"Ctrl+R",color:Ee.blue,filter:"image,video,model"},{label:"label.color",value:"palette",icon:"palette",color:Ee.purple,filter:"callout",component:"OCalloutColorBoard"}],A_={key:1,class:"group o-tips"},R_={class:"suffix o-tips"},D_={key:1,class:"item"},Xr=l.defineComponent({__name:"OBlockMenu",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},colorful:{type:Boolean,default:!1},showGroup:{type:Boolean,default:!1}},emits:["action"],setup(n,{emit:e}){const t=n,r=e,{tr:o}=ve(),i=l.ref([]),s=l.computed(()=>{var h;return(h=t.node)==null?void 0:h.type.name}),a=l.computed(()=>{const h=Cp.filter(g=>{var b;return((b=g.filter)==null?void 0:b.indexOf("common"))>=0}),m=Cp.filter(g=>{var b;return((b=g.filter)==null?void 0:b.indexOf(s.value))>=0});if(m.length>0){const g=m[0];g.group=`editor.${s.value}`}return[...h,...m]});function c(h){switch(h.component){case"OCalloutColorBoard":return pd;default:return null}}function d(h){r("action",h),setTimeout(()=>{u(h)},0)}function u(h){switch(h.value){case"delete":t.deleteNode();break;case"duplicate":p();break}}function p(){var y,k,E;const h=t.node.nodeSize,m=t.getPos()+h,g=JSON.parse(JSON.stringify(t.node));(y=t.editor)==null||y.commands.insertContentAt(m,{type:"paragraph"}),(k=t.editor)==null||k.commands.insertContentAt(m,g);const b=m+h+1;(E=t.editor)==null||E.commands.focus(b)}function f(h,m){switch(m.name){case"backColor":t.updateAttributes({background:m.value});break;case"foreColor":t.updateAttributes({borderColor:m.value});break}}return(h,m)=>(l.openBlock(),l.createBlock(l.unref(un),{class:"o-block-menu",hoverable:"",clickable:""},{default:l.withCtx(()=>[a.value.length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(a.value,(g,b)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:b},[g.group?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[b>0?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),n.showGroup?(l.openBlock(),l.createElementBlock("div",A_,l.toDisplayString(l.unref(o)(g.group)),1)):l.createCommentVNode("",!0)],64)):l.createCommentVNode("",!0),c(g)?(l.openBlock(),l.createBlock(l.unref(qe),{key:1,ref_for:!0,ref:i.value[g.value],offset:[0,16],placement:"right"},{trigger:l.withCtx(()=>[l.createVNode(l.unref(Zt),{class:"item",clickable:""},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:g.icon,color:n.colorful?g.color:""},null,8,["name","color"])]),suffix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"navigate_next",class:"o-tips"})]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(o)(g.label)),1)]),_:2},1024)]),default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(c(g)),{onSelect:y=>f(g,y)},null,40,["onSelect"]))]),_:2},1536)):(l.openBlock(),l.createBlock(l.unref(Zt),{key:2,class:"item",clickable:"",onClick:y=>d(g)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:g.icon,color:n.colorful?g.color:""},null,8,["name","color"])]),suffix:l.withCtx(()=>[l.createElementVNode("div",R_,l.toDisplayString(g.tips),1)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(o)(g.label)),1)]),_:2},1032,["onClick"]))],64))),128)):(l.openBlock(),l.createElementBlock("div",D_,"No result"))]),_:1}))}}),xo=l.defineComponent({__name:"OBlockPopover",props:{modelValue:{type:Boolean,default:!1},placement:{type:String,default:"bottom-center"},showArrow:{type:Boolean,default:!1},hideClickOutside:{type:Boolean,default:!1},tippyClass:{type:String,default:""},offset:{type:Array,default:function(){return[0,10]}}},emits:["update:modelValue","show","hide"],setup(n,{emit:e}){const t=n,r=e,o=l.ref();function i(a){r("update:modelValue",a)}function s(){t.hideClickOutside&&r("update:modelValue",!1)}return l.watch(()=>t.modelValue,a=>{var c,d;console.log("modelValue",a),a?(c=o.value)==null||c.setShow(!0):(d=o.value)==null||d.setShow(!1)}),l.onMounted(()=>{var a;t.modelValue&&((a=o.value)==null||a.setShow(!0))}),(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,placement:n.placement,"tippy-class":n.tippyClass,trigger:"manual",arrow:n.showArrow,offset:n.offset,show:n.modelValue,"onUpdate:show":i,onClickoutside:s},{trigger:l.withCtx(()=>[l.renderSlot(a.$slots,"default")]),default:l.withCtx(()=>[l.renderSlot(a.$slots,"popover-content")]),_:3},8,["placement","tippy-class","arrow","offset","show"]))}}),I_={class:"o-block-toolbar"},B_={class:"button-group"},ud=l.defineComponent({__name:"OBlockToolbar",props:{...ct,type:{type:String,default:"link"}},emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),s=l.ref();function a(c){var d;r("action",c),(d=s.value)==null||d.setShow(!1)}return(c,d)=>(l.openBlock(),l.createElementBlock("div",I_,[l.createElementVNode("section",B_,[l.renderSlot(c.$slots,"default"),l.createVNode(l.unref(qe),{ref_key:"popover",ref:s,placement:"bottom-end",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"more_horiz",tooltip:l.unref(i)("label.more")},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(Xr),l.mergeProps(t,{onAction:a}),null,16)]),_:1},512)])]))}}),L_={class:"o-callout-color-board"},P_={class:"fore-colors"},$_=l.createElementVNode("div",{class:"label o-tips"},"Border color",-1),F_={class:"color-row"},z_={class:"color-row"},V_={class:"back-colors"},H_=l.createElementVNode("div",{class:"label o-tips"},"Background",-1),U_={class:"color-row"},W_={class:"color-row"},pd=l.defineComponent({__name:"OCalloutColorBoard",props:{foreColor:{type:String,default:""},backColor:{type:String,default:""},activeColor:{type:String,default:""}},emits:["select"],setup(n,{emit:e}){const t=e;function r(s,a){t("select",{name:s,value:a.value})}const o=l.computed(()=>[{label:"Grey",value:"#e9e9e9"},{label:"Brown",value:"#ffd591"},{label:"Orange",value:"#ffbb96"},{label:"Yellow",value:"#fff08f"},{label:"Green",value:"#b7eb8f"},{label:"Blue",value:"#91d5ff"},{label:"Purple",value:"#d3adf7"},{label:"Pink",value:"#ffadd2"},{label:"Red",value:"#ffa39e"}]),i=l.computed(()=>[{label:"Grey",value:"#F5F5F5"},{label:"Brown",value:"#F4EEEE"},{label:"Orange",value:"#FAEBDD"},{label:"Yellow",value:"#FBF3DB"},{label:"Green",value:"#EDF3EC"},{label:"Blue",value:"#E7F3F8"},{label:"Purple",value:"#F6F3F9"},{label:"Pink",value:"#FAF1F5"},{label:"Red",value:"#FDEBEC"}]);return(s,a)=>(l.openBlock(),l.createElementBlock("section",L_,[l.createElementVNode("section",P_,[$_,l.createElementVNode("div",F_,[l.createVNode(l.unref(Me),{icon:"slash_forward",tooltip:"No color","content-class":"border",onClick:a[0]||(a[0]=c=>r("foreColor",{value:""}))}),n.foreColor?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,tooltip:"Last used","content-style":{borderColor:n.foreColor},onClick:a[1]||(a[1]=c=>r("foreColor",{value:n.foreColor}))},null,8,["content-style"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",z_,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(c,d)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:`col-${d}`,tooltip:c.label,"content-style":{borderColor:c.value},onClick:u=>r("foreColor",c)},null,8,["tooltip","content-style","onClick"]))),128))])]),l.createElementVNode("section",V_,[H_,l.createElementVNode("div",U_,[l.createVNode(l.unref(Me),{icon:"slash_forward",tooltip:"Default Color","content-class":"border",onClick:a[2]||(a[2]=c=>r("backColor",{value:"#F5F5F5"}))}),n.backColor?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,"content-style":{backgroundColor:n.backColor},tooltip:"Last used","content-class":"border",onClick:a[3]||(a[3]=c=>r("backColor",{value:n.backColor}))},null,8,["content-style"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",W_,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(c,d)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:`col-${d}`,tooltip:c.label,"content-style":{backgroundColor:c.value},onClick:u=>r("backColor",c)},null,8,["tooltip","content-style","onClick"]))),128))])])]))}}),q_=l.defineComponent({__name:"OCalloutColorDropdown",props:{editor:{type:Object}},emits:["select"],setup(n,{emit:e}){const t=e,{tr:r}=ve(),{run:o}=Pe(),i=l.ref(null),s=l.ref(""),a=l.ref("");function c(d,u){d==="foreColor"?(s.value=u,localStorage.setItem("yiitap.text-color.fore",u)):d==="backColor"&&(a.value=u,localStorage.setItem("yiitap.text-color.back",u)),t("select",d,u)}return l.onMounted(()=>{s.value=localStorage.getItem("yiitap.text-color.fore")||"",a.value=localStorage.getItem("yiitap.text-color.back")||""}),(d,u)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:i,placement:"bottom-center",trigger:"hover",arrow:""},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"palette",tooltip:l.unref(r)("editor.textColor")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>{var p;return[l.createVNode(l.unref(pd),{"fore-color":s.value,"back-color":a.value,"default-label":l.unref(r)("editor.defaultColor"),"active-color":(p=n.editor)==null?void 0:p.getAttributes("textStyle").color,onSelect:c},null,8,["fore-color","back-color","default-label","active-color"])]}),_:1},512))}}),Ba=l.defineComponent({__name:"OContextMenu",props:{modelValue:{type:Boolean,default:!1},clientX:{type:Number,default:0},clientY:{type:Number,default:0},event:{type:Object,default:function(){return{}}}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=l.ref();l.computed(()=>{var a;return t.clientX||((a=t.event)==null?void 0:a.clientX)||0}),l.computed(()=>{var a;return t.clientY||((a=t.event)==null?void 0:a.clientY)||0});function i(a){r("update:modelValue",a)}function s(){r("update:modelValue",!1)}return l.watch(()=>t.modelValue,a=>{var c;a?setTimeout(()=>{var d;(d=o.value)==null||d.setShow(a)},0):(c=o.value)==null||c.setShow(a)}),(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,placement:"bottom-start",trigger:"manual",show:n.modelValue,"show-arrow":!1,event:n.event,"onUpdate:show":i,onClickoutside:s},{default:l.withCtx(()=>[l.renderSlot(a.$slots,"default")]),_:3},8,["show","event"]))}}),K_={class:"o-color-board"},G_={class:"cell-container"},j_={class:"label"},J_=["onClick"],La=l.defineComponent({__name:"OColorBoard",props:{defaultColor:{type:String,default:""},defaultLabel:{type:String,default:""},activeColor:{type:String,default:""}},emits:["select"],setup(n,{emit:e}){const t=n,r=e;function o(c){r("select",c.hex)}function i(c){return t.activeColor===c}function s(c){return"abc"}const a=l.computed(()=>[[{label:"color",rgb:"rgb(0, 0, 0)",hex:"#000000"},{label:"color",rgb:"rgb(38, 38, 38)",hex:"#262626"},{label:"color",rgb:"rgb(89, 89, 89)",hex:"#595959"},{label:"color",rgb:"rgb(140, 140, 140)",hex:"#8c8c8c"},{label:"color",rgb:"rgb(191, 191, 191)",hex:"#bfbfbf"},{label:"color",rgb:"rgb(217, 217, 217)",hex:"#d9d9d9"},{label:"color",rgb:"rgb(233, 233, 233)",hex:"#e9e9e9"},{label:"color",rgb:"rgb(245, 245, 245)",hex:"#f5f5f5"},{label:"color",rgb:"rgb(250, 250, 250)",hex:"#fafafa",border:!0},{label:"color",rgb:"rgb(255, 255, 255)",hex:"#ffffff",border:!0}],[{label:"color",rgb:"rgb(245, 34, 45)",hex:"#f5222d"},{label:"color",rgb:"rgb(250, 84, 28)",hex:"#fa541c"},{label:"color",rgb:"rgb(250, 140, 22)",hex:"#fa8c16"},{label:"color",rgb:"rgb(250, 219, 20)",hex:"#fadb14"},{label:"color",rgb:"rgb(82, 196, 26)",hex:"#52c41a"},{label:"color",rgb:"rgb(19, 194, 194)",hex:"#13c2c2"},{label:"color",rgb:"rgb(24, 144, 255)",hex:"#1890ff"},{label:"color",rgb:"rgb(47, 84, 235)",hex:"#2f54eb"},{label:"color",rgb:"rgb(114, 46, 209)",hex:"#722ed1"},{label:"color",rgb:"rgb(235, 47, 150)",hex:"#eb2f96"}],[{label:"color",rgb:"rgb(255, 232, 230)",hex:"#ffe8e6"},{label:"color",rgb:"rgb(255, 236, 224)",hex:"#ffece0"},{label:"color",rgb:"rgb(255, 239, 209)",hex:"#ffefd1"},{label:"color",rgb:"rgb(255, 248, 189)",hex:"#fff8bd"},{label:"color",rgb:"rgb(228, 247, 210)",hex:"#e4f7d2"},{label:"color",rgb:"rgb(211, 245, 240)",hex:"#d3f5f0"},{label:"color",rgb:"rgb(212, 238, 252)",hex:"#d4eefc"},{label:"color",rgb:"rgb(222, 232, 252)",hex:"#dee8fc"},{label:"color",rgb:"rgb(239, 225, 250)",hex:"#efe1fa"},{label:"color",rgb:"rgb(250, 225, 235)",hex:"#fae1eb"}],[{label:"color",rgb:"rgb(255, 163, 158)",hex:"#ffa39e"},{label:"color",rgb:"rgb(255, 187, 150)",hex:"#ffbb96"},{label:"color",rgb:"rgb(255, 213, 145)",hex:"#ffd591"},{label:"color",rgb:"rgb(255, 240, 143)",hex:"#fff08f"},{label:"color",rgb:"rgb(183, 235, 143)",hex:"#b7eb8f"},{label:"color",rgb:"rgb(135, 232, 222)",hex:"#87e8de"},{label:"color",rgb:"rgb(145, 213, 255)",hex:"#91d5ff"},{label:"color",rgb:"rgb(173, 198, 255)",hex:"#adc6ff"},{label:"color",rgb:"rgb(211, 173, 247)",hex:"#d3adf7"},{label:"color",rgb:"rgb(255, 173, 210)",hex:"#ffadd2"}],[{label:"color",rgb:"rgb(255, 77, 79)",hex:"#ff4d4f"},{label:"color",rgb:"rgb(255, 122, 69)",hex:"#ff7a45"},{label:"color",rgb:"rgb(255, 169, 64)",hex:"#ffa940"},{label:"color",rgb:"rgb(255, 236, 61)",hex:"#ffec3d"},{label:"color",rgb:"rgb(115, 209, 61)",hex:"#73d13d"},{label:"color",rgb:"rgb(54, 207, 201)",hex:"#36cfc9"},{label:"color",rgb:"rgb(64, 169, 255)",hex:"#40a9ff"},{label:"color",rgb:"rgb(89, 126, 247)",hex:"#597ef7"},{label:"color",rgb:"rgb(146, 84, 222)",hex:"#9254de"},{label:"color",rgb:"rgb(247, 89, 171)",hex:"#f759ab"}],[{label:"color",rgb:"rgb(207, 19, 34)",hex:"#cf1322"},{label:"color",rgb:"rgb(212, 56, 13)",hex:"#d4380d"},{label:"color",rgb:"rgb(212, 107, 8)",hex:"#d46b08"},{label:"color",rgb:"rgb(212, 177, 6)",hex:"#d4b106"},{label:"color",rgb:"rgb(56, 158, 13)",hex:"#389e0d"},{label:"color",rgb:"rgb(8, 151, 156)",hex:"#08979c"},{label:"color",rgb:"rgb(9, 109, 217)",hex:"#096dd9"},{label:"color",rgb:"rgb(29, 57, 196)",hex:"#1d39c4"},{label:"color",rgb:"rgb(83, 29, 171)",hex:"#531dab"},{label:"color",rgb:"rgb(196, 29, 127)",hex:"#c41d7f"}],[{label:"color",rgb:"rgb(130, 0, 20)",hex:"#820014"},{label:"color",rgb:"rgb(135, 20, 0)",hex:"#871400"},{label:"color",rgb:"rgb(135, 56, 0)",hex:"#873800"},{label:"color",rgb:"rgb(97, 71, 0)",hex:"#614700"},{label:"color",rgb:"rgb(19, 82, 0)",hex:"#135200"},{label:"color",rgb:"rgb(0, 71, 79)",hex:"#00474f"},{label:"color",rgb:"rgb(0, 58, 140)",hex:"#003a8c"},{label:"color",rgb:"rgb(6, 17, 120)",hex:"#061178"},{label:"color",rgb:"rgb(34, 7, 94)",hex:"#22075e"},{label:"color",rgb:"rgb(120, 6, 80)",hex:"#780650"}]]);return(c,d)=>(l.openBlock(),l.createElementBlock("section",K_,[l.createElementVNode("div",{class:"default-color",onClick:d[0]||(d[0]=u=>o({hex:n.defaultColor}))},[l.createElementVNode("div",G_,[l.createElementVNode("div",{class:"cell border",style:l.normalizeStyle({background:n.defaultColor})},[l.createVNode(l.unref(ie),{name:"slash_forward"})],4)]),l.createElementVNode("div",j_,l.toDisplayString(n.defaultLabel),1)]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,(u,p)=>(l.openBlock(),l.createElementBlock("div",{class:"color-row",key:`row-${p}`},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u,(f,h)=>(l.openBlock(),l.createElementBlock("div",{class:"",key:`col-${h}`},[l.createElementVNode("div",{class:"cell-container",onClick:m=>o(f)},[l.createElementVNode("div",{class:l.normalizeClass(["cell",{border:f.border}]),style:l.normalizeStyle({backgroundColor:f.hex})},[i(f.hex)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",style:l.normalizeStyle({color:s(f.rgb)})},null,8,["style"])):l.createCommentVNode("",!0)],6)],8,J_)]))),128))]))),128))]))}}),st=l.defineComponent({__name:"OCommandBtn",props:{icon:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},tooltip:{type:String,default:""},placement:{type:String,default:"top"},disabled:{type:Boolean,default:!1},contentClass:{type:[String,Object],default:""},contentStyle:{type:[String,Object],default:""},iconClass:{type:[String,Object],default:""}},emits:["click"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(l.unref(_r),{placement:n.placement},{trigger:l.withCtx(()=>[l.createElementVNode("button",{class:l.normalizeClass(["o-menubar-btn o-command-btn o-btn",n.contentClass]),style:l.normalizeStyle(n.contentStyle),onClick:o[0]||(o[0]=i=>t("click",i))},[l.createVNode(l.unref(ie),{name:n.icon,color:n.color,class:l.normalizeClass(n.iconClass)},null,8,["name","color","class"]),l.renderSlot(r.$slots,"default")],6)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(n.tooltip),1)]),_:3},8,["placement"]))}}),Us=l.defineComponent({__name:"OCommonBtn",props:{icon:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},tooltip:{type:String,default:""},placement:{type:String,default:"top"},disabled:{type:Boolean,default:!1},contentClass:{type:[String,Object],default:""},contentStyle:{type:[String,Object],default:""},iconClass:{type:[String,Object],default:""}},emits:["click"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(l.unref(_r),{placement:n.placement},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-menubar-btn o-command-btn o-btn",n.contentClass]),style:l.normalizeStyle(n.contentStyle),onClick:o[0]||(o[0]=i=>t("click",i))},[l.createVNode(l.unref(ie),{name:n.icon,color:n.color,class:l.normalizeClass(n.iconClass)},null,8,["name","color","class"]),l.renderSlot(r.$slots,"default")],6)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(n.tooltip),1)]),_:3},8,["placement"]))}}),kl=[{label:"Arduino",value:"arduino",icon:"code_blocks"},{label:"Bash",value:"bash",icon:"code_blocks"},{label:"C",value:"c",icon:"code_blocks"},{label:"C++",value:"cpp",icon:"code_blocks"},{label:"C#",value:"csharp",icon:"code_blocks"},{label:"CSS",value:"css",icon:"code_blocks"},{label:"Diff",value:"diff",icon:"code_blocks"},{label:"Go",value:"go",icon:"code_blocks"},{label:"GraphQL",value:"graphql",icon:"code_blocks"},{label:"Ini",value:"ini",icon:"code_blocks"},{label:"Java",value:"java",icon:"code_blocks"},{label:"JavaScript",value:"javascript",icon:"code_blocks"},{label:"JSON",value:"json",icon:"code_blocks"},{label:"Kotlin",value:"kotlin",icon:"code_blocks"},{label:"Less",value:"less",icon:"code_blocks"},{label:"Lua",value:"lua",icon:"code_blocks"},{label:"Makefile",value:"makefile",icon:"code_blocks"},{label:"Markdown",value:"markdown",icon:"code_blocks"},{label:"Objective-C",value:"objectivec",icon:"code_blocks"},{label:"Perl",value:"perl",icon:"code_blocks"},{label:"PHP",value:"php",icon:"code_blocks"},{label:"PHP-Template",value:"php-template",icon:"code_blocks"},{label:"Plain Text",value:"plaintext",icon:"code_blocks"},{label:"Python",value:"python",icon:"code_blocks"},{label:"Python-Repl",value:"python-repl",icon:"code_blocks"},{label:"R",value:"r",icon:"code_blocks"},{label:"Ruby",value:"ruby",icon:"code_blocks"},{label:"Rust",value:"rust",icon:"code_blocks"},{label:"Scss",value:"scss",icon:"code_blocks"},{label:"Shell",value:"shell",icon:"code_blocks"},{label:"SQL",value:"sql",icon:"code_blocks"},{label:"Swift",value:"swift",icon:"code_blocks"},{label:"TypeScript",value:"typescript",icon:"code_blocks"},{label:"VB.Net",value:"vbnet",icon:"code_blocks"},{label:"WebAssembly",value:"wasm",icon:"code_blocks"},{label:"XML",value:"xml",icon:"code_blocks"},{label:"YAML",value:"yaml",icon:"code_blocks"}],Y_={class:"selected-language"},X_={class:"header"},Z_={class:"o-scroll"},Wm=l.defineComponent({__name:"OLanguageDropdown",props:{language:{type:String,default:"shell"}},emits:["select"],setup(n,{emit:e}){const t=n,r=e,{tr:o}=ve(),i=l.ref(),s=l.ref(),a=l.ref(""),c=l.ref(0),d=l.ref(""),u=l.computed(()=>a.value?kl.filter(y=>y.value.toLowerCase().indexOf(a.value.toLowerCase())>=0):kl),p=l.computed(()=>kl.find(y=>y.value===d.value));function f(y){y&&setTimeout(()=>{var k;(k=s.value)==null||k.focus(),c.value=0,window.addEventListener("keyup",b)},0)}function h(){window.removeEventListener("keyup",b)}function m(y){h(),d.value=y.value,r("select",y.value)}function g(){m(u.value[c.value])}function b(y){if(u.value.length>0){switch(y.code){case"ArrowDown":c.value=c.value+1;break;case"ArrowUp":c.value=c.value-1;break;case"Enter":g();break}c.value>=u.value.length&&(c.value=0),c.value<0&&(c.value=u.value.length-1)}else c.value=0}return l.onMounted(()=>{d.value=t.language}),(y,k)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:i,placement:"bottom-start",trigger:"click","tippy-class":"o-language-popover dropdown","onUpdate:show":f},{trigger:l.withCtx(()=>[l.createVNode(l.unref(Bt),{class:"o-dropdown-btn"},{default:l.withCtx(()=>{var E;return[l.createElementVNode("span",Y_,l.toDisplayString((E=p.value)==null?void 0:E.label),1),l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]}),_:1})]),default:l.withCtx(()=>[l.createElementVNode("header",X_,[l.createVNode(l.unref(Ao),{ref_key:"input",ref:s,modelValue:a.value,"onUpdate:modelValue":k[0]||(k[0]=E=>a.value=E),type:"text",placeholder:"Search",autofocus:"",clearable:""},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"search",class:"o-tips"})]),_:1},8,["modelValue"])]),l.createElementVNode("section",Z_,[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.value,(E,v)=>(l.openBlock(),l.createBlock(l.unref(Zt),{key:v,onClick:_=>m(E),class:l.normalizeClass({"is-active":E.value===d.value,"is-select":v===c.value})},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:E.icon},null,8,["name"])]),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(E.label)+" ",1)]),_:2},1032,["onClick","class"]))),128))]),_:1})])]),_:1},512))}}),Q_={class:"o-media-input"},eS={class:"fields"},tS=l.createElementVNode("div",{class:"o-media-title"},"Link",-1),nS={class:"actions"},fd=l.defineComponent({__name:"OMediaInput",props:{val:{type:String,default:""},type:{type:String,default:""}},emits:["input"],setup(n,{emit:e}){const t=n,r=e,{tr:o}=ve(),i=l.ref(),s=l.ref(""),a=l.ref("");function c(){return a.value?(s.value="null",!0):(s.value="error",!1)}function d(){c()&&r("input",a.value)}return l.onMounted(()=>{a.value=t.val,setTimeout(()=>{var u;(u=i.value)==null||u.focus()},0)}),(u,p)=>(l.openBlock(),l.createElementBlock("section",Q_,[l.createElementVNode("section",eS,[tS,l.createVNode(l.unref(Ao),{ref_key:"input",ref:i,modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=f=>a.value=f),status:s.value,type:"text",autofocus:"",clearable:""},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"link",class:"o-tips"})]),_:1},8,["modelValue","status"])]),l.createElementVNode("footer",nS,[l.createVNode(l.unref(Bt),{type:"info",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o)("label.ok")),1)]),_:1})])]))}}),rS={class:"o-meta-input"},oS={class:"header"},iS={class:"title"},sS={class:"fields"},aS={class:"actions"},hd=l.defineComponent({__name:"OMetaInput",props:{val:{type:String,default:""},title:{type:String,default:"Link"},type:{type:String,default:"link"},icon:{type:String,default:"link"},secondIcon:{type:String,default:""},secondLabel:{type:String,default:""}},emits:["cancel","confirm"],setup(n,{emit:e}){const t=n,r=e,{tr:o}=ve(),i=l.ref(null),s=l.ref("");function a(){console.log("confirm",s.value),r("confirm",s.value)}return l.onMounted(()=>{s.value=t.val,setTimeout(()=>{var c;(c=i.value)==null||c.focus()},0)}),(c,d)=>(l.openBlock(),l.createElementBlock("section",rS,[l.createElementVNode("section",oS,[l.createElementVNode("div",iS,l.toDisplayString(n.title),1),l.createElementVNode("div",null,[l.renderSlot(c.$slots,"header-right")])]),l.createElementVNode("section",sS,[l.createVNode(l.unref(Ao),{ref_key:"input",ref:i,modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=u=>s.value=u),type:"text",autofocus:"",clearable:""},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:n.icon,class:"o-tips"},null,8,["name"])]),_:1},8,["modelValue"])]),l.createElementVNode("footer",aS,[l.createVNode(l.unref(Bt),{type:"tertiary",onClick:d[1]||(d[1]=u=>r("cancel"))},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o)("label.cancel")),1)]),_:1}),l.createVNode(l.unref(Bt),{type:"info",onClick:a},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o)("label.ok")),1)]),_:1})])]))}}),lS={class:"o-table-grid"},cS=["onMouseover"],qm=l.defineComponent({__name:"OTableGrid",emits:["select"],setup(n,{emit:e}){const t=e,r=l.ref(6),o=l.ref(6),i=l.ref(2),s=l.ref(2);function a(d,u){i.value=d,s.value=u,r.value===d&&r.value<10&&(r.value+=1),o.value===u&&o.value<10&&(o.value+=1)}function c(){t("select",{rows:i.value,cols:s.value,withHeaderRow:!0})}return(d,u)=>(l.openBlock(),l.createElementBlock("section",lS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(p,f)=>(l.openBlock(),l.createElementBlock("div",{class:"rows",key:`row-${f}`},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(h,m)=>(l.openBlock(),l.createElementBlock("div",{key:`col-${m}`},[l.createElementVNode("div",{class:l.normalizeClass(["cell",{selected:p<=i.value&&h<=s.value}]),onMouseover:g=>a(p,h),onClick:c},null,42,cS)]))),128))]))),128)),l.createElementVNode("footer",null,l.toDisplayString(i.value)+" x "+l.toDisplayString(s.value),1)]))}}),dS={class:"o-table-cell-background o-button-group"},uS=["onClick"],pS={class:"o-command-btn"},Km=l.defineComponent({__name:"OTableCellBackground",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(),i=l.ref("#ffec3d");function s(){a(i.value)}function a(c){o.value.setShow(!1),i.value=c,r(e.editor,"tableCellAttribute",{name:"background",value:i.value})}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",placement:"bottom-start",trigger:"click"},{trigger:l.withCtx(()=>[l.createVNode(l.unref(_r),{trigger:"hover"},{trigger:l.withCtx(()=>[l.createElementVNode("div",dS,[l.createElementVNode("div",{class:"o-command-btn label",onClick:l.withModifiers(s,["stop"])},[l.createVNode(l.unref(ie),{name:"crop_16_9",class:"arrow"}),l.createElementVNode("div",{class:"indicator",style:l.normalizeStyle(`background: ${i.value}`)},null,4)],8,uS),l.createElementVNode("div",pS,[l.createVNode(l.unref(ie),{name:"arrow_drop_down"})])])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(t)("editor.highlightColor")),1)]),_:1})]),default:l.withCtx(()=>[l.createVNode(l.unref(La),{"default-color":"","default-label":l.unref(t)("editor.noColor"),onSelect:a},null,8,["default-label"])]),_:1},512))}}),fS={class:"o-simple-color-board"},hS={class:"fore-colors"},mS=l.createElementVNode("div",{class:"label o-tips"},"Color",-1),gS={class:"color-row"},bS={class:"color-row"},yS={class:"back-colors"},vS=l.createElementVNode("div",{class:"label o-tips"},"Background",-1),kS={class:"color-row"},wS={class:"color-row"},Gm=l.defineComponent({__name:"OTextColorBoard",props:{foreColor:{type:String,default:""},backColor:{type:String,default:""},activeColor:{type:String,default:""}},emits:["select"],setup(n,{emit:e}){const t=e;function r(s,a){t("select",s,a.value)}const o=l.computed(()=>[{label:"Grey",value:"#787774"},{label:"Brown",value:"#9F6B53"},{label:"Orange",value:"#D9730D"},{label:"Yellow",value:"#CB912F"},{label:"Green",value:"#448361"},{label:"Blue",value:"#337EA9"},{label:"Purple",value:"#9065B0"},{label:"Pink",value:"#C14C8A"},{label:"Red",value:"#D44C47"}]),i=l.computed(()=>[{label:"Grey",value:"#F1F1EF"},{label:"Brown",value:"#F4EEEE"},{label:"Orange",value:"#FAEBDD"},{label:"Yellow",value:"#FBF3DB"},{label:"Green",value:"#EDF3EC"},{label:"Blue",value:"#E7F3F8"},{label:"Purple",value:"#F6F3F9"},{label:"Pink",value:"#FAF1F5"},{label:"Red",value:"#FDEBEC"}]);return(s,a)=>(l.openBlock(),l.createElementBlock("section",fS,[l.createElementVNode("section",hS,[mS,l.createElementVNode("div",gS,[l.createVNode(l.unref(Me),{icon:"format_text",tooltip:"Default color","content-class":"border",onClick:a[0]||(a[0]=c=>r("foreColor",{value:""}))}),n.foreColor?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,icon:"format_text",color:n.foreColor,tooltip:"Last used","content-class":"border",onClick:a[1]||(a[1]=c=>r("foreColor",{value:n.foreColor}))},null,8,["color"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",bS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(c,d)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:`col-${d}`,icon:"format_text",color:c.value,tooltip:c.label,onClick:u=>r("foreColor",c)},null,8,["color","tooltip","onClick"]))),128))])]),l.createElementVNode("section",yS,[vS,l.createElementVNode("div",kS,[l.createVNode(l.unref(Me),{icon:"slash_forward",tooltip:"No Color","content-class":"border",onClick:a[2]||(a[2]=c=>r("backColor",{value:""}))}),n.backColor?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,icon:"format_text",tooltip:"Last used","content-class":"border","content-style":{backgroundColor:n.backColor},onClick:a[3]||(a[3]=c=>r("backColor",{value:n.backColor}))},null,8,["content-style"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",wS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(c,d)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:`col-${d}`,icon:"format_text",tooltip:c.label,"content-style":{backgroundColor:c.value},onClick:u=>r("backColor",c)},null,8,["tooltip","content-style","onClick"]))),128))])])]))}}),Ws=[{type:"paragraph",content:[]}],jm=[{type:"listItem",content:[{type:"paragraph",content:[]}]}],Jm=[{type:"taskItem",content:[{type:"paragraph",content:[]}]}],ES={class:"o-add-node-view"},CS={key:0,class:"view-main"},_S={class:"group o-tips"},SS={class:"panel"},xS={class:"group o-tips"},NS={key:1,class:"item"},TS={key:1,class:"view-emoji"},OS=l.defineComponent({__name:"AddNodeView",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),{run:s}=Pe(),a=l.ref("main"),c=l.ref(0);function d(f){const h=t.editor.chain();let m=null;switch(f.value){case"blockquote":m={content:Ws};break;case"callout":m={content:Ws,attrs:{icon:"💡"}};break;case"codeBlock":m={content:[],attrs:{language:"shell"}};break;case"emoji":m={type:"paragraph",content:[{type:"text",text:":"}]};break;case"heading":m={attrs:f.options};break;case"horizontalRule":m={};break;case"paragraph":m={content:[]};break;case"bulletList":case"orderedList":m={content:jm};break;case"taskList":m={content:Jm};break;case"table":setTimeout(()=>{h.insertContentAt(p.value,{type:"paragraph",content:[]}).insertTable({rows:3,cols:3,withHeaderRow:!0}).focus().run()},1);return;case"image":m={type:"paragraph",content:[{type:f.value,attrs:{src:"init"}}]};break;case"model-viewer":m={attrs:{src:"init"}};break}m&&(m.type=m.type||f.value,setTimeout(()=>{u.value?h.insertContent(m).focus().run():h.insertContentAt(p.value,m).focus().run()},1)),r("action",f)}const u=l.computed(()=>t.node.content.size===0),p=l.computed(()=>u.value?c.value:c.value+t.node.nodeSize);return l.onMounted(()=>{c.value=t.getPos()}),(f,h)=>(l.openBlock(),l.createElementBlock("section",ES,[a.value==="main"?(l.openBlock(),l.createElementBlock("section",CS,[l.createElementVNode("section",null,[l.createElementVNode("div",_S,l.toDisplayString(l.unref(i)("label.basic")),1),l.createElementVNode("section",SS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Li),(m,g)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:g,icon:m.icon,tooltip:l.unref(i)(m.label),quaternary:"",onClick:b=>d(m)},null,8,["icon","tooltip","onClick"]))),128))])]),l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[l.unref(wi).length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(l.unref(wi),(m,g)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:g},[m.group?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[g>0?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",xS,l.toDisplayString(l.unref(i)(m.group)),1)],64)):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:"item",clickable:"",onClick:b=>d(m)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:m.icon,color:m.color},null,8,["name","color"])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(i)(m.label)),1)]),_:2},1032,["onClick"])],64))),128)):(l.openBlock(),l.createElementBlock("div",NS,"No result"))]),_:1})])):a.value==="emoji"?(l.openBlock(),l.createElementBlock("section",TS)):l.createCommentVNode("",!0)]))}}),MS=l.defineComponent({__name:"AddNode",props:ct,setup(n){const e=n,t=l.ref(null),r=l.ref(!1);function o(s){r.value=s}function i(){var s;(s=t.value)==null||s.setShow(!1),r.value=!1}return(s,a)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:t,placement:"left",trigger:"mouseenter",arrow:"","onUpdate:show":o},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-add-node",{"is-selected":r.value}])},[l.createVNode(l.unref(Bt),{type:"tertiary",class:"o-node-btn"},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"add",small:""})]),_:1})],2)]),default:l.withCtx(()=>[l.createVNode(OS,l.mergeProps(e,{onAction:i}),null,16)]),_:1},512))}}),AS={class:"o-drag-node-view"},RS={key:0,class:"view-main"},DS={key:0},IS=l.createElementVNode("div",{class:"group o-tips"},"Turn into",-1),BS={class:"panel"},LS=l.defineComponent({__name:"DragNodeView",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),{run:s,onCommand:a}=Pe(),c=l.ref("main"),d=l.ref(["heading","codeBlock","paragraph"]),u=l.computed(()=>{var b,y;const g=(b=t.node)==null?void 0:b.content.content;if(g.length>0){const k=g[0];if(k.type.name==="image")return k.type.name}return(y=t.node)==null?void 0:y.type.name}),p=l.computed(()=>Hs.find(g=>g.value===u.value));function f(g){var b;return g.value===u.value&&((b=t.editor)==null?void 0:b.isActive(u.value,g.options))}function h(g){switch(g.value){default:m(g);break}r("action",g)}function m(g){var E,v,_,C,D;const b=t.getPos();if(g.value===u.value&&d.value.indexOf(u.value)<0){const B=(E=t.editor)==null?void 0:E.isActive(u.value),A=(v=t.editor)==null?void 0:v.commands.lift(u.value);console.log("lift",u.value,B,A);return}const y=(_=t.editor)==null?void 0:_.commands,k=(C=t.editor)==null?void 0:C.chain().focus(b+1);console.log("runCommand",g),a(y,k,g.value,g.options),(D=t.editor)==null||D.commands.setNodeSelection(b)}return l.computed(()=>[{label:"editor.duplicate",value:"duplicate",icon:"content_copy",color:Ee.blue,tips:"Ctrl+D",group:"label.common"},{label:"editor.delete",value:"delete",icon:"delete",tips:"Ctrl+D",color:Ee.deepOrange}]),(g,b)=>(l.openBlock(),l.createElementBlock("section",AS,[c.value==="main"?(l.openBlock(),l.createElementBlock("section",RS,[p.value?(l.openBlock(),l.createElementBlock("section",DS,[IS,l.createElementVNode("section",BS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Hs),(y,k)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:k,icon:y.icon,tooltip:l.unref(i)(y.label),"content-class":{"is-active":f(y)},quaternary:"",onClick:E=>h(y)},null,8,["icon","tooltip","content-class","onClick"]))),128))])])):l.createCommentVNode("",!0),l.createVNode(l.unref(Xr),l.mergeProps(t,{colorful:"","show-group":"",onAction:h}),null,16)])):l.createCommentVNode("",!0)]))}}),PS=l.defineComponent({__name:"DragNode",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,{run:o}=Pe(),i=l.ref(null),s=l.ref(0),a=l.ref(!1),c=l.ref(["heading","codeBlock","paragraph"]),d=l.ref(!1),u=l.computed(()=>{var k,E;const y=(k=t.node)==null?void 0:k.content.content;if(y.length>0){const v=y[0];if(v.type.name==="image")return v.type.name}return(E=t.node)==null?void 0:E.type.name}),p=l.computed(()=>{var k;let y=u.value;return y==="heading"?{icon:`format_h${((k=t.node.attrs)==null?void 0:k.level)||1}`,color:Ee.blue}:(y==="table-wrapper"&&(y="table"),dd.find(E=>E.value===y)||{icon:"title"})});function f(y){var k;(k=i.value)==null||k.setShow(!1),r("action",y)}function h(y){a.value=y,console.log("show",y),y&&m()}function m(){var k;let y=t.getPos();c.value.includes(u.value)||(y+=1),(k=t.editor)==null||k.commands.setNodeSelection(y),s.value=y}function g(y){d.value=!0,setTimeout(()=>{d.value=!1},10)}function b(y){d.value=!1}return(y,k)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:i,placement:"left",size:"medium",trigger:"click",arrow:"","onUpdate:show":h},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-drag-node",{"is-selected":a.value,"is-dragging":d.value}]),contenteditable:"false",draggable:"true","data-drag-handle":"",onDragstart:g,onDragend:b},[l.createVNode(l.unref(Bt),{type:"tertiary",class:"o-node-btn"},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:p.value.icon,color:p.value.color,small:""},null,8,["name","color"]),l.createVNode(l.unref(ie),{name:"drag_indicator",small:""})]),_:1})],34)]),default:l.withCtx(()=>[l.createVNode(LS,l.mergeProps(t,{onAction:f}),null,16)]),_:1},512))}}),$S=l.defineComponent({__name:"index",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,o=l.ref(!1),i=l.ref(0);l.ref(0);const s=l.computed(()=>a.value==="paragraph"&&t.node.content.size===0),a=l.computed(()=>{var f,h;const p=(f=t.node)==null?void 0:f.content.content;if(p.length>0){const m=p[0];if(m.type.name==="image")return m.type.name}return(h=t.node)==null?void 0:h.type.name}),c=l.computed(()=>{var p;return i.value||((p=t.node.attrs)==null?void 0:p.level)}),d=l.computed(()=>a.value==="heading"?`type-heading-${c.value}`:`type-${a.value}`);function u(p){r("action",p)}return l.onMounted(()=>{i.value=0}),(p,f)=>{var h;return(h=p.editor)!=null&&h.isEditable?(l.openBlock(),l.createElementBlock("section",{key:0,class:l.normalizeClass(["o-side-node",{"is-active":o.value,"is-empty":s.value}])},[l.createElementVNode("section",{class:l.normalizeClass(["action-container",d.value])},[l.createVNode(MS,l.normalizeProps(l.guardReactiveProps(t)),null,16),s.value?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(PS,l.mergeProps({key:0},t,{onAction:u}),null,16))],2)],2)):l.createCommentVNode("",!0)}}}),Bn=l.defineComponent({__name:"ONodeView",props:ct,emits:["action"],setup(n,{emit:e}){const t=n,r=e,o=l.inject("sideNode",{value:!1});return l.computed(()=>{const i={};return t.node.attrs["data-id"]&&(i["data-id"]=t.node.attrs["data-id"]),i}),(i,s)=>(l.openBlock(),l.createBlock(l.unref(ad),{class:"o-node-view"},{default:l.withCtx(()=>{var a;return[l.unref(o)&&((a=i.editor)!=null&&a.isEditable)?(l.openBlock(),l.createBlock($S,l.mergeProps({key:0},t,{onAction:s[0]||(s[0]=c=>r("action"))}),null,16)):l.createCommentVNode("",!0),l.renderSlot(i.$slots,"default")]}),_:3}))}}),FS={class:"o-add-node-view"},zS={key:0,class:"view-main"},VS={class:"group o-tips"},HS={class:"panel"},US={class:"group o-tips"},WS={key:1,class:"item"},qS={key:1,class:"view-emoji"},KS=l.defineComponent({__name:"AddNodeView",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}},emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),{run:s}=Pe(),a=l.ref("main");function c(p){const f=t.editor.chain();let h=null;switch(p.value){case"blockquote":h={content:Ws};break;case"callout":h={content:Ws,attrs:{icon:"💡"}};break;case"codeBlock":h={content:[],attrs:{language:"shell"}};break;case"emoji":h={type:"paragraph",content:[{type:"text",text:":"}]};break;case"heading":h={attrs:p.options};break;case"horizontalRule":h={};break;case"paragraph":h={content:[]};break;case"bulletList":case"orderedList":h={content:jm};break;case"taskList":h={content:Jm};break;case"table":setTimeout(()=>{f.insertContentAt(u.value,{type:"paragraph",content:[]}).insertTable({rows:3,cols:3,withHeaderRow:!0}).focus().run()},1);return;case"image":h={type:"paragraph",content:[{type:p.value,attrs:{src:"init"}}]};break;case"model-viewer":h={attrs:{src:"init"}};break}h&&(console.log("add",t.getPos(),u.value),h.type=h.type||p.value,setTimeout(()=>{d.value?f.insertContent(h).focus().run():f.insertContentAt(u.value,h).focus().run()},1)),r("action",p)}const d=l.computed(()=>{var p;return((p=t.node)==null?void 0:p.content.size)===0}),u=l.computed(()=>d.value?t.getPos():t.getPos()+t.node.nodeSize);return(p,f)=>(l.openBlock(),l.createElementBlock("section",FS,[a.value==="main"?(l.openBlock(),l.createElementBlock("section",zS,[l.createElementVNode("section",null,[l.createElementVNode("div",VS,l.toDisplayString(l.unref(i)("label.basic")),1),l.createElementVNode("section",HS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Li),(h,m)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:m,icon:h.icon,tooltip:l.unref(i)(h.label),quaternary:"",onClick:g=>c(h)},null,8,["icon","tooltip","onClick"]))),128))])]),l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[l.unref(wi).length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(l.unref(wi),(h,m)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:m},[h.group?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[m>0?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",US,l.toDisplayString(l.unref(i)(h.group)),1)],64)):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:"item",clickable:"",onClick:g=>c(h)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:h.icon,color:h.color},null,8,["name","color"])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(i)(h.label)),1)]),_:2},1032,["onClick"])],64))),128)):(l.openBlock(),l.createElementBlock("div",WS,"No result"))]),_:1})])):a.value==="emoji"?(l.openBlock(),l.createElementBlock("section",qS)):l.createCommentVNode("",!0)]))}}),Ym=l.defineComponent({__name:"AddNode",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}},setup(n){const e=n,t=l.ref(),r=l.ref(!1),o=l.computed(()=>{var c;return((c=e.node)==null?void 0:c.content.size)===0});l.computed(()=>o.value?e.getPos():e.getPos()+e.node.nodeSize);function i(c){r.value=c}function s(){var c;(c=t.value)==null||c.setShow(!0)}function a(){var c;(c=t.value)==null||c.setShow(!1),r.value=!1}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:t,placement:"left","tippy-class":"dropdown",trigger:"manual",offset:[0,4],"onUpdate:show":i},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-add-btn",{"is-selected":r.value}])},[l.createVNode(l.unref(Bt),{type:"tertiary",class:"o-node-btn",onClick:s},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"add",small:""})]),_:1})],2)]),default:l.withCtx(()=>[l.createVNode(KS,l.mergeProps(e,{onAction:a}),null,16)]),_:1},512))}}),GS={class:"o-drag-node-view"},jS={key:0,class:"view-main"},JS={key:0},YS=l.createElementVNode("div",{class:"group o-tips"},"Turn into",-1),XS={class:"panel"},ZS=l.defineComponent({__name:"DragNodeView",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}},emits:["action"],setup(n,{emit:e}){const t=n,r=e,{locale:o,tr:i}=ve(),{run:s,onCommand:a}=Pe(),c=l.ref("main"),d=l.ref(["heading","codeBlock","paragraph"]),u=l.computed(()=>{var b,y;const g=(b=t.node)==null?void 0:b.content.content;if(g.length>0){const k=g[0];if(k.type.name==="image")return k.type.name}return(y=t.node)==null?void 0:y.type.name}),p=l.computed(()=>Hs.find(g=>g.value===u.value));function f(g){var b;return g.value===u.value&&((b=t.editor)==null?void 0:b.isActive(u.value,g.options))}function h(g){switch(g.value){case"delete":break;case"duplicate":break;default:m(g);break}r("action",g)}function m(g){var E,v,_,C,D;const b=t.getPos();if(g.value===u.value&&d.value.indexOf(u.value)<0){const B=(E=t.editor)==null?void 0:E.isActive(u.value),A=(v=t.editor)==null?void 0:v.commands.lift(u.value);console.log("lift",u.value,B,A);return}const y=(_=t.editor)==null?void 0:_.commands,k=(C=t.editor)==null?void 0:C.chain().focus(b+1);console.log("runCommand",g),a(y,k,g.value,g.options),(D=t.editor)==null||D.commands.setNodeSelection(b)}return l.computed(()=>[{label:"editor.duplicate",value:"duplicate",icon:"content_copy",color:Ee.blue,tips:"Ctrl+D",group:"label.common"},{label:"editor.delete",value:"delete",icon:"delete",tips:"Ctrl+D",color:Ee.deepOrange}]),(g,b)=>(l.openBlock(),l.createElementBlock("section",GS,[c.value==="main"?(l.openBlock(),l.createElementBlock("section",jS,[p.value?(l.openBlock(),l.createElementBlock("section",JS,[YS,l.createElementVNode("section",XS,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Hs),(y,k)=>(l.openBlock(),l.createBlock(l.unref(Me),{key:k,icon:y.icon,tooltip:l.unref(i)(y.label),"content-class":{"is-active":f(y)},quaternary:"",onClick:E=>h(y)},null,8,["icon","tooltip","content-class","onClick"]))),128))])])):l.createCommentVNode("",!0),l.createVNode(l.unref(Xr),l.mergeProps(t,{colorful:"","show-group":"",onAction:h}),null,16)])):l.createCommentVNode("",!0)]))}}),Xm=l.defineComponent({__name:"DragNode",props:{editor:{type:Object,required:!0},node:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}},emits:["action","dragstart","dragend"],setup(n,{emit:e}){const t=n,r=e,{run:o}=Pe(),i=l.ref(null),s=l.ref(!1),a=l.ref(["heading","codeBlock","paragraph"]),c=l.computed(()=>{var b,y,k;const g=(y=(b=t.node)==null?void 0:b.content)==null?void 0:y.content;if((g==null?void 0:g.length)>0){const E=g[0];if(E.type.name==="image")return E.type.name}return(k=t.node)==null?void 0:k.type.name}),d=l.computed(()=>{var b;let g=c.value;return g==="heading"?{icon:`format_h${((b=t.node.attrs)==null?void 0:b.level)||1}`,color:Ee.blue}:(g==="table-wrapper"&&(g="table"),dd.find(y=>y.value===g)||{icon:"title"})});function u(g){r("dragstart",g)}function p(g){r("dragend",g)}function f(g){var b;(b=i.value)==null||b.setShow(!1),r("action",g)}function h(g){s.value=g,console.log("show",g),g&&m()}function m(){var b;let g=t.getPos();a.value.includes(c.value)||(g+=1),(b=t.editor)==null||b.commands.setNodeSelection(g)}return l.watch(()=>t.getPos(),g=>{var b;(b=i.value)==null||b.setShow(!1)}),(g,b)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:i,placement:"left","tippy-class":"dropdown",trigger:"click",offset:[0,2],"onUpdate:show":h},{trigger:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["o-drag-btn",{selected:s.value}]),contenteditable:"false",draggable:"true","data-drag-handle":"",onDragstart:u,onDragend:p},[l.createVNode(l.unref(Bt),{type:"tertiary",class:"o-node-btn"},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:d.value.icon,color:d.value.color,small:""},null,8,["name","color"]),l.createVNode(l.unref(ie),{name:"drag_indicator",small:""})]),_:1})],34)]),default:l.withCtx(()=>[l.createVNode(ZS,l.mergeProps(t,{onAction:f}),null,16)]),_:1},512))}}),Bt=l.defineComponent({__name:"OBtn",props:{icon:{type:String,default:""},iconClass:{type:[String,Object],default:""},type:{type:String,default:""}},emits:["click"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createElementBlock("button",{class:l.normalizeClass(["o-btn",n.type?`type-${n.type}`:""]),onClick:o[0]||(o[0]=i=>t("click",i))},[n.icon?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:n.icon,class:l.normalizeClass(n.iconClass)},null,8,["name","class"])):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"default")],2))}}),QS={class:"o-checkbox"},ex={class:"o-checkbox__main"},tx={class:"o-checkbox__suffix"},md=l.defineComponent({__name:"OCheckbox",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,o=l.computed({get(){return t.modelValue},set(i){r("update:modelValue",i)}});return(i,s)=>(l.openBlock(),l.createElementBlock("div",QS,[l.createElementVNode("div",ex,[l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>o.value=a),type:"checkbox"},null,512),[[l.vModelCheckbox,o.value]])]),l.createElementVNode("div",tx,l.toDisplayString(n.label),1)]))}}),Xt=l.defineComponent({__name:"ODivider",props:{vertical:{type:Boolean,default:!1}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["o-divider",{"o-divider-vertical":n.vertical}])},null,2))}}),nx={class:"o-input__prefix"},rx={class:"o-input__main"},ox={class:"o-input__suffix"},Ao=l.defineComponent({__name:"OInput",props:{modelValue:{type:String,default:""},clearable:{type:Boolean,default:!1},type:{type:String,default:""}},emits:["blur","update:modelValue"],setup(n,{expose:e,emit:t}){const r=n,o=t,i=l.ref(null),s=l.computed({get(){return r.modelValue},set(d){o("update:modelValue",d)}});function a(){var d;(d=i.value)==null||d.focus()}function c(){s.value="",a()}return e({clear:c,focus:a}),(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["o-input",`type-${n.type}`])},[l.createElementVNode("div",nx,[l.renderSlot(d.$slots,"prefix")]),l.createElementVNode("div",rx,[l.withDirectives(l.createElementVNode("input",{ref_key:"input",ref:i,"onUpdate:modelValue":u[0]||(u[0]=p=>s.value=p),onBlur:u[1]||(u[1]=p=>o("blur"))},null,544),[[l.vModelText,s.value]])]),l.createElementVNode("div",ox,[l.renderSlot(d.$slots,"suffix"),n.clearable&&s.value?(l.openBlock(),l.createBlock(ie,{key:0,name:"close",class:"clear o-tips",onClick:c})):l.createCommentVNode("",!0)])],2))}}),un=l.defineComponent({__name:"OList",props:{clickable:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("ul",{class:l.normalizeClass(["o-list",{clickable:n.clickable,hoverable:n.hoverable}])},[l.renderSlot(e.$slots,"default")],2))}}),ix={class:"o-list-item"},sx={class:"o-list-item__prefix"},ax={class:"o-list-item__main"},lx={class:"o-list-item__suffix"},Zt=l.defineComponent({__name:"OListItem",props:{hoverable:{type:Boolean,default:!1}},setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("li",ix,[l.createElementVNode("div",sx,[l.renderSlot(e.$slots,"prefix")]),l.createElementVNode("div",ax,[l.renderSlot(e.$slots,"default")]),l.createElementVNode("div",lx,[l.renderSlot(e.$slots,"suffix")])]))}}),qe=l.defineComponent({__name:"OPopover",props:{show:{type:Boolean,default:!1},arrow:{type:Boolean,default:!1},offset:{type:Array,default:function(){return[0,10]}},placement:{type:String,default:"bottom-start"},trigger:{type:String,default:"mouseenter focus"},tippyClass:{type:String,default:""},event:{type:Object,default:function(){return{}}}},emits:["update:show"],setup(n,{expose:e,emit:t}){const r=n,o=t,{theme:i}=Bi(),s=l.ref(null),a=l.ref(),c=l.ref();function d(h){var m,g,b,y;h?((g=c.value)==null||g.setProps({getReferenceClientRect:(m=r.event)!=null&&m.clientX?u:null}),(b=c.value)==null||b.show()):(y=c.value)==null||y.hide()}function u(){var h,m;return{width:0,height:0,left:r.event.clientX,right:r.event.clientX,top:r.event.clientY,bottom:r.event.clientY,x:((h=r.event)==null?void 0:h.clientX)||0,y:((m=r.event)==null?void 0:m.clientY)||0,toJSON:()=>{var g,b;return{width:100,height:100,left:((g=r.event)==null?void 0:g.clientX)||0,top:((b=r.event)==null?void 0:b.clientY)||0}}}}function p(){c.value=In(s.value,{appendTo:()=>document.body,animation:"shift-away",arrow:r.arrow,content:a.value,delay:100,duration:200,interactive:!0,placement:r.placement,trigger:r.trigger,theme:i.value,onShow:h=>{o("update:show",!0)},onHide:h=>{o("update:show",!1)}})}function f(){c.value.setProps({theme:i.value})}return l.watch(i,h=>{f()}),l.onMounted(()=>{p()}),e({setShow:d}),(h,m)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"triggerRef",ref:s,"data-tippy-role":"popover",class:"o-popover"},[l.renderSlot(h.$slots,"trigger"),l.createElementVNode("div",{ref_key:"contentRef",ref:a,class:l.normalizeClass(["popover-content",n.tippyClass])},[l.renderSlot(h.$slots,"default")],2)],512))}}),cx=l.defineComponent({__name:"OAlignDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.computed(()=>[{label:t("editor.left"),value:"left",icon:"format_align_center"},{label:t("editor.center"),value:"center",icon:"format_align_center"},{label:t("editor.right"),value:"right",icon:"format_align_right"},{label:t("editor.justify"),value:"justify",icon:"format_align_justify"}]);function s(a){var c;(c=o.value)==null||c.setShow(!1),r(e.editor,"textAlign",{textAlign:a})}return(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_align_center","content-class":"o-align-dropdown dropdown",tooltip:l.unref(t)("editor.align")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(d,u)=>{var p;return l.openBlock(),l.createBlock(l.unref(Zt),{key:u,class:l.normalizeClass({"is-active":(p=n.editor)==null?void 0:p.isActive({textAlign:d.value})}),onClick:f=>s(d.value)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:d.icon},null,8,["name"])]),suffix:l.withCtx(()=>{var f;return[(f=n.editor)!=null&&f.isActive({textAlign:d.value})?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.label)+" ",1)]),_:2},1032,["class","onClick"])}),128))]),_:1})]),_:1},512))}}),dx={class:"o-align-group"},ux=l.defineComponent({__name:"OAlignGroup",props:{editor:{type:Dn}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.computed(()=>[{label:t("editor.left"),value:"left",icon:"format_align_left"},{label:t("editor.center"),value:"center",icon:"format_align_center"},{label:t("editor.right"),value:"right",icon:"format_align_right"}]);function i(s){r(e.editor,"textAlign",{textAlign:s.value})}return(s,a)=>(l.openBlock(),l.createElementBlock("div",dx,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(c,d)=>{var u;return l.openBlock(),l.createBlock(Me,{key:d,icon:c.icon,tooltip:c.label,"content-class":{"is-active":(u=n.editor)==null?void 0:u.isActive({textAlign:c.value})},onClick:p=>i(c)},null,8,["icon","tooltip","content-class","onClick"])}),128))]))}}),px={class:"o-back-color-dropdown o-button-group"},fx=l.defineComponent({__name:"OBackColorDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.ref("#ffec3d");function s(){a(i.value)}function a(c){o.value.setShow(!1),i.value=c,r(e.editor,"backColor",{color:c})}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(_r),{trigger:"hover"},{trigger:l.withCtx(()=>[l.createElementVNode("div",px,[l.createVNode(l.unref(Bt),{icon:"ink_highlighter",class:"o-command-btn label",onClick:l.withModifiers(s,["stop"])},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"indicator",style:l.normalizeStyle(`background: ${i.value}`)},null,4)]),_:1},8,["onClick"]),l.createVNode(l.unref(Bt),{icon:"arrow_drop_down",class:"o-command-btn"})])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(t)("editor.highlightColor")),1)]),_:1})]),default:l.withCtx(()=>{var u;return[l.createVNode(l.unref(La),{"default-color":"","default-label":l.unref(t)("editor.noColor"),"active-color":(u=n.editor)==null?void 0:u.getAttributes("highlight").color,onSelect:a},null,8,["default-label","active-color"])]}),_:1},512))}}),hx=l.defineComponent({__name:"OFontFamilyDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.computed(()=>[{label:t("editor.default"),value:"system-ui"},{label:"Arial",value:"Arial",separator:!0},{label:"Arial Black",value:"Arial Black"},{label:"Georgia",value:"Georgia"},{label:"Impact",value:"Impact"},{label:"Helvetica",value:"Helvetica"},{label:"Roboto",value:"Roboto"},{label:"Tahoma",value:"Tahoma"},{label:"Times New Roman",value:"Times New Roman"},{label:"Verdana",value:"Verdana"},{label:"Courier New",value:"Courier New",separator:!0},{label:"Monaco",value:"Monaco"},{label:"Monospace",value:"monospace"}]);function s(a){var c;(c=o.value)==null||c.setShow(!1),r(e.editor,"fontFamily",{fontFamily:a})}return(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_font","content-class":"o-font-family-dropdown dropdown",tooltip:l.unref(t)("editor.fontFamily")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(d,u)=>{var p;return l.openBlock(),l.createElementBlock(l.Fragment,{key:u},[d.separator?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:l.normalizeClass({"is-active":(p=n.editor)==null?void 0:p.isActive("textStyle",{fontFamily:d.value})}),onClick:f=>s(d.value)},{suffix:l.withCtx(()=>{var f;return[(f=n.editor)!=null&&f.isActive("textStyle",{fontFamily:d.value})?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>[l.createElementVNode("span",{style:l.normalizeStyle(`font-family: ${d.value}`)},l.toDisplayString(d.label),5)]),_:2},1032,["class","onClick"])],64)}),128))]),_:1})]),_:1},512))}}),mx={class:"o-fore-color-dropdown o-button-group"},gx=l.defineComponent({__name:"OForeColorDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.ref("#ff4d4f");function s(){a(i.value)}function a(c){var d;(d=o.value)==null||d.setShow(!1),i.value=c,r(e.editor,"foreColor",{color:c})}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(_r),null,{trigger:l.withCtx(()=>[l.createElementVNode("div",mx,[l.createVNode(l.unref(Bt),{icon:"format_color_text",class:"o-command-btn label",onClick:l.withModifiers(s,["stop"])},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"indicator",style:l.normalizeStyle(`background: ${i.value}`)},null,4)]),_:1},8,["onClick"]),l.createVNode(l.unref(Bt),{icon:"arrow_drop_down",class:"o-command-btn"})])]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(l.unref(t)("editor.textColor")),1)]),_:1})]),default:l.withCtx(()=>{var u;return[l.createVNode(l.unref(La),{"default-color":"","default-label":l.unref(t)("editor.defaultColor"),"active-color":(u=n.editor)==null?void 0:u.getAttributes("textStyle").color,onSelect:a},null,8,["default-label","active-color"])]}),_:1},512))}}),bx=l.defineComponent({__name:"OHeadingDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.computed(()=>[{label:t("editor.paragraph"),value:"paragraph",valueAlt:"",icon:"title"},{label:t("editor.heading1"),value:"heading",valueAlt:1,icon:"format_h1",separator:!0},{label:t("editor.heading2"),value:"heading",valueAlt:2,icon:"format_h2"},{label:t("editor.heading3"),value:"heading",valueAlt:3,icon:"format_h3"},{label:t("editor.heading4"),value:"heading",valueAlt:4,icon:"format_h4"},{label:t("editor.heading5"),value:"heading",valueAlt:5,icon:"format_h5"}]);function s(c){var d,u;return c.value==="heading"?(d=e.editor)==null?void 0:d.isActive(c.value,{level:c.valueAlt}):(u=e.editor)==null?void 0:u.isActive(c.value)}function a(c){var d;(d=o.value)==null||d.setShow(!1),r(e.editor,c.value,{level:c.valueAlt})}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_header_pound","content-class":"o-heading-dropdown dropdown",tooltip:l.unref(t)("editor.heading")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(u,p)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:p},[u.separator?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:l.normalizeClass({"is-active":s(u)}),onClick:f=>a(u)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:u.icon},null,8,["name"])]),suffix:l.withCtx(()=>[s(u)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(u.label)+" ",1)]),_:2},1032,["class","onClick"])],64))),128))]),_:1})]),_:1},512))}}),yx={class:"o-list-dropdown o-button-group"},vx=l.defineComponent({__name:"OListDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.ref();function s(){r(e.editor,i.value.value)}function a(d){o.value.setShow(!1),i.value=d,r(e.editor,d.value)}const c=l.computed(()=>[{label:t("editor.unorderedList"),value:"bulletList",icon:"format_list_bulleted"},{label:t("editor.orderedList"),value:"orderedList",icon:"format_list_numbered"},{label:t("editor.todoList"),value:"taskList",icon:"check_box"}]);return l.onMounted(()=>{i.value=c.value[0]}),(d,u)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(_r),{trigger:"hover"},{trigger:l.withCtx(()=>{var p;return[l.createElementVNode("div",yx,[l.createVNode(l.unref(Bt),{icon:(p=i.value)==null?void 0:p.icon,class:"o-command-btn",onClick:l.withModifiers(s,["stop"])},null,8,["icon","onClick"]),l.createVNode(l.unref(Bt),{icon:"arrow_drop_down",class:"o-command-btn"})])]}),default:l.withCtx(()=>{var p;return[l.createTextVNode(" "+l.toDisplayString((p=i.value)==null?void 0:p.label),1)]}),_:1})]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,(p,f)=>{var h;return l.openBlock(),l.createBlock(l.unref(Zt),{key:f,class:l.normalizeClass({"is-active":(h=n.editor)==null?void 0:h.isActive(p.value)}),onClick:m=>a(p)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:p.icon},null,8,["name"])]),suffix:l.withCtx(()=>{var m;return[(m=n.editor)!=null&&m.isActive(p.value)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(p.label)+" ",1)]),_:2},1032,["class","onClick"])}),128))]),_:1})]),_:1},512))}}),kx={class:"o-list-group"},wx=l.defineComponent({__name:"OListGroup",props:{editor:{type:Dn,required:!0}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.computed(()=>[{label:t("editor.unorderedList"),value:"bulletList",icon:"format_list_bulleted"},{label:t("editor.orderedList"),value:"orderedList",icon:"format_list_numbered"},{label:t("editor.todoList"),value:"taskList",icon:"check_box"}]);function i(s){r(e.editor,s.value)}return(s,a)=>(l.openBlock(),l.createElementBlock("div",kx,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(c,d)=>{var u;return l.openBlock(),l.createBlock(Me,{key:d,icon:c.icon,tooltip:c.label,"content-class":{"is-active":(u=n.editor)==null?void 0:u.isActive(c.value)},onClick:p=>i(c)},null,8,["icon","tooltip","content-class","onClick"])}),128))]))}}),Ex=l.defineComponent({__name:"OLinkBtn",props:{editor:{type:Dn}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(),i=l.ref(!1),s=l.ref(""),a=l.ref(!0);function c(){var f;s.value="",a.value=!0;const p=(f=e.editor)==null?void 0:f.getAttributes("link");p!=null&&p.href&&(s.value=p.href,a.value=p.target==="_blank",console.log("show",i.value,p,a.value))}function d(){var p;(p=o.value)==null||p.setShow(!1)}function u(p){var f;p?r(e.editor,"linkSet",{href:p,target:a.value?"_blank":""}):r(e.editor,"linkUnset"),(f=o.value)==null||f.setShow(!1)}return(p,f)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",placement:"bottom",trigger:"click",arrow:"",show:i.value,"onUpdate:show":[f[1]||(f[1]=h=>i.value=h),c]},{trigger:l.withCtx(()=>{var h;return[l.createVNode(l.unref(st),{icon:"link","content-class":{"is-active":(h=n.editor)==null?void 0:h.isActive("link")},tooltip:l.unref(t)("editor.hyperlink")},null,8,["content-class","tooltip"])]}),default:l.withCtx(()=>[i.value?(l.openBlock(),l.createBlock(l.unref(hd),{key:0,title:l.unref(t)("editor.hyperlink"),val:s.value,icon:"link",onCancel:d,onConfirm:u},{"header-right":l.withCtx(()=>[l.createVNode(l.unref(md),{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),label:l.unref(t)("link.open_in_new_tab")},null,8,["modelValue","label"])]),_:1},8,["title","val"])):l.createCommentVNode("",!0)]),_:1},8,["show"]))}}),Cx=l.defineComponent({__name:"OLinkEditBtn",props:{editor:{type:Dn,required:!0}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(),i=l.ref(!1),s=l.ref(""),a=l.ref(!0);function c(){var f;s.value="",a.value=!0;const p=(f=e.editor)==null?void 0:f.getAttributes("link");p!=null&&p.href&&(s.value=p.href,a.value=p.target==="_blank")}function d(){var p;(p=o.value)==null||p.setShow(!1)}function u(p){var f;p?r(e.editor,"linkSet",{href:p,target:a.value?"_blank":""}):r(e.editor,"linkUnset"),(f=o.value)==null||f.setShow(!1)}return(p,f)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",placement:"bottom",trigger:"click",arrow:"",show:i.value,"onUpdate:show":[f[1]||(f[1]=h=>i.value=h),c]},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"edit",tooltip:l.unref(t)("link.edit")},null,8,["tooltip"])]),default:l.withCtx(()=>[i.value?(l.openBlock(),l.createBlock(l.unref(hd),{key:0,title:l.unref(t)("link.edit"),val:s.value,icon:"link",onCancel:d,onConfirm:u},{"header-right":l.withCtx(()=>[l.createVNode(l.unref(md),{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),label:l.unref(t)("link.open_in_new_tab")},null,8,["modelValue","label"])]),_:1},8,["title","val"])):l.createCommentVNode("",!0)]),_:1},8,["show"]))}}),_x=l.defineComponent({__name:"OLinkOpenBtn",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve();function r(){var i;const o=(i=e.editor)==null?void 0:i.getAttributes("link");o!=null&&o.href&&window.open(o.href,"target")}return(o,i)=>(l.openBlock(),l.createBlock(Me,{icon:"open_in_new",tooltip:l.unref(t)("link.open"),"content-class":"o-link-open-btn",onClick:r},null,8,["tooltip"]))}}),Sx=["bold","italic","text-format-dropdown","separator","heading","font-family","text-color-dropdown","fore-color","back-color","clearFormat","separator","align-dropdown","separator","horizontalRule","blockquote","list-dropdown","codeBlock","link","image","video","modelViewer","table","callout","columns","aiViewer"],xx=["table-group","separator","bold","italic","text-format-dropdown","separator","heading","font-family","text-color-dropdown","clearFormat","separator","align-dropdown","separator","horizontalRule","blockquote","list-dropdown","link","image"],Nx=["bold","strike","text-color-dropdown","clearFormat","separator","list-group","link","callout","separator","align-dropdown","more"],Tx=["link-open","link-edit","linkUnset"],Ox=["align-group","separator","link"],Mx=["align-group","separator","link-open","link-edit","linkUnset"],Ax=["heading","separator","italic","underline","font-family","separator","code","blockquote"],Rx=["table-group","separator","bold","italic","font-family","text-color-dropdown","separator","align-group"],Dx=["style-dropdown","separator","bold","italic","text-color-dropdown","separator","align-dropdown"],Ix={class:"o-command-btn"},Bx={class:"o-more-bubble"},Lx=l.defineComponent({__name:"OMoreBubble",props:{editor:{type:Dn,required:!0}},setup(n){const e=l.ref();return(t,r)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:e,offset:[4,10],class:"o-simple-command-btn","tippy-class":"o-more-bubble-popover",placement:"top-end",size:"medium",trigger:"mouseenter"},{trigger:l.withCtx(()=>[l.createElementVNode("div",Ix,[l.createVNode(l.unref(ie),{name:"more_horiz"})])]),default:l.withCtx(()=>[l.createElementVNode("section",Bx,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Ax),(o,i)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:i},[o==="separator"?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0,vertical:""})):typeof o=="string"?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Pa)(o)),{key:1,name:o,editor:n.editor},null,8,["name","editor"])):l.createCommentVNode("",!0)],64))),128))])]),_:1},512))}}),Px=l.defineComponent({__name:"OStyleDropdown",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.computed(()=>[{label:t("editor.paragraph"),value:"paragraph",icon:"title"},{label:t("editor.heading1"),value:"heading",icon:"format_h1",options:{level:1}},{label:t("editor.heading2"),value:"heading",icon:"format_h2",options:{level:2}},{label:t("editor.heading3"),value:"heading",icon:"format_h3",options:{level:3}},{label:t("editor.todoList"),value:"taskList",icon:"check_box"},{label:t("editor.unorderedList"),value:"bulletList",icon:"format_list_bulleted"},{label:t("editor.orderedList"),value:"orderedList",icon:"format_list_numbered"},{label:t("editor.blockquote"),value:"blockquote",icon:"format_quote_open"},{label:t("editor.removeFormat"),value:"clearFormat",icon:"format_clear",separator:!0}]);function s(c){var d;return(d=e.editor)==null?void 0:d.isActive(c.value,c.options)}function a(c){o.value.setShow(!1),r(e.editor,c.value,c.options)}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",trigger:"click"},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_paint","content-class":"o-style-dropdown o-command-btn dropdown",tooltip:l.unref(t)("label.styles")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(u,p)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:p},[u.separator?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0})):l.createCommentVNode("",!0),l.createVNode(l.unref(Zt),{class:l.normalizeClass({"is-active":s(u)}),onClick:f=>a(u)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:u.icon},null,8,["name"])]),suffix:l.withCtx(()=>[s(u)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(u.label)+" ",1)]),_:2},1032,["class","onClick"])],64))),128))]),_:1})]),_:1},512))}}),$x=l.defineComponent({__name:"OTableBtn",props:{editor:{type:Object}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null);function i(s){var a;(a=o.value)==null||a.setShow(!1),r(e.editor,"tableInsert",s)}return(s,a)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",placement:"bottom",trigger:"click",arrow:""},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"window","content-class":"o-table-btn",tooltip:l.unref(t)("table.insert")},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(qm),{onSelect:i})]),_:1},512))}}),Fx={class:"o-table-group"},zx=l.defineComponent({__name:"OTableGroup",props:{editor:{type:Dn,required:!0}},setup(n){const{tr:e}=ve(),{run:t}=Pe();return(r,o)=>{var i,s;return l.openBlock(),l.createElementBlock("section",Fx,[(i=n.editor)!=null&&i.can().mergeCells()?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,icon:"cell_merge",tooltip:l.unref(e)("table.merge"),onClick:o[0]||(o[0]=a=>l.unref(t)(n.editor,"tableMergeCells"))},null,8,["tooltip"])):l.createCommentVNode("",!0),(s=n.editor)!=null&&s.can().splitCell()?(l.openBlock(),l.createBlock(l.unref(Me),{key:1,icon:"splitscreen_left",tooltip:l.unref(e)("table.split"),onClick:o[1]||(o[1]=a=>l.unref(t)(n.editor,"tableSplitCell"))},null,8,["tooltip"])):l.createCommentVNode("",!0),l.createVNode(l.unref(Km),{editor:n.editor},null,8,["editor"])])}}}),Vx=l.defineComponent({__name:"OTextColorDropdown",props:{editor:{type:Dn}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(null),i=l.ref(""),s=l.ref("");function a(c,d){c==="foreColor"?(i.value=d,localStorage.setItem("yiitap.text-color.fore",d)):c==="backColor"&&(s.value=d,localStorage.setItem("yiitap.text-color.back",d)),o.value.setShow(!1),r(e.editor,c,{color:d})}return l.onMounted(()=>{i.value=localStorage.getItem("yiitap.text-color.fore")||"",s.value=localStorage.getItem("yiitap.text-color.back")||""}),(c,d)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn",size:"medium",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"format_text","content-class":"o-text-color-dropdown dropdown",tooltip:l.unref(t)("editor.textColor")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>{var u;return[l.createVNode(l.unref(Gm),{"fore-color":i.value,"back-color":s.value,"default-label":l.unref(t)("editor.defaultColor"),"active-color":(u=n.editor)==null?void 0:u.getAttributes("textStyle").color,onSelect:a},null,8,["fore-color","back-color","default-label","active-color"])]}),_:1},512))}}),Hx=l.defineComponent({__name:"OTextFormatDropdown",props:{editor:{type:Dn}},setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(),i=l.computed(()=>[{label:t("editor.strikethrough"),value:"strike",icon:"format_strikethrough"},{label:t("editor.underline"),value:"underline",icon:"format_underlined"},{label:t("editor.code"),value:"code",icon:"code"}]);function s(a){var c;(c=o.value)==null||c.setShow(!1),r(e.editor,a)}return(a,c)=>(l.openBlock(),l.createBlock(l.unref(qe),{ref_key:"popover",ref:o,class:"o-simple-command-btn","tippy-class":"dropdown",trigger:"click","show-arrow":!1},{trigger:l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"title","content-class":"o-text-format-dropdown dropdown",tooltip:l.unref(t)("editor.textFormat")},{default:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:"arrow_drop_down",class:"arrow"})]),_:1},8,["tooltip"])]),default:l.withCtx(()=>[l.createVNode(l.unref(un),{hoverable:"",clickable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(d,u)=>{var p;return l.openBlock(),l.createBlock(l.unref(Zt),{key:u,class:l.normalizeClass({"is-active":(p=n.editor)==null?void 0:p.isActive(d.value)}),onClick:f=>s(d.value)},{prefix:l.withCtx(()=>[l.createVNode(l.unref(ie),{name:d.icon},null,8,["name"])]),suffix:l.withCtx(()=>{var f;return[(f=n.editor)!=null&&f.isActive(d.value)?(l.openBlock(),l.createBlock(l.unref(ie),{key:0,name:"done",small:""})):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.label)+" ",1)]),_:2},1032,["class","onClick"])}),128))]),_:1})]),_:1},512))}}),Ux={"align-dropdown":cx,"align-group":ux,"back-color":fx,"font-family":hx,"fore-color":gx,heading:bx,"list-dropdown":vx,"list-group":wx,link:Ex,"link-edit":Cx,"link-open":_x,more:Lx,"style-dropdown":Px,table:$x,"table-group":zx,"text-color-dropdown":Vx,"text-format-dropdown":Hx},Pa=n=>Ux[n]||N_,Wx={class:"o-main-menu"},qx={class:"left"},Kx={class:"right"},Zm=l.defineComponent({__name:"OMainMenu",props:{editor:{type:Object},menu:{type:Array,default:function(){return[]}}},setup(n){const e=n,t=l.computed(()=>{var o;let r=e.menu;return(o=e.editor)!=null&&o.isActive("table")&&(r=xx),r.length>0?r:Sx});return(r,o)=>(l.openBlock(),l.createElementBlock("section",Wx,[l.createElementVNode("section",qx,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.value,(i,s)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:s},[i==="separator"?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0,vertical:""})):typeof i=="string"?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Pa)(i)),{key:1,name:i,editor:n.editor},null,8,["name","editor"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i),{key:2,editor:n.editor},null,8,["editor"]))],64))),128)),l.renderSlot(r.$slots,"left")]),l.createElementVNode("section",Kx,[l.renderSlot(r.$slots,"right")])]))}}),Gx={key:0,class:"o-bubble-menu"},jx={class:"container"},Jx=l.defineComponent({__name:"OBubbleMenu",props:{editor:{type:Object},menu:{type:Array,default:function(){return[]}},tableToolbar:{type:Array,default:function(){return[]}},menuClass:{type:String,default:""}},setup(n){const e=n,{tr:t}=ve(),{theme:r}=Bi(),o=l.ref(!1),i=l.ref({duration:100,placement:"top",role:"popover",arrow:!1,onShow:()=>{o.value=!1}});function s(){o.value=!0}function a(f){const{schema:h}=e.editor,m=h.marks.link;if(!m||!f)return!1;const{$from:g,$to:b}=f;return!!Mo(g,m)}function c({editor:f,view:h,state:m,oldState:g,from:b,to:y}){var $;const{doc:k,selection:E}=m,{empty:v}=E,_=!k.textBetween(b,y).length&&Aa(m.selection);if(!h.hasFocus()||v||_&&f.isActive("link")&&!f.isActive("image"))return!1;const C=["image"],D=["toc","video","model-viewer"],B=E.node,A=($=B==null?void 0:B.type)==null?void 0:$.name;return!(f.isActive("codeBlock")||D.indexOf(A)>=0||A&&!C.includes(A))}const d=l.computed(()=>{if(e.editor){const{state:f}=e.editor,{tr:h}=f,{selection:m}=h;return a(m)}else return!1}),u=l.computed(()=>{var f;return!o.value&&d.value&&!((f=e.editor)!=null&&f.isActive("image"))}),p=l.computed(()=>{var h,m;let f=e.menu;return o.value||((h=e.editor)!=null&&h.isActive("image")?f=d.value?Mx:Ox:(m=e.editor)!=null&&m.isActive("table")?f=Rx:d.value&&(f=Tx)),f.length>0?f:Nx});return l.onMounted(()=>{o.value=!1}),(f,h)=>n.editor?(l.openBlock(),l.createElementBlock("section",Gx,[l.createVNode(l.unref(vC),{class:l.normalizeClass(["bubble-menu",n.menuClass]),editor:n.editor,"should-show":c,"tippy-options":i.value},{default:l.withCtx(()=>[l.createElementVNode("section",jx,[u.value?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(l.unref(Me),{icon:"arrow_back",tooltip:l.unref(t)("link.back"),onClick:s},null,8,["tooltip"]),l.createVNode(l.unref(Xt),{vertical:""})],64)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,(m,g)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:g},[m==="separator"?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0,vertical:""})):typeof m=="string"?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Pa)(m)),{key:1,name:m,editor:n.editor},null,8,["name","editor"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(m),{key:2,editor:n.editor},null,8,["editor"]))],64))),128))])]),_:1},8,["class","editor","tippy-options"])])):l.createCommentVNode("",!0)}}),Yx={key:0,class:"o-floating-menu"},Xx={class:"container"},Zx=l.defineComponent({__name:"OFloatingMenu",props:{editor:{type:Object},menu:{type:Array,default:function(){return[]}},tableToolbar:{type:Array,default:function(){return[]}},menuClass:{type:String,default:""}},setup(n){const e=n,t=l.ref(!1),r=l.ref({arrow:!1,duration:100,role:"popover",placement:"right",offset:[0,168]});function o(){t.value=!0}function i(d){const{schema:u}=e.editor,p=u.marks.link;if(!p||!d)return!1;const{$from:f,$to:h}=d;return!!Mo(f,p)}const s=l.computed(()=>{if(e.editor){const{state:d}=e.editor,{tr:u}=d,{selection:p}=u;return i(p)}else return!1}),a=l.computed(()=>!t.value&&s.value),c=l.computed(()=>{let d=e.menu;return d.length>0?d:Dx});return(d,u)=>n.editor?(l.openBlock(),l.createElementBlock("section",Yx,[l.createVNode(l.unref(EC),{class:l.normalizeClass(["floating-menu",n.menuClass]),editor:n.editor,"tippy-options":r.value},{default:l.withCtx(()=>[l.createElementVNode("section",Xx,[a.value?(l.openBlock(),l.createBlock(l.unref(Me),{key:0,icon:"arrow_back",onClick:o})):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,(p,f)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:f},[p==="separator"?(l.openBlock(),l.createBlock(l.unref(Xt),{key:0,vertical:""})):typeof p=="string"?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Pa)(p)),{key:1,name:p,editor:n.editor},null,8,["name","editor"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(p),{key:2,editor:n.editor},null,8,["editor"]))],64))),128))])]),_:1},8,["class","editor","tippy-options"])])):l.createCommentVNode("",!0)}});function gd(n,e){const t=e==null?void 0:e.posAtCoords(n);if(!t)return;let r=Cs(t.pos,e);if(r!==e.dom){for(;r&&r.parentNode&&r.parentNode!==e.dom;)r=r.parentNode;if(r)return r}}function Cs(n,e){return e.nodeDOM(n)||e.domAtPos(n).node}function bd(n,e){const t=gd(n,e);if(t&&t.nodeType===1){const r=e.docView,o=r.nearestDesc(t,!0);return!o||o===r?null:o.posBefore}return null}function Qx(n,e){let t,r;const o=e.resolve(n.from).node().type.spec.group==="blockContent",i=e.resolve(n.to).node().type.spec.group==="blockContent",s=Math.min(n.$anchor.depth,n.$head.depth);if(o&&i){const a=n.$from.start(s-1),c=n.$to.end(s-1);t=e.resolve(a-1).pos,r=e.resolve(c+1).pos}else t=n.from,r=n.to;return{from:t,to:r}}function eN(n,e){const t=bd(n,e.view);return t&&t>=0?{node:e.state.doc.nodeAt(t),pos:t}:{node:null,pos:t}}const qs=new $e("sideMenu");class tN{constructor(){De(this,"hovered",!1);De(this,"coords",{left:0,top:0});De(this,"className","")}init(e){return this}apply({tr:e,oldState:t,newState:r}){return e.docChanged?this:this}setHover(e,t,r=""){this.hovered=e,this.coords=t,this.className=r}}class nN{constructor({editor:e,element:t,view:r,tippyOptions:o={},updateDelay:i=250}){De(this,"editor");De(this,"element");De(this,"view");De(this,"preventHide",!1);De(this,"tippy");De(this,"tippyOptions");De(this,"updateDelay");De(this,"updateDebounceTimer");De(this,"mousedownHandler",()=>{this.preventHide=!0});De(this,"onDragStart",e=>{this.hide()});De(this,"blurHandler",({event:e})=>{var t;e!=null&&e.relatedTarget&&((t=this.element.parentNode)!=null&&t.contains(e.relatedTarget))||this.hide()});De(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});De(this,"handleDebouncedUpdate",(e,t)=>{const r=!(t!=null&&t.selection.eq(e.state.selection)),o=!(t!=null&&t.doc.eq(e.state.doc));!r&&!o||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,r,o,t)},this.updateDelay))});De(this,"updateHandler",(e,t,r,o)=>{var u,p;const{state:i,composing:s}=e,{coords:a}=qs.getState(i),c=gd(a,e),d=bd(a,e);!c||d<=0||(this.createTooltip(),(p=this.tippy)==null||p.setProps({getReferenceClientRect:((u=this.tippyOptions)==null?void 0:u.getReferenceClientRect)||(()=>c.getBoundingClientRect())}),this.show())});this.editor=e,this.element=t,this.view=r,this.updateDelay=i,this.view.dom.addEventListener("dragstart",this.onDragStart),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=In(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"left",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,o=!(t!=null&&t.selection.eq(e.state.selection)),i=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,i,t)}show(){var e;(e=this.tippy)==null||e.show()}hide(){var e;(e=this.tippy)==null||e.hide()}destroy(){var e,t;(e=this.tippy)!=null&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)==null||t.destroy(),this.view.dom.removeEventListener("dragstart",this.onDragStart)}}const rN=(n,e)=>{if(!n.dataTransfer)return;const t=e.view,r=t.dom.getBoundingClientRect(),o={left:r.left+r.width/2,top:n.clientY},i=bd(o,t);if(i===null)return;const s=t.state.selection,a=t.state.doc;Qx(s,a),t.dispatch(t.state.tr.setSelection(G.create(t.state.doc,i))),iN(t,i);const c=t.state.selection.content(),{dom:d,text:u}=t.serializeForClipboard(c);n.dataTransfer.clearData(),n.dataTransfer.setData("text/html",d.innerHTML),n.dataTransfer.setData("text/plain",u),n.dataTransfer.effectAllowed="move",n.dataTransfer.setDragImage(zr,0,0),t.dragging={slice:c,move:!0}},oN=(n,e)=>{Qm()};let zr;function iN(n,e,t=e){const r=n.domAtPos(e).node.cloneNode(!0),o=n.domAtPos(e).node,i=(p,f)=>Array.prototype.indexOf.call(p.children,f),s=p=>{let f=p,h=f.parentElement;for(;h;){if(h===n.dom)return f;f=h,h=f.parentElement}return f};let a=-1,c=-1;e===t?(a=i(o,s(Cs(e,n))),c=a):(a=i(o,s(Cs(e+1,n))),c=i(o,s(Cs(t-1,n))));for(let p=o.childElementCount-1;p>=0;p--)(p>a||p<c)&&r.removeChild(r.children[p]);Qm(),zr=r;const u=n.dom.className.split(" ").filter(p=>p!=="ProseMirror"&&p!=="yiitap-root"&&p!=="yiitap-editor").join(" ");zr.className+=" yiitap-dragging-preview "+u,document.body.appendChild(zr)}function Qm(){zr!==void 0&&(document.body.removeChild(zr),zr=void 0)}class sN{constructor(e){De(this,"options");De(this,"plugin");De(this,"sideMenuView");const t=new tN;this.options=e,this.plugin=new Te({key:qs,props:{handleDOMEvents:{mouseover(r,o){const i={left:o.clientX,top:o.clientY},s=gd(i,r),a=(s==null?void 0:s.className)||"",c=t.className;a.indexOf("o-table-wrapper-view")>=0&&c.indexOf("o-table-wrapper-view")>=0||(t.setHover(!0,i,a),r.dispatch(r.state.tr.setMeta(qs,t)))}}},state:{init(r,o){return t.init(o)},apply(r,o,i,s){return t.apply({tr:r,oldState:i,newState:s})}},view:r=>(this.sideMenuView=new nN({view:r,...e}),this.sideMenuView)})}dragstart(e){rN(e,this.options.editor)}dragend(e){oN(e,this.options.editor)}}const aN=l.defineComponent({name:"SideMenu",props:{pluginKey:{type:[String,Object],default:"sideMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})}},setup(n,{expose:e,slots:t}){const r=l.ref(null),o=l.ref(),i=a=>{var c;(c=o.value)==null||c.dragstart(a)},s=a=>{var c;(c=o.value)==null||c.dragend(a)};return l.onMounted(()=>{const{pluginKey:a,editor:c,updateDelay:d,tippyOptions:u}=n;o.value=new sN({updateDelay:d,editor:c,element:r.value,pluginKey:a,tippyOptions:u}),c.registerPlugin(o.value.plugin)}),l.onBeforeUnmount(()=>{const{pluginKey:a,editor:c}=n;c.unregisterPlugin(a)}),e({...n,dragstart:i,dragend:s}),()=>{var a;return l.h("div",{ref:r},(a=t.default)==null?void 0:a.call(t))}}}),lN={key:0,class:"o-side-menu"},cN={class:"container"},dN=l.defineComponent({__name:"OSideMenu",props:{editor:{type:Dn,required:!0},menuClass:{type:String,default:""}},setup(n){const e=n,t=l.ref(null),r=l.ref(null),o=l.ref(0),i=l.computed(()=>({arrow:!1,duration:100,placement:"left"})),s=l.computed(()=>({editor:e.editor,node:r.value,decorations:[],selected:!1,extension:{},getPos:()=>o.value,pos:o.value,updateAttributes:c,deleteNode:a,view:void 0,innerDecorations:[],HTMLAttributes:void 0}));function a(){var m,g;const f=o.value,h=f+((m=r.value)==null?void 0:m.nodeSize);(g=e.editor)==null||g.commands.deleteRange({from:f,to:h})}function c(f){var h;(h=e.editor)==null||h.commands.command(({tr:m})=>{var g;return m.setNodeMarkup(o.value,void 0,{...(g=r.value)==null?void 0:g.attrs,...f}),!0})}function d({editor:f,transaction:h}){let m={left:0,top:0};const g=qs.getState(e.editor.view.state);if(g){m=g.coords;const b=eN(m,f);b.node&&b.pos>0&&(r.value=b.node,o.value=b.pos)}}function u(f){var h;(h=t.value)==null||h.dragstart(f)}function p(f){var h;(h=t.value)==null||h.dragend(f)}return l.onMounted(()=>{var f;(f=e.editor)==null||f.on("transaction",d)}),(f,h)=>n.editor?(l.openBlock(),l.createElementBlock("section",lN,[l.createVNode(l.unref(aN),{ref_key:"menu",ref:t,class:l.normalizeClass(["side-menu",n.menuClass]),editor:n.editor,"tippy-options":i.value},{default:l.withCtx(()=>[l.createElementVNode("section",cN,[r.value?(l.openBlock(),l.createBlock(l.unref(Ym),l.normalizeProps(l.mergeProps({key:0},s.value)),null,16)):l.createCommentVNode("",!0),r.value?(l.openBlock(),l.createBlock(l.unref(Xm),l.mergeProps({key:1},s.value,{onDragstart:u,onDragend:p}),null,16)):l.createCommentVNode("",!0)])]),_:1},8,["class","editor","tippy-options"])])):l.createCommentVNode("",!0)}}),uN=l.defineComponent({__name:"view",props:ct,setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-blockquote-view"}),{default:l.withCtx(()=>[l.createElementVNode("blockquote",null,[l.createVNode(l.unref(Xn))])]),_:1},16))}}),pN=Dm.extend({draggable:!0,addNodeView(){return yn(uN)}}),fN={class:"callout-container"},hN={class:"callout-icon"},mN={class:"callout-content"},gN=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,{theme:t}=Bi(),r=l.ref(!1),o=l.ref(!1),i=l.ref({}),s=l.computed(()=>{e.editor.isActive("callout");const{selection:b}=e.editor.view.state,y=b.from,k=e.getPos(),E=k+e.node.nodeSize;return y>=k&&y<=E});l.computed(()=>e.node.attrs);const a=l.computed({get(){return e.node.attrs.backColor},set(b){e.updateAttributes({backColor:b})}}),c=l.computed({get(){return e.node.attrs.backColorDark},set(b){e.updateAttributes({backColorDark:b})}}),d=l.computed({get(){return e.node.attrs.borderColor},set(b){e.updateAttributes({borderColor:b})}}),u=l.computed({get(){return e.node.attrs.borderColorDark},set(b){e.updateAttributes({borderColorDark:b})}}),p=l.computed(()=>t.value==="dark"?c.value:a.value),f=l.computed(()=>t.value==="dark"?u.value:d.value);function h(b){switch(r.value=!1,b.value){case"palette":g(!0);break}}function m(b){r.value=!0,i.value=b}function g(b){o.value=b}return l.watch(s,b=>{g(b)}),(b,y)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-callout-view",style:`--callout-border-color: ${f.value}; --callout-back-color: ${p.value}`,onContextmenu:l.withModifiers(m,["prevent"])}),{default:l.withCtx(()=>[l.createElementVNode("div",fN,[l.createElementVNode("div",hN,l.toDisplayString(b.node.attrs.icon),1),l.createElementVNode("div",mN,[l.createVNode(l.unref(Xn))]),l.createVNode(l.unref(Ba),{modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=k=>r.value=k),event:i.value},{default:l.withCtx(()=>[l.createVNode(l.unref(Xr),l.mergeProps(e,{onAction:h}),null,16)]),_:1},8,["modelValue","event"])])]),_:1},16,["style","onContextmenu"]))}}),bN=Ke.create({name:"callout",group:"block",content:"block+",draggable:!0,addAttributes(){return{icon:{default:"🌾"},borderColor:{default:"#dddddd"},borderColorDark:{default:"#333333"},backColor:{default:"#eeeeee"},backColorDark:{default:"rgba(101, 117, 133, 0.16)"}}},parseHTML(){return[{tag:'div[data-type="callout"]'}]},renderHTML({HTMLAttributes:n}){return["div",_e(n,{"data-type":"callout"}),0]},addCommands(){return{setCallout:()=>({commands:n})=>n.wrapIn(this.name),toggleCallout:()=>({commands:n})=>n.toggleWrap(this.name),unsetCallout:()=>({commands:n})=>n.lift(this.name)}},addNodeView(){return yn(gN)}});function yN(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function eg(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e],r=typeof t;(r==="object"||r==="function")&&!Object.isFrozen(t)&&eg(t)}),n}class _p{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function tg(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function pr(n,...e){const t=Object.create(null);for(const r in n)t[r]=n[r];return e.forEach(function(r){for(const o in r)t[o]=r[o]}),t}const vN="</span>",Sp=n=>!!n.scope,kN=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map((r,o)=>`${r}${"_".repeat(o+1)}`)].join(" ")}return`${e}${n}`};class wN{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=tg(e)}openNode(e){if(!Sp(e))return;const t=kN(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){Sp(e)&&(this.buffer+=vN)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const xp=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class yd{constructor(){this.rootNode=xp(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=xp({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(r=>this._walk(e,r)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{yd._collapse(t)}))}}class EN extends yd{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const r=e.root;t&&(r.scope=`language:${t}`),this.add(r)}toHTML(){return new wN(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ei(n){return n?typeof n=="string"?n:n.source:null}function ng(n){return Zr("(?=",n,")")}function CN(n){return Zr("(?:",n,")*")}function _N(n){return Zr("(?:",n,")?")}function Zr(...n){return n.map(t=>Ei(t)).join("")}function SN(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function vd(...n){return"("+(SN(n).capture?"":"?:")+n.map(r=>Ei(r)).join("|")+")"}function rg(n){return new RegExp(n.toString()+"|").exec("").length-1}function xN(n,e){const t=n&&n.exec(e);return t&&t.index===0}const NN=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function kd(n,{joinWith:e}){let t=0;return n.map(r=>{t+=1;const o=t;let i=Ei(r),s="";for(;i.length>0;){const a=NN.exec(i);if(!a){s+=i;break}s+=i.substring(0,a.index),i=i.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+o):(s+=a[0],a[0]==="("&&t++)}return s}).map(r=>`(${r})`).join(e)}const TN=/\b\B/,og="[a-zA-Z]\\w*",wd="[a-zA-Z_]\\w*",ig="\\b\\d+(\\.\\d+)?",sg="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ag="\\b(0b[01]+)",ON="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",MN=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=Zr(e,/.*\b/,n.binary,/\b.*/)),pr({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,r)=>{t.index!==0&&r.ignoreMatch()}},n)},Ci={begin:"\\\\[\\s\\S]",relevance:0},AN={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ci]},RN={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ci]},DN={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},$a=function(n,e,t={}){const r=pr({scope:"comment",begin:n,end:e,contains:[]},t);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=vd("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Zr(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},IN=$a("//","$"),BN=$a("/\\*","\\*/"),LN=$a("#","$"),PN={scope:"number",begin:ig,relevance:0},$N={scope:"number",begin:sg,relevance:0},FN={scope:"number",begin:ag,relevance:0},zN={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ci,{begin:/\[/,end:/\]/,relevance:0,contains:[Ci]}]},VN={scope:"title",begin:og,relevance:0},HN={scope:"title",begin:wd,relevance:0},UN={begin:"\\.\\s*"+wd,relevance:0},WN=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var Xi=Object.freeze({__proto__:null,APOS_STRING_MODE:AN,BACKSLASH_ESCAPE:Ci,BINARY_NUMBER_MODE:FN,BINARY_NUMBER_RE:ag,COMMENT:$a,C_BLOCK_COMMENT_MODE:BN,C_LINE_COMMENT_MODE:IN,C_NUMBER_MODE:$N,C_NUMBER_RE:sg,END_SAME_AS_BEGIN:WN,HASH_COMMENT_MODE:LN,IDENT_RE:og,MATCH_NOTHING_RE:TN,METHOD_GUARD:UN,NUMBER_MODE:PN,NUMBER_RE:ig,PHRASAL_WORDS_MODE:DN,QUOTE_STRING_MODE:RN,REGEXP_MODE:zN,RE_STARTERS_RE:ON,SHEBANG:MN,TITLE_MODE:VN,UNDERSCORE_IDENT_RE:wd,UNDERSCORE_TITLE_MODE:HN});function qN(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function KN(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function GN(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=qN,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function jN(n,e){Array.isArray(n.illegal)&&(n.illegal=vd(...n.illegal))}function JN(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function YN(n,e){n.relevance===void 0&&(n.relevance=1)}const XN=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},n);Object.keys(n).forEach(r=>{delete n[r]}),n.keywords=t.keywords,n.begin=Zr(t.beforeMatch,ng(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},ZN=["of","and","for","in","not","or","if","then","parent","list","value"],QN="keyword";function lg(n,e,t=QN){const r=Object.create(null);return typeof n=="string"?o(t,n.split(" ")):Array.isArray(n)?o(t,n):Object.keys(n).forEach(function(i){Object.assign(r,lg(n[i],e,i))}),r;function o(i,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){const c=a.split("|");r[c[0]]=[i,e1(c[0],c[1])]})}}function e1(n,e){return e?Number(e):t1(n)?0:1}function t1(n){return ZN.includes(n.toLowerCase())}const Np={},Vr=n=>{console.error(n)},Tp=(n,...e)=>{console.log(`WARN: ${n}`,...e)},no=(n,e)=>{Np[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),Np[`${n}/${e}`]=!0)},Ks=new Error;function cg(n,e,{key:t}){let r=0;const o=n[t],i={},s={};for(let a=1;a<=e.length;a++)s[a+r]=o[a],i[a+r]=!0,r+=rg(e[a-1]);n[t]=s,n[t]._emit=i,n[t]._multi=!0}function n1(n){if(Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw Vr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ks;if(typeof n.beginScope!="object"||n.beginScope===null)throw Vr("beginScope must be object"),Ks;cg(n,n.begin,{key:"beginScope"}),n.begin=kd(n.begin,{joinWith:""})}}function r1(n){if(Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw Vr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ks;if(typeof n.endScope!="object"||n.endScope===null)throw Vr("endScope must be object"),Ks;cg(n,n.end,{key:"endScope"}),n.end=kd(n.end,{joinWith:""})}}function o1(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function i1(n){o1(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),n1(n),r1(n)}function s1(n){function e(s,a){return new RegExp(Ei(s),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(a?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,a]),this.matchAt+=rg(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(c=>c[1]);this.matcherRe=e(kd(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(a);if(!c)return null;const d=c.findIndex((p,f)=>f>0&&p!==void 0),u=this.matchIndexes[d];return c.splice(0,d),Object.assign(c,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const c=new t;return this.rules.slice(a).forEach(([d,u])=>c.addRule(d,u)),c.compile(),this.multiRegexes[a]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,c){this.rules.push([a,c]),c.type==="begin"&&this.count++}exec(a){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let d=c.exec(a);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,d=u.exec(a)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function o(s){const a=new r;return s.contains.forEach(c=>a.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function i(s,a){const c=s;if(s.isCompiled)return c;[KN,JN,i1,XN].forEach(u=>u(s,a)),n.compilerExtensions.forEach(u=>u(s,a)),s.__beforeBegin=null,[GN,jN,YN].forEach(u=>u(s,a)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=lg(s.keywords,n.case_insensitive)),c.keywordPatternRe=e(d,!0),a&&(s.begin||(s.begin=/\B|\b/),c.beginRe=e(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=e(c.end)),c.terminatorEnd=Ei(c.end)||"",s.endsWithParent&&a.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(c.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return a1(u==="self"?s:u)})),s.contains.forEach(function(u){i(u,c)}),s.starts&&i(s.starts,a),c.matcher=o(c),c}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=pr(n.classNameAliases||{}),i(n)}function dg(n){return n?n.endsWithParent||dg(n.starts):!1}function a1(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return pr(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:dg(n)?pr(n,{starts:n.starts?pr(n.starts):null}):Object.isFrozen(n)?pr(n):n}var l1="11.10.0";class c1 extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const wl=tg,Op=pr,Mp=Symbol("nomatch"),d1=7,ug=function(n){const e=Object.create(null),t=Object.create(null),r=[];let o=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:EN};function c(N){return a.noHighlightRe.test(N)}function d(N){let M=N.className+" ";M+=N.parentNode?N.parentNode.className:"";const z=a.languageDetectRe.exec(M);if(z){const j=A(z[1]);return j||(Tp(i.replace("{}",z[1])),Tp("Falling back to no-highlight mode for this block.",N)),j?z[1]:"no-highlight"}return M.split(/\s+/).find(j=>c(j)||A(j))}function u(N,M,z){let j="",Q="";typeof M=="object"?(j=N,z=M.ignoreIllegals,Q=M.language):(no("10.7.0","highlight(lang, code, ...args) has been deprecated."),no("10.7.0",`Please use highlight(code, options) instead.
|
|
117
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Q=N,j=M),z===void 0&&(z=!0);const fe={code:j,language:Q};re("before:highlight",fe);const Se=fe.result?fe.result:p(fe.language,fe.code,z);return Se.code=fe.code,re("after:highlight",Se),Se}function p(N,M,z,j){const Q=Object.create(null);function fe(L,V){return L.keywords[V]}function Se(){if(!Z.keywords){Re.addText(ke);return}let L=0;Z.keywordPatternRe.lastIndex=0;let V=Z.keywordPatternRe.exec(ke),ue="";for(;V;){ue+=ke.substring(L,V.index);const we=le.case_insensitive?V[0].toLowerCase():V[0],Qe=fe(Z,we);if(Qe){const[Wt,Do]=Qe;if(Re.addText(ue),ue="",Q[we]=(Q[we]||0)+1,Q[we]<=d1&&(Nt+=Do),Wt.startsWith("_"))ue+=V[0];else{const x=le.classNameAliases[Wt]||Wt;Fe(V[0],x)}}else ue+=V[0];L=Z.keywordPatternRe.lastIndex,V=Z.keywordPatternRe.exec(ke)}ue+=ke.substring(L),Re.addText(ue)}function rt(){if(ke==="")return;let L=null;if(typeof Z.subLanguage=="string"){if(!e[Z.subLanguage]){Re.addText(ke);return}L=p(Z.subLanguage,ke,!0,xt[Z.subLanguage]),xt[Z.subLanguage]=L._top}else L=h(ke,Z.subLanguage.length?Z.subLanguage:null);Z.relevance>0&&(Nt+=L.relevance),Re.__addSublanguage(L._emitter,L.language)}function xe(){Z.subLanguage!=null?rt():Se(),ke=""}function Fe(L,V){L!==""&&(Re.startScope(V),Re.addText(L),Re.endScope())}function Ht(L,V){let ue=1;const we=V.length-1;for(;ue<=we;){if(!L._emit[ue]){ue++;continue}const Qe=le.classNameAliases[L[ue]]||L[ue],Wt=V[ue];Qe?Fe(Wt,Qe):(ke=Wt,Se(),ke=""),ue++}}function dt(L,V){return L.scope&&typeof L.scope=="string"&&Re.openNode(le.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Fe(ke,le.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),ke=""):L.beginScope._multi&&(Ht(L.beginScope,V),ke="")),Z=Object.create(L,{parent:{value:Z}}),Z}function Qt(L,V,ue){let we=xN(L.endRe,ue);if(we){if(L["on:end"]){const Qe=new _p(L);L["on:end"](V,Qe),Qe.isMatchIgnored&&(we=!1)}if(we){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Qt(L.parent,V,ue)}function ut(L){return Z.matcher.regexIndex===0?(ke+=L[0],1):(Tt=!0,0)}function en(L){const V=L[0],ue=L.rule,we=new _p(ue),Qe=[ue.__beforeBegin,ue["on:begin"]];for(const Wt of Qe)if(Wt&&(Wt(L,we),we.isMatchIgnored))return ut(V);return ue.skip?ke+=V:(ue.excludeBegin&&(ke+=V),xe(),!ue.returnBegin&&!ue.excludeBegin&&(ke=V)),dt(ue,L),ue.returnBegin?0:V.length}function kn(L){const V=L[0],ue=M.substring(L.index),we=Qt(Z,L,ue);if(!we)return Mp;const Qe=Z;Z.endScope&&Z.endScope._wrap?(xe(),Fe(V,Z.endScope._wrap)):Z.endScope&&Z.endScope._multi?(xe(),Ht(Z.endScope,L)):Qe.skip?ke+=V:(Qe.returnEnd||Qe.excludeEnd||(ke+=V),xe(),Qe.excludeEnd&&(ke=V));do Z.scope&&Re.closeNode(),!Z.skip&&!Z.subLanguage&&(Nt+=Z.relevance),Z=Z.parent;while(Z!==we.parent);return we.starts&&dt(we.starts,L),Qe.returnEnd?0:V.length}function pn(){const L=[];for(let V=Z;V!==le;V=V.parent)V.scope&&L.unshift(V.scope);L.forEach(V=>Re.openNode(V))}let Ut={};function fn(L,V){const ue=V&&V[0];if(ke+=L,ue==null)return xe(),0;if(Ut.type==="begin"&&V.type==="end"&&Ut.index===V.index&&ue===""){if(ke+=M.slice(V.index,V.index+1),!o){const we=new Error(`0 width match regex (${N})`);throw we.languageName=N,we.badRule=Ut.rule,we}return 1}if(Ut=V,V.type==="begin")return en(V);if(V.type==="illegal"&&!z){const we=new Error('Illegal lexeme "'+ue+'" for mode "'+(Z.scope||"<unnamed>")+'"');throw we.mode=Z,we}else if(V.type==="end"){const we=kn(V);if(we!==Mp)return we}if(V.type==="illegal"&&ue==="")return 1;if(hn>1e5&&hn>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ke+=ue,ue.length}const le=A(N);if(!le)throw Vr(i.replace("{}",N)),new Error('Unknown language: "'+N+'"');const Lt=s1(le);let vt="",Z=j||Lt;const xt={},Re=new a.__emitter(a);pn();let ke="",Nt=0,Xe=0,hn=0,Tt=!1;try{if(le.__emitTokens)le.__emitTokens(M,Re);else{for(Z.matcher.considerAll();;){hn++,Tt?Tt=!1:Z.matcher.considerAll(),Z.matcher.lastIndex=Xe;const L=Z.matcher.exec(M);if(!L)break;const V=M.substring(Xe,L.index),ue=fn(V,L);Xe=L.index+ue}fn(M.substring(Xe))}return Re.finalize(),vt=Re.toHTML(),{language:N,value:vt,relevance:Nt,illegal:!1,_emitter:Re,_top:Z}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:N,value:wl(M),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:Xe,context:M.slice(Xe-100,Xe+100),mode:L.mode,resultSoFar:vt},_emitter:Re};if(o)return{language:N,value:wl(M),illegal:!1,relevance:0,errorRaised:L,_emitter:Re,_top:Z};throw L}}function f(N){const M={value:wl(N),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return M._emitter.addText(N),M}function h(N,M){M=M||a.languages||Object.keys(e);const z=f(N),j=M.filter(A).filter(J).map(xe=>p(xe,N,!1));j.unshift(z);const Q=j.sort((xe,Fe)=>{if(xe.relevance!==Fe.relevance)return Fe.relevance-xe.relevance;if(xe.language&&Fe.language){if(A(xe.language).supersetOf===Fe.language)return 1;if(A(Fe.language).supersetOf===xe.language)return-1}return 0}),[fe,Se]=Q,rt=fe;return rt.secondBest=Se,rt}function m(N,M,z){const j=M&&t[M]||z;N.classList.add("hljs"),N.classList.add(`language-${j}`)}function g(N){let M=null;const z=d(N);if(c(z))return;if(re("before:highlightElement",{el:N,language:z}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),a.throwUnescapedHTML))throw new c1("One of your code blocks includes unescaped HTML.",N.innerHTML);M=N;const j=M.textContent,Q=z?u(j,{language:z,ignoreIllegals:!0}):h(j);N.innerHTML=Q.value,N.dataset.highlighted="yes",m(N,z,Q.language),N.result={language:Q.language,re:Q.relevance,relevance:Q.relevance},Q.secondBest&&(N.secondBest={language:Q.secondBest.language,relevance:Q.secondBest.relevance}),re("after:highlightElement",{el:N,result:Q,text:j})}function b(N){a=Op(a,N)}const y=()=>{v(),no("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function k(){v(),no("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function v(){if(document.readyState==="loading"){E=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function _(){E&&v()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_,!1);function C(N,M){let z=null;try{z=M(n)}catch(j){if(Vr("Language definition for '{}' could not be registered.".replace("{}",N)),o)Vr(j);else throw j;z=s}z.name||(z.name=N),e[N]=z,z.rawDefinition=M.bind(null,n),z.aliases&&$(z.aliases,{languageName:N})}function D(N){delete e[N];for(const M of Object.keys(t))t[M]===N&&delete t[M]}function B(){return Object.keys(e)}function A(N){return N=(N||"").toLowerCase(),e[N]||e[t[N]]}function $(N,{languageName:M}){typeof N=="string"&&(N=[N]),N.forEach(z=>{t[z.toLowerCase()]=M})}function J(N){const M=A(N);return M&&!M.disableAutodetect}function te(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=M=>{N["before:highlightBlock"](Object.assign({block:M.el},M))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=M=>{N["after:highlightBlock"](Object.assign({block:M.el},M))})}function de(N){te(N),r.push(N)}function ce(N){const M=r.indexOf(N);M!==-1&&r.splice(M,1)}function re(N,M){const z=N;r.forEach(function(j){j[z]&&j[z](M)})}function oe(N){return no("10.7.0","highlightBlock will be removed entirely in v12.0"),no("10.7.0","Please use highlightElement now."),g(N)}Object.assign(n,{highlight:u,highlightAuto:h,highlightAll:v,highlightElement:g,highlightBlock:oe,configure:b,initHighlighting:y,initHighlightingOnLoad:k,registerLanguage:C,unregisterLanguage:D,listLanguages:B,getLanguage:A,registerAliases:$,autoDetection:J,inherit:Op,addPlugin:de,removePlugin:ce}),n.debugMode=function(){o=!1},n.safeMode=function(){o=!0},n.versionString=l1,n.regex={concat:Zr,lookahead:ng,either:vd,optional:_N,anyNumberOfTimes:CN};for(const N in Xi)typeof Xi[N]=="object"&&eg(Xi[N]);return Object.assign(n,Xi),n},No=ug({});No.newInstance=()=>ug({});var u1=No;No.HighlightJS=No;No.default=No;var p1=yN(u1);function pg(n,e=[]){return n.map(t=>{const r=[...e,...t.properties?t.properties.className:[]];return t.children?pg(t.children,r):{text:t.value,classes:r}}).flat()}function Ap(n){return n.value||n.children||[]}function f1(n){return!!p1.getLanguage(n)}function Rp({doc:n,name:e,lowlight:t,defaultLanguage:r}){const o=[];return tc(n,i=>i.type.name===e).forEach(i=>{var s;let a=i.pos+1;const c=i.node.attrs.language||r,d=t.listLanguages(),u=c&&(d.includes(c)||f1(c)||!((s=t.registered)===null||s===void 0)&&s.call(t,c))?Ap(t.highlight(c,i.node.textContent)):Ap(t.highlightAuto(i.node.textContent));pg(u).forEach(p=>{const f=a+p.text.length;if(p.classes.length){const h=Ze.inline(a,f,{class:p.classes.join(" ")});o.push(h)}a=f})}),Ne.create(n,o)}function h1(n){return typeof n=="function"}function m1({name:n,lowlight:e,defaultLanguage:t}){if(!["highlight","highlightAuto","listLanguages"].every(o=>h1(e[o])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new Te({key:new $e("lowlight"),state:{init:(o,{doc:i})=>Rp({doc:i,name:n,lowlight:e,defaultLanguage:t}),apply:(o,i,s,a)=>{const c=s.selection.$head.parent.type.name,d=a.selection.$head.parent.type.name,u=tc(s.doc,f=>f.type.name===n),p=tc(a.doc,f=>f.type.name===n);return o.docChanged&&([c,d].includes(n)||p.length!==u.length||o.steps.some(f=>f.from!==void 0&&f.to!==void 0&&u.some(h=>h.pos>=f.from&&h.pos+h.node.nodeSize<=f.to)))?Rp({doc:o.doc,name:n,lowlight:e,defaultLanguage:t}):i.map(o.mapping,o.doc)}},props:{decorations(o){return r.getState(o)}}});return r}const g1=Im.extend({addOptions(){var n;return{...(n=this.parent)===null||n===void 0?void 0:n.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var n;return[...((n=this.parent)===null||n===void 0?void 0:n.call(this))||[],m1({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});function b1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+n.IDENT_RE,relevance:0},h=e.optional(o)+n.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},C=[_,p,a,t,n.C_BLOCK_COMMENT_MODE,u,d],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:C.concat([{begin:/\(/,end:/\)/,keywords:v,contains:C.concat(["self"]),relevance:0}]),relevance:0},B={className:"function",begin:"("+s+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,d,u,a,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,d,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,B,_,C,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:v,contains:["self",a]},{begin:n.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function y1(n){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},t=b1(n),r=t.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,t.name="Arduino",t.aliases=["ino"],t.supersetOf="cpp",t}function v1(n){const e=n.regex,t={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},i=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,o]};o.contains.push(a);const c={match:/\\"/},d={className:"string",begin:/'/,end:/'/},u={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=n.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],b=["true","false"],y={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],E=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],v=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:b,built_in:[...k,...E,"set","shopt",...v,..._]},contains:[h,n.SHEBANG(),m,p,i,s,y,a,c,d,u,t]}}function k1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+n.IDENT_RE,relevance:0},h=e.optional(o)+n.IDENT_RE+"\\s*\\(",b={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[p,a,t,n.C_BLOCK_COMMENT_MODE,u,d],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:y.concat([{begin:/\(/,end:/\)/,keywords:b,contains:y.concat(["self"]),relevance:0}]),relevance:0},E={begin:"("+s+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:b,relevance:0},{begin:h,returnBegin:!0,contains:[n.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,d,u,a,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,d,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:b,disableAutodetect:!0,illegal:"</",contains:[].concat(k,E,y,[p,{begin:n.IDENT_RE+"::",keywords:b},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:p,strings:d,keywords:b}}}function w1(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+n.IDENT_RE,relevance:0},h=e.optional(o)+n.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},C=[_,p,a,t,n.C_BLOCK_COMMENT_MODE,u,d],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:C.concat([{begin:/\(/,end:/\)/,keywords:v,contains:C.concat(["self"]),relevance:0}]),relevance:0},B={className:"function",begin:"("+s+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,d,u,a,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,d,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,B,_,C,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:v,contains:["self",a]},{begin:n.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function E1(n){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:o.concat(i),built_in:e,literal:r},a=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=n.inherit(u,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},h=n.inherit(f,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,h]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},b=n.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});f.contains=[g,m,u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],h.contains=[b,m,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[d,g,m,u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},k={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},E=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",v={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,k,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,k,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,k],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[y,c,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},v]}}const C1=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),_1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],S1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],x1=[..._1,...S1],N1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),T1=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),O1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),M1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function A1(n){const e=n.regex,t=C1(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",i=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+T1.join("|")+")"},{begin:":(:)?("+O1.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+M1.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:N1.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+x1.join("|")+")\\b"}]}}function R1(n){const e=n.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function D1(n){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"string",variants:[n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[n.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}function I1(n){const e=n.regex,t=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[n.HASH_COMMENT_MODE,n.QUOTE_STRING_MODE,n.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(t,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function B1(n){const e=n.regex,t={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:n.NUMBER_RE}]},r=n.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,i,o,s,t,"self"],relevance:0},c=/[A-Za-z0-9_-]+/,d=/"(\\"|[^"])*"/,u=/'[^']*'/,p=e.either(c,d,u),f=e.concat(p,"(\\s*\\.\\s*",p,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[r,a,i,o,s,t]}}]}}var ao="[0-9](_*[0-9])*",Zi=`\\.(${ao})`,Qi="[0-9a-fA-F](_*[0-9a-fA-F])*",Dp={className:"number",variants:[{begin:`(\\b(${ao})((${Zi})|\\.)?|(${Zi}))[eE][+-]?(${ao})[fFdD]?\\b`},{begin:`\\b(${ao})((${Zi})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Zi})[fFdD]?\\b`},{begin:`\\b(${ao})[fFdD]\\b`},{begin:`\\b0[xX]((${Qi})\\.?|(${Qi})?\\.(${Qi}))[pP][+-]?(${ao})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Qi})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function fg(n,e,t){return t===-1?"":n.replace(e,r=>fg(n,e,t-1))}function L1(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+fg("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[u,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[d,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,Dp,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Dp,d]}}const Ip="[A-Za-z$_][0-9A-Za-z$_]*",P1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],$1=["true","false","null","undefined","NaN","Infinity"],hg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],mg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],F1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],z1=[].concat(gg,hg,mg);function V1(n){const e=n.regex,t=(M,{after:z})=>{const j="</"+M[0].slice(1);return M.input.indexOf(j,z)!==-1},r=Ip,o={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const j=M[0].length+M.index,Q=M.input[j];if(Q==="<"||Q===","){z.ignoreMatch();return}Q===">"&&(t(M,{after:j})||z.ignoreMatch());let fe;const Se=M.input.substring(j);if(fe=Se.match(/^\s*=/)){z.ignoreMatch();return}if((fe=Se.match(/^\s+extends\s+/))&&fe.index===0){z.ignoreMatch();return}}},a={$pattern:Ip,keyword:P1,literal:$1,built_in:z1,"variable.language":F1},c="[0-9](_?[0-9])*",d=`\\.(${c})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${u})((${d})|\\.)?|(${d}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},k={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},E=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,m,g,b,{match:/\$\d+/},p];f.contains=E.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(E)});const v=[].concat(k,f.contains),_=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(v)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},B={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...hg,...mg]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(M){return e.concat("(?!",M.join("|"),")")}const de={match:e.concat(/\b/,te([...gg,"super","import"].map(M=>`${M}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},oe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(oe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:B},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,m,g,b,k,{match:/\$\d+/},p,B,{scope:"attr",match:r+e.lookahead(":"),relevance:0},N,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,n.REGEXP_MODE,{className:"function",begin:oe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},de,J,D,re,{match:/\$[(.]/}]}}function H1(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,o,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var lo="[0-9](_*[0-9])*",es=`\\.(${lo})`,ts="[0-9a-fA-F](_*[0-9a-fA-F])*",U1={className:"number",variants:[{begin:`(\\b(${lo})((${es})|\\.)?|(${es}))[eE][+-]?(${lo})[fFdD]?\\b`},{begin:`\\b(${lo})((${es})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${es})[fFdD]?\\b`},{begin:`\\b(${lo})[fFdD]\\b`},{begin:`\\b0[xX]((${ts})\\.?|(${ts})?\\.(${ts}))[pP][+-]?(${lo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ts})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function W1(n){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[n.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+n.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,o]},{begin:"'",end:"'",illegal:/\n/,contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,i,o]}]};o.contains.push(s);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+n.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+n.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[n.inherit(s,{className:"string"}),"self"]}]},d=U1,u=n.COMMENT("/\\*","\\*/",{contains:[n.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:n.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=p;return f.variants[1].contains=[p],p.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),n.C_LINE_COMMENT_MODE,u,t,r,a,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:n.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[n.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,n.C_LINE_COMMENT_MODE,u],relevance:0},n.C_LINE_COMMENT_MODE,u,a,c,s,n.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,n.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},n.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,c]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
118
|
+
`},d]}}const q1=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),K1=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],G1=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],j1=[...K1,...G1],J1=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),bg=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Y1=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),X1=bg.concat(yg).sort().reverse();function Z1(n){const e=q1(n),t=X1,r="and or not only",o="[\\w-]+",i="("+o+"|@\\{"+o+"\\})",s=[],a=[],c=function(E){return{className:"string",begin:"~?"+E+".*?"+E}},d=function(E,v,_){return{className:E,begin:v,relevance:_}},u={$pattern:/[a-z-]+/,keyword:r,attribute:J1.join(" ")},p={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,c("'"),c('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,p,d("variable","@@?"+o,10),d("variable","@\\{"+o+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const f=a.concat({begin:/\{/,end:/\}/,contains:s}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Y1.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},b={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,h,d("keyword","all\\b"),d("variable","@\\{"+o+"\\}"),{begin:"\\b("+j1.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",i,0),d("selector-id","#"+i),d("selector-class","\\."+i,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+bg.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+yg.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},k={begin:o+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[y]};return s.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,g,b,k,m,y,h,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function Q1(n){const e="\\[=*\\[",t="\\]=*\\]",r={begin:e,end:t,contains:["self"]},o=[n.COMMENT("--(?!"+e+")","$"),n.COMMENT("--"+e,t,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:n.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[n.inherit(n.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},n.C_NUMBER_MODE,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{className:"string",begin:e,end:t,contains:[r],relevance:5}])}}function eT(n){const e={className:"variable",variants:[{begin:"\\$\\("+n.UNDERSCORE_IDENT_RE+"\\)",contains:[n.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},t={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,t]},o={begin:"^"+n.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[n.HASH_COMMENT_MODE,e,t,r,o,i,s]}}function tT(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=n.inherit(d,{contains:[]}),f=n.inherit(u,{contains:[]});d.contains.push(f),u.contains.push(p);let h=[t,c];return[d,u,p,f].forEach(y=>{y.contains=y.contains.concat(h)}),h=h.concat(d,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},t,i,d,u,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},o,r,c,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function nT(n){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},t=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[e,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,n.C_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[n.UNDERSCORE_TITLE_MODE]},{begin:"\\."+n.UNDERSCORE_IDENT_RE,relevance:0}]}}function rT(n){const e=n.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:t.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},d={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[n.BACKSLASH_ESCAPE,i,c],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(g,b,y="\\1")=>{const k=y==="\\1"?y:e.concat(y,b);return e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,k,/(?:\\.|[^\\\/])*?/,y,r)},h=(g,b,y)=>e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,y,r),m=[c,n.HASH_COMMENT_MODE,n.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},d,{begin:"(\\/\\/|"+n.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[n.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...p,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...p,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE,a,d]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:m}}function oT(n){const e=n.regex,t=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),o=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),i=e.concat(/[A-Z]+/,t),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},d=n.inherit(n.APOS_STRING_MODE,{illegal:null}),u=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(c)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(ce,re)=>{re.data._beginMatch=ce[1]||ce[2]},"on:end":(ce,re)=>{re.data._beginMatch!==ce[1]&&re.ignoreMatch()}},f=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
|
|
119
|
+
]`,m={scope:"string",variants:[u,d,p,f]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],k=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:y,literal:(ce=>{const re=[];return ce.forEach(oe=>{re.push(oe),oe.toLowerCase()===oe?re.push(oe.toUpperCase()):re.push(oe.toLowerCase())}),re})(b),built_in:k},_=ce=>ce.map(re=>re.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",_(k).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},D=e.concat(r,"\\b(?!\\()"),B={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[o,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},A={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},$={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[A,s,B,n.C_BLOCK_COMMENT_MODE,m,g,C]},J={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",_(y).join("\\b|"),"|",_(k).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[$]};$.contains.push(J);const te=[A,B,n.C_BLOCK_COMMENT_MODE,m,g,C],de={begin:e.concat(/#\[\s*\\?/,e.either(o,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...te]},...te,{scope:"meta",variants:[{match:o},{match:i}]}]};return{case_insensitive:!1,keywords:v,contains:[de,n.HASH_COMMENT_MODE,n.COMMENT("//","$"),n.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:n.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,J,B,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",de,s,B,n.C_BLOCK_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},n.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[n.inherit(n.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},n.UNDERSCORE_TITLE_MODE]},m,g]}}function iT(n){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function sT(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aT(n){const e=n.regex,t=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},p={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c,u,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c,u,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,u,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,u,d]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",h=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${f})[jJ](?=${m})`}]},b={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",c,g,p,n.HASH_COMMENT_MODE]}]};return d.contains=[p,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,b,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,y,p]}]}}function lT(n){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function cT(n){const e=n.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[n.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),n.HASH_COMMENT_MODE,{scope:"string",contains:[n.BACKSLASH_ESCAPE],variants:[n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function dT(n){const e=n.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},d=[n.COMMENT("#","$",{contains:[a]}),n.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},p={className:"string",contains:[n.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[n.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},C=[p,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:s},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,d),relevance:0}].concat(c,d);u.contains=C,g.contains=C;const $=[{begin:/^\s*=>/,starts:{end:"$",contains:C}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:C}}];return d.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat($).concat(d).concat(C)}}function uT(n){const e=n.regex,t=/(r#)?/,r=e.concat(t,n.UNDERSCORE_IDENT_RE),o=e.concat(t,n.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:n.IDENT_RE+"!?",type:u,keyword:a,literal:c,built_in:d},illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.COMMENT("/\\*","\\*/",{contains:["self"]}),n.inherit(n.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:n.IDENT_RE+"::",keywords:{keyword:"Self",built_in:d,type:u}},{className:"punctuation",begin:"->"},i]}}const pT=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),fT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hT=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],mT=[...fT,...hT],gT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),bT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function kT(n){const e=pT(n),t=yT,r=bT,o="@[a-z-]+",i="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+mT.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vT.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:gT.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function wT(n){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ET(n){const e=n.regex,t=n.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=u,m=[...d,...c].filter(_=>!u.includes(_)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},b={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:e.concat(/\b/,e.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function k(_){return e.concat(/\b/,e.either(..._.map(C=>C.replace(/\s+/,"\\s+"))),/\b/)}const E={scope:"keyword",match:k(f),relevance:0};function v(_,{exceptions:C,when:D}={}){const B=D;return C=C||[],_.map(A=>A.match(/\|\d+$/)||C.includes(A)?A:B(A)?`${A}|0`:A)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:v(m,{when:_=>_.length<3}),literal:i,type:a,built_in:p},contains:[{scope:"type",match:k(s)},E,y,g,r,o,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,b]}}function vg(n){return n?typeof n=="string"?n:n.source:null}function $o(n){return Ie("(?=",n,")")}function Ie(...n){return n.map(t=>vg(t)).join("")}function CT(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function Mt(...n){return"("+(CT(n).capture?"":"?:")+n.map(r=>vg(r)).join("|")+")"}const Ed=n=>Ie(/\b/,n,/\w$/.test(n)?/\b/:/\B/),_T=["Protocol","Type"].map(Ed),Bp=["init","self"].map(Ed),ST=["Any","Self"],El=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Lp=["false","nil","true"],xT=["assignment","associativity","higherThan","left","lowerThan","none","right"],NT=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Pp=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],kg=Mt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),wg=Mt(kg,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Cl=Ie(kg,wg,"*"),Eg=Mt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Gs=Mt(Eg,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Cn=Ie(Eg,Gs,"*"),ns=Ie(/[A-Z]/,Gs,"*"),TT=["attached","autoclosure",Ie(/convention\(/,Mt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ie(/objc\(/,Cn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],OT=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function MT(n){const e={match:/\s+/,relevance:0},t=n.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[n.C_LINE_COMMENT_MODE,t],o={match:[/\./,Mt(..._T,...Bp)],className:{2:"keyword"}},i={match:Ie(/\./,Mt(...El)),relevance:0},s=El.filter(le=>typeof le=="string").concat(["_|0"]),a=El.filter(le=>typeof le!="string").concat(ST).map(Ed),c={variants:[{className:"keyword",match:Mt(...a,...Bp)}]},d={$pattern:Mt(/\b\w+/,/#\w+/),keyword:s.concat(NT),literal:Lp},u=[o,i,c],p={match:Ie(/\./,Mt(...Pp)),relevance:0},f={className:"built_in",match:Ie(/\b/,Mt(...Pp),/(?=\()/)},h=[p,f],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:Cl},{match:`\\.(\\.|${wg})+`}]},b=[m,g],y="([0-9]_*)+",k="([0-9a-fA-F]_*)+",E={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${k})(\\.(${k}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},v=(le="")=>({className:"subst",variants:[{match:Ie(/\\/,le,/[0\\tnr"']/)},{match:Ie(/\\/,le,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(le="")=>({className:"subst",match:Ie(/\\/,le,/[\t ]*(?:[\r\n]|\r\n)/)}),C=(le="")=>({className:"subst",label:"interpol",begin:Ie(/\\/,le,/\(/),end:/\)/}),D=(le="")=>({begin:Ie(le,/"""/),end:Ie(/"""/,le),contains:[v(le),_(le),C(le)]}),B=(le="")=>({begin:Ie(le,/"/),end:Ie(/"/,le),contains:[v(le),C(le)]}),A={className:"string",variants:[D(),D("#"),D("##"),D("###"),B(),B("#"),B("##"),B("###")]},$=[n.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[n.BACKSLASH_ESCAPE]}],J={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:$},te=le=>{const Lt=Ie(le,/\//),vt=Ie(/\//,le);return{begin:Lt,end:vt,contains:[...$,{scope:"comment",begin:`#(?!.*${vt})`,end:/$/}]}},de={scope:"regexp",variants:[te("###"),te("##"),te("#"),J]},ce={match:Ie(/`/,Cn,/`/)},re={className:"variable",match:/\$\d+/},oe={className:"variable",match:`\\$${Gs}+`},N=[ce,re,oe],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:OT,contains:[...b,E,A]}]}},z={scope:"keyword",match:Ie(/@/,Mt(...TT),$o(Mt(/\(/,/\s+/)))},j={scope:"meta",match:Ie(/@/,Cn)},Q=[M,z,j],fe={match:$o(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ie(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Gs,"+")},{className:"type",match:ns,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ie(/\s+&\s+/,$o(ns)),relevance:0}]},Se={begin:/</,end:/>/,keywords:d,contains:[...r,...u,...Q,m,fe]};fe.contains.push(Se);const rt={match:Ie(Cn,/\s*:/),keywords:"_|0",relevance:0},xe={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",rt,...r,de,...u,...h,...b,E,A,...N,...Q,fe]},Fe={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,fe]},Ht={begin:Mt($o(Ie(Cn,/\s*:/)),$o(Ie(Cn,/\s+/,Cn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Cn}]},dt={begin:/\(/,end:/\)/,keywords:d,contains:[Ht,...r,...u,...b,E,A,...Q,fe,xe],endsParent:!0,illegal:/["']/},Qt={match:[/(func|macro)/,/\s+/,Mt(ce.match,Cn,Cl)],className:{1:"keyword",3:"title.function"},contains:[Fe,dt,e],illegal:[/\[/,/%/]},ut={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Fe,dt,e],illegal:/\[|%/},en={match:[/operator/,/\s+/,Cl],className:{1:"keyword",3:"title"}},kn={begin:[/precedencegroup/,/\s+/,ns],className:{1:"keyword",3:"title"},contains:[fe],keywords:[...xT,...Lp],end:/}/},pn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ut={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},fn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Cn,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:d,contains:[Fe,...u,{begin:/:/,end:/\{/,keywords:d,contains:[{scope:"title.class.inherited",match:ns},...u],relevance:0}]};for(const le of A.variants){const Lt=le.contains.find(Z=>Z.label==="interpol");Lt.keywords=d;const vt=[...u,...h,...b,E,A,...N];Lt.contains=[...vt,{begin:/\(/,end:/\)/,contains:["self",...vt]}]}return{name:"Swift",keywords:d,contains:[...r,Qt,ut,pn,Ut,fn,en,kn,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},de,...u,...h,...b,E,A,...N,...Q,fe,xe]}}const js="[A-Za-z$_][0-9A-Za-z$_]*",Cg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],_g=["true","false","null","undefined","NaN","Infinity"],Sg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ng=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Tg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Og=[].concat(Ng,Sg,xg);function AT(n){const e=n.regex,t=(M,{after:z})=>{const j="</"+M[0].slice(1);return M.input.indexOf(j,z)!==-1},r=js,o={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,z)=>{const j=M[0].length+M.index,Q=M.input[j];if(Q==="<"||Q===","){z.ignoreMatch();return}Q===">"&&(t(M,{after:j})||z.ignoreMatch());let fe;const Se=M.input.substring(j);if(fe=Se.match(/^\s*=/)){z.ignoreMatch();return}if((fe=Se.match(/^\s+extends\s+/))&&fe.index===0){z.ignoreMatch();return}}},a={$pattern:js,keyword:Cg,literal:_g,built_in:Og,"variable.language":Tg},c="[0-9](_?[0-9])*",d=`\\.(${c})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${u})((${d})|\\.)?|(${d}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},k={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},E=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,m,g,b,{match:/\$\d+/},p];f.contains=E.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(E)});const v=[].concat(k,f.contains),_=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(v)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},B={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Sg,...xg]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(M){return e.concat("(?!",M.join("|"),")")}const de={match:e.concat(/\b/,te([...Ng,"super","import"].map(M=>`${M}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},oe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",N={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(oe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:B},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,m,g,b,k,{match:/\$\d+/},p,B,{scope:"attr",match:r+e.lookahead(":"),relevance:0},N,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,n.REGEXP_MODE,{className:"function",begin:oe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},de,J,D,re,{match:/\$[(.]/}]}}function RT(n){const e=n.regex,t=AT(n),r=js,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[t.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:js,keyword:Cg.concat(c),literal:_g,built_in:Og.concat(o),"variable.language":Tg},u={className:"meta",begin:"@"+r},p=(g,b,y)=>{const k=g.contains.findIndex(E=>E.label===b);if(k===-1)throw new Error("can not find mode to replace");g.contains.splice(k,1,y)};Object.assign(t.keywords,d),t.exports.PARAMS_CONTAINS.push(u);const f=t.contains.find(g=>g.scope==="attr"),h=Object.assign({},f,{match:e.concat(r,e.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,f,h]),t.contains=t.contains.concat([u,i,s,h]),p(t,"shebang",n.SHEBANG()),p(t,"use_strict",a);const m=t.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function DT(n){const e=n.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:e.concat(/# */,e.either(i,o),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(i,o),/ +/,e.either(s,a),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},p=n.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=n.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,r,c,d,u,p,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function IT(n){n.regex;const e=n.COMMENT(/\(;/,/;\)/);e.contains.push("self");const t=n.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[t,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,s,o,n.QUOTE_STRING_MODE,c,d,a]}}function BT(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=n.inherit(i,{begin:/\(/,end:/\)/}),a=n.inherit(n.APOS_STRING_MODE,{className:"string"}),c=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,s,c,a]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function LT(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,o]},a=n.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},b=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},f,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},m,g,i,s],y=[...b];return y.pop(),y.push(a),h.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}const PT={arduino:y1,bash:v1,c:k1,cpp:w1,csharp:E1,css:A1,diff:R1,go:D1,graphql:I1,ini:B1,java:L1,javascript:V1,json:H1,kotlin:W1,less:Z1,lua:Q1,makefile:eT,markdown:tT,objectivec:nT,perl:rT,php:oT,"php-template":iT,plaintext:sT,python:aT,"python-repl":lT,r:cT,ruby:dT,rust:uT,scss:kT,shell:wT,sql:ET,swift:MT,typescript:RT,vbnet:DT,wasm:IT,xml:BT,yaml:LT};function $T(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _l,$p;function FT(){if($p)return _l;$p=1;function n(w){return w instanceof Map?w.clear=w.delete=w.set=function(){throw new Error("map is read-only")}:w instanceof Set&&(w.add=w.clear=w.delete=function(){throw new Error("set is read-only")}),Object.freeze(w),Object.getOwnPropertyNames(w).forEach(T=>{const P=w[T],se=typeof P;(se==="object"||se==="function")&&!Object.isFrozen(P)&&n(P)}),w}class e{constructor(T){T.data===void 0&&(T.data={}),this.data=T.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(w){return w.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(w,...T){const P=Object.create(null);for(const se in w)P[se]=w[se];return T.forEach(function(se){for(const Ue in se)P[Ue]=se[Ue]}),P}const o="</span>",i=w=>!!w.scope,s=(w,{prefix:T})=>{if(w.startsWith("language:"))return w.replace("language:","language-");if(w.includes(".")){const P=w.split(".");return[`${T}${P.shift()}`,...P.map((se,Ue)=>`${se}${"_".repeat(Ue+1)}`)].join(" ")}return`${T}${w}`};class a{constructor(T,P){this.buffer="",this.classPrefix=P.classPrefix,T.walk(this)}addText(T){this.buffer+=t(T)}openNode(T){if(!i(T))return;const P=s(T.scope,{prefix:this.classPrefix});this.span(P)}closeNode(T){i(T)&&(this.buffer+=o)}value(){return this.buffer}span(T){this.buffer+=`<span class="${T}">`}}const c=(w={})=>{const T={children:[]};return Object.assign(T,w),T};class d{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(T){this.top.children.push(T)}openNode(T){const P=c({scope:T});this.add(P),this.stack.push(P)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(T){return this.constructor._walk(T,this.rootNode)}static _walk(T,P){return typeof P=="string"?T.addText(P):P.children&&(T.openNode(P),P.children.forEach(se=>this._walk(T,se)),T.closeNode(P)),T}static _collapse(T){typeof T!="string"&&T.children&&(T.children.every(P=>typeof P=="string")?T.children=[T.children.join("")]:T.children.forEach(P=>{d._collapse(P)}))}}class u extends d{constructor(T){super(),this.options=T}addText(T){T!==""&&this.add(T)}startScope(T){this.openNode(T)}endScope(){this.closeNode()}__addSublanguage(T,P){const se=T.root;P&&(se.scope=`language:${P}`),this.add(se)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(w){return w?typeof w=="string"?w:w.source:null}function f(w){return g("(?=",w,")")}function h(w){return g("(?:",w,")*")}function m(w){return g("(?:",w,")?")}function g(...w){return w.map(P=>p(P)).join("")}function b(w){const T=w[w.length-1];return typeof T=="object"&&T.constructor===Object?(w.splice(w.length-1,1),T):{}}function y(...w){return"("+(b(w).capture?"":"?:")+w.map(se=>p(se)).join("|")+")"}function k(w){return new RegExp(w.toString()+"|").exec("").length-1}function E(w,T){const P=w&&w.exec(T);return P&&P.index===0}const v=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function _(w,{joinWith:T}){let P=0;return w.map(se=>{P+=1;const Ue=P;let ze=p(se),q="";for(;ze.length>0;){const H=v.exec(ze);if(!H){q+=ze;break}q+=ze.substring(0,H.index),ze=ze.substring(H.index+H[0].length),H[0][0]==="\\"&&H[1]?q+="\\"+String(Number(H[1])+Ue):(q+=H[0],H[0]==="("&&P++)}return q}).map(se=>`(${se})`).join(T)}const C=/\b\B/,D="[a-zA-Z]\\w*",B="[a-zA-Z_]\\w*",A="\\b\\d+(\\.\\d+)?",$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",J="\\b(0b[01]+)",te="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",de=(w={})=>{const T=/^#![ ]*\//;return w.binary&&(w.begin=g(T,/.*\b/,w.binary,/\b.*/)),r({scope:"meta",begin:T,end:/$/,relevance:0,"on:begin":(P,se)=>{P.index!==0&&se.ignoreMatch()}},w)},ce={begin:"\\\\[\\s\\S]",relevance:0},re={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ce]},oe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ce]},N={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},M=function(w,T,P={}){const se=r({scope:"comment",begin:w,end:T,contains:[]},P);se.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ue=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return se.contains.push({begin:g(/[ ]+/,"(",Ue,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),se},z=M("//","$"),j=M("/\\*","\\*/"),Q=M("#","$"),fe={scope:"number",begin:A,relevance:0},Se={scope:"number",begin:$,relevance:0},rt={scope:"number",begin:J,relevance:0},xe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ce,{begin:/\[/,end:/\]/,relevance:0,contains:[ce]}]},Fe={scope:"title",begin:D,relevance:0},Ht={scope:"title",begin:B,relevance:0},dt={begin:"\\.\\s*"+B,relevance:0};var ut=Object.freeze({__proto__:null,APOS_STRING_MODE:re,BACKSLASH_ESCAPE:ce,BINARY_NUMBER_MODE:rt,BINARY_NUMBER_RE:J,COMMENT:M,C_BLOCK_COMMENT_MODE:j,C_LINE_COMMENT_MODE:z,C_NUMBER_MODE:Se,C_NUMBER_RE:$,END_SAME_AS_BEGIN:function(w){return Object.assign(w,{"on:begin":(T,P)=>{P.data._beginMatch=T[1]},"on:end":(T,P)=>{P.data._beginMatch!==T[1]&&P.ignoreMatch()}})},HASH_COMMENT_MODE:Q,IDENT_RE:D,MATCH_NOTHING_RE:C,METHOD_GUARD:dt,NUMBER_MODE:fe,NUMBER_RE:A,PHRASAL_WORDS_MODE:N,QUOTE_STRING_MODE:oe,REGEXP_MODE:xe,RE_STARTERS_RE:te,SHEBANG:de,TITLE_MODE:Fe,UNDERSCORE_IDENT_RE:B,UNDERSCORE_TITLE_MODE:Ht});function en(w,T){w.input[w.index-1]==="."&&T.ignoreMatch()}function kn(w,T){w.className!==void 0&&(w.scope=w.className,delete w.className)}function pn(w,T){T&&w.beginKeywords&&(w.begin="\\b("+w.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",w.__beforeBegin=en,w.keywords=w.keywords||w.beginKeywords,delete w.beginKeywords,w.relevance===void 0&&(w.relevance=0))}function Ut(w,T){Array.isArray(w.illegal)&&(w.illegal=y(...w.illegal))}function fn(w,T){if(w.match){if(w.begin||w.end)throw new Error("begin & end are not supported with match");w.begin=w.match,delete w.match}}function le(w,T){w.relevance===void 0&&(w.relevance=1)}const Lt=(w,T)=>{if(!w.beforeMatch)return;if(w.starts)throw new Error("beforeMatch cannot be used with starts");const P=Object.assign({},w);Object.keys(w).forEach(se=>{delete w[se]}),w.keywords=P.keywords,w.begin=g(P.beforeMatch,f(P.begin)),w.starts={relevance:0,contains:[Object.assign(P,{endsParent:!0})]},w.relevance=0,delete P.beforeMatch},vt=["of","and","for","in","not","or","if","then","parent","list","value"],Z="keyword";function xt(w,T,P=Z){const se=Object.create(null);return typeof w=="string"?Ue(P,w.split(" ")):Array.isArray(w)?Ue(P,w):Object.keys(w).forEach(function(ze){Object.assign(se,xt(w[ze],T,ze))}),se;function Ue(ze,q){T&&(q=q.map(H=>H.toLowerCase())),q.forEach(function(H){const ae=H.split("|");se[ae[0]]=[ze,Re(ae[0],ae[1])]})}}function Re(w,T){return T?Number(T):ke(w)?0:1}function ke(w){return vt.includes(w.toLowerCase())}const Nt={},Xe=w=>{console.error(w)},hn=(w,...T)=>{console.log(`WARN: ${w}`,...T)},Tt=(w,T)=>{Nt[`${w}/${T}`]||(console.log(`Deprecated as of ${w}. ${T}`),Nt[`${w}/${T}`]=!0)},L=new Error;function V(w,T,{key:P}){let se=0;const Ue=w[P],ze={},q={};for(let H=1;H<=T.length;H++)q[H+se]=Ue[H],ze[H+se]=!0,se+=k(T[H-1]);w[P]=q,w[P]._emit=ze,w[P]._multi=!0}function ue(w){if(Array.isArray(w.begin)){if(w.skip||w.excludeBegin||w.returnBegin)throw Xe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),L;if(typeof w.beginScope!="object"||w.beginScope===null)throw Xe("beginScope must be object"),L;V(w,w.begin,{key:"beginScope"}),w.begin=_(w.begin,{joinWith:""})}}function we(w){if(Array.isArray(w.end)){if(w.skip||w.excludeEnd||w.returnEnd)throw Xe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),L;if(typeof w.endScope!="object"||w.endScope===null)throw Xe("endScope must be object"),L;V(w,w.end,{key:"endScope"}),w.end=_(w.end,{joinWith:""})}}function Qe(w){w.scope&&typeof w.scope=="object"&&w.scope!==null&&(w.beginScope=w.scope,delete w.scope)}function Wt(w){Qe(w),typeof w.beginScope=="string"&&(w.beginScope={_wrap:w.beginScope}),typeof w.endScope=="string"&&(w.endScope={_wrap:w.endScope}),ue(w),we(w)}function Do(w){function T(q,H){return new RegExp(p(q),"m"+(w.case_insensitive?"i":"")+(w.unicodeRegex?"u":"")+(H?"g":""))}class P{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(H,ae){ae.position=this.position++,this.matchIndexes[this.matchAt]=ae,this.regexes.push([ae,H]),this.matchAt+=k(H)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const H=this.regexes.map(ae=>ae[1]);this.matcherRe=T(_(H,{joinWith:"|"}),!0),this.lastIndex=0}exec(H){this.matcherRe.lastIndex=this.lastIndex;const ae=this.matcherRe.exec(H);if(!ae)return null;const it=ae.findIndex((Bo,Va)=>Va>0&&Bo!==void 0),et=this.matchIndexes[it];return ae.splice(0,it),Object.assign(ae,et)}}class se{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(H){if(this.multiRegexes[H])return this.multiRegexes[H];const ae=new P;return this.rules.slice(H).forEach(([it,et])=>ae.addRule(it,et)),ae.compile(),this.multiRegexes[H]=ae,ae}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(H,ae){this.rules.push([H,ae]),ae.type==="begin"&&this.count++}exec(H){const ae=this.getMatcher(this.regexIndex);ae.lastIndex=this.lastIndex;let it=ae.exec(H);if(this.resumingScanAtSamePosition()&&!(it&&it.index===this.lastIndex)){const et=this.getMatcher(0);et.lastIndex=this.lastIndex+1,it=et.exec(H)}return it&&(this.regexIndex+=it.position+1,this.regexIndex===this.count&&this.considerAll()),it}}function Ue(q){const H=new se;return q.contains.forEach(ae=>H.addRule(ae.begin,{rule:ae,type:"begin"})),q.terminatorEnd&&H.addRule(q.terminatorEnd,{type:"end"}),q.illegal&&H.addRule(q.illegal,{type:"illegal"}),H}function ze(q,H){const ae=q;if(q.isCompiled)return ae;[kn,fn,Wt,Lt].forEach(et=>et(q,H)),w.compilerExtensions.forEach(et=>et(q,H)),q.__beforeBegin=null,[pn,Ut,le].forEach(et=>et(q,H)),q.isCompiled=!0;let it=null;return typeof q.keywords=="object"&&q.keywords.$pattern&&(q.keywords=Object.assign({},q.keywords),it=q.keywords.$pattern,delete q.keywords.$pattern),it=it||/\w+/,q.keywords&&(q.keywords=xt(q.keywords,w.case_insensitive)),ae.keywordPatternRe=T(it,!0),H&&(q.begin||(q.begin=/\B|\b/),ae.beginRe=T(ae.begin),!q.end&&!q.endsWithParent&&(q.end=/\B|\b/),q.end&&(ae.endRe=T(ae.end)),ae.terminatorEnd=p(ae.end)||"",q.endsWithParent&&H.terminatorEnd&&(ae.terminatorEnd+=(q.end?"|":"")+H.terminatorEnd)),q.illegal&&(ae.illegalRe=T(q.illegal)),q.contains||(q.contains=[]),q.contains=[].concat(...q.contains.map(function(et){return W(et==="self"?q:et)})),q.contains.forEach(function(et){ze(et,ae)}),q.starts&&ze(q.starts,H),ae.matcher=Ue(ae),ae}if(w.compilerExtensions||(w.compilerExtensions=[]),w.contains&&w.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return w.classNameAliases=r(w.classNameAliases||{}),ze(w)}function x(w){return w?w.endsWithParent||x(w.starts):!1}function W(w){return w.variants&&!w.cachedVariants&&(w.cachedVariants=w.variants.map(function(T){return r(w,{variants:null},T)})),w.cachedVariants?w.cachedVariants:x(w)?r(w,{starts:w.starts?r(w.starts):null}):Object.isFrozen(w)?r(w):w}var ne="11.11.1";class Ce extends Error{constructor(T,P){super(T),this.name="HTMLInjectionError",this.html=P}}const be=t,ot=r,Ot=Symbol("nomatch"),Zn=7,Io=function(w){const T=Object.create(null),P=Object.create(null),se=[];let Ue=!0;const ze="Could not find the language '{}', did you forget to load/include a language module?",q={disableAutodetect:!0,name:"Plain text",contains:[]};let H={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function ae(I){return H.noHighlightRe.test(I)}function it(I){let X=I.className+" ";X+=I.parentNode?I.parentNode.className:"";const ye=H.languageDetectRe.exec(X);if(ye){const Ve=Qn(ye[1]);return Ve||(hn(ze.replace("{}",ye[1])),hn("Falling back to no-highlight mode for this block.",I)),Ve?ye[1]:"no-highlight"}return X.split(/\s+/).find(Ve=>ae(Ve)||Qn(Ve))}function et(I,X,ye){let Ve="",nt="";typeof X=="object"?(Ve=I,ye=X.ignoreIllegals,nt=X.language):(Tt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Tt("10.7.0",`Please use highlight(code, options) instead.
|
|
120
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),nt=I,Ve=X),ye===void 0&&(ye=!0);const mn={code:Ve,language:nt};$i("before:highlight",mn);const er=mn.result?mn.result:Bo(mn.language,mn.code,ye);return er.code=mn.code,$i("after:highlight",er),er}function Bo(I,X,ye,Ve){const nt=Object.create(null);function mn(F,K){return F.keywords[K]}function er(){if(!pe.keywords){pt.addText(He);return}let F=0;pe.keywordPatternRe.lastIndex=0;let K=pe.keywordPatternRe.exec(He),ge="";for(;K;){ge+=He.substring(F,K.index);const Oe=En.case_insensitive?K[0].toLowerCase():K[0],kt=mn(pe,Oe);if(kt){const[Pn,vb]=kt;if(pt.addText(ge),ge="",nt[Oe]=(nt[Oe]||0)+1,nt[Oe]<=Zn&&(Vi+=vb),Pn.startsWith("_"))ge+=K[0];else{const kb=En.classNameAliases[Pn]||Pn;wn(K[0],kb)}}else ge+=K[0];F=pe.keywordPatternRe.lastIndex,K=pe.keywordPatternRe.exec(He)}ge+=He.substring(F),pt.addText(ge)}function Fi(){if(He==="")return;let F=null;if(typeof pe.subLanguage=="string"){if(!T[pe.subLanguage]){pt.addText(He);return}F=Bo(pe.subLanguage,He,!0,zd[pe.subLanguage]),zd[pe.subLanguage]=F._top}else F=Ha(He,pe.subLanguage.length?pe.subLanguage:null);pe.relevance>0&&(Vi+=F.relevance),pt.__addSublanguage(F._emitter,F.language)}function qt(){pe.subLanguage!=null?Fi():er(),He=""}function wn(F,K){F!==""&&(pt.startScope(K),pt.addText(F),pt.endScope())}function Ld(F,K){let ge=1;const Oe=K.length-1;for(;ge<=Oe;){if(!F._emit[ge]){ge++;continue}const kt=En.classNameAliases[F[ge]]||F[ge],Pn=K[ge];kt?wn(Pn,kt):(He=Pn,er(),He=""),ge++}}function Pd(F,K){return F.scope&&typeof F.scope=="string"&&pt.openNode(En.classNameAliases[F.scope]||F.scope),F.beginScope&&(F.beginScope._wrap?(wn(He,En.classNameAliases[F.beginScope._wrap]||F.beginScope._wrap),He=""):F.beginScope._multi&&(Ld(F.beginScope,K),He="")),pe=Object.create(F,{parent:{value:pe}}),pe}function $d(F,K,ge){let Oe=E(F.endRe,ge);if(Oe){if(F["on:end"]){const kt=new e(F);F["on:end"](K,kt),kt.isMatchIgnored&&(Oe=!1)}if(Oe){for(;F.endsParent&&F.parent;)F=F.parent;return F}}if(F.endsWithParent)return $d(F.parent,K,ge)}function hb(F){return pe.matcher.regexIndex===0?(He+=F[0],1):(Ka=!0,0)}function mb(F){const K=F[0],ge=F.rule,Oe=new e(ge),kt=[ge.__beforeBegin,ge["on:begin"]];for(const Pn of kt)if(Pn&&(Pn(F,Oe),Oe.isMatchIgnored))return hb(K);return ge.skip?He+=K:(ge.excludeBegin&&(He+=K),qt(),!ge.returnBegin&&!ge.excludeBegin&&(He=K)),Pd(ge,F),ge.returnBegin?0:K.length}function gb(F){const K=F[0],ge=X.substring(F.index),Oe=$d(pe,F,ge);if(!Oe)return Ot;const kt=pe;pe.endScope&&pe.endScope._wrap?(qt(),wn(K,pe.endScope._wrap)):pe.endScope&&pe.endScope._multi?(qt(),Ld(pe.endScope,F)):kt.skip?He+=K:(kt.returnEnd||kt.excludeEnd||(He+=K),qt(),kt.excludeEnd&&(He=K));do pe.scope&&pt.closeNode(),!pe.skip&&!pe.subLanguage&&(Vi+=pe.relevance),pe=pe.parent;while(pe!==Oe.parent);return Oe.starts&&Pd(Oe.starts,F),kt.returnEnd?0:K.length}function bb(){const F=[];for(let K=pe;K!==En;K=K.parent)K.scope&&F.unshift(K.scope);F.forEach(K=>pt.openNode(K))}let zi={};function Fd(F,K){const ge=K&&K[0];if(He+=F,ge==null)return qt(),0;if(zi.type==="begin"&&K.type==="end"&&zi.index===K.index&&ge===""){if(He+=X.slice(K.index,K.index+1),!Ue){const Oe=new Error(`0 width match regex (${I})`);throw Oe.languageName=I,Oe.badRule=zi.rule,Oe}return 1}if(zi=K,K.type==="begin")return mb(K);if(K.type==="illegal"&&!ye){const Oe=new Error('Illegal lexeme "'+ge+'" for mode "'+(pe.scope||"<unnamed>")+'"');throw Oe.mode=pe,Oe}else if(K.type==="end"){const Oe=gb(K);if(Oe!==Ot)return Oe}if(K.type==="illegal"&&ge==="")return He+=`
|
|
121
|
+
`,1;if(qa>1e5&&qa>K.index*3)throw new Error("potential infinite loop, way more iterations than matches");return He+=ge,ge.length}const En=Qn(I);if(!En)throw Xe(ze.replace("{}",I)),new Error('Unknown language: "'+I+'"');const yb=Do(En);let Wa="",pe=Ve||yb;const zd={},pt=new H.__emitter(H);bb();let He="",Vi=0,Sr=0,qa=0,Ka=!1;try{if(En.__emitTokens)En.__emitTokens(X,pt);else{for(pe.matcher.considerAll();;){qa++,Ka?Ka=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=Sr;const F=pe.matcher.exec(X);if(!F)break;const K=X.substring(Sr,F.index),ge=Fd(K,F);Sr=F.index+ge}Fd(X.substring(Sr))}return pt.finalize(),Wa=pt.toHTML(),{language:I,value:Wa,relevance:Vi,illegal:!1,_emitter:pt,_top:pe}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:I,value:be(X),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:Sr,context:X.slice(Sr-100,Sr+100),mode:F.mode,resultSoFar:Wa},_emitter:pt};if(Ue)return{language:I,value:be(X),illegal:!1,relevance:0,errorRaised:F,_emitter:pt,_top:pe};throw F}}function Va(I){const X={value:be(I),illegal:!1,relevance:0,_top:q,_emitter:new H.__emitter(H)};return X._emitter.addText(I),X}function Ha(I,X){X=X||H.languages||Object.keys(T);const ye=Va(I),Ve=X.filter(Qn).filter(Bd).map(qt=>Bo(qt,I,!1));Ve.unshift(ye);const nt=Ve.sort((qt,wn)=>{if(qt.relevance!==wn.relevance)return wn.relevance-qt.relevance;if(qt.language&&wn.language){if(Qn(qt.language).supersetOf===wn.language)return 1;if(Qn(wn.language).supersetOf===qt.language)return-1}return 0}),[mn,er]=nt,Fi=mn;return Fi.secondBest=er,Fi}function rb(I,X,ye){const Ve=X&&P[X]||ye;I.classList.add("hljs"),I.classList.add(`language-${Ve}`)}function Ua(I){let X=null;const ye=it(I);if(ae(ye))return;if($i("before:highlightElement",{el:I,language:ye}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0&&(H.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(I)),H.throwUnescapedHTML))throw new Ce("One of your code blocks includes unescaped HTML.",I.innerHTML);X=I;const Ve=X.textContent,nt=ye?et(Ve,{language:ye,ignoreIllegals:!0}):Ha(Ve);I.innerHTML=nt.value,I.dataset.highlighted="yes",rb(I,ye,nt.language),I.result={language:nt.language,re:nt.relevance,relevance:nt.relevance},nt.secondBest&&(I.secondBest={language:nt.secondBest.language,relevance:nt.secondBest.relevance}),$i("after:highlightElement",{el:I,result:nt,text:Ve})}function ob(I){H=ot(H,I)}const ib=()=>{Pi(),Tt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function sb(){Pi(),Tt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Dd=!1;function Pi(){function I(){Pi()}if(document.readyState==="loading"){Dd||window.addEventListener("DOMContentLoaded",I,!1),Dd=!0;return}document.querySelectorAll(H.cssSelector).forEach(Ua)}function ab(I,X){let ye=null;try{ye=X(w)}catch(Ve){if(Xe("Language definition for '{}' could not be registered.".replace("{}",I)),Ue)Xe(Ve);else throw Ve;ye=q}ye.name||(ye.name=I),T[I]=ye,ye.rawDefinition=X.bind(null,w),ye.aliases&&Id(ye.aliases,{languageName:I})}function lb(I){delete T[I];for(const X of Object.keys(P))P[X]===I&&delete P[X]}function cb(){return Object.keys(T)}function Qn(I){return I=(I||"").toLowerCase(),T[I]||T[P[I]]}function Id(I,{languageName:X}){typeof I=="string"&&(I=[I]),I.forEach(ye=>{P[ye.toLowerCase()]=X})}function Bd(I){const X=Qn(I);return X&&!X.disableAutodetect}function db(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=X=>{I["before:highlightBlock"](Object.assign({block:X.el},X))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=X=>{I["after:highlightBlock"](Object.assign({block:X.el},X))})}function ub(I){db(I),se.push(I)}function pb(I){const X=se.indexOf(I);X!==-1&&se.splice(X,1)}function $i(I,X){const ye=I;se.forEach(function(Ve){Ve[ye]&&Ve[ye](X)})}function fb(I){return Tt("10.7.0","highlightBlock will be removed entirely in v12.0"),Tt("10.7.0","Please use highlightElement now."),Ua(I)}Object.assign(w,{highlight:et,highlightAuto:Ha,highlightAll:Pi,highlightElement:Ua,highlightBlock:fb,configure:ob,initHighlighting:ib,initHighlightingOnLoad:sb,registerLanguage:ab,unregisterLanguage:lb,listLanguages:cb,getLanguage:Qn,registerAliases:Id,autoDetection:Bd,inherit:ot,addPlugin:ub,removePlugin:pb}),w.debugMode=function(){Ue=!1},w.safeMode=function(){Ue=!0},w.versionString=ne,w.regex={concat:g,lookahead:f,either:y,optional:m,anyNumberOfTimes:h};for(const I in ut)typeof ut[I]=="object"&&n(ut[I]);return Object.assign(w,ut),w},Pt=Io({});return Pt.newInstance=()=>Io({}),_l=Pt,Pt.HighlightJS=Pt,Pt.default=Pt,_l}var zT=FT();const VT=$T(zT),Fp={},HT="hljs-";function UT(n){const e=VT.newInstance();return n&&i(n),{highlight:t,highlightAuto:r,listLanguages:o,register:i,registerAlias:s,registered:a};function t(c,d,u){const p=u||Fp,f=typeof p.prefix=="string"?p.prefix:HT;if(!e.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");e.configure({__emitter:WT,classPrefix:f});const h=e.highlight(d,{ignoreIllegals:!0,language:c});if(h.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:h.errorRaised});const m=h._emitter.root,g=m.data;return g.language=h.language,g.relevance=h.relevance,m}function r(c,d){const p=(d||Fp).subset||o();let f=-1,h=0,m;for(;++f<p.length;){const g=p[f];if(!e.getLanguage(g))continue;const b=t(g,c,d);b.data&&b.data.relevance!==void 0&&b.data.relevance>h&&(h=b.data.relevance,m=b)}return m||{type:"root",children:[],data:{language:void 0,relevance:h}}}function o(){return e.listLanguages()}function i(c,d){if(typeof c=="string")e.registerLanguage(c,d);else{let u;for(u in c)Object.hasOwn(c,u)&&e.registerLanguage(u,c[u])}}function s(c,d){if(typeof c=="string")e.registerAliases(typeof d=="string"?d:[...d],{languageName:c});else{let u;for(u in c)if(Object.hasOwn(c,u)){const p=c[u];e.registerAliases(typeof p=="string"?p:[...p],{languageName:u})}}}function a(c){return!!e.getLanguage(c)}}class WT{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const t=this.stack[this.stack.length-1],r=t.children[t.children.length-1];r&&r.type==="text"?r.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const r=this.stack[this.stack.length-1],o=e.root.children;t?r.children.push({type:"element",tagName:"span",properties:{className:[t]},children:o}):r.children.push(...o)}openNode(e){const t=this,r=e.split(".").map(function(s,a){return a?s+"_".repeat(a):t.options.classPrefix+s}),o=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};o.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}function qT(n){const e=document.createElement("textarea");e.value=n,e.contentEditable="true",e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();const t=document.execCommand("copy");return e.remove(),t}function KT(n){return navigator.clipboard!==void 0?navigator.clipboard.writeText(n):new Promise((e,t)=>{const r=qT(n);r?e(!0):t(r)})}const GT={class:"code-block-toolbar"},jT={class:"wrap editable"},JT={class:"wrap"},YT={class:"language readonly"},XT=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.ref("content_copy"),r=l.computed({get(){return e.node.attrs.language},set(d){e.updateAttributes({language:d})}}),o=l.computed({get(){return e.node.attrs.wrap},set(d){e.updateAttributes({wrap:d})}}),i=l.computed(()=>o.value?"text_select_move_down":"format_text_wrap");function s(d){r.value=d}function a(){const d=e.node.content.content[0].text;KT(d).then(()=>{t.value="done",setTimeout(()=>{t.value="content_copy"},2e3)})}function c(){o.value=!o.value}return(d,u)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-code-block-view"}),{default:l.withCtx(()=>[l.createElementVNode("div",GT,[l.createElementVNode("div",jT,[l.createVNode(l.unref(Wm),{language:r.value,onSelect:s},null,8,["language"])]),l.createElementVNode("div",JT,[l.createElementVNode("div",YT,l.toDisplayString(r.value),1),l.createVNode(l.unref(Me),{icon:i.value,"icon-class":{"rotate-270":o.value},tooltip:"Wrap",class:"editable",onClick:c},null,8,["icon","icon-class"]),l.createVNode(l.unref(Me),{icon:t.value,tooltip:"Copy",onClick:a},null,8,["icon"])])]),l.createElementVNode("pre",null,[l.createVNode(l.unref(Xn),{as:"code",class:l.normalizeClass({wrap:o.value})},null,8,["class"])])]),_:1},16))}}),ZT=UT(PT),QT=g1.extend({draggable:!0,addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),wrap:{default:!0,rendered:!1}}},addNodeView(){return yn(XT)}}).configure({languageClassPrefix:"language-",defaultLanguage:"bash",lowlight:ZT}),zp=n=>{const e=/(#[0-9a-f]{3,6})\b/gi,t=[];return n.descendants((r,o)=>{r.text&&Array.from(r.text.matchAll(e)).forEach(i=>{const s=i[0],a=i.index||0,c=o+a,d=c+s.length,u=Ze.inline(c,d,{class:"color",style:`--color: ${s}`});t.push(u)})}),Ne.create(n,t)},eO=Ae.create({name:"colorHighlighter",addProseMirrorPlugins(){return[new Te({state:{init(n,{doc:e}){return zp(e)},apply(n,e){return n.docChanged?zp(n.doc):e}},props:{decorations(n){return this.getState(n)}}})]}});Ae.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Te({key:new $e("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:o}=e,i=[];if(!t||!r)return Ne.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((c,d)=>{if(c.isText)return;if(!(o>=d&&o<=d+c.nodeSize-1))return!1;s+=1});let a=0;return n.descendants((c,d)=>{if(c.isText||!(o>=d&&o<=d+c.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(Ze.node(d,d+c.nodeSize,{class:this.options.className}))}),Ne.create(n,i)}}})]}});const tO=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.computed(()=>e.node.attrs.level);return(r,o)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:["o-heading-view",`h${t.value}`],"data-id":r.node.attrs["data-id"],style:`text-align: ${r.node.attrs.textAlign}`}),{default:l.withCtx(()=>[l.createVNode(l.unref(Xn))]),_:1},16,["class","data-id","style"]))}}),nO=Lm.extend({draggable:!0,addNodeView(){return yn(tO)}}),rO={class:"horizontal"},oO=l.defineComponent({__name:"view",props:ct,setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-horizontal-view"}),{default:l.withCtx(()=>[l.createElementVNode("div",rO,[l.createVNode(l.unref(Xn),{as:"div",class:"divider"})])]),_:1},16))}}),iO=Vm.extend({draggable:!0,addNodeView(){return yn(oO)}}),sO=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Mg=Ke.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:n}){return["img",_e(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Zc({find:sO,type:this.type,getAttributes:n=>{const[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),aO={key:1,class:"image-container"},lO={key:1},cO=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.ref(!1),r=l.ref(!1),o=l.ref({}),i=l.ref(null),s=l.ref(!1),a=l.computed(()=>e.node.attrs),c=l.computed({get(){return e.node.attrs.src},set(b){e.updateAttributes({src:b})}}),d=l.computed({get(){return e.node.attrs.title},set(b){e.updateAttributes({title:b})}});function u(){s.value=!0,setTimeout(()=>{var b;(b=i.value)==null||b.focus()},0)}function p(){s.value=!1}function f(){c.value==="init"&&g(!0)}function h(b){switch(t.value=!1,b.value){case"replace":g(!0);break}}function m(b){c.value=b,g(!1)}function g(b){r.value=b}return l.onMounted(()=>{g(c.value==="init")}),(b,y)=>{var k;return l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:["o-image-view",{"with-caption":a.value.alt,"with-ratio":a.value.ratio,readonly:!((k=b.editor)!=null&&k.isEditable),init:c.value==="init"}],size:a.value.size,as:"div",onClick:f}),{default:l.withCtx(()=>[l.createVNode(l.unref(xo),{modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=E=>r.value=E),placement:c.value==="init"?"bottom":"top","show-arrow":""},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(fd),{val:c.value==="init"?"":c.value,type:"image",onInput:m},null,8,["val"])]),default:l.withCtx(()=>{var E;return[c.value==="init"?(l.openBlock(),l.createBlock(l.unref(cd),{key:0,icon:"image",placeholder:"Add an image"})):(l.openBlock(),l.createElementBlock("div",aO,[l.createVNode(l.unref(ud),l.mergeProps(e,{onAction:h}),{default:l.withCtx(()=>[l.createVNode(l.unref(Me),{icon:"subtitles",tooltip:"image.caption",onClick:u})]),_:1},16),l.createElementVNode("img",l.mergeProps(a.value,{draggable:"true","data-drag-handle":""}),null,16),l.createElementVNode("div",{class:"caption",onClick:u},[(E=b.editor)!=null&&E.isEditable&&s.value?(l.openBlock(),l.createBlock(l.unref(Ao),{key:0,ref_key:"captionInput",ref:i,class:"caption-input",modelValue:d.value,"onUpdate:modelValue":y[0]||(y[0]=v=>d.value=v),type:"text",placeholder:"Input caption",autosize:"",onBlur:p},null,8,["modelValue"])):(l.openBlock(),l.createElementBlock("span",lO,l.toDisplayString(d.value),1))])]))]}),_:1},8,["modelValue","placement"]),l.createVNode(l.unref(Ba),{modelValue:t.value,"onUpdate:modelValue":y[2]||(y[2]=E=>t.value=E),event:o.value},{default:l.withCtx(()=>[l.createVNode(l.unref(Xr),l.mergeProps(e,{onAction:h}),null,16)]),_:1},8,["modelValue","event"])]),_:1},16,["class","size"])}}}),dO=Mg.extend({draggable:!0,addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),size:{default:"",rendered:!1},ratio:{default:"",rendered:!1},isDraggable:{default:!0,renderHTML:e=>({})}}},renderHTML({node:n,HTMLAttributes:e}){return e.size=n.attrs.size,e.ratio=n.attrs.ratio,["img",_e(this.options.HTMLAttributes,e)]},addNodeView(){return yn(cO)}}).configure({inline:!0}),uO="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",pO="ελ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",To=(n,e)=>{for(const t in e)n[t]=e[t];return n},cc="numeric",dc="ascii",uc="alpha",ni="asciinumeric",Jo="alphanumeric",pc="domain",Ag="emoji",fO="scheme",hO="slashscheme",Sl="whitespace";function mO(n,e){return n in e||(e[n]=[]),e[n]}function Dr(n,e,t){e[cc]&&(e[ni]=!0,e[Jo]=!0),e[dc]&&(e[ni]=!0,e[uc]=!0),e[ni]&&(e[Jo]=!0),e[uc]&&(e[Jo]=!0),e[Jo]&&(e[pc]=!0),e[Ag]&&(e[pc]=!0);for(const r in e){const o=mO(r,t);o.indexOf(n)<0&&o.push(n)}}function gO(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function $t(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}$t.groups={};$t.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(n))return i}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let o=0;o<n.length;o++)this.tt(n[o],e,t,r)},tr(n,e,t,r){r=r||$t.groups;let o;return e&&e.j?o=e:(o=new $t(e),t&&r&&Dr(e,t,r)),this.jr.push([n,o]),o},ts(n,e,t,r){let o=this;const i=n.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(n[s]);return o.tt(n[i-1],e,t,r)},tt(n,e,t,r){r=r||$t.groups;const o=this;if(e&&e.j)return o.j[n]=e,e;const i=e;let s,a=o.go(n);if(a?(s=new $t,To(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new $t,i){if(r)if(s.t&&typeof s.t=="string"){const c=To(gO(s.t,r),t);Dr(i,c,r)}else t&&Dr(i,t,r);s.t=i}return o.j[n]=s,s}};const he=(n,e,t,r,o)=>n.ta(e,t,r,o),Ge=(n,e,t,r,o)=>n.tr(e,t,r,o),Vp=(n,e,t,r,o)=>n.ts(e,t,r,o),R=(n,e,t,r,o)=>n.tt(e,t,r,o),Vn="WORD",fc="UWORD",Rg="ASCIINUMERICAL",Dg="ALPHANUMERICAL",_i="LOCALHOST",hc="TLD",mc="UTLD",_s="SCHEME",co="SLASH_SCHEME",Cd="NUM",gc="WS",_d="NL",ri="OPENBRACE",oi="CLOSEBRACE",Js="OPENBRACKET",Ys="CLOSEBRACKET",Xs="OPENPAREN",Zs="CLOSEPAREN",Qs="OPENANGLEBRACKET",ea="CLOSEANGLEBRACKET",ta="FULLWIDTHLEFTPAREN",na="FULLWIDTHRIGHTPAREN",ra="LEFTCORNERBRACKET",oa="RIGHTCORNERBRACKET",ia="LEFTWHITECORNERBRACKET",sa="RIGHTWHITECORNERBRACKET",aa="FULLWIDTHLESSTHAN",la="FULLWIDTHGREATERTHAN",ca="AMPERSAND",Sd="APOSTROPHE",da="ASTERISK",ir="AT",ua="BACKSLASH",pa="BACKTICK",fa="CARET",ar="COLON",xd="COMMA",ha="DOLLAR",Sn="DOT",ma="EQUALS",Nd="EXCLAMATION",nn="HYPHEN",ii="PERCENT",ga="PIPE",ba="PLUS",ya="POUND",si="QUERY",Td="QUOTE",Ig="FULLWIDTHMIDDLEDOT",Od="SEMI",xn="SLASH",ai="TILDE",va="UNDERSCORE",Bg="EMOJI",ka="SYM";var Lg=Object.freeze({__proto__:null,WORD:Vn,UWORD:fc,ASCIINUMERICAL:Rg,ALPHANUMERICAL:Dg,LOCALHOST:_i,TLD:hc,UTLD:mc,SCHEME:_s,SLASH_SCHEME:co,NUM:Cd,WS:gc,NL:_d,OPENBRACE:ri,CLOSEBRACE:oi,OPENBRACKET:Js,CLOSEBRACKET:Ys,OPENPAREN:Xs,CLOSEPAREN:Zs,OPENANGLEBRACKET:Qs,CLOSEANGLEBRACKET:ea,FULLWIDTHLEFTPAREN:ta,FULLWIDTHRIGHTPAREN:na,LEFTCORNERBRACKET:ra,RIGHTCORNERBRACKET:oa,LEFTWHITECORNERBRACKET:ia,RIGHTWHITECORNERBRACKET:sa,FULLWIDTHLESSTHAN:aa,FULLWIDTHGREATERTHAN:la,AMPERSAND:ca,APOSTROPHE:Sd,ASTERISK:da,AT:ir,BACKSLASH:ua,BACKTICK:pa,CARET:fa,COLON:ar,COMMA:xd,DOLLAR:ha,DOT:Sn,EQUALS:ma,EXCLAMATION:Nd,HYPHEN:nn,PERCENT:ii,PIPE:ga,PLUS:ba,POUND:ya,QUERY:si,QUOTE:Td,FULLWIDTHMIDDLEDOT:Ig,SEMI:Od,SLASH:xn,TILDE:ai,UNDERSCORE:va,EMOJI:Bg,SYM:ka});const Fn=/[a-z]/,Fo=new RegExp("\\p{L}","u"),xl=new RegExp("\\p{Emoji}","u"),zn=/\d/,Nl=/\s/,Hp="\r",Tl=`
|
|
122
|
+
`,bO="️",yO="",Ol="";let rs=null,is=null;function vO(n=[]){const e={};$t.groups=e;const t=new $t;rs==null&&(rs=Up(uO)),is==null&&(is=Up(pO)),R(t,"'",Sd),R(t,"{",ri),R(t,"}",oi),R(t,"[",Js),R(t,"]",Ys),R(t,"(",Xs),R(t,")",Zs),R(t,"<",Qs),R(t,">",ea),R(t,"(",ta),R(t,")",na),R(t,"「",ra),R(t,"」",oa),R(t,"『",ia),R(t,"』",sa),R(t,"<",aa),R(t,">",la),R(t,"&",ca),R(t,"*",da),R(t,"@",ir),R(t,"`",pa),R(t,"^",fa),R(t,":",ar),R(t,",",xd),R(t,"$",ha),R(t,".",Sn),R(t,"=",ma),R(t,"!",Nd),R(t,"-",nn),R(t,"%",ii),R(t,"|",ga),R(t,"+",ba),R(t,"#",ya),R(t,"?",si),R(t,'"',Td),R(t,"/",xn),R(t,";",Od),R(t,"~",ai),R(t,"_",va),R(t,"\\",ua),R(t,"・",Ig);const r=Ge(t,zn,Cd,{[cc]:!0});Ge(r,zn,r);const o=Ge(r,Fn,Rg,{[ni]:!0}),i=Ge(r,Fo,Dg,{[Jo]:!0}),s=Ge(t,Fn,Vn,{[dc]:!0});Ge(s,zn,o),Ge(s,Fn,s),Ge(o,zn,o),Ge(o,Fn,o);const a=Ge(t,Fo,fc,{[uc]:!0});Ge(a,Fn),Ge(a,zn,i),Ge(a,Fo,a),Ge(i,zn,i),Ge(i,Fn),Ge(i,Fo,i);const c=R(t,Tl,_d,{[Sl]:!0}),d=R(t,Hp,gc,{[Sl]:!0}),u=Ge(t,Nl,gc,{[Sl]:!0});R(t,Ol,u),R(d,Tl,c),R(d,Ol,u),Ge(d,Nl,u),R(u,Hp),R(u,Tl),Ge(u,Nl,u),R(u,Ol,u);const p=Ge(t,xl,Bg,{[Ag]:!0});R(p,"#"),Ge(p,xl,p),R(p,bO,p);const f=R(p,yO);R(f,"#"),Ge(f,xl,p);const h=[[Fn,s],[zn,o]],m=[[Fn,null],[Fo,a],[zn,i]];for(let g=0;g<rs.length;g++)tr(t,rs[g],hc,Vn,h);for(let g=0;g<is.length;g++)tr(t,is[g],mc,fc,m);Dr(hc,{tld:!0,ascii:!0},e),Dr(mc,{utld:!0,alpha:!0},e),tr(t,"file",_s,Vn,h),tr(t,"mailto",_s,Vn,h),tr(t,"http",co,Vn,h),tr(t,"https",co,Vn,h),tr(t,"ftp",co,Vn,h),tr(t,"ftps",co,Vn,h),Dr(_s,{scheme:!0,ascii:!0},e),Dr(co,{slashscheme:!0,ascii:!0},e),n=n.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<n.length;g++){const b=n[g][0],k=n[g][1]?{[fO]:!0}:{[hO]:!0};b.indexOf("-")>=0?k[pc]=!0:Fn.test(b)?zn.test(b)?k[ni]=!0:k[dc]=!0:k[cc]=!0,Vp(t,b,b,k)}return Vp(t,"localhost",_i,{ascii:!0}),t.jd=new $t(ka),{start:t,tokens:To({groups:e},Lg)}}function Pg(n,e){const t=kO(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=t.length,o=[];let i=0,s=0;for(;s<r;){let a=n,c=null,d=0,u=null,p=-1,f=-1;for(;s<r&&(c=a.go(t[s]));)a=c,a.accepts()?(p=0,f=0,u=a):p>=0&&(p+=t[s].length,f++),d+=t[s].length,i+=t[s].length,s++;i-=p,s-=f,d-=p,o.push({t:u.t,v:e.slice(i-d,i),s:i-d,e:i})}return o}function kO(n){const e=[],t=n.length;let r=0;for(;r<t;){let o=n.charCodeAt(r),i,s=o<55296||o>56319||r+1===t||(i=n.charCodeAt(r+1))<56320||i>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function tr(n,e,t,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const c=e[a];n.j[c]?i=n.j[c]:(i=new $t(r),i.jr=o.slice(),n.j[c]=i),n=i}return i=new $t(t),i.jr=o.slice(),n.j[e[s-1]]=i,i}function Up(n){const e=[],t=[];let r=0,o="0123456789";for(;r<n.length;){let i=0;for(;o.indexOf(n[r+i])>=0;)i++;if(i>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+i),10);s>0;s--)t.pop();r+=i}else t.push(n[r]),r++}return e}const Si={defaultProtocol:"http",events:null,format:Wp,formatHref:Wp,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Md(n,e=null){let t=To({},Si);n&&(t=To(t,n instanceof Md?n.o:n));const r=t.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=o}Md.prototype={o:Si,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let o=this.o[n];return o&&(typeof o=="object"?(o=t.t in o?o[t.t]:Si[n],typeof o=="function"&&r&&(o=o(e,t))):typeof o=="function"&&r&&(o=o(e,t.t,t)),o)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function Wp(n){return n}function $g(n,e){this.t="token",this.v=n,this.tk=e}$g.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Si.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),o=n.get("tagName",t,e),i=this.toFormattedString(n),s={},a=n.get("className",t,e),c=n.get("target",t,e),d=n.get("rel",t,e),u=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return s.href=r,a&&(s.class=a),c&&(s.target=c),d&&(s.rel=d),u&&To(s,u),{tagName:o,attributes:s,content:i,eventListeners:p}}};function Fa(n,e){class t extends $g{constructor(o,i){super(o,i),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const qp=Fa("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Kp=Fa("text"),wO=Fa("nl"),ss=Fa("url",{isLink:!0,toHref(n=Si.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==_i&&n[1].t===ar}}),tn=n=>new $t(n);function EO({groups:n}){const e=n.domain.concat([ca,da,ir,ua,pa,fa,ha,ma,nn,Cd,ii,ga,ba,ya,xn,ka,ai,va]),t=[ar,xd,Sn,Nd,ii,si,Td,Od,Qs,ea,ri,oi,Ys,Js,Xs,Zs,ta,na,ra,oa,ia,sa,aa,la],r=[ca,Sd,da,ua,pa,fa,ha,ma,nn,ri,oi,ii,ga,ba,ya,si,xn,ka,ai,va],o=tn(),i=R(o,ai);he(i,r,i),he(i,n.domain,i);const s=tn(),a=tn(),c=tn();he(o,n.domain,s),he(o,n.scheme,a),he(o,n.slashscheme,c),he(s,r,i),he(s,n.domain,s);const d=R(s,ir);R(i,ir,d),R(a,ir,d),R(c,ir,d);const u=R(i,Sn);he(u,r,i),he(u,n.domain,i);const p=tn();he(d,n.domain,p),he(p,n.domain,p);const f=R(p,Sn);he(f,n.domain,p);const h=tn(qp);he(f,n.tld,h),he(f,n.utld,h),R(d,_i,h);const m=R(p,nn);R(m,nn,m),he(m,n.domain,p),he(h,n.domain,p),R(h,Sn,f),R(h,nn,m);const g=R(h,ar);he(g,n.numeric,qp);const b=R(s,nn),y=R(s,Sn);R(b,nn,b),he(b,n.domain,s),he(y,r,i),he(y,n.domain,s);const k=tn(ss);he(y,n.tld,k),he(y,n.utld,k),he(k,n.domain,s),he(k,r,i),R(k,Sn,y),R(k,nn,b),R(k,ir,d);const E=R(k,ar),v=tn(ss);he(E,n.numeric,v);const _=tn(ss),C=tn();he(_,e,_),he(_,t,C),he(C,e,_),he(C,t,C),R(k,xn,_),R(v,xn,_);const D=R(a,ar),B=R(c,ar),A=R(B,xn),$=R(A,xn);he(a,n.domain,s),R(a,Sn,y),R(a,nn,b),he(c,n.domain,s),R(c,Sn,y),R(c,nn,b),he(D,n.domain,_),R(D,xn,_),R(D,si,_),he($,n.domain,_),he($,e,_),R($,xn,_);const J=[[ri,oi],[Js,Ys],[Xs,Zs],[Qs,ea],[ta,na],[ra,oa],[ia,sa],[aa,la]];for(let te=0;te<J.length;te++){const[de,ce]=J[te],re=R(_,de);R(C,de,re),R(re,ce,_);const oe=tn(ss);he(re,e,oe);const N=tn();he(re,t),he(oe,e,oe),he(oe,t,N),he(N,e,oe),he(N,t,N),R(oe,ce,_),R(N,ce,_)}return R(o,_i,k),R(o,_d,wO),{start:o,tokens:Lg}}function CO(n,e,t){let r=t.length,o=0,i=[],s=[];for(;o<r;){let a=n,c=null,d=null,u=0,p=null,f=-1;for(;o<r&&!(c=a.go(t[o].t));)s.push(t[o++]);for(;o<r&&(d=c||a.go(t[o].t));)c=null,a=d,a.accepts()?(f=0,p=a):f>=0&&f++,o++,u++;if(f<0)o-=u,o<r&&(s.push(t[o]),o++);else{s.length>0&&(i.push(Ml(Kp,e,s)),s=[]),o-=f,u-=f;const h=p.t,m=t.slice(o-u,o);i.push(Ml(h,e,m))}}return s.length>0&&i.push(Ml(Kp,e,s)),i}function Ml(n,e,t){const r=t[0].s,o=t[t.length-1].e,i=e.slice(r,o);return new n(i,t)}const _O=typeof console<"u"&&console&&console.warn||(()=>{}),SO="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",We={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xO(){return $t.groups={},We.scanner=null,We.parser=null,We.tokenQueue=[],We.pluginQueue=[],We.customSchemes=[],We.initialized=!1,We}function Gp(n,e=!1){if(We.initialized&&_O(`linkifyjs: already initialized - will not register custom scheme "${n}" ${SO}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
123
123
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
124
124
|
2. Cannot start or end with "-"
|
|
125
|
-
3. "-" cannot repeat`);We.customSchemes.push([n,e])}function NO(){We.scanner=vO(We.customSchemes);for(let n=0;n<We.tokenQueue.length;n++)We.tokenQueue[n][1]({scanner:We.scanner});We.parser=EO(We.scanner.tokens);for(let n=0;n<We.pluginQueue.length;n++)We.pluginQueue[n][1]({scanner:We.scanner,parser:We.parser});return We.initialized=!0,We}function Ad(n){return We.initialized||NO(),CO(We.parser.start,n,Lg(We.scanner.start,n))}Ad.scan=Lg;function $g(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Md(t),o=Ad(n),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 TO(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function OO(n){return new Te({key:new $e("autolink"),appendTransaction:(e,t,r)=>{const o=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),i=e.some(d=>d.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=Zw(t.doc,[...e]);if(oE(a).forEach(({newRange:d})=>{const u=eE(r.doc,d,h=>h.isTextblock);let p,f;if(u.length>1?(p=u[0],f=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(p=u[0],f=r.doc.textBetween(p.pos,d.to,void 0," ")),p&&f){const h=f.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;const m=h[h.length-1],g=p.pos+f.lastIndexOf(m);if(!m)return!1;const b=Ad(m).map(y=>y.toObject(n.defaultProtocol));if(!TO(b))return!1;b.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{Yc(y.from,y.to,r.doc).some(k=>k.mark.type===n.type)||s.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function MO(n){return new Te({key:new $e("handleClickLink"),props:{handleClick:(e,t,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(f=>f.nodeName==="A"))return!1;const c=sm(e.state,n.type.name),d=r.target,u=(o=d==null?void 0:d.href)!==null&&o!==void 0?o:c.href,p=(i=d==null?void 0:d.target)!==null&&i!==void 0?i:c.target;return d&&u?(window.open(u,p),!0):!1}}})}function AO(n){return new Te({key:new $e("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(d=>{a+=d.textContent});const c=$g(a,{defaultProtocol:n.defaultProtocol}).find(d=>d.isLink&&d.value===a);return!a||!c?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}const RO=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function xr(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&t.push(o)}),!n||n.replace(RO,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Fg=ln.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(n=>{if(typeof n=="string"){Gp(n);return}Gp(n.scheme,n.optionalSlashes)})},onDestroy(){xO()},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:(n,e)=>!!xr(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.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:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!xr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!xr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",_e(this.options.HTMLAttributes,n),0]:["a",_e(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vr({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,o=$g(n).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!xr(s,t),protocols:t,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:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(OO({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!xr(o,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(MO({type:this.type})),this.options.linkOnPaste&&n.push(AO({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}});function DO(n){return new Te({key:new $e("handleClickSelectLink"),props:{handleClick:(e,t,r)=>{const{schema:o,doc:i,tr:s}=e.state,a=Mo(i.resolve(t),o.marks.link);if(!a)return!1;const c=i.resolve(a.from),d=i.resolve(a.to),u=s.setSelection(new Y(c,d));return e.dispatch(u),!0}}})}const IO=Fg.extend({addProseMirrorPlugins(){var n;return[...((n=this.parent)==null?void 0:n.call(this))||[],DO({type:this.type})]}}).configure({openOnClick:!1}),BO=l.defineComponent({__name:"view",props:ct,setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-paragraph-view"}),{default:l.withCtx(()=>[l.createVNode(l.unref(Xn),{as:"p",style:l.normalizeStyle(`text-align: ${t.node.attrs.textAlign}`)},null,8,["style"])]),_:1},16))}}),LO=Vm.extend({draggable:!1,addNodeView(){return yn(BO,{stopEvent:()=>!1})}}),PO=Ae.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Te({key:new $e("placeholder"),props:{decorations:({doc:n,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];return t?(n.descendants((i,s)=>{const a=r>=s&&r<=s+i.nodeSize,c=!i.isLeaf&&!i.childCount,d=this.options.showOnlyCurrent;if((a||!d)&&c){const u=[this.options.emptyNodeClass];this.editor.isEmpty&&u.push(this.options.emptyEditorClass);const p=Ze.node(s,s+i.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:s,hasAnchor:a}):this.options.placeholder});o.push(p)}return this.options.includeChildren}),Ne.create(n,o)):null}}})]}});var bc,yc;if(typeof WeakMap<"u"){let n=new WeakMap;bc=e=>n.get(e),yc=(e,t)=>(n.set(e,t),t)}else{const n=[];let t=0;bc=r=>{for(let o=0;o<n.length;o+=2)if(n[o]==r)return n[o+1]},yc=(r,o)=>(t==10&&(t=0),n[t++]=r,n[t++]=o)}var Je=class{constructor(n,e,t,r){this.width=n,this.height=e,this.map=t,this.problems=r}findCell(n){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=n)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]==t;a++)i++;for(let a=1;s<this.height&&this.map[e+this.width*a]==t;a++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${n} found`)}colCount(n){for(let e=0;e<this.map.length;e++)if(this.map[e]==n)return e%this.width;throw new RangeError(`No cell with offset ${n} found`)}nextCell(n,e,t){const{left:r,right:o,top:i,bottom:s}=this.findCell(n);return e=="horiz"?(t<0?r==0:o==this.width)?null:this.map[i*this.width+(t<0?r-1:o)]:(t<0?i==0:s==this.height)?null:this.map[r+this.width*(t<0?i-1:s)]}rectBetween(n,e){const{left:t,right:r,top:o,bottom:i}=this.findCell(n),{left:s,right:a,top:c,bottom:d}=this.findCell(e);return{left:Math.min(t,s),top:Math.min(o,c),right:Math.max(r,a),bottom:Math.max(i,d)}}cellsInRect(n){const e=[],t={};for(let r=n.top;r<n.bottom;r++)for(let o=n.left;o<n.right;o++){const i=r*this.width+o,s=this.map[i];t[s]||(t[s]=!0,!(o==n.left&&o&&this.map[i-1]==s||r==n.top&&r&&this.map[i-this.width]==s)&&e.push(s))}return e}positionAt(n,e,t){for(let r=0,o=0;;r++){const i=o+t.child(r).nodeSize;if(r==n){let s=e+n*this.width;const a=(n+1)*this.width;for(;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}}static get(n){return bc(n)||yc(n,$O(n))}};function $O(n){if(n.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+n.type.name);const e=FO(n),t=n.childCount,r=[];let o=0,i=null;const s=[];for(let d=0,u=e*t;d<u;d++)r[d]=0;for(let d=0,u=0;d<t;d++){const p=n.child(d);u++;for(let m=0;;m++){for(;o<r.length&&r[o]!=0;)o++;if(m==p.childCount)break;const g=p.child(m),{colspan:b,rowspan:y,colwidth:k}=g.attrs;for(let E=0;E<y;E++){if(E+d>=t){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-E});break}const v=o+E*e;for(let _=0;_<b;_++){r[v+_]==0?r[v+_]=u:(i||(i=[])).push({type:"collision",row:d,pos:u,n:b-_});const C=k&&k[_];if(C){const D=(v+_)%e*2,B=s[D];B==null||B!=C&&s[D+1]==1?(s[D]=C,s[D+1]=1):B==C&&s[D+1]++}}}o+=b,u+=g.nodeSize}const f=(d+1)*e;let h=0;for(;o<f;)r[o++]==0&&h++;h&&(i||(i=[])).push({type:"missing",row:d,n:h}),u++}(e===0||t===0)&&(i||(i=[])).push({type:"zero_sized"});const a=new Je(e,t,r,i);let c=!1;for(let d=0;!c&&d<s.length;d+=2)s[d]!=null&&s[d+1]<t&&(c=!0);return c&&zO(a,s,n),a}function FO(n){let e=-1,t=!1;for(let r=0;r<n.childCount;r++){const o=n.child(r);let i=0;if(t)for(let s=0;s<r;s++){const a=n.child(s);for(let c=0;c<a.childCount;c++){const d=a.child(c);s+d.attrs.rowspan>r&&(i+=d.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const a=o.child(s);i+=a.attrs.colspan,a.attrs.rowspan>1&&(t=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function zO(n,e,t){n.problems||(n.problems=[]);const r={};for(let o=0;o<n.map.length;o++){const i=n.map[o];if(r[i])continue;r[i]=!0;const s=t.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const c=s.attrs;for(let d=0;d<c.colspan;d++){const u=(o+d)%n.width,p=e[u*2];p!=null&&(!c.colwidth||c.colwidth[d]!=p)&&((a||(a=VO(c)))[d]=p)}a&&n.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function VO(n){if(n.colwidth)return n.colwidth.slice();const e=[];for(let t=0;t<n.colspan;t++)e.push(0);return e}function Ct(n){let e=n.cached.tableNodeTypes;if(!e){e=n.cached.tableNodeTypes={};for(const t in n.nodes){const r=n.nodes[t],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var lr=new $e("selectingCells");function Ro(n){for(let e=n.depth-1;e>0;e--)if(n.node(e).type.spec.tableRole=="row")return n.node(0).resolve(n.before(e+1));return null}function HO(n){for(let e=n.depth;e>0;e--){const t=n.node(e).type.spec.tableRole;if(t==="cell"||t==="header_cell")return n.node(e)}return null}function vn(n){const e=n.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function za(n){const e=n.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 t=Ro(e.$head)||UO(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function UO(n){for(let e=n.nodeAfter,t=n.pos;e;e=e.firstChild,t++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t)}for(let e=n.nodeBefore,t=n.pos;e;e=e.lastChild,t--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t-e.nodeSize)}}function vc(n){return n.parent.type.spec.tableRole=="row"&&!!n.nodeAfter}function WO(n){return n.node(0).resolve(n.pos+n.nodeAfter.nodeSize)}function Rd(n,e){return n.depth==e.depth&&n.pos>=e.start(-1)&&n.pos<=e.end(-1)}function zg(n,e,t){const r=n.node(-1),o=Je.get(r),i=n.start(-1),s=o.nextCell(n.pos-i,e,t);return s==null?null:n.node(0).resolve(i+s)}function jr(n,e,t=1){const r={...n,colspan:n.colspan-t};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,t),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function Vg(n,e,t=1){const r={...n,colspan:n.colspan+t};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<t;o++)r.colwidth.splice(e,0,0)}return r}function qO(n,e,t){const r=Ct(e.type.schema).header_cell;for(let o=0;o<n.height;o++)if(e.nodeAt(n.map[t+o*n.width]).type!=r)return!1;return!0}var Le=class Hn extends ee{constructor(e,t=e){const r=e.node(-1),o=Je.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,t.pos-i),a=e.node(0),c=o.cellsInRect(s).filter(u=>u!=t.pos-i);c.unshift(t.pos-i);const d=c.map(u=>{const p=r.nodeAt(u);if(!p)throw RangeError(`No cell with offset ${u} found`);const f=i+u+1;return new Hf(a.resolve(f),a.resolve(f+p.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=t}map(e,t){const r=e.resolve(t.map(this.$anchorCell.pos)),o=e.resolve(t.map(this.$headCell.pos));if(vc(r)&&vc(o)&&Rd(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Hn.rowSelection(r,o):i&&this.isColSelection()?Hn.colSelection(r,o):new Hn(r,o)}return Y.between(r,o)}content(){const e=this.$anchorCell.node(-1),t=Je.get(e),r=this.$anchorCell.start(-1),o=t.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let c=o.top;c<o.bottom;c++){const d=[];for(let u=c*t.width+o.left,p=o.left;p<o.right;p++,u++){const f=t.map[u];if(i[f])continue;i[f]=!0;const h=t.findCell(f);let m=e.nodeAt(f);if(!m)throw RangeError(`No cell with offset ${f} found`);const g=o.left-h.left,b=h.right-o.right;if(g>0||b>0){let y=m.attrs;if(g>0&&(y=jr(y,0,g)),b>0&&(y=jr(y,y.colspan-b,b)),h.left<o.left){if(m=m.type.createAndFill(y),!m)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else m=m.type.create(y,m.content)}if(h.top<o.top||h.bottom>o.bottom){const y={...m.attrs,rowspan:Math.min(h.bottom,o.bottom)-Math.max(h.top,o.top)};h.top<o.top?m=m.type.createAndFill(y):m=m.type.create(y,m.content)}d.push(m)}s.push(e.child(c).copy(S.from(d)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new O(S.from(a),1,1)}replace(e,t=O.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:a,$to:c}=o[s],d=e.mapping.slice(r);e.replace(d.map(a.pos),d.map(c.pos),s?O.empty:t)}const i=ee.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new O(S.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),r=Je.get(t),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(t.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const r=e.node(-1),o=Je.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(t.pos-i),c=e.node(0);return s.top<=a.top?(s.top>0&&(e=c.resolve(i+o.map[s.left])),a.bottom<o.height&&(t=c.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(t=c.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=c.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new Hn(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Je.get(e),r=this.$anchorCell.start(-1),o=t.colCount(this.$anchorCell.pos-r),i=t.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)==t.width}eq(e){return e instanceof Hn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const r=e.node(-1),o=Je.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(t.pos-i),c=e.node(0);return s.left<=a.left?(s.left>0&&(e=c.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(t=c.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(t=c.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=c.resolve(i+o.map[o.width*(s.top+1)-1]))),new Hn(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new Hn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){return new Hn(e.resolve(t),e.resolve(r))}getBookmark(){return new KO(this.$anchorCell.pos,this.$headCell.pos)}};Le.prototype.visible=!1;ee.jsonID("cell",Le);var KO=class Hg{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Hg(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),r=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&r.index()<r.parent.childCount&&Rd(t,r)?new Le(t,r):ee.near(r,1)}};function GO(n){if(!(n.selection instanceof Le))return null;const e=[];return n.selection.forEachCell((t,r)=>{e.push(Ze.node(r,r+t.nodeSize,{class:"selectedCell"}))}),Ne.create(n.doc,e)}function jO({$from:n,$to:e}){if(n.pos==e.pos||n.pos<e.pos-6)return!1;let t=n.pos,r=e.pos,o=n.depth;for(;o>=0&&!(n.after(o+1)<n.end(o));o--,t++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return t==r&&/row|table/.test(n.node(o).type.spec.tableRole)}function JO({$from:n,$to:e}){let t,r;for(let o=n.depth;o>0;o--){const i=n.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){t=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 t!==r&&e.parentOffset===0}function YO(n,e,t){const r=(e||n).selection,o=(e||n).doc;let i,s;if(r instanceof G&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=Le.create(o,r.from);else if(s=="row"){const a=o.resolve(r.from+1);i=Le.rowSelection(a,a)}else if(!t){const a=Je.get(r.node),c=r.from+1,d=c+a.map[a.width*a.height-1];i=Le.create(o,c+1,d)}}else r instanceof Y&&jO(r)?i=Y.create(o,r.from):r instanceof Y&&JO(r)&&(i=Y.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=n.tr)).setSelection(i),e}var XO=new $e("fix-tables");function Ug(n,e,t,r){const o=n.childCount,i=e.childCount;e:for(let s=0,a=0;s<i;s++){const c=e.child(s);for(let d=a,u=Math.min(o,s+3);d<u;d++)if(n.child(d)==c){a=d+1,t+=c.nodeSize;continue e}r(c,t),a<o&&n.child(a).sameMarkup(c)?Ug(n.child(a),c,t+1,r):c.nodesBetween(0,c.content.size,r,t+1),t+=c.nodeSize}}function Wg(n,e){let t;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(t=ZO(n,o,i,t))};return e?e.doc!=n.doc&&Ug(e.doc,n.doc,0,r):n.doc.descendants(r),t}function ZO(n,e,t,r){const o=Je.get(e);if(!o.problems)return r;r||(r=n.tr);const i=[];for(let c=0;c<o.height;c++)i.push(0);for(let c=0;c<o.problems.length;c++){const d=o.problems[c];if(d.type=="collision"){const u=e.nodeAt(d.pos);if(!u)continue;const p=u.attrs;for(let f=0;f<p.rowspan;f++)i[d.row+f]+=d.n;r.setNodeMarkup(r.mapping.map(t+1+d.pos),null,jr(p,p.colspan-d.n,d.n))}else if(d.type=="missing")i[d.row]+=d.n;else if(d.type=="overlong_rowspan"){const u=e.nodeAt(d.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(t+1+d.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-d.n})}else if(d.type=="colwidth mismatch"){const u=e.nodeAt(d.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(t+1+d.pos),null,{...u.attrs,colwidth:d.colwidth})}else if(d.type=="zero_sized"){const u=r.mapping.map(t);r.delete(u,u+e.nodeSize)}}let s,a;for(let c=0;c<i.length;c++)i[c]&&(s==null&&(s=c),a=c);for(let c=0,d=t+1;c<o.height;c++){const u=e.child(c),p=d+u.nodeSize,f=i[c];if(f>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const m=[];for(let b=0;b<f;b++){const y=Ct(n.schema)[h].createAndFill();y&&m.push(y)}const g=(c==0||s==c-1)&&a==c?d+1:p-1;r.insert(r.mapping.map(g),m)}d=p}return r.setMeta(XO,{fixTables:!0})}function Ln(n){const e=n.selection,t=za(n),r=t.node(-1),o=t.start(-1),i=Je.get(r);return{...e instanceof Le?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(t.pos-o),tableStart:o,map:i,table:r}}function qg(n,{map:e,tableStart:t,table:r},o){let i=o>0?-1:0;qO(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 c=e.map[a],d=r.nodeAt(c);n.setNodeMarkup(n.mapping.map(t+c),null,Vg(d.attrs,o-e.colCount(c))),s+=d.attrs.rowspan-1}else{const c=i==null?Ct(r.type.schema).cell:r.nodeAt(e.map[a+i]).type,d=e.positionAt(s,o,r);n.insert(n.mapping.map(t+d),c.createAndFill())}}return n}function QO(n,e){if(!vn(n))return!1;if(e){const t=Ln(n);e(qg(n.tr,t,t.left))}return!0}function eM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n);e(qg(n.tr,t,t.right))}return!0}function tM(n,{map:e,table:t,tableStart:r},o){const i=n.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+o,c=e.map[a],d=t.nodeAt(c),u=d.attrs;if(o>0&&e.map[a-1]==c||o<e.width-1&&e.map[a+1]==c)n.setNodeMarkup(n.mapping.slice(i).map(r+c),null,jr(u,o-e.colCount(c)));else{const p=n.mapping.slice(i).map(r+c);n.delete(p,p+d.nodeSize)}s+=u.rowspan}}function nM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n),r=n.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let o=t.right-1;tM(r,t,o),o!=t.left;o--){const i=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!i)throw RangeError("No table found");t.table=i,t.map=Je.get(i)}e(r)}return!0}function rM(n,e,t){var r;const o=Ct(e.type.schema).header_cell;for(let i=0;i<n.width;i++)if(((r=e.nodeAt(n.map[i+t*n.width]))==null?void 0:r.type)!=o)return!1;return!0}function Kg(n,{map:e,tableStart:t,table:r},o){var i;let s=t;for(let d=0;d<o;d++)s+=r.child(d).nodeSize;const a=[];let c=o>0?-1:0;rM(e,r,o+c)&&(c=o==0||o==e.height?null:0);for(let d=0,u=e.width*o;d<e.width;d++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const p=e.map[u],f=r.nodeAt(p).attrs;n.setNodeMarkup(t+p,null,{...f,rowspan:f.rowspan+1}),d+=f.colspan-1}else{const p=c==null?Ct(r.type.schema).cell:(i=r.nodeAt(e.map[u+c*e.width]))==null?void 0:i.type,f=p==null?void 0:p.createAndFill();f&&a.push(f)}return n.insert(s,Ct(r.type.schema).row.create(null,a)),n}function oM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n);e(Kg(n.tr,t,t.top))}return!0}function iM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n);e(Kg(n.tr,t,t.bottom))}return!0}function sM(n,{map:e,table:t,tableStart:r},o){let i=0;for(let d=0;d<o;d++)i+=t.child(d).nodeSize;const s=i+t.child(o).nodeSize,a=n.mapping.maps.length;n.delete(i+r,s+r);const c=new Set;for(let d=0,u=o*e.width;d<e.width;d++,u++){const p=e.map[u];if(!c.has(p)){if(c.add(p),o>0&&p==e.map[u-e.width]){const f=t.nodeAt(p).attrs;n.setNodeMarkup(n.mapping.slice(a).map(p+r),null,{...f,rowspan:f.rowspan-1}),d+=f.colspan-1}else if(o<e.height&&p==e.map[u+e.width]){const f=t.nodeAt(p),h=f.attrs,m=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),g=e.positionAt(o+1,d,t);n.insert(n.mapping.slice(a).map(r+g),m),d+=h.colspan-1}}}}function aM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n),r=n.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let o=t.bottom-1;sM(r,t,o),o!=t.top;o--){const i=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!i)throw RangeError("No table found");t.table=i,t.map=Je.get(t.table)}e(r)}return!0}function jp(n){const e=n.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function lM({width:n,height:e,map:t},r){let o=r.top*n+r.left,i=o,s=(r.bottom-1)*n+r.left,a=o+(r.right-r.left-1);for(let c=r.top;c<r.bottom;c++){if(r.left>0&&t[i]==t[i-1]||r.right<n&&t[a]==t[a+1])return!0;i+=n,a+=n}for(let c=r.left;c<r.right;c++){if(r.top>0&&t[o]==t[o-n]||r.bottom<e&&t[s]==t[s+n])return!0;o++,s++}return!1}function Jp(n,e){const t=n.selection;if(!(t instanceof Le)||t.$anchorCell.pos==t.$headCell.pos)return!1;const r=Ln(n),{map:o}=r;if(lM(o,r))return!1;if(e){const i=n.tr,s={};let a=S.empty,c,d;for(let u=r.top;u<r.bottom;u++)for(let p=r.left;p<r.right;p++){const f=o.map[u*o.width+p],h=r.table.nodeAt(f);if(!(s[f]||!h))if(s[f]=!0,c==null)c=f,d=h;else{jp(h)||(a=a.append(h.content));const m=i.mapping.map(f+r.tableStart);i.delete(m,m+h.nodeSize)}}if(c==null||d==null)return!0;if(i.setNodeMarkup(c+r.tableStart,null,{...Vg(d.attrs,d.attrs.colspan,r.right-r.left-d.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const u=c+1+d.content.size,p=jp(d)?c+1:u;i.replaceWith(p+r.tableStart,u+r.tableStart,a)}i.setSelection(new Le(i.doc.resolve(c+r.tableStart))),e(i)}return!0}function Yp(n,e){const t=Ct(n.schema);return cM(({node:r})=>t[r.type.spec.tableRole])(n,e)}function cM(n){return(e,t)=>{var r;const o=e.selection;let i,s;if(o instanceof Le){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{if(i=HO(o.$from),!i)return!1;s=(r=Ro(o.$from))==null?void 0:r.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(t){let a=i.attrs;const c=[],d=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=Ln(e),p=e.tr;for(let h=0;h<u.right-u.left;h++)c.push(d?{...a,colwidth:d&&d[h]?[d[h]]:null}:a);let f;for(let h=u.top;h<u.bottom;h++){let m=u.map.positionAt(h,u.left,u.table);h==u.top&&(m+=i.nodeSize);for(let g=u.left,b=0;g<u.right;g++,b++)g==u.left&&h==u.top||p.insert(f=p.mapping.map(m+u.tableStart,1),n({node:i,row:h,col:g}).createAndFill(c[b]))}p.setNodeMarkup(s,n({node:i,row:u.top,col:u.left}),c[0]),o instanceof Le&&p.setSelection(new Le(p.doc.resolve(o.$anchorCell.pos),f?p.doc.resolve(f):void 0)),t(p)}return!0}}function dM(n,e){return function(t,r){if(!vn(t))return!1;const o=za(t);if(o.nodeAfter.attrs[n]===e)return!1;if(r){const i=t.tr;t.selection instanceof Le?t.selection.forEachCell((s,a)=>{s.attrs[n]!==e&&i.setNodeMarkup(a,null,{...s.attrs,[n]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[n]:e}),r(i)}return!0}}function uM(n){return function(e,t){if(!vn(e))return!1;if(t){const r=Ct(e.schema),o=Ln(e),i=e.tr,s=o.map.cellsInRect(n=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:n=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(c=>o.table.nodeAt(c));for(let c=0;c<s.length;c++)a[c].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[c],r.cell,a[c].attrs);if(i.steps.length==0)for(let c=0;c<s.length;c++)i.setNodeMarkup(o.tableStart+s[c],r.header_cell,a[c].attrs);t(i)}return!0}}function Xp(n,e,t){const r=e.map.cellsInRect({left:0,top:0,right:n=="row"?e.map.width:1,bottom:n=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==t.header_cell)return!1}return!0}function xi(n,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?uM(n):function(t,r){if(!vn(t))return!1;if(r){const o=Ct(t.schema),i=Ln(t),s=t.tr,a=Xp("row",i,o),c=Xp("column",i,o),u=(n==="column"?a:n==="row"?c:!1)?1:0,p=n=="column"?{left:0,top:u,right:1,bottom:i.map.height}:n=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,f=n=="column"?c?o.cell:o.header_cell:n=="row"?a?o.cell:o.header_cell:o.cell;i.map.cellsInRect(p).forEach(h=>{const m=h+i.tableStart,g=s.doc.nodeAt(m);g&&s.setNodeMarkup(m,f,g.attrs)}),r(s)}return!0}}xi("row",{useDeprecatedLogic:!0});xi("column",{useDeprecatedLogic:!0});var pM=xi("cell",{useDeprecatedLogic:!0});function fM(n,e){if(e<0){const t=n.nodeBefore;if(t)return n.pos-t.nodeSize;for(let r=n.index(-1)-1,o=n.before();r>=0;r--){const i=n.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(n.index()<n.parent.childCount-1)return n.pos+n.nodeAfter.nodeSize;const t=n.node(-1);for(let r=n.indexAfter(-1),o=n.after();r<t.childCount;r++){const i=t.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function Zp(n){return function(e,t){if(!vn(e))return!1;const r=fM(za(e),n);if(r==null)return!1;if(t){const o=e.doc.resolve(r);t(e.tr.setSelection(Y.between(o,WO(o))).scrollIntoView())}return!0}}function hM(n,e){const t=n.selection.$anchor;for(let r=t.depth;r>0;r--)if(t.node(r).type.spec.tableRole=="table")return e&&e(n.tr.delete(t.before(r),t.after(r)).scrollIntoView()),!0;return!1}function as(n,e){const t=n.selection;if(!(t instanceof Le))return!1;if(e){const r=n.tr,o=Ct(n.schema).cell.createAndFill().content;t.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new O(o,0,0))}),r.docChanged&&e(r)}return!0}function mM(n){if(!n.size)return null;let{content:e,openStart:t,openEnd:r}=n;for(;e.childCount==1&&(t>0&&r>0||e.child(0).type.spec.tableRole=="table");)t--,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 c=0;c<e.childCount;c++){let d=e.child(c).content;const u=c?0:Math.max(0,t-1),p=c<e.childCount-1?0:Math.max(0,r-1);(u||p)&&(d=kc(Ct(s).row,new O(d,u,p)).content),a.push(d)}else if(i=="cell"||i=="header_cell")a.push(t||r?kc(Ct(s).row,new O(e,t,r)).content:e);else return null;return gM(s,a)}function gM(n,e){const t=[];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:c}=i.child(s).attrs;for(let d=o;d<o+a;d++)t[d]=(t[d]||0)+c}}let r=0;for(let o=0;o<t.length;o++)r=Math.max(r,t[o]);for(let o=0;o<t.length;o++)if(o>=e.length&&e.push(S.empty),t[o]<r){const i=Ct(n).cell.createAndFill(),s=[];for(let a=t[o];a<r;a++)s.push(i);e[o]=e[o].append(S.from(s))}return{height:e.length,width:r,rows:e}}function kc(n,e){const t=n.createAndFill();return new rh(t).replace(0,t.content.size,e).doc}function bM({width:n,height:e,rows:t},r,o){if(n!=r){const i=[],s=[];for(let a=0;a<t.length;a++){const c=t[a],d=[];for(let u=i[a]||0,p=0;u<r;p++){let f=c.child(p%c.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(jr(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),d.push(f),u+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)i[a+h]=(i[a+h]||0)+f.attrs.colspan}s.push(S.from(d))}t=s,n=r}if(e!=o){const i=[];for(let s=0,a=0;s<o;s++,a++){const c=[],d=t[a%e];for(let u=0;u<d.childCount;u++){let p=d.child(u);s+p.attrs.rowspan>o&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,o-p.attrs.rowspan)},p.content)),c.push(p)}i.push(S.from(c))}t=i,e=o}return{width:n,height:e,rows:t}}function yM(n,e,t,r,o,i,s){const a=n.doc.type.schema,c=Ct(a);let d,u;if(o>e.width)for(let p=0,f=0;p<e.height;p++){const h=t.child(p);f+=h.nodeSize;const m=[];let g;h.lastChild==null||h.lastChild.type==c.cell?g=d||(d=c.cell.createAndFill()):g=u||(u=c.header_cell.createAndFill());for(let b=e.width;b<o;b++)m.push(g);n.insert(n.mapping.slice(s).map(f-1+r),m)}if(i>e.height){const p=[];for(let m=0,g=(e.height-1)*e.width;m<Math.max(e.width,o);m++){const b=m>=e.width?!1:t.nodeAt(e.map[g+m]).type==c.header_cell;p.push(b?u||(u=c.header_cell.createAndFill()):d||(d=c.cell.createAndFill()))}const f=c.row.create(null,S.from(p)),h=[];for(let m=e.height;m<i;m++)h.push(f);n.insert(n.mapping.slice(s).map(r+t.nodeSize-2),h)}return!!(d||u)}function Qp(n,e,t,r,o,i,s,a){if(s==0||s==e.height)return!1;let c=!1;for(let d=o;d<i;d++){const u=s*e.width+d,p=e.map[u];if(e.map[u-e.width]==p){c=!0;const f=t.nodeAt(p),{top:h,left:m}=e.findCell(p);n.setNodeMarkup(n.mapping.slice(a).map(p+r),null,{...f.attrs,rowspan:s-h}),n.insert(n.mapping.slice(a).map(e.positionAt(s,m,t)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-s})),d+=f.attrs.colspan-1}}return c}function ef(n,e,t,r,o,i,s,a){if(s==0||s==e.width)return!1;let c=!1;for(let d=o;d<i;d++){const u=d*e.width+s,p=e.map[u];if(e.map[u-1]==p){c=!0;const f=t.nodeAt(p),h=e.colCount(p),m=n.mapping.slice(a).map(p+r);n.setNodeMarkup(m,null,jr(f.attrs,s-h,f.attrs.colspan-(s-h))),n.insert(m+f.nodeSize,f.type.createAndFill(jr(f.attrs,0,s-h))),d+=f.attrs.rowspan-1}}return c}function tf(n,e,t,r,o){let i=t?n.doc.nodeAt(t-1):n.doc;if(!i)throw new Error("No table found");let s=Je.get(i);const{top:a,left:c}=r,d=c+o.width,u=a+o.height,p=n.tr;let f=0;function h(){if(i=t?p.doc.nodeAt(t-1):p.doc,!i)throw new Error("No table found");s=Je.get(i),f=p.mapping.maps.length}yM(p,s,i,t,d,u,f)&&h(),Qp(p,s,i,t,c,d,a,f)&&h(),Qp(p,s,i,t,c,d,u,f)&&h(),ef(p,s,i,t,a,u,c,f)&&h(),ef(p,s,i,t,a,u,d,f)&&h();for(let m=a;m<u;m++){const g=s.positionAt(m,c,i),b=s.positionAt(m,d,i);p.replace(p.mapping.slice(f).map(g+t),p.mapping.slice(f).map(b+t),new O(o.rows[m-a],0,0))}h(),p.setSelection(new Le(p.doc.resolve(t+s.positionAt(a,c,i)),p.doc.resolve(t+s.positionAt(u-1,d-1,i)))),e(p)}var vM=zc({ArrowLeft:ls("horiz",-1),ArrowRight:ls("horiz",1),ArrowUp:ls("vert",-1),ArrowDown:ls("vert",1),"Shift-ArrowLeft":cs("horiz",-1),"Shift-ArrowRight":cs("horiz",1),"Shift-ArrowUp":cs("vert",-1),"Shift-ArrowDown":cs("vert",1),Backspace:as,"Mod-Backspace":as,Delete:as,"Mod-Delete":as});function Ss(n,e,t){return t.eq(n.selection)?!1:(e&&e(n.tr.setSelection(t).scrollIntoView()),!0)}function ls(n,e){return(t,r,o)=>{if(!o)return!1;const i=t.selection;if(i instanceof Le)return Ss(t,r,ee.near(i.$headCell,e));if(n!="horiz"&&!i.empty)return!1;const s=Gg(o,n,e);if(s==null)return!1;if(n=="horiz")return Ss(t,r,ee.near(t.doc.resolve(i.head+e),e));{const a=t.doc.resolve(s),c=zg(a,n,e);let d;return c?d=ee.near(c,1):e<0?d=ee.near(t.doc.resolve(a.before(-1)),-1):d=ee.near(t.doc.resolve(a.after(-1)),1),Ss(t,r,d)}}}function cs(n,e){return(t,r,o)=>{if(!o)return!1;const i=t.selection;let s;if(i instanceof Le)s=i;else{const c=Gg(o,n,e);if(c==null)return!1;s=new Le(t.doc.resolve(c))}const a=zg(s.$headCell,n,e);return a?Ss(t,r,new Le(s.$anchorCell,a)):!1}}function kM(n,e){const t=n.state.doc,r=Ro(t.resolve(e));return r?(n.dispatch(n.state.tr.setSelection(new Le(r))),!0):!1}function wM(n,e,t){if(!vn(n.state))return!1;let r=mM(t);const o=n.state.selection;if(o instanceof Le){r||(r={width:1,height:1,rows:[S.from(kc(Ct(n.state.schema).cell,t))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),a=Je.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=bM(r,a.right-a.left,a.bottom-a.top),tf(n.state,n.dispatch,s,a,r),!0}else if(r){const i=za(n.state),s=i.start(-1);return tf(n.state,n.dispatch,s,Je.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function EM(n,e){var t;if(e.ctrlKey||e.metaKey)return;const r=nf(n,e.target);let o;if(e.shiftKey&&n.state.selection instanceof Le)i(n.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Ro(n.state.selection.$anchor))!=null&&((t=Al(n,e))==null?void 0:t.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(c,d){let u=Al(n,d);const p=lr.getState(n.state)==null;if(!u||!Rd(c,u))if(p)u=c;else return;const f=new Le(c,u);if(p||!n.state.selection.eq(f)){const h=n.state.tr.setSelection(f);p&&h.setMeta(lr,c.pos),n.dispatch(h)}}function s(){n.root.removeEventListener("mouseup",s),n.root.removeEventListener("dragstart",s),n.root.removeEventListener("mousemove",a),lr.getState(n.state)!=null&&n.dispatch(n.state.tr.setMeta(lr,-1))}function a(c){const d=c,u=lr.getState(n.state);let p;if(u!=null)p=n.state.doc.resolve(u);else if(nf(n,d.target)!=r&&(p=Al(n,e),!p))return s();p&&i(p,d)}n.root.addEventListener("mouseup",s),n.root.addEventListener("dragstart",s),n.root.addEventListener("mousemove",a)}function Gg(n,e,t){if(!(n.state.selection instanceof Y))return null;const{$head:r}=n.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((t<0?r.index(o):r.indexAfter(o))!=(t<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const a=r.before(o),c=e=="vert"?t>0?"down":"up":t>0?"right":"left";return n.endOfTextblock(c)?a:null}}return null}function nf(n,e){for(;e&&e!=n.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Al(n,e){const t=n.posAtCoords({left:e.clientX,top:e.clientY});return t&&t?Ro(n.state.doc.resolve(t.pos)):null}var CM=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),wc(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,wc(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function wc(n,e,t,r,o,i){var s;let a=0,c=!0,d=e.firstChild;const u=n.firstChild;if(u){for(let p=0,f=0;p<u.childCount;p++){const{colspan:h,colwidth:m}=u.child(p).attrs;for(let g=0;g<h;g++,f++){const b=o==f?i:m&&m[g],y=b?b+"px":"";if(a+=b||r,b||(c=!1),d)d.style.width!=y&&(d.style.width=y),d=d.nextSibling;else{const k=document.createElement("col");k.style.width=y,e.appendChild(k)}}}for(;d;){const p=d.nextSibling;(s=d.parentNode)==null||s.removeChild(d),d=p}c?(t.style.width=a+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=a+"px")}}var jt=new $e("tableColumnResizing");function _M({handleWidth:n=5,cellMinWidth:e=25,defaultCellMinWidth:t=100,View:r=CM,lastColumnResizable:o=!0}={}){const i=new Te({key:jt,state:{init(s,a){var c,d;const u=(d=(c=i.spec)==null?void 0:c.props)==null?void 0:d.nodeViews,p=Ct(a.schema).table.name;return r&&u&&(u[p]=(f,h)=>new r(f,t,h)),new SM(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=jt.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{xM(s,a,n,o)},mouseleave:s=>{NM(s)},mousedown:(s,a)=>{TM(s,a,e,t)}},decorations:s=>{const a=jt.getState(s);if(a&&a.activeHandle>-1)return DM(s,a.activeHandle)},nodeViews:{}}});return i}var SM=class xs{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,r=e.getMeta(jt);if(r&&r.setHandle!=null)return new xs(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new xs(t.activeHandle,r.setDragging);if(t.activeHandle>-1&&e.docChanged){let o=e.mapping.map(t.activeHandle,-1);return vc(e.doc.resolve(o))||(o=-1),new xs(o,t.dragging)}return t}};function xM(n,e,t,r){if(!n.editable)return;const o=jt.getState(n.state);if(o&&!o.dragging){const i=MM(e.target);let s=-1;if(i){const{left:a,right:c}=i.getBoundingClientRect();e.clientX-a<=t?s=rf(n,e,"left",t):c-e.clientX<=t&&(s=rf(n,e,"right",t))}if(s!=o.activeHandle){if(!r&&s!==-1){const a=n.state.doc.resolve(s),c=a.node(-1),d=Je.get(c),u=a.start(-1);if(d.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==d.width-1)return}jg(n,s)}}}function NM(n){if(!n.editable)return;const e=jt.getState(n.state);e&&e.activeHandle>-1&&!e.dragging&&jg(n,-1)}function TM(n,e,t,r){var o;if(!n.editable)return!1;const i=(o=n.dom.ownerDocument.defaultView)!=null?o:window,s=jt.getState(n.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=n.state.doc.nodeAt(s.activeHandle),c=OM(n,s.activeHandle,a.attrs);n.dispatch(n.state.tr.setMeta(jt,{setDragging:{startX:e.clientX,startWidth:c}}));function d(p){i.removeEventListener("mouseup",d),i.removeEventListener("mousemove",u);const f=jt.getState(n.state);f!=null&&f.dragging&&(AM(n,f.activeHandle,of(f.dragging,p,t)),n.dispatch(n.state.tr.setMeta(jt,{setDragging:null})))}function u(p){if(!p.which)return d(p);const f=jt.getState(n.state);if(f&&f.dragging){const h=of(f.dragging,p,t);sf(n,f.activeHandle,h,r)}}return sf(n,s.activeHandle,c,r),i.addEventListener("mouseup",d),i.addEventListener("mousemove",u),e.preventDefault(),!0}function OM(n,e,{colspan:t,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=n.domAtPos(e);let a=i.node.childNodes[i.offset].offsetWidth,c=t;if(r)for(let d=0;d<t;d++)r[d]&&(a-=r[d],c--);return a/c}function MM(n){for(;n&&n.nodeName!="TD"&&n.nodeName!="TH";)n=n.classList&&n.classList.contains("ProseMirror")?null:n.parentNode;return n}function rf(n,e,t,r){const o=t=="right"?-r:r,i=n.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,a=Ro(n.state.doc.resolve(s));if(!a)return-1;if(t=="right")return a.pos;const c=Je.get(a.node(-1)),d=a.start(-1),u=c.map.indexOf(a.pos-d);return u%c.width==0?-1:d+c.map[u-1]}function of(n,e,t){const r=e.clientX-n.startX;return Math.max(t,n.startWidth+r)}function jg(n,e){n.dispatch(n.state.tr.setMeta(jt,{setHandle:e}))}function AM(n,e,t){const r=n.state.doc.resolve(e),o=r.node(-1),i=Je.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,c=n.state.tr;for(let d=0;d<i.height;d++){const u=d*i.width+a;if(d&&i.map[u]==i.map[u-i.width])continue;const p=i.map[u],f=o.nodeAt(p).attrs,h=f.colspan==1?0:a-i.colCount(p);if(f.colwidth&&f.colwidth[h]==t)continue;const m=f.colwidth?f.colwidth.slice():RM(f.colspan);m[h]=t,c.setNodeMarkup(s+p,null,{...f,colwidth:m})}c.docChanged&&n.dispatch(c)}function sf(n,e,t,r){const o=n.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=Je.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let c=n.domAtPos(o.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&wc(i,c.firstChild,c,r,a,t)}function RM(n){return Array(n).fill(0)}function DM(n,e){var t;const r=[],o=n.doc.resolve(e),i=o.node(-1);if(!i)return Ne.empty;const s=Je.get(i),a=o.start(-1),c=s.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;for(let d=0;d<s.height;d++){const u=c+d*s.width;if((c==s.width-1||s.map[u]!=s.map[u+1])&&(d==0||s.map[u]!=s.map[u-s.width])){const p=s.map[u],f=a+p+i.nodeAt(p).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",(t=jt.getState(n))!=null&&t.dragging&&r.push(Ze.node(a+p,a+p+i.nodeAt(p).nodeSize,{class:"column-resize-dragging"})),r.push(Ze.widget(f,h))}}return Ne.create(n.doc,r)}function IM({allowTableNodeSelection:n=!1}={}){return new Te({key:lr,state:{init(){return null},apply(e,t){const r=e.getMeta(lr);if(r!=null)return r==-1?null:r;if(t==null||!e.docChanged)return t;const{deleted:o,pos:i}=e.mapping.mapResult(t);return o?null:i}},props:{decorations:GO,handleDOMEvents:{mousedown:EM},createSelectionBetween(e){return lr.getState(e.state)!=null?e.state.selection:null},handleTripleClick:kM,handleKeyDown:vM,handlePaste:wM},appendTransaction(e,t,r){return YO(r,Wg(r,t),n)}})}function Ec(n,e){return e?["width",`${Math.max(e,n)}px`]:["min-width",`${n}px`]}function af(n,e,t,r,o,i){var s;let a=0,c=!0,d=e.firstChild;const u=n.firstChild;if(u!==null)for(let p=0,f=0;p<u.childCount;p+=1){const{colspan:h,colwidth:m}=u.child(p).attrs;for(let g=0;g<h;g+=1,f+=1){const b=o===f?i:m&&m[g],y=b?`${b}px`:"";if(a+=b||r,b||(c=!1),d){if(d.style.width!==y){const[k,E]=Ec(r,b);d.style.setProperty(k,E)}d=d.nextSibling}else{const k=document.createElement("col"),[E,v]=Ec(r,b);k.style.setProperty(E,v),e.appendChild(k)}}}for(;d;){const p=d.nextSibling;(s=d.parentNode)===null||s===void 0||s.removeChild(d),d=p}c?(t.style.width=`${a}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${a}px`)}let BM=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),af(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,af(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}};function LM(n,e,t,r){let o=0,i=!0;const s=[],a=n.firstChild;if(!a)return{};for(let p=0,f=0;p<a.childCount;p+=1){const{colspan:h,colwidth:m}=a.child(p).attrs;for(let g=0;g<h;g+=1,f+=1){const b=t===f?r:m&&m[g];o+=b||e,b||(i=!1);const[y,k]=Ec(e,b);s.push(["col",{style:`${y}: ${k}`}])}}const c=i?`${o}px`:"",d=i?"":`${o}px`;return{colgroup:["colgroup",{},...s],tableWidth:c,tableMinWidth:d}}function lf(n,e){return n.createAndFill()}function PM(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const r=n.nodes[t];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),n.cached.tableNodeTypes=e,e}function Jg(n,e,t,r,o){const i=PM(n),s=[],a=[];for(let d=0;d<t;d+=1){const u=lf(i.cell);if(u&&a.push(u),r){const p=lf(i.header_cell);p&&s.push(p)}}const c=[];for(let d=0;d<e;d+=1)c.push(i.row.createChecked(null,r&&d===0?s:a));return i.table.createChecked(null,c)}function $M(n){return n instanceof Le}const ds=({editor:n})=>{const{selection:e}=n.state;if(!$M(e))return!1;let t=0;const r=om(e.ranges[0].$from,i=>i.type.name==="table");return r==null||r.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},Yg=Ke.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:BM,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:n,HTMLAttributes:e}){const{colgroup:t,tableWidth:r,tableMinWidth:o}=LM(n,this.options.cellMinWidth);return["table",_e(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),t,["tbody",0]]},addCommands(){return{insertTable:({rows:n=3,cols:e=3,withHeaderRow:t=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const s=Jg(i.schema,n,e,t);if(o){const a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(Y.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:n,dispatch:e})=>QO(n,e),addColumnAfter:()=>({state:n,dispatch:e})=>eM(n,e),deleteColumn:()=>({state:n,dispatch:e})=>nM(n,e),addRowBefore:()=>({state:n,dispatch:e})=>oM(n,e),addRowAfter:()=>({state:n,dispatch:e})=>iM(n,e),deleteRow:()=>({state:n,dispatch:e})=>aM(n,e),deleteTable:()=>({state:n,dispatch:e})=>hM(n,e),mergeCells:()=>({state:n,dispatch:e})=>Jp(n,e),splitCell:()=>({state:n,dispatch:e})=>Yp(n,e),toggleHeaderColumn:()=>({state:n,dispatch:e})=>xi("column")(n,e),toggleHeaderRow:()=>({state:n,dispatch:e})=>xi("row")(n,e),toggleHeaderCell:()=>({state:n,dispatch:e})=>pM(n,e),mergeOrSplit:()=>({state:n,dispatch:e})=>Jp(n,e)?!0:Yp(n,e),setCellAttribute:(n,e)=>({state:t,dispatch:r})=>dM(n,e)(t,r),goToNextCell:()=>({state:n,dispatch:e})=>Zp(1)(n,e),goToPreviousCell:()=>({state:n,dispatch:e})=>Zp(-1)(n,e),fixTables:()=>({state:n,dispatch:e})=>(e&&Wg(n),!0),setCellSelection:n=>({tr:e,dispatch:t})=>{if(t){const r=Le.create(e.doc,n.anchorCell,n.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:ds,"Mod-Backspace":ds,Delete:ds,"Mod-Delete":ds}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[_M({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],IM({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(n){const e={name:n.name,options:n.options,storage:n.storage};return{tableRole:me(U(n,"tableRole",e))}}});function cf(n,e,t,r,o,i){let s=0,a=!0,c=e.firstChild;const d=n.firstChild;for(let u=0,p=0;u<d.childCount;u+=1){const{colspan:f,colwidth:h}=d.child(u).attrs;for(let m=0;m<f;m+=1,p+=1){const g=o===p?i:h&&h[m],b=g?`${g}px`:"";if(s+=g||r,g||(a=!1),c)c.style.width!==b&&(c.style.width=b),c=c.nextSibling;else{const y=document.createElement("col");y.className=`col-${p}`,e.appendChild(y).style.width=b}}}for(;c;){const u=c.nextSibling;c.parentNode.removeChild(c),c=u}a?(t.style.width=`${s}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${s}px`)}class FM{constructor(e,t,r){De(this,"node");De(this,"cellMinWidth");De(this,"view");De(this,"dom");De(this,"table");De(this,"colgroup");De(this,"contentDOM");this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),cf(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,cf(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}const zM=Yg.extend({addOptions(){return{HTMLAttributes:{},resizable:!0,handleWidth:5,cellMinWidth:25,View:FM,lastColumnResizable:!0,allowTableNodeSelection:!1}},addCommands(){var n;return{...(n=this.parent)==null?void 0:n.call(this),insertTable:({rows:e,cols:t,withHeaderRow:r})=>({editor:o,commands:i,tr:s,dispatch:a})=>{const c=Jg(o.schema,e,t,r);if(a){const d=s.selection.anchor+1;i.insertContent({type:"table-wrapper",content:[c.toJSON()]}),s.scrollIntoView().setSelection(Y.near(s.doc.resolve(d)))}return!0},deleteTable:()=>({state:e,dispatch:t})=>{const r=e.selection.$anchor;for(let o=r.depth;o>0;o--)if(r.node(o).type.name==="table-wrapper")return t&&t(e.tr.delete(r.before(o),r.after(o)).scrollIntoView()),!0;return!1},selectRow:e=>({tr:t,dispatch:r})=>{if(r){const o=t.doc.resolve(e),i=Le.rowSelection(o);t.setSelection(i)}return!0},selectColumn:e=>({tr:t,dispatch:r})=>{if(r){const o=t.doc.resolve(e),i=Le.colSelection(o);t.setSelection(i)}return!0}}}}),Xg=Ke.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",_e(this.options.HTMLAttributes,n),0]}}),VM={class:"add"},HM=l.createElementVNode("div",{class:"indicator"},[l.createElementVNode("svg",{width:"3",height:"3",viewBox:"0 0 3 3",fill:"none"},[l.createElementVNode("circle",{cx:"1.5",cy:"1.5",r:"1.5",fill:"#BBBFC4"})])],-1),UM=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(!1);function i(){o.value=!0}function s(){a("tableSelectRow",{pos:e.getPos()})}function a(c,d={}){c==="tableDeleteRow"&&(o.value=!1),setTimeout(()=>{r(e.editor,c,d)},0)}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(ad),l.mergeProps({class:"o-table-cell-view",as:"td"},c.node.attrs,{style:{background:c.node.attrs.background}}),{default:l.withCtx(()=>{var u;return[(u=c.editor)!=null&&u.isEditable?(l.openBlock(),l.createBlock(l.unref(xo),{key:0,modelValue:o.value,"onUpdate:modelValue":d[2]||(d[2]=p=>o.value=p),placement:"left","tippy-class":"o-row-popover",offset:[16,40],"hide-click-outside":""},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"select_all",tooltip:l.unref(t)("table.removeColumn"),onClick:s},null,8,["tooltip"]),l.createVNode(l.unref(st),{icon:"delete",tooltip:l.unref(t)("table.removeRow"),onClick:d[1]||(d[1]=p=>a("tableDeleteRow"))},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createElementVNode("section",{class:l.normalizeClass(["row-handler",{active:o.value}]),onClick:i},[l.createElementVNode("div",VM,[HM,l.createVNode(l.unref(Us),{icon:"add_circle",color:l.unref(Ee).blue,tooltip:l.unref(t)("table.addRow"),placement:"left",onClick:d[0]||(d[0]=l.withModifiers(p=>a("tableAddRow"),["stop"]))},null,8,["color","tooltip"])])],2)]),_:1},8,["modelValue"])):l.createCommentVNode("",!0),l.createVNode(l.unref(Xn))]}),_:1},16,["style"]))}}),WM=Xg.extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),background:{default:""}}},addNodeView(){return yn(UM,{stopEvent:()=>!1})}}),Zg=Ke.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",_e(this.options.HTMLAttributes,n),0]}}),qM={class:"add"},KM=l.createElementVNode("div",{class:"indicator"},[l.createElementVNode("svg",{width:"3",height:"3",viewBox:"0 0 3 3",fill:"none"},[l.createElementVNode("circle",{cx:"1.5",cy:"1.5",r:"1.5",fill:"#BBBFC4"})])],-1),GM={class:"add"},jM=l.createElementVNode("div",{class:"indicator"},[l.createElementVNode("svg",{width:"3",height:"3",viewBox:"0 0 3 3",fill:"none"},[l.createElementVNode("circle",{cx:"1.5",cy:"1.5",r:"1.5",fill:"#BBBFC4"})])],-1),JM=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(!1),i=l.ref(!1);function s(){setTimeout(()=>{o.value=!0},0)}function a(){i.value=!0}function c(){o.value=!1,u("tableSelectColumn",{pos:e.getPos()})}function d(){u("tableSelectRow",{pos:e.getPos()})}function u(p,f={}){p==="tableDeleteRow"?i.value=!1:p==="tableDeleteColumn"&&(o.value=!1),setTimeout(()=>{r(e.editor,p,f)},0)}return(p,f)=>(l.openBlock(),l.createBlock(l.unref(ad),l.mergeProps({class:"o-table-header-view",as:"th"},p.node.attrs,{style:{background:p.node.attrs.background}}),{default:l.withCtx(()=>{var h;return[(h=p.editor)!=null&&h.isEditable?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(l.unref(xo),{modelValue:o.value,"onUpdate:modelValue":f[2]||(f[2]=m=>o.value=m),placement:"top","tippy-class":"o-column-popover",offset:[0,20],"hide-click-outside":""},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"select_all",tooltip:l.unref(t)("table.removeColumn"),onClick:c},null,8,["tooltip"]),l.createVNode(l.unref(st),{icon:"delete",tooltip:l.unref(t)("table.removeColumn"),onClick:f[1]||(f[1]=m=>u("tableDeleteColumn"))},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createElementVNode("section",{class:l.normalizeClass(["col-handler",{active:o.value}]),onClick:s},[l.createElementVNode("div",qM,[KM,l.createVNode(l.unref(Us),{icon:"add_circle",color:l.unref(Ee).blue,tooltip:l.unref(t)("table.addColumn"),onClick:f[0]||(f[0]=l.withModifiers(m=>u("tableAddColumn"),["stop"]))},null,8,["color","tooltip"])])],2)]),_:1},8,["modelValue"]),l.createVNode(l.unref(xo),{modelValue:i.value,"onUpdate:modelValue":f[5]||(f[5]=m=>i.value=m),placement:"left","tippy-class":"o-row-popover",offset:[15,40],"hide-click-outside":""},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"select_all",tooltip:l.unref(t)("table.removeColumn"),onClick:d},null,8,["tooltip"]),l.createVNode(l.unref(st),{icon:"delete",tooltip:l.unref(t)("table.removeRow"),onClick:f[4]||(f[4]=m=>u("tableDeleteRow"))},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createElementVNode("section",{class:l.normalizeClass(["row-handler",{active:i.value}]),onClick:a},[l.createElementVNode("div",GM,[jM,l.createVNode(l.unref(Us),{icon:"add_circle",color:l.unref(Ee).blue,tooltip:l.unref(t)("table.addRow"),placement:"left",onClick:f[3]||(f[3]=l.withModifiers(m=>u("tableAddRow"),["stop"]))},null,8,["color","tooltip"])])],2)]),_:1},8,["modelValue"])],64)):l.createCommentVNode("",!0),l.createVNode(l.unref(Xn))]}),_:1},16,["style"]))}}),YM=Zg.extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),background:{default:""}}},addNodeView(){return yn(JM,{stopEvent:()=>!1})}}),XM=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.inject("sideNode",{value:!1}),r=l.ref(!1),o=l.computed(()=>{const{selection:s}=e.editor.view.state,a=s.from,c=e.getPos(),d=c+e.node.nodeSize;return a>=c&&a<=d});function i(s){r.value=s}return l.watch(o,s=>{i(s)}),(s,a)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:["o-table-wrapper-view",{"side-node-enabled":l.unref(t)}]}),{default:l.withCtx(()=>[l.createVNode(l.unref(Xn),{as:"table"})]),_:1},16,["class"]))}}),ZM=Ke.create({name:"table-wrapper",group:"block",content:"table",draggable:!0,parseHTML(){return[{tag:"table-wrapper"}]},renderHTML({HTMLAttributes:n}){return["table-wrapper",_e(n),0]},addNodeView(){return yn(XM,{stopEvent:()=>!1})}});function QM({node:n,types:e}){return Array.isArray(e)&&e.includes(n==null?void 0:n.type)||(n==null?void 0:n.type)===e}function us({node:n,types:e}){return n?!QM({node:n,types:e}):!1}const eA=Ae.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph"]}},addProseMirrorPlugins(){const n=new $e(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>this.options.notAfter.includes(t.name));return[new Te({key:n,appendTransaction:(t,r,o)=>{const{doc:i,tr:s,schema:a}=o,c=n.getState(o),d=i.content.size,u=a.nodes[this.options.node];if(c)return s.insert(d,u.create())},state:{init:(t,r)=>{const o=r.tr.doc.lastChild,i=(o==null?void 0:o.firstChild)??null;return us({node:o,types:e})||us({node:i,types:e})},apply:(t,r)=>{var s;if(!t.docChanged)return r;const o=t.doc.lastChild,i=((s=t.doc.lastChild)==null?void 0:s.firstChild)??null;return us({node:o,types:e})||us({node:i,types:e})}}})]}});var ft=[];for(var Rl=0;Rl<256;++Rl)ft.push((Rl+256).toString(16).slice(1));function tA(n,e=0){return(ft[n[e+0]]+ft[n[e+1]]+ft[n[e+2]]+ft[n[e+3]]+"-"+ft[n[e+4]]+ft[n[e+5]]+"-"+ft[n[e+6]]+ft[n[e+7]]+"-"+ft[n[e+8]]+ft[n[e+9]]+"-"+ft[n[e+10]]+ft[n[e+11]]+ft[n[e+12]]+ft[n[e+13]]+ft[n[e+14]]+ft[n[e+15]]).toLowerCase()}var ps,nA=new Uint8Array(16);function rA(){if(!ps&&(ps=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ps))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ps(nA)}var oA=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const df={randomUUID:oA};function iA(n,e,t){if(df.randomUUID&&!n)return df.randomUUID();n=n||{};var r=n.random||(n.rng||rA)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,tA(r)}const sA=()=>iA(),aA=Ae.create({name:"uniqueID",priority:1e4,addOptions:()=>({attributeName:"data-id",types:["heading"],enableRender:!1,generateId:()=>sA()}),addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:this.options.generateId(),parseHTML:n=>n.getAttribute(this.options.attributeName),renderHTML:n=>this.options.enableRender?{[this.options.attributeName]:n[this.options.attributeName]}:{}}}}]}}),lA={key:1,class:"video-container"},cA=l.createElementVNode("div",{class:"video-cover"},null,-1),dA={key:1},uA=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.ref(!1),r=l.ref({}),o=l.ref(null),i=l.ref(!1),s=l.ref(!1),a=l.computed({get(){return e.node.attrs.caption},set(b){e.updateAttributes({caption:b})}}),c=l.computed({get(){return e.node.attrs.src},set(b){e.updateAttributes({src:b})}});function d(b){switch(t.value=!1,b.value){case"replace":g(!0);break}}function u(){i.value=!0,setTimeout(()=>{var b;(b=o.value)==null||b.focus()},0)}function p(){i.value=!1}function f(){c.value==="init"&&g(!0)}function h(b){t.value=!0,r.value=b}function m(b){c.value=b,g(!1)}function g(b){s.value=b}return l.onMounted(()=>{g(c.value==="init")}),(b,y)=>{var k;return l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:["o-video-view",{readonly:!((k=b.editor)!=null&&k.isEditable),init:c.value==="init"}],as:"div",onContextmenu:l.withModifiers(h,["prevent"]),onClick:f}),{default:l.withCtx(()=>[l.createVNode(l.unref(xo),{modelValue:s.value,"onUpdate:modelValue":y[1]||(y[1]=E=>s.value=E),placement:c.value==="init"?"bottom":"top"},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(fd),{val:c.value==="init"?"":c.value,type:"video",onInput:m},null,8,["val"])]),default:l.withCtx(()=>{var E;return[c.value==="init"?(l.openBlock(),l.createBlock(l.unref(cd),{key:0,icon:"videocam",placeholder:"Add a video"})):(l.openBlock(),l.createElementBlock("div",lA,[cA,l.createVNode(l.unref(ud),l.mergeProps(e,{onAction:d}),{default:l.withCtx(()=>[l.createVNode(l.unref(Me),{icon:"subtitles",tooltip:"image.caption",onClick:u})]),_:1},16),l.createElementVNode("video",l.mergeProps(b.node.attrs,{draggable:"true","data-drag-handle":"",controls:""}),[l.createElementVNode("source",l.normalizeProps(l.guardReactiveProps(b.node.attrs)),null,16)],16),l.createElementVNode("div",{class:"caption",onClick:u},[(E=b.editor)!=null&&E.isEditable&&i.value?(l.openBlock(),l.createBlock(l.unref(Ao),{key:0,ref_key:"captionInput",ref:o,class:"caption-input",modelValue:a.value,"onUpdate:modelValue":y[0]||(y[0]=v=>a.value=v),type:"text",placeholder:"Input caption",autosize:"",onBlur:p},null,8,["modelValue"])):(l.openBlock(),l.createElementBlock("span",dA,l.toDisplayString(a.value),1))])]))]}),_:1},8,["modelValue","placement"]),l.createVNode(l.unref(Ba),{modelValue:t.value,"onUpdate:modelValue":y[2]||(y[2]=E=>t.value=E),event:r.value},{default:l.withCtx(()=>[l.createVNode(l.unref(Xr),l.mergeProps(e,{onAction:d}),null,16)]),_:1},8,["modelValue","event"])]),_:1},16,["class","onContextmenu"])}}}),pA=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,fA=Ke.create({name:"video",draggable:!0,addOptions(){return{inline:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{caption:{default:"",rendered:!1},src:{default:null,parseHTML:n=>{const e=n.firstElementChild;return(e==null?void 0:e.src)??""}}}},parseHTML(){return[{tag:"video"}]},renderHTML({node:n,HTMLAttributes:e}){return["video",{caption:n.attrs.caption},["source",_e(this.options.HTMLAttributes,e)]]},addCommands(){return{setVideo:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Zc({find:pA,type:this.type,getAttributes:n=>{const[e]=n;return{src:e}}})]},addNodeView(){return yn(uA)}}),uf=["BackColor","Focus","FontFamily","ForeColor","Table","TaskItem","TaskList","TextAlign","Typography","Underline","OHorizontalRule","OUniqueID"],hA=["BackColor","Blockquote","Bold","BulletList","Code","CodeBlockLowlight","Focus","FontFamily","ForeColor","HorizontalRule","Image","Italic","Link","ListItem","OrderedList","Strike","Table","TaskItem","TaskList","TextAlign","Typography","Underline"],mA=["OBlockquote","OCallout","OCodeBlock","OColon","OColorHighlighter","OColumnExtension","ODiagram","ODoc","ODraggableItem","OEmbed","OFocus","OFontFamily","OFormatClear","OHeading","OHorizontalRule","OIframe","OImage","OIndent","OInsertHtml","OKatexBlock","OKatexInline","OLineHeight","OLink","OModelViewer","OParagraph","OPrint","OSlash","OSlashZh","OTOC","OTableWrapper","OTitle","OTodoItem","OTrailingNode","OUniqueID","OVideo"],gA=[...hA,...mA],bA=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,yA=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,vA=ln.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Kr({find:bA,type:this.type})]},addPasteRules(){return[vr({find:yA,type:this.type})]}}),kA=Ae.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Te({key:new $e("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:o}=e,i=[];if(!t||!r)return Ne.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((c,d)=>{if(c.isText)return;if(!(o>=d&&o<=d+c.nodeSize-1))return!1;s+=1});let a=0;return n.descendants((c,d)=>{if(c.isText||!(o>=d&&o<=d+c.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(Ze.node(d,d+c.nodeSize,{class:this.options.className}))}),Ne.create(n,i)}}})]}}),wA=Ae.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:n=>n.style.fontFamily,renderHTML:n=>n.fontFamily?{style:`font-family: ${n.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:n=>({chain:e})=>e().setMark("textStyle",{fontFamily:n}).run(),unsetFontFamily:()=>({chain:n})=>n().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),EA=Ae.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var e;return(e=n.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:e})=>e().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),CA=/^\s*(\[([( |x])?\])\s$/,_A=Ke.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",_e(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),c=document.createElement("div");return i.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:u}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const f=t();if(typeof f!="number")return!1;const h=p.doc.nodeAt(f);return p.setNodeMarkup(f,void 0,{...h==null?void 0:h.attrs,checked:u}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,u)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,u])=>{o.setAttribute(d,u)}),o.dataset.checked=n.attrs.checked,a.checked=n.attrs.checked,i.append(a,s),o.append(i,c),Object.entries(e).forEach(([d,u])=>{o.setAttribute(d,u)}),{dom:o,contentDOM:c,update:d=>d.type!==this.type?!1:(o.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,!0)}}},addInputRules(){return[wo({find:CA,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),SA=Ke.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:n}){return["ul",_e(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),xA=Ae.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:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).every(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.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")}}}),NA=n=>Ye({find:/--$/,replace:n??"—"}),TA=n=>Ye({find:/\.\.\.$/,replace:n??"…"}),OA=n=>Ye({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:n??"“"}),MA=n=>Ye({find:/"$/,replace:n??"”"}),AA=n=>Ye({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:n??"‘"}),RA=n=>Ye({find:/'$/,replace:n??"’"}),DA=n=>Ye({find:/<-$/,replace:n??"←"}),IA=n=>Ye({find:/->$/,replace:n??"→"}),BA=n=>Ye({find:/\(c\)$/,replace:n??"©"}),LA=n=>Ye({find:/\(tm\)$/,replace:n??"™"}),PA=n=>Ye({find:/\(sm\)$/,replace:n??"℠"}),$A=n=>Ye({find:/\(r\)$/,replace:n??"®"}),FA=n=>Ye({find:/(?:^|\s)(1\/2)\s$/,replace:n??"½"}),zA=n=>Ye({find:/\+\/-$/,replace:n??"±"}),VA=n=>Ye({find:/!=$/,replace:n??"≠"}),HA=n=>Ye({find:/<<$/,replace:n??"«"}),UA=n=>Ye({find:/>>$/,replace:n??"»"}),WA=n=>Ye({find:/\d+\s?([*x])\s?\d+$/,replace:n??"×"}),qA=n=>Ye({find:/\^2$/,replace:n??"²"}),KA=n=>Ye({find:/\^3$/,replace:n??"³"}),GA=n=>Ye({find:/(?:^|\s)(1\/4)\s$/,replace:n??"¼"}),jA=n=>Ye({find:/(?:^|\s)(3\/4)\s$/,replace:n??"¾"}),JA=Ae.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const n=[];return this.options.emDash!==!1&&n.push(NA(this.options.emDash)),this.options.ellipsis!==!1&&n.push(TA(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&n.push(OA(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&n.push(MA(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&n.push(AA(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&n.push(RA(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&n.push(DA(this.options.leftArrow)),this.options.rightArrow!==!1&&n.push(IA(this.options.rightArrow)),this.options.copyright!==!1&&n.push(BA(this.options.copyright)),this.options.trademark!==!1&&n.push(LA(this.options.trademark)),this.options.servicemark!==!1&&n.push(PA(this.options.servicemark)),this.options.registeredTrademark!==!1&&n.push($A(this.options.registeredTrademark)),this.options.oneHalf!==!1&&n.push(FA(this.options.oneHalf)),this.options.plusMinus!==!1&&n.push(zA(this.options.plusMinus)),this.options.notEqual!==!1&&n.push(VA(this.options.notEqual)),this.options.laquo!==!1&&n.push(HA(this.options.laquo)),this.options.raquo!==!1&&n.push(UA(this.options.raquo)),this.options.multiplication!==!1&&n.push(WA(this.options.multiplication)),this.options.superscriptTwo!==!1&&n.push(qA(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&n.push(KA(this.options.superscriptThree)),this.options.oneQuarter!==!1&&n.push(GA(this.options.oneQuarter)),this.options.threeQuarters!==!1&&n.push(jA(this.options.threeQuarters)),n}}),YA=ln.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Qg=Ke.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",_e(this.options.HTMLAttributes,n),0]}});function XA(n){var e;const{char:t,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=n,c=r&&!o,d=LE(t),u=new RegExp(`\\s${d}$`),p=s?"^":"",f=o?"":d,h=c?new RegExp(`${p}${d}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${p}(?:^)?${d}[^\\s${f}]*`,"gm"),m=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!m)return null;const g=a.pos-m.length,b=Array.from(m.matchAll(h)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const y=b.input.slice(Math.max(0,b.index-1),b.index),k=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!k)return null;const E=g+b.index;let v=E+b[0].length;return c&&u.test(m.slice(v-1,v+1))&&(b[0]+=" ",v+=1),E<a.pos&&v>=a.pos?{range:{from:E,to:v},query:b[0].slice(t.length),text:b[0]}:null}const ZA=new $e("suggestion");function eb({pluginKey:n=ZA,editor:e,char:t="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:c="suggestion",command:d=()=>null,items:u=()=>[],render:p=()=>({}),allow:f=()=>!0,findSuggestionMatch:h=XA}){let m;const g=p==null?void 0:p(),b=new Te({key:n,view(){return{update:async(y,k)=>{var E,v,_,C,D,B,A;const $=(E=this.key)===null||E===void 0?void 0:E.getState(k),J=(v=this.key)===null||v===void 0?void 0:v.getState(y.state),te=$.active&&J.active&&$.range.from!==J.range.from,de=!$.active&&J.active,ce=$.active&&!J.active,re=!de&&!ce&&$.query!==J.query,oe=de||te&&re,N=re||te,M=ce||te&&re;if(!oe&&!N&&!M)return;const z=M&&!oe?$:J,j=y.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);m={editor:e,range:z.range,query:z.query,text:z.text,items:[],command:Q=>d({editor:e,range:z.range,props:Q}),decorationNode:j,clientRect:j?()=>{var Q;const{decorationId:fe}=(Q=this.key)===null||Q===void 0?void 0:Q.getState(e.state),Se=y.dom.querySelector(`[data-decoration-id="${fe}"]`);return(Se==null?void 0:Se.getBoundingClientRect())||null}:null},oe&&((_=g==null?void 0:g.onBeforeStart)===null||_===void 0||_.call(g,m)),N&&((C=g==null?void 0:g.onBeforeUpdate)===null||C===void 0||C.call(g,m)),(N||oe)&&(m.items=await u({editor:e,query:z.query})),M&&((D=g==null?void 0:g.onExit)===null||D===void 0||D.call(g,m)),N&&((B=g==null?void 0:g.onUpdate)===null||B===void 0||B.call(g,m)),oe&&((A=g==null?void 0:g.onStart)===null||A===void 0||A.call(g,m))},destroy:()=>{var y;m&&((y=g==null?void 0:g.onExit)===null||y===void 0||y.call(g,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(y,k,E,v){const{isEditable:_}=e,{composing:C}=e.view,{selection:D}=y,{empty:B,from:A}=D,$={...k};if($.composing=C,_&&(B||e.view.composing)){(A<k.range.from||A>k.range.to)&&!C&&!k.composing&&($.active=!1);const J=h({char:t,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:D.$from}),te=`id_${Math.floor(Math.random()*4294967295)}`;J&&f({editor:e,state:v,range:J.range,isActive:k.active})?($.active=!0,$.decorationId=k.decorationId?k.decorationId:te,$.range=J.range,$.query=J.query,$.text=J.text):$.active=!1}else $.active=!1;return $.active||($.decorationId=null,$.range={from:0,to:0},$.query=null,$.text=null),$}},props:{handleKeyDown(y,k){var E;const{active:v,range:_}=b.getState(y.state);return v&&((E=g==null?void 0:g.onKeyDown)===null||E===void 0?void 0:E.call(g,{view:y,event:k,range:_}))||!1},decorations(y){const{active:k,range:E,decorationId:v}=b.getState(y);return k?Ne.create(y.doc,[Ze.inline(E.from,E.to,{nodeName:a,class:c,"data-decoration-id":v})]):null}}});return b}const QA=Ae.create({name:"slash",addOptions(){return{suggestion:{char:"/",command:({editor:n,range:e,props:t})=>{t.command({editor:n,range:e})}}}},addProseMirrorPlugins(){return[eb({editor:this.editor,...this.options.suggestion})]}}),eR=Ae.create({name:"slash-zh",addOptions(){return{suggestion:{char:"、",command:({editor:n,range:e,props:t})=>{t.command({editor:n,range:e})}}}},addProseMirrorPlugins(){return[eb({pluginKey:new $e("slash-zh-suggestion"),editor:this.editor,...this.options.suggestion})]}}),tR={props:{items:{type:Array,required:!0},command:{type:Function,required:!0},editor:{type:Object},range:{type:Object}},setup(){const{locale:n,tr:e}=ve(),{onCommand:t}=Pe();return{locale:n,tr:e,onCommand:t}},data(){return{view:"main",selectedIndex:0}},components:{ODivider:Xt,OIcon:ie,OList:un,OListItem:Zt},watch:{items(){this.selectedIndex=0}},methods:{onClick(n){switch(n.value){default:this.run(n);break}return!0},run(n){const e=this.editor.chain().focus().deleteRange(this.range),t=this.editor.commands;switch(n.value){case"codeBlock":t.deleteRange(this.range),this.editor.commands.setCodeBlock({language:"bash"});break;case"content":t.deleteRange(this.range),this.editor.commands.insertContent(n.options.content);break;case"taskList":t.deleteRange(this.range),this.editor.commands.toggleTaskList();break;default:this.onCommand(t,e,n.value,n.options);break}},onKeyDown({event:n}){return n.key==="ArrowUp"?(this.upHandler(),!0):n.key==="ArrowDown"?(this.downHandler(),!0):n.key==="Enter"?(this.enterHandler(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length},enterHandler(){this.selectItem(this.selectedIndex)},selectItem(n){const e=this.items[n];e&&this.onClick(e)},setEmoji(n){this.onClick({value:"content",options:{content:n}})}},computed:{basicBlocks(){return Li.slice(1)}},mounted(){this.selectedIndex=0}},nR=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},rR={key:0,class:"view-main"},oR={class:"group o-tips"},iR={class:"o-tips"},sR={key:1,class:"item"},aR={key:1,class:"view-emoji"},lR={key:2,class:"view-emoji"};function cR(n,e,t,r,o,i){const s=l.resolveComponent("o-divider"),a=l.resolveComponent("o-icon"),c=l.resolveComponent("o-list-item"),d=l.resolveComponent("o-list");return l.openBlock(),l.createElementBlock("section",{class:l.normalizeClass(["o-slash-view o-shadow-3 o-menu o-scroll",`view-${o.view}`])},[o.view==="main"?(l.openBlock(),l.createElementBlock("section",rR,[l.createVNode(d,{hoverable:"",clickable:""},{default:l.withCtx(()=>[t.items.length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(t.items,(u,p)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:p},[u.group?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[p>0?(l.openBlock(),l.createBlock(s,{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",oR,l.toDisplayString(r.tr(u.group)),1)],64)):l.createCommentVNode("",!0),l.createVNode(c,{class:l.normalizeClass(["item",{"is-active":p===o.selectedIndex}]),clickable:"",onClick:f=>i.onClick(u)},{prefix:l.withCtx(()=>[l.createVNode(a,{name:u.icon,color:u.color},null,8,["name","color"])]),suffix:l.withCtx(()=>[l.createElementVNode("span",iR,l.toDisplayString(u.tips),1)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(r.tr(u.label)),1)]),_:2},1032,["class","onClick"])],64))),128)):(l.openBlock(),l.createElementBlock("div",sR,"No result"))]),_:1})])):o.view==="emoji"?(l.openBlock(),l.createElementBlock("section",aR)):o.view==="ai"?(l.openBlock(),l.createElementBlock("section",lR)):l.createCommentVNode("",!0)],2)}const dR=nR(tR,[["render",cR]]),pf={items:({query:n})=>dd.filter(e=>e.value.toLowerCase().startsWith(n.toLowerCase())),render:()=>{let n,e;return{onStart:t=>{n=new Rm(dR,{props:t,editor:t.editor}),e=In("body",{getReferenceClientRect:t.clientRect,appendTo:()=>document.body,content:n.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1})},onUpdate(t){n.updateProps(t),e[0].setProps({getReferenceClientRect:t.clientRect})},onKeyDown(t){var r;return t.event.key==="Escape"?(e[0].hide(),n.destroy(),!0):(r=n.ref)==null?void 0:r.onKeyDown(t)},onExit(){e[0].destroy(),n.destroy()}}}},uR={BackColor:vA.configure({multicolor:!0}),Focus:kA,ForeColor:EA,FontFamily:wA,Image:Og,Link:Fg,TextAlign:xA.configure({types:["heading","paragraph"]}),TaskItem:_A,TaskList:SA.configure({itemTypeName:"taskItem"}),Underline:YA,Typography:JA,OSlash:QA.configure({suggestion:pf}),OSlashZh:eR.configure({suggestion:pf}),OBlockquote:pN,OCallout:bN,OCodeBlock:QT,OColorHighlighter:eO,OHeading:nO,OHorizontalRule:iO,OImage:dO,OLink:IO.configure({openOnClick:!1}),OParagraph:LO,OTrailingNode:eA,OUniqueID:aA.configure({attributeName:"data-id",enableRender:!1,types:["heading","paragraph"]}),OVideo:fA};class pR{constructor(e){return uR[e]}}const fR=[ZM,zM.configure({resizable:!0}),Qg,YM,WM];Yg.configure({resizable:!0});const hR=["data-theme"],tb=l.defineComponent({__name:"YiiEditor",props:{content:{type:[String,Object],default:""},editable:{type:Boolean,default:!0},locale:{type:String,default:"en"},darkMode:{type:Boolean,default:!1},showMainMenu:{type:Boolean,default:!1},showBubbleMenu:{type:Boolean,default:!1},showFloatingMenu:{type:Boolean,default:!1},showSideMenu:{type:Boolean,default:!1},showSideNode:{type:Boolean,default:!1},showContent:{type:Boolean,default:!0},showGuide:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},editorProps:{type:Object,default:function(){return{}}},extensions:{type:Array,default:function(){return[]}},mainMenu:{type:Array,default:function(){return[]}},tableMenu:{type:Array,default:function(){return[]}},bubbleMenu:{type:Array,default:function(){return[]}},floatingMenu:{type:Array,default:function(){return[]}},pageView:{type:String,default:"page"},options:{type:Object,default:function(){return{}}}},emits:["transaction","update"],setup(n,{expose:e,emit:t}){const r=n,o=t,{tr:i}=ve(),s=l.ref(!1),a=l.ref("en"),c=l.ref(!1);l.provide("darkMode",s),l.provide("locale",a),l.provide("sideNode",c);const d=l.computed(()=>g()),u=EC({editable:r.editable,content:r.content,extensions:d.value,onUpdate:()=>{var k,E;const b=(k=u.value)==null?void 0:k.getJSON(),y=(E=u.value)==null?void 0:E.getHTML();o("update",{json:b,html:y})},onTransaction:({editor:b,transaction:y})=>{o("transaction",{editor:b,transaction:y})}}),p=l.computed(()=>({editor:u.value,menu:r.mainMenu})),f=l.computed(()=>({editor:u.value,menu:r.bubbleMenu})),h=l.computed(()=>({editor:u.value,menu:r.floatingMenu})),m=l.computed(()=>({editor:u.value,menu:[]}));function g(){const b=[];b.push(PO.configure({placeholder:({editor:k,node:E,pos:v})=>{if(E.type.name==="heading"){const _=E.attrs.level;return v>0?`H${_}`:i("label.untitled")}else return E.type.name==="paragraph"?i("label.typeForCommands"):""}})),b.push(k_),b.push(y_.configure({blockquote:r.extensions.includes("OBlockquote")?!1:{},codeBlock:!1,heading:r.extensions.includes("OHeading")?!1:{levels:[1,2,3,4,5]},paragraph:r.extensions.includes("OParagraph")?!1:{},dropcursor:{width:5,color:"skyblue",class:"yiitap-dropcursor"},horizontalRule:!1})),console.log("default",uf);const y=uf.concat(r.extensions);for(const k of y)if(typeof k=="string"){if(!gA.includes(k))continue;switch(k){case"Table":b.push(...fR);break;default:try{const E=new pR(k);b.push(E),console.log("dynamic extension",k,E)}catch(E){console.error(E.message)}break}}else b.push(k);return b}return l.watch(()=>r.darkMode,b=>{s.value=b}),l.watch(()=>r.locale,b=>{a.value=b}),l.watch(()=>r.editable,b=>{var y;(y=u.value)==null||y.setEditable(b)}),l.onBeforeMount(()=>{s.value=r.darkMode,a.value=r.locale,c.value=!r.showSideMenu&&r.showSideNode}),e({editor:u,darkModeAlt:s,localeAlt:a}),(b,y)=>{var k,E,v;return l.openBlock(),l.createElementBlock("main",{class:"yiitap yiitap-editor","data-theme":s.value?"dark":""},[n.showMainMenu?(l.openBlock(),l.createBlock(Xm,l.mergeProps({key:0},p.value,{class:"desktop-only"}),{left:l.withCtx(()=>[l.renderSlot(b.$slots,"toolbar-left")]),right:l.withCtx(()=>[l.renderSlot(b.$slots,"toolbar-right")]),_:3},16)):l.createCommentVNode("",!0),(k=l.unref(u))!=null&&k.isEditable&&n.showBubbleMenu?(l.openBlock(),l.createBlock(Jx,l.normalizeProps(l.mergeProps({key:1},f.value)),null,16)):l.createCommentVNode("",!0),(E=l.unref(u))!=null&&E.isEditable&&n.showFloatingMenu?(l.openBlock(),l.createBlock(Zx,l.normalizeProps(l.mergeProps({key:2},h.value)),null,16)):l.createCommentVNode("",!0),(v=l.unref(u))!=null&&v.isEditable&&n.showSideMenu?(l.openBlock(),l.createBlock(dN,l.normalizeProps(l.mergeProps({key:3},m.value)),null,16)):l.createCommentVNode("",!0),l.createVNode(l.unref(kC),{class:l.normalizeClass(["editor-content",n.pageView]),editor:l.unref(u)},null,8,["class","editor"])],8,hR)}}}),mR={installed:!1,spellcheck:!0,install(n){this.installed=!0,n.component("YiiEditor",tb)}};exports.AddNode=Jm;exports.DragNode=Ym;exports.OBlockMenu=Xr;exports.OBlockPlaceholder=cd;exports.OBlockPopover=xo;exports.OBlockToolbar=ud;exports.OBtn=Bt;exports.OCalloutColorBoard=pd;exports.OCalloutColorDropdown=q_;exports.OCheckbox=md;exports.OColorBoard=La;exports.OCommandBtn=st;exports.OCommonBtn=Us;exports.OContextMenu=Ba;exports.ODivider=Xt;exports.OIcon=ie;exports.OInput=Ao;exports.OLanguageDropdown=Um;exports.OList=un;exports.OListItem=Zt;exports.OMainMenu=Xm;exports.OMediaInput=fd;exports.OMenubarBtn=Me;exports.OMetaInput=hd;exports.ONodeView=Bn;exports.OPopover=qe;exports.OTableCellBackground=qm;exports.OTableGrid=Wm;exports.OTextColorBoard=Km;exports.OTooltip=_r;exports.YiiEditor=tb;exports.YiiEditorPlugin=mR;exports.useI18n=ve;exports.useTheme=Bi;exports.useTiptap=Pe;
|
|
125
|
+
3. "-" cannot repeat`);We.customSchemes.push([n,e])}function NO(){We.scanner=vO(We.customSchemes);for(let n=0;n<We.tokenQueue.length;n++)We.tokenQueue[n][1]({scanner:We.scanner});We.parser=EO(We.scanner.tokens);for(let n=0;n<We.pluginQueue.length;n++)We.pluginQueue[n][1]({scanner:We.scanner,parser:We.parser});return We.initialized=!0,We}function Ad(n){return We.initialized||NO(),CO(We.parser.start,n,Pg(We.scanner.start,n))}Ad.scan=Pg;function Fg(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Md(t),o=Ad(n),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 TO(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function OO(n){return new Te({key:new $e("autolink"),appendTransaction:(e,t,r)=>{const o=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),i=e.some(d=>d.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=Qw(t.doc,[...e]);if(iE(a).forEach(({newRange:d})=>{const u=tE(r.doc,d,h=>h.isTextblock);let p,f;if(u.length>1?(p=u[0],f=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(p=u[0],f=r.doc.textBetween(p.pos,d.to,void 0," ")),p&&f){const h=f.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;const m=h[h.length-1],g=p.pos+f.lastIndexOf(m);if(!m)return!1;const b=Ad(m).map(y=>y.toObject(n.defaultProtocol));if(!TO(b))return!1;b.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{Yc(y.from,y.to,r.doc).some(k=>k.mark.type===n.type)||s.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function MO(n){return new Te({key:new $e("handleClickLink"),props:{handleClick:(e,t,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(f=>f.nodeName==="A"))return!1;const c=sm(e.state,n.type.name),d=r.target,u=(o=d==null?void 0:d.href)!==null&&o!==void 0?o:c.href,p=(i=d==null?void 0:d.target)!==null&&i!==void 0?i:c.target;return d&&u?(window.open(u,p),!0):!1}}})}function AO(n){return new Te({key:new $e("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(d=>{a+=d.textContent});const c=Fg(a,{defaultProtocol:n.defaultProtocol}).find(d=>d.isLink&&d.value===a);return!a||!c?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}const RO=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function xr(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&t.push(o)}),!n||n.replace(RO,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const zg=ln.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(n=>{if(typeof n=="string"){Gp(n);return}Gp(n.scheme,n.optionalSlashes)})},onDestroy(){xO()},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:(n,e)=>!!xr(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.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:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!xr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!xr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",_e(this.options.HTMLAttributes,n),0]:["a",_e(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!xr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vr({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,o=Fg(n).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!xr(s,t),protocols:t,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:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(OO({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!xr(o,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(MO({type:this.type})),this.options.linkOnPaste&&n.push(AO({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}});function DO(n){return new Te({key:new $e("handleClickSelectLink"),props:{handleClick:(e,t,r)=>{const{schema:o,doc:i,tr:s}=e.state,a=Mo(i.resolve(t),o.marks.link);if(!a)return!1;const c=i.resolve(a.from),d=i.resolve(a.to),u=s.setSelection(new Y(c,d));return e.dispatch(u),!0}}})}const IO=zg.extend({addProseMirrorPlugins(){var n;return[...((n=this.parent)==null?void 0:n.call(this))||[],DO({type:this.type})]}}).configure({openOnClick:!1}),BO=l.defineComponent({__name:"view",props:ct,setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:"o-paragraph-view"}),{default:l.withCtx(()=>[l.createVNode(l.unref(Xn),{as:"p",style:l.normalizeStyle(`text-align: ${t.node.attrs.textAlign}`)},null,8,["style"])]),_:1},16))}}),LO=Hm.extend({draggable:!1,addNodeView(){return yn(BO,{stopEvent:()=>!1})}}),PO=Ae.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Te({key:new $e("placeholder"),props:{decorations:({doc:n,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];return t?(n.descendants((i,s)=>{const a=r>=s&&r<=s+i.nodeSize,c=!i.isLeaf&&!i.childCount,d=this.options.showOnlyCurrent;if((a||!d)&&c){const u=[this.options.emptyNodeClass];this.editor.isEmpty&&u.push(this.options.emptyEditorClass);const p=Ze.node(s,s+i.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:s,hasAnchor:a}):this.options.placeholder});o.push(p)}return this.options.includeChildren}),Ne.create(n,o)):null}}})]}});var bc,yc;if(typeof WeakMap<"u"){let n=new WeakMap;bc=e=>n.get(e),yc=(e,t)=>(n.set(e,t),t)}else{const n=[];let t=0;bc=r=>{for(let o=0;o<n.length;o+=2)if(n[o]==r)return n[o+1]},yc=(r,o)=>(t==10&&(t=0),n[t++]=r,n[t++]=o)}var Je=class{constructor(n,e,t,r){this.width=n,this.height=e,this.map=t,this.problems=r}findCell(n){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=n)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]==t;a++)i++;for(let a=1;s<this.height&&this.map[e+this.width*a]==t;a++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${n} found`)}colCount(n){for(let e=0;e<this.map.length;e++)if(this.map[e]==n)return e%this.width;throw new RangeError(`No cell with offset ${n} found`)}nextCell(n,e,t){const{left:r,right:o,top:i,bottom:s}=this.findCell(n);return e=="horiz"?(t<0?r==0:o==this.width)?null:this.map[i*this.width+(t<0?r-1:o)]:(t<0?i==0:s==this.height)?null:this.map[r+this.width*(t<0?i-1:s)]}rectBetween(n,e){const{left:t,right:r,top:o,bottom:i}=this.findCell(n),{left:s,right:a,top:c,bottom:d}=this.findCell(e);return{left:Math.min(t,s),top:Math.min(o,c),right:Math.max(r,a),bottom:Math.max(i,d)}}cellsInRect(n){const e=[],t={};for(let r=n.top;r<n.bottom;r++)for(let o=n.left;o<n.right;o++){const i=r*this.width+o,s=this.map[i];t[s]||(t[s]=!0,!(o==n.left&&o&&this.map[i-1]==s||r==n.top&&r&&this.map[i-this.width]==s)&&e.push(s))}return e}positionAt(n,e,t){for(let r=0,o=0;;r++){const i=o+t.child(r).nodeSize;if(r==n){let s=e+n*this.width;const a=(n+1)*this.width;for(;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}}static get(n){return bc(n)||yc(n,$O(n))}};function $O(n){if(n.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+n.type.name);const e=FO(n),t=n.childCount,r=[];let o=0,i=null;const s=[];for(let d=0,u=e*t;d<u;d++)r[d]=0;for(let d=0,u=0;d<t;d++){const p=n.child(d);u++;for(let m=0;;m++){for(;o<r.length&&r[o]!=0;)o++;if(m==p.childCount)break;const g=p.child(m),{colspan:b,rowspan:y,colwidth:k}=g.attrs;for(let E=0;E<y;E++){if(E+d>=t){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-E});break}const v=o+E*e;for(let _=0;_<b;_++){r[v+_]==0?r[v+_]=u:(i||(i=[])).push({type:"collision",row:d,pos:u,n:b-_});const C=k&&k[_];if(C){const D=(v+_)%e*2,B=s[D];B==null||B!=C&&s[D+1]==1?(s[D]=C,s[D+1]=1):B==C&&s[D+1]++}}}o+=b,u+=g.nodeSize}const f=(d+1)*e;let h=0;for(;o<f;)r[o++]==0&&h++;h&&(i||(i=[])).push({type:"missing",row:d,n:h}),u++}(e===0||t===0)&&(i||(i=[])).push({type:"zero_sized"});const a=new Je(e,t,r,i);let c=!1;for(let d=0;!c&&d<s.length;d+=2)s[d]!=null&&s[d+1]<t&&(c=!0);return c&&zO(a,s,n),a}function FO(n){let e=-1,t=!1;for(let r=0;r<n.childCount;r++){const o=n.child(r);let i=0;if(t)for(let s=0;s<r;s++){const a=n.child(s);for(let c=0;c<a.childCount;c++){const d=a.child(c);s+d.attrs.rowspan>r&&(i+=d.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const a=o.child(s);i+=a.attrs.colspan,a.attrs.rowspan>1&&(t=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function zO(n,e,t){n.problems||(n.problems=[]);const r={};for(let o=0;o<n.map.length;o++){const i=n.map[o];if(r[i])continue;r[i]=!0;const s=t.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const c=s.attrs;for(let d=0;d<c.colspan;d++){const u=(o+d)%n.width,p=e[u*2];p!=null&&(!c.colwidth||c.colwidth[d]!=p)&&((a||(a=VO(c)))[d]=p)}a&&n.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function VO(n){if(n.colwidth)return n.colwidth.slice();const e=[];for(let t=0;t<n.colspan;t++)e.push(0);return e}function Ct(n){let e=n.cached.tableNodeTypes;if(!e){e=n.cached.tableNodeTypes={};for(const t in n.nodes){const r=n.nodes[t],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var lr=new $e("selectingCells");function Ro(n){for(let e=n.depth-1;e>0;e--)if(n.node(e).type.spec.tableRole=="row")return n.node(0).resolve(n.before(e+1));return null}function HO(n){for(let e=n.depth;e>0;e--){const t=n.node(e).type.spec.tableRole;if(t==="cell"||t==="header_cell")return n.node(e)}return null}function vn(n){const e=n.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function za(n){const e=n.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 t=Ro(e.$head)||UO(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function UO(n){for(let e=n.nodeAfter,t=n.pos;e;e=e.firstChild,t++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t)}for(let e=n.nodeBefore,t=n.pos;e;e=e.lastChild,t--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t-e.nodeSize)}}function vc(n){return n.parent.type.spec.tableRole=="row"&&!!n.nodeAfter}function WO(n){return n.node(0).resolve(n.pos+n.nodeAfter.nodeSize)}function Rd(n,e){return n.depth==e.depth&&n.pos>=e.start(-1)&&n.pos<=e.end(-1)}function Vg(n,e,t){const r=n.node(-1),o=Je.get(r),i=n.start(-1),s=o.nextCell(n.pos-i,e,t);return s==null?null:n.node(0).resolve(i+s)}function jr(n,e,t=1){const r={...n,colspan:n.colspan-t};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,t),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function Hg(n,e,t=1){const r={...n,colspan:n.colspan+t};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<t;o++)r.colwidth.splice(e,0,0)}return r}function qO(n,e,t){const r=Ct(e.type.schema).header_cell;for(let o=0;o<n.height;o++)if(e.nodeAt(n.map[t+o*n.width]).type!=r)return!1;return!0}var Le=class Hn extends ee{constructor(e,t=e){const r=e.node(-1),o=Je.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,t.pos-i),a=e.node(0),c=o.cellsInRect(s).filter(u=>u!=t.pos-i);c.unshift(t.pos-i);const d=c.map(u=>{const p=r.nodeAt(u);if(!p)throw RangeError(`No cell with offset ${u} found`);const f=i+u+1;return new Hf(a.resolve(f),a.resolve(f+p.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=t}map(e,t){const r=e.resolve(t.map(this.$anchorCell.pos)),o=e.resolve(t.map(this.$headCell.pos));if(vc(r)&&vc(o)&&Rd(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Hn.rowSelection(r,o):i&&this.isColSelection()?Hn.colSelection(r,o):new Hn(r,o)}return Y.between(r,o)}content(){const e=this.$anchorCell.node(-1),t=Je.get(e),r=this.$anchorCell.start(-1),o=t.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let c=o.top;c<o.bottom;c++){const d=[];for(let u=c*t.width+o.left,p=o.left;p<o.right;p++,u++){const f=t.map[u];if(i[f])continue;i[f]=!0;const h=t.findCell(f);let m=e.nodeAt(f);if(!m)throw RangeError(`No cell with offset ${f} found`);const g=o.left-h.left,b=h.right-o.right;if(g>0||b>0){let y=m.attrs;if(g>0&&(y=jr(y,0,g)),b>0&&(y=jr(y,y.colspan-b,b)),h.left<o.left){if(m=m.type.createAndFill(y),!m)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else m=m.type.create(y,m.content)}if(h.top<o.top||h.bottom>o.bottom){const y={...m.attrs,rowspan:Math.min(h.bottom,o.bottom)-Math.max(h.top,o.top)};h.top<o.top?m=m.type.createAndFill(y):m=m.type.create(y,m.content)}d.push(m)}s.push(e.child(c).copy(S.from(d)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new O(S.from(a),1,1)}replace(e,t=O.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:a,$to:c}=o[s],d=e.mapping.slice(r);e.replace(d.map(a.pos),d.map(c.pos),s?O.empty:t)}const i=ee.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new O(S.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),r=Je.get(t),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(t.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const r=e.node(-1),o=Je.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(t.pos-i),c=e.node(0);return s.top<=a.top?(s.top>0&&(e=c.resolve(i+o.map[s.left])),a.bottom<o.height&&(t=c.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(t=c.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=c.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new Hn(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Je.get(e),r=this.$anchorCell.start(-1),o=t.colCount(this.$anchorCell.pos-r),i=t.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)==t.width}eq(e){return e instanceof Hn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const r=e.node(-1),o=Je.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(t.pos-i),c=e.node(0);return s.left<=a.left?(s.left>0&&(e=c.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(t=c.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(t=c.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=c.resolve(i+o.map[o.width*(s.top+1)-1]))),new Hn(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new Hn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){return new Hn(e.resolve(t),e.resolve(r))}getBookmark(){return new KO(this.$anchorCell.pos,this.$headCell.pos)}};Le.prototype.visible=!1;ee.jsonID("cell",Le);var KO=class Ug{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Ug(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),r=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&r.index()<r.parent.childCount&&Rd(t,r)?new Le(t,r):ee.near(r,1)}};function GO(n){if(!(n.selection instanceof Le))return null;const e=[];return n.selection.forEachCell((t,r)=>{e.push(Ze.node(r,r+t.nodeSize,{class:"selectedCell"}))}),Ne.create(n.doc,e)}function jO({$from:n,$to:e}){if(n.pos==e.pos||n.pos<e.pos-6)return!1;let t=n.pos,r=e.pos,o=n.depth;for(;o>=0&&!(n.after(o+1)<n.end(o));o--,t++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return t==r&&/row|table/.test(n.node(o).type.spec.tableRole)}function JO({$from:n,$to:e}){let t,r;for(let o=n.depth;o>0;o--){const i=n.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){t=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 t!==r&&e.parentOffset===0}function YO(n,e,t){const r=(e||n).selection,o=(e||n).doc;let i,s;if(r instanceof G&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=Le.create(o,r.from);else if(s=="row"){const a=o.resolve(r.from+1);i=Le.rowSelection(a,a)}else if(!t){const a=Je.get(r.node),c=r.from+1,d=c+a.map[a.width*a.height-1];i=Le.create(o,c+1,d)}}else r instanceof Y&&jO(r)?i=Y.create(o,r.from):r instanceof Y&&JO(r)&&(i=Y.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=n.tr)).setSelection(i),e}var XO=new $e("fix-tables");function Wg(n,e,t,r){const o=n.childCount,i=e.childCount;e:for(let s=0,a=0;s<i;s++){const c=e.child(s);for(let d=a,u=Math.min(o,s+3);d<u;d++)if(n.child(d)==c){a=d+1,t+=c.nodeSize;continue e}r(c,t),a<o&&n.child(a).sameMarkup(c)?Wg(n.child(a),c,t+1,r):c.nodesBetween(0,c.content.size,r,t+1),t+=c.nodeSize}}function qg(n,e){let t;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(t=ZO(n,o,i,t))};return e?e.doc!=n.doc&&Wg(e.doc,n.doc,0,r):n.doc.descendants(r),t}function ZO(n,e,t,r){const o=Je.get(e);if(!o.problems)return r;r||(r=n.tr);const i=[];for(let c=0;c<o.height;c++)i.push(0);for(let c=0;c<o.problems.length;c++){const d=o.problems[c];if(d.type=="collision"){const u=e.nodeAt(d.pos);if(!u)continue;const p=u.attrs;for(let f=0;f<p.rowspan;f++)i[d.row+f]+=d.n;r.setNodeMarkup(r.mapping.map(t+1+d.pos),null,jr(p,p.colspan-d.n,d.n))}else if(d.type=="missing")i[d.row]+=d.n;else if(d.type=="overlong_rowspan"){const u=e.nodeAt(d.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(t+1+d.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-d.n})}else if(d.type=="colwidth mismatch"){const u=e.nodeAt(d.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(t+1+d.pos),null,{...u.attrs,colwidth:d.colwidth})}else if(d.type=="zero_sized"){const u=r.mapping.map(t);r.delete(u,u+e.nodeSize)}}let s,a;for(let c=0;c<i.length;c++)i[c]&&(s==null&&(s=c),a=c);for(let c=0,d=t+1;c<o.height;c++){const u=e.child(c),p=d+u.nodeSize,f=i[c];if(f>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const m=[];for(let b=0;b<f;b++){const y=Ct(n.schema)[h].createAndFill();y&&m.push(y)}const g=(c==0||s==c-1)&&a==c?d+1:p-1;r.insert(r.mapping.map(g),m)}d=p}return r.setMeta(XO,{fixTables:!0})}function Ln(n){const e=n.selection,t=za(n),r=t.node(-1),o=t.start(-1),i=Je.get(r);return{...e instanceof Le?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(t.pos-o),tableStart:o,map:i,table:r}}function Kg(n,{map:e,tableStart:t,table:r},o){let i=o>0?-1:0;qO(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 c=e.map[a],d=r.nodeAt(c);n.setNodeMarkup(n.mapping.map(t+c),null,Hg(d.attrs,o-e.colCount(c))),s+=d.attrs.rowspan-1}else{const c=i==null?Ct(r.type.schema).cell:r.nodeAt(e.map[a+i]).type,d=e.positionAt(s,o,r);n.insert(n.mapping.map(t+d),c.createAndFill())}}return n}function QO(n,e){if(!vn(n))return!1;if(e){const t=Ln(n);e(Kg(n.tr,t,t.left))}return!0}function eM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n);e(Kg(n.tr,t,t.right))}return!0}function tM(n,{map:e,table:t,tableStart:r},o){const i=n.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+o,c=e.map[a],d=t.nodeAt(c),u=d.attrs;if(o>0&&e.map[a-1]==c||o<e.width-1&&e.map[a+1]==c)n.setNodeMarkup(n.mapping.slice(i).map(r+c),null,jr(u,o-e.colCount(c)));else{const p=n.mapping.slice(i).map(r+c);n.delete(p,p+d.nodeSize)}s+=u.rowspan}}function nM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n),r=n.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let o=t.right-1;tM(r,t,o),o!=t.left;o--){const i=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!i)throw RangeError("No table found");t.table=i,t.map=Je.get(i)}e(r)}return!0}function rM(n,e,t){var r;const o=Ct(e.type.schema).header_cell;for(let i=0;i<n.width;i++)if(((r=e.nodeAt(n.map[i+t*n.width]))==null?void 0:r.type)!=o)return!1;return!0}function Gg(n,{map:e,tableStart:t,table:r},o){var i;let s=t;for(let d=0;d<o;d++)s+=r.child(d).nodeSize;const a=[];let c=o>0?-1:0;rM(e,r,o+c)&&(c=o==0||o==e.height?null:0);for(let d=0,u=e.width*o;d<e.width;d++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const p=e.map[u],f=r.nodeAt(p).attrs;n.setNodeMarkup(t+p,null,{...f,rowspan:f.rowspan+1}),d+=f.colspan-1}else{const p=c==null?Ct(r.type.schema).cell:(i=r.nodeAt(e.map[u+c*e.width]))==null?void 0:i.type,f=p==null?void 0:p.createAndFill();f&&a.push(f)}return n.insert(s,Ct(r.type.schema).row.create(null,a)),n}function oM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n);e(Gg(n.tr,t,t.top))}return!0}function iM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n);e(Gg(n.tr,t,t.bottom))}return!0}function sM(n,{map:e,table:t,tableStart:r},o){let i=0;for(let d=0;d<o;d++)i+=t.child(d).nodeSize;const s=i+t.child(o).nodeSize,a=n.mapping.maps.length;n.delete(i+r,s+r);const c=new Set;for(let d=0,u=o*e.width;d<e.width;d++,u++){const p=e.map[u];if(!c.has(p)){if(c.add(p),o>0&&p==e.map[u-e.width]){const f=t.nodeAt(p).attrs;n.setNodeMarkup(n.mapping.slice(a).map(p+r),null,{...f,rowspan:f.rowspan-1}),d+=f.colspan-1}else if(o<e.height&&p==e.map[u+e.width]){const f=t.nodeAt(p),h=f.attrs,m=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),g=e.positionAt(o+1,d,t);n.insert(n.mapping.slice(a).map(r+g),m),d+=h.colspan-1}}}}function aM(n,e){if(!vn(n))return!1;if(e){const t=Ln(n),r=n.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let o=t.bottom-1;sM(r,t,o),o!=t.top;o--){const i=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!i)throw RangeError("No table found");t.table=i,t.map=Je.get(t.table)}e(r)}return!0}function jp(n){const e=n.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function lM({width:n,height:e,map:t},r){let o=r.top*n+r.left,i=o,s=(r.bottom-1)*n+r.left,a=o+(r.right-r.left-1);for(let c=r.top;c<r.bottom;c++){if(r.left>0&&t[i]==t[i-1]||r.right<n&&t[a]==t[a+1])return!0;i+=n,a+=n}for(let c=r.left;c<r.right;c++){if(r.top>0&&t[o]==t[o-n]||r.bottom<e&&t[s]==t[s+n])return!0;o++,s++}return!1}function Jp(n,e){const t=n.selection;if(!(t instanceof Le)||t.$anchorCell.pos==t.$headCell.pos)return!1;const r=Ln(n),{map:o}=r;if(lM(o,r))return!1;if(e){const i=n.tr,s={};let a=S.empty,c,d;for(let u=r.top;u<r.bottom;u++)for(let p=r.left;p<r.right;p++){const f=o.map[u*o.width+p],h=r.table.nodeAt(f);if(!(s[f]||!h))if(s[f]=!0,c==null)c=f,d=h;else{jp(h)||(a=a.append(h.content));const m=i.mapping.map(f+r.tableStart);i.delete(m,m+h.nodeSize)}}if(c==null||d==null)return!0;if(i.setNodeMarkup(c+r.tableStart,null,{...Hg(d.attrs,d.attrs.colspan,r.right-r.left-d.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const u=c+1+d.content.size,p=jp(d)?c+1:u;i.replaceWith(p+r.tableStart,u+r.tableStart,a)}i.setSelection(new Le(i.doc.resolve(c+r.tableStart))),e(i)}return!0}function Yp(n,e){const t=Ct(n.schema);return cM(({node:r})=>t[r.type.spec.tableRole])(n,e)}function cM(n){return(e,t)=>{var r;const o=e.selection;let i,s;if(o instanceof Le){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{if(i=HO(o.$from),!i)return!1;s=(r=Ro(o.$from))==null?void 0:r.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(t){let a=i.attrs;const c=[],d=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=Ln(e),p=e.tr;for(let h=0;h<u.right-u.left;h++)c.push(d?{...a,colwidth:d&&d[h]?[d[h]]:null}:a);let f;for(let h=u.top;h<u.bottom;h++){let m=u.map.positionAt(h,u.left,u.table);h==u.top&&(m+=i.nodeSize);for(let g=u.left,b=0;g<u.right;g++,b++)g==u.left&&h==u.top||p.insert(f=p.mapping.map(m+u.tableStart,1),n({node:i,row:h,col:g}).createAndFill(c[b]))}p.setNodeMarkup(s,n({node:i,row:u.top,col:u.left}),c[0]),o instanceof Le&&p.setSelection(new Le(p.doc.resolve(o.$anchorCell.pos),f?p.doc.resolve(f):void 0)),t(p)}return!0}}function dM(n,e){return function(t,r){if(!vn(t))return!1;const o=za(t);if(o.nodeAfter.attrs[n]===e)return!1;if(r){const i=t.tr;t.selection instanceof Le?t.selection.forEachCell((s,a)=>{s.attrs[n]!==e&&i.setNodeMarkup(a,null,{...s.attrs,[n]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[n]:e}),r(i)}return!0}}function uM(n){return function(e,t){if(!vn(e))return!1;if(t){const r=Ct(e.schema),o=Ln(e),i=e.tr,s=o.map.cellsInRect(n=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:n=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(c=>o.table.nodeAt(c));for(let c=0;c<s.length;c++)a[c].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[c],r.cell,a[c].attrs);if(i.steps.length==0)for(let c=0;c<s.length;c++)i.setNodeMarkup(o.tableStart+s[c],r.header_cell,a[c].attrs);t(i)}return!0}}function Xp(n,e,t){const r=e.map.cellsInRect({left:0,top:0,right:n=="row"?e.map.width:1,bottom:n=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==t.header_cell)return!1}return!0}function xi(n,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?uM(n):function(t,r){if(!vn(t))return!1;if(r){const o=Ct(t.schema),i=Ln(t),s=t.tr,a=Xp("row",i,o),c=Xp("column",i,o),u=(n==="column"?a:n==="row"?c:!1)?1:0,p=n=="column"?{left:0,top:u,right:1,bottom:i.map.height}:n=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,f=n=="column"?c?o.cell:o.header_cell:n=="row"?a?o.cell:o.header_cell:o.cell;i.map.cellsInRect(p).forEach(h=>{const m=h+i.tableStart,g=s.doc.nodeAt(m);g&&s.setNodeMarkup(m,f,g.attrs)}),r(s)}return!0}}xi("row",{useDeprecatedLogic:!0});xi("column",{useDeprecatedLogic:!0});var pM=xi("cell",{useDeprecatedLogic:!0});function fM(n,e){if(e<0){const t=n.nodeBefore;if(t)return n.pos-t.nodeSize;for(let r=n.index(-1)-1,o=n.before();r>=0;r--){const i=n.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(n.index()<n.parent.childCount-1)return n.pos+n.nodeAfter.nodeSize;const t=n.node(-1);for(let r=n.indexAfter(-1),o=n.after();r<t.childCount;r++){const i=t.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function Zp(n){return function(e,t){if(!vn(e))return!1;const r=fM(za(e),n);if(r==null)return!1;if(t){const o=e.doc.resolve(r);t(e.tr.setSelection(Y.between(o,WO(o))).scrollIntoView())}return!0}}function hM(n,e){const t=n.selection.$anchor;for(let r=t.depth;r>0;r--)if(t.node(r).type.spec.tableRole=="table")return e&&e(n.tr.delete(t.before(r),t.after(r)).scrollIntoView()),!0;return!1}function as(n,e){const t=n.selection;if(!(t instanceof Le))return!1;if(e){const r=n.tr,o=Ct(n.schema).cell.createAndFill().content;t.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new O(o,0,0))}),r.docChanged&&e(r)}return!0}function mM(n){if(!n.size)return null;let{content:e,openStart:t,openEnd:r}=n;for(;e.childCount==1&&(t>0&&r>0||e.child(0).type.spec.tableRole=="table");)t--,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 c=0;c<e.childCount;c++){let d=e.child(c).content;const u=c?0:Math.max(0,t-1),p=c<e.childCount-1?0:Math.max(0,r-1);(u||p)&&(d=kc(Ct(s).row,new O(d,u,p)).content),a.push(d)}else if(i=="cell"||i=="header_cell")a.push(t||r?kc(Ct(s).row,new O(e,t,r)).content:e);else return null;return gM(s,a)}function gM(n,e){const t=[];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:c}=i.child(s).attrs;for(let d=o;d<o+a;d++)t[d]=(t[d]||0)+c}}let r=0;for(let o=0;o<t.length;o++)r=Math.max(r,t[o]);for(let o=0;o<t.length;o++)if(o>=e.length&&e.push(S.empty),t[o]<r){const i=Ct(n).cell.createAndFill(),s=[];for(let a=t[o];a<r;a++)s.push(i);e[o]=e[o].append(S.from(s))}return{height:e.length,width:r,rows:e}}function kc(n,e){const t=n.createAndFill();return new rh(t).replace(0,t.content.size,e).doc}function bM({width:n,height:e,rows:t},r,o){if(n!=r){const i=[],s=[];for(let a=0;a<t.length;a++){const c=t[a],d=[];for(let u=i[a]||0,p=0;u<r;p++){let f=c.child(p%c.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(jr(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),d.push(f),u+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)i[a+h]=(i[a+h]||0)+f.attrs.colspan}s.push(S.from(d))}t=s,n=r}if(e!=o){const i=[];for(let s=0,a=0;s<o;s++,a++){const c=[],d=t[a%e];for(let u=0;u<d.childCount;u++){let p=d.child(u);s+p.attrs.rowspan>o&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,o-p.attrs.rowspan)},p.content)),c.push(p)}i.push(S.from(c))}t=i,e=o}return{width:n,height:e,rows:t}}function yM(n,e,t,r,o,i,s){const a=n.doc.type.schema,c=Ct(a);let d,u;if(o>e.width)for(let p=0,f=0;p<e.height;p++){const h=t.child(p);f+=h.nodeSize;const m=[];let g;h.lastChild==null||h.lastChild.type==c.cell?g=d||(d=c.cell.createAndFill()):g=u||(u=c.header_cell.createAndFill());for(let b=e.width;b<o;b++)m.push(g);n.insert(n.mapping.slice(s).map(f-1+r),m)}if(i>e.height){const p=[];for(let m=0,g=(e.height-1)*e.width;m<Math.max(e.width,o);m++){const b=m>=e.width?!1:t.nodeAt(e.map[g+m]).type==c.header_cell;p.push(b?u||(u=c.header_cell.createAndFill()):d||(d=c.cell.createAndFill()))}const f=c.row.create(null,S.from(p)),h=[];for(let m=e.height;m<i;m++)h.push(f);n.insert(n.mapping.slice(s).map(r+t.nodeSize-2),h)}return!!(d||u)}function Qp(n,e,t,r,o,i,s,a){if(s==0||s==e.height)return!1;let c=!1;for(let d=o;d<i;d++){const u=s*e.width+d,p=e.map[u];if(e.map[u-e.width]==p){c=!0;const f=t.nodeAt(p),{top:h,left:m}=e.findCell(p);n.setNodeMarkup(n.mapping.slice(a).map(p+r),null,{...f.attrs,rowspan:s-h}),n.insert(n.mapping.slice(a).map(e.positionAt(s,m,t)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-s})),d+=f.attrs.colspan-1}}return c}function ef(n,e,t,r,o,i,s,a){if(s==0||s==e.width)return!1;let c=!1;for(let d=o;d<i;d++){const u=d*e.width+s,p=e.map[u];if(e.map[u-1]==p){c=!0;const f=t.nodeAt(p),h=e.colCount(p),m=n.mapping.slice(a).map(p+r);n.setNodeMarkup(m,null,jr(f.attrs,s-h,f.attrs.colspan-(s-h))),n.insert(m+f.nodeSize,f.type.createAndFill(jr(f.attrs,0,s-h))),d+=f.attrs.rowspan-1}}return c}function tf(n,e,t,r,o){let i=t?n.doc.nodeAt(t-1):n.doc;if(!i)throw new Error("No table found");let s=Je.get(i);const{top:a,left:c}=r,d=c+o.width,u=a+o.height,p=n.tr;let f=0;function h(){if(i=t?p.doc.nodeAt(t-1):p.doc,!i)throw new Error("No table found");s=Je.get(i),f=p.mapping.maps.length}yM(p,s,i,t,d,u,f)&&h(),Qp(p,s,i,t,c,d,a,f)&&h(),Qp(p,s,i,t,c,d,u,f)&&h(),ef(p,s,i,t,a,u,c,f)&&h(),ef(p,s,i,t,a,u,d,f)&&h();for(let m=a;m<u;m++){const g=s.positionAt(m,c,i),b=s.positionAt(m,d,i);p.replace(p.mapping.slice(f).map(g+t),p.mapping.slice(f).map(b+t),new O(o.rows[m-a],0,0))}h(),p.setSelection(new Le(p.doc.resolve(t+s.positionAt(a,c,i)),p.doc.resolve(t+s.positionAt(u-1,d-1,i)))),e(p)}var vM=zc({ArrowLeft:ls("horiz",-1),ArrowRight:ls("horiz",1),ArrowUp:ls("vert",-1),ArrowDown:ls("vert",1),"Shift-ArrowLeft":cs("horiz",-1),"Shift-ArrowRight":cs("horiz",1),"Shift-ArrowUp":cs("vert",-1),"Shift-ArrowDown":cs("vert",1),Backspace:as,"Mod-Backspace":as,Delete:as,"Mod-Delete":as});function Ss(n,e,t){return t.eq(n.selection)?!1:(e&&e(n.tr.setSelection(t).scrollIntoView()),!0)}function ls(n,e){return(t,r,o)=>{if(!o)return!1;const i=t.selection;if(i instanceof Le)return Ss(t,r,ee.near(i.$headCell,e));if(n!="horiz"&&!i.empty)return!1;const s=jg(o,n,e);if(s==null)return!1;if(n=="horiz")return Ss(t,r,ee.near(t.doc.resolve(i.head+e),e));{const a=t.doc.resolve(s),c=Vg(a,n,e);let d;return c?d=ee.near(c,1):e<0?d=ee.near(t.doc.resolve(a.before(-1)),-1):d=ee.near(t.doc.resolve(a.after(-1)),1),Ss(t,r,d)}}}function cs(n,e){return(t,r,o)=>{if(!o)return!1;const i=t.selection;let s;if(i instanceof Le)s=i;else{const c=jg(o,n,e);if(c==null)return!1;s=new Le(t.doc.resolve(c))}const a=Vg(s.$headCell,n,e);return a?Ss(t,r,new Le(s.$anchorCell,a)):!1}}function kM(n,e){const t=n.state.doc,r=Ro(t.resolve(e));return r?(n.dispatch(n.state.tr.setSelection(new Le(r))),!0):!1}function wM(n,e,t){if(!vn(n.state))return!1;let r=mM(t);const o=n.state.selection;if(o instanceof Le){r||(r={width:1,height:1,rows:[S.from(kc(Ct(n.state.schema).cell,t))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),a=Je.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=bM(r,a.right-a.left,a.bottom-a.top),tf(n.state,n.dispatch,s,a,r),!0}else if(r){const i=za(n.state),s=i.start(-1);return tf(n.state,n.dispatch,s,Je.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function EM(n,e){var t;if(e.ctrlKey||e.metaKey)return;const r=nf(n,e.target);let o;if(e.shiftKey&&n.state.selection instanceof Le)i(n.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Ro(n.state.selection.$anchor))!=null&&((t=Al(n,e))==null?void 0:t.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(c,d){let u=Al(n,d);const p=lr.getState(n.state)==null;if(!u||!Rd(c,u))if(p)u=c;else return;const f=new Le(c,u);if(p||!n.state.selection.eq(f)){const h=n.state.tr.setSelection(f);p&&h.setMeta(lr,c.pos),n.dispatch(h)}}function s(){n.root.removeEventListener("mouseup",s),n.root.removeEventListener("dragstart",s),n.root.removeEventListener("mousemove",a),lr.getState(n.state)!=null&&n.dispatch(n.state.tr.setMeta(lr,-1))}function a(c){const d=c,u=lr.getState(n.state);let p;if(u!=null)p=n.state.doc.resolve(u);else if(nf(n,d.target)!=r&&(p=Al(n,e),!p))return s();p&&i(p,d)}n.root.addEventListener("mouseup",s),n.root.addEventListener("dragstart",s),n.root.addEventListener("mousemove",a)}function jg(n,e,t){if(!(n.state.selection instanceof Y))return null;const{$head:r}=n.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((t<0?r.index(o):r.indexAfter(o))!=(t<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const a=r.before(o),c=e=="vert"?t>0?"down":"up":t>0?"right":"left";return n.endOfTextblock(c)?a:null}}return null}function nf(n,e){for(;e&&e!=n.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Al(n,e){const t=n.posAtCoords({left:e.clientX,top:e.clientY});return t&&t?Ro(n.state.doc.resolve(t.pos)):null}var CM=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,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",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),wc(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,wc(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function wc(n,e,t,r,o,i){var s;let a=0,c=!0,d=e.firstChild;const u=n.firstChild;if(u){for(let p=0,f=0;p<u.childCount;p++){const{colspan:h,colwidth:m}=u.child(p).attrs;for(let g=0;g<h;g++,f++){const b=o==f?i:m&&m[g],y=b?b+"px":"";if(a+=b||r,b||(c=!1),d)d.style.width!=y&&(d.style.width=y),d=d.nextSibling;else{const k=document.createElement("col");k.style.width=y,e.appendChild(k)}}}for(;d;){const p=d.nextSibling;(s=d.parentNode)==null||s.removeChild(d),d=p}c?(t.style.width=a+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=a+"px")}}var jt=new $e("tableColumnResizing");function _M({handleWidth:n=5,cellMinWidth:e=25,defaultCellMinWidth:t=100,View:r=CM,lastColumnResizable:o=!0}={}){const i=new Te({key:jt,state:{init(s,a){var c,d;const u=(d=(c=i.spec)==null?void 0:c.props)==null?void 0:d.nodeViews,p=Ct(a.schema).table.name;return r&&u&&(u[p]=(f,h)=>new r(f,t,h)),new SM(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=jt.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{xM(s,a,n,o)},mouseleave:s=>{NM(s)},mousedown:(s,a)=>{TM(s,a,e,t)}},decorations:s=>{const a=jt.getState(s);if(a&&a.activeHandle>-1)return DM(s,a.activeHandle)},nodeViews:{}}});return i}var SM=class xs{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,r=e.getMeta(jt);if(r&&r.setHandle!=null)return new xs(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new xs(t.activeHandle,r.setDragging);if(t.activeHandle>-1&&e.docChanged){let o=e.mapping.map(t.activeHandle,-1);return vc(e.doc.resolve(o))||(o=-1),new xs(o,t.dragging)}return t}};function xM(n,e,t,r){if(!n.editable)return;const o=jt.getState(n.state);if(o&&!o.dragging){const i=MM(e.target);let s=-1;if(i){const{left:a,right:c}=i.getBoundingClientRect();e.clientX-a<=t?s=rf(n,e,"left",t):c-e.clientX<=t&&(s=rf(n,e,"right",t))}if(s!=o.activeHandle){if(!r&&s!==-1){const a=n.state.doc.resolve(s),c=a.node(-1),d=Je.get(c),u=a.start(-1);if(d.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==d.width-1)return}Jg(n,s)}}}function NM(n){if(!n.editable)return;const e=jt.getState(n.state);e&&e.activeHandle>-1&&!e.dragging&&Jg(n,-1)}function TM(n,e,t,r){var o;if(!n.editable)return!1;const i=(o=n.dom.ownerDocument.defaultView)!=null?o:window,s=jt.getState(n.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=n.state.doc.nodeAt(s.activeHandle),c=OM(n,s.activeHandle,a.attrs);n.dispatch(n.state.tr.setMeta(jt,{setDragging:{startX:e.clientX,startWidth:c}}));function d(p){i.removeEventListener("mouseup",d),i.removeEventListener("mousemove",u);const f=jt.getState(n.state);f!=null&&f.dragging&&(AM(n,f.activeHandle,of(f.dragging,p,t)),n.dispatch(n.state.tr.setMeta(jt,{setDragging:null})))}function u(p){if(!p.which)return d(p);const f=jt.getState(n.state);if(f&&f.dragging){const h=of(f.dragging,p,t);sf(n,f.activeHandle,h,r)}}return sf(n,s.activeHandle,c,r),i.addEventListener("mouseup",d),i.addEventListener("mousemove",u),e.preventDefault(),!0}function OM(n,e,{colspan:t,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=n.domAtPos(e);let a=i.node.childNodes[i.offset].offsetWidth,c=t;if(r)for(let d=0;d<t;d++)r[d]&&(a-=r[d],c--);return a/c}function MM(n){for(;n&&n.nodeName!="TD"&&n.nodeName!="TH";)n=n.classList&&n.classList.contains("ProseMirror")?null:n.parentNode;return n}function rf(n,e,t,r){const o=t=="right"?-r:r,i=n.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,a=Ro(n.state.doc.resolve(s));if(!a)return-1;if(t=="right")return a.pos;const c=Je.get(a.node(-1)),d=a.start(-1),u=c.map.indexOf(a.pos-d);return u%c.width==0?-1:d+c.map[u-1]}function of(n,e,t){const r=e.clientX-n.startX;return Math.max(t,n.startWidth+r)}function Jg(n,e){n.dispatch(n.state.tr.setMeta(jt,{setHandle:e}))}function AM(n,e,t){const r=n.state.doc.resolve(e),o=r.node(-1),i=Je.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,c=n.state.tr;for(let d=0;d<i.height;d++){const u=d*i.width+a;if(d&&i.map[u]==i.map[u-i.width])continue;const p=i.map[u],f=o.nodeAt(p).attrs,h=f.colspan==1?0:a-i.colCount(p);if(f.colwidth&&f.colwidth[h]==t)continue;const m=f.colwidth?f.colwidth.slice():RM(f.colspan);m[h]=t,c.setNodeMarkup(s+p,null,{...f,colwidth:m})}c.docChanged&&n.dispatch(c)}function sf(n,e,t,r){const o=n.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=Je.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let c=n.domAtPos(o.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&wc(i,c.firstChild,c,r,a,t)}function RM(n){return Array(n).fill(0)}function DM(n,e){var t;const r=[],o=n.doc.resolve(e),i=o.node(-1);if(!i)return Ne.empty;const s=Je.get(i),a=o.start(-1),c=s.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;for(let d=0;d<s.height;d++){const u=c+d*s.width;if((c==s.width-1||s.map[u]!=s.map[u+1])&&(d==0||s.map[u]!=s.map[u-s.width])){const p=s.map[u],f=a+p+i.nodeAt(p).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",(t=jt.getState(n))!=null&&t.dragging&&r.push(Ze.node(a+p,a+p+i.nodeAt(p).nodeSize,{class:"column-resize-dragging"})),r.push(Ze.widget(f,h))}}return Ne.create(n.doc,r)}function IM({allowTableNodeSelection:n=!1}={}){return new Te({key:lr,state:{init(){return null},apply(e,t){const r=e.getMeta(lr);if(r!=null)return r==-1?null:r;if(t==null||!e.docChanged)return t;const{deleted:o,pos:i}=e.mapping.mapResult(t);return o?null:i}},props:{decorations:GO,handleDOMEvents:{mousedown:EM},createSelectionBetween(e){return lr.getState(e.state)!=null?e.state.selection:null},handleTripleClick:kM,handleKeyDown:vM,handlePaste:wM},appendTransaction(e,t,r){return YO(r,qg(r,t),n)}})}function Ec(n,e){return e?["width",`${Math.max(e,n)}px`]:["min-width",`${n}px`]}function af(n,e,t,r,o,i){var s;let a=0,c=!0,d=e.firstChild;const u=n.firstChild;if(u!==null)for(let p=0,f=0;p<u.childCount;p+=1){const{colspan:h,colwidth:m}=u.child(p).attrs;for(let g=0;g<h;g+=1,f+=1){const b=o===f?i:m&&m[g],y=b?`${b}px`:"";if(a+=b||r,b||(c=!1),d){if(d.style.width!==y){const[k,E]=Ec(r,b);d.style.setProperty(k,E)}d=d.nextSibling}else{const k=document.createElement("col"),[E,v]=Ec(r,b);k.style.setProperty(E,v),e.appendChild(k)}}}for(;d;){const p=d.nextSibling;(s=d.parentNode)===null||s===void 0||s.removeChild(d),d=p}c?(t.style.width=`${a}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${a}px`)}let BM=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),af(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,af(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}};function LM(n,e,t,r){let o=0,i=!0;const s=[],a=n.firstChild;if(!a)return{};for(let p=0,f=0;p<a.childCount;p+=1){const{colspan:h,colwidth:m}=a.child(p).attrs;for(let g=0;g<h;g+=1,f+=1){const b=t===f?r:m&&m[g];o+=b||e,b||(i=!1);const[y,k]=Ec(e,b);s.push(["col",{style:`${y}: ${k}`}])}}const c=i?`${o}px`:"",d=i?"":`${o}px`;return{colgroup:["colgroup",{},...s],tableWidth:c,tableMinWidth:d}}function lf(n,e){return n.createAndFill()}function PM(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const r=n.nodes[t];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),n.cached.tableNodeTypes=e,e}function Yg(n,e,t,r,o){const i=PM(n),s=[],a=[];for(let d=0;d<t;d+=1){const u=lf(i.cell);if(u&&a.push(u),r){const p=lf(i.header_cell);p&&s.push(p)}}const c=[];for(let d=0;d<e;d+=1)c.push(i.row.createChecked(null,r&&d===0?s:a));return i.table.createChecked(null,c)}function $M(n){return n instanceof Le}const ds=({editor:n})=>{const{selection:e}=n.state;if(!$M(e))return!1;let t=0;const r=om(e.ranges[0].$from,i=>i.type.name==="table");return r==null||r.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},Xg=Ke.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:BM,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:n,HTMLAttributes:e}){const{colgroup:t,tableWidth:r,tableMinWidth:o}=LM(n,this.options.cellMinWidth);return["table",_e(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),t,["tbody",0]]},addCommands(){return{insertTable:({rows:n=3,cols:e=3,withHeaderRow:t=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const s=Yg(i.schema,n,e,t);if(o){const a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(Y.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:n,dispatch:e})=>QO(n,e),addColumnAfter:()=>({state:n,dispatch:e})=>eM(n,e),deleteColumn:()=>({state:n,dispatch:e})=>nM(n,e),addRowBefore:()=>({state:n,dispatch:e})=>oM(n,e),addRowAfter:()=>({state:n,dispatch:e})=>iM(n,e),deleteRow:()=>({state:n,dispatch:e})=>aM(n,e),deleteTable:()=>({state:n,dispatch:e})=>hM(n,e),mergeCells:()=>({state:n,dispatch:e})=>Jp(n,e),splitCell:()=>({state:n,dispatch:e})=>Yp(n,e),toggleHeaderColumn:()=>({state:n,dispatch:e})=>xi("column")(n,e),toggleHeaderRow:()=>({state:n,dispatch:e})=>xi("row")(n,e),toggleHeaderCell:()=>({state:n,dispatch:e})=>pM(n,e),mergeOrSplit:()=>({state:n,dispatch:e})=>Jp(n,e)?!0:Yp(n,e),setCellAttribute:(n,e)=>({state:t,dispatch:r})=>dM(n,e)(t,r),goToNextCell:()=>({state:n,dispatch:e})=>Zp(1)(n,e),goToPreviousCell:()=>({state:n,dispatch:e})=>Zp(-1)(n,e),fixTables:()=>({state:n,dispatch:e})=>(e&&qg(n),!0),setCellSelection:n=>({tr:e,dispatch:t})=>{if(t){const r=Le.create(e.doc,n.anchorCell,n.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:ds,"Mod-Backspace":ds,Delete:ds,"Mod-Delete":ds}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[_M({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],IM({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(n){const e={name:n.name,options:n.options,storage:n.storage};return{tableRole:me(U(n,"tableRole",e))}}});function cf(n,e,t,r,o,i){let s=0,a=!0,c=e.firstChild;const d=n.firstChild;for(let u=0,p=0;u<d.childCount;u+=1){const{colspan:f,colwidth:h}=d.child(u).attrs;for(let m=0;m<f;m+=1,p+=1){const g=o===p?i:h&&h[m],b=g?`${g}px`:"";if(s+=g||r,g||(a=!1),c)c.style.width!==b&&(c.style.width=b),c=c.nextSibling;else{const y=document.createElement("col");y.className=`col-${p}`,e.appendChild(y).style.width=b}}}for(;c;){const u=c.nextSibling;c.parentNode.removeChild(c),c=u}a?(t.style.width=`${s}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${s}px`)}class FM{constructor(e,t,r){De(this,"node");De(this,"cellMinWidth");De(this,"view");De(this,"dom");De(this,"table");De(this,"colgroup");De(this,"contentDOM");this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),cf(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,cf(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}const zM=Xg.extend({addOptions(){return{HTMLAttributes:{},resizable:!0,handleWidth:5,cellMinWidth:25,View:FM,lastColumnResizable:!0,allowTableNodeSelection:!1}},addCommands(){var n;return{...(n=this.parent)==null?void 0:n.call(this),insertTable:({rows:e,cols:t,withHeaderRow:r})=>({editor:o,commands:i,tr:s,dispatch:a})=>{const c=Yg(o.schema,e,t,r);if(a){const d=s.selection.anchor+1;i.insertContent({type:"table-wrapper",content:[c.toJSON()]}),s.scrollIntoView().setSelection(Y.near(s.doc.resolve(d)))}return!0},deleteTable:()=>({state:e,dispatch:t})=>{const r=e.selection.$anchor;for(let o=r.depth;o>0;o--)if(r.node(o).type.name==="table-wrapper")return t&&t(e.tr.delete(r.before(o),r.after(o)).scrollIntoView()),!0;return!1},selectRow:e=>({tr:t,dispatch:r})=>{if(r){const o=t.doc.resolve(e),i=Le.rowSelection(o);t.setSelection(i)}return!0},selectColumn:e=>({tr:t,dispatch:r})=>{if(r){const o=t.doc.resolve(e),i=Le.colSelection(o);t.setSelection(i)}return!0}}}}),Zg=Ke.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",_e(this.options.HTMLAttributes,n),0]}}),VM={class:"add"},HM=l.createElementVNode("div",{class:"indicator"},[l.createElementVNode("svg",{width:"3",height:"3",viewBox:"0 0 3 3",fill:"none"},[l.createElementVNode("circle",{cx:"1.5",cy:"1.5",r:"1.5",fill:"#BBBFC4"})])],-1),UM=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(!1);function i(){o.value=!0}function s(){a("tableSelectRow",{pos:e.getPos()})}function a(c,d={}){c==="tableDeleteRow"&&(o.value=!1),setTimeout(()=>{r(e.editor,c,d)},0)}return(c,d)=>(l.openBlock(),l.createBlock(l.unref(ad),l.mergeProps({class:"o-table-cell-view",as:"td"},c.node.attrs,{style:{background:c.node.attrs.background}}),{default:l.withCtx(()=>{var u;return[(u=c.editor)!=null&&u.isEditable?(l.openBlock(),l.createBlock(l.unref(xo),{key:0,modelValue:o.value,"onUpdate:modelValue":d[2]||(d[2]=p=>o.value=p),placement:"left","tippy-class":"o-row-popover",offset:[16,40],"hide-click-outside":""},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"select_all",tooltip:l.unref(t)("table.removeColumn"),onClick:s},null,8,["tooltip"]),l.createVNode(l.unref(st),{icon:"delete",tooltip:l.unref(t)("table.removeRow"),onClick:d[1]||(d[1]=p=>a("tableDeleteRow"))},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createElementVNode("section",{class:l.normalizeClass(["row-handler",{active:o.value}]),onClick:i},[l.createElementVNode("div",VM,[HM,l.createVNode(l.unref(Us),{icon:"add_circle",color:l.unref(Ee).blue,tooltip:l.unref(t)("table.addRow"),placement:"left",onClick:d[0]||(d[0]=l.withModifiers(p=>a("tableAddRow"),["stop"]))},null,8,["color","tooltip"])])],2)]),_:1},8,["modelValue"])):l.createCommentVNode("",!0),l.createVNode(l.unref(Xn))]}),_:1},16,["style"]))}}),WM=Zg.extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),background:{default:""}}},addNodeView(){return yn(UM,{stopEvent:()=>!1})}}),Qg=Ke.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",_e(this.options.HTMLAttributes,n),0]}}),qM={class:"add"},KM=l.createElementVNode("div",{class:"indicator"},[l.createElementVNode("svg",{width:"3",height:"3",viewBox:"0 0 3 3",fill:"none"},[l.createElementVNode("circle",{cx:"1.5",cy:"1.5",r:"1.5",fill:"#BBBFC4"})])],-1),GM={class:"add"},jM=l.createElementVNode("div",{class:"indicator"},[l.createElementVNode("svg",{width:"3",height:"3",viewBox:"0 0 3 3",fill:"none"},[l.createElementVNode("circle",{cx:"1.5",cy:"1.5",r:"1.5",fill:"#BBBFC4"})])],-1),JM=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,{tr:t}=ve(),{run:r}=Pe(),o=l.ref(!1),i=l.ref(!1);function s(){setTimeout(()=>{o.value=!0},0)}function a(){i.value=!0}function c(){o.value=!1,u("tableSelectColumn",{pos:e.getPos()})}function d(){u("tableSelectRow",{pos:e.getPos()})}function u(p,f={}){p==="tableDeleteRow"?i.value=!1:p==="tableDeleteColumn"&&(o.value=!1),setTimeout(()=>{r(e.editor,p,f)},0)}return(p,f)=>(l.openBlock(),l.createBlock(l.unref(ad),l.mergeProps({class:"o-table-header-view",as:"th"},p.node.attrs,{style:{background:p.node.attrs.background}}),{default:l.withCtx(()=>{var h;return[(h=p.editor)!=null&&h.isEditable?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(l.unref(xo),{modelValue:o.value,"onUpdate:modelValue":f[2]||(f[2]=m=>o.value=m),placement:"top","tippy-class":"o-column-popover",offset:[0,20],"hide-click-outside":""},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"select_all",tooltip:l.unref(t)("table.removeColumn"),onClick:c},null,8,["tooltip"]),l.createVNode(l.unref(st),{icon:"delete",tooltip:l.unref(t)("table.removeColumn"),onClick:f[1]||(f[1]=m=>u("tableDeleteColumn"))},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createElementVNode("section",{class:l.normalizeClass(["col-handler",{active:o.value}]),onClick:s},[l.createElementVNode("div",qM,[KM,l.createVNode(l.unref(Us),{icon:"add_circle",color:l.unref(Ee).blue,tooltip:l.unref(t)("table.addColumn"),onClick:f[0]||(f[0]=l.withModifiers(m=>u("tableAddColumn"),["stop"]))},null,8,["color","tooltip"])])],2)]),_:1},8,["modelValue"]),l.createVNode(l.unref(xo),{modelValue:i.value,"onUpdate:modelValue":f[5]||(f[5]=m=>i.value=m),placement:"left","tippy-class":"o-row-popover",offset:[15,40],"hide-click-outside":""},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(st),{icon:"select_all",tooltip:l.unref(t)("table.removeColumn"),onClick:d},null,8,["tooltip"]),l.createVNode(l.unref(st),{icon:"delete",tooltip:l.unref(t)("table.removeRow"),onClick:f[4]||(f[4]=m=>u("tableDeleteRow"))},null,8,["tooltip"])]),default:l.withCtx(()=>[l.createElementVNode("section",{class:l.normalizeClass(["row-handler",{active:i.value}]),onClick:a},[l.createElementVNode("div",GM,[jM,l.createVNode(l.unref(Us),{icon:"add_circle",color:l.unref(Ee).blue,tooltip:l.unref(t)("table.addRow"),placement:"left",onClick:f[3]||(f[3]=l.withModifiers(m=>u("tableAddRow"),["stop"]))},null,8,["color","tooltip"])])],2)]),_:1},8,["modelValue"])],64)):l.createCommentVNode("",!0),l.createVNode(l.unref(Xn))]}),_:1},16,["style"]))}}),YM=Qg.extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),background:{default:""}}},addNodeView(){return yn(JM,{stopEvent:()=>!1})}}),XM=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.inject("sideNode",{value:!1}),r=l.ref(!1),o=l.computed(()=>{const{selection:s}=e.editor.view.state,a=s.from,c=e.getPos(),d=c+e.node.nodeSize;return a>=c&&a<=d});function i(s){r.value=s}return l.watch(o,s=>{i(s)}),(s,a)=>(l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:["o-table-wrapper-view",{"side-node-enabled":l.unref(t)}]}),{default:l.withCtx(()=>[l.createVNode(l.unref(Xn),{as:"table"})]),_:1},16,["class"]))}}),ZM=Ke.create({name:"table-wrapper",group:"block",content:"table",draggable:!0,parseHTML(){return[{tag:"table-wrapper"}]},renderHTML({HTMLAttributes:n}){return["table-wrapper",_e(n),0]},addNodeView(){return yn(XM,{stopEvent:()=>!1})}});function QM({node:n,types:e}){return Array.isArray(e)&&e.includes(n==null?void 0:n.type)||(n==null?void 0:n.type)===e}function us({node:n,types:e}){return n?!QM({node:n,types:e}):!1}const eA=Ae.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph"]}},addProseMirrorPlugins(){const n=new $e(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>this.options.notAfter.includes(t.name));return[new Te({key:n,appendTransaction:(t,r,o)=>{const{doc:i,tr:s,schema:a}=o,c=n.getState(o),d=i.content.size,u=a.nodes[this.options.node];if(c)return s.insert(d,u.create())},state:{init:(t,r)=>{const o=r.tr.doc.lastChild,i=(o==null?void 0:o.firstChild)??null;return us({node:o,types:e})||us({node:i,types:e})},apply:(t,r)=>{var s;if(!t.docChanged)return r;const o=t.doc.lastChild,i=((s=t.doc.lastChild)==null?void 0:s.firstChild)??null;return us({node:o,types:e})||us({node:i,types:e})}}})]}});var ft=[];for(var Rl=0;Rl<256;++Rl)ft.push((Rl+256).toString(16).slice(1));function tA(n,e=0){return(ft[n[e+0]]+ft[n[e+1]]+ft[n[e+2]]+ft[n[e+3]]+"-"+ft[n[e+4]]+ft[n[e+5]]+"-"+ft[n[e+6]]+ft[n[e+7]]+"-"+ft[n[e+8]]+ft[n[e+9]]+"-"+ft[n[e+10]]+ft[n[e+11]]+ft[n[e+12]]+ft[n[e+13]]+ft[n[e+14]]+ft[n[e+15]]).toLowerCase()}var ps,nA=new Uint8Array(16);function rA(){if(!ps&&(ps=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ps))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ps(nA)}var oA=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const df={randomUUID:oA};function iA(n,e,t){if(df.randomUUID&&!n)return df.randomUUID();n=n||{};var r=n.random||(n.rng||rA)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,tA(r)}const sA=()=>iA(),aA=Ae.create({name:"uniqueID",priority:1e4,addOptions:()=>({attributeName:"data-id",types:["heading"],enableRender:!1,generateId:()=>sA()}),addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:this.options.generateId(),parseHTML:n=>n.getAttribute(this.options.attributeName),renderHTML:n=>this.options.enableRender?{[this.options.attributeName]:n[this.options.attributeName]}:{}}}}]}}),lA={key:1,class:"video-container"},cA=l.createElementVNode("div",{class:"video-cover"},null,-1),dA={key:1},uA=l.defineComponent({__name:"view",props:ct,setup(n){const e=n,t=l.ref(!1),r=l.ref({}),o=l.ref(null),i=l.ref(!1),s=l.ref(!1),a=l.computed({get(){return e.node.attrs.caption},set(b){e.updateAttributes({caption:b})}}),c=l.computed({get(){return e.node.attrs.src},set(b){e.updateAttributes({src:b})}});function d(b){switch(t.value=!1,b.value){case"replace":g(!0);break}}function u(){i.value=!0,setTimeout(()=>{var b;(b=o.value)==null||b.focus()},0)}function p(){i.value=!1}function f(){c.value==="init"&&g(!0)}function h(b){t.value=!0,r.value=b}function m(b){c.value=b,g(!1)}function g(b){s.value=b}return l.onMounted(()=>{g(c.value==="init")}),(b,y)=>{var k;return l.openBlock(),l.createBlock(l.unref(Bn),l.mergeProps(e,{class:["o-video-view",{readonly:!((k=b.editor)!=null&&k.isEditable),init:c.value==="init"}],as:"div",onContextmenu:l.withModifiers(h,["prevent"]),onClick:f}),{default:l.withCtx(()=>[l.createVNode(l.unref(xo),{modelValue:s.value,"onUpdate:modelValue":y[1]||(y[1]=E=>s.value=E),placement:c.value==="init"?"bottom":"top"},{"popover-content":l.withCtx(()=>[l.createVNode(l.unref(fd),{val:c.value==="init"?"":c.value,type:"video",onInput:m},null,8,["val"])]),default:l.withCtx(()=>{var E;return[c.value==="init"?(l.openBlock(),l.createBlock(l.unref(cd),{key:0,icon:"videocam",placeholder:"Add a video"})):(l.openBlock(),l.createElementBlock("div",lA,[cA,l.createVNode(l.unref(ud),l.mergeProps(e,{onAction:d}),{default:l.withCtx(()=>[l.createVNode(l.unref(Me),{icon:"subtitles",tooltip:"image.caption",onClick:u})]),_:1},16),l.createElementVNode("video",l.mergeProps(b.node.attrs,{draggable:"true","data-drag-handle":"",controls:""}),[l.createElementVNode("source",l.normalizeProps(l.guardReactiveProps(b.node.attrs)),null,16)],16),l.createElementVNode("div",{class:"caption",onClick:u},[(E=b.editor)!=null&&E.isEditable&&i.value?(l.openBlock(),l.createBlock(l.unref(Ao),{key:0,ref_key:"captionInput",ref:o,class:"caption-input",modelValue:a.value,"onUpdate:modelValue":y[0]||(y[0]=v=>a.value=v),type:"text",placeholder:"Input caption",autosize:"",onBlur:p},null,8,["modelValue"])):(l.openBlock(),l.createElementBlock("span",dA,l.toDisplayString(a.value),1))])]))]}),_:1},8,["modelValue","placement"]),l.createVNode(l.unref(Ba),{modelValue:t.value,"onUpdate:modelValue":y[2]||(y[2]=E=>t.value=E),event:r.value},{default:l.withCtx(()=>[l.createVNode(l.unref(Xr),l.mergeProps(e,{onAction:d}),null,16)]),_:1},8,["modelValue","event"])]),_:1},16,["class","onContextmenu"])}}}),pA=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,fA=Ke.create({name:"video",draggable:!0,addOptions(){return{inline:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{caption:{default:"",rendered:!1},src:{default:null,parseHTML:n=>{const e=n.firstElementChild;return(e==null?void 0:e.src)??""}}}},parseHTML(){return[{tag:"video"}]},renderHTML({node:n,HTMLAttributes:e}){return["video",{caption:n.attrs.caption},["source",_e(this.options.HTMLAttributes,e)]]},addCommands(){return{setVideo:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Zc({find:pA,type:this.type,getAttributes:n=>{const[e]=n;return{src:e}}})]},addNodeView(){return yn(uA)}}),uf=["BackColor","Focus","FontFamily","ForeColor","Table","TaskItem","TaskList","TextAlign","Typography","Underline","OHorizontalRule","OUniqueID"],hA=["BackColor","Blockquote","Bold","BulletList","Code","CodeBlockLowlight","Focus","FontFamily","ForeColor","HorizontalRule","Image","Italic","Link","ListItem","OrderedList","Strike","Table","TaskItem","TaskList","TextAlign","Typography","Underline"],mA=["OBlockquote","OCallout","OCodeBlock","OColon","OColorHighlighter","OColumnExtension","ODiagram","ODoc","ODraggableItem","OEmbed","OFocus","OFontFamily","OFormatClear","OHeading","OHorizontalRule","OIframe","OImage","OIndent","OInsertHtml","OKatexBlock","OKatexInline","OLineHeight","OLink","OModelViewer","OParagraph","OPrint","OSlash","OSlashZh","OTOC","OTableWrapper","OTitle","OTodoItem","OTrailingNode","OUniqueID","OVideo"],gA=[...hA,...mA],bA=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,yA=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,vA=ln.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Kr({find:bA,type:this.type})]},addPasteRules(){return[vr({find:yA,type:this.type})]}}),kA=Ae.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Te({key:new $e("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:o}=e,i=[];if(!t||!r)return Ne.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((c,d)=>{if(c.isText)return;if(!(o>=d&&o<=d+c.nodeSize-1))return!1;s+=1});let a=0;return n.descendants((c,d)=>{if(c.isText||!(o>=d&&o<=d+c.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(Ze.node(d,d+c.nodeSize,{class:this.options.className}))}),Ne.create(n,i)}}})]}}),wA=Ae.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:n=>n.style.fontFamily,renderHTML:n=>n.fontFamily?{style:`font-family: ${n.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:n=>({chain:e})=>e().setMark("textStyle",{fontFamily:n}).run(),unsetFontFamily:()=>({chain:n})=>n().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),EA=Ae.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var e;return(e=n.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:e})=>e().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),CA=/^\s*(\[([( |x])?\])\s$/,_A=Ke.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",_e(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),c=document.createElement("div");return i.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:u}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const f=t();if(typeof f!="number")return!1;const h=p.doc.nodeAt(f);return p.setNodeMarkup(f,void 0,{...h==null?void 0:h.attrs,checked:u}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,u)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,u])=>{o.setAttribute(d,u)}),o.dataset.checked=n.attrs.checked,a.checked=n.attrs.checked,i.append(a,s),o.append(i,c),Object.entries(e).forEach(([d,u])=>{o.setAttribute(d,u)}),{dom:o,contentDOM:c,update:d=>d.type!==this.type?!1:(o.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,!0)}}},addInputRules(){return[wo({find:CA,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),SA=Ke.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:n}){return["ul",_e(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),xA=Ae.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:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).every(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.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")}}}),NA=n=>Ye({find:/--$/,replace:n??"—"}),TA=n=>Ye({find:/\.\.\.$/,replace:n??"…"}),OA=n=>Ye({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:n??"“"}),MA=n=>Ye({find:/"$/,replace:n??"”"}),AA=n=>Ye({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:n??"‘"}),RA=n=>Ye({find:/'$/,replace:n??"’"}),DA=n=>Ye({find:/<-$/,replace:n??"←"}),IA=n=>Ye({find:/->$/,replace:n??"→"}),BA=n=>Ye({find:/\(c\)$/,replace:n??"©"}),LA=n=>Ye({find:/\(tm\)$/,replace:n??"™"}),PA=n=>Ye({find:/\(sm\)$/,replace:n??"℠"}),$A=n=>Ye({find:/\(r\)$/,replace:n??"®"}),FA=n=>Ye({find:/(?:^|\s)(1\/2)\s$/,replace:n??"½"}),zA=n=>Ye({find:/\+\/-$/,replace:n??"±"}),VA=n=>Ye({find:/!=$/,replace:n??"≠"}),HA=n=>Ye({find:/<<$/,replace:n??"«"}),UA=n=>Ye({find:/>>$/,replace:n??"»"}),WA=n=>Ye({find:/\d+\s?([*x])\s?\d+$/,replace:n??"×"}),qA=n=>Ye({find:/\^2$/,replace:n??"²"}),KA=n=>Ye({find:/\^3$/,replace:n??"³"}),GA=n=>Ye({find:/(?:^|\s)(1\/4)\s$/,replace:n??"¼"}),jA=n=>Ye({find:/(?:^|\s)(3\/4)\s$/,replace:n??"¾"}),JA=Ae.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const n=[];return this.options.emDash!==!1&&n.push(NA(this.options.emDash)),this.options.ellipsis!==!1&&n.push(TA(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&n.push(OA(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&n.push(MA(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&n.push(AA(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&n.push(RA(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&n.push(DA(this.options.leftArrow)),this.options.rightArrow!==!1&&n.push(IA(this.options.rightArrow)),this.options.copyright!==!1&&n.push(BA(this.options.copyright)),this.options.trademark!==!1&&n.push(LA(this.options.trademark)),this.options.servicemark!==!1&&n.push(PA(this.options.servicemark)),this.options.registeredTrademark!==!1&&n.push($A(this.options.registeredTrademark)),this.options.oneHalf!==!1&&n.push(FA(this.options.oneHalf)),this.options.plusMinus!==!1&&n.push(zA(this.options.plusMinus)),this.options.notEqual!==!1&&n.push(VA(this.options.notEqual)),this.options.laquo!==!1&&n.push(HA(this.options.laquo)),this.options.raquo!==!1&&n.push(UA(this.options.raquo)),this.options.multiplication!==!1&&n.push(WA(this.options.multiplication)),this.options.superscriptTwo!==!1&&n.push(qA(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&n.push(KA(this.options.superscriptThree)),this.options.oneQuarter!==!1&&n.push(GA(this.options.oneQuarter)),this.options.threeQuarters!==!1&&n.push(jA(this.options.threeQuarters)),n}}),YA=ln.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",_e(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),eb=Ke.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",_e(this.options.HTMLAttributes,n),0]}});function XA(n){var e;const{char:t,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=n,c=r&&!o,d=PE(t),u=new RegExp(`\\s${d}$`),p=s?"^":"",f=o?"":d,h=c?new RegExp(`${p}${d}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${p}(?:^)?${d}[^\\s${f}]*`,"gm"),m=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!m)return null;const g=a.pos-m.length,b=Array.from(m.matchAll(h)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const y=b.input.slice(Math.max(0,b.index-1),b.index),k=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!k)return null;const E=g+b.index;let v=E+b[0].length;return c&&u.test(m.slice(v-1,v+1))&&(b[0]+=" ",v+=1),E<a.pos&&v>=a.pos?{range:{from:E,to:v},query:b[0].slice(t.length),text:b[0]}:null}const ZA=new $e("suggestion");function tb({pluginKey:n=ZA,editor:e,char:t="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:c="suggestion",command:d=()=>null,items:u=()=>[],render:p=()=>({}),allow:f=()=>!0,findSuggestionMatch:h=XA}){let m;const g=p==null?void 0:p(),b=new Te({key:n,view(){return{update:async(y,k)=>{var E,v,_,C,D,B,A;const $=(E=this.key)===null||E===void 0?void 0:E.getState(k),J=(v=this.key)===null||v===void 0?void 0:v.getState(y.state),te=$.active&&J.active&&$.range.from!==J.range.from,de=!$.active&&J.active,ce=$.active&&!J.active,re=!de&&!ce&&$.query!==J.query,oe=de||te&&re,N=re||te,M=ce||te&&re;if(!oe&&!N&&!M)return;const z=M&&!oe?$:J,j=y.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);m={editor:e,range:z.range,query:z.query,text:z.text,items:[],command:Q=>d({editor:e,range:z.range,props:Q}),decorationNode:j,clientRect:j?()=>{var Q;const{decorationId:fe}=(Q=this.key)===null||Q===void 0?void 0:Q.getState(e.state),Se=y.dom.querySelector(`[data-decoration-id="${fe}"]`);return(Se==null?void 0:Se.getBoundingClientRect())||null}:null},oe&&((_=g==null?void 0:g.onBeforeStart)===null||_===void 0||_.call(g,m)),N&&((C=g==null?void 0:g.onBeforeUpdate)===null||C===void 0||C.call(g,m)),(N||oe)&&(m.items=await u({editor:e,query:z.query})),M&&((D=g==null?void 0:g.onExit)===null||D===void 0||D.call(g,m)),N&&((B=g==null?void 0:g.onUpdate)===null||B===void 0||B.call(g,m)),oe&&((A=g==null?void 0:g.onStart)===null||A===void 0||A.call(g,m))},destroy:()=>{var y;m&&((y=g==null?void 0:g.onExit)===null||y===void 0||y.call(g,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(y,k,E,v){const{isEditable:_}=e,{composing:C}=e.view,{selection:D}=y,{empty:B,from:A}=D,$={...k};if($.composing=C,_&&(B||e.view.composing)){(A<k.range.from||A>k.range.to)&&!C&&!k.composing&&($.active=!1);const J=h({char:t,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:D.$from}),te=`id_${Math.floor(Math.random()*4294967295)}`;J&&f({editor:e,state:v,range:J.range,isActive:k.active})?($.active=!0,$.decorationId=k.decorationId?k.decorationId:te,$.range=J.range,$.query=J.query,$.text=J.text):$.active=!1}else $.active=!1;return $.active||($.decorationId=null,$.range={from:0,to:0},$.query=null,$.text=null),$}},props:{handleKeyDown(y,k){var E;const{active:v,range:_}=b.getState(y.state);return v&&((E=g==null?void 0:g.onKeyDown)===null||E===void 0?void 0:E.call(g,{view:y,event:k,range:_}))||!1},decorations(y){const{active:k,range:E,decorationId:v}=b.getState(y);return k?Ne.create(y.doc,[Ze.inline(E.from,E.to,{nodeName:a,class:c,"data-decoration-id":v})]):null}}});return b}const QA=Ae.create({name:"slash",addOptions(){return{suggestion:{char:"/",command:({editor:n,range:e,props:t})=>{t.command({editor:n,range:e})}}}},addProseMirrorPlugins(){return[tb({editor:this.editor,...this.options.suggestion})]}}),eR=Ae.create({name:"slash-zh",addOptions(){return{suggestion:{char:"、",command:({editor:n,range:e,props:t})=>{t.command({editor:n,range:e})}}}},addProseMirrorPlugins(){return[tb({pluginKey:new $e("slash-zh-suggestion"),editor:this.editor,...this.options.suggestion})]}}),tR={props:{items:{type:Array,required:!0},command:{type:Function,required:!0},editor:{type:Object},range:{type:Object}},setup(){const{locale:n,tr:e}=ve(),{onCommand:t}=Pe();return{locale:n,tr:e,onCommand:t}},data(){return{view:"main",selectedIndex:0}},components:{ODivider:Xt,OIcon:ie,OList:un,OListItem:Zt},watch:{items(){this.selectedIndex=0}},methods:{onClick(n){switch(n.value){default:this.run(n);break}return!0},run(n){const e=this.editor.chain().focus().deleteRange(this.range),t=this.editor.commands;switch(n.value){case"codeBlock":t.deleteRange(this.range),this.editor.commands.setCodeBlock({language:"bash"});break;case"content":t.deleteRange(this.range),this.editor.commands.insertContent(n.options.content);break;case"taskList":t.deleteRange(this.range),this.editor.commands.toggleTaskList();break;default:this.onCommand(t,e,n.value,n.options);break}},onKeyDown({event:n}){return n.key==="ArrowUp"?(this.upHandler(),!0):n.key==="ArrowDown"?(this.downHandler(),!0):n.key==="Enter"?(this.enterHandler(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length},enterHandler(){this.selectItem(this.selectedIndex)},selectItem(n){const e=this.items[n];e&&this.onClick(e)},setEmoji(n){this.onClick({value:"content",options:{content:n}})}},computed:{basicBlocks(){return Li.slice(1)}},mounted(){this.selectedIndex=0}},nR=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},rR={key:0,class:"view-main"},oR={class:"group o-tips"},iR={class:"o-tips"},sR={key:1,class:"item"},aR={key:1,class:"view-emoji"},lR={key:2,class:"view-emoji"};function cR(n,e,t,r,o,i){const s=l.resolveComponent("o-divider"),a=l.resolveComponent("o-icon"),c=l.resolveComponent("o-list-item"),d=l.resolveComponent("o-list");return l.openBlock(),l.createElementBlock("section",{class:l.normalizeClass(["o-slash-view o-shadow-3 o-menu o-scroll",`view-${o.view}`])},[o.view==="main"?(l.openBlock(),l.createElementBlock("section",rR,[l.createVNode(d,{hoverable:"",clickable:""},{default:l.withCtx(()=>[t.items.length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(t.items,(u,p)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:p},[u.group?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[p>0?(l.openBlock(),l.createBlock(s,{key:0})):l.createCommentVNode("",!0),l.createElementVNode("div",oR,l.toDisplayString(r.tr(u.group)),1)],64)):l.createCommentVNode("",!0),l.createVNode(c,{class:l.normalizeClass(["item",{"is-active":p===o.selectedIndex}]),clickable:"",onClick:f=>i.onClick(u)},{prefix:l.withCtx(()=>[l.createVNode(a,{name:u.icon,color:u.color},null,8,["name","color"])]),suffix:l.withCtx(()=>[l.createElementVNode("span",iR,l.toDisplayString(u.tips),1)]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(r.tr(u.label)),1)]),_:2},1032,["class","onClick"])],64))),128)):(l.openBlock(),l.createElementBlock("div",sR,"No result"))]),_:1})])):o.view==="emoji"?(l.openBlock(),l.createElementBlock("section",aR)):o.view==="ai"?(l.openBlock(),l.createElementBlock("section",lR)):l.createCommentVNode("",!0)],2)}const dR=nR(tR,[["render",cR]]),pf={items:({query:n})=>dd.filter(e=>e.value.toLowerCase().startsWith(n.toLowerCase())),render:()=>{let n,e;return{onStart:t=>{n=new Rm(dR,{props:t,editor:t.editor}),e=In("body",{getReferenceClientRect:t.clientRect,appendTo:()=>document.body,content:n.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1})},onUpdate(t){n.updateProps(t),e[0].setProps({getReferenceClientRect:t.clientRect})},onKeyDown(t){var r;return t.event.key==="Escape"?(e[0].hide(),n.destroy(),!0):(r=n.ref)==null?void 0:r.onKeyDown(t)},onExit(){e[0].destroy(),n.destroy()}}}},uR={BackColor:vA.configure({multicolor:!0}),Focus:kA,ForeColor:EA,FontFamily:wA,Image:Mg,Link:zg,TextAlign:xA.configure({types:["heading","paragraph"]}),TaskItem:_A,TaskList:SA.configure({itemTypeName:"taskItem"}),Underline:YA,Typography:JA,OSlash:QA.configure({suggestion:pf}),OSlashZh:eR.configure({suggestion:pf}),OBlockquote:pN,OCallout:bN,OCodeBlock:QT,OColorHighlighter:eO,OHeading:nO,OHorizontalRule:iO,OImage:dO,OLink:IO.configure({openOnClick:!1}),OParagraph:LO,OTrailingNode:eA,OUniqueID:aA.configure({attributeName:"data-id",enableRender:!1,types:["heading","paragraph"]}),OVideo:fA};class pR{constructor(e){return uR[e]}}const fR=[ZM,zM.configure({resizable:!0}),eb,YM,WM];Xg.configure({resizable:!0});const hR=["data-theme"],nb=l.defineComponent({__name:"YiiEditor",props:{content:{type:[String,Object],default:""},editable:{type:Boolean,default:!0},locale:{type:String,default:"en"},darkMode:{type:Boolean,default:!1},showMainMenu:{type:Boolean,default:!1},showBubbleMenu:{type:Boolean,default:!1},showFloatingMenu:{type:Boolean,default:!1},showSideMenu:{type:Boolean,default:!1},showSideNode:{type:Boolean,default:!1},showContent:{type:Boolean,default:!0},showGuide:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},editorProps:{type:Object,default:function(){return{}}},extensions:{type:Array,default:function(){return[]}},mainMenu:{type:Array,default:function(){return[]}},tableMenu:{type:Array,default:function(){return[]}},bubbleMenu:{type:Array,default:function(){return[]}},floatingMenu:{type:Array,default:function(){return[]}},pageView:{type:String,default:"page"},options:{type:Object,default:function(){return{}}}},emits:["transaction","update"],setup(n,{expose:e,emit:t}){const r=n,o=t,{tr:i}=ve(),s=l.ref(!1),a=l.ref("en"),c=l.ref(!1);l.provide("darkMode",s),l.provide("locale",a),l.provide("sideNode",c);const d=l.computed(()=>g()),u=CC({editable:r.editable,content:r.content,extensions:d.value,onUpdate:()=>{var k,E;const b=(k=u.value)==null?void 0:k.getJSON(),y=(E=u.value)==null?void 0:E.getHTML();o("update",{json:b,html:y})},onTransaction:({editor:b,transaction:y})=>{o("transaction",{editor:b,transaction:y})}}),p=l.computed(()=>({editor:u.value,menu:r.mainMenu})),f=l.computed(()=>({editor:u.value,menu:r.bubbleMenu})),h=l.computed(()=>({editor:u.value,menu:r.floatingMenu})),m=l.computed(()=>({editor:u.value,menu:[]}));function g(){const b=[];r.extensions.includes("OColumn")||b.push(Bm.extend({content:"heading block*"})),b.push(PO.configure({placeholder:({editor:k,node:E,pos:v})=>{if(E.type.name==="heading"){const _=E.attrs.level;return v>0?`H${_}`:i("label.untitled")}else return E.type.name==="paragraph"?i("label.typeForCommands"):""}})),b.push(k_),b.push(y_.configure({document:!1,blockquote:r.extensions.includes("OBlockquote")?!1:{},codeBlock:!1,heading:r.extensions.includes("OHeading")?!1:{levels:[1,2,3,4,5]},paragraph:r.extensions.includes("OParagraph")?!1:{},dropcursor:{width:5,color:"skyblue",class:"yiitap-dropcursor"},horizontalRule:!1})),console.debug("default",uf);const y=uf.concat(r.extensions);for(const k of y)if(typeof k=="string"){if(!gA.includes(k))continue;switch(k){case"Table":b.push(...fR);break;default:try{const E=new pR(k);b.push(E),console.debug("dynamic extension",k,E)}catch(E){console.error(E.message)}break}}else b.push(k);return b}return l.watch(()=>r.darkMode,b=>{s.value=b}),l.watch(()=>r.locale,b=>{a.value=b}),l.watch(()=>r.editable,b=>{var y;(y=u.value)==null||y.setEditable(b)}),l.onBeforeMount(()=>{s.value=r.darkMode,a.value=r.locale,c.value=!r.showSideMenu&&r.showSideNode}),e({editor:u,darkModeAlt:s,localeAlt:a}),(b,y)=>{var k,E,v;return l.openBlock(),l.createElementBlock("main",{class:"yiitap yiitap-editor","data-theme":s.value?"dark":""},[n.showMainMenu?(l.openBlock(),l.createBlock(Zm,l.mergeProps({key:0},p.value,{class:"desktop-only"}),{left:l.withCtx(()=>[l.renderSlot(b.$slots,"toolbar-left")]),right:l.withCtx(()=>[l.renderSlot(b.$slots,"toolbar-right")]),_:3},16)):l.createCommentVNode("",!0),(k=l.unref(u))!=null&&k.isEditable&&n.showBubbleMenu?(l.openBlock(),l.createBlock(Jx,l.normalizeProps(l.mergeProps({key:1},f.value)),null,16)):l.createCommentVNode("",!0),(E=l.unref(u))!=null&&E.isEditable&&n.showFloatingMenu?(l.openBlock(),l.createBlock(Zx,l.normalizeProps(l.mergeProps({key:2},h.value)),null,16)):l.createCommentVNode("",!0),(v=l.unref(u))!=null&&v.isEditable&&n.showSideMenu?(l.openBlock(),l.createBlock(dN,l.normalizeProps(l.mergeProps({key:3},m.value)),null,16)):l.createCommentVNode("",!0),l.createVNode(l.unref(wC),{class:l.normalizeClass(["editor-content",n.pageView]),editor:l.unref(u)},null,8,["class","editor"])],8,hR)}}}),mR={installed:!1,spellcheck:!0,install(n){this.installed=!0,n.component("YiiEditor",nb)}};exports.AddNode=Ym;exports.DragNode=Xm;exports.OBlockMenu=Xr;exports.OBlockPlaceholder=cd;exports.OBlockPopover=xo;exports.OBlockToolbar=ud;exports.OBtn=Bt;exports.OCalloutColorBoard=pd;exports.OCalloutColorDropdown=q_;exports.OCheckbox=md;exports.OColorBoard=La;exports.OCommandBtn=st;exports.OCommonBtn=Us;exports.OContextMenu=Ba;exports.ODivider=Xt;exports.OIcon=ie;exports.OInput=Ao;exports.OLanguageDropdown=Wm;exports.OList=un;exports.OListItem=Zt;exports.OMainMenu=Zm;exports.OMediaInput=fd;exports.OMenubarBtn=Me;exports.OMetaInput=hd;exports.ONodeView=Bn;exports.OPopover=qe;exports.OTableCellBackground=Km;exports.OTableGrid=qm;exports.OTextColorBoard=Gm;exports.OTooltip=_r;exports.YiiEditor=nb;exports.YiiEditorPlugin=mR;exports.useI18n=ve;exports.useTheme=Bi;exports.useTiptap=Pe;
|