vue-spear-tip 0.3.5-beta.0 → 0.4.0-bata.0
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/.vite/manifest.json +32 -32
- package/dist/{Button-Du8xJmW4.js → Button-CKWq-QhM.js} +30 -31
- package/dist/Button-DufvpxJE.cjs +1 -0
- package/dist/{CodeHighlight-ClnxSRpw.js → CodeHighlight-CGL23MLE.js} +2 -2
- package/dist/{CodeHighlight-JSvuKBTX.cjs → CodeHighlight-ZxdmtTCr.cjs} +1 -1
- package/dist/{DateField-CqpNaubi.cjs → DateField-CHfa8-Do.cjs} +1 -1
- package/dist/{DateField-C4362r9o.js → DateField-uyIAOhkd.js} +2 -2
- package/dist/{FieldComponent.vue_vue_type_script_lang-jsRPTb1I.js → FieldComponent.vue_vue_type_script_lang-CBlqKRzm.js} +1 -1
- package/dist/{FieldComponent.vue_vue_type_script_lang-BC3VLZoe.cjs → FieldComponent.vue_vue_type_script_lang-D1X1I7bd.cjs} +1 -1
- package/dist/Interfaces/IBaseVueComponent.d.ts +23 -0
- package/dist/Interfaces/IDeviceInfo.d.ts +30 -0
- package/dist/Interfaces/IGlobalVST.d.ts +63 -9
- package/dist/Interfaces/IHammer.d.ts +271 -0
- package/dist/{SelectField-DZ9FrKd8.js → SelectField-DiN44-uN.js} +2 -2
- package/dist/{SelectField-DepJmnpN.cjs → SelectField-DrAP2d8E.cjs} +1 -1
- package/dist/{StringField-BNqCmIO-.cjs → StringField-C3rUlB-U.cjs} +1 -1
- package/dist/{StringField-C2xjiPLN.js → StringField-C6GPyrJH.js} +2 -2
- package/dist/{SwitchField-DtUM_9yI.cjs → SwitchField-DHpQB0AX.cjs} +1 -1
- package/dist/{SwitchField-Bd9Hhv_F.js → SwitchField-DyEDSMk2.js} +2 -2
- package/dist/{Tabs-10yUU8H-.cjs → Tabs-BLrXVeT4.cjs} +1 -1
- package/dist/{Tabs-f_Dhaakg.js → Tabs-Cwhv2zO2.js} +1 -1
- package/dist/TextField-eL69jvRK.cjs +171 -0
- package/dist/{TextField-Cy_YVWog.js → TextField-hUqAtULW.js} +4688 -4719
- package/dist/components/Elements/Button/ButtonInherited.d.ts +2 -2
- package/dist/core/Helpers/DeviceInfo.d.ts +21 -0
- package/dist/core/Helpers/Hammer.d.ts +3 -0
- package/dist/index-BxErfaCr.js +5559 -0
- package/dist/index-Isr0TfMn.cjs +3 -0
- package/dist/replaceable/BaseComponent.vue +110 -57
- package/dist/replaceable/Elements/Button/ButtonInherited.d.ts +2 -2
- package/dist/vue-spear-tip.cjs.js +1 -1
- package/dist/vue-spear-tip.css +1 -1
- package/dist/vue-spear-tip.es.js +1 -1
- package/docs/index.html +2 -2
- package/docs/static/Button-BuXt8FG8.css +1 -0
- package/docs/static/Button-Co7K-58W.js +1 -0
- package/docs/static/{CodeHighlight-CJLZIU3P.js → CodeHighlight-CG0zK3xQ.js} +1 -1
- package/docs/static/{DateField-cKzguGFS.js → DateField-43C7au0D.js} +1 -1
- package/docs/static/{FieldComponent.vue_vue_type_script_lang-CbUYeXxM.js → FieldComponent.vue_vue_type_script_lang-C_vol6Qx.js} +1 -1
- package/docs/static/{NoSymbolIcon-Wc3DJrIk.js → NoSymbolIcon-DmB80OZI.js} +1 -1
- package/docs/static/{SelectField-D8fzgnba.js → SelectField-rD3qrYlT.js} +1 -1
- package/docs/static/{StringField-0KCExOu8.js → StringField-DP-fbIl0.js} +1 -1
- package/docs/static/{SwitchField-DRyKtOUk.js → SwitchField-8sJmj5jC.js} +1 -1
- package/docs/static/{Tabs-Px1SyHqa.js → Tabs-DqMbsFic.js} +1 -1
- package/docs/static/TextField-pkS19yfO.js +171 -0
- package/docs/static/index-dqGIXUrW.js +2 -0
- package/docs/static/main--zkFhs1r.js +97 -0
- package/docs/static/main-hpuWh67r.css +1 -0
- package/package.json +1 -1
- package/dist/Button-Bd73SE5k.cjs +0 -1
- package/dist/TextField-BmOUp-jf.cjs +0 -171
- package/dist/index-Ccp2Ps3f.cjs +0 -1
- package/dist/index-tFjvTAxv.js +0 -4720
- package/docs/static/Button-CGu5GzBW.css +0 -1
- package/docs/static/Button-DH5D9bi_.js +0 -1
- package/docs/static/TextField-CUuzbyvs.js +0 -171
- package/docs/static/index-CWyWjtR8.js +0 -2
- package/docs/static/main-Dgq_kxc_.css +0 -1
- package/docs/static/main-HraVMNxt.js +0 -95
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";var I0=Object.defineProperty;var a=(t,e)=>I0(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("vue"),Vt=require("./index-Ccp2Ps3f.cjs"),R0=require("./FieldComponent.vue_vue_type_script_lang-BC3VLZoe.cjs"),F0=require("./_commonjsHelpers-DqS8WYlY.cjs"),L0=require("./NoSymbolIcon-BoH28Kep.cjs"),P0=require("./_plugin-vue_export-helper-BaHX9ZKS.cjs");function se(t){this.content=t}a(se,"OrderedMap");se.prototype={constructor:se,find:a(function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},"find"),get:a(function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},"get"),update:a(function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new se(o)},"update"),remove:a(function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new se(n)},"remove"),addToStart:a(function(t,e){return new se([t,e].concat(this.remove(t).content))},"addToStart"),addToEnd:a(function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new se(n)},"addToEnd"),addBefore:a(function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new se(i)},"addBefore"),forEach:a(function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},"forEach"),prepend:a(function(t){return t=se.from(t),t.size?new se(t.content.concat(this.subtract(t).content)):this},"prepend"),append:a(function(t){return t=se.from(t),t.size?new se(this.subtract(t).content.concat(t.content)):this},"append"),subtract:a(function(t){var e=this;t=se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},"subtract"),toObject:a(function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},"toObject"),get size(){return this.content.length>>1}};se.from=function(t){if(t instanceof se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new se(e)};function cf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=cf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}a(cf,"findDiffStart");function df(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),u=e.child(--o),l=s.nodeSize;if(s==u){n-=l,r-=l;continue}if(!s.sameMarkup(u))return{a:n,b:r};if(s.isText&&s.text!=u.text){let c=0,d=Math.min(s.text.length,u.text.length);for(;c<d&&s.text[s.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||u.content.size){let c=df(s.content,u.content,n-1,r-1);if(c)return c}n-=l,r-=l}}a(df,"findDiffEnd");const oe=class oe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,u=0;u<n;s++){let l=this.content[s],c=u+l.nodeSize;if(c>e&&r(l,i+u,o||null,s)!==!1&&l.content.size){let d=u+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}u=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(u,l)=>{let c=u.isText?u.text.slice(Math.max(e,l)-l,n-l):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&c||u.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new oe(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let u=this.content[o],l=s+u.nodeSize;l>e&&((s<e||l>n)&&(u.isText?u=u.cut(Math.max(0,e-s),Math.min(u.text.length,n-s)):u=u.cut(Math.max(0,e-s-1),Math.min(u.content.size,n-s-1))),r.push(u),i+=u.nodeSize),s=l}return new oe(r,i)}cutByIndex(e,n){return e==n?oe.empty:e==0&&n==this.content.length?this:new oe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new oe(i,o)}addToStart(e){return new oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new oe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return cf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return df(this,e,n,r)}findIndex(e){if(e==0)return ki(0,e);if(e==this.size)return ki(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=e)return o==e?ki(n+1,o):ki(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return oe.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new oe(n||e,r)}static from(e){if(!e)return oe.empty;if(e instanceof oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};a(oe,"Fragment");let M=oe;M.empty=new M([],0);const Ts={index:0,offset:0};function ki(t,e){return Ts.index=t,Ts.offset=e,Ts}a(ki,"retIndex");function Hi(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Hi(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Hi(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}a(Hi,"compareDeep");var $t;let z=($t=class{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Hi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $t.none;if(e instanceof $t)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}},a($t,"Mark"),$t);z.none=[];const ya=class ya extends Error{};a(ya,"ReplaceError");let ir=ya;const Tt=class Tt{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=hf(this.content,e+this.openStart,n);return r&&new Tt(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Tt(ff(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Tt.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Tt(M.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new Tt(e,r,i)}};a(Tt,"Slice");let T=Tt;T.empty=new T(M.empty,0,0);function ff(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:u}=t.findIndex(n);if(i==e||o.isText){if(u!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ff(o.content,e-i-1,n-i-1)))}a(ff,"removeRange");function hf(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=hf(s.content,e-o-1,n,s);return u&&t.replaceChild(i,s.copy(u))}a(hf,"insertInto");function B0(t,e,n){if(n.openStart>t.depth)throw new ir("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ir("Inconsistent open depths");return pf(t,e,n,0)}a(B0,"replace$1");function pf(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=pf(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,u=s.content;return hn(s,u.cut(0,t.parentOffset).append(n.content).append(u.cut(e.parentOffset)))}else{let{start:s,end:u}=z0(n,t);return hn(o,gf(t,s,u,e,r))}else return hn(o,Vi(t,e,r))}a(pf,"replaceOuter");function mf(t,e){if(!e.type.compatibleContent(t.type))throw new ir("Cannot join "+e.type.name+" onto "+t.type.name)}a(mf,"checkJoin");function fu(t,e,n){let r=t.node(n);return mf(r,e.node(n)),r}a(fu,"joinable$1");function fn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}a(fn,"addNode");function Or(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(fn(t.nodeAfter,r),o++));for(let u=o;u<s;u++)fn(i.child(u),r);e&&e.depth==n&&e.textOffset&&fn(e.nodeBefore,r)}a(Or,"addRange");function hn(t,e){return t.type.checkContent(e),t.copy(e)}a(hn,"close");function gf(t,e,n,r,i){let o=t.depth>i&&fu(t,e,i+1),s=r.depth>i&&fu(n,r,i+1),u=[];return Or(null,t,i,u),o&&s&&e.index(i)==n.index(i)?(mf(o,s),fn(hn(o,gf(t,e,n,r,i+1)),u)):(o&&fn(hn(o,Vi(t,e,i+1)),u),Or(e,n,i,u),s&&fn(hn(s,Vi(n,r,i+1)),u)),Or(r,null,i,u),new M(u)}a(gf,"replaceThreeWay");function Vi(t,e,n){let r=[];if(Or(null,t,n,r),t.depth>n){let i=fu(t,e,n+1);fn(hn(i,Vi(t,e,n+1)),r)}return Or(e,null,n,r),new M(r)}a(Vi,"replaceTwoWay");function z0(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(M.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}a(z0,"prepareSliceForReplace");const Hr=class Hr{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new or(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:u,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,u,i+l),!c||(s=s.child(u),s.isText))break;o=c-1,i+=l+1}return new Hr(n,r,o)}static resolveCached(e,n){let r=nc.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else nc.set(e,r=new hu);let i=r.elts[r.i]=Hr.resolve(e,n);return r.i=(r.i+1)%$0,i}};a(Hr,"ResolvedPos");let ji=Hr;const xa=class xa{constructor(){this.elts=[],this.i=0}};a(xa,"ResolveCache");let hu=xa;const $0=12,nc=new WeakMap,ka=class ka{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};a(ka,"NodeRange");let or=ka;const H0=Object.create(null);var Ht;let Lt=(Ht=class{constructor(e,n,r,i=z.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Hi(this.attrs,n||e.defaultAttrs||H0)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ht(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ht(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return T.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),u=i.start(s),c=i.node(s).content.cut(i.pos-u,o.pos-u);return new T(c,i.depth-s,o.depth-s)}replace(e,n,r){return B0(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return ji.resolveCached(this,e)}resolveNoCache(e){return ji.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),bf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=M.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),u=s&&s.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=M.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}},a(Ht,"Node"),Ht);Lt.prototype.text=void 0;const Vr=class Vr extends Lt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Vr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vr(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};a(Vr,"TextNode");let pu=Vr;function bf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}a(bf,"wrapMarks");const Zo=class Zo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new mu(e,n);if(r.next==null)return Zo.empty;let i=yf(r);r.next&&r.err("Unexpected trailing text");let o=J0(K0(i));return G0(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,u){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return M.from(u.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:f}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,u.concat(d));if(h)return h}}return null}return a(o,"search"),o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let u=i;u.type;u=u.via)s.push(u.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:u,next:l}=o.next[s];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||l.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return a(n,"scan"),n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
2
|
-
`)}};a(Zo,"ContentMatch");let En=Zo;En.empty=new En(!0);const wa=class wa{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};a(wa,"TokenStream");let mu=wa;function yf(t){let e=[];do e.push(V0(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}a(yf,"parseExpr");function V0(t){let e=[];do e.push(j0(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}a(V0,"parseExprSeq");function j0(t){let e=W0(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=q0(t,e);else break;return e}a(j0,"parseExprSubscript");function rc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}a(rc,"parseNum");function q0(t,e){let n=rc(t),r=n;return t.eat(",")&&(t.next!="}"?r=rc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}a(q0,"parseExprRange");function U0(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}a(U0,"resolveName");function W0(t){if(t.eat("(")){let e=yf(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=U0(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}a(W0,"parseExprAtom");function K0(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}a(n,"node");function r(s,u,l){let c={term:l,to:u};return e[s].push(c),c}a(r,"edge");function i(s,u){s.forEach(l=>l.to=u)}a(i,"connect");function o(s,u){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,u)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],u);if(l==s.exprs.length-1)return c;i(c,u=n())}else if(s.type=="star"){let l=n();return r(u,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,u),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(u)].concat(o(s.expr,u));if(s.type=="range"){let l=u;for(let c=0;c<s.min;c++){let d=n();i(o(s.expr,l),d),l=d}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let d=n();r(l,d),i(o(s.expr,l),d),l=d}return[r(l)]}else{if(s.type=="name")return[r(u,void 0,s.value)];throw new Error("Unknown expr type")}}}a(o,"compile")}a(K0,"nfa");function xf(t,e){return e-t}a(xf,"cmp");function ic(t,e){let n=[];return r(e),n.sort(xf);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:u,to:l}=o[s];!u&&n.indexOf(l)==-1&&r(l)}}a(r,"scan")}a(ic,"nullFrom");function J0(t){let e=Object.create(null);return n(ic(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:u,to:l})=>{if(!u)return;let c;for(let d=0;d<i.length;d++)i[d][0]==u&&(c=i[d][1]);ic(t,l).forEach(d=>{c||i.push([u,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=e[r.join(",")]=new En(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let u=i[s][1].sort(xf);o.next.push({type:i[s][0],next:e[u.join(",")]||n(u)})}return o}}a(J0,"dfa");function G0(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let u=0;u<i.next.length;u++){let{type:l,next:c}=i.next[u];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}a(G0,"checkForDeadEnds");function kf(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}a(kf,"defaultAttrs");function wf(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}a(wf,"computeAttrs");function Cf(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}a(Cf,"checkAttrs");function Ef(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new gu(t,r,e[r]);return n}a(Ef,"initAttrs");var yn;let oc=(yn=class{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Ef(e,r.attrs),this.defaultAttrs=kf(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==En.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:wf(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Lt(this,this.computeAttrs(e),M.from(n),z.setFrom(r))}createChecked(e=null,n,r){return n=M.from(n),this.checkContent(n),new Lt(this,this.computeAttrs(e),n,z.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=M.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(M.empty,!0);return o?new Lt(this,e,n.append(o),z.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Cf(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:z.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new yn(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}},a(yn,"NodeType"),yn);function Z0(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}a(Z0,"validateType");const Ca=class Ca{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Z0(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}};a(Ca,"Attribute");let gu=Ca;const Xo=class Xo{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Ef(e,i.attrs),this.excluded=null;let o=kf(this.attrs);this.instance=o?new z(this,o):null}create(e=null){return!e&&this.instance?this.instance:new z(this,wf(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Xo(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Cf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}};a(Xo,"MarkType");let qi=Xo;const Ea=class Ea{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=se.from(e.nodes),n.marks=se.from(e.marks||{}),this.nodes=oc.compile(this.spec.nodes,this),this.marks=qi.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",u=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=En.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=u=="_"?null:u?sc(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:sc(this,s.split(" "))}this.nodeFromJSON=i=>Lt.fromJSON(this,i),this.markFromJSON=i=>z.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof oc){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new pu(r,r.defaultAttrs,e,z.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};a(Ea,"Schema");let Gr=Ea;function sc(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let u in t.marks){let l=t.marks[u];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}a(sc,"gatherMarks");function X0(t){return t.tag!=null}a(X0,"isTagRule");function Y0(t){return t.style!=null}a(Y0,"isStyleRule");const jr=class jr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(X0(i))this.tags.push(i);else if(Y0(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Ui(this,n,!1);return r.addAll(e,z.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Ui(this,n,!0);return r.addAll(e,z.none,n.from,n.to),T.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(tm(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],u=s.style;if(!(u.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let u=n[s];if((u.priority==null?50:u.priority)<o)break}n.splice(s,0,i)}a(r,"insert");for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=lc(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=lc(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new jr(e,jr.schemaRules(e)))}};a(jr,"DOMParser");let Pt=jr;const Sf={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},Q0={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},vf={ol:!0,ul:!0},Zr=1,bu=2,_r=4;function uc(t,e,n){return e!=null?(e?Zr:0)|(e==="full"?bu:0):t&&t.whitespace=="pre"?Zr|bu:n&~_r}a(uc,"wsOptionsFor");const Sa=class Sa{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=z.none,this.match=o||(s&_r?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(M.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Zr)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=M.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Sf.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}};a(Sa,"NodeContext");let Fn=Sa;const va=class va{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=uc(null,n.preserveWhitespace,0)|(r?_r:0);i?o=new Fn(i.type,i.attrs,z.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Fn(null,null,z.none,!0,null,s):o=new Fn(e.schema.topNodeType,null,z.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&bu?"full":this.localPreserveWS||(i.options&Zr)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
|
|
3
|
-
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let u=r.split(/\r?\n|\r/);for(let l=0;l<u.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),u[l]&&this.insertNode(s.text(u[l]),n,!/\S/.test(u[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let u=i.content[i.content.length-1],l=e.previousSibling;(!u||l&&l.nodeName=="BR"||u.isText&&/[ \t\r\n\u000c]$/.test(u.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),u;vf.hasOwnProperty(s)&&this.parser.normalizeLists&&em(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(u=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Q0.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(Sf.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(o),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?u:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
-
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let u=void 0;;){let l=this.parser.matchStyle(o,s,this,u);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)u=l;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let u=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(u)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,u=i==null?null:e.childNodes[i];s!=u;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n,r){let i,o;for(let s=this.open,u=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+u)&&(i=c,o=l,!c.length))break;if(l.solid){if(r)break;u+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=z.none;for(let u of i.concat(e.marks))(o.type?o.type.allowsMarkType(u.type):ac(u.type,e.type))&&(s=u.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r,!1);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let u=uc(e,o,s.options);s.options&_r&&s.content.length==0&&(u|=_r);let l=z.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):ac(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Fn(e,n,l,i,null,u)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Zr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=a((u,l)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;l>=o;l--)if(s(u-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0},"match");return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};a(va,"ParseContext");let Ui=va;function em(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&vf.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}a(em,"normalizeList");function tm(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}a(tm,"matches");function lc(t){let e={};for(let n in t)e[n]=t[n];return e}a(lc,"copy");function ac(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a(u=>{o.push(u);for(let l=0;l<u.edgeCount;l++){let{type:c,next:d}=u.edge(l);if(c==e||o.indexOf(d)<0&&s(d))return!0}},"scan");if(s(i.contentMatch))return!0}}a(ac,"markMayApply");const Yo=class Yo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ds(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let u=0,l=0;for(;u<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,l++}for(;u<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],d=this.serializeMark(c,s.isInline,n);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Fi(Ds(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Fi(Ds(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Fi(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Yo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=cc(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return cc(e.marks)}};a(Yo,"DOMSerializer");let Sn=Yo;function cc(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}a(cc,"gatherToDOM");function Ds(t){return t.document||window.document}a(Ds,"doc$1");const dc=new WeakMap;function nm(t){let e=dc.get(t);return e===void 0&&dc.set(t,e=rm(t)),e}a(nm,"suspiciousAttributes");function rm(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return a(n,"scan"),n(t),e}a(rm,"suspiciousAttributesInner");function Fi(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=nm(r))&&o.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=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let u,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let h=f.indexOf(" ");h>0?l.setAttributeNS(f.slice(0,h),f.slice(h+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=d;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:m}=Fi(t,h,n,r);if(l.appendChild(p),m){if(u)throw new RangeError("Multiple content holes");u=m}}}return{dom:l,contentDOM:u}}a(Fi,"renderSpec");const Af=65535,Mf=Math.pow(2,16);function im(t,e){return t+e*Mf}a(im,"makeRecover");function fc(t){return t&Af}a(fc,"recoverIndex");function om(t){return(t-(t&Af))/Mf}a(om,"recoverOffset");const Tf=1,Df=2,Li=4,Of=8,Aa=class Aa{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Of)>0}get deletedBefore(){return(this.delInfo&(Tf|Li))>0}get deletedAfter(){return(this.delInfo&(Df|Li))>0}get deletedAcross(){return(this.delInfo&Li)>0}};a(Aa,"MapResult");let Xr=Aa;const Dt=class Dt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Dt.empty)return Dt.empty}recover(e){let n=0,r=fc(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+om(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let l=this.ranges[u]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[u+o],d=this.ranges[u+s],f=l+c;if(e<=f){let h=c?e==l?-1:e==f?1:n:n,p=l+i+(h<0?0:d);if(r)return p;let m=e==(n<0?l:f)?null:im(u/3,e-l),g=e==l?Df:e==f?Tf:Li;return(n<0?e!=l:e!=f)&&(g|=Of),new Xr(p,g,m)}i+=d-c}return r?e+i:new Xr(e+i,0,null)}touches(e,n){let r=0,i=fc(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let l=this.ranges[u]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[u+o],d=l+c;if(e<=d&&u==i*3)return!0;r+=this.ranges[u+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],u=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],d=this.ranges[i+r];e(u,u+c,l,l+d),o+=d-c}}invert(){return new Dt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Dt.empty:new Dt(e<0?[0,-e,0]:[0,0,e])}};a(Dt,"StepMap");let yt=Dt;yt.empty=new yt([]);const qr=class qr{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new qr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new qr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],u=s.mapResult(e,n);if(u.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new Xr(e,i,null)}};a(qr,"Mapping");let Wi=qr;const Os=Object.create(null),Ma=class Ma{getMap(){return yt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Os[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Os)throw new RangeError("Duplicate use of step JSON ID "+e);return Os[e]=n,n.prototype.jsonID=e,n}};a(Ma,"Step");let ie=Ma;const Qt=class Qt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Qt(e,null)}static fail(e){return new Qt(null,e)}static fromReplace(e,n,r,i){try{return Qt.ok(e.replace(n,r,i))}catch(o){if(o instanceof ir)return Qt.fail(o.message);throw o}}};a(Qt,"StepResult");let ae=Qt;function ml(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(ml(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return M.fromArray(r)}a(ml,"mapFragment");const en=class en extends ie{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new T(ml(n.content,(s,u)=>!s.isAtom||!u.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return ae.fromReplace(e,this.from,this.to,o)}invert(){return new jt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new en(n.pos,r.pos,this.mark)}merge(e){return e instanceof en&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new en(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new en(n.from,n.to,e.markFromJSON(n.mark))}};a(en,"AddMarkStep");let Yr=en;ie.jsonID("addMark",Yr);const tn=class tn extends ie{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new T(ml(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return ae.fromReplace(e,this.from,this.to,r)}invert(){return new Yr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new tn(n.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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new tn(n.from,n.to,e.markFromJSON(n.mark))}};a(tn,"RemoveMarkStep");let jt=tn;ie.jsonID("removeMark",jt);const nn=class nn extends ie{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ae.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ae.fromReplace(e,this.pos,this.pos+1,new T(M.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new nn(this.pos,n.marks[i]);return new nn(this.pos,this.mark)}}return new sr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new nn(n.pos,e.markFromJSON(n.mark))}};a(nn,"AddNodeMarkStep");let Qr=nn;ie.jsonID("addNodeMark",Qr);const Ur=class Ur extends ie{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ae.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ae.fromReplace(e,this.pos,this.pos+1,new T(M.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Qr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ur(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ur(n.pos,e.markFromJSON(n.mark))}};a(Ur,"RemoveNodeMarkStep");let sr=Ur;ie.jsonID("removeNodeMark",sr);const ft=class ft extends ie{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&yu(e,this.from,this.to)?ae.fail("Structure replace would overwrite content"):ae.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new yt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ft(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ft(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ft)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?T.empty:new T(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ft(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?T.empty:new T(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ft(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ft(n.from,n.to,T.fromJSON(e,n.slice),!!n.structure)}};a(ft,"ReplaceStep");let Ae=ft;ie.jsonID("replace",Ae);const Ln=class Ln extends ie{constructor(e,n,r,i,o,s,u=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=u}apply(e){if(this.structure&&(yu(e,this.from,this.gapFrom)||yu(e,this.gapTo,this.to)))return ae.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ae.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ae.fromReplace(e,this.from,this.to,r):ae.fail("Content does not fit in gap")}getMap(){return new yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ln(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ln(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ln(n.from,n.to,n.gapFrom,n.gapTo,T.fromJSON(e,n.slice),n.insert,!!n.structure)}};a(Ln,"ReplaceAroundStep");let he=Ln;ie.jsonID("replaceAround",he);function yu(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}a(yu,"contentBetween");function sm(t,e,n,r){let i=[],o=[],s,u;t.doc.nodesBetween(e,n,(l,c,d)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let h=Math.max(c,e),p=Math.min(c+l.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[g])?s.to=p:i.push(s=new jt(h,p,f[g])));u&&u.to==h?u.to=p:o.push(u=new Yr(h,p,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}a(sm,"addMark");function um(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,u)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof qi){let c=s.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(u+s.nodeSize,n);for(let d=0;d<l.length;d++){let f=l[d],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=c,h.step=o):i.push({style:f,from:Math.max(u,e),to:c,step:o})}}}),i.forEach(s=>t.step(new jt(s.from,s.to,s.style)))}a(um,"removeMark");function gl(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],u=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=u+c.nodeSize,f=r.matchType(c.type);if(!f)s.push(new Ae(u,d,T.empty));else{r=f;for(let h=0;h<c.marks.length;h++)n.allowsMarkType(c.marks[h].type)||t.step(new jt(u,d,c.marks[h]));if(i&&c.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(c.text);)m||(m=new T(M.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Ae(u+h.index,u+h.index+h[0].length,m))}}u=d}if(!r.validEnd){let l=r.fillBefore(M.empty,!0);t.replace(u,u,new T(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}a(gl,"clearIncompatible");function lm(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}a(lm,"canCut");function kr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,o=0;;--r){let s=t.$from.node(r),u=t.$from.index(r)+i,l=t.$to.indexAfter(r)-o;if(r<t.depth&&s.canReplace(u,l,n))return r;if(r==0||s.type.spec.isolating||!lm(s,u,l))break;u&&(i=1),l<s.childCount&&(o=1)}return null}a(kr,"liftTarget");function am(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),u=i.after(o+1),l=s,c=u,d=M.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,d=M.from(r.node(m).copy(d)),f++):l--;let h=M.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=M.from(i.node(m).copy(h)),p++):c++;t.step(new he(l,c,s,u,new T(d.append(h),f,p),d.size-f,!0))}a(am,"lift$2");function bl(t,e,n=null,r=t){let i=cm(t,e),o=i&&dm(r,e);return o?i.map(hc).concat({type:e,attrs:n}).concat(o.map(hc)):null}a(bl,"findWrapping");function hc(t){return{type:t,attrs:null}}a(hc,"withAttrs");function cm(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}a(cm,"findWrappingOutside");function dm(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}a(dm,"findWrappingInside");function fm(t,e,n){let r=M.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let u=n[s].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=M.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new he(i,o,i,o,new T(r,0,0),n.length,!0))}a(fm,"wrap");function hm(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,u)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&pm(t.doc,t.mapping.slice(o).map(u),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}c===!1&&Nf(t,s,u,o),gl(t,t.mapping.slice(o).map(u,1),r,void 0,c===null);let d=t.mapping.slice(o),f=d.map(u,1),h=d.map(u+s.nodeSize,1);return t.step(new he(f,h,f+1,h-1,new T(M.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&_f(t,s,u,o),!1}})}a(hm,"setBlockType$1");function _f(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,u=/\r?\n|\r/g;for(;s=u.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}a(_f,"replaceNewlines");function Nf(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
5
|
-
`))}})}a(Nf,"replaceLinebreaks");function pm(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}a(pm,"canChangeType");function mm(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new he(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new T(M.from(s),0,0),1,!0))}a(mm,"setNodeMarkup");function gt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=n-2;c>o;c--,d--){let f=i.node(c),h=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[d+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[d]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let u=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(u,u,l?l.type:i.node(o+1).type)}a(gt,"canSplit");function gm(t,e,n=1,r){let i=t.doc.resolve(e),o=M.empty,s=M.empty;for(let u=i.depth,l=i.depth-n,c=n-1;u>l;u--,c--){o=M.from(i.node(u).copy(o));let d=r&&r[c];s=M.from(d?d.type.create(d.attrs,s):i.node(u).copy(s))}t.step(new Ae(e,e,new T(o.append(s),n,n),!0))}a(gm,"split");function Gt(t,e){let n=t.resolve(e),r=n.index();return If(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}a(Gt,"canJoin");function bm(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}a(bm,"canAppendWithSubstitutedLinebreaks");function If(t,e){return!!(t&&e&&!t.isLeaf&&bm(t,e))}a(If,"joinable");function ls(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),u++,s=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),s=r.node(i+1)),o&&!o.isTextblock&&If(o,s)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}a(ls,"joinPoint");function ym(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let d=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);d&&!f?r=!1:!d&&f&&(r=!0)}let u=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Nf(t,d.node(),d.before(),u)}s.inlineContent&&gl(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=t.mapping.slice(u),c=l.map(e-n);if(t.step(new Ae(c,l.map(e+n,-1),T.empty,!0)),r===!0){let d=t.doc.resolve(c);_f(t,d.node(),d.before(),t.steps.length)}return t}a(ym,"join");function xm(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}a(xm,"insertPoint");function Rf(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(u>0?1:0),c=r.node(s),d=!1;if(o==1)d=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);d=f&&c.canReplaceWith(l,l,f[0])}if(d)return u==0?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}a(Rf,"dropPoint");function as(t,e,n=e,r=T.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Ff(i,o,r)?new Ae(e,n,r):new xu(i,o,r).fit()}a(as,"replaceStep");function Ff(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}a(Ff,"fitsTrivially");const Ta=class Ta{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=M.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=M.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,u=i.depth;for(;s&&u&&o.childCount==1;)o=o.firstChild.content,s--,u--;let l=new T(o,s,u);return e>-1?new he(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ae(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=_s(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:l,match:c}=this.frontier[u],d,f=null;if(n==1&&(s?c.matchType(s.type)||(f=c.fillBefore(M.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:f};if(n==2&&s&&(d=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:d};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=_s(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new T(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=_s(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new T(Mr(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new T(Mr(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,u=r?r.content:s.content,l=s.openStart-e,c=0,d=[],{match:f,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)d.push(i.child(g));f=f.matchFragment(i)}let p=u.size+e-(s.content.size-s.openEnd);for(;c<u.childCount;){let g=u.child(c),b=f.matchType(g.type);if(!b)break;c++,(c>1||l==0||g.content.size)&&(f=b,d.push(Lf(g.mark(h.allowedMarks(g.marks)),c==1?l:0,c==u.childCount?p:-1)))}let m=c==u.childCount;m||(p=-1),this.placed=Tr(this.placed,n,M.from(d)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=u;g<p;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?T.empty:new T(Mr(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new T(Mr(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ns(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Ns(e,n,i,r,o);if(s){for(let u=n-1;u>=0;u--){let{match:l,type:c}=this.frontier[u],d=Ns(e,u,c,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Tr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Tr(this.placed,this.depth,M.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(M.empty,!0);n.childCount&&(this.placed=Tr(this.placed,this.frontier.length,n))}};a(Ta,"Fitter");let xu=Ta;function Mr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Mr(t.firstChild.content,e-1,n)))}a(Mr,"dropFromFragment");function Tr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Tr(t.lastChild.content,e-1,n)))}a(Tr,"addToFragment");function _s(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}a(_s,"contentAt");function Lf(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Lf(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(M.empty,!0)))),t.copy(r)}a(Lf,"closeNodeStart");function Ns(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,s);return u&&!km(n,o.content,s)?u:null}a(Ns,"contentAfterFits");function km(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}a(km,"invalidMarks");function wm(t){return t.spec.defining||t.spec.definingForContent}a(wm,"definesContent");function Cm(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Ff(i,o,r))return t.step(new Ae(e,n,r));let s=Bf(i,o);s[s.length-1]==0&&s.pop();let u=-(i.depth+1);s.unshift(u);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?u=h:i.before(h)==p&&s.splice(1,0,-h)}let l=s.indexOf(u),c=[],d=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(c.push(m),p==r.openStart)break;h=m.content}for(let h=d-1;h>=0;h--){let p=c[h],m=wm(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(u)-1)))d=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+d+1)%(r.openStart+1),m=c[p];if(m)for(let g=0;g<s.length;g++){let b=s[(g+l)%s.length],y=!0;b<0&&(y=!1,b=-b);let x=i.node(b-1),k=i.index(b-1);if(x.canReplaceWith(k,k,m.type,m.marks))return t.replace(i.before(b),y?o.after(b):n,new T(Pf(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}a(Cm,"replaceRange");function Pf(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Pf(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(M.empty,!0))}return t}a(Pf,"closeFragment");function Em(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=xm(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new T(M.from(r),0,0))}a(Em,"replaceRangeWith");function Sm(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Bf(r,i);for(let s=0;s<o.length;s++){let u=o[s],l=s==o.length-1;if(l&&u==0||r.node(u).type.contentMatch.validEnd)return t.delete(r.start(u),i.end(u));if(u>0&&(l||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return t.delete(r.before(u),i.after(u))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}a(Sm,"deleteRange$1");function Bf(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}a(Bf,"coveredDepths");const Pn=class Pn extends ie{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return ae.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return ae.fromReplace(e,this.pos,this.pos+1,new T(M.from(i),0,n.isLeaf?0:1))}getMap(){return yt.empty}invert(e){return new Pn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Pn(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Pn(n.pos,n.attr,n.value)}};a(Pn,"AttrStep");let Ki=Pn;ie.jsonID("attr",Ki);const Wr=class Wr extends ie{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return ae.ok(r)}getMap(){return yt.empty}invert(e){return new Wr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Wr(n.attr,n.value)}};a(Wr,"DocAttrStep");let Ji=Wr;ie.jsonID("docAttr",Ji);var Vn;let ur=(Vn=class extends Error{},a(Vn,"TransformError"),Vn);ur=a(function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},"TransformError");ur.prototype=Object.create(Error.prototype);ur.prototype.constructor=ur;ur.prototype.name="TransformError";const Da=class Da{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Wi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ur(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=T.empty){let i=as(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new T(M.from(r),0,0))}delete(e,n){return this.replace(e,n,T.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Cm(this,e,n,r),this}replaceRangeWith(e,n,r){return Em(this,e,n,r),this}deleteRange(e,n){return Sm(this,e,n),this}lift(e,n){return am(this,e,n),this}join(e,n=1){return ym(this,e,n),this}wrap(e,n){return fm(this,e,n),this}setBlockType(e,n=e,r,i=null){return hm(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return mm(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Ki(e,n,r)),this}setDocAttribute(e,n){return this.step(new Ji(e,n)),this}addNodeMark(e,n){return this.step(new Qr(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof z)n.isInSet(r.marks)&&this.step(new sr(e,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new sr(e,o)),i=o.removeFromSet(i);for(let u=s.length-1;u>=0;u--)this.step(s[u])}return this}split(e,n=1,r){return gm(this,e,n,r),this}addMark(e,n,r){return sm(this,e,n,r),this}removeMark(e,n,r){return um(this,e,n,r),this}clearIncompatible(e,n,r){return gl(this,e,n,r),this}};a(Da,"Transform");let Gi=Da;const Is=Object.create(null),Oa=class Oa{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Zi(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=T.empty){let r=n.content.lastChild,i=null;for(let u=0;u<n.openEnd;u++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let u=0;u<s.length;u++){let{$from:l,$to:c}=s[u],d=e.mapping.slice(o);e.replaceRange(d.map(l.pos),d.map(c.pos),u?T.empty:n),u==0&&gc(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:u}=i[o],l=e.mapping.slice(r),c=l.map(s.pos),d=l.map(u.pos);o?e.deleteRange(c,d):(e.replaceRangeWith(c,d,n),gc(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new F(e):Nn(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Nn(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Nn(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Be(e.node(0))}static atStart(e){return Nn(e,e,0,0,1)||new Be(e)}static atEnd(e){return Nn(e,e,e.content.size,e.childCount,-1)||new Be(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Is[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Is)throw new RangeError("Duplicate use of selection JSON ID "+e);return Is[e]=n,n.prototype.jsonID=e,n}getBookmark(){return F.between(this.$anchor,this.$head).getBookmark()}};a(Oa,"Selection");let R=Oa;R.prototype.visible=!0;const _a=class _a{constructor(e,n){this.$from=e,this.$to=n}};a(_a,"SelectionRange");let Zi=_a,pc=!1;function mc(t){!pc&&!t.parent.inlineContent&&(pc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}a(mc,"checkTextSelection");const rn=class rn extends R{constructor(e,n=e){mc(e),mc(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return R.near(r);let i=e.resolve(n.map(this.anchor));return new rn(i.parent.inlineContent?i:r,r)}replace(e,n=T.empty){if(super.replace(e,n),n==T.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof rn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Xi(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new rn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=R.findFrom(n,r,!0)||R.findFrom(n,-r,!0);if(o)n=o.$head;else return R.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(R.findFrom(e,-r,!0)||R.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new rn(e,n)}};a(rn,"TextSelection");let F=rn;R.jsonID("text",F);const Qo=class Qo{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Qo(e.map(this.anchor),e.map(this.head))}resolve(e){return F.between(e.resolve(this.anchor),e.resolve(this.head))}};a(Qo,"TextBookmark");let Xi=Qo;const on=class on extends R{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?R.near(o):new on(o)}content(){return new T(M.from(this.node),0,0)}eq(e){return e instanceof on&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ku(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new on(e.resolve(n.anchor))}static create(e,n){return new on(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};a(on,"NodeSelection");let I=on;I.prototype.visible=!1;R.jsonID("node",I);const es=class es{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Xi(r,r):new es(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&I.isSelectable(r)?new I(n):R.near(n)}};a(es,"NodeBookmark");let ku=es;const Bn=class Bn extends R{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=T.empty){if(n==T.empty){e.delete(0,e.doc.content.size);let r=R.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Bn(e)}map(e){return new Bn(e)}eq(e){return e instanceof Bn}getBookmark(){return vm}};a(Bn,"AllSelection");let Be=Bn;R.jsonID("all",Be);const vm={map(){return this},resolve(t){return new Be(t)}};function Nn(t,e,n,r,i,o=!1){if(e.inlineContent)return F.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let u=e.child(s);if(u.isAtom){if(!o&&I.isSelectable(u))return I.create(t,n-(i<0?u.nodeSize:0))}else{let l=Nn(t,u,n+i,i<0?u.childCount:0,i,o);if(l)return l}n+=u.nodeSize*i}return null}a(Nn,"findSelectionIn");function gc(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ae||i instanceof he))return;let o=t.mapping.maps[r],s;o.forEach((u,l,c,d)=>{s==null&&(s=d)}),t.setSelection(R.near(t.doc.resolve(s),n))}a(gc,"selectionToInsertionEnd$1");const bc=1,wi=2,yc=4,Na=class Na extends Gi{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|bc)&~wi,this.storedMarks=null,this}get selectionSet(){return(this.updated&bc)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=wi,this}ensureMarks(e){return z.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&wi)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~wi,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||z.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(R.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=yc,this}get scrolledIntoView(){return(this.updated&yc)>0}};a(Na,"Transaction");let wu=Na;function xc(t,e){return!e||!t?t:t.bind(e)}a(xc,"bind");const Ia=class Ia{constructor(e,n,r){this.name=e,this.init=xc(n.init,r),this.apply=xc(n.apply,r)}};a(Ia,"FieldDesc");let ln=Ia;const Am=[new ln("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ln("selection",{init(t,e){return t.selection||R.atStart(e.doc)},apply(t){return t.selection}}),new ln("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ln("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],Ra=class Ra{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Am.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new ln(r.key,r.spec.state,r))})}};a(Ra,"Configuration");let Nr=Ra;const sn=class sn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let u=this.config.plugins[s];if(u.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,d=l<n.length&&u.spec.appendTransaction.call(u,l?n.slice(l):n,c,r);if(d&&r.filterTransaction(d,s)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new sn(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new wu(this)}static create(e){let n=new Nr(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new sn(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Nr(this.schema,e.plugins),r=n.fields,i=new sn(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Nr(e.schema,e.plugins),o=new sn(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Lt.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=R.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let u in r){let l=r[u],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[s.name]=c.fromJSON.call(l,e,n[u],o);return}}o[s.name]=s.init(e,o)}}),o}};a(sn,"EditorState");let Cu=sn;function zf(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=zf(i,e,{})),n[r]=i}return n}a(zf,"bindProps");const Fa=class Fa{constructor(e){this.spec=e,this.props={},e.props&&zf(e.props,this,this.props),this.key=e.key?e.key.key:$f("plugin")}getState(e){return e[this.key]}};a(Fa,"Plugin");let V=Fa;const Rs=Object.create(null);function $f(t){return t in Rs?t+"$"+ ++Rs[t]:(Rs[t]=0,t+"$")}a($f,"createKey");const La=class La{constructor(e="key"){this.key=$f(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};a(La,"PluginKey");let q=La;const yl=a((t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),"deleteSelection$1");function Hf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}a(Hf,"atBlockStart");const Vf=a((t,e,n)=>{let r=Hf(t,n);if(!r)return!1;let i=xl(r);if(!i){let s=r.blockRange(),u=s&&kr(s);return u==null?!1:(e&&e(t.tr.lift(s,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(Xf(t,i,e,-1))return!0;if(r.parent.content.size==0&&(lr(o,"end")||I.isSelectable(o)))for(let s=r.depth;;s--){let u=as(t.doc,r.before(s),r.after(s),T.empty);if(u&&u.slice.size<u.to-u.from){if(e){let l=t.tr.step(u);l.setSelection(lr(o,"end")?R.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):I.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},"joinBackward$1"),Mm=a((t,e,n)=>{let r=Hf(t,n);if(!r)return!1;let i=xl(r);return i?jf(t,i,e):!1},"joinTextblockBackward$1"),Tm=a((t,e,n)=>{let r=Uf(t,n);if(!r)return!1;let i=kl(r);return i?jf(t,i,e):!1},"joinTextblockForward$1");function jf(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let s=e.nodeAfter,u=s,l=e.pos+1;for(;!u.isTextblock;l++){if(u.type.spec.isolating)return!1;let d=u.firstChild;if(!d)return!1;u=d}let c=as(t.doc,o,l,T.empty);if(!c||c.from!=o||c instanceof Ae&&c.slice.size>=l-o)return!1;if(n){let d=t.tr.step(c);d.setSelection(F.create(d.doc,o)),n(d.scrollIntoView())}return!0}a(jf,"joinTextblocksAround");function lr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}a(lr,"textblockAt");const qf=a((t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=xl(r)}let s=o&&o.nodeBefore;return!s||!I.isSelectable(s)?!1:(e&&e(t.tr.setSelection(I.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)},"selectNodeBackward$1");function xl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}a(xl,"findCutBefore");function Uf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}a(Uf,"atBlockEnd");const Wf=a((t,e,n)=>{let r=Uf(t,n);if(!r)return!1;let i=kl(r);if(!i)return!1;let o=i.nodeAfter;if(Xf(t,i,e,1))return!0;if(r.parent.content.size==0&&(lr(o,"start")||I.isSelectable(o))){let s=as(t.doc,r.before(),r.after(),T.empty);if(s&&s.slice.size<s.to-s.from){if(e){let u=t.tr.step(s);u.setSelection(lr(o,"start")?R.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):I.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},"joinForward$1"),Kf=a((t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=kl(r)}let s=o&&o.nodeAfter;return!s||!I.isSelectable(s)?!1:(e&&e(t.tr.setSelection(I.create(t.doc,o.pos)).scrollIntoView()),!0)},"selectNodeForward$1");function kl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}a(kl,"findCutAfter");const Dm=a((t,e)=>{let n=t.selection,r=n instanceof I,i;if(r){if(n.node.isTextblock||!Gt(t.doc,n.from))return!1;i=n.from}else if(i=ls(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(I.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},"joinUp$1"),Om=a((t,e)=>{let n=t.selection,r;if(n instanceof I){if(n.node.isTextblock||!Gt(t.doc,n.to))return!1;r=n.to}else if(r=ls(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},"joinDown$1"),_m=a((t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&kr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},"lift$1"),Jf=a((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
6
|
-
`).scrollIntoView()),!0)},"newlineInCode$1");function wl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}a(wl,"defaultBlockAt$1");const Nm=a((t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=wl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let u=n.after(),l=t.tr.replaceWith(u,u,s.createAndFill());l.setSelection(R.near(l.doc.resolve(u),1)),e(l.scrollIntoView())}return!0},"exitCode$1"),Gf=a((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Be||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=wl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=t.tr.insert(s,o.createAndFill());u.setSelection(F.create(u.doc,s+1)),e(u.scrollIntoView())}return!0},"createParagraphNear$1"),Zf=a((t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(gt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&kr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},"liftEmptyBlock$1");function Im(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof I&&e.selection.node.isBlock)return!r.parentOffset||!gt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,u,l=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),u=wl(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),o.unshift(l&&u?{type:u}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let d=e.tr;(e.selection instanceof F||e.selection instanceof Be)&&d.deleteSelection();let f=d.mapping.map(r.pos),h=gt(d.doc,f,o.length,o);if(h||(o[0]=u?{type:u}:null,h=gt(d.doc,f,o.length,o)),!h)return!1;if(d.split(f,o.length,o),!l&&c&&r.node(s).type!=u){let p=d.mapping.map(r.before(s)),m=d.doc.resolve(p);u&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,u)&&d.setNodeMarkup(d.mapping.map(r.before(s)),u)}return n&&n(d.scrollIntoView()),!0}}a(Im,"splitBlockAs");const Rm=Im(),Fm=a((t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(I.create(t.doc,i))),!0)},"selectParentNode$1");function Lm(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Gt(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}a(Lm,"joinMaybeClear");function Xf(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,u,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&Lm(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(u=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&u.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,m=M.empty;for(let y=s.length-1;y>=0;y--)m=M.from(s[y].create(null,m));m=M.from(i.copy(m));let g=t.tr.step(new he(e.pos-1,p,e.pos,p,new T(m,1,0),s.length,!0)),b=g.doc.resolve(p+2*s.length);b.nodeAfter&&b.nodeAfter.type==i.type&&Gt(g.doc,b.pos)&&g.join(b.pos),n(g.scrollIntoView())}return!0}let d=o.type.spec.isolating||r>0&&l?null:R.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),h=f&&kr(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(c&&lr(o,"start",!0)&&lr(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=o,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let y=M.empty;for(let k=m.length-1;k>=0;k--)y=M.from(m[k].copy(y));let x=t.tr.step(new he(e.pos-m.length,e.pos+o.nodeSize,e.pos+b,e.pos+o.nodeSize-b,new T(y,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}a(Xf,"deleteBarrier");function Yf(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(F.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}a(Yf,"selectTextblockSide");const Pm=Yf(-1),Bm=Yf(1);function zm(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),u=s&&bl(s,t,e);return u?(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0):!1}}a(zm,"wrapIn$1");function kc(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:u}}=n.selection.ranges[o];n.doc.nodesBetween(s,u,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(c),f=d.index();i=d.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:u},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(u,l,t,e)}r(o.scrollIntoView())}return!0}}a(kc,"setBlockType");function Cl(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}a(Cl,"chainCommands");Cl(yl,Vf,qf);Cl(yl,Wf,Kf);Cl(Jf,Gf,Zf,Rm);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function $m(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let u=r?n.tr:null;return Hm(u,s,t,e)?(r&&r(u.scrollIntoView()),!0):!1}}a($m,"wrapInList$1");function Hm(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);o=new or(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new or(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let u=bl(o,n,r,e);return u?(t&&Vm(t,e,u,i,n),!0):!1}a(Hm,"wrapRangeInList");function Vm(t,e,n,r,i){let o=M.empty;for(let d=n.length-1;d>=0;d--)o=M.from(n[d].type.create(n[d].attrs,o));t.step(new he(e.start-(r?2:0),e.end,e.start,e.end,new T(o,0,0),n.length,!0));let s=0;for(let d=0;d<n.length;d++)n[d].type==i&&(s=d+1);let u=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let d=e.startIndex,f=e.endIndex,h=!0;d<f;d++,h=!1)!h&>(t.doc,l,u)&&(t.split(l,u),l+=2*u),l+=c.child(d).nodeSize;return t}a(Vm,"doWrapInList");function jm(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?qm(e,n,t,o):Um(e,n,o):!0:!1}}a(jm,"liftListItem$1");function qm(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new he(o-1,s,o,s,new T(M.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new or(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const u=kr(r);if(u==null)return!1;i.lift(r,u);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return Gt(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}a(qm,"liftToOuterList");function Um(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+(u?0:1),d+1,s.content.append(l?M.empty:M.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new he(f-(u?1:0),h+(l?1:0),f+1,h-1,new T((u?M.empty:M.from(i.copy(M.empty))).append(l?M.empty:M.from(i.copy(M.empty))),u?0:1,l?0:1),u?0:1)),e(r.scrollIntoView()),!0}a(Um,"liftOutOfList");function Wm(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let u=o.parent,l=u.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==u.type,d=M.from(c?t.create():null),f=new T(M.from(t.create(null,M.from(u.type.create(null,d)))),c?3:1,0),h=o.start,p=o.end;n(e.tr.step(new he(h-(c?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}a(Wm,"sinkListItem$1");const ue=a(function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},"domIndex"),ar=a(function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},"parentNode");let Eu=null;const dt=a(function(t,e,n){let r=Eu||(Eu=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},"textRange"),Km=a(function(){Eu=null},"clearReusedRange"),vn=a(function(t,e,n,r){return n&&(wc(t,e,n,r,-1)||wc(t,e,n,r,1))},"isEquivalentPosition"),Jm=/^(img|br|input|textarea|hr)$/i;function wc(t,e,n,r,i){for(var o;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Ne(t))){let s=t.parentNode;if(!s||s.nodeType!=1||di(t)||Jm.test(t.nodeName)||t.contentEditable=="false")return!1;e=ue(t)+(i<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=i;else return!1;else t=s,e=i<0?Ne(t):0}else return!1}}a(wc,"scanFor");function Ne(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}a(Ne,"nodeSize");function Gm(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ne(t)}else if(t.parentNode&&!di(t))e=ue(t),t=t.parentNode;else return null}}a(Gm,"textNodeBefore$1");function Zm(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!di(t))e=ue(t)+1,t=t.parentNode;else return null}}a(Zm,"textNodeAfter$1");function Xm(t,e,n){for(let r=e==0,i=e==Ne(t);r||i;){if(t==n)return!0;let o=ue(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Ne(t)}}a(Xm,"isOnEdge");function di(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}a(di,"hasBlockDesc");const cs=a(function(t){return t.focusNode&&vn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)},"selectionCollapsed");function Yt(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}a(Yt,"keyEvent");function Ym(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}a(Ym,"deepActiveElement");function Qm(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ne(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ne(r.startContainer),r.startOffset)}}}a(Qm,"caretFromPoint");const et=typeof navigator<"u"?navigator:null,Cc=typeof document<"u"?document:null,Zt=et&&et.userAgent||"",Su=/Edge\/(\d+)/.exec(Zt),Qf=/MSIE \d/.exec(Zt),vu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zt),we=!!(Qf||vu||Su),Bt=Qf?document.documentMode:vu?+vu[1]:Su?+Su[1]:0,Ie=!we&&/gecko\/(\d+)/i.test(Zt);Ie&&+(/Firefox\/(\d+)/.exec(Zt)||[0,0])[1];const Au=!we&&/Chrome\/(\d+)/.exec(Zt),fe=!!Au,eh=Au?+Au[1]:0,ge=!we&&!!et&&/Apple Computer/.test(et.vendor),cr=ge&&(/Mobile\/\w+/.test(Zt)||!!et&&et.maxTouchPoints>2),_e=cr||(et?/Mac/.test(et.platform):!1),e1=et?/Win/.test(et.platform):!1,pt=/Android \d/.test(Zt),fi=!!Cc&&"webkitFontSmoothing"in Cc.documentElement.style,t1=fi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function n1(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}a(n1,"windowRect");function ut(t,e){return typeof t=="number"?t:t[e]}a(ut,"getSide$1");function r1(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}a(r1,"clientRect");function Ec(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=ar(s);continue}let u=s,l=u==o.body,c=l?n1(o):r1(u),d=0,f=0;if(e.top<c.top+ut(r,"top")?f=-(c.top-e.top+ut(i,"top")):e.bottom>c.bottom-ut(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+ut(i,"top")-c.top:e.bottom-c.bottom+ut(i,"bottom")),e.left<c.left+ut(r,"left")?d=-(c.left-e.left+ut(i,"left")):e.right>c.right-ut(r,"right")&&(d=e.right-c.right+ut(i,"right")),d||f)if(l)o.defaultView.scrollBy(d,f);else{let p=u.scrollLeft,m=u.scrollTop;f&&(u.scrollTop+=f),d&&(u.scrollLeft+=d);let g=u.scrollLeft-p,b=u.scrollTop-m;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let h=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s=h=="absolute"?s.offsetParent:ar(s)}}a(Ec,"scrollRectIntoView");function i1(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let u=t.root.elementFromPoint(o,s);if(!u||u==t.dom||!t.dom.contains(u))continue;let l=u.getBoundingClientRect();if(l.top>=n-20){r=u,i=l.top;break}}return{refDOM:r,refTop:i,stack:th(t.dom)}}a(i1,"storeScrollPos");function th(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ar(r));return e}a(th,"scrollStack");function o1({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;nh(n,r==0?0:r-e)}a(o1,"resetScrollPos");function nh(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}a(nh,"restoreScrollStack");let Dn=null;function s1(t){if(t.setActive)return t.setActive();if(Dn)return t.focus(Dn);let e=th(t);t.focus(Dn==null?{get preventScroll(){return Dn={preventScroll:!0},!0}}:void 0),Dn||(Dn=!1,nh(e,0))}a(s1,"focusPreventScroll");function rh(t,e){let n,r=2e8,i,o=0,s=e.top,u=e.top,l,c;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let h;if(d.nodeType==1)h=d.getClientRects();else if(d.nodeType==3)h=dt(d).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=u){s=Math.max(m.bottom,s),u=Math.min(m.top,u);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=d,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,d.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=d,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?u1(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:rh(n,i)}a(rh,"findOffsetInNode");function u1(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=St(r,1);if(o.top!=o.bottom&&El(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}a(u1,"findOffsetInText");function El(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}a(El,"inRect");function l1(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}a(l1,"targetKludge");function a1(t,e,n){let{node:r,offset:i}=rh(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}a(a1,"posFromElement");function c1(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let u=t.docView.nearestDesc(o,!0),l;if(!u)return null;if(u.dom.nodeType==1&&(u.node.isBlock&&u.parent||!u.contentDOM)&&((l=u.dom.getBoundingClientRect()).width||l.height)&&(u.node.isBlock&&u.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(u.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?i=u.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=u.posAfter),s=!0),!u.contentDOM&&i<0&&!u.node.isText))return(u.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?u.posBefore:u.posAfter;o=u.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}a(c1,"posFromCaret");function ih(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let u=s.getClientRects();for(let l=0;l<u.length;l++){let c=u[l];if(El(e,c))return ih(s,e,c)}}if((o=(o+1)%r)==i)break}return t}a(ih,"elementFromPoint");function d1(t,e){let n=t.dom.ownerDocument,r,i=0,o=Qm(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),u;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!El(e,c)||(s=ih(t.dom,e,c),!s))return null}if(ge)for(let c=s;r&&c;c=ar(c))c.draggable&&(r=void 0);if(s=l1(s,e),r){if(Ie&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let c;fi&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?u=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(u=c1(t,r,i,e))}u==null&&(u=a1(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:u,inside:l?l.posAtStart-l.border:-1}}a(d1,"posAtCoords");function Sc(t){return t.top<t.bottom||t.left<t.right}a(Sc,"nonZero");function St(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Sc(r))return r}return Array.prototype.find.call(n,Sc)||t.getBoundingClientRect()}a(St,"singleRect");const f1=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function oh(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=fi||Ie;if(r.nodeType==3)if(s&&(f1.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=St(dt(r,i,i),n);if(Ie&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=St(dt(r,i-1,i-1),-1);if(c.top==l.top){let d=St(dt(r,i,i+1),-1);if(d.top!=l.top)return Sr(d,d.left<c.left)}}return l}else{let l=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:c++,Sr(St(dt(r,l,c),d),d<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Ne(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Fs(l.getBoundingClientRect(),!1)}if(o==null&&i<Ne(r)){let l=r.childNodes[i];if(l.nodeType==1)return Fs(l.getBoundingClientRect(),!0)}return Fs(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Ne(r))){let l=r.childNodes[i-1],c=l.nodeType==3?dt(l,Ne(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Sr(St(c,1),!1)}if(o==null&&i<Ne(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?dt(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Sr(St(c,-1),!0)}return Sr(St(r.nodeType==3?dt(r):r,-n),n>=0)}a(oh,"coordsAtPos");function Sr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}a(Sr,"flattenV");function Fs(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}a(Fs,"flattenH");function sh(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}a(sh,"withFlushedState");function h1(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return sh(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let u=t.docView.nearestDesc(o,!0);if(!u)break;if(u.node.isBlock){o=u.contentDOM||u.dom;break}o=u.dom.parentNode}let s=oh(t,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let l;if(u.nodeType==1)l=u.getClientRects();else if(u.nodeType==3)l=dt(u,0,u.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(n=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}a(h1,"endOfTextblockVertical");const p1=/[\u0590-\u08ac]/;function m1(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,u=t.domSelection();return u?!p1.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:s:sh(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),h=u.caretBidiLevel;u.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),b=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{u.collapse(d,f),l&&(l!=d||c!=f)&&u.extend&&u.extend(l,c)}catch{}return h!=null&&(u.caretBidiLevel=h),b}):r.pos==r.start()||r.pos==r.end()}a(m1,"endOfTextblockHorizontal");let vc=null,Ac=null,Mc=!1;function g1(t,e,n){return vc==e&&Ac==n?Mc:(vc=e,Ac=n,Mc=n=="up"||n=="down"?h1(t,e,n):m1(t,e,n))}a(g1,"endOfTextblock");const Re=0,Tc=1,an=2,tt=3,Pa=class Pa{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Re,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>ue(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let u=i.children[s];if(u.size){i=u;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],u=o+s.size;if(u>e||s instanceof eo){i=e-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Yi&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?ue(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?ue(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,u=0;;u++){let l=this.children[u],c=s+l.size;if(i==-1&&e<=c){let d=s+l.border;if(e>=d&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=s;for(let f=u;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=ue(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let d=u+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=ue(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,m=0;p<this.children.length;p++){let g=this.children[p],b=m+g.size;if(o>m&&s<b)return g.setSelection(e-m-g.border,n-m-g.border,r,i);m=b}let u=this.domFromPos(e,e?-1:1),l=n==e?u:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),f=!1;if((Ie||ge)&&e==n){let{node:p,offset:m}=u;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
7
|
-
`),f&&m==p.nodeValue.length)for(let g=p,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(u=l={node:b.parentNode,offset:ue(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=p.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Ie&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&ge)&&vn(u.node,u.offset,d.anchorNode,d.anchorOffset)&&vn(l.node,l.offset,d.focusNode,d.focusOffset))return;let h=!1;if((c.extend||e==n)&&!(f&&Ie)){c.collapse(u.node,u.offset);try{e!=n&&c.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let m=u;u=l,l=m}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(u.node,u.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let u=r+o.border,l=s-o.border;if(e>=u&&n<=l){this.dirty=e==r||n==s?an:Tc,e==u&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=tt:o.markDirty(e-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?an:tt}r=s}this.dirty=an}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?an:Tc;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}};a(Pa,"ViewDesc");let An=Pa;const Ba=class Ba extends An{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let u=document.createElement("span");u.appendChild(s),s=u}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Re&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}};a(Ba,"WidgetViewDesc");let Yi=Ba;const za=class za extends An{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}};a(za,"CompositionViewDesc");let Mu=za;const Kr=class Kr extends An{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Sn.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Kr(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&tt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=tt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Re){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Re}}slice(e,n,r){let i=Kr.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=_u(o,n,s,r)),e>0&&(o=_u(o,0,e,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}};a(Kr,"MarkViewDesc");let dr=Kr;const ts=class ts extends An{constructor(e,n,r,i,o,s,u,l,c){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u}static create(e,n,r,i,o,s){let u=o.nodeViews[n.type.name],l,c=u&&u(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=Sn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let h=d;return d=ah(d,r,n),c?l=new Tu(e,n,r,i,d,f||null,h,c,o,s+1):n.isText?new Qi(e,n,r,i,d,h,o):new ts(e,n,r,i,d,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>M.empty)}return e}matchesNode(e,n,r){return this.dirty==Re&&e.eq(this.node)&&to(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,u=o&&o.pos<0,l=new Ou(this,s&&s.node,e);k1(this.node,this.innerDeco,(c,d,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&l.syncToMarks(d==this.node.childCount?z.none:this.node.child(d).marks,r,e),l.placeWidget(c,e,i)},(c,d,f,h)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,d,f,h)||u&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,d,f,p,e)||l.updateNextNode(c,d,f,e,h,i)||l.addNode(c,d,f,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==an)&&(s&&this.protectLocalComposition(e,s),uh(this.contentDOM,this.children,e),cr&&w1(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof F)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,u=C1(this.node.content,s,r-n,i-n);return u<0?null:{node:o,pos:u,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Mu(this,o,n,i);e.input.compositionNodes.push(s),this.children=_u(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==tt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Re}updateOuterDeco(e){if(to(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=lh(this.dom,this.nodeDOM,Du(this.outerDeco,this.node,n),Du(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};a(ts,"NodeViewDesc");let zt=ts;function Dc(t,e,n,r,i){ah(r,e,t);let o=new zt(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}a(Dc,"docViewDesc");const ns=class ns extends zt{constructor(e,n,r,i,o,s,u){super(e,n,r,i,o,null,s,u,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==tt||this.dirty!=Re&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Re||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Re,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new ns(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=tt)}get domAtom(){return!1}isText(e){return this.node.text==e}};a(ns,"TextViewDesc");let Qi=ns;const $a=class $a extends An{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Re&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}};a($a,"TrailingHackViewDesc");let eo=$a;const Ha=class Ha extends zt{constructor(e,n,r,i,o,s,u,l,c,d){super(e,n,r,i,o,s,u,c,d),this.spec=l}update(e,n,r,i){if(this.dirty==tt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}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)}};a(Ha,"CustomNodeViewDesc");let Tu=Ha;function uh(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],u=s.dom;if(u.parentNode==t){for(;u!=r;)r=Oc(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(u,r);if(s instanceof dr){let l=r?r.previousSibling:t.lastChild;uh(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Oc(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}a(uh,"renderDescs");const Ir=a(function(t){t&&(this.nodeName=t)},"OuterDecoLevel");Ir.prototype=Object.create(null);const cn=[new Ir];function Du(t,e,n){if(t.length==0)return cn;let r=n?cn[0]:new Ir,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new Ir(s.nodeName));for(let u in s){let l=s[u];l!=null&&(n&&i.length==1&&i.push(r=new Ir(e.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+l:u=="style"?r.style=(r.style?r.style+";":"")+l:u!="nodeName"&&(r[u]=l))}}}return i}a(Du,"computeOuterDeco");function lh(t,e,n,r){if(n==cn&&r==cn)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],u=n[o];if(o){let l;u&&u.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),u=cn[0]),i=l}b1(i,u||cn[0],s)}return i}a(lh,"patchOuterDeco");function b1(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}a(b1,"patchAttributes");function ah(t,e,n){return lh(t,t,cn,Du(e,n,t.nodeType!=1))}a(ah,"applyOuterDeco");function to(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}a(to,"sameOuterDeco");function Oc(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}a(Oc,"rm");const Va=class Va{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=y1(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Re,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){u=l;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let l=dr.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let u=this.index,l=Math.min(this.top.children.length,u+5);u<l;u++){let c=this.top.children[u];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==tt&&s.dom==s.contentDOM&&(s.dirty=an),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let u=this.index;u<this.top.children.length;u++){let l=this.top.children[u];if(l instanceof zt){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let d=l.dom,f,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=tt&&to(n,l.outerDeco));if(!h&&l.update(e,n,r,i))return this.destroyBetween(this.index,u),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(l,e,n,r,i,s)))return this.destroyBetween(this.index,u),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=an,f.updateChildren(i,s+1),f.dirty=Re),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!to(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let u=zt.create(this.top,n,r,i,o,s);if(u.contentDOM){u.children=e.children,e.children=[];for(let l of u.children)l.parent=u}return e.destroy(),u}addNode(e,n,r,i,o){let s=zt.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Yi(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof dr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Qi)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ge||fe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new eo(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};a(Va,"ViewTreeUpdater");let Ou=Va;function y1(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let u;for(;;)if(r){let c=n.children[r-1];if(c instanceof dr)n=c,r=c.children.length;else{u=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=u.node;if(l){if(l!=t.child(i-1))break;--i,o.set(u,i),s.push(u)}}return{index:i,matched:o,matches:s.reverse()}}a(y1,"preMatch");function x1(t,e){return t.type.side-e.type.side}a(x1,"compareSide");function k1(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,i,e.forChild(o,d),c),o+=d.nodeSize}return}let s=0,u=[],l=null;for(let c=0;;){let d,f;for(;s<i.length&&i[s].to==o;){let b=i[s++];b.widget&&(d?(f||(f=[d])).push(b):d=b)}if(d)if(f){f.sort(x1);for(let b=0;b<f.length;b++)n(f[b],c,!!l)}else n(d,c,!!l);let h,p;if(l)p=-1,h=l,l=null;else if(c<t.childCount)p=c,h=t.child(c++);else break;for(let b=0;b<u.length;b++)u[b].to<=o&&u.splice(b--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)u.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let b=m;s<i.length&&i[s].from<b&&(b=i[s].from);for(let y=0;y<u.length;y++)u[y].to<b&&(b=u[y].to);b<m&&(l=h.cut(b-o),h=h.cut(0,b-o),m=b,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let g=h.isInline&&!h.isLeaf?u.filter(b=>!b.inline):u.slice();r(h,g,e.forChild(o,h),p),o=m}}a(k1,"iterDeco");function w1(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}a(w1,"iosHacks");function C1(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),u=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){if(o>=r&&l.slice(r-e.length-u,r-u)==e)return r-e.length;let c=u<r?l.lastIndexOf(e,r-u-1):-1;if(c>=0&&c+e.length+u>=n)return u+c;if(n==r&&l.length>=r+e.length-u&&l.slice(r-u,r-u+e.length)==e)return r}}return-1}a(C1,"findTextInFragment");function _u(t,e,n,r,i){let o=[];for(let s=0,u=0;s<t.length;s++){let l=t[s],c=u,d=u+=l.size;c>=n||d<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,r)),i&&(o.push(i),i=void 0),d>n&&o.push(l.slice(n-c,l.size,r)))}return o}a(_u,"replaceNodes");function Sl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let u=r.resolve(s),l,c;if(cs(n)){for(l=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&I.isSelectable(f)&&i.parent&&!(f.isInline&&Xm(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;c=new I(s==h?u:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,h=s;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[l,s]=h==t.state.selection.anchor?[h,f]:[f,h],u=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<u.pos&&!o?1:-1;c=vl(t,d,u,f)}return c}a(Sl,"selectionFromDOM");function ch(t){return t.editable?t.hasFocus():fh(t)&&document.activeElement&&document.activeElement.contains(t.dom)}a(ch,"editorOwnsSelection");function bt(t,e=!1){let n=t.state.selection;if(dh(t,n),!!ch(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&fe){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&vn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)S1(t);else{let{anchor:r,head:i}=n,o,s;_c&&!(n instanceof F)&&(n.$from.parent.inlineContent||(o=Nc(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Nc(t,n.to))),t.docView.setSelection(r,i,t,e),_c&&(o&&Ic(o),s&&Ic(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&E1(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}a(bt,"selectionToDOM");const _c=ge||fe&&eh<63;function Nc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(ge&&i&&i.contentEditable=="false")return Ls(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Ls(i);if(o)return Ls(o)}}a(Nc,"temporarilyEditableNear");function Ls(t){return t.contentEditable="true",ge&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}a(Ls,"setEditable");function Ic(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}a(Ic,"resetEditable");function E1(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!ch(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}a(E1,"removeClassOnSelectionChange");function S1(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,ue(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&we&&Bt<=11&&(n.disabled=!0,n.disabled=!1)}a(S1,"selectCursorWrapper");function dh(t,e){if(e instanceof I){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Rc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Rc(t)}a(dh,"syncNodeSelection");function Rc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}a(Rc,"clearNodeSelection");function vl(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||F.between(e,n,r)}a(vl,"selectionBetween");function Fc(t){return t.editable&&!t.hasFocus()?!1:fh(t)}a(Fc,"hasFocusAndSelection");function fh(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}a(fh,"hasSelection");function v1(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return vn(e.node,e.offset,n.anchorNode,n.anchorOffset)}a(v1,"anchorInRightPlace");function Nu(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&R.findFrom(o,e)}a(Nu,"moveSelectionBlock");function vt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}a(vt,"apply");function Lc(t,e,n){let r=t.state.selection;if(r instanceof F)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return vt(t,new F(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Nu(t.state,e);return i&&i instanceof I?vt(t,i):!1}else if(!(_e&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(u))&&!s.contentDOM?I.isSelectable(o)?vt(t,new I(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):fi?vt(t,new F(t.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof I&&r.node.isInline)return vt(t,new F(e>0?r.$to:r.$from));{let i=Nu(t.state,e);return i?vt(t,i):!1}}}a(Lc,"selectHorizontally");function no(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}a(no,"nodeLen");function Rr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}a(Rr,"isIgnorable");function On(t,e){return e<0?A1(t):M1(t)}a(On,"skipIgnoredNodes");function A1(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Ie&&n.nodeType==1&&r<no(n)&&Rr(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Rr(u,-1))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(hh(n))break;{let u=n.previousSibling;for(;u&&Rr(u,-1);)i=n.parentNode,o=ue(u),u=u.previousSibling;if(u)n=u,r=no(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Iu(t,n,r):i&&Iu(t,i,o)}a(A1,"skipIgnoredNodesBefore");function M1(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=no(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Rr(u,1))o=n,s=++r;else break}else{if(hh(n))break;{let u=n.nextSibling;for(;u&&Rr(u,1);)o=u.parentNode,s=ue(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=no(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Iu(t,o,s)}a(M1,"skipIgnoredNodesAfter");function hh(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}a(hh,"isBlockNode");function T1(t,e){for(;t&&e==t.childNodes.length&&!di(t);)e=ue(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}a(T1,"textNodeAfter");function D1(t,e){for(;t&&!e&&!di(t);)e=ue(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}a(D1,"textNodeBefore");function Iu(t,e,n){if(e.nodeType!=3){let o,s;(s=T1(e,n))?(e=s,n=0):(o=D1(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(cs(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&bt(t)},50)}a(Iu,"setSelFocus");function Pc(t,e){let n=t.state.doc.resolve(e);if(!(fe||e1)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}a(Pc,"findDirection");function Bc(t,e,n){let r=t.state.selection;if(r instanceof F&&!r.empty||n.indexOf("s")>-1||_e&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Nu(t.state,e);if(s&&s instanceof I)return vt(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,u=r instanceof Be?R.near(s,e):R.findFrom(s,e);return u?vt(t,u):!1}return!1}a(Bc,"selectVertically");function zc(t,e){if(!(t.state.selection instanceof F))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}a(zc,"stopNativeHorizontalDelete");function $c(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}a($c,"switchEditable");function O1(t){if(!ge||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;$c(t,r,"true"),setTimeout(()=>$c(t,r,"false"),20)}return!1}a(O1,"safariDownArrowBug");function _1(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}a(_1,"getMods");function N1(t,e){let n=e.keyCode,r=_1(e);if(n==8||_e&&n==72&&r=="c")return zc(t,-1)||On(t,-1);if(n==46&&!e.shiftKey||_e&&n==68&&r=="c")return zc(t,1)||On(t,1);if(n==13||n==27)return!0;if(n==37||_e&&n==66&&r=="c"){let i=n==37?Pc(t,t.state.selection.from)=="ltr"?-1:1:-1;return Lc(t,i,r)||On(t,i)}else if(n==39||_e&&n==70&&r=="c"){let i=n==39?Pc(t,t.state.selection.from)=="ltr"?1:-1:1;return Lc(t,i,r)||On(t,i)}else{if(n==38||_e&&n==80&&r=="c")return Bc(t,-1,r)||On(t,-1);if(n==40||_e&&n==78&&r=="c")return O1(t)||Bc(t,1,r)||On(t,1);if(r==(_e?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}a(N1,"captureKeyDown");function Al(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Sn.fromSchema(t.state.schema),u=xh(),l=u.createElement("div");l.appendChild(s.serializeFragment(r,{document:u}));let c=l.firstChild,d,f=0;for(;c&&c.nodeType==1&&(d=yh[c.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let m=u.createElement(d[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
8
|
-
|
|
9
|
-
`);return{dom:l,text:h,slice:e}}a(Al,"serializeForClipboard");function ph(t,e,n,r,i){let o=i.parent.type.spec.code,s,u;if(!n&&!e)return null;let l=!!e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return u=new T(M.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
10
|
-
`))),0,0),t.someProp("transformPasted",h=>{u=h(u,t,!0)}),u;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)u=f;else{let h=i.marks(),{schema:p}=t.state,m=Sn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=s.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=L1(n),fi&&P1(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(u||(u=(t.someProp("clipboardParser")||t.someProp("domParser")||Pt.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!I1.test(h.parentNode.nodeName)?{ignore:!0}:null}})),d)u=B1(Hc(u,+d[1],+d[2]),d[4]);else if(u=T.maxOpen(R1(u.content,i),!0),u.openStart||u.openEnd){let f=0,h=0;for(let p=u.content.firstChild;f<u.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=u.content.lastChild;h<u.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);u=Hc(u,f,h)}return t.someProp("transformPasted",f=>{u=f(u,t,l)}),u}a(ph,"parseFromClipboard");const I1=/^(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 R1(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(u=>{if(!s)return;let l=i.findWrapping(u.type),c;if(!l)return s=null;if(c=s.length&&o.length&&gh(l,o,u,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=bh(s[s.length-1],o.length));let d=mh(u,l);s.push(d),i=i.matchType(d.type),o=l}}),s)return M.from(s)}return t}a(R1,"normalizeSiblings");function mh(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,M.from(t));return t}a(mh,"withWrappers");function gh(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=gh(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(M.from(mh(n,t,i+1))))}}a(gh,"addToSibling");function bh(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,bh(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(M.empty,!0);return t.copy(n.append(r))}a(bh,"closeRight");function Ru(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,u=s.content;return t.childCount>1&&(o=0),i<r-1&&(u=Ru(u,e,n,r,i+1,o)),i>=n&&(u=e<0?s.contentMatchAt(0).fillBefore(u,o<=i).append(u):u.append(s.contentMatchAt(s.childCount).fillBefore(M.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(u))}a(Ru,"closeRange");function Hc(t,e,n){return e<t.openStart&&(t=new T(Ru(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new T(Ru(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}a(Hc,"closeSlice");const yh={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 Vc=null;function xh(){return Vc||(Vc=document.implementation.createHTMLDocument("title"))}a(xh,"detachedDoc");let Ps=null;function F1(t){let e=window.trustedTypes;return e?(Ps||(Ps=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:a(n=>n,"createHTML")})),Ps.createHTML(t)):t}a(F1,"maybeWrapTrusted");function L1(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=xh().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&yh[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=F1(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}a(L1,"readHTML");function P1(t){let e=t.querySelectorAll(fe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}a(P1,"restoreReplacedSpaces");function B1(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let u=r.length-2;u>=0;u-=2){let l=n.nodes[r[u]];if(!l||l.hasRequiredAttrs())break;i=M.from(l.create(r[u+1],i)),o++,s++}return new T(i,o,s)}a(B1,"addContext");const be={},ye={},z1={touchstart:!0,touchmove:!0},ja=class ja{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};a(ja,"InputState");let Fu=ja;function $1(t){for(let e in be){let n=be[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{V1(t,r)&&!Ml(t,r)&&(t.editable||!(r.type in ye))&&n(t,r)},z1[e]?{passive:!0}:void 0)}ge&&t.dom.addEventListener("input",()=>null),Lu(t)}a($1,"initInput");function Rt(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}a(Rt,"setSelectionOrigin");function H1(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}a(H1,"destroyInput");function Lu(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ml(t,r))})}a(Lu,"ensureListeners");function Ml(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}a(Ml,"runCustomHandler");function V1(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}a(V1,"eventBelongsToView");function j1(t,e){!Ml(t,e)&&be[e.type]&&(t.editable||!(e.type in ye))&&be[e.type](t,e)}a(j1,"dispatchEvent");ye.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!wh(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(pt&&fe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),cr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Yt(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||N1(t,n)?n.preventDefault():Rt(t,"key")};ye.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ye.keypress=(t,e)=>{let n=e;if(wh(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||_e&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof F)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=a(()=>t.state.tr.insertText(i).scrollIntoView(),"deflt");!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i,o))&&t.dispatch(o()),n.preventDefault()}};function ds(t){return{left:t.clientX,top:t.clientY}}a(ds,"eventCoords");function q1(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}a(q1,"isNear");function Tl(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,u=>s>o.depth?u(t,n,o.nodeAfter,o.before(s),i,!0):u(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}a(Tl,"runHandlerOnContext");function zn(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}a(zn,"updateSelection");function U1(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&I.isSelectable(r)?(zn(t,new I(n)),!0):!1}a(U1,"selectClickedLeaf");function W1(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof I&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let u=s>o.depth?o.nodeAfter:o.node(s);if(I.isSelectable(u)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(zn(t,I.create(t.state.doc,i)),!0):!1}a(W1,"selectClickedNode");function K1(t,e,n,r,i){return Tl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?W1(t,n):U1(t,n))}a(K1,"handleSingleClick");function J1(t,e,n,r){return Tl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}a(J1,"handleDoubleClick");function G1(t,e,n,r){return Tl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Z1(t,n,r)}a(G1,"handleTripleClick");function Z1(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(zn(t,F.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(s.inlineContent)zn(t,F.create(r,u+1,u+1+s.content.size));else if(I.isSelectable(s))zn(t,I.create(r,u));else continue;return!0}}a(Z1,"defaultTripleClick");function Dl(t){return ro(t)}a(Dl,"forceDOMFlush");const kh=_e?"metaKey":"ctrlKey";be.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Dl(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&q1(n,t.input.lastClick)&&!n[kh]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button};let s=t.posAtCoords(ds(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Pu(t,s,n,!!r)):(o=="doubleClick"?J1:G1)(t,s.pos,s.inside,n)?n.preventDefault():Rt(t,"pointer"))};const qa=class qa{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[kh],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let d=e.state.doc.resolve(n.pos);o=d.parent,s=d.depth?d.before():0}const u=i?null:r.target,l=u?e.docView.nearestDesc(u,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof I&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ie&&!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)),Rt(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(()=>bt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(ds(e))),this.updateAllowDefault(e),this.allowDefault||!n?Rt(this.view,"pointer"):K1(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ge&&this.mightDrag&&!this.mightDrag.node.isAtom||fe&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(zn(this.view,R.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Rt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Rt(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)}};a(qa,"MouseDown");let Pu=qa;be.touchstart=t=>{t.input.lastTouch=Date.now(),Dl(t),Rt(t,"pointer")};be.touchmove=t=>{t.input.lastTouch=Date.now(),Rt(t,"pointer")};be.contextmenu=t=>Dl(t);function wh(t,e){return t.composing?!0:ge&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}a(wh,"inOrNearComposition");const X1=pt?5e3:-1;ye.compositionstart=ye.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof F&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),ro(t,!0),t.markCursor=null;else if(ro(t,!e.selection.empty),Ie&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let u=t.domSelection();u&&u.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Ch(t,X1)};ye.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Ch(t,20))};function Ch(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ro(t),e))}a(Ch,"scheduleComposeEnd");function Eh(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Q1());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}a(Eh,"clearComposition");function Y1(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Gm(e.focusNode,e.focusOffset),r=Zm(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}a(Y1,"findCompositionNode");function Q1(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}a(Q1,"timestampFromCustomEvent");function ro(t,e=!1){if(!(pt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Eh(t),e||t.docView&&t.docView.dirty){let n=Sl(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}a(ro,"endComposition");function eg(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}a(eg,"captureCopy");const ei=we&&Bt<15||cr&&t1<604;be.copy=ye.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ei?null:n.clipboardData,s=r.content(),{dom:u,text:l}=Al(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",l)):eg(t,u),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function tg(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}a(tg,"sliceSingleNode");function ng(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ti(t,r.value,null,i,e):ti(t,r.textContent,r.innerHTML,i,e)},50)}a(ng,"capturePaste");function ti(t,e,n,r,i){let o=ph(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||T.empty)))return!0;if(!o)return!1;let s=tg(o),u=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}a(ti,"doPaste");function Sh(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}a(Sh,"getText$1");ye.paste=(t,e)=>{let n=e;if(t.composing&&!pt)return;let r=ei?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ti(t,Sh(r),r.getData("text/html"),i,n)?n.preventDefault():ng(t,n)};const Ua=class Ua{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}};a(Ua,"Dragging");let io=Ua;const rg=_e?"altKey":"ctrlKey";function vh(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[rg]}a(vh,"dragMoves");be.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(ds(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof I?i.to-1:i.to))){if(r&&r.mightDrag)s=I.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=I.create(t.state.doc,f.posBefore))}}let u=(s||t.state.selection).content(),{dom:l,text:c,slice:d}=Al(t,u);(!n.dataTransfer.files.length||!fe||eh>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ei?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ei||n.dataTransfer.setData("text/plain",c),t.dragging=new io(d,vh(t,n),s)};be.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ye.dragover=ye.dragenter=(t,e)=>e.preventDefault();ye.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(ds(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t,!1)}):s=ph(t,Sh(n.dataTransfer),ei?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&vh(t,n));if(t.someProp("handleDrop",m=>m(t,n,s||T.empty,u))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Rf(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(u){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let d=c.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=c.doc;if(f?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(h))return;let p=c.doc.resolve(d);if(f&&I.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new I(p));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,y,x)=>m=x),c.setSelection(vl(t,p,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};be.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&bt(t)},20))};be.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};be.beforeinput=(t,e)=>{if(fe&&pt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Yt(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in ye)be[t]=ye[t];function ni(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}a(ni,"compareObjs");const rs=class rs{constructor(e,n){this.toDOM=e,this.spec=n||mn,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Fe(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof rs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ni(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}};a(rs,"WidgetType");let oo=rs;const Jr=class Jr{constructor(e,n){this.attrs=e,this.spec=n||mn}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Fe(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Jr&&ni(this.attrs,e.attrs)&&ni(this.spec,e.spec)}static is(e){return e.type instanceof Jr}destroy(){}};a(Jr,"InlineType");let pn=Jr;const is=class is{constructor(e,n){this.attrs=e,this.spec=n||mn}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Fe(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof is&&ni(this.attrs,e.attrs)&&ni(this.spec,e.spec)}destroy(){}};a(is,"NodeType");let Bu=is;const un=class un{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new un(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new un(e,e,new oo(n,r))}static inline(e,n,r,i){return new un(e,n,new pn(r,i))}static node(e,n,r,i){return new un(e,n,new Bu(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof pn}get widget(){return this.type instanceof oo}};a(un,"Decoration");let Fe=un;const In=[],mn={},We=class We{constructor(e,n){this.local=e.length?e:In,this.children=n.length?n:In}static create(e,n){return n.length?uo(n,e,0,mn):de}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let u=this.local[s];u.from<=n&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let u=this.children[s]+1;this.children[s+2].findInner(e-u,n-u,r,i+u,o)}}map(e,n,r){return this==de||e.maps.length==0?this:this.mapInner(e,n,0,0,r||mn)}mapInner(e,n,r,i,o){let s;for(let u=0;u<this.local.length;u++){let l=this.local[u].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?ig(this.children,s||[],e,n,r,i,o):s?new We(s.sort(gn),In):de}add(e,n){return n.length?this==de?We.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((u,l)=>{let c=l+r,d;if(d=Mh(n,u,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(u,d,c+1):i.splice(o,0,l,l+u.nodeSize,uo(d,u,c+1,mn)),o+=3}});let s=Ah(o?Th(n):n,-r);for(let u=0;u<s.length;u++)s[u].type.valid(e,s[u])||s.splice(u--,1);return new We(s.length?this.local.concat(s).sort(gn):this.local,i||this.children)}remove(e){return e.length==0||this==de?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,u=r[o]+n,l=r[o+1]+n;for(let d=0,f;d<e.length;d++)(f=e[d])&&f.from>u&&f.to<l&&(e[d]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,u+1);c!=de?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let u=0;u<i.length;u++)i[u].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new We(i,r):de}forChild(e,n){if(this==de)return this;if(n.isLeaf)return We.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let o=e+1,s=o+n.content.size;for(let u=0;u<this.local.length;u++){let l=this.local[u];if(l.from<s&&l.to>o&&l.type instanceof pn){let c=Math.max(o,l.from)-o,d=Math.min(s,l.to)-o;c<d&&(i||(i=[])).push(l.copy(c,d))}}if(i){let u=new We(i.sort(gn),In);return r?new so([u,r]):u}return r||de}eq(e){if(this==e)return!0;if(!(e instanceof We)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Ol(this.localsInner(e))}localsInner(e){if(this==de)return In;if(e.inlineContent||!this.local.some(pn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof pn||n.push(this.local[r]);return n}forEachSet(e){e(this)}};a(We,"DecorationSet");let ce=We;ce.empty=new ce([],[]);ce.removeOverlap=Ol;const de=ce.empty,Ot=class Ot{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,mn));return Ot.from(r)}forChild(e,n){if(n.isLeaf)return ce.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=de&&(o instanceof Ot?r=r.concat(o.members):r.push(o))}return Ot.from(r)}eq(e){if(!(e instanceof Ot)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Ol(r?n:n.sort(gn)):In}static from(e){switch(e.length){case 0:return de;case 1:return e[0];default:return new Ot(e.every(n=>n instanceof ce)?e:e.reduce((n,r)=>n.concat(r instanceof ce?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}};a(Ot,"DecorationGroup");let so=Ot;function ig(t,e,n,r,i,o,s){let u=t.slice();for(let c=0,d=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((h,p,m,g)=>{let b=g-m-(p-h);for(let y=0;y<u.length;y+=3){let x=u[y+1];if(x<0||h>x+d-f)continue;let k=u[y]+d-f;p>=k?u[y+1]=h<=k?-2:-1:h>=d&&b&&(u[y]+=b,u[y+1]+=b)}f+=b}),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c<u.length;c+=3)if(u[c+1]<0){if(u[c+1]==-2){l=!0,u[c+1]=-1;continue}let d=n.map(t[c]+o),f=d-i;if(f<0||f>=r.content.size){l=!0;continue}let h=n.map(t[c+1]+o,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),b=r.maybeChild(m);if(b&&g==f&&g+b.nodeSize==p){let y=u[c+2].mapInner(n,b,d+1,t[c]+o+1,s);y!=de?(u[c]=f,u[c+1]=p,u[c+2]=y):(u[c+1]=-2,l=!0)}else l=!0}if(l){let c=og(u,t,e,n,i,o,s),d=uo(c,r,0,s);e=d.local;for(let f=0;f<u.length;f+=3)u[f+1]<0&&(u.splice(f,3),f-=3);for(let f=0,h=0;f<d.children.length;f+=3){let p=d.children[f];for(;h<u.length&&u[h]<p;)h+=3;u.splice(h,0,d.children[f],d.children[f+1],d.children[f+2])}}return new ce(e.sort(gn),u)}a(ig,"mapChildren");function Ah(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Fe(i.from+e,i.to+e,i.type))}return n}a(Ah,"moveSpans");function og(t,e,n,r,i,o,s){function u(l,c){for(let d=0;d<l.local.length;d++){let f=l.local[d].map(r,i,c);f?n.push(f):s.onRemove&&s.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)u(l.children[d+2],l.children[d]+c+1)}a(u,"gather");for(let l=0;l<t.length;l+=3)t[l+1]==-1&&u(t[l+2],e[l]+o+1);return n}a(og,"mapAndGatherRemainingDecorations");function Mh(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}a(Mh,"takeSpansForNode");function Th(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}a(Th,"withoutNulls");function uo(t,e,n,r){let i=[],o=!1;e.forEach((u,l)=>{let c=Mh(t,u,l+n);if(c){o=!0;let d=uo(c,u,n+l+1,r);d!=de&&i.push(l,l+u.nodeSize,d)}});let s=Ah(o?Th(t):t,-n).sort(gn);for(let u=0;u<s.length;u++)s[u].type.valid(e,s[u])||(r.onRemove&&r.onRemove(s[u].spec),s.splice(u--,1));return s.length||i.length?new ce(s,i):de}a(uo,"buildTree");function gn(t,e){return t.from-e.from||t.to-e.to}a(gn,"byPos");function Ol(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),jc(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),jc(e,i,r.copy(o.from,r.to)));break}}}return e}a(Ol,"removeOverlap");function jc(t,e,n){for(;e<t.length&&gn(n,t[e])>0;)e++;t.splice(e,0,n)}a(jc,"insertAhead");function Bs(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=de&&e.push(r)}),t.cursorWrapper&&e.push(ce.create(t.state.doc,[t.cursorWrapper.deco])),so.from(e)}a(Bs,"viewDecorations");const sg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ug=we&&Bt<=11,Wa=class Wa{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}};a(Wa,"SelectionState");let zu=Wa;const Ka=class Ka{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new zu,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);we&&Bt<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),ug&&(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,sg)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Fc(this.view)){if(this.suppressingSelectionUpdates)return bt(this.view);if(we&&Bt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=ar(o))n.add(o);for(let o=e.anchorNode;o;o=ar(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Fc(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,u=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let f=this.registerMutation(n[d],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(u=!0))}if(Ie&&l.length){let d=l.filter(f=>f.nodeName=="BR");if(d.length==2){let[f,h]=d;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of d){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||cg(e,f)!=p)&&h.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&cs(r)&&(c=Sl(e))&&c.eq(R.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,bt(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),lg(e)),this.handleDOMChange(o,s,u,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||bt(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let f=e.addedNodes[d];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(we&&Bt<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:f,nextSibling:h}=e.addedNodes[d];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?ue(i)+1:0,u=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?ue(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:u,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}};a(Ka,"DOMObserver");let $u=Ka,qc=new WeakMap,Uc=!1;function lg(t){if(!qc.has(t)&&(qc.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Ie,Uc)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."),Uc=!0}}a(lg,"checkCSS");function Wc(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return vn(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}a(Wc,"rangeToSelectionRange");function ag(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Wc(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return a(r,"read"),t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Wc(t,n):null}a(ag,"safariShadowSelectionRange");function cg(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}a(cg,"blockParent");function dg(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:u}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],cs(l)||c.push({node:l.focusNode,offset:l.focusOffset})),fe&&t.input.lastKeyCode===8)for(let b=o;b>i;b--){let y=r.childNodes[b-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){o=b;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||Pt.fromSchema(t.state.schema),p=f.resolve(s),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:fg,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=b),m={anchor:b+s,head:y+s}}return{doc:g,sel:m,from:s,to:u}}a(dg,"parseBetween");function fg(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ge&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||ge&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}a(fg,"ruleFromNode");const hg=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function pg(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let v=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,D=Sl(t,v);if(D&&!t.state.selection.eq(D)){if(fe&&pt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",N=>N(t,Yt(13,"Enter"))))return;let O=t.state.tr.setSelection(D);v=="pointer"?O.setMeta("pointer",!0):v=="key"&&O.scrollIntoView(),o&&O.setMeta("composition",o),t.dispatch(O)}return}let s=t.state.doc.resolve(e),u=s.sharedDepth(n);e=s.before(u+1),n=t.state.doc.resolve(n).after(u+1);let l=t.state.selection,c=dg(t,e,n),d=t.state.doc,f=d.slice(c.from,c.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=bg(f.content,c.doc.content,c.from,h,p);if(m&&t.input.domChangeCount++,(cr&&t.input.lastIOSEnter>Date.now()-225||pt)&&i.some(v=>v.nodeType==1&&!hg.test(v.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",v=>v(t,Yt(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof F&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let v=Kc(t,t.state.doc,c.sel);if(v&&!v.eq(t.state.selection)){let D=t.state.tr.setSelection(v);o&&D.setMeta("composition",o),t.dispatch(D)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof F&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),we&&Bt<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),y=d.resolve(m.start),x=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA;if((cr&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(v=>v.nodeName=="DIV"||v.nodeName=="P"))||!x&&g.pos<c.doc.content.size&&(!g.sameParent(b)||!g.parent.inlineContent)&&g.pos<b.pos&&!/\S/.test(c.doc.textBetween(g.pos,b.pos,"","")))&&t.someProp("handleKeyDown",v=>v(t,Yt(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&gg(d,m.start,m.endA,g,b)&&t.someProp("handleKeyDown",v=>v(t,Yt(8,"Backspace")))){pt&&fe&&t.domObserver.suppressSelectionUpdates();return}fe&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),pt&&!x&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(v){return v(t,Yt(13,"Enter"))})},20));let k=m.start,C=m.endA,w=a(v=>{let D=v||t.state.tr.replace(k,C,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let O=Kc(t,D.doc,c.sel);O&&!(fe&&t.composing&&O.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==k||O.head==D.mapping.map(C)-1)||we&&O.empty&&O.head==k)&&D.setSelection(O)}return o&&D.setMeta("composition",o),D.scrollIntoView()},"mkTr"),S;if(x)if(g.pos==b.pos){we&&Bt<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>bt(t),20));let v=w(t.state.tr.delete(k,C)),D=d.resolve(m.start).marksAcross(d.resolve(m.endA));D&&v.ensureMarks(D),t.dispatch(v)}else if(m.endA==m.endB&&(S=mg(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let v=w(t.state.tr);S.type=="add"?v.addMark(k,C,S.mark):v.removeMark(k,C,S.mark),t.dispatch(v)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let v=g.parent.textBetween(g.parentOffset,b.parentOffset),D=a(()=>w(t.state.tr.insertText(v,k,C)),"deflt");t.someProp("handleTextInput",O=>O(t,k,C,v,D))||t.dispatch(D())}else t.dispatch(w());else t.dispatch(w())}a(pg,"readDOMChange");function Kc(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:vl(t,e.resolve(n.anchor),e.resolve(n.head))}a(Kc,"resolveSelection");function mg(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,u,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)o=n[d].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],s="add",l=a(d=>d.mark(u.addToSet(d.marks)),"update");else if(i.length==0&&o.length==1)u=o[0],s="remove",l=a(d=>d.mark(u.removeFromSet(d.marks)),"update");else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(M.from(c).eq(t))return{mark:u,type:s}}a(mg,"isMarkChange");function gg(t,e,n,r,i){if(n-e<=i.pos-r.pos||zs(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let u=o.nodeAfter;return u!=null&&n==e+u.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(zs(o,!0,!0));return!s.parent.isTextblock||s.pos>n||zs(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}a(gg,"looksLikeBackspace");function zs(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}a(zs,"skipClosingAndOpening");function bg(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:u}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,u));r-=s+l-o}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<e.size&&Jc(e.textBetween(o-1,o+1))&&(o+=l?1:-1),u=o+(u-s),s=o}else if(u<o){let l=r<=o&&r>=u?o-r:0;o-=l,o&&o<t.size&&Jc(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-u),u=o}return{start:o,endA:s,endB:u}}a(bg,"findDiff");function Jc(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}a(Jc,"isSurrogatePair");const Ja=class Ja{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Fu,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Qc),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=Xc(this),Zc(this),this.nodeViews=Yc(this),this.docView=Dc(this.state.doc,Gc(this),Bs(this),this.dom,this),this.domObserver=new $u(this,(r,i,o,s)=>pg(this,r,i,o,s)),this.domObserver.start(),$1(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Lu(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Qc),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Eh(this),s=!0),this.state=e;let u=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(u||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=Yc(this);xg(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(u||n.handleDOMEvents!=this._props.handleDOMEvents)&&Lu(this),this.editable=Xc(this),Zc(this);let l=Bs(this),c=Gc(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(i.selection))&&(s=!0);let h=d=="preserve"&&s&&this.dom.style.overflowAnchor==null&&i1(this);if(s){this.domObserver.stop();let p=f&&(we||fe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&yg(i.selection,e.selection);if(f){let m=fe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Y1(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Dc(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&v1(this))?bt(this,p):(dh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():h&&o1(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof I){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Ec(this,n.getBoundingClientRect(),e)}else Ec(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new io(e.slice,e.move,i<0?void 0:I.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let u=this.directPlugins[s].props[e];if(u!=null&&(i=n?n(u):u))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let u=o[s].props[e];if(u!=null&&(i=n?n(u):u))return i}}hasFocus(){if(we){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&&s1(this.dom),bt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return d1(this,e)}coordsAtPos(e,n=1){return oh(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return g1(this,n||this.state,e)}pasteHTML(e,n){return ti(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ti(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Al(this,e)}destroy(){this.docView&&(H1(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Bs(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Km())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return j1(this,e)}domSelectionRange(){let e=this.domSelection();return e?ge&&this.root.nodeType===11&&Ym(this.dom.ownerDocument)==this.dom&&ag(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};a(Ja,"EditorView");let lo=Ja;lo.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Gc(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Fe.node(0,t.state.doc.content.size,e)]}a(Gc,"computeDocDeco");function Zc(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Fe.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}a(Zc,"updateCursorWrapper");function Xc(t){return!t.someProp("editable",e=>e(t.state)===!1)}a(Xc,"getEditable");function yg(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}a(yg,"selectionContextChanged");function Yc(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return a(n,"add"),t.someProp("nodeViews",n),t.someProp("markViews",n),e}a(Yc,"buildNodeViews");function xg(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}a(xg,"changedNodeViews");function Qc(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}a(Qc,"checkStateComponent");var qt={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:"'"},ao={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kg=typeof navigator<"u"&&/Mac/.test(navigator.platform),wg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var le=0;le<10;le++)qt[48+le]=qt[96+le]=String(le);for(var le=1;le<=24;le++)qt[le+111]="F"+le;for(var le=65;le<=90;le++)qt[le]=String.fromCharCode(le+32),ao[le]=String.fromCharCode(le);for(var $s in qt)ao.hasOwnProperty($s)||(ao[$s]=qt[$s]);function Cg(t){var e=kg&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||wg&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ao:qt)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}a(Cg,"keyName");const Eg=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Sg=typeof navigator<"u"&&/Win/.test(navigator.platform);function vg(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let u=0;u<e.length-1;u++){let l=e[u];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Eg?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}a(vg,"normalizeKeyName$1");function Ag(t){let e=Object.create(null);for(let n in t)e[vg(n)]=t[n];return e}a(Ag,"normalize$1");function Hs(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}a(Hs,"modifiers");function Mg(t){return new V({props:{handleKeyDown:_l(t)}})}a(Mg,"keymap");function _l(t){let e=Ag(t);return function(n,r){let i=Cg(r),o,s=e[Hs(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=e[Hs(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(Sg&&r.ctrlKey&&r.altKey)&&(o=qt[r.keyCode])&&o!=i){let u=e[Hs(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}a(_l,"keydownHandler");var Tg=Object.defineProperty,Nl=a((t,e)=>{for(var n in e)Tg(t,n,{get:e[n],enumerable:!0})},"__export$1");function fs(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}a(fs,"createChainableState");var jn,hs=(jn=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,l])=>[u,a((...d)=>{const f=l(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f},"method")]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,u=[],l=!!e,c=e||o.tr,d=a(()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),u.every(h=>h===!0)),"run3"),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,a((...g)=>{const b=this.buildProps(c,n),y=p(...g)(b);return u.push(y),f},"chainedCommand")])),run:d};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)({...s,dispatch:void 0})])),chain:a(()=>this.createChain(o,i),"chain")}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,u={tr:e,editor:i,view:s,state:fs({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:a(()=>this.createChain(e,n),"chain"),can:a(()=>this.createCan(e),"can"),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...d)=>c(...d)(u)]))}};return u}},a(jn,"CommandManager"),jn),Dh={};Nl(Dh,{blur:a(()=>Dg,"blur"),clearContent:a(()=>Og,"clearContent"),clearNodes:a(()=>_g,"clearNodes"),command:a(()=>Ng,"command"),createParagraphNear:a(()=>Ig,"createParagraphNear"),cut:a(()=>Rg,"cut"),deleteCurrentNode:a(()=>Fg,"deleteCurrentNode"),deleteNode:a(()=>Lg,"deleteNode"),deleteRange:a(()=>Pg,"deleteRange"),deleteSelection:a(()=>Bg,"deleteSelection"),enter:a(()=>zg,"enter"),exitCode:a(()=>$g,"exitCode"),extendMarkRange:a(()=>Hg,"extendMarkRange"),first:a(()=>Vg,"first"),focus:a(()=>qg,"focus"),forEach:a(()=>Ug,"forEach"),insertContent:a(()=>Wg,"insertContent"),insertContentAt:a(()=>Gg,"insertContentAt"),joinBackward:a(()=>Yg,"joinBackward"),joinDown:a(()=>Xg,"joinDown"),joinForward:a(()=>Qg,"joinForward"),joinItemBackward:a(()=>eb,"joinItemBackward"),joinItemForward:a(()=>tb,"joinItemForward"),joinTextblockBackward:a(()=>nb,"joinTextblockBackward"),joinTextblockForward:a(()=>rb,"joinTextblockForward"),joinUp:a(()=>Zg,"joinUp"),keyboardShortcut:a(()=>ob,"keyboardShortcut"),lift:a(()=>sb,"lift"),liftEmptyBlock:a(()=>ub,"liftEmptyBlock"),liftListItem:a(()=>lb,"liftListItem"),newlineInCode:a(()=>ab,"newlineInCode"),resetAttributes:a(()=>cb,"resetAttributes"),scrollIntoView:a(()=>db,"scrollIntoView"),selectAll:a(()=>fb,"selectAll"),selectNodeBackward:a(()=>hb,"selectNodeBackward"),selectNodeForward:a(()=>pb,"selectNodeForward"),selectParentNode:a(()=>mb,"selectParentNode"),selectTextblockEnd:a(()=>gb,"selectTextblockEnd"),selectTextblockStart:a(()=>bb,"selectTextblockStart"),setContent:a(()=>yb,"setContent"),setMark:a(()=>Fb,"setMark"),setMeta:a(()=>Lb,"setMeta"),setNode:a(()=>Pb,"setNode"),setNodeSelection:a(()=>Bb,"setNodeSelection"),setTextDirection:a(()=>zb,"setTextDirection"),setTextSelection:a(()=>$b,"setTextSelection"),sinkListItem:a(()=>Hb,"sinkListItem"),splitBlock:a(()=>Vb,"splitBlock"),splitListItem:a(()=>jb,"splitListItem"),toggleList:a(()=>qb,"toggleList"),toggleMark:a(()=>Ub,"toggleMark"),toggleNode:a(()=>Wb,"toggleNode"),toggleWrap:a(()=>Kb,"toggleWrap"),undoInputRule:a(()=>Jb,"undoInputRule"),unsetAllMarks:a(()=>Gb,"unsetAllMarks"),unsetMark:a(()=>Zb,"unsetMark"),unsetTextDirection:a(()=>Xb,"unsetTextDirection"),updateAttributes:a(()=>Yb,"updateAttributes"),wrapIn:a(()=>Qb,"wrapIn"),wrapInList:a(()=>e2,"wrapInList")});var Dg=a(()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),"blur"),Og=a((t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),"clearContent"),_g=a(()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(u,l)=>{if(u.type.isText)return;const{doc:c,mapping:d}=e,f=c.resolve(d.map(l)),h=c.resolve(d.map(l+u.nodeSize)),p=f.blockRange(h);if(!p)return;const m=kr(p);if(u.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},"clearNodes"),Ng=a(t=>e=>t(e),"command"),Ig=a(()=>({state:t,dispatch:e})=>Gf(t,e),"createParagraphNear"),Rg=a((t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new F(r.doc.resolve(Math.max(s-1,0)))),!0},"cut"),Fg=a(()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const u=i.before(o),l=i.after(o);t.delete(u,l).scrollIntoView()}return!0}return!1},"deleteCurrentNode");function Y(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}a(Y,"getNodeType");var Lg=a(t=>({tr:e,state:n,dispatch:r})=>{const i=Y(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},"deleteNode"),Pg=a(t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},"deleteRange"),Bg=a(()=>({state:t,dispatch:e})=>yl(t,e),"deleteSelection"),zg=a(()=>({commands:t})=>t.keyboardShortcut("Enter"),"enter"),$g=a(()=>({state:t,dispatch:e})=>Nm(t,e),"exitCode");function Il(t){return Object.prototype.toString.call(t)==="[object RegExp]"}a(Il,"isRegExp$1");function co(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Il(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}a(co,"objectIncludes");function Oh(t,e,n={}){return t.find(r=>r.type===e&&co(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}a(Oh,"findMarkInSet");function ed(t,e,n={}){return!!Oh(t,e,n)}a(ed,"isMarkInSet");function Rl(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!Oh([...i.node.marks],e,n)))return;let s=i.index,u=t.start()+i.offset,l=s+1,c=u+i.node.nodeSize;for(;s>0&&ed([...t.parent.child(s-1).marks],e,n);)s-=1,u-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&ed([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:u,to:c}}a(Rl,"getMarkRange");function xt(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}a(xt,"getMarkType");var Hg=a((t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=xt(t,r.schema),{doc:s,selection:u}=n,{$from:l,from:c,to:d}=u;if(i){const f=Rl(l,o,e);if(f&&f.from<=c&&f.to>=d){const h=F.create(s,f.from,f.to);n.setSelection(h)}}return!0},"extendMarkRange"),Vg=a(t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1},"first");function Fl(t){return t instanceof F}a(Fl,"isTextSelection");function mt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}a(mt,"minMax");function _h(t,e=null){if(!e)return null;const n=R.atStart(t),r=R.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?F.create(t,mt(0,i,o),mt(t.content.size,i,o)):F.create(t,mt(e,i,o),mt(e,i,o))}a(_h,"resolveFocusPosition");function jg(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}a(jg,"isAndroid");function Ll(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}a(Ll,"isiOS");var qg=a((t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=a(()=>{(Ll()||jg())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})},"delayedFocus");if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Fl(n.state.selection))return s(),!0;const u=_h(i.doc,t)||n.state.selection,l=n.state.selection.eq(u);return o&&(l||i.setSelection(u),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},"focus"),Ug=a((t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),"forEach"),Wg=a((t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),"insertContent"),Nh=a(t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Nh(r)}return t},"removeWhitespaces");function Ci(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Nh(n)}a(Ci,"elementFromString$1");function ri(t,e,n){if(t instanceof Lt||t instanceof M)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return M.fromArray(t.map(u=>e.nodeFromJSON(u)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),ri("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,u="";const l=new Gr({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:a(c=>(s=!0,u=typeof c=="string"?c:c.outerHTML,null),"getAttrs")}]}})});if(n.slice?Pt.fromSchema(l).parseSlice(Ci(t),n.parseOptions):Pt.fromSchema(l).parse(Ci(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${u}`)})}const o=Pt.fromSchema(e);return n.slice?o.parseSlice(Ci(t),n.parseOptions).content:o.parse(Ci(t),n.parseOptions)}return ri("",e,n)}a(ri,"createNodeFromContent");function Kg(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ae||i instanceof he))return;const o=t.mapping.maps[r];let s=0;o.forEach((u,l,c,d)=>{s===0&&(s=d)}),t.setSelection(R.near(t.doc.resolve(s),n))}a(Kg,"selectionToInsertionEnd");var Jg=a(t=>!("type"in t),"isFragment"),Gg=a((t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let u;const l=a(b=>{o.emit("contentError",{editor:o,error:b,disableCollaboration:a(()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)},"disableCollaboration")})},"emitContentError"),c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{ri(e,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(b){l(b)}try{u=ri(e,o.schema,{parseOptions:c,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(b){return l(b),!1}let{from:d,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},h=!0,p=!0;if((Jg(u)?u:[u]).forEach(b=>{b.check(),h=h?b.isText&&b.marks.length===0:!1,p=p?b.isBlock:!1}),d===f&&p){const{parent:b}=r.doc.resolve(d);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(d-=1,f+=1)}let g;if(h){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof M){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,d,f)}else{g=u;const b=r.doc.resolve(d),y=b.node(),x=b.parentOffset===0,k=y.isText||y.isTextblock,C=y.content.size>0;x&&k&&C&&(d=Math.max(0,d-1)),r.replaceWith(d,f,g)}n.updateSelection&&Kg(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:g})}return!0},"insertContentAt"),Zg=a(()=>({state:t,dispatch:e})=>Dm(t,e),"joinUp"),Xg=a(()=>({state:t,dispatch:e})=>Om(t,e),"joinDown"),Yg=a(()=>({state:t,dispatch:e})=>Vf(t,e),"joinBackward"),Qg=a(()=>({state:t,dispatch:e})=>Wf(t,e),"joinForward"),eb=a(()=>({state:t,dispatch:e,tr:n})=>{try{const r=ls(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},"joinItemBackward"),tb=a(()=>({state:t,dispatch:e,tr:n})=>{try{const r=ls(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},"joinItemForward"),nb=a(()=>({state:t,dispatch:e})=>Mm(t,e),"joinTextblockBackward"),rb=a(()=>({state:t,dispatch:e})=>Tm(t,e),"joinTextblockForward");function Ih(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}a(Ih,"isMacOS");function ib(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let u=0;u<e.length-1;u+=1){const l=e[u];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Ll()||Ih()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}a(ib,"normalizeKeyName");var ob=a(t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=ib(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),u=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,u))});return l?.steps.forEach(c=>{const d=c.map(r.mapping);d&&i&&r.maybeStep(d)}),!0},"keyboardShortcut");function Ut(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Y(e,t.schema):null,u=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);u.push({node:f,from:p,to:m})});const l=i-r,c=u.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>co(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,h)=>f+h.to-h.from,0)>=l}a(Ut,"isNodeActive");var sb=a((t,e={})=>({state:n,dispatch:r})=>{const i=Y(t,n.schema);return Ut(n,i,e)?_m(n,r):!1},"lift"),ub=a(()=>({state:t,dispatch:e})=>Zf(t,e),"liftEmptyBlock"),lb=a(t=>({state:e,dispatch:n})=>{const r=Y(t,e.schema);return jm(r)(e,n)},"liftListItem"),ab=a(()=>({state:t,dispatch:e})=>Jf(t,e),"newlineInCode");function ps(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}a(ps,"getSchemaTypeNameByName");function td(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}a(td,"deleteProps");var cb=a((t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const u=ps(typeof t=="string"?t:t.name,r.schema);if(!u)return!1;u==="node"&&(o=Y(t,r.schema)),u==="mark"&&(s=xt(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,f)=>{o&&o===d.type&&(l=!0,i&&n.setNodeMarkup(f,void 0,td(d.attrs,e))),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&(l=!0,i&&n.addMark(f,f+d.nodeSize,s.create(td(h.attrs,e))))})})}),l},"resetAttributes"),db=a(()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),"scrollIntoView"),fb=a(()=>({tr:t,dispatch:e})=>{if(e){const n=new Be(t.doc);t.setSelection(n)}return!0},"selectAll"),hb=a(()=>({state:t,dispatch:e})=>qf(t,e),"selectNodeBackward"),pb=a(()=>({state:t,dispatch:e})=>Kf(t,e),"selectNodeForward"),mb=a(()=>({state:t,dispatch:e})=>Fm(t,e),"selectParentNode"),gb=a(()=>({state:t,dispatch:e})=>Bm(t,e),"selectTextblockEnd"),bb=a(()=>({state:t,dispatch:e})=>Pm(t,e),"selectTextblockStart");function Hu(t,e,n={},r={}){return ri(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}a(Hu,"createDocument");var yb=a((t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:u})=>{const{doc:l}=o;if(r.preserveWhitespace!=="full"){const c=Hu(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return s&&o.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),u.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})},"setContent");function Rh(t,e){const n=xt(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const u=s.find(l=>l.type.name===n.name);return u?{...u.attrs}:{}}a(Rh,"getMarkAttributes");function Fh(t,e){const n=new Gi(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}a(Fh,"combineTransactionSteps");function xb(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}a(xb,"defaultBlockAt");function kb(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}a(kb,"findChildrenInRange");function wb(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}a(wb,"findParentNodeClosestToPos");function hi(t){return e=>wb(e.$from,t)}a(hi,"findParentNode");function _(t,e,n){return t.config[e]===void 0&&t.parent?_(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?_(t.parent,e,n):null}):t.config[e]}a(_,"getExtensionField");function Pl(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=_(e,"addExtensions",n);return r?[e,...Pl(r())]:e}).flat(10)}a(Pl,"flattenExtensions");function pi(t,e){const n=Sn.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}a(pi,"getHTMLFromFragment");function Lh(t){return typeof t=="function"}a(Lh,"isFunction$1");function H(t,e=void 0,...n){return Lh(t)?e?t.bind(e)(...n):t(...n):t}a(H,"callOrReturn");function Cb(t={}){return Object.keys(t).length===0&&t.constructor===Object}a(Cb,"isEmptyObject");function fr(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}a(fr,"splitExtensions");function Ph(t){const e=[],{nodeExtensions:n,markExtensions:r}=fr(t),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const u={name:s.name,options:s.options,storage:s.storage,extensions:i},l=_(s,"addGlobalAttributes",u);if(!l)return;l().forEach(d=>{d.types.forEach(f=>{Object.entries(d.attributes).forEach(([h,p])=>{e.push({type:f,name:h,attribute:{...o,...p}})})})})}),i.forEach(s=>{const u={name:s.name,options:s.options,storage:s.storage},l=_(s,"addAttributes",u);if(!l)return;const c=l();Object.entries(c).forEach(([d,f])=>{const h={...o,...f};typeof h?.default=="function"&&(h.default=h.default()),h?.isRequired&&h?.default===void 0&&delete h.default,e.push({type:s.name,name:d,attribute:h})})}),e}a(Ph,"getAttributesFromExtensions");function Q(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const u=o?String(o).split(" "):[],l=r[i]?r[i].split(" "):[],c=u.filter(d=>!l.includes(d));r[i]=[...l,...c].join(" ")}else if(i==="style"){const u=o?o.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[f,h]=d.split(":").map(p=>p.trim());c.set(f,h)}),u.forEach(d=>{const[f,h]=d.split(":").map(p=>p.trim());c.set(f,h)}),r[i]=Array.from(c.entries()).map(([d,f])=>`${d}: ${f}`).join("; ")}else r[i]=o}),r},{})}a(Q,"mergeAttributes");function fo(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Q(n,r),{})}a(fo,"getRenderedAttributes");function Eb(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}a(Eb,"fromString");function nd(t,e){return"style"in t?t:{...t,getAttrs:a(n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const u=s.attribute.parseHTML?s.attribute.parseHTML(n):Eb(n.getAttribute(s.name));return u==null?o:{...o,[s.name]:u}},{});return{...r,...i}},"getAttrs")}}a(nd,"injectExtensionAttributesToParseRule");function rd(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Cb(n)?!1:n!=null))}a(rd,"cleanUpSchemaItem");function id(t){var e,n;const r={};return!((e=t?.attribute)!=null&&e.isRequired)&&"default"in(t?.attribute||{})&&(r.default=t.attribute.default),((n=t?.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}a(id,"buildAttributeSpec");function Sb(t,e){var n;const r=Ph(t),{nodeExtensions:i,markExtensions:o}=fr(t),s=(n=i.find(c=>_(c,"topNode")))==null?void 0:n.name,u=Object.fromEntries(i.map(c=>{const d=r.filter(y=>y.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((y,x)=>{const k=_(x,"extendNodeSchema",f);return{...y,...k?k(c):{}}},{}),p=rd({...h,content:H(_(c,"content",f)),marks:H(_(c,"marks",f)),group:H(_(c,"group",f)),inline:H(_(c,"inline",f)),atom:H(_(c,"atom",f)),selectable:H(_(c,"selectable",f)),draggable:H(_(c,"draggable",f)),code:H(_(c,"code",f)),whitespace:H(_(c,"whitespace",f)),linebreakReplacement:H(_(c,"linebreakReplacement",f)),defining:H(_(c,"defining",f)),isolating:H(_(c,"isolating",f)),attrs:Object.fromEntries(d.map(id))}),m=H(_(c,"parseHTML",f));m&&(p.parseDOM=m.map(y=>nd(y,d)));const g=_(c,"renderHTML",f);g&&(p.toDOM=y=>g({node:y,HTMLAttributes:fo(y,d)}));const b=_(c,"renderText",f);return b&&(p.toText=b),[c.name,p]})),l=Object.fromEntries(o.map(c=>{const d=r.filter(b=>b.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((b,y)=>{const x=_(y,"extendMarkSchema",f);return{...b,...x?x(c):{}}},{}),p=rd({...h,inclusive:H(_(c,"inclusive",f)),excludes:H(_(c,"excludes",f)),group:H(_(c,"group",f)),spanning:H(_(c,"spanning",f)),code:H(_(c,"code",f)),attrs:Object.fromEntries(d.map(id))}),m=H(_(c,"parseHTML",f));m&&(p.parseDOM=m.map(b=>nd(b,d)));const g=_(c,"renderHTML",f);return g&&(p.toDOM=b=>g({mark:b,HTMLAttributes:fo(b,d)})),[c.name,p]}));return new Gr({topNode:s,nodes:u,marks:l})}a(Sb,"getSchemaByResolvedExtensions");function vb(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}a(vb,"findDuplicates");function Bl(t){return t.sort((n,r)=>{const i=_(n,"priority")||100,o=_(r,"priority")||100;return i>o?-1:i<o?1:0})}a(Bl,"sortExtensions");function Bh(t){const e=Bl(Pl(t)),n=vb(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}a(Bh,"resolveExtensions");function zh(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
11
|
-
|
|
12
|
-
`,textSerializers:s={}}=n||{};let u="";return t.nodesBetween(r,i,(l,c,d,f)=>{var h;l.isBlock&&c>r&&(u+=o);const p=s?.[l.type.name];if(p)return d&&(u+=p({node:l,pos:c,parent:d,index:f,range:e})),!1;l.isText&&(u+=(h=l?.text)==null?void 0:h.slice(Math.max(r,c)-c,i-c))}),u}a(zh,"getTextBetween");function $h(t,e){const n={from:0,to:t.content.size};return zh(t,n,e)}a($h,"getText");function zl(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}a(zl,"getTextSerializersFromSchema");function Ab(t,e){const n=Y(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,u=>{o.push(u)});const s=o.reverse().find(u=>u.type.name===n.name);return s?{...s.attrs}:{}}a(Ab,"getNodeAttributes");function Hh(t,e){const n=ps(typeof e=="string"?e:e.name,t.schema);return n==="node"?Ab(t,e):n==="mark"?Rh(t,e):{}}a(Hh,"getAttributes");function Mb(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}a(Mb,"removeDuplicates");function Tb(t){const e=Mb(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}a(Tb,"simplifyChangedRanges");function Vh(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((u,l)=>{s.push({from:u,to:l})});else{const{from:u,to:l}=n[o];if(u===void 0||l===void 0)return;s.push({from:u,to:l})}s.forEach(({from:u,to:l})=>{const c=e.slice(o).map(u,-1),d=e.slice(o).map(l),f=e.invert().map(c,-1),h=e.invert().map(d);r.push({oldRange:{from:f,to:h},newRange:{from:c,to:d}})})}),Tb(r)}a(Vh,"getChangedRanges");function $l(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Rl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}a($l,"getMarksBetween");var Db=a((t,e,n,r=20)=>{const i=t.doc.resolve(n);let o=r,s=null;for(;o>0&&s===null;){const u=i.node(o);u?.type.name===e?s=u:o-=1}return[s,o]},"getNodeAtPosition");function Vs(t,e){return e.nodes[t]||e.marks[t]||null}a(Vs,"getSchemaTypeByName");function Pi(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}a(Pi,"getSplittedAttributes");var Ob=a((t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,u)=>{var l,c;const d=((c=(l=i.type.spec).toText)==null?void 0:c.call(l,{node:i,pos:o,parent:s,index:u}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-o))}),n},"getTextContentFromNodes");function Vu(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?xt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>co(f.attrs,n,{strict:!1}));let s=0;const u=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,b)=>{if(!g.isText&&!g.marks.length)return;const y=Math.max(p,b),x=Math.min(m,b+g.nodeSize),k=x-y;s+=k,u.push(...g.marks.map(C=>({mark:C,from:y,to:x})))})}),s===0)return!1;const l=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>co(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(l>0?l+c:l)>=s}a(Vu,"isMarkActive");function _b(t,e,n={}){if(!e)return Ut(t,null,n)||Vu(t,null,n);const r=ps(e,t.schema);return r==="node"?Ut(t,e,n):r==="mark"?Vu(t,e,n):!1}a(_b,"isActive");var Nb=a((t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const o=hi(u=>u.type.name===e)(t.selection);if(!o)return!1;const s=t.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},"isAtEndOfNode"),Ib=a(t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)},"isAtStartOfNode");function od(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}a(od,"isExtensionRulesEnabled");function sd(t,e){const{nodeExtensions:n}=fr(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=H(_(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}a(sd,"isList");function ms(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(ms(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}a(ms,"isNodeEmpty");function jh(t){return t instanceof I}a(jh,"isNodeSelection");function Hl(t,e,n){const i=t.state.doc.content.size,o=mt(e,0,i),s=mt(n,0,i),u=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),c=Math.min(u.top,l.top),d=Math.max(u.bottom,l.bottom),f=Math.min(u.left,l.left),h=Math.max(u.right,l.right),p=h-f,m=d-c,y={top:c,bottom:d,left:f,right:h,width:p,height:m,x:f,y:c};return{...y,toJSON:a(()=>y,"toJSON")}}a(Hl,"posToDOMRect");function Rb(t,e,n){var r;const{selection:i}=e;let o=null;if(Fl(i)&&(o=i.$cursor),o){const u=(r=t.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(u)||!u.some(c=>c.type.excludes(n)))}const{ranges:s}=i;return s.some(({$from:u,$to:l})=>{let c=u.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(u.pos,l.pos,(d,f,h)=>{if(c)return!1;if(d.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(d.marks)||!d.marks.some(g=>g.type.excludes(n));c=p&&m}return!c}),c})}a(Rb,"canSetMark");var Fb=a((t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:u}=o,l=xt(t,r.schema);if(i)if(s){const c=Rh(r,l);n.addStoredMark(l.create({...c,...e}))}else u.forEach(c=>{const d=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(d,f,(h,p)=>{const m=Math.max(p,d),g=Math.min(p+h.nodeSize,f);h.marks.find(y=>y.type===l)?h.marks.forEach(y=>{l===y.type&&n.addMark(m,g,l.create({...y.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return Rb(r,n,l)},"setMark"),Lb=a((t,e)=>({tr:n})=>(n.setMeta(t,e),!0),"setMeta"),Pb=a((t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Y(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:u})=>kc(o,{...s,...e})(n)?!0:u.clearNodes()).command(({state:u})=>kc(o,{...s,...e})(u,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},"setNode"),Bb=a(t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=mt(t,0,r.content.size),o=I.create(r,i);e.setSelection(o)}return!0},"setNodeSelection"),zb=a((t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=r;let s,u;return typeof e=="number"?(s=e,u=e):e&&"from"in e&&"to"in e?(s=e.from,u=e.to):(s=o.from,u=o.to),i&&n.doc.nodesBetween(s,u,(l,c)=>{l.isText||n.setNodeMarkup(c,void 0,{...l.attrs,dir:t})}),!0},"setTextDirection"),$b=a(t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=F.atStart(r).from,u=F.atEnd(r).to,l=mt(i,s,u),c=mt(o,s,u),d=F.create(r,l,c);e.setSelection(d)}return!0},"setTextSelection"),Hb=a(t=>({state:e,dispatch:n})=>{const r=Y(t,e.schema);return Wm(r)(e,n)},"sinkListItem");function ud(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}a(ud,"ensureMarks");var Vb=a(({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:u,$to:l}=o,c=i.extensionManager.attributes,d=Pi(c,u.node().type.name,u.node().attrs);if(o instanceof I&&o.node.isBlock)return!u.parentOffset||!gt(s,u.pos)?!1:(r&&(t&&ud(n,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,h=u.depth===0?void 0:xb(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&h?[{type:h,attrs:d}]:void 0,m=gt(e.doc,e.mapping.map(u.pos),1,p);if(!p&&!m&>(e.doc,e.mapping.map(u.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:d}]:void 0),r){if(m&&(o instanceof F&&e.deleteSelection(),e.split(e.mapping.map(u.pos),1,p),h&&!f&&!u.parentOffset&&u.parent.type!==h)){const g=e.mapping.map(u.before()),b=e.doc.resolve(g);u.node(-1).canReplaceWith(b.index(),b.index()+1,h)&&e.setNodeMarkup(e.mapping.map(u.before()),h)}t&&ud(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},"splitBlock"),jb=a((t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const u=Y(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==u)return!1;const h=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==u||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let y=M.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let D=l.depth-x;D>=l.depth-3;D-=1)y=M.from(l.node(D).copy(y));const k=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,C={...Pi(h,l.node().type.name,l.node().attrs),...e},w=((s=u.contentMatch.defaultType)==null?void 0:s.createAndFill(C))||void 0;y=y.append(M.from(u.createAndFill(null,w)||void 0));const S=l.before(l.depth-(x-1));n.replace(S,l.after(-k),new T(y,4-x,0));let v=-1;n.doc.nodesBetween(S,n.doc.content.size,(D,O)=>{if(v>-1)return!1;D.isTextblock&&D.content.size===0&&(v=O+1)}),v>-1&&n.setSelection(F.near(n.doc.resolve(v))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,m={...Pi(h,f.type.name,f.attrs),...e},g={...Pi(h,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const b=p?[{type:u,attrs:m},{type:p,attrs:g}]:[{type:u,attrs:m}];if(!gt(n.doc,l.pos,2))return!1;if(i){const{selection:y,storedMarks:x}=r,{splittableMarks:k}=o.extensionManager,C=x||y.$to.parentOffset&&y.$from.marks();if(n.split(l.pos,2,b).scrollIntoView(),!C||!i)return!0;const w=C.filter(S=>k.includes(S.type.name));n.ensureMarks(w)}return!0},"splitListItem"),js=a((t,e)=>{const n=hi(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&Gt(t.doc,n.pos)&&t.join(n.pos),!0},"joinListBackwards"),qs=a((t,e)=>{const n=hi(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&Gt(t.doc,r)&&t.join(r),!0},"joinListForwards"),qb=a((t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:u,chain:l,commands:c,can:d})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Y(t,s.schema),m=Y(e,s.schema),{selection:g,storedMarks:b}=s,{$from:y,$to:x}=g,k=y.blockRange(x),C=b||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const w=hi(S=>sd(S.type.name,f))(g);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===p)return c.liftListItem(m);if(sd(w.node.type.name,f)&&p.validContent(w.node.content)&&u)return l().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>js(o,p)).command(()=>qs(o,p)).run()}return!n||!C||!u?l().command(()=>d().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>js(o,p)).command(()=>qs(o,p)).run():l().command(()=>{const S=d().wrapInList(p,r),v=C.filter(D=>h.includes(D.type.name));return o.ensureMarks(v),S?!0:c.clearNodes()}).wrapInList(p,r).command(()=>js(o,p)).command(()=>qs(o,p)).run()},"toggleList"),Ub=a((t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=xt(t,r.schema);return Vu(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},"toggleMark"),Wb=a((t,e,n={})=>({state:r,commands:i})=>{const o=Y(t,r.schema),s=Y(e,r.schema),u=Ut(r,o,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),u?i.setNode(s,l):i.setNode(o,{...l,...n})},"toggleNode"),Kb=a((t,e={})=>({state:n,commands:r})=>{const i=Y(t,n.schema);return Ut(n,i,e)?r.lift(i):r.wrapIn(i,e)},"toggleWrap"),Jb=a(()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,u=o.transform;for(let l=u.steps.length-1;l>=0;l-=1)s.step(u.steps[l].invert(u.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},"undoInputRule"),Gb=a(()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},"unsetAllMarks"),Zb=a((t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:u}=n,l=xt(t,r.schema),{$from:c,empty:d,ranges:f}=u;if(!i)return!0;if(d&&s){let{from:h,to:p}=u;const m=(o=c.marks().find(b=>b.type===l))==null?void 0:o.attrs,g=Rl(c,l,m);g&&(h=g.from,p=g.to),n.removeMark(h,p,l)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},"unsetMark"),Xb=a(t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let o,s;return typeof t=="number"?(o=t,s=t):t&&"from"in t&&"to"in t?(o=t.from,s=t.to):(o=i.from,s=i.to),r&&e.doc.nodesBetween(o,s,(u,l)=>{if(u.isText)return;const c={...u.attrs};delete c.dir,e.setNodeMarkup(l,void 0,c)}),!0},"unsetTextDirection"),Yb=a((t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const u=ps(typeof t=="string"?t:t.name,r.schema);if(!u)return!1;u==="node"&&(o=Y(t,r.schema)),u==="mark"&&(s=xt(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{const d=c.$from.pos,f=c.$to.pos;let h,p,m,g;n.selection.empty?r.doc.nodesBetween(d,f,(b,y)=>{o&&o===b.type&&(l=!0,m=Math.max(y,d),g=Math.min(y+b.nodeSize,f),h=y,p=b)}):r.doc.nodesBetween(d,f,(b,y)=>{y<d&&o&&o===b.type&&(l=!0,m=Math.max(y,d),g=Math.min(y+b.nodeSize,f),h=y,p=b),y>=d&&y<=f&&(o&&o===b.type&&(l=!0,i&&n.setNodeMarkup(y,void 0,{...b.attrs,...e})),s&&b.marks.length&&b.marks.forEach(x=>{if(s===x.type&&(l=!0,i)){const k=Math.max(y,d),C=Math.min(y+b.nodeSize,f);n.addMark(k,C,s.create({...x.attrs,...e}))}}))}),p&&(h!==void 0&&i&&n.setNodeMarkup(h,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(b=>{s===b.type&&i&&n.addMark(m,g,s.create({...b.attrs,...e}))}))}),l},"updateAttributes"),Qb=a((t,e={})=>({state:n,dispatch:r})=>{const i=Y(t,n.schema);return zm(i,e)(n,r)},"wrapIn"),e2=a((t,e={})=>({state:n,dispatch:r})=>{const i=Y(t,n.schema);return $m(i,e)(n,r)},"wrapInList"),qn,t2=(qn=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){const r=a((...i)=>{this.off(e,r),n.apply(this,i)},"onceFn");return this.on(e,r)}removeAllListeners(){this.callbacks={}}},a(qn,"EventEmitter"),qn),Un,gs=(Un=class{constructor(e){var n;this.find=e.find,this.handler=e.handler,this.undoable=(n=e.undoable)!=null?n:!0}},a(Un,"InputRule"),Un),n2=a((t,e)=>{if(Il(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r},"inputRuleMatcherHandler");function Ei(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:u}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let d=!1;const f=Ob(c)+o;return s.forEach(h=>{if(d)return;const p=n2(f,h.find);if(!p)return;const m=l.state.tr,g=fs({state:l.state,transaction:m}),b={from:r-(p[0].length-o.length),to:i},{commands:y,chain:x,can:k}=new hs({editor:n,state:g});h.handler({state:g,range:b,match:p,commands:y,chain:x,can:k})===null||!m.steps.length||(h.undoable&&m.setMeta(u,{transform:m,from:r,to:i,text:o}),l.dispatch(m),d=!0)}),d}a(Ei,"run$2");function r2(t){const{editor:e,rules:n}=t,r=new V({state:{init(){return null},apply(i,o,s){const u=i.getMeta(r);if(u)return u;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=pi(M.from(d),s.schema);const{from:f}=l,h=f+d.length;Ei({editor:e,from:f,to:h,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,u){return Ei({editor:e,from:o,to:s,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:a(i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ei({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1),"compositionend")},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Ei({editor:e,from:s.pos,to:s.pos,text:`
|
|
13
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}a(r2,"inputRulesPlugin");function i2(t){return Object.prototype.toString.call(t).slice(8,-1)}a(i2,"getType");function Si(t){return i2(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}a(Si,"isPlainObject");function qh(t,e){const n={...t};return Si(t)&&Si(e)&&Object.keys(e).forEach(r=>{Si(e[r])&&Si(t[r])?n[r]=qh(t[r],e[r]):n[r]=e[r]}),n}a(qh,"mergeDeep");var Wn,Vl=(Wn=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...H(_(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...H(_(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const n=this.extend({...this.config,addOptions:a(()=>qh(this.options,e),"addOptions")});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new this.constructor({...this.config,...e});return n.parent=this,this.child=n,n.name="name"in e?e.name:n.parent.name,n}},a(Wn,"Extendable"),Wn),xn,Te=(xn=class extends Vl{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new xn(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>c?.type.name===n.name))return!1;const l=s.find(c=>c?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},a(xn,"_Mark"),xn);function o2(t){return typeof t=="number"}a(o2,"isNumber$1");var Kn,s2=(Kn=class{constructor(e){this.find=e.find,this.handler=e.handler}},a(Kn,"PasteRule"),Kn),u2=a((t,e,n)=>{if(Il(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]},"pasteRuleMatcherHandler");function l2(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:u}=t,{commands:l,chain:c,can:d}=new hs({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(p,m)=>{var g,b,y,x,k;if((b=(g=p.type)==null?void 0:g.spec)!=null&&b.code||!(p.isText||p.isTextblock||p.isInline))return;const C=(k=(x=(y=p.content)==null?void 0:y.size)!=null?x:p.nodeSize)!=null?k:0,w=Math.max(r,m),S=Math.min(i,m+C);if(w>=S)return;const v=p.isText?p.text||"":p.textBetween(w-m,S-m,void 0,"");u2(v,o.find,s).forEach(O=>{if(O.index===void 0)return;const N=w+O.index+1,$=N+O[0].length,U={from:n.tr.mapping.map(N),to:n.tr.mapping.map($)},G=o.handler({state:n,range:U,match:O,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:u});f.push(G)})}),f.every(p=>p!==null)}a(l2,"run2");var vi=null,a2=a(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n},"createClipboardPasteEvent");function c2(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,u;try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}const l=a(({state:d,from:f,to:h,rule:p,pasteEvt:m})=>{const g=d.tr,b=fs({state:d,transaction:g});if(!(!l2({editor:e,state:b,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:u})||!g.steps.length)){try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}},"processEvent");return n.map(d=>new V({view(f){const h=a(m=>{var g;r=(g=f.dom.parentElement)!=null&&g.contains(m.target)?f.dom.parentElement:null,r&&(vi=e)},"handleDragstart"),p=a(()=>{vi&&(vi=null)},"handleDragend");return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:a((f,h)=>{if(o=r===f.dom.parentElement,u=h,!o){const p=vi;p?.isEditable&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},"drop"),paste:a((f,h)=>{var p;const m=(p=h.clipboardData)==null?void 0:p.getData("text/html");return s=h,i=!!m?.includes("data-pm-slice"),!1},"paste")}},appendTransaction:a((f,h,p)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,b=m.getMeta("uiEvent")==="drop"&&!o,y=m.getMeta("applyPasteRules"),x=!!y;if(!g&&!b&&!x)return;if(x){let{text:w}=y;typeof w=="string"?w=w:w=pi(M.from(w),p.schema);const{from:S}=y,v=S+w.length,D=a2(w);return l({rule:d,state:p,from:S,to:{b:v},pasteEvt:D})}const k=h.doc.content.findDiffStart(p.doc.content),C=h.doc.content.findDiffEnd(p.doc.content);if(!(!o2(k)||!C||k===C.b))return l({rule:d,state:p,from:k,to:C,pasteEvt:s})},"appendTransaction")}))}a(c2,"pasteRulesPlugin");var Jn,bs=(Jn=class{constructor(e,n){this.splittableMarks=[],this.editor=n,this.baseExtensions=e,this.extensions=Bh(e),this.schema=Sb(this.extensions,n),this.setupExtensions()}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:this.editor,type:Vs(n.name,this.schema)},i=_(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this;return Bl([...this.extensions].reverse()).flatMap(i=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Vs(i.name,this.schema)},s=[],u=_(i,"addKeyboardShortcuts",o);let l={};if(i.type==="mark"&&_(i,"exitable",o)&&(l.ArrowRight=()=>Te.handleExit({editor:e,mark:i})),u){const p=Object.fromEntries(Object.entries(u()).map(([m,g])=>[m,()=>g({editor:e})]));l={...l,...p}}const c=Mg(l);s.push(c);const d=_(i,"addInputRules",o);if(od(i,e.options.enableInputRules)&&d){const p=d();if(p&&p.length){const m=r2({editor:e,rules:p}),g=Array.isArray(m)?m:[m];s.push(...g)}}const f=_(i,"addPasteRules",o);if(od(i,e.options.enablePasteRules)&&f){const p=f();if(p&&p.length){const m=c2({editor:e,rules:p});s.push(...m)}}const h=_(i,"addProseMirrorPlugins",o);if(h){const p=h();s.push(...p)}return s})}get attributes(){return Ph(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=fr(this.extensions);return Object.fromEntries(n.filter(r=>!!_(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.type===r.name),o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Y(r.name,this.schema)},s=_(r,"addNodeView",o);if(!s)return[];const u=s();if(!u)return[];const l=a((c,d,f,h,p)=>{const m=fo(c,i);return u({node:c,view:d,getPos:f,decorations:h,innerDecorations:p,editor:e,extension:r,HTMLAttributes:m})},"nodeview");return[r.name,l]}))}get markViews(){const{editor:e}=this,{markExtensions:n}=fr(this.extensions);return Object.fromEntries(n.filter(r=>!!_(r,"addMarkView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:xt(r.name,this.schema)},s=_(r,"addMarkView",o);if(!s)return[];const u=a((l,c,d)=>{const f=fo(l,i);return s()({mark:l,view:c,inline:d,editor:e,extension:r,HTMLAttributes:f,updateAttributes:a(h=>{E2(l,e,h)},"updateAttributes")})},"markView");return[r.name,u]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(n=>[n.name,n.storage])),e.forEach(n=>{var r;const i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:this.editor,type:Vs(n.name,this.schema)};n.type==="mark"&&((r=H(_(n,"keepOnSplit",i)))==null||r)&&this.splittableMarks.push(n.name);const o=_(n,"onBeforeCreate",i),s=_(n,"onCreate",i),u=_(n,"onUpdate",i),l=_(n,"onSelectionUpdate",i),c=_(n,"onTransaction",i),d=_(n,"onFocus",i),f=_(n,"onBlur",i),h=_(n,"onDestroy",i);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),u&&this.editor.on("update",u),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}},a(Jn,"ExtensionManager"),Jn);bs.resolve=Bh;bs.sort=Bl;bs.flatten=Pl;var Uh={};Nl(Uh,{ClipboardTextSerializer:a(()=>Wh,"ClipboardTextSerializer"),Commands:a(()=>Kh,"Commands"),Delete:a(()=>Jh,"Delete"),Drop:a(()=>Gh,"Drop"),Editable:a(()=>Zh,"Editable"),FocusEvents:a(()=>Yh,"FocusEvents"),Keymap:a(()=>Qh,"Keymap"),Paste:a(()=>ep,"Paste"),Tabindex:a(()=>tp,"Tabindex"),TextDirection:a(()=>np,"TextDirection"),focusEventsPluginKey:a(()=>Xh,"focusEventsPluginKey")});var kn,J=(kn=class extends Vl{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new kn(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},a(kn,"_Extension"),kn),Wh=J.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new V({key:new q("clipboardTextSerializer"),props:{clipboardTextSerializer:a(()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(d=>d.$from.pos)),u=Math.max(...o.map(d=>d.$to.pos)),l=zl(n);return zh(r,{from:s,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})},"clipboardTextSerializer")}})]}}),Kh=J.create({name:"commands",addCommands(){return{...Dh}}}),Jh=J.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const o=a(()=>{var s,u,l,c;if((c=(l=(u=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:u.filterTransaction)==null?void 0:l.call(u,t))!=null?c:t.getMeta("y-sync$"))return;const d=Fh(t.before,[t,...e]);Vh(d).forEach(p=>{d.mapping.mapResult(p.oldRange.from).deletedAfter&&d.mapping.mapResult(p.oldRange.to).deletedBefore&&d.before.nodesBetween(p.oldRange.from,p.oldRange.to,(m,g)=>{const b=g+m.nodeSize-2,y=p.oldRange.from<=g&&b<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:b,newFrom:d.mapping.map(g),newTo:d.mapping.map(b),deletedRange:p.oldRange,newRange:p.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:d})})});const h=d.mapping;d.steps.forEach((p,m)=>{var g,b;if(p instanceof jt){const y=h.slice(m).map(p.from,-1),x=h.slice(m).map(p.to),k=h.invert().map(y,-1),C=h.invert().map(x),w=(g=d.doc.nodeAt(y-1))==null?void 0:g.marks.some(v=>v.eq(p.mark)),S=(b=d.doc.nodeAt(x))==null?void 0:b.marks.some(v=>v.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:k,to:C},newRange:{from:y,to:x},partial:!!(S||w),editor:this.editor,transaction:t,combinedTransform:d})}})},"callback");(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),Gh=J.create({name:"drop",addProseMirrorPlugins(){return[new V({key:new q("tiptapDrop"),props:{handleDrop:a((t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})},"handleDrop")}})]}}),Zh=J.create({name:"editable",addProseMirrorPlugins(){return[new V({key:new q("editable"),props:{editable:a(()=>this.editor.options.editable,"editable")}})]}}),Xh=new q("focusEvents"),Yh=J.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new V({key:Xh,props:{handleDOMEvents:{focus:a((e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},"focus"),blur:a((e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},"blur")}}})]}}),Qh=J.create({name:"keymap",addKeyboardShortcuts(){const t=a(()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:u})=>{const{selection:l,doc:c}=u,{empty:d,$anchor:f}=l,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?u.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=g&&m.parent.childCount===1?b===f.pos:R.atStart(c).from===h;return!d||!p.type.isTextblock||p.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),"handleBackspace"),e=a(()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),"handleDelete"),r={Enter:a(()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"handleEnter"),"Mod-Enter":a(()=>this.editor.commands.exitCode(),"Mod-Enter"),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":a(()=>this.editor.commands.selectAll(),"Mod-a")},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":a(()=>this.editor.commands.selectTextblockStart(),"Ctrl-a"),"Ctrl-e":a(()=>this.editor.commands.selectTextblockEnd(),"Ctrl-e")};return Ll()||Ih()?o:i},addProseMirrorPlugins(){return[new V({key:new q("clearDocument"),appendTransaction:a((t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:u}=e.selection,l=R.atStart(e.doc).from,c=R.atEnd(e.doc).to;if(o||!(s===l&&u===c)||!ms(n.doc))return;const h=n.tr,p=fs({state:n,transaction:h}),{commands:m}=new hs({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h},"appendTransaction")})]}}),ep=J.create({name:"paste",addProseMirrorPlugins(){return[new V({key:new q("tiptapPaste"),props:{handlePaste:a((t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})},"handlePaste")}})]}}),tp=J.create({name:"tabindex",addProseMirrorPlugins(){return[new V({key:new q("tabindex"),props:{attributes:a(()=>this.editor.isEditable?{tabindex:"0"}:{},"attributes")}})]}}),np=J.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=fr(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:a(e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},"parseHTML"),renderHTML:a(e=>e.dir?{dir:e.dir}:{},"renderHTML")}}}]},addProseMirrorPlugins(){return[new V({key:new q("textDirection"),props:{attributes:a(()=>{const t=this.options.direction;return t?{dir:t}:{}},"attributes")}})]}}),Pe,d2=(Pe=class{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Pe(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Pe(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 Pe(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(s);if(!i&&u.depth<=this.depth)return;const l=new Pe(u,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Pe(u,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let u=0;u<s.length;u+=1){const l=s[u];if(o[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},a(Pe,"_NodePos"),Pe),f2=`.ProseMirror {
|
|
14
|
-
position: relative;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.ProseMirror {
|
|
18
|
-
word-wrap: break-word;
|
|
19
|
-
white-space: pre-wrap;
|
|
20
|
-
white-space: break-spaces;
|
|
21
|
-
-webkit-font-variant-ligatures: none;
|
|
22
|
-
font-variant-ligatures: none;
|
|
23
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.ProseMirror [contenteditable="false"] {
|
|
27
|
-
white-space: normal;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
31
|
-
white-space: pre-wrap;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.ProseMirror pre {
|
|
35
|
-
white-space: pre-wrap;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
img.ProseMirror-separator {
|
|
39
|
-
display: inline !important;
|
|
40
|
-
border: none !important;
|
|
41
|
-
margin: 0 !important;
|
|
42
|
-
width: 0 !important;
|
|
43
|
-
height: 0 !important;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.ProseMirror-gapcursor {
|
|
47
|
-
display: none;
|
|
48
|
-
pointer-events: none;
|
|
49
|
-
position: absolute;
|
|
50
|
-
margin: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.ProseMirror-gapcursor:after {
|
|
54
|
-
content: "";
|
|
55
|
-
display: block;
|
|
56
|
-
position: absolute;
|
|
57
|
-
top: -2px;
|
|
58
|
-
width: 20px;
|
|
59
|
-
border-top: 1px solid black;
|
|
60
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@keyframes ProseMirror-cursor-blink {
|
|
64
|
-
to {
|
|
65
|
-
visibility: hidden;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.ProseMirror-hideselection *::selection {
|
|
70
|
-
background: transparent;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
74
|
-
background: transparent;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.ProseMirror-hideselection * {
|
|
78
|
-
caret-color: transparent;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
82
|
-
display: block;
|
|
83
|
-
}`;function h2(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}a(h2,"createStyleTag");var Gn,p2=(Gn=class extends t2{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:a(()=>null,"onBeforeCreate"),onCreate:a(()=>null,"onCreate"),onMount:a(()=>null,"onMount"),onUnmount:a(()=>null,"onUnmount"),onUpdate:a(()=>null,"onUpdate"),onSelectionUpdate:a(()=>null,"onSelectionUpdate"),onTransaction:a(()=>null,"onTransaction"),onFocus:a(()=>null,"onFocus"),onBlur:a(()=>null,"onBlur"),onDestroy:a(()=>null,"onDestroy"),onContentError:a(({error:i})=>{throw i},"onContentError"),onPaste:a(()=>null,"onPaste"),onDrop:a(()=>null,"onDrop"),onDelete:a(()=>null,"onDelete")},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:i,slice:o,moved:s})=>this.options.onDrop(i,o,s)),this.on("paste",({event:i,slice:o})=>this.options.onPaste(i,o)),this.on("delete",this.options.onDelete);const n=this.createDoc(),r=_h(n,this.options.autofocus);this.editorState=Cu.create({doc:n,schema:this.schema,selection:r||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=h2(f2,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:a(e=>{this.editorState=e},"updateState"),dispatch:a(e=>{this.dispatchTransaction(e)},"dispatch"),composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:a((e,n)=>{if(this.editorView)return this.editorView[n];if(n==="state")return this.editorState;if(n in e)return Reflect.get(e,n);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${n}']. The editor may not be mounted yet.`)},"get")})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,n){const r=Lh(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=r.filter(u=>!u.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[Zh,Wh.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:n.blockSeparator}),Kh,Yh,Qh,tp,Gh,ep,Jh,np.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new bs(i,this)}createCommandManager(){this.commandManager=new hs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Hu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(n){if(!(n instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(n.message))throw n;this.emit("contentError",{editor:this,error:n,disableCollaboration:a(()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()},"disableCollaboration")}),e=Hu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var n;this.editorView=new lo(e,{...this.options.editorProps,attributes:{role:"textbox",...(n=this.options.editorProps)==null?void 0:n.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.prependClass(),this.injectCSS();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(d=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(d)});return}const{state:n,transactions:r}=this.state.applyTransaction(e),i=!this.state.selection.eq(n.selection),o=r.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),!o)return;this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:r.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});const u=r.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=u?.getMeta("focus"),c=u?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:u}),c&&this.emit("blur",{editor:this,event:c.event,transaction:u}),!(e.getMeta("preventUpdate")||!r.some(d=>d.docChanged)||s.doc.eq(n.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:r.slice(1)})}getAttributes(e){return Hh(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return _b(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return pi(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
84
|
-
|
|
85
|
-
`,textSerializers:r={}}=e||{};return $h(this.state.doc,{blockSeparator:n,textSerializers:{...zl(this.schema),...r}})}get isEmpty(){return ms(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,n;return(n=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?n:!0}$node(e,n){var r;return((r=this.$doc)==null?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)==null?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new d2(n,this)}get $doc(){return this.$pos(0)}},a(Gn,"Editor"),Gn);function hr(t){return new gs({find:t.find,handler:a(({state:e,range:n,match:r})=>{const i=H(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],u=r[0];if(s){const l=u.search(/\S/),c=n.from+u.indexOf(s),d=c+s.length;if($l(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>c).length)return null;d<n.to&&o.delete(d,n.to),c>n.from&&o.delete(n.from+l,c);const h=n.from+l+s.length;o.addMark(n.from+l,h,t.type.create(i||{})),o.removeStoredMark(t.type)}},"handler"),undoable:t.undoable})}a(hr,"markInputRule");function m2(t){return new gs({find:t.find,handler:a(({state:e,range:n,match:r})=>{const i=H(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let u=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=s+c;d>u?d=u:u=d+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(d,u,l)}else if(r[0]){const c=t.type.isInline?s:s-1;o.insert(c,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(u))}o.scrollIntoView()},"handler"),undoable:t.undoable})}a(m2,"nodeInputRule");function ju(t){return new gs({find:t.find,handler:a(({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=H(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)},"handler"),undoable:t.undoable})}a(ju,"textblockTypeInputRule");function pr(t){return new gs({find:t.find,handler:a(({state:e,range:n,match:r,chain:i})=>{const o=H(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&bl(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(b=>p.includes(b.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Gt(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&s.join(n.from-1)},"handler"),undoable:t.undoable})}a(pr,"wrappingInputRule");function g2(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof I){const o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let i=r.depth;for(;i>=0;){const o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(e))return!0;i-=1}return!1}a(g2,"canInsertNode");var b2={};Nl(b2,{createAtomBlockMarkdownSpec:a(()=>y2,"createAtomBlockMarkdownSpec"),createBlockMarkdownSpec:a(()=>x2,"createBlockMarkdownSpec"),createInlineMarkdownSpec:a(()=>C2,"createInlineMarkdownSpec"),parseAttributes:a(()=>jl,"parseAttributes"),parseIndentedBlocks:a(()=>qu,"parseIndentedBlocks"),renderNestedMarkdownContent:a(()=>Ul,"renderNestedMarkdownContent"),serializeAttributes:a(()=>ql,"serializeAttributes")});function jl(t){if(!t?.trim())return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const c=i.map(d=>d.trim().slice(1));e.class=c.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(e.id=o[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,c,d])=>{var f;const h=parseInt(((f=d.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),p=n[h];p&&(e[c]=p.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}a(jl,"parseAttributes");function ql(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}a(ql,"serializeAttributes");function y2(t){const{nodeName:e,name:n,parseAttributes:r=jl,serializeAttributes:i=ql,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:u}=t,l=n||e,c=a(d=>{if(!u)return d;const f={};return u.forEach(h=>{h in d&&(f[h]=d[h])}),f},"filterAttributes");return{parseMarkdown:a((d,f)=>{const h={...o,...d.attributes};return f.createNode(e,h,[])},"parseMarkdown"),markdownTokenizer:{name:e,level:"block",start(d){var f;const h=new RegExp(`^:::${l}(?:\\s|$)`,"m"),p=(f=d.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(d,f,h){const p=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=d.match(p);if(!m)return;const g=m[1]||"",b=r(g);if(!s.find(x=>!(x in b)))return{type:e,raw:m[0],attributes:b}}},renderMarkdown:a(d=>{const f=c(d.attrs||{}),h=i(f),p=h?` {${h}}`:"";return`:::${l}${p} :::`},"renderMarkdown")}}a(y2,"createAtomBlockMarkdownSpec");function x2(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=jl,serializeAttributes:o=ql,defaultAttributes:s={},content:u="block",allowedAttributes:l}=t,c=n||e,d=a(f=>{if(!l)return f;const h={};return l.forEach(p=>{p in f&&(h[p]=f[p])}),h},"filterAttributes");return{parseMarkdown:a((f,h)=>{let p;if(r){const g=r(f);p=typeof g=="string"?[{type:"text",text:g}]:g}else u==="block"?p=h.parseChildren(f.tokens||[]):p=h.parseInline(f.tokens||[]);const m={...s,...f.attributes};return h.createNode(e,m,p)},"parseMarkdown"),markdownTokenizer:{name:e,level:"block",start(f){var h;const p=new RegExp(`^:::${c}`,"m"),m=(h=f.match(p))==null?void 0:h.index;return m!==void 0?m:-1},tokenize(f,h,p){var m;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=f.match(g);if(!b)return;const[y,x=""]=b,k=i(x);let C=1;const w=y.length;let S="";const v=/^:::([\w-]*)(\s.*)?/gm,D=f.slice(w);for(v.lastIndex=0;;){const O=v.exec(D);if(O===null)break;const N=O.index,$=O[1];if(!((m=O[2])!=null&&m.endsWith(":::"))){if($)C+=1;else if(C-=1,C===0){const U=D.slice(0,N);S=U.trim();const G=f.slice(0,w+N+O[0].length);let P=[];if(S)if(u==="block")for(P=p.blockTokens(U),P.forEach(B=>{B.text&&(!B.tokens||B.tokens.length===0)&&(B.tokens=p.inlineTokens(B.text))});P.length>0;){const B=P[P.length-1];if(B.type==="paragraph"&&(!B.text||B.text.trim()===""))P.pop();else break}else P=p.inlineTokens(S);return{type:e,raw:G,attributes:k,content:S,tokens:P}}}}}},renderMarkdown:a((f,h)=>{const p=d(f.attrs||{}),m=o(p),g=m?` {${m}}`:"",b=h.renderChildren(f.content||[],`
|
|
86
|
-
|
|
87
|
-
`);return`:::${c}${g}
|
|
88
|
-
|
|
89
|
-
${b}
|
|
90
|
-
|
|
91
|
-
:::`},"renderMarkdown")}}a(x2,"createBlockMarkdownSpec");function k2(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,o,s]=r;e[i]=o||s,r=n.exec(t)}return e}a(k2,"parseShortcodeAttributes");function w2(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}a(w2,"serializeShortcodeAttributes");function C2(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=k2,serializeAttributes:o=w2,defaultAttributes:s={},selfClosing:u=!1,allowedAttributes:l}=t,c=n||e,d=a(h=>{if(!l)return h;const p={};return l.forEach(m=>{m in h&&(p[m]=h[m])}),p},"filterAttributes"),f=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:a((h,p)=>{const m={...s,...h.attributes};if(u)return p.createNode(e,m);const g=r?r(h):h.content||"";return g?p.createNode(e,m,[p.createTextNode(g)]):p.createNode(e,m,[])},"parseMarkdown"),markdownTokenizer:{name:e,level:"inline",start(h){const p=u?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),m=h.match(p),g=m?.index;return g!==void 0?g:-1},tokenize(h,p,m){const g=u?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),b=h.match(g);if(!b)return;let y="",x="";if(u){const[,C]=b;x=C}else{const[,C,w]=b;x=C,y=w||""}const k=i(x.trim());return{type:e,raw:b[0],content:y.trim(),attributes:k}}},renderMarkdown:a(h=>{let p="";r?p=r(h):h.content&&h.content.length>0&&(p=h.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const m=d(h.attrs||{}),g=o(m),b=g?` ${g}`:"";return u?`[${c}${b}]`:`[${c}${b}]${p}[/${c}]`},"renderMarkdown")}}a(C2,"createInlineMarkdownSpec");function qu(t,e,n){var r,i,o,s;const u=t.split(`
|
|
92
|
-
`),l=[];let c="",d=0;const f=e.baseIndentSize||2;for(;d<u.length;){const h=u[d],p=h.match(e.itemPattern);if(!p){if(l.length>0)break;if(h.trim()===""){d+=1,c=`${c}${h}
|
|
93
|
-
`;continue}else return}const m=e.extractItemData(p),{indentLevel:g,mainContent:b}=m;c=`${c}${h}
|
|
94
|
-
`;const y=[b];for(d+=1;d<u.length;){const w=u[d];if(w.trim()===""){const v=u.slice(d+1).findIndex(N=>N.trim()!=="");if(v===-1)break;if((((i=(r=u[d+1+v].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>g){y.push(w),c=`${c}${w}
|
|
95
|
-
`,d+=1;continue}else break}if((((s=(o=w.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:s.length)||0)>g)y.push(w),c=`${c}${w}
|
|
96
|
-
`,d+=1;else break}let x;const k=y.slice(1);if(k.length>0){const w=k.map(S=>S.slice(g+f)).join(`
|
|
97
|
-
`);w.trim()&&(e.customNestedParser?x=e.customNestedParser(w):x=n.blockTokens(w))}const C=e.createToken(m,x);l.push(C)}if(l.length!==0)return{items:l,raw:c}}a(qu,"parseIndentedBlocks");function Ul(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[o,...s]=t.content,u=e.renderChildren([o]),l=[`${i}${u}`];return s&&s.length>0&&s.forEach(c=>{const d=e.renderChildren([c]);if(d){const f=d.split(`
|
|
98
|
-
`).map(h=>h?e.indent(h):"").join(`
|
|
99
|
-
`);l.push(f)}}),l.join(`
|
|
100
|
-
`)}a(Ul,"renderNestedMarkdownContent");function E2(t,e,n={}){const{state:r}=e,{doc:i,tr:o}=r,s=t;i.descendants((u,l)=>{const c=o.mapping.map(l),d=o.mapping.map(l)+u.nodeSize;let f=null;if(u.marks.forEach(p=>{if(p!==s)return!1;f=p}),!f)return;let h=!1;if(Object.keys(n).forEach(p=>{n[p]!==f.attrs[p]&&(h=!0)}),h){const p=t.type.create({...t.attrs,...n});o.removeMark(c,d,t.type),o.addMark(c,d,p)}}),o.docChanged&&e.view.dispatch(o)}a(E2,"updateMarkViewAttributes");var wn,j=(wn=class extends Vl{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new wn(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},a(wn,"_Node"),wn);function Mn(t){return new s2({find:t.find,handler:a(({state:e,range:n,match:r,pasteEvent:i})=>{const o=H(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,u=r[r.length-1],l=r[0];let c=n.to;if(u){const d=l.search(/\S/),f=n.from+l.indexOf(u),h=f+u.length;if($l(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(b=>b===t.type&&b!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+d,f),c=n.from+d+u.length,s.addMark(n.from+d,c,t.type.create(o||{})),s.removeStoredMark(t.type)}},"handler")})}a(Mn,"markPasteRule");var ho=a((t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},"h"),S2=/^\s*>\s$/,v2=j.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return ho("blockquote",{...Q(this.options.HTMLAttributes,t),children:ho("slot",{})})},parseMarkdown:a((t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
|
|
101
|
-
`).map(l=>l.trim()===""?n:`${n} ${l}`);r.push(u.join(`
|
|
102
|
-
`))}),r.join(`
|
|
103
|
-
${n}
|
|
104
|
-
`)},"renderMarkdown"),addCommands(){return{setBlockquote:a(()=>({commands:t})=>t.wrapIn(this.name),"setBlockquote"),toggleBlockquote:a(()=>({commands:t})=>t.toggleWrap(this.name),"toggleBlockquote"),unsetBlockquote:a(()=>({commands:t})=>t.lift(this.name),"unsetBlockquote")}},addKeyboardShortcuts(){return{"Mod-Shift-b":a(()=>this.editor.commands.toggleBlockquote(),"Mod-Shift-b")}},addInputRules(){return[pr({find:S2,type:this.type})]}}),A2=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,M2=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,T2=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,D2=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,O2=Te.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:a(t=>t.style.fontWeight!=="normal"&&null,"getAttrs")},{style:"font-weight=400",clearMark:a(t=>t.type.name===this.name,"clearMark")},{style:"font-weight",getAttrs:a(t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null,"getAttrs")}]},renderHTML({HTMLAttributes:t}){return ho("strong",{...Q(this.options.HTMLAttributes,t),children:ho("slot",{})})},markdownTokenName:"strong",parseMarkdown:a((t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>`**${e.renderChildren(t)}**`,"renderMarkdown"),addCommands(){return{setBold:a(()=>({commands:t})=>t.setMark(this.name),"setBold"),toggleBold:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleBold"),unsetBold:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetBold")}},addKeyboardShortcuts(){return{"Mod-b":a(()=>this.editor.commands.toggleBold(),"Mod-b"),"Mod-B":a(()=>this.editor.commands.toggleBold(),"Mod-B")}},addInputRules(){return[hr({find:A2,type:this.type}),hr({find:T2,type:this.type})]},addPasteRules(){return[Mn({find:M2,type:this.type}),Mn({find:D2,type:this.type})]}}),_2=/(^|[^`])`([^`]+)`(?!`)$/,N2=/(^|[^`])`([^`]+)`(?!`)/g,I2=Te.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:a((t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),"parseMarkdown"),renderMarkdown:a((t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"","renderMarkdown"),addCommands(){return{setCode:a(()=>({commands:t})=>t.setMark(this.name),"setCode"),toggleCode:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleCode"),unsetCode:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetCode")}},addKeyboardShortcuts(){return{"Mod-e":a(()=>this.editor.commands.toggleCode(),"Mod-e")}},addInputRules(){return[hr({find:_2,type:this.type})]},addPasteRules(){return[Mn({find:N2,type:this.type})]}}),Us=4,R2=/^```([a-z]+)?[\s\n]$/,F2=/^~~~([a-z]+)?[\s\n]$/,L2=j.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Us,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:a(t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const o=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},"parseHTML"),rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Q(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:a((t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},"parseMarkdown"),renderMarkdown:a((t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
|
|
105
|
-
`):r=`\`\`\`${i}
|
|
106
|
-
|
|
107
|
-
\`\`\``,r},"renderMarkdown"),addCommands(){return{setCodeBlock:a(t=>({commands:e})=>e.setNode(this.name,t),"setCodeBlock"),toggleCodeBlock:a(t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t),"toggleCodeBlock")}},addKeyboardShortcuts(){return{"Mod-Alt-c":a(()=>this.editor.commands.toggleCodeBlock(),"Mod-Alt-c"),Backspace:a(()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},"Backspace"),Tab:a(({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Us,{state:r}=t,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;const u=" ".repeat(n);return s?t.commands.insertContent(u):t.commands.command(({tr:l})=>{const{from:c,to:d}=i,p=r.doc.textBetween(c,d,`
|
|
108
|
-
`,`
|
|
109
|
-
`).split(`
|
|
110
|
-
`).map(m=>u+m).join(`
|
|
111
|
-
`);return l.replaceWith(c,d,r.schema.text(p)),!0})},"Tab"),"Shift-Tab":a(({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Us,{state:r}=t,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type!==this.type?!1:s?t.commands.command(({tr:u})=>{var l;const{pos:c}=o,d=o.start(),f=o.end(),p=r.doc.textBetween(d,f,`
|
|
112
|
-
`,`
|
|
113
|
-
`).split(`
|
|
114
|
-
`);let m=0,g=0;const b=c-d;for(let S=0;S<p.length;S+=1){if(g+p[S].length>=b){m=S;break}g+=p[S].length+1}const x=((l=p[m].match(/^ */))==null?void 0:l[0])||"",k=Math.min(x.length,n);if(k===0)return!0;let C=d;for(let S=0;S<m;S+=1)C+=p[S].length+1;return u.delete(C,C+k),c-C<=k&&u.setSelection(F.create(u.doc,C)),!0}):t.commands.command(({tr:u})=>{const{from:l,to:c}=i,h=r.doc.textBetween(l,c,`
|
|
115
|
-
`,`
|
|
116
|
-
`).split(`
|
|
117
|
-
`).map(p=>{var m;const g=((m=p.match(/^ */))==null?void 0:m[0])||"",b=Math.min(g.length,n);return p.slice(b)}).join(`
|
|
118
|
-
`);return u.replaceWith(l,c,r.schema.text(h)),!0})},"Shift-Tab"),Enter:a(({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
119
|
-
|
|
120
|
-
`);return!o||!s?!1:t.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},"Enter"),ArrowDown:a(({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const u=i.after();return u===void 0?!1:r.nodeAt(u)?t.commands.command(({tr:c})=>(c.setSelection(R.near(r.resolve(u))),!0)):t.commands.exitCode()},"ArrowDown")}},addInputRules(){return[ju({find:R2,type:this.type,getAttributes:a(t=>({language:t[1]}),"getAttributes")}),ju({find:F2,type:this.type,getAttributes:a(t=>({language:t[1]}),"getAttributes")})]},addProseMirrorPlugins(){return[new V({key:new q("codeBlockVSCodeHandler"),props:{handlePaste:a((t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!n||!o)return!1;const{tr:s,schema:u}=t.state,l=u.text(n.replace(/\r\n?/g,`
|
|
121
|
-
`));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(F.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0},"handlePaste")}})]}}),P2=j.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:a((t,e)=>t.content?e.renderChildren(t.content,`
|
|
122
|
-
|
|
123
|
-
`):"","renderMarkdown")}),B2=j.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Q(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
124
|
-
`},renderMarkdown:a(()=>`
|
|
125
|
-
`,"renderMarkdown"),parseMarkdown:a(()=>({type:"hardBreak"}),"parseMarkdown"),addCommands(){return{setHardBreak:a(()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:u}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){const f=l.filter(h=>u.includes(h.type.name));c.ensureMarks(f)}return!0}).run()})]),"setHardBreak")}},addKeyboardShortcuts(){return{"Mod-Enter":a(()=>this.editor.commands.setHardBreak(),"Mod-Enter"),"Shift-Enter":a(()=>this.editor.commands.setHardBreak(),"Shift-Enter")}}}),z2=j.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Q(this.options.HTMLAttributes,e),0]},parseMarkdown:a((t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},"renderMarkdown"),addCommands(){return{setHeading:a(t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,"setHeading"),toggleHeading:a(t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1,"toggleHeading")}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>ju({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),$2=j.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Q(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:a((t,e)=>e.createNode("horizontalRule"),"parseMarkdown"),renderMarkdown:a(()=>"---","renderMarkdown"),addCommands(){return{setHorizontalRule:a(()=>({chain:t,state:e})=>{if(!g2(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return jh(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:o,tr:s,dispatch:u})=>{if(u){const{$to:l}=s.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(F.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(I.create(s.doc,l.pos)):s.setSelection(F.create(s.doc,l.pos));else{const d=o.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,f=d?.create();f&&(s.insert(c,f),s.setSelection(F.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()},"setHorizontalRule")}},addInputRules(){return[m2({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),H2=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,V2=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,j2=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,q2=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,U2=Te.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:a(t=>t.style.fontStyle!=="normal"&&null,"getAttrs")},{style:"font-style=normal",clearMark:a(t=>t.type.name===this.name,"clearMark")},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:a(()=>({commands:t})=>t.setMark(this.name),"setItalic"),toggleItalic:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleItalic"),unsetItalic:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetItalic")}},markdownTokenName:"em",parseMarkdown:a((t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>`*${e.renderChildren(t)}*`,"renderMarkdown"),addKeyboardShortcuts(){return{"Mod-i":a(()=>this.editor.commands.toggleItalic(),"Mod-i"),"Mod-I":a(()=>this.editor.commands.toggleItalic(),"Mod-I")}},addInputRules(){return[hr({find:H2,type:this.type}),hr({find:j2,type:this.type})]},addPasteRules(){return[Mn({find:V2,type:this.type}),Mn({find:q2,type:this.type})]}});const W2="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",K2="ελ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",Uu="numeric",Wu="ascii",Ku="alpha",Fr="asciinumeric",Dr="alphanumeric",Ju="domain",rp="emoji",J2="scheme",G2="slashscheme",Ws="whitespace";function Z2(t,e){return t in e||(e[t]=[]),e[t]}a(Z2,"registerGroup");function dn(t,e,n){e[Uu]&&(e[Fr]=!0,e[Dr]=!0),e[Wu]&&(e[Fr]=!0,e[Ku]=!0),e[Fr]&&(e[Dr]=!0),e[Ku]&&(e[Dr]=!0),e[Dr]&&(e[Ju]=!0),e[rp]&&(e[Ju]=!0);for(const r in e){const i=Z2(r,n);i.indexOf(t)<0&&i.push(t)}}a(dn,"addToGroups");function X2(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}a(X2,"flagsForToken");function ke(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}a(ke,"State");ke.groups={};ke.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||ke.groups;let i;return e&&e.j?i=e:(i=new ke(e),n&&r&&dn(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||ke.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,u=i.go(t);if(u?(s=new ke,Object.assign(s.j,u.j),s.jr.push.apply(s.jr,u.jr),s.jd=u.jd,s.t=u.t):s=new ke,o){if(r)if(s.t&&typeof s.t=="string"){const l=Object.assign(X2(s.t,r),n);dn(o,l,r)}else n&&dn(o,n,r);s.t=o}return i.j[t]=s,s}};const L=a((t,e,n,r,i)=>t.ta(e,n,r,i),"ta"),Z=a((t,e,n,r,i)=>t.tr(e,n,r,i),"tr"),ld=a((t,e,n,r,i)=>t.ts(e,n,r,i),"ts"),A=a((t,e,n,r,i)=>t.tt(e,n,r,i),"tt"),ct="WORD",Gu="UWORD",ip="ASCIINUMERICAL",op="ALPHANUMERICAL",ii="LOCALHOST",Zu="TLD",Xu="UTLD",Bi="SCHEME",Rn="SLASH_SCHEME",Wl="NUM",Yu="WS",Kl="NL",Lr="OPENBRACE",Pr="CLOSEBRACE",po="OPENBRACKET",mo="CLOSEBRACKET",go="OPENPAREN",bo="CLOSEPAREN",yo="OPENANGLEBRACKET",xo="CLOSEANGLEBRACKET",ko="FULLWIDTHLEFTPAREN",wo="FULLWIDTHRIGHTPAREN",Co="LEFTCORNERBRACKET",Eo="RIGHTCORNERBRACKET",So="LEFTWHITECORNERBRACKET",vo="RIGHTWHITECORNERBRACKET",Ao="FULLWIDTHLESSTHAN",Mo="FULLWIDTHGREATERTHAN",To="AMPERSAND",Do="APOSTROPHE",Oo="ASTERISK",At="AT",_o="BACKSLASH",No="BACKTICK",Io="CARET",Nt="COLON",Jl="COMMA",Ro="DOLLAR",je="DOT",Fo="EQUALS",Gl="EXCLAMATION",Oe="HYPHEN",Br="PERCENT",Lo="PIPE",Po="PLUS",Bo="POUND",zr="QUERY",Zl="QUOTE",sp="FULLWIDTHMIDDLEDOT",Xl="SEMI",qe="SLASH",$r="TILDE",zo="UNDERSCORE",up="EMOJI",$o="SYM";var lp=Object.freeze({__proto__:null,ALPHANUMERICAL:op,AMPERSAND:To,APOSTROPHE:Do,ASCIINUMERICAL:ip,ASTERISK:Oo,AT:At,BACKSLASH:_o,BACKTICK:No,CARET:Io,CLOSEANGLEBRACKET:xo,CLOSEBRACE:Pr,CLOSEBRACKET:mo,CLOSEPAREN:bo,COLON:Nt,COMMA:Jl,DOLLAR:Ro,DOT:je,EMOJI:up,EQUALS:Fo,EXCLAMATION:Gl,FULLWIDTHGREATERTHAN:Mo,FULLWIDTHLEFTPAREN:ko,FULLWIDTHLESSTHAN:Ao,FULLWIDTHMIDDLEDOT:sp,FULLWIDTHRIGHTPAREN:wo,HYPHEN:Oe,LEFTCORNERBRACKET:Co,LEFTWHITECORNERBRACKET:So,LOCALHOST:ii,NL:Kl,NUM:Wl,OPENANGLEBRACKET:yo,OPENBRACE:Lr,OPENBRACKET:po,OPENPAREN:go,PERCENT:Br,PIPE:Lo,PLUS:Po,POUND:Bo,QUERY:zr,QUOTE:Zl,RIGHTCORNERBRACKET:Eo,RIGHTWHITECORNERBRACKET:vo,SCHEME:Bi,SEMI:Xl,SLASH:qe,SLASH_SCHEME:Rn,SYM:$o,TILDE:$r,TLD:Zu,UNDERSCORE:zo,UTLD:Xu,UWORD:Gu,WORD:ct,WS:Yu});const lt=/[a-z]/,vr=new RegExp("\\p{L}","u"),Ks=new RegExp("\\p{Emoji}","u"),at=/\d/,Js=/\s/,ad="\r",Gs=`
|
|
126
|
-
`,Y2="️",Q2="",Zs="";let Ai=null,Mi=null;function ey(t=[]){const e={};ke.groups=e;const n=new ke;Ai==null&&(Ai=cd(W2)),Mi==null&&(Mi=cd(K2)),A(n,"'",Do),A(n,"{",Lr),A(n,"}",Pr),A(n,"[",po),A(n,"]",mo),A(n,"(",go),A(n,")",bo),A(n,"<",yo),A(n,">",xo),A(n,"(",ko),A(n,")",wo),A(n,"「",Co),A(n,"」",Eo),A(n,"『",So),A(n,"』",vo),A(n,"<",Ao),A(n,">",Mo),A(n,"&",To),A(n,"*",Oo),A(n,"@",At),A(n,"`",No),A(n,"^",Io),A(n,":",Nt),A(n,",",Jl),A(n,"$",Ro),A(n,".",je),A(n,"=",Fo),A(n,"!",Gl),A(n,"-",Oe),A(n,"%",Br),A(n,"|",Lo),A(n,"+",Po),A(n,"#",Bo),A(n,"?",zr),A(n,'"',Zl),A(n,"/",qe),A(n,";",Xl),A(n,"~",$r),A(n,"_",zo),A(n,"\\",_o),A(n,"・",sp);const r=Z(n,at,Wl,{[Uu]:!0});Z(r,at,r);const i=Z(r,lt,ip,{[Fr]:!0}),o=Z(r,vr,op,{[Dr]:!0}),s=Z(n,lt,ct,{[Wu]:!0});Z(s,at,i),Z(s,lt,s),Z(i,at,i),Z(i,lt,i);const u=Z(n,vr,Gu,{[Ku]:!0});Z(u,lt),Z(u,at,o),Z(u,vr,u),Z(o,at,o),Z(o,lt),Z(o,vr,o);const l=A(n,Gs,Kl,{[Ws]:!0}),c=A(n,ad,Yu,{[Ws]:!0}),d=Z(n,Js,Yu,{[Ws]:!0});A(n,Zs,d),A(c,Gs,l),A(c,Zs,d),Z(c,Js,d),A(d,ad),A(d,Gs),Z(d,Js,d),A(d,Zs,d);const f=Z(n,Ks,up,{[rp]:!0});A(f,"#"),Z(f,Ks,f),A(f,Y2,f);const h=A(f,Q2);A(h,"#"),Z(h,Ks,f);const p=[[lt,s],[at,i]],m=[[lt,null],[vr,u],[at,o]];for(let g=0;g<Ai.length;g++)Et(n,Ai[g],Zu,ct,p);for(let g=0;g<Mi.length;g++)Et(n,Mi[g],Xu,Gu,m);dn(Zu,{tld:!0,ascii:!0},e),dn(Xu,{utld:!0,alpha:!0},e),Et(n,"file",Bi,ct,p),Et(n,"mailto",Bi,ct,p),Et(n,"http",Rn,ct,p),Et(n,"https",Rn,ct,p),Et(n,"ftp",Rn,ct,p),Et(n,"ftps",Rn,ct,p),dn(Bi,{scheme:!0,ascii:!0},e),dn(Rn,{slashscheme:!0,ascii:!0},e),t=t.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<t.length;g++){const b=t[g][0],x=t[g][1]?{[J2]:!0}:{[G2]:!0};b.indexOf("-")>=0?x[Ju]=!0:lt.test(b)?at.test(b)?x[Fr]=!0:x[Wu]=!0:x[Uu]=!0,ld(n,b,b,x)}return ld(n,"localhost",ii,{ascii:!0}),n.jd=new ke($o),{start:n,tokens:Object.assign({groups:e},lp)}}a(ey,"init$2");function ap(t,e){const n=ty(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let u=t,l=null,c=0,d=null,f=-1,h=-1;for(;s<r&&(l=u.go(n[s]));)u=l,u.accepts()?(f=0,h=0,d=u):f>=0&&(f+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=f,s-=h,c-=f,i.push({t:d.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}a(ap,"run$1");function ty(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}a(ty,"stringToArray");function Et(t,e,n,r,i){let o;const s=e.length;for(let u=0;u<s-1;u++){const l=e[u];t.j[l]?o=t.j[l]:(o=new ke(r),o.jr=i.slice(),t.j[l]=o),t=o}return o=new ke(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}a(Et,"fastts");function cd(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let o=0;for(;i.indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}a(cd,"decodeTlds");const oi={defaultProtocol:"http",events:null,format:dd,formatHref:dd,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Yl(t,e=null){let n=Object.assign({},oi);t&&(n=Object.assign(n,t instanceof Yl?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}a(Yl,"Options");Yl.prototype={o:oi,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:oi[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function dd(t){return t}a(dd,"noop");function cp(t,e){this.t="token",this.v=t,this.tk=e}a(cp,"MultiToken");cp.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=oi.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},u=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return s.href=r,u&&(s.class=u),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:i,attributes:s,content:o,eventListeners:f}}};function ys(t,e){const r=class r extends cp{constructor(o,s){super(o,s),this.t=t}};a(r,"Token");let n=r;for(const i in e)n.prototype[i]=e[i];return n.t=t,n}a(ys,"createTokenClass");const fd=ys("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),hd=ys("text"),ny=ys("nl"),Ti=ys("url",{isLink:!0,toHref(t=oi.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ii&&t[1].t===Nt}}),De=a(t=>new ke(t),"makeState");function ry({groups:t}){const e=t.domain.concat([To,Oo,At,_o,No,Io,Ro,Fo,Oe,Wl,Br,Lo,Po,Bo,qe,$o,$r,zo]),n=[Do,Nt,Jl,je,Gl,Br,zr,Zl,Xl,yo,xo,Lr,Pr,mo,po,go,bo,ko,wo,Co,Eo,So,vo,Ao,Mo],r=[To,Do,Oo,_o,No,Io,Ro,Fo,Oe,Lr,Pr,Br,Lo,Po,Bo,zr,qe,$o,$r,zo],i=De(),o=A(i,$r);L(o,r,o),L(o,t.domain,o);const s=De(),u=De(),l=De();L(i,t.domain,s),L(i,t.scheme,u),L(i,t.slashscheme,l),L(s,r,o),L(s,t.domain,s);const c=A(s,At);A(o,At,c),A(u,At,c),A(l,At,c);const d=A(o,je);L(d,r,o),L(d,t.domain,o);const f=De();L(c,t.domain,f),L(f,t.domain,f);const h=A(f,je);L(h,t.domain,f);const p=De(fd);L(h,t.tld,p),L(h,t.utld,p),A(c,ii,p);const m=A(f,Oe);A(m,Oe,m),L(m,t.domain,f),L(p,t.domain,f),A(p,je,h),A(p,Oe,m);const g=A(p,Nt);L(g,t.numeric,fd);const b=A(s,Oe),y=A(s,je);A(b,Oe,b),L(b,t.domain,s),L(y,r,o),L(y,t.domain,s);const x=De(Ti);L(y,t.tld,x),L(y,t.utld,x),L(x,t.domain,s),L(x,r,o),A(x,je,y),A(x,Oe,b),A(x,At,c);const k=A(x,Nt),C=De(Ti);L(k,t.numeric,C);const w=De(Ti),S=De();L(w,e,w),L(w,n,S),L(S,e,w),L(S,n,S),A(x,qe,w),A(C,qe,w);const v=A(u,Nt),D=A(l,Nt),O=A(D,qe),N=A(O,qe);L(u,t.domain,s),A(u,je,y),A(u,Oe,b),L(l,t.domain,s),A(l,je,y),A(l,Oe,b),L(v,t.domain,w),A(v,qe,w),A(v,zr,w),L(N,t.domain,w),L(N,e,w),A(N,qe,w);const $=[[Lr,Pr],[po,mo],[go,bo],[yo,xo],[ko,wo],[Co,Eo],[So,vo],[Ao,Mo]];for(let U=0;U<$.length;U++){const[G,P]=$[U],B=A(w,G);A(S,G,B),A(B,P,w);const X=De(Ti);L(B,e,X);const ee=De();L(B,n),L(X,e,X),L(X,n,ee),L(ee,e,X),L(ee,n,ee),A(X,P,w),A(ee,P,w)}return A(i,ii,x),A(i,Kl,ny),{start:i,tokens:lp}}a(ry,"init$1");function iy(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let u=t,l=null,c=null,d=0,f=null,h=-1;for(;i<r&&!(l=u.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||u.go(n[i].t));)l=null,u=c,u.accepts()?(h=0,f=u):h>=0&&h++,i++,d++;if(h<0)i-=d,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(Xs(hd,e,s)),s=[]),i-=h,d-=h;const p=f.t,m=n.slice(i-d,i);o.push(Xs(p,e,m))}}return s.length>0&&o.push(Xs(hd,e,s)),o}a(iy,"run");function Xs(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}a(Xs,"initMultiToken");const oy=typeof console<"u"&&console&&console.warn||(()=>{}),sy="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",K={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function uy(){return ke.groups={},K.scanner=null,K.parser=null,K.tokenQueue=[],K.pluginQueue=[],K.customSchemes=[],K.initialized=!1,K}a(uy,"reset");function pd(t,e=!1){if(K.initialized&&oy(`linkifyjs: already initialized - will not register custom scheme "${t}" ${sy}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
127
|
-
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
128
|
-
2. Cannot start or end with "-"
|
|
129
|
-
3. "-" cannot repeat`);K.customSchemes.push([t,e])}a(pd,"registerCustomProtocol");function ly(){K.scanner=ey(K.customSchemes);for(let t=0;t<K.tokenQueue.length;t++)K.tokenQueue[t][1]({scanner:K.scanner});K.parser=ry(K.scanner.tokens);for(let t=0;t<K.pluginQueue.length;t++)K.pluginQueue[t][1]({scanner:K.scanner,parser:K.parser});return K.initialized=!0,K}a(ly,"init");function Ql(t){return K.initialized||ly(),iy(K.parser.start,t,ap(K.scanner.start,t))}a(Ql,"tokenize");Ql.scan=ap;function dp(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Yl(n),i=Ql(t),o=[];for(let s=0;s<i.length;s++){const u=i[s];u.isLink&&(!e||u.t===e)&&r.check(u)&&o.push(u.toFormattedObject(r))}return o}a(dp,"find");var ea="[\0- -\u2029 ]",ay=new RegExp(ea),cy=new RegExp(`${ea}$`),dy=new RegExp(ea,"g");function fy(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}a(fy,"isValidLinkStructure");function hy(t){return new V({key:new q("autolink"),appendTransaction:a((e,n,r)=>{const i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,u=Fh(n.doc,[...e]);if(Vh(u).forEach(({newRange:c})=>{const d=kb(r.doc,c,p=>p.isTextblock);let f,h;if(d.length>1)f=d[0],h=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(d.length){const p=r.doc.textBetween(c.from,c.to," "," ");if(!cy.test(p))return;f=d[0],h=r.doc.textBetween(f.pos,c.to,void 0," ")}if(f&&h){const p=h.split(ay).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],g=f.pos+h.lastIndexOf(m);if(!m)return!1;const b=Ql(m).map(y=>y.toObject(t.defaultProtocol));if(!fy(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=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{$l(y.from,y.to,r.doc).some(x=>x.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s},"appendTransaction")})}a(hy,"autolink$1");function py(t){return new V({key:new q("handleClickLink"),props:{handleClick:a((e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let d=r.target;const f=[];for(;d.nodeName!=="DIV";)f.push(d),d=d.parentNode;s=f.find(h=>h.nodeName==="A")}if(!s)return!1;const u=Hh(e.state,t.type.name),l=(i=s?.href)!=null?i:u.href,c=(o=s?.target)!=null?o:u.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),s&&l?(window.open(l,c),!0):!1},"handleClick")}})}a(py,"clickHandler");function my(t){return new V({key:new q("handlePasteLink"),props:{handlePaste:a((e,n,r)=>{const{shouldAutoLink:i}=t,{state:o}=e,{selection:s}=o,{empty:u}=s;if(u)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const c=dp(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c||i!==void 0&&!i(c.href)?!1:t.editor.commands.setMark(t.type,{href:c.href})},"handlePaste")}})}a(my,"pasteHandler");function Xt(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(dy,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}a(Xt,"isAllowedUri");var fp=Te.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){pd(t);return}pd(t.scheme,t.optionalSlashes)})},onDestroy(){uy()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:a((t,e)=>!!Xt(t,e.protocols),"isAllowedUri"),validate:a(t=>!!t,"validate"),shouldAutoLink:a(t=>!!t,"shouldAutoLink")}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:a(t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:a(n=>!!Xt(n,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null},"getAttrs")}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:a(e=>!!Xt(e,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Q(this.options.HTMLAttributes,t),0]:["a",Q(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:a((t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),"parseMarkdown"),renderMarkdown:a((t,e)=>{var n;const r=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${r})`},"renderMarkdown"),addCommands(){return{setLink:a(t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:a(r=>!!Xt(r,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},"setLink"),toggleLink:a(t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:a(r=>!!Xt(r,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},"toggleLink"),unsetLink:a(()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),"unsetLink")}},addPasteRules(){return[Mn({find:a(t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=dp(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a(s=>!!Xt(s,n),"defaultValidate"),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>{this.options.shouldAutoLink(o.value)&&e.push({text:o.value,data:{href:o.href},index:o.start})})}return e},"find"),type:this.type,getAttributes:a(t=>{var e;return{href:(e=t.data)==null?void 0:e.href}},"getAttributes")})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(hy({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:a(r=>this.options.isAllowedUri(r,{defaultValidate:a(i=>!!Xt(i,e),"defaultValidate"),protocols:e,defaultProtocol:n}),"validate"),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(py({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(my({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),gy=Object.defineProperty,by=a((t,e)=>{for(var n in e)gy(t,n,{get:e[n],enumerable:!0})},"__export"),yy="listItem",md="textStyle",gd=/^\s*([-+*])\s$/,hp=j.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:a((t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},"parseMarkdown"),renderMarkdown:a((t,e)=>t.content?e.renderChildren(t.content,`
|
|
130
|
-
`):"","renderMarkdown"),markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:a(()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yy,this.editor.getAttributes(md)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks),"toggleBulletList")}},addKeyboardShortcuts(){return{"Mod-Shift-8":a(()=>this.editor.commands.toggleBulletList(),"Mod-Shift-8")}},addInputRules(){let t=pr({find:gd,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=pr({find:gd,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:a(()=>this.editor.getAttributes(md),"getAttributes"),editor:this.editor})),[t]}}),pp=j.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:a((t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(i=>i.type==="paragraph"))n=e.parseChildren(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const s=t.tokens.slice(1),u=e.parseChildren(s);n.push(...u)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},"parseMarkdown"),renderMarkdown:a((t,e,n)=>Ul(t,e,r=>r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${r.index+1}. `:"- ",n),"renderMarkdown"),addKeyboardShortcuts(){return{Enter:a(()=>this.editor.commands.splitListItem(this.name),"Enter"),Tab:a(()=>this.editor.commands.sinkListItem(this.name),"Tab"),"Shift-Tab":a(()=>this.editor.commands.liftListItem(this.name),"Shift-Tab")}}}),xy={};by(xy,{findListItemPos:a(()=>mi,"findListItemPos"),getNextListDepth:a(()=>ta,"getNextListDepth"),handleBackspace:a(()=>Qu,"handleBackspace"),handleDelete:a(()=>el,"handleDelete"),hasListBefore:a(()=>mp,"hasListBefore"),hasListItemAfter:a(()=>ky,"hasListItemAfter"),hasListItemBefore:a(()=>gp,"hasListItemBefore"),listItemHasSubList:a(()=>bp,"listItemHasSubList"),nextListIsDeeper:a(()=>yp,"nextListIsDeeper"),nextListIsHigher:a(()=>xp,"nextListIsHigher")});var mi=a((t,e)=>{const{$from:n}=e.selection,r=Y(t,e.schema);let i=null,o=n.depth,s=n.pos,u=null;for(;o>0&&u===null;)i=n.node(o),i.type===r?u=o:(o-=1,s-=1);return u===null?null:{$pos:e.doc.resolve(s),depth:u}},"findListItemPos"),ta=a((t,e)=>{const n=mi(t,e);if(!n)return!1;const[,r]=Db(e,t,n.$pos.pos+4);return r},"getNextListDepth"),mp=a((t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),o=t.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},"hasListBefore"),gp=a((t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},"hasListItemBefore"),bp=a((t,e,n)=>{if(!n)return!1;const r=Y(t,e.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},"listItemHasSubList"),Qu=a((t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ut(t.state,e)&&mp(t.state,e,n)){const{$anchor:u}=t.state.selection,l=t.state.doc.resolve(u.before()-1),c=[];l.node().descendants((h,p)=>{h.type.name===e&&c.push({node:h,pos:p})});const d=c.at(-1);if(!d)return!1;const f=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:u.start()-1,to:u.end()+1},f.end()).joinForward().run()}if(!Ut(t.state,e)||!Ib(t.state))return!1;const r=mi(e,t.state);if(!r)return!1;const o=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=bp(e,t.state,o);return gp(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},"handleBackspace"),yp=a((t,e)=>{const n=ta(t,e),r=mi(t,e);return!r||!n?!1:n>r.depth},"nextListIsDeeper"),xp=a((t,e)=>{const n=ta(t,e),r=mi(t,e);return!r||!n?!1:n<r.depth},"nextListIsHigher"),el=a((t,e)=>{if(!Ut(t.state,e)||!Nb(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:yp(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():xp(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},"handleDelete"),ky=a((t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},"hasListItemAfter"),kp=J.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:a(({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&el(t,n)&&(e=!0)}),e},"Delete"),"Mod-Delete":a(({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&el(t,n)&&(e=!0)}),e},"Mod-Delete"),Backspace:a(({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Qu(t,n,r)&&(e=!0)}),e},"Backspace"),"Mod-Backspace":a(({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Qu(t,n,r)&&(e=!0)}),e},"Mod-Backspace")}}}),bd=/^(\s*)(\d+)\.\s+(.*)$/,wy=/^\s/;function Cy(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n],o=i.match(bd);if(!o)break;const[,s,u,l]=o,c=s.length;let d=l,f=n+1;const h=[i];for(;f<t.length;){const p=t[f];if(p.match(bd))break;if(p.trim()==="")h.push(p),d+=`
|
|
131
|
-
`,f+=1;else if(p.match(wy))h.push(p),d+=`
|
|
132
|
-
${p.slice(c+2)}`,f+=1;else break}e.push({indent:c,number:parseInt(u,10),content:d.trim(),raw:h.join(`
|
|
133
|
-
`)}),r=f,n=f}return[e,r]}a(Cy,"collectOrderedListItems");function wp(t,e,n){var r;const i=[];let o=0;for(;o<t.length;){const s=t[o];if(s.indent===e){const u=s.content.split(`
|
|
134
|
-
`),l=((r=u[0])==null?void 0:r.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=u.slice(1).join(`
|
|
135
|
-
`).trim();if(d){const p=n.blockTokens(d);c.push(...p)}let f=o+1;const h=[];for(;f<t.length&&t[f].indent>e;)h.push(t[f]),f+=1;if(h.length>0){const p=Math.min(...h.map(g=>g.indent)),m=wp(h,p,n);c.push({type:"list",ordered:!0,start:h[0].number,items:m,raw:h.map(g=>g.raw).join(`
|
|
136
|
-
`)})}i.push({type:"list_item",raw:s.raw,tokens:c}),o=f}else o+=1}return i}a(wp,"buildNestedStructure");function Ey(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const o=e.parseChildren([i]);r.push({type:"paragraph",content:o})}else{const o=e.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}a(Ey,"parseListItems");var Sy="listItem",yd="textStyle",xd=/^(\d+)\.\s$/,Cp=j.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:a(t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1,"parseHTML")},type:{default:null,parseHTML:a(t=>t.getAttribute("type"),"parseHTML")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Q(this.options.HTMLAttributes,n),0]:["ol",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:a((t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?Ey(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},"parseMarkdown"),renderMarkdown:a((t,e)=>t.content?e.renderChildren(t.content,`
|
|
137
|
-
`):"","renderMarkdown"),markdownTokenizer:{name:"orderedList",level:"block",start:a(t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e?.index;return n!==void 0?n:-1},"start"),tokenize:a((t,e,n)=>{var r;const i=t.split(`
|
|
138
|
-
`),[o,s]=Cy(i);if(o.length===0)return;const u=wp(o,0,n);return u.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:u,raw:i.slice(0,s).join(`
|
|
139
|
-
`)}},"tokenize")},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:a(()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Sy,this.editor.getAttributes(yd)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks),"toggleOrderedList")}},addKeyboardShortcuts(){return{"Mod-Shift-7":a(()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-7")}},addInputRules(){let t=pr({find:xd,type:this.type,getAttributes:a(e=>({start:+e[1]}),"getAttributes"),joinPredicate:a((e,n)=>n.childCount+n.attrs.start===+e[1],"joinPredicate")});return(this.options.keepMarks||this.options.keepAttributes)&&(t=pr({find:xd,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:a(e=>({start:+e[1],...this.editor.getAttributes(yd)}),"getAttributes"),joinPredicate:a((e,n)=>n.childCount+n.attrs.start===+e[1],"joinPredicate"),editor:this.editor})),[t]}}),vy=/^\s*(\[([( |x])?\])\s$/,Ay=j.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:a(t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},"parseHTML"),renderHTML:a(t=>({"data-checked":t.checked}),"renderHTML")}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Q(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:a((t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},"parseMarkdown"),renderMarkdown:a((t,e)=>{var n;const i=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return Ul(t,e,i)},"renderMarkdown"),addKeyboardShortcuts(){const t={Enter:a(()=>this.editor.commands.splitListItem(this.name),"Enter"),"Shift-Tab":a(()=>this.editor.commands.liftListItem(this.name),"Shift-Tab")};return this.options.nested?{...t,Tab:a(()=>this.editor.commands.sinkListItem(this.name),"Tab")}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),u=document.createElement("input"),l=document.createElement("div"),c=a(d=>{var f,h;u.ariaLabel=((h=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:h.call(f,d,u.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`},"updateA11Y");return c(t),o.contentEditable="false",u.type="checkbox",u.addEventListener("mousedown",d=>d.preventDefault()),u.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){u.checked=!u.checked;return}const{checked:f}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=n();if(typeof p!="number")return!1;const m=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...m?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(u.checked=!u.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=t.attrs.checked,u.checked=t.attrs.checked,o.append(u,s),i.append(o,l),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)}),{dom:i,contentDOM:l,update:a(d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,u.checked=d.attrs.checked,c(d),!0),"update")}}},addInputRules(){return[pr({find:vy,type:this.type,getAttributes:a(t=>({checked:t[t.length-1]==="x"}),"getAttributes")})]}}),My=j.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Q(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:a((t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>t.content?e.renderChildren(t.content,`
|
|
140
|
-
`):"","renderMarkdown"),markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=a(o=>{const s=qu(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a(u=>({indentLevel:u[1].length,mainContent:u[4],checked:u[3].toLowerCase()==="x"}),"extractItemData"),createToken:a((u,l)=>({type:"taskItem",raw:"",mainContent:u.mainContent,indentLevel:u.indentLevel,checked:u.checked,text:u.mainContent,tokens:n.inlineTokens(u.mainContent),nestedTokens:l}),"createToken"),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(o)},"parseTaskListContent"),i=qu(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a(o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),"extractItemData"),createToken:a((o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:s}),"createToken"),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:a(()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName),"toggleTaskList")}},addKeyboardShortcuts(){return{"Mod-Shift-9":a(()=>this.editor.commands.toggleTaskList(),"Mod-Shift-9")}}});J.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(hp.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(pp.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(kp.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Cp.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Ay.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(My.configure(this.options.taskList)),t}});var Ty=j.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Q(this.options.HTMLAttributes,t),0]},parseMarkdown:a((t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},"parseMarkdown"),renderMarkdown:a((t,e)=>!t||!Array.isArray(t.content)?"":e.renderChildren(t.content),"renderMarkdown"),addCommands(){return{setParagraph:a(()=>({commands:t})=>t.setNode(this.name),"setParagraph")}},addKeyboardShortcuts(){return{"Mod-Alt-0":a(()=>this.editor.commands.setParagraph(),"Mod-Alt-0")}}}),Dy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Oy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_y=Te.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:a(t=>t.includes("line-through")?{}:!1,"getAttrs")}]},renderHTML({HTMLAttributes:t}){return["s",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:a((t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>`~~${e.renderChildren(t)}~~`,"renderMarkdown"),addCommands(){return{setStrike:a(()=>({commands:t})=>t.setMark(this.name),"setStrike"),toggleStrike:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleStrike"),unsetStrike:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetStrike")}},addKeyboardShortcuts(){return{"Mod-Shift-s":a(()=>this.editor.commands.toggleStrike(),"Mod-Shift-s")}},addInputRules(){return[hr({find:Dy,type:this.type})]},addPasteRules(){return[Mn({find:Oy,type:this.type})]}}),Ny=j.create({name:"text",group:"inline",parseMarkdown:a(t=>({type:"text",text:t.text||""}),"parseMarkdown"),renderMarkdown:a(t=>t.text||"","renderMarkdown")}),Iy=Te.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:a(t=>t.includes("underline")?{}:!1,"getAttrs")}]},renderHTML({HTMLAttributes:t}){return["u",Q(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:a(()=>({commands:t})=>t.setMark(this.name),"setUnderline"),toggleUnderline:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleUnderline"),unsetUnderline:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetUnderline")}},addKeyboardShortcuts(){return{"Mod-u":a(()=>this.editor.commands.toggleUnderline(),"Mod-u"),"Mod-U":a(()=>this.editor.commands.toggleUnderline(),"Mod-U")}}});function Ry(t={}){return new V({view(e){return new tl(e,t)}})}a(Ry,"dropCursor");const Ga=class Ga{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a(s=>{this[i](s)},"handler");return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,u=o.height/i.offsetHeight;if(n){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let p=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=f?m.bottom:m.top;f&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*u;r={left:m.left,right:m.right,top:g-b,bottom:g+b}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*s;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let f=l.getBoundingClientRect(),h=f.width/l.offsetWidth,p=f.height/l.offsetHeight;c=f.left-l.scrollLeft*h,d=f.top-l.scrollTop*p}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-d)/u+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/u+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let u=Rf(this.editorView.state.doc,s,this.editorView.dragging.slice);u!=null&&(s=u)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};a(Ga,"DropCursorView");let tl=Ga;const Ke=class Ke extends R{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ke.valid(r)?new Ke(r):R.near(r)}content(){return T.empty}eq(e){return e instanceof Ke&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ke(e.resolve(n.pos))}getBookmark(){return new nl(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!Fy(e)||!Ly(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ke.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let u=e.node(s);if(n>0?e.indexAfter(s)<u.childCount:e.index(s)>0){o=u.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(Ke.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!I.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let u=e.doc.resolve(i);if(Ke.valid(u))return u}return null}}};a(Ke,"GapCursor");let pe=Ke;pe.prototype.visible=!1;pe.findFrom=pe.findGapCursorFrom;R.jsonID("gapcursor",pe);const ss=class ss{constructor(e){this.pos=e}map(e){return new ss(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return pe.valid(n)?new pe(n):R.near(n)}};a(ss,"GapBookmark");let nl=ss;function Ep(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}a(Ep,"needsGap");function Fy(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Ep(i.type))return!0;if(i.inlineContent)return!1}}return!0}a(Fy,"closedBefore");function Ly(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Ep(i.type))return!0;if(i.inlineContent)return!1}}return!0}a(Ly,"closedAfter");function Py(){return new V({props:{decorations:Hy,createSelectionBetween(t,e,n){return e.pos==n.pos&&pe.valid(n)?new pe(n):null},handleClick:zy,handleKeyDown:By,handleDOMEvents:{beforeinput:$y}}})}a(Py,"gapCursor");const By=_l({ArrowLeft:Di("horiz",-1),ArrowRight:Di("horiz",1),ArrowUp:Di("vert",-1),ArrowDown:Di("vert",1)});function Di(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,u=e>0?s.$to:s.$from,l=s.empty;if(s instanceof F){if(!o.endOfTextblock(n)||u.depth==0)return!1;l=!1,u=r.doc.resolve(e>0?u.after():u.before())}let c=pe.findGapCursorFrom(u,e,l);return c?(i&&i(r.tr.setSelection(new pe(c))),!0):!1}}a(Di,"arrow$3");function zy(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!pe.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&I.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new pe(r))),!0)}a(zy,"handleClick");function $y(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof pe))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=M.empty;for(let s=r.length-1;s>=0;s--)i=M.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new T(i,0,0));return o.setSelection(F.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}a($y,"beforeinput");function Hy(t){if(!(t.selection instanceof pe))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ce.create(t.doc,[Fe.widget(t.selection.head,e,{key:"gapcursor"})])}a(Hy,"drawGapCursor");var Ho=200,re=a(function(){},"RopeSequence");re.prototype.append=a(function(e){return e.length?(e=re.from(e),!this.length&&e||e.length<Ho&&this.leafAppend(e)||this.length<Ho&&e.leafPrepend(this)||this.appendInner(e)):this},"append");re.prototype.prepend=a(function(e){return e.length?re.from(e).append(this):this},"prepend");re.prototype.appendInner=a(function(e){return new Vy(this,e)},"appendInner");re.prototype.slice=a(function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?re.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},"slice");re.prototype.get=a(function(e){if(!(e<0||e>=this.length))return this.getInner(e)},"get");re.prototype.forEach=a(function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},"forEach");re.prototype.map=a(function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i},"map");re.from=a(function(e){return e instanceof re?e:e&&e.length?new Sp(e):re.empty},"from");var Sp=(function(t){function e(r){t.call(this),this.values=r}a(e,"Leaf"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=a(function(){return this.values},"flatten"),e.prototype.sliceInner=a(function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},"sliceInner"),e.prototype.getInner=a(function(i){return this.values[i]},"getInner"),e.prototype.forEachInner=a(function(i,o,s,u){for(var l=o;l<s;l++)if(i(this.values[l],u+l)===!1)return!1},"forEachInner"),e.prototype.forEachInvertedInner=a(function(i,o,s,u){for(var l=o-1;l>=s;l--)if(i(this.values[l],u+l)===!1)return!1},"forEachInvertedInner"),e.prototype.leafAppend=a(function(i){if(this.length+i.length<=Ho)return new e(this.values.concat(i.flatten()))},"leafAppend"),e.prototype.leafPrepend=a(function(i){if(this.length+i.length<=Ho)return new e(i.flatten().concat(this.values))},"leafPrepend"),n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(re);re.empty=new Sp([]);var Vy=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return a(e,"Append"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=a(function(){return this.left.flatten().concat(this.right.flatten())},"flatten"),e.prototype.getInner=a(function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},"getInner"),e.prototype.forEachInner=a(function(r,i,o,s){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),s)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,s+u)===!1)return!1},"forEachInner"),e.prototype.forEachInvertedInner=a(function(r,i,o,s){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,s+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,s)===!1)return!1},"forEachInvertedInner"),e.prototype.sliceInner=a(function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},"sliceInner"),e.prototype.leafAppend=a(function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},"leafAppend"),e.prototype.leafPrepend=a(function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},"leafPrepend"),e.prototype.appendInner=a(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)},"appendInner"),e})(re);const jy=500,_t=class _t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,u,l,c=[],d=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,d.push(f);return}if(i){d.push(new Ue(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new Ue(m,void 0,void 0,c.length+d.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return u=i?f.selection.map(i.slice(o)):f.selection,l=new _t(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:u}}addTransform(e,n,r,i){let o=[],s=this.eventCount,u=this.items,l=!i&&u.length?u.get(u.length-1):null;for(let d=0;d<e.steps.length;d++){let f=e.steps[d].invert(e.docs[d]),h=new Ue(e.mapping.maps[d],f,n),p;(p=l&&l.merge(h))&&(h=p,d?o.pop():u=u.slice(0,u.length-1)),o.push(h),n&&(s++,n=void 0),i||(l=h)}let c=s-r.depth;return c>Uy&&(u=qy(u,c),s-=c),new _t(u.append(o),s)}remapping(e,n){let r=new Wi;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new _t(this.items.append(e.map(n=>new Ue(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,u=this.eventCount;this.items.forEach(h=>{h.selection&&u--},i);let l=n;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),b=h.selection&&h.selection.map(o.slice(l+1,p));b&&u++,r.push(new Ue(m,g,b))}else r.push(new Ue(m))},i);let c=[];for(let h=n;h<s;h++)c.push(new Ue(o.maps[h]));let d=this.items.slice(0,i).append(c).append(r),f=new _t(d,u);return f.emptyItemCount()>jy&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,u)=>{if(u>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=s.selection&&s.selection.map(n.slice(r));d&&o++;let f=new Ue(c.invert(),l,d),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new _t(re.from(i.reverse()),o)}};a(_t,"Branch");let Tn=_t;Tn.empty=new Tn(re.empty,0);function qy(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}a(qy,"cutOffEvents");const us=class us{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new us(n.getMap().invert(),n,this.selection)}}};a(us,"Item");let Ue=us;const Za=class Za{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}};a(Za,"HistoryState");let Je=Za;const Uy=20;function Wy(t,e,n,r){let i=n.getMeta(bn),o;if(i)return i.historyState;n.getMeta(Gy)&&(t=new Je(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(bn))return s.getMeta(bn).redo?new Je(t.done.addTransform(n,void 0,r,zi(e)),t.undone,kd(n.mapping.maps),t.prevTime,t.prevComposition):new Je(t.done,t.undone.addTransform(n,void 0,r,zi(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let u=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=u&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Ky(n,t.prevRanges)),c=s?Ys(t.prevRanges,n.mapping):kd(n.mapping.maps);return new Je(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,zi(e)),Tn.empty,c,n.time,u??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Je(t.done.rebased(n,o),t.undone.rebased(n,o),Ys(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Je(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ys(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}a(Wy,"applyTransaction");function Ky(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}a(Ky,"isAdjacentTo");function kd(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}a(kd,"rangesFor");function Ys(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}a(Ys,"mapRanges");function Jy(t,e,n){let r=zi(e),i=bn.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),u=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new Je(n?u:o.remaining,n?o.remaining:u,null,0,-1);return o.transform.setSelection(s).setMeta(bn,{redo:n,historyState:l})}a(Jy,"histTransaction");let Qs=!1,wd=null;function zi(t){let e=t.plugins;if(wd!=e){Qs=!1,wd=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Qs=!0;break}}return Qs}a(zi,"mustPreserveItems");const bn=new q("history"),Gy=new q("closeHistory");function Zy(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new V({key:bn,state:{init(){return new Je(Tn.empty,Tn.empty,null,0,-1)},apply(e,n,r){return Wy(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Ap:r=="historyRedo"?Mp:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}a(Zy,"history");function vp(t,e){return(n,r)=>{let i=bn.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=Jy(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}a(vp,"buildCommand");const Ap=vp(!1,!0),Mp=vp(!0,!0);J.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:a(t=>t.length,"textCounter"),wordCounter:a(t=>t.split(" ").filter(e=>e!=="").length,"wordCounter")}},addStorage(){return{characters:a(()=>0,"characters"),words:a(()=>0,"words")}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new V({key:new q("characterCount"),appendTransaction:a((e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const s=o-i,u=0,l=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(u,l);return t=!0,c}t=!0},"appendTransaction"),filterTransaction:a((e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;const u=e.selection.$head.pos,l=o-r,c=u-l,d=u;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>r)},"filterTransaction")})]}});var Xy=J.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Ry(this.options)]}});J.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new V({key:new q("focus"),props:{decorations:a(({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!n||!r)return ce.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;s+=1});let u=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(u+=1,this.options.mode==="deepest"&&s-u>0||this.options.mode==="shallowest"&&u>1)return this.options.mode==="deepest";o.push(Fe.node(c,c+l.nodeSize,{class:this.options.className}))}),ce.create(t,o)},"decorations")}})]}});var Yy=J.create({name:"gapCursor",addProseMirrorPlugins(){return[Py()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=H(_(t,"allowGapCursor",n)))!=null?e:null}}}),Qy=J.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new V({key:new q("placeholder"),props:{decorations:a(({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const o=this.editor.isEmpty;return t.descendants((s,u)=>{const l=r>=u&&r<=u+s.nodeSize,c=!s.isLeaf&&ms(s);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];o&&d.push(this.options.emptyEditorClass);const f=Fe.node(u,u+s.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:u,hasAnchor:l}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),ce.create(t,i)},"decorations")}})]}});J.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new V({key:new q("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||jh(n.selection)||t.view.dragging?null:ce.create(n.doc,[Fe.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function Cd({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}a(Cd,"nodeEqualsType");var ex=J.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new q(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new V({key:e,appendTransaction:a((i,o,s)=>{const{doc:u,tr:l,schema:c}=s,d=e.getState(s),f=u.content.size,h=c.nodes[n];if(d)return l.insert(f,h.create())},"appendTransaction"),state:{init:a((i,o)=>{const s=o.tr.doc.lastChild;return!Cd({node:s,types:r})},"init"),apply:a((i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!Cd({node:s,types:r})},"apply")}})]}}),tx=J.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:a(()=>({state:t,dispatch:e})=>Ap(t,e),"undo"),redo:a(()=>({state:t,dispatch:e})=>Mp(t,e),"redo")}},addProseMirrorPlugins(){return[Zy(this.options)]},addKeyboardShortcuts(){return{"Mod-z":a(()=>this.editor.commands.undo(),"Mod-z"),"Shift-Mod-z":a(()=>this.editor.commands.redo(),"Shift-Mod-z"),"Mod-y":a(()=>this.editor.commands.redo(),"Mod-y"),"Mod-я":a(()=>this.editor.commands.undo(),"Mod-я"),"Shift-Mod-я":a(()=>this.editor.commands.redo(),"Shift-Mod-я")}}}),nx=J.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(O2.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(v2.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(hp.configure(this.options.bulletList)),this.options.code!==!1&&i.push(I2.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(L2.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(P2.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Xy.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Yy.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(B2.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(z2.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(tx.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push($2.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(U2.configure(this.options.italic)),this.options.listItem!==!1&&i.push(pp.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(kp.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(fp.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(Cp.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(Ty.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(_y.configure(this.options.strike)),this.options.text!==!1&&i.push(Ny.configure(this.options.text)),this.options.underline!==!1&&i.push(Iy.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(ex.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),rx=nx;function Ed(t){return E.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}a(Ed,"useDebouncedRef");var Zn,ix=(Zn=class extends p2{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Ed(this.view.state),this.reactiveExtensionStorage=Ed(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),E.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}},a(Zn,"Editor"),Zn),ox=E.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=E.ref(),n=E.getCurrentInstance();return E.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&E.nextTick(()=>{var i;if(!e.value||!((i=r.view.dom)!=null&&i.firstChild))return;const o=E.unref(e.value);e.value.append(r.view.dom),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:o}),r.createNodeViews()})}),E.onBeforeUnmount(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return E.h("div",{ref:a(t=>{this.rootEl=t},"ref")})}});E.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return E.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});E.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return E.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)==null?void 0:e.call(t))}});E.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return E.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});const Tp=["top","right","bottom","left"],Sd=["start","end"],vd=Tp.reduce((t,e)=>t.concat(e,e+"-"+Sd[0],e+"-"+Sd[1]),[]),nt=Math.min,me=Math.max,Vo=Math.round,Ye=a(t=>({x:t,y:t}),"createCoords"),sx={left:"right",right:"left",bottom:"top",top:"bottom"},ux={start:"end",end:"start"};function rl(t,e,n){return me(t,nt(e,n))}a(rl,"clamp");function kt(t,e){return typeof t=="function"?t(e):t}a(kt,"evaluate");function Le(t){return t.split("-")[0]}a(Le,"getSide");function ze(t){return t.split("-")[1]}a(ze,"getAlignment");function Dp(t){return t==="x"?"y":"x"}a(Dp,"getOppositeAxis");function na(t){return t==="y"?"height":"width"}a(na,"getAxisLength");const lx=new Set(["top","bottom"]);function Ge(t){return lx.has(Le(t))?"y":"x"}a(Ge,"getSideAxis");function ra(t){return Dp(Ge(t))}a(ra,"getAlignmentAxis");function Op(t,e,n){n===void 0&&(n=!1);const r=ze(t),i=ra(t),o=na(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=qo(s)),[s,qo(s)]}a(Op,"getAlignmentSides");function ax(t){const e=qo(t);return[jo(t),e,jo(e)]}a(ax,"getExpandedPlacements");function jo(t){return t.replace(/start|end/g,e=>ux[e])}a(jo,"getOppositeAlignmentPlacement");const Ad=["left","right"],Md=["right","left"],cx=["top","bottom"],dx=["bottom","top"];function fx(t,e,n){switch(t){case"top":case"bottom":return n?e?Md:Ad:e?Ad:Md;case"left":case"right":return e?cx:dx;default:return[]}}a(fx,"getSideList");function hx(t,e,n,r){const i=ze(t);let o=fx(Le(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(jo)))),o}a(hx,"getOppositeAxisPlacements");function qo(t){return t.replace(/left|right|bottom|top/g,e=>sx[e])}a(qo,"getOppositePlacement");function px(t){return{top:0,right:0,bottom:0,left:0,...t}}a(px,"expandPaddingObject");function ia(t){return typeof t!="number"?px(t):{top:t,right:t,bottom:t,left:t}}a(ia,"getPaddingObject");function mr(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}a(mr,"rectToClientRect");function Td(t,e,n){let{reference:r,floating:i}=t;const o=Ge(e),s=ra(e),u=na(s),l=Le(e),c=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[u]/2-i[u]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ze(e)){case"start":p[s]-=h*(n&&c?-1:1);break;case"end":p[s]+=h*(n&&c?-1:1);break}return p}a(Td,"computeCoordsFromPlacement");const mx=a(async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,u=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=Td(c,r,l),h=r,p={},m=0;for(let g=0;g<u.length;g++){const{name:b,fn:y}=u[g],{x,y:k,data:C,reset:w}=await y({x:d,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:t,floating:e}});d=x??d,f=k??f,p={...p,[b]:{...p[b],...C}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:d,y:f}=Td(c,h,l)),g=-1)}return{x:d,y:f,placement:h,strategy:i,middlewareData:p}},"computePosition$1");async function gr(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:u,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=kt(e,t),m=ia(p),b=u[h?f==="floating"?"reference":"floating":f],y=mr(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:d,strategy:l})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),C=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},w=mr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:x,offsetParent:k,strategy:l}):x);return{top:(y.top-w.top+m.top)/C.y,bottom:(w.bottom-y.bottom+m.bottom)/C.y,left:(y.left-w.left+m.left)/C.x,right:(w.right-y.right+m.right)/C.x}}a(gr,"detectOverflow");const gx=a(t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:u,middlewareData:l}=e,{element:c,padding:d=0}=kt(t,e)||{};if(c==null)return{};const f=ia(d),h={x:n,y:r},p=ra(i),m=na(p),g=await s.getDimensions(c),b=p==="y",y=b?"top":"left",x=b?"bottom":"right",k=b?"clientHeight":"clientWidth",C=o.reference[m]+o.reference[p]-h[p]-o.floating[m],w=h[p]-o.reference[p],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let v=S?S[k]:0;(!v||!await(s.isElement==null?void 0:s.isElement(S)))&&(v=u.floating[k]||o.floating[m]);const D=C/2-w/2,O=v/2-g[m]/2-1,N=nt(f[y],O),$=nt(f[x],O),U=N,G=v-g[m]-$,P=v/2-g[m]/2+D,B=rl(U,P,G),X=!l.arrow&&ze(i)!=null&&P!==B&&o.reference[m]/2-(P<U?N:$)-g[m]/2<0,ee=X?P<U?P-U:P-G:0;return{[p]:h[p]+ee,data:{[p]:B,centerOffset:P-B-ee,...X&&{alignmentOffset:ee}},reset:X}}}),"arrow$2");function bx(t,e,n){return(t?[...n.filter(i=>ze(i)===t),...n.filter(i=>ze(i)!==t)]:n.filter(i=>Le(i)===i)).filter(i=>t?ze(i)===t||(e?jo(i)!==i:!1):!0)}a(bx,"getPlacementList");const yx=a(function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,i;const{rects:o,middlewareData:s,placement:u,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:f,allowedPlacements:h=vd,autoAlignment:p=!0,...m}=kt(t,e),g=f!==void 0||h===vd?bx(f||null,p,h):h,b=await gr(e,m),y=((n=s.autoPlacement)==null?void 0:n.index)||0,x=g[y];if(x==null)return{};const k=Op(x,o,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(u!==x)return{reset:{placement:g[0]}};const C=[b[Le(x)],b[k[0]],b[k[1]]],w=[...((r=s.autoPlacement)==null?void 0:r.overflows)||[],{placement:x,overflows:C}],S=g[y+1];if(S)return{data:{index:y+1,overflows:w},reset:{placement:S}};const v=w.map(N=>{const $=ze(N.placement);return[N.placement,$&&d?N.overflows.slice(0,2).reduce((U,G)=>U+G,0):N.overflows[0],N.overflows]}).sort((N,$)=>N[1]-$[1]),O=((i=v.filter(N=>N[2].slice(0,ze(N[0])?2:3).every($=>$<=0))[0])==null?void 0:i[0])||v[0][0];return O!==u?{data:{index:y+1,overflows:w},reset:{placement:O}}:{}}}},"autoPlacement$1"),xx=a(function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:u,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=kt(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const y=Le(i),x=Ge(u),k=Le(u)===u,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(k||!g?[qo(u)]:ax(u)),S=m!=="none";!h&&S&&w.push(...hx(u,g,m,C));const v=[u,...w],D=await gr(e,b),O=[];let N=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&O.push(D[y]),f){const P=Op(i,s,C);O.push(D[P[0]],D[P[1]])}if(N=[...N,{placement:i,overflows:O}],!O.every(P=>P<=0)){var $,U;const P=((($=o.flip)==null?void 0:$.index)||0)+1,B=v[P];if(B&&(!(f==="alignment"?x!==Ge(B):!1)||N.every(Se=>Ge(Se.placement)===x?Se.overflows[0]>0:!0)))return{data:{index:P,overflows:N},reset:{placement:B}};let X=(U=N.filter(ee=>ee.overflows[0]<=0).sort((ee,Se)=>ee.overflows[1]-Se.overflows[1])[0])==null?void 0:U.placement;if(!X)switch(p){case"bestFit":{var G;const ee=(G=N.filter(Se=>{if(S){const Ct=Ge(Se.placement);return Ct===x||Ct==="y"}return!0}).map(Se=>[Se.placement,Se.overflows.filter(Ct=>Ct>0).reduce((Ct,N0)=>Ct+N0,0)]).sort((Se,Ct)=>Se[1]-Ct[1])[0])==null?void 0:G[0];ee&&(X=ee);break}case"initialPlacement":X=u;break}if(i!==X)return{reset:{placement:X}}}return{}}}},"flip$1");function Dd(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}a(Dd,"getSideOffsets");function Od(t){return Tp.some(e=>t[e]>=0)}a(Od,"isAnySideFullyClipped");const kx=a(function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=kt(t,e);switch(r){case"referenceHidden":{const o=await gr(e,{...i,elementContext:"reference"}),s=Dd(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Od(s)}}}case"escaped":{const o=await gr(e,{...i,altBoundary:!0}),s=Dd(o,n.floating);return{data:{escapedOffsets:s,escaped:Od(s)}}}default:return{}}}}},"hide$1");function _p(t){const e=nt(...t.map(o=>o.left)),n=nt(...t.map(o=>o.top)),r=me(...t.map(o=>o.right)),i=me(...t.map(o=>o.bottom));return{x:e,y:n,width:r-e,height:i-n}}a(_p,"getBoundingRect");function wx(t){const e=t.slice().sort((i,o)=>i.y-o.y),n=[];let r=null;for(let i=0;i<e.length;i++){const o=e[i];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(i=>mr(_p(i)))}a(wx,"getRectsByLine");const Cx=a(function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:r,rects:i,platform:o,strategy:s}=e,{padding:u=2,x:l,y:c}=kt(t,e),d=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(r.reference))||[]),f=wx(d),h=mr(_p(d)),p=ia(u);function m(){if(f.length===2&&f[0].left>f[1].right&&l!=null&&c!=null)return f.find(b=>l>b.left-p.left&&l<b.right+p.right&&c>b.top-p.top&&c<b.bottom+p.bottom)||h;if(f.length>=2){if(Ge(n)==="y"){const N=f[0],$=f[f.length-1],U=Le(n)==="top",G=N.top,P=$.bottom,B=U?N.left:$.left,X=U?N.right:$.right,ee=X-B,Se=P-G;return{top:G,bottom:P,left:B,right:X,width:ee,height:Se,x:B,y:G}}const b=Le(n)==="left",y=me(...f.map(N=>N.right)),x=nt(...f.map(N=>N.left)),k=f.filter(N=>b?N.left===x:N.right===y),C=k[0].top,w=k[k.length-1].bottom,S=x,v=y,D=v-S,O=w-C;return{top:C,bottom:w,left:S,right:v,width:D,height:O,x:S,y:C}}return h}a(m,"getBoundingClientRect");const g=await o.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:s});return i.reference.x!==g.reference.x||i.reference.y!==g.reference.y||i.reference.width!==g.reference.width||i.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}},"inline$2"),Ex=new Set(["left","top"]);async function Sx(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Le(n),u=ze(n),l=Ge(n)==="y",c=Ex.has(s)?-1:1,d=o&&l?-1:1,f=kt(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&typeof m=="number"&&(p=u==="end"?m*-1:m),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}a(Sx,"convertValueToCoords");const vx=a(function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:u}=e,l=await Sx(e,t);return s===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},"offset$1"),Ax=a(function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:u={fn:a(b=>{let{x:y,y:x}=b;return{x:y,y:x}},"fn")},...l}=kt(t,e),c={x:n,y:r},d=await gr(e,l),f=Ge(Le(i)),h=Dp(f);let p=c[h],m=c[f];if(o){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=p+d[b],k=p-d[y];p=rl(x,p,k)}if(s){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=m+d[b],k=m-d[y];m=rl(x,m,k)}const g=u.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:o,[f]:s}}}}}},"shift$1"),Mx=a(function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:s,elements:u}=e,{apply:l=a(()=>{},"apply"),...c}=kt(t,e),d=await gr(e,c),f=Le(i),h=ze(i),p=Ge(i)==="y",{width:m,height:g}=o.floating;let b,y;f==="top"||f==="bottom"?(b=f,y=h===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(y=f,b=h==="end"?"top":"bottom");const x=g-d.top-d.bottom,k=m-d.left-d.right,C=nt(g-d[b],x),w=nt(m-d[y],k),S=!e.middlewareData.shift;let v=C,D=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=k),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(v=x),S&&!h){const N=me(d.left,0),$=me(d.right,0),U=me(d.top,0),G=me(d.bottom,0);p?D=m-2*(N!==0||$!==0?N+$:me(d.left,d.right)):v=g-2*(U!==0||G!==0?U+G:me(d.top,d.bottom))}await l({...e,availableWidth:D,availableHeight:v});const O=await s.getDimensions(u.floating);return m!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}},"size$1");function xs(){return typeof window<"u"}a(xs,"hasWindow");function wr(t){return Np(t)?(t.nodeName||"").toLowerCase():"#document"}a(wr,"getNodeName");function ve(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}a(ve,"getWindow");function wt(t){var e;return(e=(Np(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}a(wt,"getDocumentElement");function Np(t){return xs()?t instanceof Node||t instanceof ve(t).Node:!1}a(Np,"isNode");function $e(t){return xs()?t instanceof Element||t instanceof ve(t).Element:!1}a($e,"isElement");function rt(t){return xs()?t instanceof HTMLElement||t instanceof ve(t).HTMLElement:!1}a(rt,"isHTMLElement");function _d(t){return!xs()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ve(t).ShadowRoot}a(_d,"isShadowRoot");const Tx=new Set(["inline","contents"]);function gi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=He(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!Tx.has(i)}a(gi,"isOverflowElement");const Dx=new Set(["table","td","th"]);function Ox(t){return Dx.has(wr(t))}a(Ox,"isTableElement");const _x=[":popover-open",":modal"];function ks(t){return _x.some(e=>{try{return t.matches(e)}catch{return!1}})}a(ks,"isTopLayer");const Nx=["transform","translate","scale","rotate","perspective"],Ix=["transform","translate","scale","rotate","perspective","filter"],Rx=["paint","layout","strict","content"];function oa(t){const e=sa(),n=$e(t)?He(t):t;return Nx.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ix.some(r=>(n.willChange||"").includes(r))||Rx.some(r=>(n.contain||"").includes(r))}a(oa,"isContainingBlock");function Fx(t){let e=Wt(t);for(;rt(e)&&!br(e);){if(oa(e))return e;if(ks(e))return null;e=Wt(e)}return null}a(Fx,"getContainingBlock");function sa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}a(sa,"isWebKit");const Lx=new Set(["html","body","#document"]);function br(t){return Lx.has(wr(t))}a(br,"isLastTraversableNode");function He(t){return ve(t).getComputedStyle(t)}a(He,"getComputedStyle$1");function ws(t){return $e(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}a(ws,"getNodeScroll");function Wt(t){if(wr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||_d(t)&&t.host||wt(t);return _d(e)?e.host:e}a(Wt,"getParentNode");function Ip(t){const e=Wt(t);return br(e)?t.ownerDocument?t.ownerDocument.body:t.body:rt(e)&&gi(e)?e:Ip(e)}a(Ip,"getNearestOverflowAncestor");function Rp(t,e,n){var r;e===void 0&&(e=[]);const i=Ip(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=ve(i);return o?(il(s),e.concat(s,s.visualViewport||[],gi(i)?i:[],[])):e.concat(i,Rp(i,[]))}a(Rp,"getOverflowAncestors");function il(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}a(il,"getFrameElement");function Fp(t){const e=He(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=rt(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,u=Vo(n)!==o||Vo(r)!==s;return u&&(n=o,r=s),{width:n,height:r,$:u}}a(Fp,"getCssDimensions");function Lp(t){return $e(t)?t:t.contextElement}a(Lp,"unwrapElement$1");function $n(t){const e=Lp(t);if(!rt(e))return Ye(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Fp(e);let s=(o?Vo(n.width):n.width)/r,u=(o?Vo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}a($n,"getScale");const Px=Ye(0);function Pp(t){const e=ve(t);return!sa()||!e.visualViewport?Px:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}a(Pp,"getVisualOffsets");function Bx(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ve(t)?!1:e}a(Bx,"shouldAddVisualOffsets");function si(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Lp(t);let s=Ye(1);e&&(r?$e(r)&&(s=$n(r)):s=$n(t));const u=Bx(o,n,r)?Pp(o):Ye(0);let l=(i.left+u.x)/s.x,c=(i.top+u.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){const h=ve(o),p=r&&$e(r)?ve(r):r;let m=h,g=il(m);for(;g&&r&&p!==m;){const b=$n(g),y=g.getBoundingClientRect(),x=He(g),k=y.left+(g.clientLeft+parseFloat(x.paddingLeft))*b.x,C=y.top+(g.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=k,c+=C,m=ve(g),g=il(m)}}return mr({width:d,height:f,x:l,y:c})}a(si,"getBoundingClientRect");function Cs(t,e){const n=ws(t).scrollLeft;return e?e.left+n:si(wt(t)).left+n}a(Cs,"getWindowScrollBarX");function Bp(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Cs(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}a(Bp,"getHTMLOffset");function zx(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=wt(r),u=e?ks(e.floating):!1;if(r===s||u&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ye(1);const d=Ye(0),f=rt(r);if((f||!f&&!o)&&((wr(r)!=="body"||gi(s))&&(l=ws(r)),rt(r))){const p=si(r);c=$n(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=s&&!f&&!o?Bp(s,l):Ye(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}a(zx,"convertOffsetParentRelativeRectToViewportRelativeRect");function $x(t){return Array.from(t.getClientRects())}a($x,"getClientRects");function Hx(t){const e=wt(t),n=ws(t),r=t.ownerDocument.body,i=me(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=me(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Cs(t);const u=-n.scrollTop;return He(r).direction==="rtl"&&(s+=me(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:u}}a(Hx,"getDocumentRect");const Nd=25;function Vx(t,e){const n=ve(t),r=wt(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,u=0,l=0;if(i){o=i.width,s=i.height;const d=sa();(!d||d&&e==="fixed")&&(u=i.offsetLeft,l=i.offsetTop)}const c=Cs(r);if(c<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-p);m<=Nd&&(o-=m)}else c<=Nd&&(o+=c);return{width:o,height:s,x:u,y:l}}a(Vx,"getViewportRect");const jx=new Set(["absolute","fixed"]);function qx(t,e){const n=si(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=rt(t)?$n(t):Ye(1),s=t.clientWidth*o.x,u=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:u,x:l,y:c}}a(qx,"getInnerBoundingClientRect");function Id(t,e,n){let r;if(e==="viewport")r=Vx(t,n);else if(e==="document")r=Hx(wt(t));else if($e(e))r=qx(e,n);else{const i=Pp(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return mr(r)}a(Id,"getClientRectFromClippingAncestor");function zp(t,e){const n=Wt(t);return n===e||!$e(n)||br(n)?!1:He(n).position==="fixed"||zp(n,e)}a(zp,"hasFixedPositionAncestor");function Ux(t,e){const n=e.get(t);if(n)return n;let r=Rp(t,[]).filter(u=>$e(u)&&wr(u)!=="body"),i=null;const o=He(t).position==="fixed";let s=o?Wt(t):t;for(;$e(s)&&!br(s);){const u=He(s),l=oa(s);!l&&u.position==="fixed"&&(i=null),(o?!l&&!i:!l&&u.position==="static"&&!!i&&jx.has(i.position)||gi(s)&&!l&&zp(t,s))?r=r.filter(d=>d!==s):i=u,s=Wt(s)}return e.set(t,r),r}a(Ux,"getClippingElementAncestors");function Wx(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?ks(e)?[]:Ux(e,this._c):[].concat(n),r],u=s[0],l=s.reduce((c,d)=>{const f=Id(e,d,i);return c.top=me(f.top,c.top),c.right=nt(f.right,c.right),c.bottom=nt(f.bottom,c.bottom),c.left=me(f.left,c.left),c},Id(e,u,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}a(Wx,"getClippingRect");function Kx(t){const{width:e,height:n}=Fp(t);return{width:e,height:n}}a(Kx,"getDimensions");function Jx(t,e,n){const r=rt(e),i=wt(e),o=n==="fixed",s=si(t,!0,o,e);let u={scrollLeft:0,scrollTop:0};const l=Ye(0);function c(){l.x=Cs(i)}if(a(c,"setLeftRTLScrollbarOffset"),r||!r&&!o)if((wr(e)!=="body"||gi(i))&&(u=ws(e)),r){const p=si(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&c();o&&!r&&i&&c();const d=i&&!r&&!o?Bp(i,u):Ye(0),f=s.left+u.scrollLeft-l.x-d.x,h=s.top+u.scrollTop-l.y-d.y;return{x:f,y:h,width:s.width,height:s.height}}a(Jx,"getRectRelativeToOffsetParent");function eu(t){return He(t).position==="static"}a(eu,"isStaticPositioned");function Rd(t,e){if(!rt(t)||He(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return wt(t)===n&&(n=n.ownerDocument.body),n}a(Rd,"getTrueOffsetParent");function $p(t,e){const n=ve(t);if(ks(t))return n;if(!rt(t)){let i=Wt(t);for(;i&&!br(i);){if($e(i)&&!eu(i))return i;i=Wt(i)}return n}let r=Rd(t,e);for(;r&&Ox(r)&&eu(r);)r=Rd(r,e);return r&&br(r)&&eu(r)&&!oa(r)?n:r||Fx(t)||n}a($p,"getOffsetParent");const Gx=a(async function(t){const e=this.getOffsetParent||$p,n=this.getDimensions,r=await n(t.floating);return{reference:Jx(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},"getElementRects");function Zx(t){return He(t).direction==="rtl"}a(Zx,"isRTL");const Xx={convertOffsetParentRelativeRectToViewportRelativeRect:zx,getDocumentElement:wt,getClippingRect:Wx,getOffsetParent:$p,getElementRects:Gx,getClientRects:$x,getDimensions:Kx,getScale:$n,isElement:$e,isRTL:Zx},Hp=vx,Vp=yx,jp=Ax,qp=xx,Up=Mx,Wp=kx,Kp=gx,Jp=Cx,Gp=a((t,e,n)=>{const r=new Map,i={platform:Xx,...n},o={...i.platform,_c:r};return mx(t,e,{...i,platform:o})},"computePosition");var ol,sl;if(typeof WeakMap<"u"){let t=new WeakMap;ol=a(e=>t.get(e),"readFromCache"),sl=a((e,n)=>(t.set(e,n),n),"addToCache")}else{const t=[];let n=0;ol=a(r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},"readFromCache"),sl=a((r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i),"addToCache")}var Xn,ht=(Xn=class{constructor(e,n,r,i){this.width=e,this.height=n,this.map=r,this.problems=i}findCell(e){for(let n=0;n<this.map.length;n++){const r=this.map[n];if(r!=e)continue;const i=n%this.width,o=n/this.width|0;let s=i+1,u=o+1;for(let l=1;s<this.width&&this.map[n+l]==r;l++)s++;for(let l=1;u<this.height&&this.map[n+this.width*l]==r;l++)u++;return{left:i,top:o,right:s,bottom:u}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let n=0;n<this.map.length;n++)if(this.map[n]==e)return n%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,n,r){const{left:i,right:o,top:s,bottom:u}=this.findCell(e);return n=="horiz"?(r<0?i==0:o==this.width)?null:this.map[s*this.width+(r<0?i-1:o)]:(r<0?s==0:u==this.height)?null:this.map[i+this.width*(r<0?s-1:u)]}rectBetween(e,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(e),{left:u,right:l,top:c,bottom:d}=this.findCell(n);return{left:Math.min(r,u),top:Math.min(o,c),right:Math.max(i,l),bottom:Math.max(s,d)}}cellsInRect(e){const n=[],r={};for(let i=e.top;i<e.bottom;i++)for(let o=e.left;o<e.right;o++){const s=i*this.width+o,u=this.map[s];r[u]||(r[u]=!0,!(o==e.left&&o&&this.map[s-1]==u||i==e.top&&i&&this.map[s-this.width]==u)&&n.push(u))}return n}positionAt(e,n,r){for(let i=0,o=0;;i++){const s=o+r.child(i).nodeSize;if(i==e){let u=n+e*this.width;const l=(e+1)*this.width;for(;u<l&&this.map[u]<o;)u++;return u==l?s-1:this.map[u]}o=s}}static get(e){return ol(e)||sl(e,Yx(e))}},a(Xn,"TableMap"),Xn);function Yx(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Qx(t),n=t.childCount,r=[];let i=0,o=null;const s=[];for(let c=0,d=e*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){const f=t.child(c);d++;for(let m=0;;m++){for(;i<r.length&&r[i]!=0;)i++;if(m==f.childCount)break;const g=f.child(m),{colspan:b,rowspan:y,colwidth:x}=g.attrs;for(let k=0;k<y;k++){if(k+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:d,n:y-k});break}const C=i+k*e;for(let w=0;w<b;w++){r[C+w]==0?r[C+w]=d:(o||(o=[])).push({type:"collision",row:c,pos:d,n:b-w});const S=x&&x[w];if(S){const v=(C+w)%e*2,D=s[v];D==null||D!=S&&s[v+1]==1?(s[v]=S,s[v+1]=1):D==S&&s[v+1]++}}}i+=b,d+=g.nodeSize}const h=(c+1)*e;let p=0;for(;i<h;)r[i++]==0&&p++;p&&(o||(o=[])).push({type:"missing",row:c,n:p}),d++}(e===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const u=new ht(e,n,r,o);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&ek(u,s,t),u}a(Yx,"computeMap");function Qx(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let o=0;if(n)for(let s=0;s<r;s++){const u=t.child(s);for(let l=0;l<u.childCount;l++){const c=u.child(l);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const u=i.child(s);o+=u.attrs.colspan,u.attrs.rowspan>1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}a(Qx,"findWidth");function ek(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const o=t.map[i];if(r[o])continue;r[o]=!0;const s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let u=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const d=(i+c)%t.width,f=e[d*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((u||(u=tk(l)))[c]=f)}u&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:u})}}a(ek,"findBadColWidths");function tk(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}a(tk,"freshColWidth");function ua(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}a(ua,"tableNodeTypes");new q("selectingCells");function nk(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}a(nk,"cellAround");function Zp(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}a(Zp,"isInTable");function rk(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=nk(e.$head)||ik(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}a(rk,"selectionCell");function ik(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}a(ik,"cellNear");function Fd(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}a(Fd,"pointsAtCell");function Xp(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}a(Xp,"inSameTable");function Yp(t,e,n){const r=t.node(-1),i=ht.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}a(Yp,"nextCell");function Ld(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}a(Ld,"removeColSpan");var xe,Qe=(xe=class extends R{constructor(e,n=e){const r=e.node(-1),i=ht.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),u=e.node(0),l=i.cellsInRect(s).filter(d=>d!=n.pos-o);l.unshift(n.pos-o);const c=l.map(d=>{const f=r.nodeAt(d);if(!f)throw RangeError(`No cell with offset ${d} found`);const h=o+d+1;return new Zi(u.resolve(h),u.resolve(h+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Fd(r)&&Fd(i)&&Xp(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?xe.rowSelection(r,i):o&&this.isColSelection()?xe.colSelection(r,i):new xe(r,i)}return F.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=ht.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let d=l*n.width+i.left,f=i.left;f<i.right;f++,d++){const h=n.map[d];if(o[h])continue;o[h]=!0;const p=n.findCell(h);let m=e.nodeAt(h);if(!m)throw RangeError(`No cell with offset ${h} found`);const g=i.left-p.left,b=p.right-i.right;if(g>0||b>0){let y=m.attrs;if(g>0&&(y=Ld(y,0,g)),b>0&&(y=Ld(y,y.colspan-b,b)),p.left<i.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(p.top<i.top||p.bottom>i.bottom){const y={...m.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top<i.top?m=m.type.createAndFill(y):m=m.type.create(y,m.content)}c.push(m)}s.push(e.child(l).copy(M.from(c)))}const u=this.isColSelection()&&this.isRowSelection()?e:s;return new T(M.from(u),1,1)}replace(e,n=T.empty){const r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:u,$to:l}=i[s],c=e.mapping.slice(r);e.replace(c.map(u.pos),c.map(l.pos),s?T.empty:n)}const o=R.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new T(M.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=ht.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(n.nodeAt(o[s]),i+o[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=ht.get(r),o=e.start(-1),s=i.findCell(e.pos-o),u=i.findCell(n.pos-o),l=e.node(0);return s.top<=u.top?(s.top>0&&(e=l.resolve(o+i.map[s.left])),u.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+u.right-1]))):(u.top>0&&(n=l.resolve(o+i.map[u.left])),s.bottom<i.height&&(e=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new xe(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=ht.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,u=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,u)==n.width}eq(e){return e instanceof xe&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=ht.get(r),o=e.start(-1),s=i.findCell(e.pos-o),u=i.findCell(n.pos-o),l=e.node(0);return s.left<=u.left?(s.left>0&&(e=l.resolve(o+i.map[s.top*i.width])),u.right<i.width&&(n=l.resolve(o+i.map[i.width*(u.top+1)-1]))):(u.left>0&&(n=l.resolve(o+i.map[u.top*i.width])),s.right<i.width&&(e=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new xe(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new xe(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new xe(e.resolve(n),e.resolve(r))}getBookmark(){return new ok(this.$anchorCell.pos,this.$headCell.pos)}},a(xe,"_CellSelection"),xe);Qe.prototype.visible=!1;R.jsonID("cell",Qe);var Cn,ok=(Cn=class{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Cn(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Xp(n,r)?new Qe(n,r):R.near(r,1)}},a(Cn,"_CellBookmark"),Cn);new q("fix-tables");function Qp(t){const e=t.selection,n=rk(t),r=n.node(-1),i=n.start(-1),o=ht.get(r);return{...e instanceof Qe?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}a(Qp,"selectedRect");function sk(t){return function(e,n){if(!Zp(e))return!1;if(n){const r=ua(e.schema),i=Qp(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),u=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)u[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[l],r.cell,u[l].attrs);if(o.steps.length==0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],r.header_cell,u[l].attrs);n(o)}return!0}}a(sk,"deprecated_toggleHeader");function Pd(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}a(Pd,"isHeaderEnabledByType");function la(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?sk(t):function(n,r){if(!Zp(n))return!1;if(r){const i=ua(n.schema),o=Qp(n),s=n.tr,u=Pd("row",o,i),l=Pd("column",o,i),d=(t==="column"?u:t==="row"?l:!1)?1:0,f=t=="column"?{left:0,top:d,right:1,bottom:o.map.height}:t=="row"?{left:d,top:0,right:o.map.width,bottom:1}:o,h=t=="column"?l?i.cell:i.header_cell:t=="row"?u?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(p=>{const m=p+o.tableStart,g=s.doc.nodeAt(m);g&&s.setNodeMarkup(m,h,g.attrs)}),r(s)}return!0}}a(la,"toggleHeader");la("row",{useDeprecatedLogic:!0});la("column",{useDeprecatedLogic:!0});la("cell",{useDeprecatedLogic:!0});function Oi(t,e){const n=t.selection;if(!(n instanceof Qe))return!1;if(e){const r=t.tr,i=ua(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new T(i,0,0))}),r.docChanged&&e(r)}return!0}a(Oi,"deleteCellSelection");_l({ArrowLeft:_i("horiz",-1),ArrowRight:_i("horiz",1),ArrowUp:_i("vert",-1),ArrowDown:_i("vert",1),"Shift-ArrowLeft":Ni("horiz",-1),"Shift-ArrowRight":Ni("horiz",1),"Shift-ArrowUp":Ni("vert",-1),"Shift-ArrowDown":Ni("vert",1),Backspace:Oi,"Mod-Backspace":Oi,Delete:Oi,"Mod-Delete":Oi});function $i(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}a($i,"maybeSetSelection");function _i(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof Qe)return $i(n,r,R.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=e0(i,t,e);if(s==null)return!1;if(t=="horiz")return $i(n,r,R.near(n.doc.resolve(o.head+e),e));{const u=n.doc.resolve(s),l=Yp(u,t,e);let c;return l?c=R.near(l,1):e<0?c=R.near(n.doc.resolve(u.before(-1)),-1):c=R.near(n.doc.resolve(u.after(-1)),1),$i(n,r,c)}}}a(_i,"arrow");function Ni(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof Qe)s=o;else{const l=e0(i,t,e);if(l==null)return!1;s=new Qe(n.doc.resolve(l))}const u=Yp(s.$headCell,t,e);return u?$i(n,r,new Qe(s.$anchorCell,u)):!1}}a(Ni,"shiftArrow");function e0(t,e,n){if(!(t.state.selection instanceof F))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const u=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?u:null}}return null}a(e0,"atEndOfCell");new q("tableColumnResizing");function uk(t,e){const n=Math.min(t.top,e.top),r=Math.max(t.bottom,e.bottom),i=Math.min(t.left,e.left),s=Math.max(t.right,e.right)-i,u=r-n,l=i,c=n;return new DOMRect(l,c,s,u)}a(uk,"combineDOMRects");var Yn,lk=(Yn=class{constructor({editor:e,element:n,view:r,updateDelay:i=250,resizeDelay:o=60,shouldShow:s,appendTo:u,getReferencedVirtualElement:l,options:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:f,state:h,from:p,to:m})=>{const{doc:g,selection:b}=h,{empty:y}=b,x=!g.textBetween(p,m).length&&Fl(h.selection),k=this.element.contains(document.activeElement);return!(!(f.hasFocus()||k)||y||x||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:f})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((h=this.element.parentNode)!=null&&h.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(f,h)=>{const p=!h?.selection.eq(f.state.selection),m=!h?.doc.eq(f.state.doc);!p&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(f,p,m,h)},this.updateDelay))},this.updateHandler=(f,h,p,m)=>{const{composing:g}=f;if(g||!h&&!p)return;if(!this.getShouldShow(m)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:f})=>{f.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var d;this.editor=e,this.element=n,this.view=r,this.updateDelay=i,this.resizeDelay=o,this.appendTo=u,this.scrollTarget=(d=c?.scrollTarget)!=null?d:window,this.getReferencedVirtualElement=l,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,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.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(qp(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(jp(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Hp(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Kp(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Up(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Vp(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Wp(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Jp(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e;const{selection:n}=this.editor.state,r=(e=this.getReferencedVirtualElement)==null?void 0:e.call(this);if(r)return r;const i=Hl(this.view,n.from,n.to);let o={getBoundingClientRect:a(()=>i,"getBoundingClientRect"),getClientRects:a(()=>[i],"getClientRects")};if(n instanceof I){let s=this.view.nodeDOM(n.from);const u=s.dataset.nodeViewWrapper?s:s.querySelector("[data-node-view-wrapper]");u&&(s=u),s&&(o={getBoundingClientRect:a(()=>s.getBoundingClientRect(),"getBoundingClientRect"),getClientRects:a(()=>[s.getBoundingClientRect()],"getClientRects")})}if(n instanceof Qe){const{$anchorCell:s,$headCell:u}=n,l=s?s.pos:u.pos,c=u?u.pos:s.pos,d=this.view.nodeDOM(l),f=this.view.nodeDOM(c);if(!d||!f)return;const h=d===f?d.getBoundingClientRect():uk(d.getBoundingClientRect(),f.getBoundingClientRect());o={getBoundingClientRect:a(()=>h,"getBoundingClientRect"),getClientRects:a(()=>[h],"getClientRects")}}return o}updatePosition(){const e=this.virtualElement;e&&Gp(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:n,y:r,strategy:i})=>{this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${n}px`,this.element.style.top=`${r}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}getShouldShow(e){var n;const{state:r}=this.view,{selection:i}=r,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),u=Math.max(...o.map(c=>c.$to.pos));return((n=this.shouldShow)==null?void 0:n.call(this,{editor:this.editor,element:this.element,view:this.view,state:r,oldState:e,from:s,to:u}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const n=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=n??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},a(Yn,"BubbleMenuView"),Yn),ak=a(t=>new V({key:typeof t.pluginKey=="string"?new q(t.pluginKey):t.pluginKey,view:a(e=>new lk({view:e,...t}),"view")}),"BubbleMenuPlugin"),ck=E.defineComponent({name:"BubbleMenu",inheritAttrs:!1,props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:a(()=>({}),"default")},appendTo:{type:Object,default:void 0},shouldShow:{type:Function,default:null},getReferencedVirtualElement:{type:Function,default:void 0}},setup(t,{slots:e,attrs:n}){const r=E.ref(null);return E.onMounted(()=>{const{editor:i,options:o,pluginKey:s,resizeDelay:u,appendTo:l,shouldShow:c,getReferencedVirtualElement:d,updateDelay:f}=t,h=r.value;h&&(h.style.visibility="hidden",h.style.position="absolute",h.remove(),E.nextTick(()=>{i.registerPlugin(ak({editor:i,element:h,options:o,pluginKey:s,resizeDelay:u,appendTo:l,shouldShow:c,getReferencedVirtualElement:d,updateDelay:f}))}))}),E.onBeforeUnmount(()=>{const{pluginKey:i,editor:o}=t;o.unregisterPlugin(i)}),()=>{var i;return E.h("div",{ref:r,...n},(i=e.default)==null?void 0:i.call(e))}}}),Qn,dk=(Qn=class{constructor({editor:e,element:n,view:r,options:i,appendTo:o,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:u,state:l})=>{const{selection:c}=l,{$anchor:d,empty:f}=c,h=d.depth===1,p=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!u.hasFocus()||!f||!h||!p||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,l,c,d)=>{const{composing:f}=u;if(f||!l&&!c)return;if(!this.getShouldShow(d)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var l;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((l=this.element.parentNode)!=null&&l.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=e,this.element=n,this.view=r,this.appendTo=o,this.floatingUIOptions={...this.floatingUIOptions,...i},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return $h(e,{textSerializers:zl(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(qp(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(jp(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Hp(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Kp(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Up(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Vp(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Wp(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Jp(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}getShouldShow(e){var n;const{state:r}=this.view,{selection:i}=r,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),u=Math.max(...o.map(c=>c.$to.pos));return(n=this.shouldShow)==null?void 0:n.call(this,{editor:this.editor,view:this.view,state:r,oldState:e,from:s,to:u})}updatePosition(){const{selection:e}=this.editor.state,n=Hl(this.view,e.from,e.to);Gp({getBoundingClientRect:a(()=>n,"getBoundingClientRect"),getClientRects:a(()=>[n],"getClientRects")},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:i,y:o,strategy:s})=>{this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${i}px`,this.element.style.top=`${o}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,n){const r=!n?.selection.eq(e.state.selection),i=!n?.doc.eq(e.state.doc);this.updateHandler(e,r,i,n)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const n=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=n??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},a(Qn,"FloatingMenuView"),Qn),fk=a(t=>new V({key:typeof t.pluginKey=="string"?new q(t.pluginKey):t.pluginKey,view:a(e=>new dk({view:e,...t}),"view")}),"FloatingMenuPlugin");E.defineComponent({name:"FloatingMenu",inheritAttrs:!1,props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},options:{type:Object,default:a(()=>({}),"default")},appendTo:{type:Object,default:void 0},shouldShow:{type:Function,default:null}},setup(t,{slots:e,attrs:n}){const r=E.ref(null);return E.onMounted(()=>{const{pluginKey:i,editor:o,options:s,appendTo:u,shouldShow:l}=t,c=r.value;c&&(c.style.visibility="hidden",c.style.position="absolute",c.remove(),o.registerPlugin(fk({pluginKey:i,editor:o,element:c,options:s,appendTo:u,shouldShow:l})))}),E.onBeforeUnmount(()=>{const{pluginKey:i,editor:o}=t;o.unregisterPlugin(i)}),()=>{var i;return E.h("div",{ref:r,...n},(i=e.default)==null?void 0:i.call(e))}}});const Bd={};function hk(t){let e=Bd[t];if(e)return e;e=Bd[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}a(hk,"getDecodeCache");function yr(t,e){typeof e!="string"&&(e=yr.defaultChars);const n=hk(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let o=0,s=r.length;o<s;o+=3){const u=parseInt(r.slice(o+1,o+3),16);if(u<128){i+=n[u];continue}if((u&224)===192&&o+3<s){const l=parseInt(r.slice(o+4,o+6),16);if((l&192)===128){const c=u<<6&1984|l&63;c<128?i+="��":i+=String.fromCharCode(c),o+=3;continue}}if((u&240)===224&&o+6<s){const l=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16);if((l&192)===128&&(c&192)===128){const d=u<<12&61440|l<<6&4032|c&63;d<2048||d>=55296&&d<=57343?i+="���":i+=String.fromCharCode(d),o+=6;continue}}if((u&248)===240&&o+9<s){const l=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16),d=parseInt(r.slice(o+10,o+12),16);if((l&192)===128&&(c&192)===128&&(d&192)===128){let f=u<<18&1835008|l<<12&258048|c<<6&4032|d&63;f<65536||f>1114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}i+="�"}return i})}a(yr,"decode$1");yr.defaultChars=";/?:@&=+$,#";yr.componentChars="";const zd={};function pk(t){let e=zd[t];if(e)return e;e=zd[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}a(pk,"getEncodeCache");function bi(t,e,n){typeof e!="string"&&(n=e,e=bi.defaultChars),typeof n>"u"&&(n=!0);const r=pk(e);let i="";for(let o=0,s=t.length;o<s;o++){const u=t.charCodeAt(o);if(n&&u===37&&o+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(o+1,o+3))){i+=t.slice(o,o+3),o+=2;continue}if(u<128){i+=r[u];continue}if(u>=55296&&u<=57343){if(u>=55296&&u<=56319&&o+1<s){const l=t.charCodeAt(o+1);if(l>=56320&&l<=57343){i+=encodeURIComponent(t[o]+t[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[o])}return i}a(bi,"encode$1");bi.defaultChars=";/?:@&=+$,-_.!~*'()#";bi.componentChars="-_.!~*'()";function aa(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}a(aa,"format");function Uo(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}a(Uo,"Url");const mk=/^([a-z0-9.+-]+:)/i,gk=/:[0-9]*$/,bk=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,yk=["<",">",'"',"`"," ","\r",`
|
|
141
|
-
`," "],xk=["{","}","|","\\","^","`"].concat(yk),kk=["'"].concat(xk),$d=["%","/","?",";","#"].concat(kk),Hd=["/","?","#"],wk=255,Vd=/^[+a-z0-9A-Z_-]{0,63}$/,Ck=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jd={javascript:!0,"javascript:":!0},qd={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ca(t,e){if(t&&t instanceof Uo)return t;const n=new Uo;return n.parse(t,e),n}a(ca,"urlParse");Uo.prototype.parse=function(t,e){let n,r,i,o=t;if(o=o.trim(),!e&&t.split("#").length===1){const c=bk.exec(o);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let s=mk.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(e||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&jd[s])&&(o=o.substr(2),this.slashes=!0)),!jd[s]&&(i||s&&!qd[s])){let c=-1;for(let m=0;m<Hd.length;m++)r=o.indexOf(Hd[m]),r!==-1&&(c===-1||r<c)&&(c=r);let d,f;c===-1?f=o.lastIndexOf("@"):f=o.lastIndexOf("@",c),f!==-1&&(d=o.slice(0,f),o=o.slice(f+1),this.auth=d),c=-1;for(let m=0;m<$d.length;m++)r=o.indexOf($d[m]),r!==-1&&(c===-1||r<c)&&(c=r);c===-1&&(c=o.length),o[c-1]===":"&&c--;const h=o.slice(0,c);o=o.slice(c),this.parseHost(h),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const m=this.hostname.split(/\./);for(let g=0,b=m.length;g<b;g++){const y=m[g];if(y&&!y.match(Vd)){let x="";for(let k=0,C=y.length;k<C;k++)y.charCodeAt(k)>127?x+="x":x+=y[k];if(!x.match(Vd)){const k=m.slice(0,g),C=m.slice(g+1),w=y.match(Ck);w&&(k.push(w[1]),C.unshift(w[2])),C.length&&(o=C.join(".")+o),this.hostname=k.join(".");break}}}}this.hostname.length>wk&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const u=o.indexOf("#");u!==-1&&(this.hash=o.substr(u),o=o.slice(0,u));const l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),qd[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Uo.prototype.parseHost=function(t){let e=gk.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const Ek=Object.freeze(Object.defineProperty({__proto__:null,decode:yr,encode:bi,format:aa,parse:ca},Symbol.toStringTag,{value:"Module"})),t0=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,n0=/[\0-\x1F\x7F-\x9F]/,Sk=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,da=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,r0=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,i0=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,vk=Object.freeze(Object.defineProperty({__proto__:null,Any:t0,Cc:n0,Cf:Sk,P:da,S:r0,Z:i0},Symbol.toStringTag,{value:"Module"})),Ak=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),Mk=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var tu;const Tk=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Dk=(tu=String.fromCodePoint)!==null&&tu!==void 0?tu:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function Ok(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Tk.get(t))!==null&&e!==void 0?e:t}a(Ok,"replaceCodePoint");var ne;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(ne||(ne={}));const _k=32;var Ft;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ft||(Ft={}));function ul(t){return t>=ne.ZERO&&t<=ne.NINE}a(ul,"isNumber");function Nk(t){return t>=ne.UPPER_A&&t<=ne.UPPER_F||t>=ne.LOWER_A&&t<=ne.LOWER_F}a(Nk,"isHexadecimalCharacter");function Ik(t){return t>=ne.UPPER_A&&t<=ne.UPPER_Z||t>=ne.LOWER_A&&t<=ne.LOWER_Z||ul(t)}a(Ik,"isAsciiAlphaNumeric");function Rk(t){return t===ne.EQUALS||Ik(t)}a(Rk,"isEntityInAttributeInvalidEnd");var te;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(te||(te={}));var It;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(It||(It={}));const Xa=class Xa{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=te.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=It.Strict}startEntity(e){this.decodeMode=e,this.state=te.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case te.EntityStart:return e.charCodeAt(n)===ne.NUM?(this.state=te.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=te.NamedEntity,this.stateNamedEntity(e,n));case te.NumericStart:return this.stateNumericStart(e,n);case te.NumericDecimal:return this.stateNumericDecimal(e,n);case te.NumericHex:return this.stateNumericHex(e,n);case te.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|_k)===ne.LOWER_X?(this.state=te.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=te.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(e.substr(n,o),i),this.consumed+=o}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(ul(i)||Nk(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(ul(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ne.SEMI)this.consumed+=1;else if(this.decodeMode===It.Strict)return 0;return this.emitCodePoint(Ok(this.result),this.consumed),this.errors&&(e!==ne.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],o=(i&Ft.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const s=e.charCodeAt(n);if(this.treeIndex=Fk(r,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===It.Attribute&&(o===0||Rk(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&Ft.VALUE_LENGTH)>>14,o!==0){if(s===ne.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==It.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Ft.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Ft.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case te.NamedEntity:return this.result!==0&&(this.decodeMode!==It.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case te.NumericDecimal:return this.emitNumericEntity(0,2);case te.NumericHex:return this.emitNumericEntity(0,3);case te.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case te.EntityStart:return 0}}};a(Xa,"EntityDecoder");let ll=Xa;function o0(t){let e="";const n=new ll(t,r=>e+=Dk(r));return a(function(i,o){let s=0,u=0;for(;(u=i.indexOf("&",u))>=0;){e+=i.slice(s,u),n.startEntity(o);const c=n.write(i,u+1);if(c<0){s=u+n.end();break}s=u+c,u=c===0?s+1:s}const l=e+i.slice(s);return e="",l},"decodeWithTrie")}a(o0,"getDecoder");function Fk(t,e,n,r){const i=(e&Ft.BRANCH_LENGTH)>>7,o=e&Ft.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const l=r-o;return l<0||l>=i?-1:t[n+l]-1}let s=n,u=s+i-1;for(;s<=u;){const l=s+u>>>1,c=t[l];if(c<r)s=l+1;else if(c>r)u=l-1;else return t[l+i]}return-1}a(Fk,"determineBranch");const Lk=o0(Ak);o0(Mk);function s0(t,e=It.Legacy){return Lk(t,e)}a(s0,"decodeHTML");function Pk(t){return Object.prototype.toString.call(t)}a(Pk,"_class$1");function fa(t){return Pk(t)==="[object String]"}a(fa,"isString$1");const Bk=Object.prototype.hasOwnProperty;function zk(t,e){return Bk.call(t,e)}a(zk,"has");function Es(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}a(Es,"assign$1");function u0(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}a(u0,"arrayReplaceAt");function ha(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}a(ha,"isValidEntityCode");function Wo(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}a(Wo,"fromCodePoint");const l0=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,$k=/&([a-z#][a-z0-9]{1,31});/gi,Hk=new RegExp(l0.source+"|"+$k.source,"gi"),Vk=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function jk(t,e){if(e.charCodeAt(0)===35&&Vk.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return ha(r)?Wo(r):t}const n=s0(t);return n!==t?n:t}a(jk,"replaceEntityPattern");function qk(t){return t.indexOf("\\")<0?t:t.replace(l0,"$1")}a(qk,"unescapeMd");function xr(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Hk,function(e,n,r){return n||jk(e,r)})}a(xr,"unescapeAll");const Uk=/[&<>"]/,Wk=/[&<>"]/g,Kk={"&":"&","<":"<",">":">",'"':"""};function Jk(t){return Kk[t]}a(Jk,"replaceUnsafeChar");function Kt(t){return Uk.test(t)?t.replace(Wk,Jk):t}a(Kt,"escapeHtml");const Gk=/[.?*+^$[\]\\(){}|-]/g;function Zk(t){return t.replace(Gk,"\\$&")}a(Zk,"escapeRE$1");function W(t){switch(t){case 9:case 32:return!0}return!1}a(W,"isSpace");function ui(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}a(ui,"isWhiteSpace");function li(t){return da.test(t)||r0.test(t)}a(li,"isPunctChar");function ai(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}a(ai,"isMdAsciiPunct");function Ss(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}a(Ss,"normalizeReference");const Xk={mdurl:Ek,ucmicro:vk},Yk=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:u0,assign:Es,escapeHtml:Kt,escapeRE:Zk,fromCodePoint:Wo,has:zk,isMdAsciiPunct:ai,isPunctChar:li,isSpace:W,isString:fa,isValidEntityCode:ha,isWhiteSpace:ui,lib:Xk,normalizeReference:Ss,unescapeAll:xr,unescapeMd:qk},Symbol.toStringTag,{value:"Module"}));function Qk(t,e,n){let r,i,o,s;const u=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos<u;){if(o=t.src.charCodeAt(t.pos),o===93&&(r--,r===0)){i=!0;break}if(s=t.pos,t.md.inline.skipToken(t),o===91){if(s===t.pos-1)r++;else if(n)return t.pos=l,-1}}let c=-1;return i&&(c=t.pos),t.pos=l,c}a(Qk,"parseLinkLabel");function e3(t,e,n){let r,i=e;const o={ok:!1,pos:0,str:""};if(t.charCodeAt(i)===60){for(i++;i<n;){if(r=t.charCodeAt(i),r===10||r===60)return o;if(r===62)return o.pos=i+1,o.str=xr(t.slice(e+1,i)),o.ok=!0,o;if(r===92&&i+1<n){i+=2;continue}i++}return o}let s=0;for(;i<n&&(r=t.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(t.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(s++,s>32))return o;if(r===41){if(s===0)break;s--}i++}return e===i||s!==0||(o.str=xr(t.slice(e,i)),o.pos=i,o.ok=!0),o}a(e3,"parseLinkDestination");function t3(t,e,n,r){let i,o=e;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let u=t.charCodeAt(o);if(u!==34&&u!==39&&u!==40)return s;e++,o++,u===40&&(u=41),s.marker=u}for(;o<n;){if(i=t.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=xr(t.slice(e,o)),s.ok=!0,s;if(i===40&&s.marker===41)return s;i===92&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=xr(t.slice(e,o)),s}a(t3,"parseLinkTitle");const n3=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:e3,parseLinkLabel:Qk,parseLinkTitle:t3},Symbol.toStringTag,{value:"Module"})),it={};it.code_inline=function(t,e,n,r,i){const o=t[e];return"<code"+i.renderAttrs(o)+">"+Kt(o.content)+"</code>"};it.code_block=function(t,e,n,r,i){const o=t[e];return"<pre"+i.renderAttrs(o)+"><code>"+Kt(t[e].content)+`</code></pre>
|
|
142
|
-
`};it.fence=function(t,e,n,r,i){const o=t[e],s=o.info?xr(o.info).trim():"";let u="",l="";if(s){const d=s.split(/(\s+)/g);u=d[0],l=d.slice(2).join("")}let c;if(n.highlight?c=n.highlight(o.content,u,l)||Kt(o.content):c=Kt(o.content),c.indexOf("<pre")===0)return c+`
|
|
143
|
-
`;if(s){const d=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];d<0?f.push(["class",n.langPrefix+u]):(f[d]=f[d].slice(),f[d][1]+=" "+n.langPrefix+u);const h={attrs:f};return`<pre><code${i.renderAttrs(h)}>${c}</code></pre>
|
|
144
|
-
`}return`<pre><code${i.renderAttrs(o)}>${c}</code></pre>
|
|
145
|
-
`};it.image=function(t,e,n,r,i){const o=t[e];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(t,e,n)};it.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
|
|
146
|
-
`:`<br>
|
|
147
|
-
`};it.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
|
|
148
|
-
`:`<br>
|
|
149
|
-
`:`
|
|
150
|
-
`};it.text=function(t,e){return Kt(t[e].content)};it.html_block=function(t,e){return t[e].content};it.html_inline=function(t,e){return t[e].content};function Cr(){this.rules=Es({},it)}a(Cr,"Renderer");Cr.prototype.renderAttrs=a(function(e){let n,r,i;if(!e.attrs)return"";for(i="",n=0,r=e.attrs.length;n<r;n++)i+=" "+Kt(e.attrs[n][0])+'="'+Kt(e.attrs[n][1])+'"';return i},"renderAttrs");Cr.prototype.renderToken=a(function(e,n,r){const i=e[n];let o="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&e[n-1].hidden&&(o+=`
|
|
151
|
-
`),o+=(i.nesting===-1?"</":"<")+i.tag,o+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(o+=" /");let s=!1;if(i.block&&(s=!0,i.nesting===1&&n+1<e.length)){const u=e[n+1];(u.type==="inline"||u.hidden||u.nesting===-1&&u.tag===i.tag)&&(s=!1)}return o+=s?`>
|
|
152
|
-
`:">",o},"renderToken");Cr.prototype.renderInline=function(t,e,n){let r="";const i=this.rules;for(let o=0,s=t.length;o<s;o++){const u=t[o].type;typeof i[u]<"u"?r+=i[u](t,o,e,n,this):r+=this.renderToken(t,o,e)}return r};Cr.prototype.renderInlineAsText=function(t,e,n){let r="";for(let i=0,o=t.length;i<o;i++)switch(t[i].type){case"text":r+=t[i].content;break;case"image":r+=this.renderInlineAsText(t[i].children,e,n);break;case"html_inline":case"html_block":r+=t[i].content;break;case"softbreak":case"hardbreak":r+=`
|
|
153
|
-
`;break}return r};Cr.prototype.render=function(t,e,n){let r="";const i=this.rules;for(let o=0,s=t.length;o<s;o++){const u=t[o].type;u==="inline"?r+=this.renderInline(t[o].children,e,n):typeof i[u]<"u"?r+=i[u](t,o,e,n,this):r+=this.renderToken(t,o,e,n)}return r};function Ce(){this.__rules__=[],this.__cache__=null}a(Ce,"Ruler");Ce.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Ce.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};Ce.prototype.at=function(t,e,n){const r=this.__find__(t),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Ce.prototype.before=function(t,e,n,r){const i=this.__find__(t),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Ce.prototype.after=function(t,e,n,r){const i=this.__find__(t),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Ce.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};Ce.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};Ce.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};Ce.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};Ce.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function Ve(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}a(Ve,"Token");Ve.prototype.attrIndex=a(function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===e)return r;return-1},"attrIndex");Ve.prototype.attrPush=a(function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},"attrPush");Ve.prototype.attrSet=a(function(e,n){const r=this.attrIndex(e),i=[e,n];r<0?this.attrPush(i):this.attrs[r]=i},"attrSet");Ve.prototype.attrGet=a(function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r},"attrGet");Ve.prototype.attrJoin=a(function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n},"attrJoin");function a0(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}a(a0,"StateCore");a0.prototype.Token=Ve;const r3=/\r\n?|\n/g,i3=/\0/g;function o3(t){let e;e=t.src.replace(r3,`
|
|
154
|
-
`),e=e.replace(i3,"�"),t.src=e}a(o3,"normalize");function s3(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}a(s3,"block");function u3(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const i=e[n];i.type==="inline"&&t.md.inline.parse(i.content,t.md,t.env,i.children)}}a(u3,"inline");function l3(t){return/^<a[>\s]/i.test(t)}a(l3,"isLinkOpen$1");function a3(t){return/^<\/a\s*>/i.test(t)}a(a3,"isLinkClose$1");function c3(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let i=e[n].children,o=0;for(let s=i.length-1;s>=0;s--){const u=i[s];if(u.type==="link_close"){for(s--;i[s].level!==u.level&&i[s].type!=="link_open";)s--;continue}if(u.type==="html_inline"&&(l3(u.content)&&o>0&&o--,a3(u.content)&&o++),!(o>0)&&u.type==="text"&&t.md.linkify.test(u.content)){const l=u.content;let c=t.md.linkify.match(l);const d=[];let f=u.level,h=0;c.length>0&&c[0].index===0&&s>0&&i[s-1].type==="text_special"&&(c=c.slice(1));for(let p=0;p<c.length;p++){const m=c[p].url,g=t.md.normalizeLink(m);if(!t.md.validateLink(g))continue;let b=c[p].text;c[p].schema?c[p].schema==="mailto:"&&!/^mailto:/i.test(b)?b=t.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=t.md.normalizeLinkText(b):b=t.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");const y=c[p].index;if(y>h){const w=new t.Token("text","",0);w.content=l.slice(h,y),w.level=f,d.push(w)}const x=new t.Token("link_open","a",1);x.attrs=[["href",g]],x.level=f++,x.markup="linkify",x.info="auto",d.push(x);const k=new t.Token("text","",0);k.content=b,k.level=f,d.push(k);const C=new t.Token("link_close","a",-1);C.level=--f,C.markup="linkify",C.info="auto",d.push(C),h=c[p].lastIndex}if(h<l.length){const p=new t.Token("text","",0);p.content=l.slice(h),p.level=f,d.push(p)}e[n].children=i=u0(i,s,d)}}}}a(c3,"linkify$1");const c0=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,d3=/\((c|tm|r)\)/i,f3=/\((c|tm|r)\)/ig,h3={c:"©",r:"®",tm:"™"};function p3(t,e){return h3[e.toLowerCase()]}a(p3,"replaceFn");function m3(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(f3,p3)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}a(m3,"replace_scoped");function g3(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&c0.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}a(g3,"replace_rare");function b3(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(d3.test(t.tokens[e].content)&&m3(t.tokens[e].children),c0.test(t.tokens[e].content)&&g3(t.tokens[e].children))}a(b3,"replace");const y3=/['"]/,Ud=/['"]/g,Wd="’";function Ii(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}a(Ii,"replaceAt");function x3(t,e){let n;const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=t[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!=="text")continue;let u=o.content,l=0,c=u.length;e:for(;l<c;){Ud.lastIndex=l;const d=Ud.exec(u);if(!d)break;let f=!0,h=!0;l=d.index+1;const p=d[0]==="'";let m=32;if(d.index-1>=0)m=u.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){m=t[n].content.charCodeAt(t[n].content.length-1);break}let g=32;if(l<c)g=u.charCodeAt(l);else for(n=i+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){g=t[n].content.charCodeAt(0);break}const b=ai(m)||li(String.fromCharCode(m)),y=ai(g)||li(String.fromCharCode(g)),x=ui(m),k=ui(g);if(k?f=!1:y&&(x||b||(f=!1)),x?h=!1:b&&(k||y||(h=!1)),g===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=b,h=y),!f&&!h){p&&(o.content=Ii(o.content,d.index,Wd));continue}if(h)for(n=r.length-1;n>=0;n--){let C=r[n];if(r[n].level<s)break;if(C.single===p&&r[n].level===s){C=r[n];let w,S;p?(w=e.md.options.quotes[2],S=e.md.options.quotes[3]):(w=e.md.options.quotes[0],S=e.md.options.quotes[1]),o.content=Ii(o.content,d.index,S),t[C.token].content=Ii(t[C.token].content,C.pos,w),l+=S.length-1,C.token===i&&(l+=w.length-1),u=o.content,c=u.length,r.length=n;continue e}}f?r.push({token:i,pos:d.index,single:p,level:s}):h&&p&&(o.content=Ii(o.content,d.index,Wd))}}}a(x3,"process_inlines");function k3(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!y3.test(t.tokens[e].content)||x3(t.tokens[e].children,t)}a(k3,"smartquotes");function w3(t){let e,n;const r=t.tokens,i=r.length;for(let o=0;o<i;o++){if(r[o].type!=="inline")continue;const s=r[o].children,u=s.length;for(e=0;e<u;e++)s[e].type==="text_special"&&(s[e].type="text");for(e=n=0;e<u;e++)s[e].type==="text"&&e+1<u&&s[e+1].type==="text"?s[e+1].content=s[e].content+s[e+1].content:(e!==n&&(s[n]=s[e]),n++);e!==n&&(s.length=n)}}a(w3,"text_join");const nu=[["normalize",o3],["block",s3],["inline",u3],["linkify",c3],["replacements",b3],["smartquotes",k3],["text_join",w3]];function pa(){this.ruler=new Ce;for(let t=0;t<nu.length;t++)this.ruler.push(nu[t][0],nu[t][1])}a(pa,"Core");pa.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};pa.prototype.State=a0;function ot(t,e,n,r){this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let o=0,s=0,u=0,l=0,c=i.length,d=!1;s<c;s++){const f=i.charCodeAt(s);if(!d)if(W(f)){u++,f===9?l+=4-l%4:l++;continue}else d=!0;(f===10||s===c-1)&&(f!==10&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(u),this.sCount.push(l),this.bsCount.push(0),d=!1,u=0,l=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}a(ot,"StateBlock");ot.prototype.push=function(t,e,n){const r=new Ve(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};ot.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");ot.prototype.skipEmptyLines=a(function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},"skipEmptyLines");ot.prototype.skipSpaces=a(function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!W(r))break}return e},"skipSpaces");ot.prototype.skipSpacesBack=a(function(e,n){if(e<=n)return e;for(;e>n;)if(!W(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");ot.prototype.skipChars=a(function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e},"skipChars");ot.prototype.skipCharsBack=a(function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e},"skipCharsBack");ot.prototype.getLines=a(function(e,n,r,i){if(e>=n)return"";const o=new Array(n-e);for(let s=0,u=e;u<n;u++,s++){let l=0;const c=this.bMarks[u];let d=c,f;for(u+1<n||i?f=this.eMarks[u]+1:f=this.eMarks[u];d<f&&l<r;){const h=this.src.charCodeAt(d);if(W(h))h===9?l+=4-(l+this.bsCount[u])%4:l++;else if(d-c<this.tShift[u])l++;else break;d++}l>r?o[s]=new Array(l-r+1).join(" ")+this.src.slice(d,f):o[s]=this.src.slice(d,f)}return o.join("")},"getLines");ot.prototype.Token=Ve;const C3=65536;function ru(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}a(ru,"getLine");function Kd(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),o=!1,s=0,u="";for(;r<n;)i===124&&(o?(u+=t.substring(s,r-1),s=r):(e.push(u+t.substring(s,r)),u="",s=r+1)),o=i===92,r++,i=t.charCodeAt(r);return e.push(u+t.substring(s)),e}a(Kd,"escapedSplit");function E3(t,e,n,r){if(e+2>n)return!1;let i=e+1;if(t.sCount[i]<t.blkIndent||t.sCount[i]-t.blkIndent>=4)return!1;let o=t.bMarks[i]+t.tShift[i];if(o>=t.eMarks[i])return!1;const s=t.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=t.eMarks[i])return!1;const u=t.src.charCodeAt(o++);if(u!==124&&u!==45&&u!==58&&!W(u)||s===45&&W(u))return!1;for(;o<t.eMarks[i];){const C=t.src.charCodeAt(o);if(C!==124&&C!==45&&C!==58&&!W(C))return!1;o++}let l=ru(t,e+1),c=l.split("|");const d=[];for(let C=0;C<c.length;C++){const w=c[C].trim();if(!w){if(C===0||C===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(w))return!1;w.charCodeAt(w.length-1)===58?d.push(w.charCodeAt(0)===58?"center":"right"):w.charCodeAt(0)===58?d.push("left"):d.push("")}if(l=ru(t,e).trim(),l.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;c=Kd(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const f=c.length;if(f===0||f!==d.length)return!1;if(r)return!0;const h=t.parentType;t.parentType="table";const p=t.md.block.ruler.getRules("blockquote"),m=t.push("table_open","table",1),g=[e,0];m.map=g;const b=t.push("thead_open","thead",1);b.map=[e,e+1];const y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let C=0;C<c.length;C++){const w=t.push("th_open","th",1);d[C]&&(w.attrs=[["style","text-align:"+d[C]]]);const S=t.push("inline","",0);S.content=c[C].trim(),S.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let x,k=0;for(i=e+2;i<n&&!(t.sCount[i]<t.blkIndent);i++){let C=!1;for(let S=0,v=p.length;S<v;S++)if(p[S](t,i,n,!0)){C=!0;break}if(C||(l=ru(t,i).trim(),!l)||t.sCount[i]-t.blkIndent>=4||(c=Kd(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),k+=f-c.length,k>C3))break;if(i===e+2){const S=t.push("tbody_open","tbody",1);S.map=x=[e+2,0]}const w=t.push("tr_open","tr",1);w.map=[i,i+1];for(let S=0;S<f;S++){const v=t.push("td_open","td",1);d[S]&&(v.attrs=[["style","text-align:"+d[S]]]);const D=t.push("inline","",0);D.content=c[S]?c[S].trim():"",D.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return x&&(t.push("tbody_close","tbody",-1),x[1]=i),t.push("table_close","table",-1),g[1]=i,t.parentType=h,t.line=i,!0}a(E3,"table");function S3(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,i=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,i=r;continue}break}t.line=i;const o=t.push("code_block","code",0);return o.content=t.getLines(e,i,4+t.blkIndent,!1)+`
|
|
155
|
-
`,o.map=[e,t.line],!0}a(S3,"code");function v3(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>o)return!1;const s=t.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let u=i;i=t.skipChars(i,s);let l=i-u;if(l<3)return!1;const c=t.src.slice(u,i),d=t.src.slice(i,o);if(s===96&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=e,h=!1;for(;f++,!(f>=n||(i=u=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],i<o&&t.sCount[f]<t.blkIndent));)if(t.src.charCodeAt(i)===s&&!(t.sCount[f]-t.blkIndent>=4)&&(i=t.skipChars(i,s),!(i-u<l)&&(i=t.skipSpaces(i),!(i<o)))){h=!0;break}l=t.sCount[e],t.line=f+(h?1:0);const p=t.push("fence","code",0);return p.info=d,p.content=t.getLines(e+1,f,l,!0),p.markup=c,p.map=[e,t.line],!0}a(v3,"fence");function A3(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];const s=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const u=[],l=[],c=[],d=[],f=t.md.block.ruler.getRules("blockquote"),h=t.parentType;t.parentType="blockquote";let p=!1,m;for(m=e;m<n;m++){const k=t.sCount[m]<t.blkIndent;if(i=t.bMarks[m]+t.tShift[m],o=t.eMarks[m],i>=o)break;if(t.src.charCodeAt(i++)===62&&!k){let w=t.sCount[m]+1,S,v;t.src.charCodeAt(i)===32?(i++,w++,v=!1,S=!0):t.src.charCodeAt(i)===9?(S=!0,(t.bsCount[m]+w)%4===3?(i++,w++,v=!1):v=!0):S=!1;let D=w;for(u.push(t.bMarks[m]),t.bMarks[m]=i;i<o;){const O=t.src.charCodeAt(i);if(W(O))O===9?D+=4-(D+t.bsCount[m]+(v?1:0))%4:D++;else break;i++}p=i>=o,l.push(t.bsCount[m]),t.bsCount[m]=t.sCount[m]+1+(S?1:0),c.push(t.sCount[m]),t.sCount[m]=D-w,d.push(t.tShift[m]),t.tShift[m]=i-t.bMarks[m];continue}if(p)break;let C=!1;for(let w=0,S=f.length;w<S;w++)if(f[w](t,m,n,!0)){C=!0;break}if(C){t.lineMax=m,t.blkIndent!==0&&(u.push(t.bMarks[m]),l.push(t.bsCount[m]),d.push(t.tShift[m]),c.push(t.sCount[m]),t.sCount[m]-=t.blkIndent);break}u.push(t.bMarks[m]),l.push(t.bsCount[m]),d.push(t.tShift[m]),c.push(t.sCount[m]),t.sCount[m]=-1}const g=t.blkIndent;t.blkIndent=0;const b=t.push("blockquote_open","blockquote",1);b.markup=">";const y=[e,0];b.map=y,t.md.block.tokenize(t,e,m);const x=t.push("blockquote_close","blockquote",-1);x.markup=">",t.lineMax=s,t.parentType=h,y[1]=t.line;for(let k=0;k<d.length;k++)t.bMarks[k+e]=u[k],t.tShift[k+e]=d[k],t.sCount[k+e]=c[k],t.bsCount[k+e]=l[k];return t.blkIndent=g,!0}a(A3,"blockquote");function M3(t,e,n,r){const i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let u=1;for(;o<i;){const c=t.src.charCodeAt(o++);if(c!==s&&!W(c))return!1;c===s&&u++}if(u<3)return!1;if(r)return!0;t.line=e+1;const l=t.push("hr","hr",0);return l.map=[e,t.line],l.markup=Array(u+1).join(String.fromCharCode(s)),!0}a(M3,"hr");function Jd(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const i=t.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const o=t.src.charCodeAt(r);if(!W(o))return-1}return r}a(Jd,"skipBulletListMarker");function Gd(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let i=n;if(i+1>=r)return-1;let o=t.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=t.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i<r&&(o=t.src.charCodeAt(i),!W(o))?-1:i}a(Gd,"skipOrderedListMarker");function T3(t,e){const n=t.level+2;for(let r=e+2,i=t.tokens.length-2;r<i;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}a(T3,"markTightParagraphs");function D3(t,e,n,r){let i,o,s,u,l=e,c=!0;if(t.sCount[l]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]<t.blkIndent)return!1;let d=!1;r&&t.parentType==="paragraph"&&t.sCount[l]>=t.blkIndent&&(d=!0);let f,h,p;if((p=Gd(t,l))>=0){if(f=!0,s=t.bMarks[l]+t.tShift[l],h=Number(t.src.slice(s,p-1)),d&&h!==1)return!1}else if((p=Jd(t,l))>=0)f=!1;else return!1;if(d&&t.skipSpaces(p)>=t.eMarks[l])return!1;if(r)return!0;const m=t.src.charCodeAt(p-1),g=t.tokens.length;f?(u=t.push("ordered_list_open","ol",1),h!==1&&(u.attrs=[["start",h]])):u=t.push("bullet_list_open","ul",1);const b=[l,0];u.map=b,u.markup=String.fromCharCode(m);let y=!1;const x=t.md.block.ruler.getRules("list"),k=t.parentType;for(t.parentType="list";l<n;){o=p,i=t.eMarks[l];const C=t.sCount[l]+p-(t.bMarks[l]+t.tShift[l]);let w=C;for(;o<i;){const B=t.src.charCodeAt(o);if(B===9)w+=4-(w+t.bsCount[l])%4;else if(B===32)w++;else break;o++}const S=o;let v;S>=i?v=1:v=w-C,v>4&&(v=1);const D=C+v;u=t.push("list_item_open","li",1),u.markup=String.fromCharCode(m);const O=[l,0];u.map=O,f&&(u.info=t.src.slice(s,p-1));const N=t.tight,$=t.tShift[l],U=t.sCount[l],G=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=D,t.tight=!0,t.tShift[l]=S-t.bMarks[l],t.sCount[l]=w,S>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||y)&&(c=!1),y=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=G,t.tShift[l]=$,t.sCount[l]=U,t.tight=N,u=t.push("list_item_close","li",-1),u.markup=String.fromCharCode(m),l=t.line,O[1]=l,l>=n||t.sCount[l]<t.blkIndent||t.sCount[l]-t.blkIndent>=4)break;let P=!1;for(let B=0,X=x.length;B<X;B++)if(x[B](t,l,n,!0)){P=!0;break}if(P)break;if(f){if(p=Gd(t,l),p<0)break;s=t.bMarks[l]+t.tShift[l]}else if(p=Jd(t,l),p<0)break;if(m!==t.src.charCodeAt(p-1))break}return f?u=t.push("ordered_list_close","ol",-1):u=t.push("bullet_list_close","ul",-1),u.markup=String.fromCharCode(m),b[1]=l,t.line=l,t.parentType=k,c&&T3(t,g),!0}a(D3,"list");function O3(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],s=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==91)return!1;function u(x){const k=t.lineMax;if(x>=k||t.isEmpty(x))return null;let C=!1;if(t.sCount[x]-t.blkIndent>3&&(C=!0),t.sCount[x]<0&&(C=!0),!C){const v=t.md.block.ruler.getRules("reference"),D=t.parentType;t.parentType="reference";let O=!1;for(let N=0,$=v.length;N<$;N++)if(v[N](t,x,k,!0)){O=!0;break}if(t.parentType=D,O)return null}const w=t.bMarks[x]+t.tShift[x],S=t.eMarks[x];return t.src.slice(w,S+1)}a(u,"getNextLine");let l=t.src.slice(i,o+1);o=l.length;let c=-1;for(i=1;i<o;i++){const x=l.charCodeAt(i);if(x===91)return!1;if(x===93){c=i;break}else if(x===10){const k=u(s);k!==null&&(l+=k,o=l.length,s++)}else if(x===92&&(i++,i<o&&l.charCodeAt(i)===10)){const k=u(s);k!==null&&(l+=k,o=l.length,s++)}}if(c<0||l.charCodeAt(c+1)!==58)return!1;for(i=c+2;i<o;i++){const x=l.charCodeAt(i);if(x===10){const k=u(s);k!==null&&(l+=k,o=l.length,s++)}else if(!W(x))break}const d=t.md.helpers.parseLinkDestination(l,i,o);if(!d.ok)return!1;const f=t.md.normalizeLink(d.str);if(!t.md.validateLink(f))return!1;i=d.pos;const h=i,p=s,m=i;for(;i<o;i++){const x=l.charCodeAt(i);if(x===10){const k=u(s);k!==null&&(l+=k,o=l.length,s++)}else if(!W(x))break}let g=t.md.helpers.parseLinkTitle(l,i,o);for(;g.can_continue;){const x=u(s);if(x===null)break;l+=x,i=o,o=l.length,s++,g=t.md.helpers.parseLinkTitle(l,i,o,g)}let b;for(i<o&&m!==i&&g.ok?(b=g.str,i=g.pos):(b="",i=h,s=p);i<o;){const x=l.charCodeAt(i);if(!W(x))break;i++}if(i<o&&l.charCodeAt(i)!==10&&b)for(b="",i=h,s=p;i<o;){const x=l.charCodeAt(i);if(!W(x))break;i++}if(i<o&&l.charCodeAt(i)!==10)return!1;const y=Ss(l.slice(1,c));return y?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[y]>"u"&&(t.env.references[y]={title:b,href:f}),t.line=s),!0):!1}a(O3,"reference");const _3=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],N3="[a-zA-Z_:][a-zA-Z0-9:._-]*",I3="[^\"'=<>`\\x00-\\x20]+",R3="'[^']*'",F3='"[^"]*"',L3="(?:"+I3+"|"+R3+"|"+F3+")",P3="(?:\\s+"+N3+"(?:\\s*=\\s*"+L3+")?)",d0="<[A-Za-z][A-Za-z0-9\\-]*"+P3+"*\\s*\\/?>",f0="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",B3="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",z3="<[?][\\s\\S]*?[?]>",$3="<![A-Za-z][^>]*>",H3="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",V3=new RegExp("^(?:"+d0+"|"+f0+"|"+B3+"|"+z3+"|"+$3+"|"+H3+")"),j3=new RegExp("^(?:"+d0+"|"+f0+")"),_n=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+_3.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(j3.source+"\\s*$"),/^$/,!1]];function q3(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let s=t.src.slice(i,o),u=0;for(;u<_n.length&&!_n[u][0].test(s);u++);if(u===_n.length)return!1;if(r)return _n[u][2];let l=e+1;if(!_n[u][1].test(s)){for(;l<n&&!(t.sCount[l]<t.blkIndent);l++)if(i=t.bMarks[l]+t.tShift[l],o=t.eMarks[l],s=t.src.slice(i,o),_n[u][1].test(s)){s.length!==0&&l++;break}}t.line=l;const c=t.push("html_block","",0);return c.map=[e,l],c.content=t.getLines(e,l,t.blkIndent,!0),!0}a(q3,"html_block");function U3(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.src.charCodeAt(i);if(s!==35||i>=o)return!1;let u=1;for(s=t.src.charCodeAt(++i);s===35&&i<o&&u<=6;)u++,s=t.src.charCodeAt(++i);if(u>6||i<o&&!W(s))return!1;if(r)return!0;o=t.skipSpacesBack(o,i);const l=t.skipCharsBack(o,35,i);l>i&&W(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;const c=t.push("heading_open","h"+String(u),1);c.markup="########".slice(0,u),c.map=[e,t.line];const d=t.push("inline","",0);d.content=t.src.slice(i,o).trim(),d.map=[e,t.line],d.children=[];const f=t.push("heading_close","h"+String(u),-1);return f.markup="########".slice(0,u),!0}a(U3,"heading");function W3(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let o=0,s,u=e+1;for(;u<n&&!t.isEmpty(u);u++){if(t.sCount[u]-t.blkIndent>3)continue;if(t.sCount[u]>=t.blkIndent){let p=t.bMarks[u]+t.tShift[u];const m=t.eMarks[u];if(p<m&&(s=t.src.charCodeAt(p),(s===45||s===61)&&(p=t.skipChars(p,s),p=t.skipSpaces(p),p>=m))){o=s===61?1:2;break}}if(t.sCount[u]<0)continue;let h=!1;for(let p=0,m=r.length;p<m;p++)if(r[p](t,u,n,!0)){h=!0;break}if(h)break}if(!o)return!1;const l=t.getLines(e,u,t.blkIndent,!1).trim();t.line=u+1;const c=t.push("heading_open","h"+String(o),1);c.markup=String.fromCharCode(s),c.map=[e,t.line];const d=t.push("inline","",0);d.content=l,d.map=[e,t.line-1],d.children=[];const f=t.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(s),t.parentType=i,!0}a(W3,"lheading");function K3(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),i=t.parentType;let o=e+1;for(t.parentType="paragraph";o<n&&!t.isEmpty(o);o++){if(t.sCount[o]-t.blkIndent>3||t.sCount[o]<0)continue;let c=!1;for(let d=0,f=r.length;d<f;d++)if(r[d](t,o,n,!0)){c=!0;break}if(c)break}const s=t.getLines(e,o,t.blkIndent,!1).trim();t.line=o;const u=t.push("paragraph_open","p",1);u.map=[e,t.line];const l=t.push("inline","",0);return l.content=s,l.map=[e,t.line],l.children=[],t.push("paragraph_close","p",-1),t.parentType=i,!0}a(K3,"paragraph");const Ri=[["table",E3,["paragraph","reference"]],["code",S3],["fence",v3,["paragraph","reference","blockquote","list"]],["blockquote",A3,["paragraph","reference","blockquote","list"]],["hr",M3,["paragraph","reference","blockquote","list"]],["list",D3,["paragraph","reference","blockquote"]],["reference",O3],["html_block",q3,["paragraph","reference","blockquote"]],["heading",U3,["paragraph","reference","blockquote"]],["lheading",W3],["paragraph",K3]];function vs(){this.ruler=new Ce;for(let t=0;t<Ri.length;t++)this.ruler.push(Ri[t][0],Ri[t][1],{alt:(Ri[t][2]||[]).slice()})}a(vs,"ParserBlock");vs.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),i=r.length,o=t.md.options.maxNesting;let s=e,u=!1;for(;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n||t.sCount[s]<t.blkIndent));){if(t.level>=o){t.line=n;break}const l=t.line;let c=!1;for(let d=0;d<i;d++)if(c=r[d](t,s,n,!1),c){if(l>=t.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");t.tight=!u,t.isEmpty(t.line-1)&&(u=!0),s=t.line,s<n&&t.isEmpty(s)&&(u=!0,s++,t.line=s)}};vs.prototype.parse=function(t,e,n,r){if(!t)return;const i=new this.State(t,e,n,r);this.tokenize(i,i.line,i.lineMax)};vs.prototype.State=ot;function yi(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}a(yi,"StateInline");yi.prototype.pushPending=function(){const t=new Ve("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};yi.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new Ve(t,e,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};yi.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let o=t;for(;o<n&&this.src.charCodeAt(o)===r;)o++;const s=o-t,u=o<n?this.src.charCodeAt(o):32,l=ai(i)||li(String.fromCharCode(i)),c=ai(u)||li(String.fromCharCode(u)),d=ui(i),f=ui(u),h=!f&&(!c||d||l),p=!d&&(!l||f||c);return{can_open:h&&(e||!p||l),can_close:p&&(e||!h||c),length:s}};yi.prototype.Token=Ve;function J3(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}a(J3,"isTerminatorChar");function G3(t,e){let n=t.pos;for(;n<t.posMax&&!J3(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}a(G3,"text");const Z3=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function X3(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match(Z3);if(!i)return!1;const o=i[1],s=t.md.linkify.matchAtStart(t.src.slice(n-o.length));if(!s)return!1;let u=s.url;if(u.length<=o.length)return!1;u=u.replace(/\*+$/,"");const l=t.md.normalizeLink(u);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-o.length);const c=t.push("link_open","a",1);c.attrs=[["href",l]],c.markup="linkify",c.info="auto";const d=t.push("text","",0);d.content=t.md.normalizeLinkText(u);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=u.length-o.length,!0}a(X3,"linkify");function Y3(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&t.pending.charCodeAt(o-1)===32;)o--;t.pending=t.pending.slice(0,o),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<i&&W(t.src.charCodeAt(n));)n++;return t.pos=n,!0}a(Y3,"newline");const ma=[];for(let t=0;t<256;t++)ma.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){ma[t.charCodeAt(0)]=1});function Q3(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(i=t.src.charCodeAt(n),!!W(i));)n++;return t.pos=n,!0}let o=t.src[n];if(i>=55296&&i<=56319&&n+1<r){const u=t.src.charCodeAt(n+1);u>=56320&&u<=57343&&(o+=t.src[n+1],n++)}const s="\\"+o;if(!e){const u=t.push("text_special","",0);i<256&&ma[i]!==0?u.content=o:u.content=s,u.markup=s,u.info="escape"}return t.pos=n+1,!0}a(Q3,"escape");function e6(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=t.posMax;for(;n<o&&t.src.charCodeAt(n)===96;)n++;const s=t.src.slice(i,n),u=s.length;if(t.backticksScanned&&(t.backticks[u]||0)<=i)return e||(t.pending+=s),t.pos+=u,!0;let l=n,c;for(;(c=t.src.indexOf("`",l))!==-1;){for(l=c+1;l<o&&t.src.charCodeAt(l)===96;)l++;const d=l-c;if(d===u){if(!e){const f=t.push("code_inline","code",0);f.markup=s,f.content=t.src.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=l,!0}t.backticks[d]=c}return t.backticksScanned=!0,e||(t.pending+=s),t.pos+=u,!0}a(e6,"backtick");function t6(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const i=t.scanDelims(t.pos,!0);let o=i.length;const s=String.fromCharCode(r);if(o<2)return!1;let u;o%2&&(u=t.push("text","",0),u.content=s,o--);for(let l=0;l<o;l+=2)u=t.push("text","",0),u.content=s+s,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return t.pos+=i.length,!0}a(t6,"strikethrough_tokenize");function Zd(t,e){let n;const r=[],i=e.length;for(let o=0;o<i;o++){const s=e[o];if(s.marker!==126||s.end===-1)continue;const u=e[s.end];n=t.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[u.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[u.token-1].type==="text"&&t.tokens[u.token-1].content==="~"&&r.push(u.token-1)}for(;r.length;){const o=r.pop();let s=o+1;for(;s<t.tokens.length&&t.tokens[s].type==="s_close";)s++;s--,o!==s&&(n=t.tokens[s],t.tokens[s]=t.tokens[o],t.tokens[o]=n)}}a(Zd,"postProcess$1");function n6(t){const e=t.tokens_meta,n=t.tokens_meta.length;Zd(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Zd(t,e[r].delimiters)}a(n6,"strikethrough_postProcess");const h0={tokenize:t6,postProcess:n6};function r6(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const i=t.scanDelims(t.pos,r===42);for(let o=0;o<i.length;o++){const s=t.push("text","",0);s.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:i.length,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return t.pos+=i.length,!0}a(r6,"emphasis_tokenize");function Xd(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=e[i.end],s=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===o.token+1,u=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?u+u:u,l.content="";const c=t.tokens[o.token];c.type=s?"strong_close":"em_close",c.tag=s?"strong":"em",c.nesting=-1,c.markup=s?u+u:u,c.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}a(Xd,"postProcess");function i6(t){const e=t.tokens_meta,n=t.tokens_meta.length;Xd(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Xd(t,e[r].delimiters)}a(i6,"emphasis_post_process");const p0={tokenize:r6,postProcess:i6};function o6(t,e){let n,r,i,o,s="",u="",l=t.pos,c=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const d=t.pos,f=t.posMax,h=t.pos+1,p=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(p<0)return!1;let m=p+1;if(m<f&&t.src.charCodeAt(m)===40){for(c=!1,m++;m<f&&(n=t.src.charCodeAt(m),!(!W(n)&&n!==10));m++);if(m>=f)return!1;if(l=m,i=t.md.helpers.parseLinkDestination(t.src,m,t.posMax),i.ok){for(s=t.md.normalizeLink(i.str),t.md.validateLink(s)?m=i.pos:s="",l=m;m<f&&(n=t.src.charCodeAt(m),!(!W(n)&&n!==10));m++);if(i=t.md.helpers.parseLinkTitle(t.src,m,t.posMax),m<f&&l!==m&&i.ok)for(u=i.str,m=i.pos;m<f&&(n=t.src.charCodeAt(m),!(!W(n)&&n!==10));m++);}(m>=f||t.src.charCodeAt(m)!==41)&&(c=!0),m++}if(c){if(typeof t.env.references>"u")return!1;if(m<f&&t.src.charCodeAt(m)===91?(l=m+1,m=t.md.helpers.parseLinkLabel(t,m),m>=0?r=t.src.slice(l,m++):m=p+1):m=p+1,r||(r=t.src.slice(h,p)),o=t.env.references[Ss(r)],!o)return t.pos=d,!1;s=o.href,u=o.title}if(!e){t.pos=h,t.posMax=p;const g=t.push("link_open","a",1),b=[["href",s]];g.attrs=b,u&&b.push(["title",u]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=m,t.posMax=f,!0}a(o6,"link");function s6(t,e){let n,r,i,o,s,u,l,c,d="";const f=t.pos,h=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const p=t.pos+2,m=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(m<0)return!1;if(o=m+1,o<h&&t.src.charCodeAt(o)===40){for(o++;o<h&&(n=t.src.charCodeAt(o),!(!W(n)&&n!==10));o++);if(o>=h)return!1;for(c=o,u=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),u.ok&&(d=t.md.normalizeLink(u.str),t.md.validateLink(d)?o=u.pos:d=""),c=o;o<h&&(n=t.src.charCodeAt(o),!(!W(n)&&n!==10));o++);if(u=t.md.helpers.parseLinkTitle(t.src,o,t.posMax),o<h&&c!==o&&u.ok)for(l=u.str,o=u.pos;o<h&&(n=t.src.charCodeAt(o),!(!W(n)&&n!==10));o++);else l="";if(o>=h||t.src.charCodeAt(o)!==41)return t.pos=f,!1;o++}else{if(typeof t.env.references>"u")return!1;if(o<h&&t.src.charCodeAt(o)===91?(c=o+1,o=t.md.helpers.parseLinkLabel(t,o),o>=0?i=t.src.slice(c,o++):o=m+1):o=m+1,i||(i=t.src.slice(p,m)),s=t.env.references[Ss(i)],!s)return t.pos=f,!1;d=s.href,l=s.title}if(!e){r=t.src.slice(p,m);const g=[];t.md.inline.parse(r,t.md,t.env,g);const b=t.push("image","img",0),y=[["src",d],["alt",""]];b.attrs=y,b.children=g,b.content=r,l&&y.push(["title",l])}return t.pos=o,t.posMax=h,!0}a(s6,"image");const u6=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,l6=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function a6(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=t.src.slice(r+1,n);if(l6.test(o)){const s=t.md.normalizeLink(o);if(!t.md.validateLink(s))return!1;if(!e){const u=t.push("link_open","a",1);u.attrs=[["href",s]],u.markup="autolink",u.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const c=t.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return t.pos+=o.length+2,!0}if(u6.test(o)){const s=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(s))return!1;if(!e){const u=t.push("link_open","a",1);u.attrs=[["href",s]],u.markup="autolink",u.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const c=t.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return t.pos+=o.length+2,!0}return!1}a(a6,"autolink");function c6(t){return/^<a[>\s]/i.test(t)}a(c6,"isLinkOpen");function d6(t){return/^<\/a\s*>/i.test(t)}a(d6,"isLinkClose");function f6(t){const e=t|32;return e>=97&&e<=122}a(f6,"isLetter");function h6(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!f6(i))return!1;const o=t.src.slice(r).match(V3);if(!o)return!1;if(!e){const s=t.push("html_inline","",0);s.content=o[0],c6(s.content)&&t.linkLevel++,d6(s.content)&&t.linkLevel--}return t.pos+=o[0].length,!0}a(h6,"html_inline");const p6=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,m6=/^&([a-z][a-z0-9]{1,31});/i;function g6(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const o=t.src.slice(n).match(p6);if(o){if(!e){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),u=t.push("text_special","",0);u.content=ha(s)?Wo(s):Wo(65533),u.markup=o[0],u.info="entity"}return t.pos+=o[0].length,!0}}else{const o=t.src.slice(n).match(m6);if(o){const s=s0(o[0]);if(s!==o[0]){if(!e){const u=t.push("text_special","",0);u.content=s,u.markup=o[0],u.info="entity"}return t.pos+=o[0].length,!0}}}return!1}a(g6,"entity");function Yd(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;s<n;s++){const u=t[s];if(o.push(0),(t[r].marker!==u.marker||i!==u.token-1)&&(r=s),i=u.token,u.length=u.length||0,!u.close)continue;e.hasOwnProperty(u.marker)||(e[u.marker]=[-1,-1,-1,-1,-1,-1]);const l=e[u.marker][(u.open?3:0)+u.length%3];let c=r-o[r]-1,d=c;for(;c>l;c-=o[c]+1){const f=t[c];if(f.marker===u.marker&&f.open&&f.end<0){let h=!1;if((f.close||u.open)&&(f.length+u.length)%3===0&&(f.length%3!==0||u.length%3!==0)&&(h=!0),!h){const p=c>0&&!t[c-1].open?o[c-1]+1:0;o[s]=s-c+p,o[c]=p,u.open=!1,f.end=s,f.close=!1,d=-1,i=-2;break}}}d!==-1&&(e[u.marker][(u.open?3:0)+(u.length||0)%3]=d)}}a(Yd,"processDelimiters");function b6(t){const e=t.tokens_meta,n=t.tokens_meta.length;Yd(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Yd(e[r].delimiters)}a(b6,"link_pairs");function y6(t){let e,n,r=0;const i=t.tokens,o=t.tokens.length;for(e=n=0;e<o;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,i[e].type==="text"&&e+1<o&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}a(y6,"fragments_join");const iu=[["text",G3],["linkify",X3],["newline",Y3],["escape",Q3],["backticks",e6],["strikethrough",h0.tokenize],["emphasis",p0.tokenize],["link",o6],["image",s6],["autolink",a6],["html_inline",h6],["entity",g6]],ou=[["balance_pairs",b6],["strikethrough",h0.postProcess],["emphasis",p0.postProcess],["fragments_join",y6]];function xi(){this.ruler=new Ce;for(let t=0;t<iu.length;t++)this.ruler.push(iu[t][0],iu[t][1]);this.ruler2=new Ce;for(let t=0;t<ou.length;t++)this.ruler2.push(ou[t][0],ou[t][1])}a(xi,"ParserInline");xi.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,i=t.md.options.maxNesting,o=t.cache;if(typeof o[e]<"u"){t.pos=o[e];return}let s=!1;if(t.level<i){for(let u=0;u<r;u++)if(t.level++,s=n[u](t,!0),t.level--,s){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,o[e]=t.pos};xi.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos<r;){const o=t.pos;let s=!1;if(t.level<i){for(let u=0;u<n;u++)if(s=e[u](t,!1),s){if(o>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};xi.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let u=0;u<s;u++)o[u](i)};xi.prototype.State=yi;function x6(t){const e={};t=t||{},e.src_Any=t0.source,e.src_Cc=n0.source,e.src_Z=i0.source,e.src_P=da.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter="(?:(?!"+n+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+n+"|"+e.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}a(x6,"reFactory");function al(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}a(al,"assign");function As(t){return Object.prototype.toString.call(t)}a(As,"_class");function k6(t){return As(t)==="[object String]"}a(k6,"isString");function w6(t){return As(t)==="[object Object]"}a(w6,"isObject");function C6(t){return As(t)==="[object RegExp]"}a(C6,"isRegExp");function Qd(t){return As(t)==="[object Function]"}a(Qd,"isFunction");function E6(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(E6,"escapeRE");const m0={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function S6(t){return Object.keys(t||{}).reduce(function(e,n){return e||m0.hasOwnProperty(n)},!1)}a(S6,"isOptionsObj");const v6={"http:":{validate:a(function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0},"validate")},"https:":"http:","ftp:":"http:","//":{validate:a(function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0},"validate")},"mailto:":{validate:a(function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0},"validate")}},A6="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",M6="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function T6(t){t.__index__=-1,t.__text_cache__=""}a(T6,"resetScanCache");function D6(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}a(D6,"createValidator");function ef(){return function(t,e){e.normalize(t)}}a(ef,"createNormalizer");function Ko(t){const e=t.re=x6(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(A6),n.push(e.src_xn),e.src_tlds=n.join("|");function r(u){return u.replace("%TLDS%",e.src_tlds)}a(r,"untpl"),e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function o(u,l){throw new Error('(LinkifyIt) Invalid schema "'+u+'": '+l)}a(o,"schemaError"),Object.keys(t.__schemas__).forEach(function(u){const l=t.__schemas__[u];if(l===null)return;const c={validate:null,link:null};if(t.__compiled__[u]=c,w6(l)){C6(l.validate)?c.validate=D6(l.validate):Qd(l.validate)?c.validate=l.validate:o(u,l),Qd(l.normalize)?c.normalize=l.normalize:l.normalize?o(u,l):c.normalize=ef();return}if(k6(l)){i.push(u);return}o(u,l)}),i.forEach(function(u){t.__compiled__[t.__schemas__[u]]&&(t.__compiled__[u].validate=t.__compiled__[t.__schemas__[u]].validate,t.__compiled__[u].normalize=t.__compiled__[t.__schemas__[u]].normalize)}),t.__compiled__[""]={validate:null,normalize:ef()};const s=Object.keys(t.__compiled__).filter(function(u){return u.length>0&&t.__compiled__[u]}).map(E6).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),T6(t)}a(Ko,"compile");function O6(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}a(O6,"Match");function cl(t,e){const n=new O6(t,e);return t.__compiled__[n.schema].normalize(n,t),n}a(cl,"createMatch");function Me(t,e){if(!(this instanceof Me))return new Me(t,e);e||S6(t)&&(e=t,t={}),this.__opts__=al({},m0,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=al({},v6,t),this.__compiled__={},this.__tlds__=M6,this.__tlds_replaced__=!1,this.re={},Ko(this)}a(Me,"LinkifyIt");Me.prototype.add=a(function(e,n){return this.__schemas__[e]=n,Ko(this),this},"add");Me.prototype.set=a(function(e){return this.__opts__=al(this.__opts__,e),this},"set");Me.prototype.test=a(function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,o,s,u,l,c,d;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(o=this.testSchemaAt(e,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=r.index+r[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(d=e.indexOf("@"),d>=0&&(i=e.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,u=i.index+i[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&u>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=u))),this.__index__>=0},"test");Me.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");Me.prototype.testSchemaAt=a(function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0},"testSchemaAt");Me.prototype.match=a(function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(cl(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(cl(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null},"match");Me.prototype.matchAtStart=a(function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,cl(this,0)):null},"matchAtStart");Me.prototype.tlds=a(function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Ko(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Ko(this),this)},"tlds");Me.prototype.normalize=a(function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)},"normalize");Me.prototype.onCompile=a(function(){},"onCompile");const Hn=2147483647,Ze=36,ga=1,ci=26,_6=38,N6=700,g0=72,b0=128,y0="-",I6=/^xn--/,R6=/[^\0-\x7F]/,F6=/[\x2E\u3002\uFF0E\uFF61]/g,L6={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},su=Ze-ga,Xe=Math.floor,uu=String.fromCharCode;function Mt(t){throw new RangeError(L6[t])}a(Mt,"error");function P6(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}a(P6,"map");function x0(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(F6,".");const i=t.split("."),o=P6(i,e).join(".");return r+o}a(x0,"mapDomain");function k0(t){const e=[];let n=0;const r=t.length;for(;n<r;){const i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const o=t.charCodeAt(n++);(o&64512)==56320?e.push(((i&1023)<<10)+(o&1023)+65536):(e.push(i),n--)}else e.push(i)}return e}a(k0,"ucs2decode");const B6=a(t=>String.fromCodePoint(...t),"ucs2encode"),z6=a(function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:Ze},"basicToDigit"),tf=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),w0=a(function(t,e,n){let r=0;for(t=n?Xe(t/N6):t>>1,t+=Xe(t/e);t>su*ci>>1;r+=Ze)t=Xe(t/su);return Xe(r+(su+1)*t/(t+_6))},"adapt"),C0=a(function(t){const e=[],n=t.length;let r=0,i=b0,o=g0,s=t.lastIndexOf(y0);s<0&&(s=0);for(let u=0;u<s;++u)t.charCodeAt(u)>=128&&Mt("not-basic"),e.push(t.charCodeAt(u));for(let u=s>0?s+1:0;u<n;){const l=r;for(let d=1,f=Ze;;f+=Ze){u>=n&&Mt("invalid-input");const h=z6(t.charCodeAt(u++));h>=Ze&&Mt("invalid-input"),h>Xe((Hn-r)/d)&&Mt("overflow"),r+=h*d;const p=f<=o?ga:f>=o+ci?ci:f-o;if(h<p)break;const m=Ze-p;d>Xe(Hn/m)&&Mt("overflow"),d*=m}const c=e.length+1;o=w0(r-l,c,l==0),Xe(r/c)>Hn-i&&Mt("overflow"),i+=Xe(r/c),r%=c,e.splice(r++,0,i)}return String.fromCodePoint(...e)},"decode"),E0=a(function(t){const e=[];t=k0(t);const n=t.length;let r=b0,i=0,o=g0;for(const l of t)l<128&&e.push(uu(l));const s=e.length;let u=s;for(s&&e.push(y0);u<n;){let l=Hn;for(const d of t)d>=r&&d<l&&(l=d);const c=u+1;l-r>Xe((Hn-i)/c)&&Mt("overflow"),i+=(l-r)*c,r=l;for(const d of t)if(d<r&&++i>Hn&&Mt("overflow"),d===r){let f=i;for(let h=Ze;;h+=Ze){const p=h<=o?ga:h>=o+ci?ci:h-o;if(f<p)break;const m=f-p,g=Ze-p;e.push(uu(tf(p+m%g,0))),f=Xe(m/g)}e.push(uu(tf(f,0))),o=w0(i,c,u===s),i=0,++u}++i,++r}return e.join("")},"encode"),$6=a(function(t){return x0(t,function(e){return I6.test(e)?C0(e.slice(4).toLowerCase()):e})},"toUnicode"),H6=a(function(t){return x0(t,function(e){return R6.test(e)?"xn--"+E0(e):e})},"toASCII"),S0={version:"2.3.1",ucs2:{decode:k0,encode:B6},decode:C0,encode:E0,toASCII:H6,toUnicode:$6},V6={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},j6={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},q6={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},U6={default:V6,zero:j6,commonmark:q6},W6=/^(vbscript|javascript|file|data):/,K6=/^data:image\/(gif|png|jpeg|webp);/;function J6(t){const e=t.trim().toLowerCase();return W6.test(e)?K6.test(e):!0}a(J6,"validateLink");const v0=["http:","https:","mailto:"];function G6(t){const e=ca(t,!0);if(e.hostname&&(!e.protocol||v0.indexOf(e.protocol)>=0))try{e.hostname=S0.toASCII(e.hostname)}catch{}return bi(aa(e))}a(G6,"normalizeLink");function Z6(t){const e=ca(t,!0);if(e.hostname&&(!e.protocol||v0.indexOf(e.protocol)>=0))try{e.hostname=S0.toUnicode(e.hostname)}catch{}return yr(aa(e),yr.defaultChars+"%")}a(Z6,"normalizeLinkText");function Ee(t,e){if(!(this instanceof Ee))return new Ee(t,e);e||fa(t)||(e=t||{},t="default"),this.inline=new xi,this.block=new vs,this.core=new pa,this.renderer=new Cr,this.linkify=new Me,this.validateLink=J6,this.normalizeLink=G6,this.normalizeLinkText=Z6,this.utils=Yk,this.helpers=Es({},n3),this.options={},this.configure(t),e&&this.set(e)}a(Ee,"MarkdownIt");Ee.prototype.set=function(t){return Es(this.options,t),this};Ee.prototype.configure=function(t){const e=this;if(fa(t)){const n=t;if(t=U6[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};Ee.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Ee.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Ee.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Ee.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};Ee.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Ee.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Ee.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const X6=new Gr({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:a(t=>({params:t.getAttribute("data-params")||""}),"getAttrs")}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:a(t=>({tight:t.hasAttribute("data-tight")}),"getAttrs")}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:a(t=>t.type.name=="em","clearMark")}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:a(t=>t.style.fontWeight!="normal"&&null,"getAttrs")},{style:"font-weight=400",clearMark:a(t=>t.type.name=="strong","clearMark")},{style:"font-weight",getAttrs:a(t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null,"getAttrs")}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Y6(t,e){if(t.isText&&e.isText&&z.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}a(Y6,"maybeMerge");const Ya=class Ya{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:z.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,i=r[r.length-1],o=this.schema.text(e,n.marks),s;i&&(s=Y6(i,o))?r[r.length-1]=s:r.push(o)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n<e.length;n++){let r=e[n],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,e,n)}}addNode(e,n,r){let i=this.top(),o=e.createAndFill(n,r,i?i.marks:[]);return o?(this.push(o),o):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:z.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}};a(Ya,"MarkdownParseState");let dl=Ya;function Ar(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}a(Ar,"attrs");function lu(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}a(lu,"noCloseToken");function nf(t){return t[t.length-1]==`
|
|
156
|
-
`?t.slice(0,t.length-1):t}a(nf,"withoutTrailingNewline");function au(){}a(au,"noOp");function Q6(t,e){let n=Object.create(null);for(let r in e){let i=e[r];if(i.block){let o=t.nodeType(i.block);lu(i,r)?n[r]=(s,u,l,c)=>{s.openNode(o,Ar(i,u,l,c)),s.addText(nf(u.content)),s.closeNode()}:(n[r+"_open"]=(s,u,l,c)=>s.openNode(o,Ar(i,u,l,c)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=t.nodeType(i.node);n[r]=(s,u,l,c)=>s.addNode(o,Ar(i,u,l,c))}else if(i.mark){let o=t.marks[i.mark];lu(i,r)?n[r]=(s,u,l,c)=>{s.openMark(o.create(Ar(i,u,l,c))),s.addText(nf(u.content)),s.closeMark(o)}:(n[r+"_open"]=(s,u,l,c)=>s.openMark(o.create(Ar(i,u,l,c))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)lu(i,r)?n[r]=au:(n[r+"_open"]=au,n[r+"_close"]=au);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}a(Q6,"tokenHandlers");var er;let ew=(er=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=Q6(e,r)}parse(e,n={}){let r=new dl(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}},a(er,"MarkdownParser"),er);function rf(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}a(rf,"listIsTight");new ew(X6,Ee("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:a((t,e,n)=>({tight:rf(e,n)}),"getAttrs")},ordered_list:{block:"ordered_list",getAttrs:a((t,e,n)=>({order:+t.attrGet("start")||1,tight:rf(e,n)}),"getAttrs")},heading:{block:"heading",getAttrs:a(t=>({level:+t.tag.slice(1)}),"getAttrs")},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:a(t=>({params:t.info||""}),"getAttrs"),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:a(t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null}),"getAttrs")},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:a(t=>({href:t.attrGet("href"),title:t.attrGet("title")||null}),"getAttrs")},code_inline:{mark:"code",noCloseToken:!0}});const tw={open:"",close:"",mixable:!0};var tr;let nw=(tr=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new A0(this.nodes,this.marks,n);return r.renderContent(e),r.out}},a(tr,"MarkdownSerializer"),tr);const st=new nw({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
|
|
157
|
-
`),t.text(e.textContent,!1),t.write(`
|
|
158
|
-
`),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){let n=e.attrs.order||1,r=String(n+e.childCount-1).length,i=t.repeat(" ",r+2);t.renderList(e,i,o=>{let s=String(n+o);return t.repeat(" ",r-s.length)+s+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(`\\
|
|
159
|
-
`);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=rw(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:i}=t;return t.inAutolink=void 0,i?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return of(n.child(r),-1)},close(t,e,n,r){return of(n.child(r-1),1)},escape:!1}});function of(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let o=i>0&&e>0?" `":"`";for(let s=0;s<i;s++)o+="`";return i>0&&e<0&&(o+=" "),o}a(of,"backticksFor");function rw(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}a(rw,"isPlainURL");var nr;let A0=(nr=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
|
|
160
|
-
`),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<e;i++)this.out+=n+`
|
|
161
|
-
`}this.closed=null}}getMark(e){let n=this.marks[e];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${e}\` not supported by Markdown renderer`);n=tw}return n}wrapBlock(e,n,r,i){let o=this.delim;this.write(n??e),this.delim+=e,i(),this.delim=o,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
|
|
162
|
-
`)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,n=!0){let r=e.split(`
|
|
163
|
-
`);for(let i=0;i<r.length;i++)this.write(),!n&&r[i][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[i],this.atBlockStart):r[i],i!=r.length-1&&(this.out+=`
|
|
164
|
-
`)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,i)=>this.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",o=a((s,u,l)=>{let c=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(c=c.filter(g=>{if(l+1==e.childCount)return!1;let b=e.child(l+1);return g.isInSet(b.marks)&&(!b.isText||/\S/.test(b.text))}));let d=i;if(i="",s&&s.isText&&c.some(g=>{let b=this.getMark(g.type.name);return b&&b.expelEnclosingWhitespace&&!g.isInSet(r)})){let[g,b,y]=/^(\s*)(.*)$/m.exec(s.text);b&&(d+=b,s=y?s.withText(y):null,s||(c=r))}if(s&&s.isText&&c.some(g=>{let b=this.getMark(g.type.name);return b&&b.expelEnclosingWhitespace&&(l==e.childCount-1||!g.isInSet(e.child(l+1).marks))})){let[g,b,y]=/^(.*?)(\s*)$/m.exec(s.text);y&&(i=y,s=b?s.withText(b):null,s||(c=r))}let f=c.length?c[c.length-1]:null,h=f&&this.getMark(f.type.name).escape===!1,p=c.length-(h?1:0);e:for(let g=0;g<p;g++){let b=c[g];if(!this.getMark(b.type.name).mixable)break;for(let y=0;y<r.length;y++){let x=r[y];if(!this.getMark(x.type.name).mixable)break;if(b.eq(x)){g>y?c=c.slice(0,y).concat(b).concat(c.slice(y,g)).concat(c.slice(g+1,p)):y>g&&(c=c.slice(0,g).concat(c.slice(g+1,y)).concat(b).concat(c.slice(y,p)));continue e}}}let m=0;for(;m<Math.min(r.length,p)&&c[m].eq(r[m]);)++m;for(;m<r.length;)this.text(this.markString(r.pop(),!1,e,l),!1);if(d&&this.text(d),s){for(;r.length<p;){let g=c[r.length];r.push(g),this.text(this.markString(g,!0,e,l),!1),this.atBlockStart=!1}h&&s.isText?this.text(this.markString(f,!0,e,l)+s.text+this.markString(f,!1,e,l+1),!1):this.render(s,e,l),this.atBlockStart=!1}s?.isText&&s.nodeSize>0&&(this.atBlockStart=!1)},"progress");e.forEach(o),o(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,e.forEach((s,u,l)=>{l&&i&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(s,e,l))}),this.inTightList=o}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<e.length&&e[i-1].match(/\w/)&&e[i+1].match(/\w/)?r:"\\"+r),n&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let i=0;i<n;i++)r+=e;return r}markString(e,n,r,i){let o=this.getMark(e.type.name),s=n?o.open:o.close;return typeof s=="string"?s:s(this,e,r,i)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}},a(nr,"MarkdownSerializerState"),nr);var cu,sf;function iw(){if(sf)return cu;sf=1;var t=!0,e=!1,n=!1;cu=a(function(g,b){b&&(t=!b.enabled,e=!!b.label,n=!!b.labelAfter),g.core.ruler.after("inline","github-task-lists",function(y){for(var x=y.tokens,k=2;k<x.length;k++)o(x,k)&&(s(x[k],y.Token),r(x[k-2],"class","task-list-item"+(t?"":" enabled")),r(x[i(x,k-2)],"class","contains-task-list"))})},"markdownItTaskLists");function r(g,b,y){var x=g.attrIndex(b),k=[b,y];x<0?g.attrPush(k):g.attrs[x]=k}a(r,"attrSet");function i(g,b){for(var y=g[b].level-1,x=b-1;x>=0;x--)if(g[x].level===y)return x;return-1}a(i,"parentToken");function o(g,b){return f(g[b])&&h(g[b-1])&&p(g[b-2])&&m(g[b])}a(o,"isTodoItem");function s(g,b){if(g.children.unshift(u(g,b)),g.children[1].content=g.children[1].content.slice(3),g.content=g.content.slice(3),e)if(n){g.children.pop();var y="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);g.children[0].content=g.children[0].content.slice(0,-1)+' id="'+y+'">',g.children.push(d(g.content,y,b))}else g.children.unshift(l(b)),g.children.push(c(b))}a(s,"todoify");function u(g,b){var y=new b("html_inline","",0),x=t?' disabled="" ':"";return g.content.indexOf("[ ] ")===0?y.content='<input class="task-list-item-checkbox"'+x+'type="checkbox">':(g.content.indexOf("[x] ")===0||g.content.indexOf("[X] ")===0)&&(y.content='<input class="task-list-item-checkbox" checked=""'+x+'type="checkbox">'),y}a(u,"makeCheckbox");function l(g){var b=new g("html_inline","",0);return b.content="<label>",b}a(l,"beginLabel");function c(g){var b=new g("html_inline","",0);return b.content="</label>",b}a(c,"endLabel");function d(g,b,y){var x=new y("html_inline","",0);return x.content='<label class="task-list-item-label" for="'+b+'">'+g+"</label>",x.attrs=[{for:b}],x}a(d,"afterLabel");function f(g){return g.type==="inline"}a(f,"isInline");function h(g){return g.type==="paragraph_open"}a(h,"isParagraph");function p(g){return g.type==="list_item_open"}a(p,"isListItem");function m(g){return g.content.indexOf("[ ] ")===0||g.content.indexOf("[x] ")===0||g.content.indexOf("[X] ")===0}return a(m,"startsWithTodoMarkdown"),cu}a(iw,"requireMarkdownItTaskLists");var ow=iw();const sw=F0.getDefaultExportFromCjs(ow);var uw=Object.defineProperty,lw=a((t,e,n)=>e in t?uw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,"__defNormalProp"),Jo=a((t,e,n)=>(lw(t,typeof e!="symbol"?e+"":e,n),n),"__publicField");const aw=J.create({name:"markdownTightLists",addOptions:a(()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),"addOptions"),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:a(t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),"parseHTML"),renderHTML:a(t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null}),"renderHTML")}}}]},addCommands(){var t=this;return{toggleTight:a(function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function o(s){if(!r.isActive(s))return!1;const u=r.getAttributes(s);return i.updateAttributes(s,{tight:e??!(u!=null&&u.tight)})}return a(o,"toggleTight"),t.options.listTypes.some(s=>o(s))}},"toggleTight")}}}),uf=Ee();function M0(t,e){return uf.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new uf.inline.State(t,null,null,[]).scanDelims(e,!0)}a(M0,"scanDelims");function T0(t,e,n,r){let i=t.substring(0,n)+t.substring(n+e.length);return i=i.substring(0,n+r)+e+i.substring(n+r),i}a(T0,"shiftDelim");function cw(t,e,n,r){let i=n,o=t;for(;i<r&&!M0(o,i).can_open;)o=T0(o,e,i,1),i++;return{text:o,from:i,to:r}}a(cw,"trimStart");function dw(t,e,n,r){let i=r,o=t;for(;i>n&&!M0(o,i).can_close;)o=T0(o,e,i,-1),i--;return{text:o,from:n,to:i}}a(dw,"trimEnd");function fw(t,e,n,r){let i={text:t,from:n,to:r};return i=cw(i.text,e,i.from,i.to),i=dw(i.text,e,i.from,i.to),i.to-i.from<e.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+e.length)),i.text}a(fw,"trimInline");const Qa=class Qa extends A0{constructor(e,n,r){super(e,n,r??{}),Jo(this,"inTable",!1),this.inlines=[]}render(e,n,r){super.render(e,n,r);const i=this.inlines[this.inlines.length-1];if(i!=null&&i.start&&i!==null&&i!==void 0&&i.end){const{delimiter:o,start:s,end:u}=this.normalizeInline(i);this.out=fw(this.out,o,s,u),this.inlines.pop()}}markString(e,n,r,i){const o=this.marks[e.type.name];if(o.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:o.open});else{const s=this.inlines.pop();this.inlines.push({...s,end:this.out.length})}return super.markString(e,n,r,i)}normalizeInline(e){let{start:n,end:r}=e;for(;this.out.charAt(n).match(/\s/);)n++;return{...e,start:n}}};a(Qa,"MarkdownSerializerState");let fl=Qa;const D0=Te.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=lf(e))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${e.type.name}" mark is only available in html mode`),"")},close(t,e){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=lf(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function lf(t){const e=t.type.schema,n=e.text(" ",[t]),i=pi(M.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}a(lf,"getMarkTags");function ba(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}a(ba,"elementFromString");function hw(t){return t?.replace(/</g,"<").replace(/>/g,">")}a(hw,"escapeHTML");function pw(t){const e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}a(pw,"extractElement");function mw(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}a(mw,"unwrapElement");const Ms=j.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(gw(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function gw(t,e){const n=t.type.schema,r=pi(M.from(t),n);return t.isBlock&&(e instanceof M||e.type.name===n.topNodeType.name)?bw(r):r}a(gw,"serializeHTML");function bw(t){const n=ba(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
|
|
165
|
-
${n.innerHTML}
|
|
166
|
-
`:`
|
|
167
|
-
`,n.outerHTML}a(bw,"formatBlock");const yw=j.create({name:"blockquote"}),xw=yw.extend({addStorage(){return{markdown:{serialize:st.nodes.blockquote,parse:{}}}}}),kw=j.create({name:"bulletList"}),O0=kw.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),ww=j.create({name:"codeBlock"}),Cw=ww.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
|
|
168
|
-
`),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),Ew=j.create({name:"hardBreak"}),_0=Ew.extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(t.inTable?Ms.storage.markdown.serialize.call(this,t,e,n):`\\
|
|
169
|
-
`);return}},parse:{}}}}}),Sw=j.create({name:"heading"}),vw=Sw.extend({addStorage(){return{markdown:{serialize:st.nodes.heading,parse:{}}}}}),Aw=j.create({name:"horizontalRule"}),Mw=Aw.extend({addStorage(){return{markdown:{serialize:st.nodes.horizontal_rule,parse:{}}}}}),Tw=j.create({name:"image"}),Dw=Tw.extend({addStorage(){return{markdown:{serialize:st.nodes.image,parse:{}}}}}),Ow=j.create({name:"listItem"}),_w=Ow.extend({addStorage(){return{markdown:{serialize:st.nodes.list_item,parse:{}}}}}),Nw=j.create({name:"orderedList"});function Iw(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}a(Iw,"findIndexOfAdjacentNode");const Rw=Nw.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const i=e.attrs.start||1,o=String(i+e.childCount-1).length,s=t.repeat(" ",o+2),l=Iw(e,n,r)%2?") ":". ";t.renderList(e,s,c=>{const d=String(i+c);return t.repeat(" ",o-d.length)+d+l})},parse:{}}}}}),Fw=j.create({name:"paragraph"}),Lw=Fw.extend({addStorage(){return{markdown:{serialize:st.nodes.paragraph,parse:{}}}}});function du(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}a(du,"childNodes");const Pw=j.create({name:"table"}),Bw=Pw.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!zw(e)){Ms.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,i,o)=>{if(t.write("| "),r.forEach((s,u,l)=>{l&&t.write(" | ");const c=s.firstChild;c.textContent.trim()&&t.renderInline(c)}),t.write(" |"),t.ensureNewLine(),!o){const s=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${s} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function af(t){return t.attrs.colspan>1||t.attrs.rowspan>1}a(af,"hasSpan");function zw(t){const e=du(t),n=e[0],r=e.slice(1);return!(du(n).some(i=>i.type.name!=="tableHeader"||af(i)||i.childCount>1)||r.some(i=>du(i).some(o=>o.type.name==="tableHeader"||af(o)||o.childCount>1)))}a(zw,"isMarkdownSerializable");const $w=j.create({name:"taskItem"}),Hw=$w.extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),Vw=j.create({name:"taskList"}),jw=Vw.extend({addStorage(){return{markdown:{serialize:O0.storage.markdown.serialize,parse:{setup(t){t.use(sw)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),qw=j.create({name:"text"}),Uw=qw.extend({addStorage(){return{markdown:{serialize(t,e){t.text(hw(e.text))},parse:{}}}}}),Ww=Te.create({name:"bold"}),Kw=Ww.extend({addStorage(){return{markdown:{serialize:st.marks.strong,parse:{}}}}}),Jw=Te.create({name:"code"}),Gw=Jw.extend({addStorage(){return{markdown:{serialize:st.marks.code,parse:{}}}}}),Zw=Te.create({name:"italic"}),Xw=Zw.extend({addStorage(){return{markdown:{serialize:st.marks.em,parse:{}}}}}),Yw=Te.create({name:"link"}),Qw=Yw.extend({addStorage(){return{markdown:{serialize:st.marks.link,parse:{}}}}}),eC=Te.create({name:"strike"}),tC=eC.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),nC=[xw,O0,Cw,_0,vw,Mw,Ms,Dw,_w,Rw,Lw,Bw,Hw,jw,Uw,Kw,Gw,D0,Xw,Qw,tC];function Go(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,i=(n=nC.find(o=>o.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}a(Go,"getMarkdownSpec");const ec=class ec{constructor(e){Jo(this,"editor",null),this.editor=e}serialize(e){const n=new fl(this.nodes,this.marks,{hardBreakNodeName:_0.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Ms)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(D0)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=Go(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=Go(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}};a(ec,"MarkdownSerializer");let hl=ec;const tc=class tc{constructor(e,n){Jo(this,"editor",null),Jo(this,"md",null);let{html:r,linkify:i,breaks:o}=n;this.editor=e,this.md=this.withPatchedRenderer(Ee({html:r,linkify:i,breaks:o}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=Go(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.setup)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},this.md)});const r=this.md.render(e),i=ba(r);return this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=Go(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.updateDOM)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},i)}),this.normalizeDOM(i,{inline:n,content:e}),i.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:i}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(o=>{var s;((s=o.nextSibling)===null||s===void 0?void 0:s.nodeType)===Node.TEXT_NODE&&!o.closest("pre")&&(o.nextSibling.textContent=o.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,i),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var o;return(o=i.spec.parseDOM)===null||o===void 0?void 0:o.map(s=>s.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&pw(i)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,o,s,u;const l=e.firstElementChild,{nextElementSibling:c}=l,d=(i=(o=n.match(/^\s+/))===null||o===void 0?void 0:o[0])!==null&&i!==void 0?i:"",f=c?"":(s=(u=n.match(/\s+$/))===null||u===void 0?void 0:u[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){l.innerHTML=`${l.innerHTML}${f}`;return}mw(l),e.innerHTML=`${d}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=a(r=>function(){const i=r(...arguments);return i===`
|
|
170
|
-
`?i:i[i.length-1]===`
|
|
171
|
-
`?i.slice(0,-1):i},"withoutNewLine");return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}};a(tc,"MarkdownParser");let pl=tc;const rC=J.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new V({key:new q("markdownClipboard"),props:{clipboardTextParser:a((t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return Pt.fromSchema(this.editor.schema).parseSlice(ba(r),{preserveWhitespace:!0,context:e})},"clipboardTextParser"),clipboardTextSerializer:a(t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null,"clipboardTextSerializer")}})]}}),iC=J.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=Uh.Commands.config.addCommands();return{setContent:a((e,n)=>r=>t.setContent(r.editor.storage.markdown.parser.parse(e),n)(r),"setContent"),insertContentAt:a((e,n,r)=>i=>t.insertContentAt(e,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i),"insertContentAt")}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new pl(this.editor,this.options),serializer:new hl(this.editor),getMarkdown:a(()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc),"getMarkdown")},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[aw.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),rC.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});var oC=Qy,sC=Object.defineProperty,uC=Object.getOwnPropertyDescriptor,Er=a((t,e,n,r)=>{for(var i=r>1?void 0:r?uC(e,n):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(r?s(e,n,i):s(i))||i);return r&&i&&sC(e,n,i),i},"__decorateClass"),rr;let Jt=(rr=class extends R0.FieldComponentUnoCss{outputFormat="markdown";defaultButtonsTheme="pink";activeButtonsTheme="purple";placeholder="";components={EditorContent:ox,BubbleMenu:ck,VSTButton:Vt.VSTButton,VSTStringField:Vt.VSTStringField,NoSymbolIcon:L0.render};editor=void 0;isEditable=!0;showMenu=!0;vstTextId="";showLinkModal=!1;linkUrl="";beforeMount(){this.vstTextId=`vst-text-field-${this.VST.generateRandomKey()}`}mounted(){this.value=this.modelValue||this.inputValue||"",this.editor=new ix({extensions:[rx,oC.configure({placeholder:this.placeholder?this.placeholder:"Введите текст"}),fp.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"}),iC.configure({html:!0,breaks:!0,linkify:!0,transformPastedText:!0,transformCopiedText:this.outputFormat==="markdown"})],content:this.value})}getValue(){return this.outputFormat==="markdown"?this.editor.storage.markdown.getMarkdown():this.editor.getHTML()}addLink(){this.editor.chain().focus().setLink({href:this.linkUrl}).run(),this.showLinkModal=!1,this.linkUrl=""}beforeUnmount(){}getListVirtualElement(){const e=this.editor,n=hi(r=>r.type.name==="bulletList"||r.type.name==="orderedList")(e.state.selection);if(n){const r=Hl(e.view,n.start,n.start+n.node.nodeSize);return{getBoundingClientRect:a(()=>r,"getBoundingClientRect"),getClientRects:a(()=>[r],"getClientRects")}}return null}toggleListType(){const e=this.editor,n=e.chain().focus();e.isActive("bulletList")?n.toggleOrderedList():n.toggleBulletList(),n.run()}_isEditableWatch(e){this.editor.setEditable(e)}},a(rr,"TextField"),rr);Er([Vt.Prop(String)],Jt.prototype,"outputFormat",2);Er([Vt.Prop(String)],Jt.prototype,"defaultButtonsTheme",2);Er([Vt.Prop(String)],Jt.prototype,"activeButtonsTheme",2);Er([Vt.Prop(String)],Jt.prototype,"placeholder",2);Er([Vt.Watch("isEditable")],Jt.prototype,"_isEditableWatch",1);Jt=Er([Vt.VST],Jt);const lC=["id"],aC={class:"bubble-menu"};function cC(t,e,n,r,i,o){const s=E.resolveComponent("VSTButton"),u=E.resolveComponent("BubbleMenu"),l=E.resolveComponent("EditorContent"),c=E.resolveComponent("NoSymbolIcon"),d=E.resolveComponent("VSTStringField");return E.openBlock(),E.createElementBlock("div",{class:"vst-field-editor container relative",id:t.vstTextId},[t.editor&&t.showMenu?(E.openBlock(),E.createBlock(u,{key:0,class:"bubble-menu",editor:t.editor,options:{placement:"bottom",offset:8}},{default:E.withCtx(()=>[E.createElementVNode("div",aC,[E.createVNode(s,{theme:t.editor.isActive("bold")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[0]||(e[0]=f=>t.editor.chain().focus().toggleBold().run())},{default:E.withCtx(()=>[E.createElementVNode("div",{class:E.normalizeClass(["h18px mt-0",{"fw-bold":t.editor.isActive("bold")}])},"B",2)]),_:1},8,["theme"]),E.createVNode(s,{theme:t.editor.isActive("italic")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[1]||(e[1]=f=>t.editor.chain().focus().toggleItalic().run())},{default:E.withCtx(()=>[E.createElementVNode("div",{class:E.normalizeClass(["h18px mt-0",{italic:t.editor.isActive("italic")}])},"I",2)]),_:1},8,["theme"]),E.createVNode(s,{theme:t.editor.isActive("underline")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[2]||(e[2]=f=>t.editor.chain().focus().toggleUnderline().run())},{default:E.withCtx(()=>[E.createElementVNode("div",{class:E.normalizeClass(["h18px mt-0",{underline:t.editor.isActive("underline")}])},"U",2)]),_:1},8,["theme"]),E.createVNode(s,{onClick:e[3]||(e[3]=f=>t.showLinkModal=!0)},{default:E.withCtx(()=>[...e[13]||(e[13]=[E.createTextVNode("Link",-1)])]),_:1}),E.createVNode(s,{class:"p-0",theme:t.editor.isActive("strike")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[4]||(e[4]=f=>t.editor.chain().focus().toggleStrike().run())},{default:E.withCtx(()=>[E.createElementVNode("div",{class:E.normalizeClass(["h18px mt-0",{italic:t.editor.isActive("strike")}]),style:E.normalizeStyle({textDecoration:t.editor.isActive("strike")?"line-through":void 0,textDecorationColor:t.editor.isActive("strike")?"#fff":void 0})},"S",6)]),_:1},8,["theme"]),E.createVNode(s,{theme:t.editor.isActive("bulletList")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[5]||(e[5]=f=>t.editor.chain().focus().toggleBulletList().run()),class:E.normalizeClass({"fw-bold!":t.editor.isActive("bulletList")})},{default:E.withCtx(()=>[...e[14]||(e[14]=[E.createElementVNode("svg",{class:"icon icon-tabler icons-tabler-outline icon-tabler-list fs-1rem",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[E.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),E.createElementVNode("path",{d:"M9 6l11 0"}),E.createElementVNode("path",{d:"M9 12l11 0"}),E.createElementVNode("path",{d:"M9 18l11 0"}),E.createElementVNode("path",{d:"M5 6l0 .01"}),E.createElementVNode("path",{d:"M5 12l0 .01"}),E.createElementVNode("path",{d:"M5 18l0 .01"})],-1)])]),_:1},8,["theme","class"]),E.createVNode(s,{theme:t.editor.isActive("orderedList")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[6]||(e[6]=f=>t.editor.chain().focus().toggleOrderedList().run()),class:E.normalizeClass({"fw-bold!":t.editor.isActive("orderedList"),"text-white! fill-white! stroke-white!":!0})},{default:E.withCtx(()=>[...e[15]||(e[15]=[E.createElementVNode("svg",{class:"icon icon-tabler icons-tabler-outline icon-tabler-list-numbers fs-1rem",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[E.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),E.createElementVNode("path",{d:"M11 6h9",stroke:"currentColor",fill:"none"}),E.createElementVNode("path",{d:"M11 12h9",stroke:"currentColor",fill:"none"}),E.createElementVNode("path",{d:"M12 18h8",stroke:"currentColor",fill:"none"}),E.createElementVNode("path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4",stroke:"currentColor",fill:"none"}),E.createElementVNode("path",{d:"M6 10v-6l-2 2",stroke:"currentColor",fill:"none"})],-1)])]),_:1},8,["theme","class"]),E.createVNode(s,{onClick:e[7]||(e[7]=f=>t.editor.chain().focus().toggleHeading({level:1}).run()),class:E.normalizeClass({"is-active":t.editor.isActive("heading",{level:1})})},{default:E.withCtx(()=>[...e[16]||(e[16]=[E.createTextVNode("H1",-1)])]),_:1},8,["class"]),E.createVNode(s,{onClick:e[8]||(e[8]=f=>t.editor.chain().focus().toggleHeading({level:2}).run()),class:E.normalizeClass({"is-active":t.editor.isActive("heading",{level:2})})},{default:E.withCtx(()=>[...e[17]||(e[17]=[E.createTextVNode("H2",-1)])]),_:1},8,["class"])])]),_:1},8,["editor"])):E.createCommentVNode("",!0),E.createVNode(l,{editor:t.editor},null,8,["editor"]),!t.disabled&&t.value?(E.openBlock(),E.createElementBlock("div",{key:1,class:E.normalizeClass(["w25px h25px text-stone absolute t-10px r-12px z4 cursor-pointer hover:scale-130",{}])},[E.createVNode(c,{onClick:e[9]||(e[9]=f=>t._onInput(""))})])):E.createCommentVNode("",!0),t.showLinkModal?(E.openBlock(),E.createElementBlock("div",{key:2,onClose:e[12]||(e[12]=f=>t.showLinkModal=!1)},[E.withDirectives(E.createElementVNode("input",{"onUpdate:modelValue":e[10]||(e[10]=f=>t.linkUrl=f),placeholder:"URL"},null,512),[[E.vModelText,t.linkUrl]]),E.createElementVNode("button",{onClick:e[11]||(e[11]=(...f)=>t.addLink&&t.addLink(...f))},"Вставить ссылку")],32)):E.createCommentVNode("",!0),(E.openBlock(),E.createBlock(E.resolveDynamicComponent("style"))),E.createElementVNode("div",null,[E.createVNode(d,{inputValue:"Для ссылок, например"})])],8,lC)}a(cC,"render");const dC=P0._export_sfc(Jt,[["render",cC]]);exports.default=dC;
|